From 9c93dc5037a78db3050e2254324ab3846fa7a339 Mon Sep 17 00:00:00 2001 From: mkeller <7525285+keller-mark@users.noreply.github.com> Date: Mon, 29 Aug 2022 12:19:52 -0400 Subject: [PATCH 1/2] Add polyfill --- .Rbuildignore | 2 ++ .envrc | 1 + .nvmrc | 1 + inst/htmlwidgets/lib/index.js | 9 +++++++++ package.json | 1 + 5 files changed, 14 insertions(+) create mode 100644 .envrc create mode 100644 .nvmrc diff --git a/.Rbuildignore b/.Rbuildignore index 4281824..b8cd9d6 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,6 +3,8 @@ ^\.Rproj\.user$ ^\.travis\.yml$ ^\.BBSoptions$ +^\.envrc$ +^\.nvmrc$ ^.github$ ^package\.json$ ^package-lock\.json$ diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3269fc5 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use nvm \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..d1c51cd --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v16.14.2 \ No newline at end of file diff --git a/inst/htmlwidgets/lib/index.js b/inst/htmlwidgets/lib/index.js index 9f4b0d0..50352ed 100644 --- a/inst/htmlwidgets/lib/index.js +++ b/inst/htmlwidgets/lib/index.js @@ -1,9 +1,18 @@ import React from 'react'; import ReactDOM from 'react-dom'; import { Vitessce } from 'vitessce'; +import allSettled from 'promise.allsettled'; import 'vitessce/dist/es/production/static/css/index.css'; import './index.css'; +if((new URLSearchParams(window.location.search)).get("viewer_pane") === "1") { + // This Vitessce instance is currently running in the Viewer pane of RStudio. + // The built-in browser does not support all modern JavaScript features used by Vitessce. + // Click the 'Show in new window' button to run in a standalone web browser if the polyfill does not work. + console.log("Detected running in the RStudio Viewer pane which does not implement Promise.allSettled. Using polyfill."); + allSettled.shim(); +} + export function render_vitessce(el, config, width, height, theme) { ReactDOM.render( Date: Mon, 29 Aug 2022 12:28:35 -0400 Subject: [PATCH 2/2] Run npm install and npm run build --- inst/htmlwidgets/dist/index.js | 132 +- inst/htmlwidgets/dist/index.js.map | 2 +- package-lock.json | 15769 +++++++++++++++++++++++++-- 3 files changed, 14769 insertions(+), 1134 deletions(-) diff --git a/inst/htmlwidgets/dist/index.js b/inst/htmlwidgets/dist/index.js index ff7e5d3..cd20deb 100644 --- a/inst/htmlwidgets/dist/index.js +++ b/inst/htmlwidgets/dist/index.js @@ -1,4 +1,4 @@ -var globalThis = window; !function webpackUniversalModuleDefinition(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n,r=t();for(n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(window,function(){return n=[function(e,t,n){"use strict";e.exports=n(686)},function(n,e,t){"use strict";function accessor(e,t,n){return e.fields=t||[],e.fname=n,e}function accessorName(e){return null==e?null:e.fname}function accessorFields(e){return null==e?null:e.fields}function getter(e){return 1===e.length?C(e[0]):m(e)}t.d(e,"a",function(){return A}),t.d(e,"b",function(){return o}),t.d(e,"c",function(){return s}),t.d(e,"d",function(){return i}),t.d(e,"e",function(){return a}),t.d(e,"f",function(){return accessor}),t.d(e,"g",function(){return accessorFields}),t.d(e,"h",function(){return accessorName}),t.d(e,"i",function(){return array}),t.d(e,"j",function(){return f}),t.d(e,"k",function(){return clampRange}),t.d(e,"l",function(){return compare}),t.d(e,"m",function(){return constant}),t.d(e,"n",function(){return debounce}),t.d(e,"o",function(){return error}),t.d(e,"p",function(){return extend}),t.d(e,"q",function(){return extent}),t.d(e,"r",function(){return extentIndex}),t.d(e,"s",function(){return E}),t.d(e,"t",function(){return fastmap}),t.d(e,"u",function(){return field}),t.d(e,"v",function(){return flush}),t.d(e,"w",function(){return has}),t.d(e,"x",function(){return y}),t.d(e,"y",function(){return r}),t.d(e,"z",function(){return inherits}),t.d(e,"A",function(){return inrange}),t.d(e,"B",function(){return l}),t.d(e,"C",function(){return isBoolean}),t.d(e,"D",function(){return isDate}),t.d(e,"E",function(){return isFunction}),t.d(e,"F",function(){return isIterable}),t.d(e,"G",function(){return isNumber}),t.d(e,"H",function(){return isObject}),t.d(e,"I",function(){return isRegExp}),t.d(e,"J",function(){return isString}),t.d(e,"K",function(){return key}),t.d(e,"L",function(){return lerp}),t.d(e,"M",function(){return logger}),t.d(e,"N",function(){return lruCache}),t.d(e,"O",function(){return merge}),t.d(e,"P",function(){return mergeConfig}),t.d(e,"Q",function(){return b}),t.d(e,"R",function(){return pad}),t.d(e,"S",function(){return panLinear}),t.d(e,"T",function(){return panLog}),t.d(e,"U",function(){return panPow}),t.d(e,"V",function(){return panSymlog}),t.d(e,"W",function(){return peek}),t.d(e,"X",function(){return quarter}),t.d(e,"Y",function(){return repeat}),t.d(e,"Z",function(){return span}),t.d(e,"ab",function(){return splitAccessPath}),t.d(e,"bb",function(){return $}),t.d(e,"cb",function(){return toBoolean}),t.d(e,"db",function(){return toDate}),t.d(e,"eb",function(){return toNumber}),t.d(e,"fb",function(){return toSet}),t.d(e,"gb",function(){return toString}),t.d(e,"hb",function(){return truncate}),t.d(e,"ib",function(){return v}),t.d(e,"jb",function(){return utcquarter}),t.d(e,"kb",function(){return visitArray}),t.d(e,"lb",function(){return writeConfig}),t.d(e,"mb",function(){return B}),t.d(e,"nb",function(){return zoomLinear}),t.d(e,"ob",function(){return zoomLog}),t.d(e,"pb",function(){return zoomPow}),t.d(e,"qb",function(){return zoomSymlog});const C=t=>function(e){return e[t]},m=n=>{const r=n.length;return function(t){for(let e=0;ea&&push(),i=a=s+1):"]"===A&&(i||error("Access path missing open bracket: "+e),0a?push():a=s+1);return i&&error("Access path missing closing bracket: "+e),r&&error("Access path missing closing quote: "+e),s>a&&(s++,push()),t}function field(e,t,n){var r=splitAccessPath(e);return e=1===r.length?r[0]:e,accessor((n&&n.get||getter)(r),[e],t||e)}const y=field("id"),r=accessor(e=>e,[],"identity"),B=accessor(()=>0,[],"zero"),b=accessor(()=>1,[],"one"),v=accessor(()=>!0,[],"true"),E=accessor(()=>!1,[],"false");const i=0,o=1,a=2,s=3,A=4;function logger(e,t,n=function log$1(e,t,n){t=[t].concat([].slice.call(n)),console[e].apply(console,t)}){let r=e||i;return{level(e){return arguments.length?(r=+e,this):r},error(){return r>=o&&n(t||"error","ERROR",arguments),this},warn(){return r>=a&&n(t||"warn","WARN",arguments),this},info(){return r>=s&&n(t||"log","INFO",arguments),this},debug(){return r>=A&&n(t||"log","DEBUG",arguments),this}}}var l=Array.isArray;function isObject(e){return e===Object(e)}const c=e=>"__proto__"!==e;function mergeConfig(...e){return e.reduce((e,t)=>{for(const r in t){var n;"signals"===r?e.signals=function mergeNamed(e,t){if(null==e)return t;const n={},r=[];function add(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(add),e.forEach(add),r}(e.signals,t.signals):(n="legend"===r?{layout:1}:"style"===r||null,writeConfig(e,r,t[r],n))}return e},{})}function writeConfig(n,r,i,o){if(c(r)){let e,t;if(isObject(i)&&!l(i))for(e in t=isObject(n[r])?n[r]:n[r]={},i)o&&(!0===o||o[e])?writeConfig(t,e,i[e]):c(e)&&(t[e]=i[e]);else n[r]=i}}function peek(e){return e[e.length-1]}function toNumber(e){return null==e||""===e?null:+e}const g=t=>e=>t*Math.exp(e),u=t=>e=>Math.log(t*e),d=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),h=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,p=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function pan(e,t,n,r){var i=n(e[0]),n=n(peek(e)),e=(n-i)*t;return[r(i-e),r(n-e)]}function panLinear(e,t){return pan(e,t,toNumber,r)}function panLog(e,t){var n=Math.sign(e[0]);return pan(e,t,u(n),g(n))}function panPow(e,t,n){return pan(e,t,p(n),p(1/n))}function panSymlog(e,t,n){return pan(e,t,d(n),h(n))}function zoom(e,t,n,r,i){var o=r(e[0]),e=r(peek(e)),r=null!=t?r(t):(o+e)/2;return[i(r+(o-r)*n),i(r+(e-r)*n)]}function zoomLinear(e,t,n){return zoom(e,t,n,toNumber,r)}function zoomLog(e,t,n){var r=Math.sign(e[0]);return zoom(e,t,n,u(r),g(r))}function zoomPow(e,t,n,r){return zoom(e,t,n,p(r),p(1/r))}function zoomSymlog(e,t,n,r){return zoom(e,t,n,d(r),h(r))}function quarter(e){return 1+~~(new Date(e).getMonth()/3)}function utcquarter(e){return 1+~~(new Date(e).getUTCMonth()/3)}function array(e){return null!=e?l(e)?e:[e]:[]}function clampRange(e,t,n){let r=e[0],i=e[1],o;return i=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-o),r+o]}function isFunction(e){return"function"==typeof e}const Q="descending";function compare(e,n,r){r=r||{},n=array(n)||[];const i=[],o=[],a={},t=r.comparator||w;return array(e).forEach((e,t)=>{null!=e&&(i.push(n[t]===Q?-1:1),o.push(e=isFunction(e)?e:field(e,null,r)),(accessorFields(e)||[]).forEach(e=>a[e]=1))}),0===o.length?null:accessor(t(o,i),Object.keys(a))}const f=(e,t)=>(e1===e.length?S(e[0],t[0]):_(e,t,e.length),S=(n,r)=>function(e,t){return f(n(e),n(t))*r},_=(o,a,s)=>(a.push(0),function(e,t){let n,r=0,i=-1;for(;0===r&&++ie}function debounce(t,n){let r;return e=>{r&&clearTimeout(r),r=setTimeout(()=>(n(e),r=null),t)}}function extend(i){for(let e,t,n=1,r=arguments.length;na&&(a=i))}else{for(i=t(e[n]);na&&(a=i))}return[o,a]}function extentIndex(e,t){var n=e.length;let r=-1,i,o,a,s,A;if(null==t){for(;++r=o){i=a=o;break}if(r===n)return[-1,-1];for(s=A=r;++ro&&(i=o,s=r),a=o){i=a=o;break}if(r===n)return[-1,-1];for(s=A=r;++ro&&(i=o,s=r),a{a.set(e,t[e])}),a}function flush(e,t,n,r,i,o){if(!n&&0!==n)return o;n=+n;let a=e[0],s=peek(e),A;so&&(a=i,i=o,o=a),r=void 0===r||r,((n=void 0===n||n)?i<=e:ie.replace(/\\(.)/g,"$1")):array(e)))&&e.length,i=n&&n.get||getter,o=e=>i(t?[e]:splitAccessPath(e));let a;if(r)if(1===r){const s=o(e[0]);a=function(e){return""+s(e)}}else{const A=e.map(o);a=function(e){let t=""+A[0](e),n=0;for(;++n{r={},i={},o=0};const a=(e,t)=>(++o>n&&(i=r,r={},o=1),r[e]=t);return e(),{clear:e,has:e=>has(r,e)||has(i,e),get:e=>has(r,e)?r[e]:has(i,e)?a(e,i[e]):void 0,set:(e,t)=>has(r,e)?r[e]=t:a(e,t)}}function merge(e,t,n,r){var i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,A=0,l=0;for(;sisNumber(e)||isDate(e)?e:Date.parse(e);function toDate(e,t){return t=t||F,null==e||""===e?null:t(e)}function toString(e){return null==e||""===e?null:e+""}function toSet(t){const n={},r=t.length;for(let e=0;er=e.statusMessage||r,{webgl1:o=!0,webgl2:a=!0}=(e.addEventListener("webglcontextcreationerror",i,!1),t);let s=null;a&&(s=(s=s||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t));o&&(s=(s=s||e.getContext("webgl",t))||e.getContext("experimental-webgl",t));if(e.removeEventListener("webglcontextcreationerror",i,!1),!s)return n(`Failed to create ${a&&!o?"WebGL2":"WebGL"} context: `+(r||"Unknown error"));t.onContextLost&&e.addEventListener("webglcontextlost",t.onContextLost,!1);t.onContextRestored&&e.addEventListener("webglcontextrestored",t.onContextRestored,!1);return s}(function getCanvas({canvas:e,width:t=800,height:n=600,onError:r}){let i;"string"==typeof e?(c&&"complete"===document.readyState||r(`createGLContext called on canvas '${e}' before page was loaded`),i=document.getElementById(e)):e?i=e:((i=document.createElement("canvas")).id="lumagl-canvas",i.style.width=Number.isFinite(t)?t+"px":"100%",i.style.height=Number.isFinite(n)?n+"px":"100%",document.body.insertBefore(i,document.body.firstChild));return i}({canvas:r,width:e,height:n,onError:onError}),t))?(function logInfo(e){var t=Object(i.e)(e)?"WebGL2":"WebGL1",n=function getContextDebugInfo(e){var t=e.getParameter(7936),n=e.getParameter(7937),r=e.getExtension("WEBGL_debug_renderer_info"),i=r&&e.getParameter(r.UNMASKED_VENDOR_WEBGL||7936),r=r&&e.getParameter(r.UNMASKED_RENDERER_WEBGL||7937);return{vendor:i||t,renderer:r||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}(e),n=n?`(${n.vendor},${n.renderer})`:"",e=e.debug?" debug":"";s.info(1,t+e+" context "+n)()}(r=instrumentGLContext(r,t)),r):null}function instrumentGLContext(e,t={}){if(!e||e._instrumented)return e;e._version=e._version||function getVersion(e){if("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext)return 2;return 1}(e),e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};var{manageState:n,debug:r}=t=Object.assign({},g,t);return n&&Object(o.c)(e,{copyState:!1,log:(...e)=>s.log(1,...e)()}),l&&r&&(a.global.makeDebugContext?(e=a.global.makeDebugContext(e,t),s.level=Math.max(s.level,1)):s.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),e._instrumented=!0,e}function resizeGLContext(e,t={}){if(e.canvas)!function setDevicePixelRatio(e,t,n){let r="width"in n?n.width:e.canvas.clientWidth,i="height"in n?n.height:e.canvas.clientHeight;r&&i||(s.log(1,"Canvas clientWidth/clientHeight is 0")(),t=1,r=e.canvas.width||1,i=e.canvas.height||1);e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};n=e.luma.canvasSizeInfo;{var o,a;n.clientWidth===r&&n.clientHeight===i&&n.devicePixelRatio===t||(n=t,o=Math.floor(r*n),a=Math.floor(i*n),e.canvas.width=o,e.canvas.height=a,e.drawingBufferWidth===o&&e.drawingBufferHeight===a||(s.warn("Device pixel ratio clamped")(),n=Math.min(e.drawingBufferWidth/r,e.drawingBufferHeight/i),e.canvas.width=Math.floor(r*n),e.canvas.height=Math.floor(i*n)),Object.assign(e.luma.canvasSizeInfo,{clientWidth:r,clientHeight:i,devicePixelRatio:t}))}}(e,function getDevicePixelRatio(e){var t="undefined"!=typeof window&&window.devicePixelRatio||1;return Number.isFinite(e)?e<=0?1:e:e?t:1}(t.useDevicePixels),t);else{const n=e.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in t&&"height"in t&&n.resize(t.width,t.height)}}},function(e,t,n){"use strict";n.r(t),t.default=function(){for(var e,t=0,n="";te*o,t)}function degrees(e,t){return map(e,e=>e*i,t)}function sin(e){return map(e,e=>Math.sin(e))}function cos(e){return map(e,e=>Math.cos(e))}function tan(e){return map(e,e=>Math.tan(e))}function asin(e){return map(e,e=>Math.asin(e))}function acos(e){return map(e,e=>Math.acos(e))}function atan(e){return map(e,e=>Math.atan(e))}function clamp(e,t,n){return map(e,e=>Math.max(t,Math.min(n,e)))}function lerp(e,n,r){return isArray(e)?e.map((e,t)=>lerp(e,n[t],r)):r*n+(1-r)*e}function equals(t,n,e){var r=a.EPSILON;e&&(a.EPSILON=e);try{if(t===n)return!0;if(isArray(t)&&isArray(n)){if(t.length!==n.length)return!1;for(let e=0;ethis._renderPass(t,e))}delete(){this.model.delete(),this.model=null}_renderPass(e,{inputBuffer:t}){Object(M.a)(e,{color:!0}),this.model.draw({moduleSettings:this.props.moduleSettings,uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}var U=t(475);class post_process_effect_PostProcessEffect extends s.a{constructor(e,t={}){super(t),this.id="".concat(e.name,"-pass"),Object(U.b)(e),this.module=e}postRender(e,t){this.passes||(this.passes=function createPasses(n,r,i,o){{var e;if(r.filter||r.sampler)return e=getFragmentShaderForRenderPass(r),[new screen_pass_ScreenPass(n,{id:i,module:r,fs:e,moduleSettings:o})]}const t=r.passes||[];return t.map((e,t)=>{e=getFragmentShaderForRenderPass(r,e),t="".concat(i,"-").concat(t);return new screen_pass_ScreenPass(n,{id:t,module:r,fs:e,moduleSettings:o})})}(e,this.module,this.id,this.props));var n=t["target"];let r=t.inputBuffer,i=t.swapBuffer;for(let e=0;e"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"),L=e=>"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 getFragmentShaderForRenderPass(e,t=e){var n;return t.filter?(n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor"),O(n)):t.sampler?(n="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor"),L(n)):null}var P=t(171),V=t(600),Z=t(341),W=t(336),H=t(335),j=t(450),Y=t(344),l=t(76),z=t(233),d=t(12),c=t(29),g=t(51);const h=Math.PI/180,u=180/Math.PI,p=6370972;class globe_viewport_GlobeViewport extends l.a{constructor(e={}){var{latitude:t=0,longitude:n=0,zoom:r=11,nearZMultiplier:i=.1,farZMultiplier:o=2,resolution:a=10}=e,{width:s,height:A,altitude:l=1.5}=e,s=s||1,A=A||1,l=Math.max(.75,l);const c=(new d.Matrix4).lookAt({eye:[0,-l,0],up:[0,0,1]});var g=Math.pow(2,r),u=(c.rotateX(t*h),c.rotateZ(-n*h),c.scale(g/A),Math.atan(.5/l)),g=512*g/A;super({...e,width:s,height:A,viewMatrix:c,longitude:n,latitude:t,zoom:r,fovyRadians:2*u,aspect:s/A,focalDistance:l,near:i,far:Math.min(2,1/g+1)*l*o}),this.resolution=a,this.distanceScales=function getDistanceScales(){var e=256/p,t=Math.PI/180*256;return{unitsPerMeter:[e,e,e],unitsPerMeter2:[0,0,0],metersPerUnit:[1/e,1/e,1/e],unitsPerDegree:[t,t,e],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/t,1/t,1/e]}}()}get projectionMode(){return i.c.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(e={}){e={targetZ:e.z||0};const t=this.unproject([0,this.height/2],e);var n=this.unproject([this.width/2,0],e);const r=this.unproject([this.width,this.height/2],e);e=this.unproject([this.width/2,this.height],e);return r[0]this.longitude&&(t[0]-=360),[Math.min(t[0],r[0],n[0],e[0]),Math.min(t[1],r[1],n[1],e[1]),Math.max(t[0],r[0],n[0],e[0]),Math.max(t[1],r[1],n[1],e[1])]}unproject(e,{topLeft:t=!0,targetZ:n}={}){var r,i,[e,o,a]=e,t=t?o:this.height-o,o=this["pixelUnprojectionMatrix"];let s;s=Number.isFinite(a)?transformVector(o,[e,t,a,1]):(r=transformVector(o,[e,t,-1,1]),o=transformVector(o,[e,t,1,1]),e=256*((n||0)/p+1),t=c.p(c.q([],r,o)),A=4*((4*(i=c.p(r))*(A=c.p(o))-(t-i-A)**2)/16)/t,i=(Math.sqrt(i-A)-Math.sqrt(Math.max(0,e*e-A)))/Math.sqrt(t),c.i([],r,o,i));var[e,A,t]=this.unprojectPosition(s);return Number.isFinite(a)?[e,A,t]:Number.isFinite(n)?[e,A,n]:[e,A]}projectPosition(e){var[e,t,n=0]=e,e=e*h,t=t*h,r=Math.cos(t),n=256*(n/p+1);return[Math.sin(e)*r*n,-Math.cos(e)*r*n,Math.sin(t)*n]}unprojectPosition(e){var[t,n,r]=e,e=c.g(e),r=Math.asin(r/e);return[Math.atan2(t,-n)*u,r*u,(e/256-1)*p]}projectFlat(e){return e}unprojectFlat(e){return e}panByPosition(e,t){t=this.unproject(t);return{longitude:e[0]-t[0]+this.longitude,latitude:e[1]-t[1]+this.latitude}}}function transformVector(e,t){t=g.n([],t,e);return g.k(t,t,1/t[3]),t}var J=t(499),K=t(196),X=t(498),f=t(1163),q=t(247),I=t(112),$=t(333),C=t(36),m=t(111),e=t(246),y=t(64);const B={position:[0,0,0],pitch:0,bearing:0,maxPitch:90,minPitch:-90};class first_person_controller_FirstPersonState extends e.a{constructor({width:e,height:t,position:n=B.position,bearing:r=B.bearing,pitch:i=B.pitch,longitude:o,latitude:a,maxPitch:s=B.maxPitch,minPitch:A=B.minPitch,startRotatePos:l,startBearing:c,startPitch:g,startZoomPosition:u,startZoom:d}){super({width:e,height:t,position:n,bearing:r,pitch:i,longitude:o,latitude:a,maxPitch:s,minPitch:A}),this._state={startRotatePos:l,startBearing:c,startPitch:g,startZoomPosition:u,startZoom:d}}getDirection(e=!1){const t=new d._SphericalCoordinates({bearing:this._viewportProps.bearing,pitch:e?90:90+this._viewportProps.pitch});return t.toVector3().normalize()}panStart(){return this}pan(){return this}panEnd(){return this}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){var{startRotatePos:r,startBearing:i,startPitch:o}=this._state,{width:a,height:s}=this._viewportProps;if(!r||!Number.isFinite(i)||!Number.isFinite(o))return this;let A;return A=e?{bearing:i-180*((e[0]-r[0])/a),pitch:o-90*((e[1]-r[1])/s)}:{bearing:i-t,pitch:o-n},this._getUpdatedState(A)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this._viewportProps.position,startZoom:this._viewportProps.zoom})}zoom({scale:e}){let t=this._state["startZoomPosition"];t=t||this._viewportProps.position;var n=this.getDirection();return this._move(n,20*Math.log2(e),t)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}moveLeft(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:Math.PI/2}),e)}moveRight(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:-Math.PI/2}),e)}moveUp(e=20){var t=this.getDirection(!0);return this._move(t,e)}moveDown(e=20){const t=this.getDirection(!0);return this._move(t.negate(),e)}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}zoomIn(e=2){return this.zoom({scale:e})}zoomOut(e=2){return this.zoom({scale:1/e})}shortestPathFrom(e){e=e.getViewportProps();const t={...this._viewportProps};var{bearing:n,longitude:r}=t;return 180r.a.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}),{WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0}),a={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(e,t,n){var r=n(396);e.exports=function isEqual(e,t){return r(e,t)}},function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"f",function(){return s}),n.d(t,"d",function(){return A}),n.d(t,"g",function(){return l});const r=1e3,i=60*r,o=60*i,a=24*o,s=7*a,A=30*a,l=365*a},function(e,t,n){"use strict";!function checkDCE(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}(),e.exports=n(687)},function(e,t,n){"use strict";n.d(t,"a",function(){return capitalize});var r=n(659);function capitalize(e){if("string"!=typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";n.d(t,"q",function(){return transpose}),n.d(t,"f",function(){return invert}),n.d(t,"a",function(){return determinant}),n.d(t,"h",function(){return multiply}),n.d(t,"p",function(){return translate}),n.d(t,"o",function(){return scale}),n.d(t,"k",function(){return rotate}),n.d(t,"l",function(){return rotateX}),n.d(t,"m",function(){return rotateY}),n.d(t,"n",function(){return rotateZ}),n.d(t,"e",function(){return getScaling}),n.d(t,"c",function(){return fromQuat}),n.d(t,"d",function(){return frustum}),n.d(t,"j",function(){return perspective}),n.d(t,"i",function(){return ortho}),n.d(t,"g",function(){return lookAt}),n.d(t,"b",function(){return equals});var D=n(17);function transpose(e,t){var n,r,i,o,a,s;return e===t?(n=t[1],r=t[2],i=t[3],o=t[6],a=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]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s):(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]),e}function invert(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],A=t[6],l=t[7],c=t[8],g=t[9],u=t[10],d=t[11],h=t[12],p=t[13],f=t[14],t=t[15],I=n*s-r*a,C=n*A-i*a,m=n*l-o*a,y=r*A-i*s,B=r*l-o*s,b=i*l-o*A,v=c*p-g*h,E=c*f-u*h,Q=c*t-d*h,w=g*f-u*p,S=g*t-d*p,_=u*t-d*f,x=I*_-C*S+m*w+y*Q-B*E+b*v;return x?(e[0]=(s*_-A*S+l*w)*(x=1/x),e[1]=(i*S-r*_-o*w)*x,e[2]=(p*b-f*B+t*y)*x,e[3]=(u*B-g*b-d*y)*x,e[4]=(A*Q-a*_-l*E)*x,e[5]=(n*_-i*Q+o*E)*x,e[6]=(f*m-h*b-t*C)*x,e[7]=(c*b-u*m+d*C)*x,e[8]=(a*S-s*Q+l*v)*x,e[9]=(r*Q-n*S-o*v)*x,e[10]=(h*B-p*m+t*I)*x,e[11]=(g*m-c*B-d*I)*x,e[12]=(s*E-a*w-A*v)*x,e[13]=(n*w-r*E+i*v)*x,e[14]=(p*C-h*y-f*I)*x,e[15]=(c*y-g*C+u*I)*x,e):null}function determinant(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],A=e[7],l=e[8],c=e[9],g=e[10],u=e[11],d=e[12],h=e[13],p=e[14],e=e[15];return(t*a-n*o)*(g*e-u*p)-(t*s-r*o)*(c*e-u*h)+(t*A-i*o)*(c*p-g*h)+(n*s-r*a)*(l*e-u*d)-(n*A-i*a)*(l*p-g*d)+(r*A-i*s)*(l*h-c*d)}function multiply(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],A=t[5],l=t[6],c=t[7],g=t[8],u=t[9],d=t[10],h=t[11],p=t[12],f=t[13],I=t[14],t=t[15],C=n[0],m=n[1],y=n[2],B=n[3];return e[0]=C*r+m*s+y*g+B*p,e[1]=C*i+m*A+y*u+B*f,e[2]=C*o+m*l+y*d+B*I,e[3]=C*a+m*c+y*h+B*t,C=n[4],m=n[5],y=n[6],B=n[7],e[4]=C*r+m*s+y*g+B*p,e[5]=C*i+m*A+y*u+B*f,e[6]=C*o+m*l+y*d+B*I,e[7]=C*a+m*c+y*h+B*t,C=n[8],m=n[9],y=n[10],B=n[11],e[8]=C*r+m*s+y*g+B*p,e[9]=C*i+m*A+y*u+B*f,e[10]=C*o+m*l+y*d+B*I,e[11]=C*a+m*c+y*h+B*t,C=n[12],m=n[13],y=n[14],B=n[15],e[12]=C*r+m*s+y*g+B*p,e[13]=C*i+m*A+y*u+B*f,e[14]=C*o+m*l+y*d+B*I,e[15]=C*a+m*c+y*h+B*t,e}function translate(e,t,n){var r,i,o,a,s,A,l,c,g,u,d,h,p=n[0],f=n[1],n=n[2];return t===e?(e[12]=t[0]*p+t[4]*f+t[8]*n+t[12],e[13]=t[1]*p+t[5]*f+t[9]*n+t[13],e[14]=t[2]*p+t[6]*f+t[10]*n+t[14],e[15]=t[3]*p+t[7]*f+t[11]*n+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],A=t[5],l=t[6],c=t[7],g=t[8],u=t[9],d=t[10],h=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=A,e[6]=l,e[7]=c,e[8]=g,e[9]=u,e[10]=d,e[11]=h,e[12]=r*p+s*f+g*n+t[12],e[13]=i*p+A*f+u*n+t[13],e[14]=o*p+l*f+d*n+t[14],e[15]=a*p+c*f+h*n+t[15]),e}function scale(e,t,n){var r=n[0],i=n[1],n=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function rotate(e,t,n,r){var i,o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E=r[0],Q=r[1],r=r[2],w=Math.hypot(E,Q,r);return w(e[t]=1+n,e),{});function timeUnits(e){const t=Object(I.i)(e).slice(),n={};return t.length||Object(I.o)("Missing time unit."),t.forEach(e=>{Object(I.w)(A,e)?n[e]=1:Object(I.o)("Invalid time unit: ".concat(e,"."))}),1<(n[B]||n[v]?1:0)+(n[m]||n[y]||n[b]?1:0)+(n[E]?1:0)&&Object(I.o)("Incompatible time units: ".concat(e)),t.sort((e,t)=>A[e]-A[t]),t}const O={[C]:"%Y ",[m]:"Q%q ",[y]:"%b ",[b]:"%d ",[B]:"W%U ",[v]:"%a ",[E]:"%j ",[Q]:"%H:00",[w]:"00:%M",[S]:":%S",[_]:".%L",["".concat(C,"-").concat(y)]:"%Y-%m ",["".concat(C,"-").concat(y,"-").concat(b)]:"%Y-%m-%d ",["".concat(Q,"-").concat(w)]:"%H:%M"};function timeUnitSpecifier(e,t){const n=Object(I.p)({},O,t),r=timeUnits(e),i=r.length;let o="",a=0,s,A;for(a=0;aa;--s)if(null!=n[A=r.slice(a,s).join("-")]){o+=n[A],a=s;break}return o.trim()}const l=new Date;function localYear(e){return l.setFullYear(e),l.setMonth(0),l.setDate(1),l.setHours(0,0,0,0),l}function dayofyear(e){return localDayOfYear(new Date(e))}function week(e){return localWeekNum(new Date(e))}function localDayOfYear(e){return n.a.count(localYear(e.getFullYear())-1,e)}function localWeekNum(e){return r.b.count(localYear(e.getFullYear())-1,e)}function localFirst(e){return localYear(e).getDay()}function localDate(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function utcdayofyear(e){return utcDayOfYear(new Date(e))}function utcweek(e){return utcWeekNum(new Date(e))}function utcDayOfYear(e){var t=Date.UTC(e.getUTCFullYear(),0,1);return i.a.count(t-1,e)}function utcWeekNum(e){var t=Date.UTC(e.getUTCFullYear(),0,1);return o.b.count(t-1,e)}function utcFirst(e){return l.setTime(Date.UTC(e,0,1)),l.getUTCDay()}function utcDate(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(Date.UTC(-1,t,n,r,i,o,a));return s.setUTCFullYear(n.y),s}return new Date(Date.UTC(e,t,n,r,i,o,a))}function floor(e,t,r,i,n){const o=t||1,a=Object(I.W)(e),s=(e,t,n)=>function getUnit(n,r,i,o){const a=i<=1?n:o?(e,t)=>o+i*Math.floor((n(e,t)-o)/i):(e,t)=>i*Math.floor(n(e,t)/i);return r?(e,t)=>r(a(e,t),t):a}(r[n=n||e],i[n],e===a&&o,t),A=new Date,l=Object(I.fb)(e),c=l[C]?s(C):Object(I.m)(2012),g=l[y]?s(y):l[m]?s(m):I.mb,u=l[B]&&l[v]?s(v,1,B+v):l[B]?s(B,1):l[v]?s(v,1):l[b]?s(b,1):l[E]?s(E,1):I.Q,d=l[Q]?s(Q):I.mb,h=l[w]?s(w):I.mb,p=l[S]?s(S):I.mb,f=l[_]?s(_):I.mb;return function(e){A.setTime(+e);e=c(A);return n(e,g(A),u(A,e),d(A),h(A),p(A),f(A))}}function weekday(e,t,n){return t+7*e-(n+6)%7}const L={[C]:e=>e.getFullYear(),[m]:e=>Math.floor(e.getMonth()/3),[y]:e=>e.getMonth(),[b]:e=>e.getDate(),[Q]:e=>e.getHours(),[w]:e=>e.getMinutes(),[S]:e=>e.getSeconds(),[_]:e=>e.getMilliseconds(),[E]:e=>localDayOfYear(e),[B]:e=>localWeekNum(e),[B+v]:(e,t)=>weekday(localWeekNum(e),e.getDay(),localFirst(t)),[v]:(e,t)=>weekday(1,e.getDay(),localFirst(t))},P={[m]:e=>3*e,[B]:(e,t)=>0+7*e-(localFirst(t)+6)%7};function timeFloor(e,t){return floor(e,t||1,L,P,localDate)}const V={[C]:e=>e.getUTCFullYear(),[m]:e=>Math.floor(e.getUTCMonth()/3),[y]:e=>e.getUTCMonth(),[b]:e=>e.getUTCDate(),[Q]:e=>e.getUTCHours(),[w]:e=>e.getUTCMinutes(),[S]:e=>e.getUTCSeconds(),[_]:e=>e.getUTCMilliseconds(),[E]:e=>utcDayOfYear(e),[B]:e=>utcWeekNum(e),[v]:(e,t)=>weekday(1,e.getUTCDay(),utcFirst(t)),[B+v]:(e,t)=>weekday(utcWeekNum(e),e.getUTCDay(),utcFirst(t))},Z={[m]:e=>3*e,[B]:(e,t)=>0+7*e-(utcFirst(t)+6)%7};function utcFloor(e,t){return floor(e,t||1,V,Z,utcDate)}const W={[C]:e.a,[m]:a.a.every(3),[y]:a.a,[B]:r.b,[b]:n.a,[v]:n.a,[E]:n.a,[Q]:x.a,[w]:R.a,[S]:s.a,[_]:F.a},H={[C]:D.a,[m]:G.a.every(3),[y]:G.a,[B]:o.b,[b]:i.a,[v]:i.a,[E]:i.a,[Q]:N.a,[w]:k.a,[S]:s.a,[_]:F.a};function timeInterval(e){return W[e]}function utcInterval(e){return H[e]}function offset(e,t,n){return e?e.offset(t,n):void 0}function timeOffset(e,t,n){return offset(timeInterval(e),t,n)}function utcOffset(e,t,n){return offset(utcInterval(e),t,n)}function sequence(e,t,n,r){return e?e.range(t,n,r):void 0}function timeSequence(e,t,n,r){return sequence(timeInterval(e),t,n,r)}function utcSequence(e,t,n,r){return sequence(utcInterval(e),t,n,r)}const c=36e5,j=864e5,g=365*j,Y=[C,y,b,Q,w,S,_],u=Y.slice(0,-1),d=u.slice(0,-1),h=d.slice(0,-1),z=h.slice(0,-1),J=[C,B],K=[C,y],X=[C],p=[[u,1,1e3],[u,5,5e3],[u,15,15e3],[u,30,3e4],[d,1,6e4],[d,5,3e5],[d,15,9e5],[d,30,18e5],[h,1,c],[h,3,3*c],[h,6,6*c],[h,12,432e5],[z,1,j],[J,1,6048e5],[K,1,2592e6],[K,3,7776e6],[X,1,g]];function bin(e){var t=e.extent,e=e.maxbins||40,n=Math.abs(Object(I.Z)(t))/e;let r=Object(T.a)(e=>e[2]).right(p,n),i,o;return o=r===p.length?(i=X,Object(M.c)(t[0]/g,t[1]/g,e)):r?(r=p[n/p[r-1][2]l?(n=s,t=1,a):o+(a-o)*(i/l),-2!==i&&i!==l+2||(r=0,t=0),n-=s/2;for(let e=0;el?0:S*p,v[Q+B[1]]=i<0?-1:i>l?1:f,v[Q+B[2]]=i<0||i>l?0:_*p,E[w+0]=e/A,E[w+1]=t,w+=2,Q+=3}}for(let t=0;t{const o={};return(e,t)=>{var n=((e*=3)<(t*=3)?e:t)+"|"+(tB}const s=new Float32Array(3*e),A=new Float32Array(3*e),l=new Float32Array(2*e),t=65535function(e){return e[t]},m=n=>{const r=n.length;return function(t){for(let e=0;ea&&push(),i=a=s+1):"]"===A&&(i||error("Access path missing open bracket: "+e),0a?push():a=s+1);return i&&error("Access path missing closing bracket: "+e),r&&error("Access path missing closing quote: "+e),s>a&&(s++,push()),t}function field(e,t,n){var r=splitAccessPath(e);return e=1===r.length?r[0]:e,accessor((n&&n.get||getter)(r),[e],t||e)}const y=field("id"),r=accessor(e=>e,[],"identity"),B=accessor(()=>0,[],"zero"),b=accessor(()=>1,[],"one"),v=accessor(()=>!0,[],"true"),E=accessor(()=>!1,[],"false");const i=0,o=1,a=2,s=3,A=4;function logger(e,t,n=function log$1(e,t,n){t=[t].concat([].slice.call(n)),console[e].apply(console,t)}){let r=e||i;return{level(e){return arguments.length?(r=+e,this):r},error(){return r>=o&&n(t||"error","ERROR",arguments),this},warn(){return r>=a&&n(t||"warn","WARN",arguments),this},info(){return r>=s&&n(t||"log","INFO",arguments),this},debug(){return r>=A&&n(t||"log","DEBUG",arguments),this}}}var l=Array.isArray;function isObject(e){return e===Object(e)}const c=e=>"__proto__"!==e;function mergeConfig(...e){return e.reduce((e,t)=>{for(const r in t){var n;"signals"===r?e.signals=function mergeNamed(e,t){if(null==e)return t;const n={},r=[];function add(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(add),e.forEach(add),r}(e.signals,t.signals):(n="legend"===r?{layout:1}:"style"===r||null,writeConfig(e,r,t[r],n))}return e},{})}function writeConfig(n,r,i,o){if(c(r)){let e,t;if(isObject(i)&&!l(i))for(e in t=isObject(n[r])?n[r]:n[r]={},i)o&&(!0===o||o[e])?writeConfig(t,e,i[e]):c(e)&&(t[e]=i[e]);else n[r]=i}}function peek(e){return e[e.length-1]}function toNumber(e){return null==e||""===e?null:+e}const g=t=>e=>t*Math.exp(e),u=t=>e=>Math.log(t*e),d=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),h=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t,p=t=>e=>e<0?-Math.pow(-e,t):Math.pow(e,t);function pan(e,t,n,r){var i=n(e[0]),n=n(peek(e)),e=(n-i)*t;return[r(i-e),r(n-e)]}function panLinear(e,t){return pan(e,t,toNumber,r)}function panLog(e,t){var n=Math.sign(e[0]);return pan(e,t,u(n),g(n))}function panPow(e,t,n){return pan(e,t,p(n),p(1/n))}function panSymlog(e,t,n){return pan(e,t,d(n),h(n))}function zoom(e,t,n,r,i){var o=r(e[0]),e=r(peek(e)),r=null!=t?r(t):(o+e)/2;return[i(r+(o-r)*n),i(r+(e-r)*n)]}function zoomLinear(e,t,n){return zoom(e,t,n,toNumber,r)}function zoomLog(e,t,n){var r=Math.sign(e[0]);return zoom(e,t,n,u(r),g(r))}function zoomPow(e,t,n,r){return zoom(e,t,n,p(r),p(1/r))}function zoomSymlog(e,t,n,r){return zoom(e,t,n,d(r),h(r))}function quarter(e){return 1+~~(new Date(e).getMonth()/3)}function utcquarter(e){return 1+~~(new Date(e).getUTCMonth()/3)}function array(e){return null!=e?l(e)?e:[e]:[]}function clampRange(e,t,n){let r=e[0],i=e[1],o;return i=n-t?[t,n]:[r=Math.min(Math.max(r,t),n-o),r+o]}function isFunction(e){return"function"==typeof e}const Q="descending";function compare(e,n,r){r=r||{},n=array(n)||[];const i=[],o=[],a={},t=r.comparator||w;return array(e).forEach((e,t)=>{null!=e&&(i.push(n[t]===Q?-1:1),o.push(e=isFunction(e)?e:field(e,null,r)),(accessorFields(e)||[]).forEach(e=>a[e]=1))}),0===o.length?null:accessor(t(o,i),Object.keys(a))}const f=(e,t)=>(e1===e.length?S(e[0],t[0]):_(e,t,e.length),S=(n,r)=>function(e,t){return f(n(e),n(t))*r},_=(o,a,s)=>(a.push(0),function(e,t){let n,r=0,i=-1;for(;0===r&&++ie}function debounce(t,n){let r;return e=>{r&&clearTimeout(r),r=setTimeout(()=>(n(e),r=null),t)}}function extend(i){for(let e,t,n=1,r=arguments.length;na&&(a=i))}else{for(i=t(e[n]);na&&(a=i))}return[o,a]}function extentIndex(e,t){var n=e.length;let r=-1,i,o,a,s,A;if(null==t){for(;++r=o){i=a=o;break}if(r===n)return[-1,-1];for(s=A=r;++ro&&(i=o,s=r),a=o){i=a=o;break}if(r===n)return[-1,-1];for(s=A=r;++ro&&(i=o,s=r),a{a.set(e,t[e])}),a}function flush(e,t,n,r,i,o){if(!n&&0!==n)return o;n=+n;let a=e[0],s=peek(e),A;so&&(a=i,i=o,o=a),r=void 0===r||r,((n=void 0===n||n)?i<=e:ie.replace(/\\(.)/g,"$1")):array(e)))&&e.length,i=n&&n.get||getter,o=e=>i(t?[e]:splitAccessPath(e));let a;if(r)if(1===r){const s=o(e[0]);a=function(e){return""+s(e)}}else{const A=e.map(o);a=function(e){let t=""+A[0](e),n=0;for(;++n{r={},i={},o=0};const a=(e,t)=>(++o>n&&(i=r,r={},o=1),r[e]=t);return e(),{clear:e,has:e=>has(r,e)||has(i,e),get:e=>has(r,e)?r[e]:has(i,e)?a(e,i[e]):void 0,set:(e,t)=>has(r,e)?r[e]=t:a(e,t)}}function merge(e,t,n,r){var i=t.length,o=n.length;if(!o)return t;if(!i)return n;const a=r||new t.constructor(i+o);let s=0,A=0,l=0;for(;sisNumber(e)||isDate(e)?e:Date.parse(e);function toDate(e,t){return t=t||F,null==e||""===e?null:t(e)}function toString(e){return null==e||""===e?null:e+""}function toSet(t){const n={},r=t.length;for(let e=0;er=e.statusMessage||r,{webgl1:o=!0,webgl2:a=!0}=(e.addEventListener("webglcontextcreationerror",i,!1),t);let s=null;a&&(s=(s=s||e.getContext("webgl2",t))||e.getContext("experimental-webgl2",t));o&&(s=(s=s||e.getContext("webgl",t))||e.getContext("experimental-webgl",t));if(e.removeEventListener("webglcontextcreationerror",i,!1),!s)return n(`Failed to create ${a&&!o?"WebGL2":"WebGL"} context: `+(r||"Unknown error"));t.onContextLost&&e.addEventListener("webglcontextlost",t.onContextLost,!1);t.onContextRestored&&e.addEventListener("webglcontextrestored",t.onContextRestored,!1);return s}(function getCanvas({canvas:e,width:t=800,height:n=600,onError:r}){let i;"string"==typeof e?(c&&"complete"===document.readyState||r(`createGLContext called on canvas '${e}' before page was loaded`),i=document.getElementById(e)):e?i=e:((i=document.createElement("canvas")).id="lumagl-canvas",i.style.width=Number.isFinite(t)?t+"px":"100%",i.style.height=Number.isFinite(n)?n+"px":"100%",document.body.insertBefore(i,document.body.firstChild));return i}({canvas:r,width:e,height:n,onError:onError}),t))?(function logInfo(e){var t=Object(i.e)(e)?"WebGL2":"WebGL1",n=function getContextDebugInfo(e){var t=e.getParameter(7936),n=e.getParameter(7937),r=e.getExtension("WEBGL_debug_renderer_info"),i=r&&e.getParameter(r.UNMASKED_VENDOR_WEBGL||7936),r=r&&e.getParameter(r.UNMASKED_RENDERER_WEBGL||7937);return{vendor:i||t,renderer:r||n,vendorMasked:t,rendererMasked:n,version:e.getParameter(7938),shadingLanguageVersion:e.getParameter(35724)}}(e),n=n?`(${n.vendor},${n.renderer})`:"",e=e.debug?" debug":"";s.info(1,t+e+" context "+n)()}(r=instrumentGLContext(r,t)),r):null}function instrumentGLContext(e,t={}){if(!e||e._instrumented)return e;e._version=e._version||function getVersion(e){if("undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext)return 2;return 1}(e),e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};var{manageState:n,debug:r}=t=Object.assign({},g,t);return n&&Object(o.c)(e,{copyState:!1,log:(...e)=>s.log(1,...e)()}),l&&r&&(a.global.makeDebugContext?(e=a.global.makeDebugContext(e,t),s.level=Math.max(s.level,1)):s.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),e._instrumented=!0,e}function resizeGLContext(e,t={}){if(e.canvas)!function setDevicePixelRatio(e,t,n){let r="width"in n?n.width:e.canvas.clientWidth,i="height"in n?n.height:e.canvas.clientHeight;r&&i||(s.log(1,"Canvas clientWidth/clientHeight is 0")(),t=1,r=e.canvas.width||1,i=e.canvas.height||1);e.luma=e.luma||{},e.luma.canvasSizeInfo=e.luma.canvasSizeInfo||{};n=e.luma.canvasSizeInfo;{var o,a;n.clientWidth===r&&n.clientHeight===i&&n.devicePixelRatio===t||(n=t,o=Math.floor(r*n),a=Math.floor(i*n),e.canvas.width=o,e.canvas.height=a,e.drawingBufferWidth===o&&e.drawingBufferHeight===a||(s.warn("Device pixel ratio clamped")(),n=Math.min(e.drawingBufferWidth/r,e.drawingBufferHeight/i),e.canvas.width=Math.floor(r*n),e.canvas.height=Math.floor(i*n)),Object.assign(e.luma.canvasSizeInfo,{clientWidth:r,clientHeight:i,devicePixelRatio:t}))}}(e,function getDevicePixelRatio(e){var t="undefined"!=typeof window&&window.devicePixelRatio||1;return Number.isFinite(e)?e<=0?1:e:e?t:1}(t.useDevicePixels),t);else{const n=e.getExtension("STACKGL_resize_drawingbuffer");n&&"width"in t&&"height"in t&&n.resize(t.width,t.height)}}},function(e,t,n){"use strict";n.r(t),t.default=function(){for(var e,t=0,n="";te*o,t)}function degrees(e,t){return map(e,e=>e*i,t)}function sin(e){return map(e,e=>Math.sin(e))}function cos(e){return map(e,e=>Math.cos(e))}function tan(e){return map(e,e=>Math.tan(e))}function asin(e){return map(e,e=>Math.asin(e))}function acos(e){return map(e,e=>Math.acos(e))}function atan(e){return map(e,e=>Math.atan(e))}function clamp(e,t,n){return map(e,e=>Math.max(t,Math.min(n,e)))}function lerp(e,n,r){return isArray(e)?e.map((e,t)=>lerp(e,n[t],r)):r*n+(1-r)*e}function equals(t,n,e){var r=a.EPSILON;e&&(a.EPSILON=e);try{if(t===n)return!0;if(isArray(t)&&isArray(n)){if(t.length!==n.length)return!1;for(let e=0;ethis._renderPass(t,e))}delete(){this.model.delete(),this.model=null}_renderPass(e,{inputBuffer:t}){Object(M.a)(e,{color:!0}),this.model.draw({moduleSettings:this.props.moduleSettings,uniforms:{texture:t,texSize:[t.width,t.height]},parameters:{depthWrite:!1,depthTest:!1}})}}var U=t(486);class post_process_effect_PostProcessEffect extends s.a{constructor(e,t={}){super(t),this.id="".concat(e.name,"-pass"),Object(U.b)(e),this.module=e}postRender(e,t){this.passes||(this.passes=function createPasses(n,r,i,o){{var e;if(r.filter||r.sampler)return e=getFragmentShaderForRenderPass(r),[new screen_pass_ScreenPass(n,{id:i,module:r,fs:e,moduleSettings:o})]}const t=r.passes||[];return t.map((e,t)=>{e=getFragmentShaderForRenderPass(r,e),t="".concat(i,"-").concat(t);return new screen_pass_ScreenPass(n,{id:t,module:r,fs:e,moduleSettings:o})})}(e,this.module,this.id,this.props));var n=t["target"];let r=t.inputBuffer,i=t.swapBuffer;for(let e=0;e"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"),L=e=>"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 getFragmentShaderForRenderPass(e,t=e){var n;return t.filter?(n="string"==typeof t.filter?t.filter:"".concat(e.name,"_filterColor"),O(n)):t.sampler?(n="string"==typeof t.sampler?t.sampler:"".concat(e.name,"_sampleColor"),L(n)):null}var P=t(176),V=t(631),Z=t(348),W=t(343),H=t(342),j=t(461),Y=t(351),l=t(76),z=t(239),d=t(12),c=t(29),g=t(52);const h=Math.PI/180,u=180/Math.PI,p=6370972;class globe_viewport_GlobeViewport extends l.a{constructor(e={}){var{latitude:t=0,longitude:n=0,zoom:r=11,nearZMultiplier:i=.1,farZMultiplier:o=2,resolution:a=10}=e,{width:s,height:A,altitude:l=1.5}=e,s=s||1,A=A||1,l=Math.max(.75,l);const c=(new d.Matrix4).lookAt({eye:[0,-l,0],up:[0,0,1]});var g=Math.pow(2,r),u=(c.rotateX(t*h),c.rotateZ(-n*h),c.scale(g/A),Math.atan(.5/l)),g=512*g/A;super({...e,width:s,height:A,viewMatrix:c,longitude:n,latitude:t,zoom:r,fovyRadians:2*u,aspect:s/A,focalDistance:l,near:i,far:Math.min(2,1/g+1)*l*o}),this.resolution=a,this.distanceScales=function getDistanceScales(){var e=256/p,t=Math.PI/180*256;return{unitsPerMeter:[e,e,e],unitsPerMeter2:[0,0,0],metersPerUnit:[1/e,1/e,1/e],unitsPerDegree:[t,t,e],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/t,1/t,1/e]}}()}get projectionMode(){return i.c.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(e={}){e={targetZ:e.z||0};const t=this.unproject([0,this.height/2],e);var n=this.unproject([this.width/2,0],e);const r=this.unproject([this.width,this.height/2],e);e=this.unproject([this.width/2,this.height],e);return r[0]this.longitude&&(t[0]-=360),[Math.min(t[0],r[0],n[0],e[0]),Math.min(t[1],r[1],n[1],e[1]),Math.max(t[0],r[0],n[0],e[0]),Math.max(t[1],r[1],n[1],e[1])]}unproject(e,{topLeft:t=!0,targetZ:n}={}){var r,i,[e,o,a]=e,t=t?o:this.height-o,o=this["pixelUnprojectionMatrix"];let s;s=Number.isFinite(a)?transformVector(o,[e,t,a,1]):(r=transformVector(o,[e,t,-1,1]),o=transformVector(o,[e,t,1,1]),e=256*((n||0)/p+1),t=c.p(c.q([],r,o)),A=4*((4*(i=c.p(r))*(A=c.p(o))-(t-i-A)**2)/16)/t,i=(Math.sqrt(i-A)-Math.sqrt(Math.max(0,e*e-A)))/Math.sqrt(t),c.i([],r,o,i));var[e,A,t]=this.unprojectPosition(s);return Number.isFinite(a)?[e,A,t]:Number.isFinite(n)?[e,A,n]:[e,A]}projectPosition(e){var[e,t,n=0]=e,e=e*h,t=t*h,r=Math.cos(t),n=256*(n/p+1);return[Math.sin(e)*r*n,-Math.cos(e)*r*n,Math.sin(t)*n]}unprojectPosition(e){var[t,n,r]=e,e=c.g(e),r=Math.asin(r/e);return[Math.atan2(t,-n)*u,r*u,(e/256-1)*p]}projectFlat(e){return e}unprojectFlat(e){return e}panByPosition(e,t){t=this.unproject(t);return{longitude:e[0]-t[0]+this.longitude,latitude:e[1]-t[1]+this.latitude}}}function transformVector(e,t){t=g.n([],t,e);return g.k(t,t,1/t[3]),t}var J=t(509),K=t(201),X=t(508),f=t(1231),q=t(253),I=t(114),$=t(340),C=t(36),m=t(113),e=t(252),y=t(65);const B={position:[0,0,0],pitch:0,bearing:0,maxPitch:90,minPitch:-90};class first_person_controller_FirstPersonState extends e.a{constructor({width:e,height:t,position:n=B.position,bearing:r=B.bearing,pitch:i=B.pitch,longitude:o,latitude:a,maxPitch:s=B.maxPitch,minPitch:A=B.minPitch,startRotatePos:l,startBearing:c,startPitch:g,startZoomPosition:u,startZoom:d}){super({width:e,height:t,position:n,bearing:r,pitch:i,longitude:o,latitude:a,maxPitch:s,minPitch:A}),this._state={startRotatePos:l,startBearing:c,startPitch:g,startZoomPosition:u,startZoom:d}}getDirection(e=!1){const t=new d._SphericalCoordinates({bearing:this._viewportProps.bearing,pitch:e?90:90+this._viewportProps.pitch});return t.toVector3().normalize()}panStart(){return this}pan(){return this}panEnd(){return this}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}rotate({pos:e,deltaAngleX:t=0,deltaAngleY:n=0}){var{startRotatePos:r,startBearing:i,startPitch:o}=this._state,{width:a,height:s}=this._viewportProps;if(!r||!Number.isFinite(i)||!Number.isFinite(o))return this;let A;return A=e?{bearing:i-180*((e[0]-r[0])/a),pitch:o-90*((e[1]-r[1])/s)}:{bearing:i-t,pitch:o-n},this._getUpdatedState(A)}rotateEnd(){return this._getUpdatedState({startRotatePos:null,startBearing:null,startPitch:null})}zoomStart(){return this._getUpdatedState({startZoomPosition:this._viewportProps.position,startZoom:this._viewportProps.zoom})}zoom({scale:e}){let t=this._state["startZoomPosition"];t=t||this._viewportProps.position;var n=this.getDirection();return this._move(n,20*Math.log2(e),t)}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}moveLeft(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:Math.PI/2}),e)}moveRight(e=20){const t=this.getDirection(!0);return this._move(t.rotateZ({radians:-Math.PI/2}),e)}moveUp(e=20){var t=this.getDirection(!0);return this._move(t,e)}moveDown(e=20){const t=this.getDirection(!0);return this._move(t.negate(),e)}rotateLeft(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing-e})}rotateRight(e=15){return this._getUpdatedState({bearing:this._viewportProps.bearing+e})}rotateUp(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch+e})}rotateDown(e=10){return this._getUpdatedState({pitch:this._viewportProps.pitch-e})}zoomIn(e=2){return this.zoom({scale:e})}zoomOut(e=2){return this.zoom({scale:1/e})}shortestPathFrom(e){e=e.getViewportProps();const t={...this._viewportProps};var{bearing:n,longitude:r}=t;return 180r.a.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")()||0}),{WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0}),a={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}}},function(e,t,n){var r=n(403);e.exports=function isEqual(e,t){return r(e,t)}},function(e,t,n){"use strict";n.d(t,"e",function(){return r}),n.d(t,"c",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"f",function(){return s}),n.d(t,"d",function(){return A}),n.d(t,"g",function(){return l});const r=1e3,i=60*r,o=60*i,a=24*o,s=7*a,A=30*a,l=365*a},function(e,t,n){"use strict";!function checkDCE(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(e){console.error(e)}}(),e.exports=n(720)},function(e,t,n){"use strict";n.d(t,"a",function(){return capitalize});var r=n(691);function capitalize(e){if("string"!=typeof e)throw new Error(Object(r.a)(7));return e.charAt(0).toUpperCase()+e.slice(1)}},function(e,t,n){"use strict";n.d(t,"q",function(){return transpose}),n.d(t,"f",function(){return invert}),n.d(t,"a",function(){return determinant}),n.d(t,"h",function(){return multiply}),n.d(t,"p",function(){return translate}),n.d(t,"o",function(){return scale}),n.d(t,"k",function(){return rotate}),n.d(t,"l",function(){return rotateX}),n.d(t,"m",function(){return rotateY}),n.d(t,"n",function(){return rotateZ}),n.d(t,"e",function(){return getScaling}),n.d(t,"c",function(){return fromQuat}),n.d(t,"d",function(){return frustum}),n.d(t,"j",function(){return perspective}),n.d(t,"i",function(){return ortho}),n.d(t,"g",function(){return lookAt}),n.d(t,"b",function(){return equals});var D=n(17);function transpose(e,t){var n,r,i,o,a,s;return e===t?(n=t[1],r=t[2],i=t[3],o=t[6],a=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]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s):(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]),e}function invert(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],A=t[6],l=t[7],c=t[8],g=t[9],u=t[10],d=t[11],h=t[12],p=t[13],f=t[14],t=t[15],I=n*s-r*a,C=n*A-i*a,m=n*l-o*a,y=r*A-i*s,B=r*l-o*s,b=i*l-o*A,v=c*p-g*h,E=c*f-u*h,Q=c*t-d*h,w=g*f-u*p,S=g*t-d*p,_=u*t-d*f,x=I*_-C*S+m*w+y*Q-B*E+b*v;return x?(e[0]=(s*_-A*S+l*w)*(x=1/x),e[1]=(i*S-r*_-o*w)*x,e[2]=(p*b-f*B+t*y)*x,e[3]=(u*B-g*b-d*y)*x,e[4]=(A*Q-a*_-l*E)*x,e[5]=(n*_-i*Q+o*E)*x,e[6]=(f*m-h*b-t*C)*x,e[7]=(c*b-u*m+d*C)*x,e[8]=(a*S-s*Q+l*v)*x,e[9]=(r*Q-n*S-o*v)*x,e[10]=(h*B-p*m+t*I)*x,e[11]=(g*m-c*B-d*I)*x,e[12]=(s*E-a*w-A*v)*x,e[13]=(n*w-r*E+i*v)*x,e[14]=(p*C-h*y-f*I)*x,e[15]=(c*y-g*C+u*I)*x,e):null}function determinant(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],A=e[7],l=e[8],c=e[9],g=e[10],u=e[11],d=e[12],h=e[13],p=e[14],e=e[15];return(t*a-n*o)*(g*e-u*p)-(t*s-r*o)*(c*e-u*h)+(t*A-i*o)*(c*p-g*h)+(n*s-r*a)*(l*e-u*d)-(n*A-i*a)*(l*p-g*d)+(r*A-i*s)*(l*h-c*d)}function multiply(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],A=t[5],l=t[6],c=t[7],g=t[8],u=t[9],d=t[10],h=t[11],p=t[12],f=t[13],I=t[14],t=t[15],C=n[0],m=n[1],y=n[2],B=n[3];return e[0]=C*r+m*s+y*g+B*p,e[1]=C*i+m*A+y*u+B*f,e[2]=C*o+m*l+y*d+B*I,e[3]=C*a+m*c+y*h+B*t,C=n[4],m=n[5],y=n[6],B=n[7],e[4]=C*r+m*s+y*g+B*p,e[5]=C*i+m*A+y*u+B*f,e[6]=C*o+m*l+y*d+B*I,e[7]=C*a+m*c+y*h+B*t,C=n[8],m=n[9],y=n[10],B=n[11],e[8]=C*r+m*s+y*g+B*p,e[9]=C*i+m*A+y*u+B*f,e[10]=C*o+m*l+y*d+B*I,e[11]=C*a+m*c+y*h+B*t,C=n[12],m=n[13],y=n[14],B=n[15],e[12]=C*r+m*s+y*g+B*p,e[13]=C*i+m*A+y*u+B*f,e[14]=C*o+m*l+y*d+B*I,e[15]=C*a+m*c+y*h+B*t,e}function translate(e,t,n){var r,i,o,a,s,A,l,c,g,u,d,h,p=n[0],f=n[1],n=n[2];return t===e?(e[12]=t[0]*p+t[4]*f+t[8]*n+t[12],e[13]=t[1]*p+t[5]*f+t[9]*n+t[13],e[14]=t[2]*p+t[6]*f+t[10]*n+t[14],e[15]=t[3]*p+t[7]*f+t[11]*n+t[15]):(r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],A=t[5],l=t[6],c=t[7],g=t[8],u=t[9],d=t[10],h=t[11],e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=A,e[6]=l,e[7]=c,e[8]=g,e[9]=u,e[10]=d,e[11]=h,e[12]=r*p+s*f+g*n+t[12],e[13]=i*p+A*f+u*n+t[13],e[14]=o*p+l*f+d*n+t[14],e[15]=a*p+c*f+h*n+t[15]),e}function scale(e,t,n){var r=n[0],i=n[1],n=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function rotate(e,t,n,r){var i,o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E=r[0],Q=r[1],r=r[2],w=Math.hypot(E,Q,r);return w(e[t]=1+n,e),{});function timeUnits(e){const t=Object(I.i)(e).slice(),n={};return t.length||Object(I.o)("Missing time unit."),t.forEach(e=>{Object(I.w)(A,e)?n[e]=1:Object(I.o)("Invalid time unit: ".concat(e,"."))}),1<(n[B]||n[v]?1:0)+(n[m]||n[y]||n[b]?1:0)+(n[E]?1:0)&&Object(I.o)("Incompatible time units: ".concat(e)),t.sort((e,t)=>A[e]-A[t]),t}const O={[C]:"%Y ",[m]:"Q%q ",[y]:"%b ",[b]:"%d ",[B]:"W%U ",[v]:"%a ",[E]:"%j ",[Q]:"%H:00",[w]:"00:%M",[S]:":%S",[_]:".%L",["".concat(C,"-").concat(y)]:"%Y-%m ",["".concat(C,"-").concat(y,"-").concat(b)]:"%Y-%m-%d ",["".concat(Q,"-").concat(w)]:"%H:%M"};function timeUnitSpecifier(e,t){const n=Object(I.p)({},O,t),r=timeUnits(e),i=r.length;let o="",a=0,s,A;for(a=0;aa;--s)if(null!=n[A=r.slice(a,s).join("-")]){o+=n[A],a=s;break}return o.trim()}const l=new Date;function localYear(e){return l.setFullYear(e),l.setMonth(0),l.setDate(1),l.setHours(0,0,0,0),l}function dayofyear(e){return localDayOfYear(new Date(e))}function week(e){return localWeekNum(new Date(e))}function localDayOfYear(e){return n.a.count(localYear(e.getFullYear())-1,e)}function localWeekNum(e){return r.b.count(localYear(e.getFullYear())-1,e)}function localFirst(e){return localYear(e).getDay()}function localDate(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(-1,t,n,r,i,o,a);return s.setFullYear(e),s}return new Date(e,t,n,r,i,o,a)}function utcdayofyear(e){return utcDayOfYear(new Date(e))}function utcweek(e){return utcWeekNum(new Date(e))}function utcDayOfYear(e){var t=Date.UTC(e.getUTCFullYear(),0,1);return i.a.count(t-1,e)}function utcWeekNum(e){var t=Date.UTC(e.getUTCFullYear(),0,1);return o.b.count(t-1,e)}function utcFirst(e){return l.setTime(Date.UTC(e,0,1)),l.getUTCDay()}function utcDate(e,t,n,r,i,o,a){if(0<=e&&e<100){const s=new Date(Date.UTC(-1,t,n,r,i,o,a));return s.setUTCFullYear(n.y),s}return new Date(Date.UTC(e,t,n,r,i,o,a))}function floor(e,t,r,i,n){const o=t||1,a=Object(I.W)(e),s=(e,t,n)=>function getUnit(n,r,i,o){const a=i<=1?n:o?(e,t)=>o+i*Math.floor((n(e,t)-o)/i):(e,t)=>i*Math.floor(n(e,t)/i);return r?(e,t)=>r(a(e,t),t):a}(r[n=n||e],i[n],e===a&&o,t),A=new Date,l=Object(I.fb)(e),c=l[C]?s(C):Object(I.m)(2012),g=l[y]?s(y):l[m]?s(m):I.mb,u=l[B]&&l[v]?s(v,1,B+v):l[B]?s(B,1):l[v]?s(v,1):l[b]?s(b,1):l[E]?s(E,1):I.Q,d=l[Q]?s(Q):I.mb,h=l[w]?s(w):I.mb,p=l[S]?s(S):I.mb,f=l[_]?s(_):I.mb;return function(e){A.setTime(+e);e=c(A);return n(e,g(A),u(A,e),d(A),h(A),p(A),f(A))}}function weekday(e,t,n){return t+7*e-(n+6)%7}const L={[C]:e=>e.getFullYear(),[m]:e=>Math.floor(e.getMonth()/3),[y]:e=>e.getMonth(),[b]:e=>e.getDate(),[Q]:e=>e.getHours(),[w]:e=>e.getMinutes(),[S]:e=>e.getSeconds(),[_]:e=>e.getMilliseconds(),[E]:e=>localDayOfYear(e),[B]:e=>localWeekNum(e),[B+v]:(e,t)=>weekday(localWeekNum(e),e.getDay(),localFirst(t)),[v]:(e,t)=>weekday(1,e.getDay(),localFirst(t))},P={[m]:e=>3*e,[B]:(e,t)=>0+7*e-(localFirst(t)+6)%7};function timeFloor(e,t){return floor(e,t||1,L,P,localDate)}const V={[C]:e=>e.getUTCFullYear(),[m]:e=>Math.floor(e.getUTCMonth()/3),[y]:e=>e.getUTCMonth(),[b]:e=>e.getUTCDate(),[Q]:e=>e.getUTCHours(),[w]:e=>e.getUTCMinutes(),[S]:e=>e.getUTCSeconds(),[_]:e=>e.getUTCMilliseconds(),[E]:e=>utcDayOfYear(e),[B]:e=>utcWeekNum(e),[v]:(e,t)=>weekday(1,e.getUTCDay(),utcFirst(t)),[B+v]:(e,t)=>weekday(utcWeekNum(e),e.getUTCDay(),utcFirst(t))},Z={[m]:e=>3*e,[B]:(e,t)=>0+7*e-(utcFirst(t)+6)%7};function utcFloor(e,t){return floor(e,t||1,V,Z,utcDate)}const W={[C]:e.a,[m]:a.a.every(3),[y]:a.a,[B]:r.b,[b]:n.a,[v]:n.a,[E]:n.a,[Q]:x.a,[w]:R.a,[S]:s.a,[_]:F.a},H={[C]:D.a,[m]:G.a.every(3),[y]:G.a,[B]:o.b,[b]:i.a,[v]:i.a,[E]:i.a,[Q]:N.a,[w]:k.a,[S]:s.a,[_]:F.a};function timeInterval(e){return W[e]}function utcInterval(e){return H[e]}function offset(e,t,n){return e?e.offset(t,n):void 0}function timeOffset(e,t,n){return offset(timeInterval(e),t,n)}function utcOffset(e,t,n){return offset(utcInterval(e),t,n)}function sequence(e,t,n,r){return e?e.range(t,n,r):void 0}function timeSequence(e,t,n,r){return sequence(timeInterval(e),t,n,r)}function utcSequence(e,t,n,r){return sequence(utcInterval(e),t,n,r)}const c=36e5,j=864e5,g=365*j,Y=[C,y,b,Q,w,S,_],u=Y.slice(0,-1),d=u.slice(0,-1),h=d.slice(0,-1),z=h.slice(0,-1),J=[C,B],K=[C,y],X=[C],p=[[u,1,1e3],[u,5,5e3],[u,15,15e3],[u,30,3e4],[d,1,6e4],[d,5,3e5],[d,15,9e5],[d,30,18e5],[h,1,c],[h,3,3*c],[h,6,6*c],[h,12,432e5],[z,1,j],[J,1,6048e5],[K,1,2592e6],[K,3,7776e6],[X,1,g]];function bin(e){var t=e.extent,e=e.maxbins||40,n=Math.abs(Object(I.Z)(t))/e;let r=Object(T.a)(e=>e[2]).right(p,n),i,o;return o=r===p.length?(i=X,Object(M.c)(t[0]/g,t[1]/g,e)):r?(r=p[n/p[r-1][2]l?(n=s,t=1,a):o+(a-o)*(i/l),-2!==i&&i!==l+2||(r=0,t=0),n-=s/2;for(let e=0;el?0:S*p,v[Q+B[1]]=i<0?-1:i>l?1:f,v[Q+B[2]]=i<0||i>l?0:_*p,E[w+0]=e/A,E[w+1]=t,w+=2,Q+=3}}for(let t=0;t{const o={};return(e,t)=>{var n=((e*=3)<(t*=3)?e:t)+"|"+(tB}const s=new Float32Array(3*e),A=new Float32Array(3*e),l=new Float32Array(2*e),t=65535e[0])),n=Math.max(...t.map(e=>e[0]));return[[e,Math.min(...t.map(e=>e[1]))],[n,Math.max(...t.map(e=>e[1]))]]}getBoundingRegion(e={}){return getBounds(this,e.z||0)}}const d=512;function normalizeViewportProps({width:e,height:t,longitude:n,latitude:r,zoom:i,pitch:o=0,bearing:a=0}){(n<-180||180o?0:a}function getFlyToTransitionParams(e,t,n){var n=(n=Object.assign({},h,n)).curve,r=e.zoom,i=[e.longitude,e.latitude],o=zoomToScale(r),a=t.zoom,t=[t.longitude,t.latitude],a=zoomToScale(a-r),i=lngLatToWorld(i),t=lngLatToWorld(t),t=I.f([],t,i),e=Math.max(e.width,e.height),a=e/a,o=I.b(t)*o,s=Math.max(o,C),A=n*n,l=(a*a-e*e+A*A*s*s)/(2*e*A*s),a=(a*a-e*e-A*A*s*s)/(2*a*A*s),s=Math.log(Math.sqrt(l*l+1)-l),l=Math.log(Math.sqrt(a*a+1)-a);return{startZoom:r,startCenterXY:i,uDelta:t,w0:e,u1:o,S:(l-s)/n,rho:n,rho2:A,r0:s,r1:l}}},function(e,t,n){"use strict";n.d(t,"a",function(){return useForkRef});var r=n(0),i=n(113);function useForkRef(t,n){return r.useMemo(function(){return null==t&&null==n?null:function(e){Object(i.a)(t,e),Object(i.a)(n,e)}},[t,n])}},function(e,p,f){"use strict";!function(e){var t=f(18),n=f(491),r=(f.d(p,"g",function(){return n.a}),f(193)),i=(f.d(p,"h",function(){return r.a}),f(492)),o=(f.d(p,"i",function(){return i.a}),f(493)),a=(f.d(p,"b",function(){return o.a}),f(244)),s=(f.d(p,"c",function(){return a.a}),f(275)),A=(f.d(p,"e",function(){return s.a}),f.d(p,"u",function(){return t.f}),f.d(p,"v",function(){return t.g}),f.d(p,"A",function(){return t.l}),f.d(p,"B",function(){return t.m}),f.d(p,"t",function(){return t.e}),f.d(p,"y",function(){return t.j}),f.d(p,"z",function(){return t.k}),f.d(p,"H",function(){return t.s}),f.d(p,"G",function(){return t.r}),f.d(p,"D",function(){return t.o}),f.d(p,"x",function(){return t.i}),f.d(p,"E",function(){return t.p}),f.d(p,"w",function(){return t.h}),f.d(p,"F",function(){return t.q}),f.d(p,"o",function(){return t.b}),f.d(p,"n",function(){return t.a}),f.d(p,"q",function(){return t.c}),f.d(p,"s",function(){return t.d}),f.d(p,"C",function(){return t.n}),f.d(p,"I",function(){return t.t}),f(19)),l=(f.d(p,"r",function(){return A.a}),f(494)),c=(f.d(p,"k",function(){return l.a}),f(298)),g=(f.d(p,"f",function(){return c.a}),f(299)),u=(f.d(p,"d",function(){return g.a}),f(169)),d=(f.d(p,"a",function(){return u.a}),f(77)),e=(f.d(p,"p",function(){return d.a}),f.d(p,"m",function(){return c.a}),f.d(p,"l",function(){return g.a}),f.d(p,"j",function(){return u.a}),{self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e});const h=e.global||e.self||e.window;h.mathgl={config:t.f}}.call(this,f(59))},function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"g",function(){return a}),n.d(t,"d",function(){return s}),n.d(t,"a",function(){return A}),n.d(t,"e",function(){return l}),n.d(t,"i",function(){return c}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return u}),n.d(t,"h",function(){return d});const r=e=>"boolean"==typeof e,i=e=>"function"==typeof e,o=e=>null!==e&&"object"==typeof e,a=e=>o(e)&&e.constructor==={}.constructor;const s=e=>e&&"function"==typeof e[Symbol.iterator],A=e=>e&&"function"==typeof e[Symbol.asyncIterator],l=e=>e&&i(e.next),c=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;const g=e=>"undefined"!=typeof Blob&&e instanceof Blob,u=e=>e&&"object"==typeof e&&e.isBuffer,d=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||o(e)&&i(e.tee)&&i(e.cancel)&&i(e.getReader))(e)||(e=>o(e)&&i(e.read)&&i(e.pipe)&&r(e.readable))(e)},function(e,t,n){"use strict";function assign(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function endsWith(e,t){return!(e.lengthsetTimeout(e,t))}function zip(e,t){const n=Array.isArray(e)?e:Array.from(e),r=Array.isArray(t)?t:Array.from(t);return n.map((e,t)=>[e,r[t]])}n.d(t,"c",function(){return assign}),n.d(t,"d",function(){return endsWith}),n.d(t,"e",function(){return forEach}),n.d(t,"f",function(){return invert}),n.d(t,"g",function(){return times}),n.d(t,"h",function(){return wait}),n.d(t,"i",function(){return zip}),n.d(t,"a",function(){return AbortError}),n.d(t,"b",function(){return r});class AbortError extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,AbortError),this.name="AbortError"}}class CustomAggregateError extends Error{constructor(e,t){super(t),this.errors=e,this.message=t,this.name="AggregateError"}}const r=CustomAggregateError},,function(e,t,n){"use strict";n.d(t,"c",function(){return getContrastRatio}),n.d(t,"a",function(){return alpha}),n.d(t,"b",function(){return darken}),n.d(t,"d",function(){return lighten});var r=n(659);function clamp(e,t,n){t=1e[0])),n=Math.max(...t.map(e=>e[0]));return[[e,Math.min(...t.map(e=>e[1]))],[n,Math.max(...t.map(e=>e[1]))]]}getBoundingRegion(e={}){return getBounds(this,e.z||0)}}const d=512;function normalizeViewportProps({width:e,height:t,longitude:n,latitude:r,zoom:i,pitch:o=0,bearing:a=0}){(n<-180||180o?0:a}function getFlyToTransitionParams(e,t,n){var n=(n=Object.assign({},h,n)).curve,r=e.zoom,i=[e.longitude,e.latitude],o=zoomToScale(r),a=t.zoom,t=[t.longitude,t.latitude],a=zoomToScale(a-r),i=lngLatToWorld(i),t=lngLatToWorld(t),t=I.f([],t,i),e=Math.max(e.width,e.height),a=e/a,o=I.b(t)*o,s=Math.max(o,C),A=n*n,l=(a*a-e*e+A*A*s*s)/(2*e*A*s),a=(a*a-e*e-A*A*s*s)/(2*a*A*s),s=Math.log(Math.sqrt(l*l+1)-l),l=Math.log(Math.sqrt(a*a+1)-a);return{startZoom:r,startCenterXY:i,uDelta:t,w0:e,u1:o,S:(l-s)/n,rho:n,rho2:A,r0:s,r1:l}}},function(e,t,n){"use strict";n.d(t,"a",function(){return useForkRef});var r=n(0),i=n(115);function useForkRef(t,n){return r.useMemo(function(){return null==t&&null==n?null:function(e){Object(i.a)(t,e),Object(i.a)(n,e)}},[t,n])}},function(e,p,f){"use strict";!function(e){var t=f(18),n=f(501),r=(f.d(p,"g",function(){return n.a}),f(198)),i=(f.d(p,"h",function(){return r.a}),f(502)),o=(f.d(p,"i",function(){return i.a}),f(503)),a=(f.d(p,"b",function(){return o.a}),f(250)),s=(f.d(p,"c",function(){return a.a}),f(281)),A=(f.d(p,"e",function(){return s.a}),f.d(p,"u",function(){return t.f}),f.d(p,"v",function(){return t.g}),f.d(p,"A",function(){return t.l}),f.d(p,"B",function(){return t.m}),f.d(p,"t",function(){return t.e}),f.d(p,"y",function(){return t.j}),f.d(p,"z",function(){return t.k}),f.d(p,"H",function(){return t.s}),f.d(p,"G",function(){return t.r}),f.d(p,"D",function(){return t.o}),f.d(p,"x",function(){return t.i}),f.d(p,"E",function(){return t.p}),f.d(p,"w",function(){return t.h}),f.d(p,"F",function(){return t.q}),f.d(p,"o",function(){return t.b}),f.d(p,"n",function(){return t.a}),f.d(p,"q",function(){return t.c}),f.d(p,"s",function(){return t.d}),f.d(p,"C",function(){return t.n}),f.d(p,"I",function(){return t.t}),f(19)),l=(f.d(p,"r",function(){return A.a}),f(504)),c=(f.d(p,"k",function(){return l.a}),f(304)),g=(f.d(p,"f",function(){return c.a}),f(305)),u=(f.d(p,"d",function(){return g.a}),f(174)),d=(f.d(p,"a",function(){return u.a}),f(77)),e=(f.d(p,"p",function(){return d.a}),f.d(p,"m",function(){return c.a}),f.d(p,"l",function(){return g.a}),f.d(p,"j",function(){return u.a}),{self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e});const h=e.global||e.self||e.window;h.mathgl={config:t.f}}.call(this,f(64))},function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"g",function(){return a}),n.d(t,"d",function(){return s}),n.d(t,"a",function(){return A}),n.d(t,"e",function(){return l}),n.d(t,"i",function(){return c}),n.d(t,"b",function(){return g}),n.d(t,"c",function(){return u}),n.d(t,"h",function(){return d});const r=e=>"boolean"==typeof e,i=e=>"function"==typeof e,o=e=>null!==e&&"object"==typeof e,a=e=>o(e)&&e.constructor==={}.constructor;const s=e=>e&&"function"==typeof e[Symbol.iterator],A=e=>e&&"function"==typeof e[Symbol.asyncIterator],l=e=>e&&i(e.next),c=e=>"undefined"!=typeof Response&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;const g=e=>"undefined"!=typeof Blob&&e instanceof Blob,u=e=>e&&"object"==typeof e&&e.isBuffer,d=e=>(e=>"undefined"!=typeof ReadableStream&&e instanceof ReadableStream||o(e)&&i(e.tee)&&i(e.cancel)&&i(e.getReader))(e)||(e=>o(e)&&i(e.read)&&i(e.pipe)&&r(e.readable))(e)},function(e,t,n){"use strict";function assign(e,t){for(const n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}function endsWith(e,t){return!(e.lengthsetTimeout(e,t))}function zip(e,t){const n=Array.isArray(e)?e:Array.from(e),r=Array.isArray(t)?t:Array.from(t);return n.map((e,t)=>[e,r[t]])}n.d(t,"c",function(){return assign}),n.d(t,"d",function(){return endsWith}),n.d(t,"e",function(){return forEach}),n.d(t,"f",function(){return invert}),n.d(t,"g",function(){return times}),n.d(t,"h",function(){return wait}),n.d(t,"i",function(){return zip}),n.d(t,"a",function(){return AbortError}),n.d(t,"b",function(){return r});class AbortError extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,AbortError),this.name="AbortError"}}class CustomAggregateError extends Error{constructor(e,t){super(t),this.errors=e,this.message=t,this.name="AggregateError"}}const r=CustomAggregateError},,function(e,t,n){"use strict";n.d(t,"c",function(){return getContrastRatio}),n.d(t,"a",function(){return alpha}),n.d(t,"b",function(){return darken}),n.d(t,"d",function(){return lighten});var r=n(691);function clamp(e,t,n){t=1(t&&(e=e.replace(new RegExp("^".concat("/")),"")),e=t!==n.length-1?e.replace(new RegExp("".concat("/","$")),""):e))).join("/")}n.r(r),n.d(r,"dirname",function(){return dirname}),n.d(r,"join",function(){return join});n(310),n(540)},function(e,t,n){"use strict";n.r(t);var o=n(15),a=n(6);t.default=function distance(e,t,n){void 0===n&&(n={});var e=Object(o.getCoord)(e),t=Object(o.getCoord)(t),r=Object(a.degreesToRadians)(t[1]-e[1]),i=Object(a.degreesToRadians)(t[0]-e[0]),e=Object(a.degreesToRadians)(e[1]),t=Object(a.degreesToRadians)(t[1]),r=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(e)*Math.cos(t);return Object(a.radiansToLength)(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)),n.units)}},function(e,t,n){"use strict";n.d(t,"b",function(){return register}),n.d(t,"a",function(){return debug});var r=n(28);let i={};function register(e){i=e}function debug(e){0e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=a.properties,A=a.geometry,l=l.addFeature({type:"Feature",properties:s,geometry:A});i.push(r+i.length)}}catch(e){o.e(e)}finally{o.f()}return{updatedData:l.getObject(),editType:"addFeature",editContext:{featureIndexes:i}}}},{key:"getAddFeatureOrBooleanPolygonAction",value:function getAddFeatureOrBooleanPolygonAction(e,t){var n=e,r=this.getSelectedFeature(t),i=t.modeConfig;if(i&&i.booleanOperation){if(!r||"Polygon"!==r.geometry.type&&"MultiPolygon"!==r.geometry.type)return console.warn("booleanOperation only supported for single Polygon or MultiPolygon selection"),null;var o,n="Feature"===n.type?n:{type:"Feature",geometry:n};if("union"===i.booleanOperation)o=(0,a.default)(r,n);else if("difference"===i.booleanOperation)o=(0,s.default)(r,n);else{if("intersection"!==i.booleanOperation)return console.warn("Invalid booleanOperation ".concat(i.booleanOperation)),null;o=(0,A.default)(r,n)}if(!o)return console.warn("Canceling edit. Boolean operation erased entire polygon."),null;i=t.selectedIndexes[0];return{updatedData:new c.ImmutableFeatureCollection(t.data).replaceGeometry(i,o.geometry).getObject(),editType:"unionGeometry",editContext:{featureIndexes:[i]}}}return this.getAddFeatureAction(e,t.data)}},{key:"createTentativeFeature",value:function createTentativeFeature(e){return null}},{key:"handleClick",value:function handleClick(e,t){}},{key:"handlePointerMove",value:function handlePointerMove(e,t){var n=this.createTentativeFeature(t);n&&t.onEdit({updatedData:t.data,editType:"updateTentativeFeature",editContext:{feature:n}})}},{key:"handleStartDragging",value:function handleStartDragging(e,t){}},{key:"handleStopDragging",value:function handleStopDragging(e,t){}},{key:"handleDragging",value:function handleDragging(e,t){}},{key:"handleKeyUp",value:function handleKeyUp(e,t){"Escape"===e.key&&(this.resetClickSequence(),t.onEdit({updatedData:t.data,editType:"cancelFeature",editContext:{}}))}}]),GeoJsonEditMode}();t.GeoJsonEditMode=n},function(e,t,n){"use strict";var n=n(366),r="object"==typeof self&&self&&self.Object===Object&&self,n=n.a||r||Function("return this")();t.a=n},function(e,t,n){"use strict";n.d(t,"a",function(){return Buffer});var t=n(72),i=n(117),l=n(93),c=n(7),g=n(14),r=n(278);n={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"};const o={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:n},a={removedProps:n};class Buffer extends t.a{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/i.a.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/i.a.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(r.a)("Buffer",e,o),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=Object(r.a)("Buffer",e,a))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new i.a(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){var{data:t,offset:n=0,srcOffset:r=0}=e=ArrayBuffer.isView(e)?{data:e}:e,e=e.byteLength||e.length,i=(Object(g.a)(t),this.gl.webgl2?36663:this.target);return this.gl.bindBuffer(i,this.handle),0!==r||void 0!==e?(Object(c.a)(this.gl),this.gl.bufferSubData(this.target,n,t,r,e)):this.gl.bufferSubData(i,n,t),this.gl.bindBuffer(i,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:n=0,size:r}){const i=this["gl"];return Object(c.a)(i),i.bindBuffer(36662,e.handle),i.bindBuffer(36663,this.handle),i.copyBufferSubData(36662,36663,t,n,r),i.bindBuffer(36662,null),i.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:n=0,length:r=0}={}){Object(c.a)(this.gl);const i=Object(l.c)(this.accessor.type||5126,{clamped:!1});var o=this._getAvailableElementCount(t),a=n;let s,A;e?(A=e.length,s=A-a):(s=Math.min(o,r||o),A=a+s);a=Math.min(o,s);return r=r||a,Object(g.a)(r<=a),e=e||new i(A),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,n,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:n=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,n,r):(Object(g.a)(0===n),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,n=e.byteLength+t){Object(g.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var r=this._getTarget(),r=(this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n),Object(l.b)(e));return Object(g.a)(r),this.setAccessor(new i.a(this.accessor,{type:r})),this}_setByteLength(e,t=this.usage){Object(g.a)(0<=e),this._trackDeallocatedMemory();let n=e;0===e&&(n=new Float32Array(0));var r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){e/=Object(l.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(e){this.accessor.type||this.setAccessor(new i.a(this.accessor,{type:Object(l.b)(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);e=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),e}get type(){return c.k.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return c.k.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return c.k.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return c.k.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new i.a(this.accessor,e),this}}},function(F,e,t){"use strict";t.d(e,"a",function(){return axis_aligned_bounding_box_AxisAlignedBoundingBox}),t.d(e,"b",function(){return bounding_sphere_BoundingSphere}),t.d(e,"d",function(){return oriented_bounding_box_OrientedBoundingBox}),t.d(e,"c",function(){return culling_volume_CullingVolume}),t.d(e,"e",function(){return plane_Plane}),t.d(e,"f",function(){return makeOrientedBoundingBoxFromPoints});const s=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});var Q=t(193);const i=new Q.a,r=new Q.a;class axis_aligned_bounding_box_AxisAlignedBoundingBox{constructor(e=[0,0,0],t=[0,0,0],n=null){n=n||i.copy(e).add(t).scale(.5),this.center=new Q.a(n),this.halfDiagonal=new Q.a(t).subtract(this.center),this.minimum=new Q.a(e),this.maximum=new Q.a(t)}clone(){return new axis_aligned_bounding_box_AxisAlignedBoundingBox(this.minimum,this.maximum,this.center)}equals(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){var t=this["halfDiagonal"],n=r.from(e.normal),t=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),n=this.center.dot(n)+e.distance;return 0this.radius&&(this.radius=e),this}transform(e){this.center.transform(e);e=n.e(a,e);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(e){e=this.distanceTo(e);return e*e}distanceTo(e){const t=(e=a.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){var t=this.center,n=this.radius;const r=e.normal;t=r.dot(t)+e.distance;return t<-n?s.OUTSIDE:te instanceof plane_Plane))}fromBoundingSphere(e){this.planes.length=2*y.length;var n=e.center,r=e.radius;let i=0;for(const a of y){let e=this.planes[i],t=this.planes[i+1];e=e||(this.planes[i]=new plane_Plane),t=t||(this.planes[i+1]=new plane_Plane);var o=B.copy(a).scale(-r).add(n),o=(a.dot(o),e.fromPointNormal(o,a),B.copy(a).scale(r).add(n));const s=G.copy(a).negate();s.dot(o);t.fromPointNormal(o,s),i+=2}return this}computeVisibility(e){Object(u.a)(e);let t=s.INSIDE;for(const n of this.planes)switch(e.intersectPlane(n)){case s.OUTSIDE:return s.OUTSIDE;case s.INTERSECTING:t=s.INTERSECTING}return t}computeVisibilityWithPlaneMask(t,n){if(Object(u.a)(t,"boundingVolume is required."),Object(u.a)(Number.isFinite(n),"parentPlaneMask is required."),n===culling_volume_CullingVolume.MASK_OUTSIDE||n===culling_volume_CullingVolume.MASK_INSIDE)return n;let r=culling_volume_CullingVolume.MASK_INSIDE;var i=this.planes;for(let e=0;es;)!function shurDecomposition(t,e){var n=b.a.EPSILON15;let r=0,i=1;for(let e=0;e<3;++e){var o=Math.abs(t[v.getElementIndex(x[e],_[e])]);o>r&&(i=e,r=o)}var a=_[i],s=x[i];let A=1,l=0;if(Math.abs(t[v.getElementIndex(s,a)])>n){var n=t[v.getElementIndex(s,s)],c=t[v.getElementIndex(a,a)],g=t[v.getElementIndex(s,a)],n=(n-c)/2/g;let e;e=n<0?-1/(-n+Math.sqrt(1+n*n)):1/(n+Math.sqrt(1+n*n)),A=1/Math.sqrt(1+e*e),l=e*A}w.a.IDENTITY.to(e),e[v.getElementIndex(a,a)]=e[v.getElementIndex(s,s)]=A,e[v.getElementIndex(s,a)]=l,e[v.getElementIndex(a,s)]=-l}(a,E),S.copy(E).transpose(),a.multiplyRight(E),a.multiplyLeft(S),o.multiplyRight(E),2<++r&&(++i,r=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}const _=[1,0,0],x=[2,2,1];const R=new Q.a,T=new Q.a,M=new Q.a,U=new Q.a,O=new Q.a,L=new w.a,P={diagonal:new w.a,unitary:new w.a};function makeOrientedBoundingBoxFromPoints(e,t=new oriented_bounding_box_OrientedBoundingBox){if(!e||0===e.length)return t.halfAxes=new w.a([0,0,0,0,0,0,0,0,0]),t.center=new Q.a,t;var n=e.length;const r=new Q.a(0,0,0);for(const b of e)r.add(b);n=1/n;r.multiplyByScalar(n);let i=0,o=0,a=0,s=0,A=0,l=0;for(const v of e){var c=R.copy(v).subtract(r);i+=c.x*c.x,o+=c.x*c.y,a+=c.x*c.z,s+=c.y*c.y,A+=c.y*c.z,l+=c.z*c.z}i*=n,o*=n,a*=n,s*=n,A*=n,l*=n;const g=L;g[0]=i,g[1]=o,g[2]=a,g[3]=o,g[4]=s,g[5]=A,g[6]=a,g[7]=A,g[8]=l;n=computeEigenDecomposition(g,P).unitary;const u=t.halfAxes.copy(n);let d=u.getColumn(0,M),h=u.getColumn(1,U),p=u.getColumn(2,O),f=-Number.MAX_VALUE,I=-Number.MAX_VALUE,C=-Number.MAX_VALUE,m=Number.MAX_VALUE,y=Number.MAX_VALUE,B=Number.MAX_VALUE;for(const E of e)R.copy(E),f=Math.max(R.dot(d),f),I=Math.max(R.dot(h),I),C=Math.max(R.dot(p),C),m=Math.min(R.dot(d),m),y=Math.min(R.dot(h),y),B=Math.min(R.dot(p),B);d=d.multiplyByScalar(.5*(m+f)),h=h.multiplyByScalar(.5*(y+I)),p=p.multiplyByScalar(.5*(B+C)),t.center.copy(d).add(h).add(p);n=T.set(f-m,I-y,C-B).multiplyByScalar(.5),e=new w.a([n[0],0,0,0,n[1],0,0,0,n[2]]);return t.halfAxes.multiplyRight(e),t}},function(e,t,n){"use strict";n.d(t,"a",function(){return createMat4}),n.d(t,"e",function(){return mod}),n.d(t,"c",function(){return getCameraPosition}),n.d(t,"d",function(){return getFrustumPlanes}),n.d(t,"b",function(){return fp64LowPart}),n.d(t,"f",function(){return toDoublePrecisionArray});var A=n(122),o=n(12);function createMat4(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function mod(e,t){e%=t;return e<0?t+e:e}function getCameraPosition(e){return[e[12],e[13],e[14]]}function getFrustumPlanes(e){const t={};return t.left=getFrustumPlane(e[3]+e[0],e[7]+e[4],e[11]+e[8],e[15]+e[12]),t.right=getFrustumPlane(e[3]-e[0],e[7]-e[4],e[11]-e[8],e[15]-e[12]),t.bottom=getFrustumPlane(e[3]+e[1],e[7]+e[5],e[11]+e[9],e[15]+e[13]),t.top=getFrustumPlane(e[3]-e[1],e[7]-e[5],e[11]-e[9],e[15]-e[13]),t.near=getFrustumPlane(e[3]+e[2],e[7]+e[6],e[11]+e[10],e[15]+e[14]),t.far=getFrustumPlane(e[3]-e[2],e[7]-e[6],e[11]-e[10],e[15]-e[14]),t}const a=new o.Vector3;function getFrustumPlane(e,t,n,r){a.set(e,t,n);var i=a.len();return{distance:r/i,normal:new o.Vector3(-e/i,-t/i,-n/i)}}function fp64LowPart(e){return e-Math.fround(e)}let l;function toDoublePrecisionArray(t,{size:n=1,startIndex:e=0,endIndex:r}){var i=((r=Number.isFinite(r)?r:t.length)-e)/n;l=A.a.allocate(l,i,{type:Float32Array,size:2*n});let o=e,a=0;for(;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>o){if((o=s)===r){if(i===n.y)return n;if(i===n.next.y)return n.next}a=n.x=n.x&&n.x>=l&&r!==n.x&&pointInTriangle(ia.x||n.x===a.x&&function sectorContainsSector(e,t){return earcut_area(e.prev,e,t.prev)<0&&earcut_area(t.next,e,e.next)<0}(a,n)))&&(a=n,g=u)),n=n.next,n!==A;);return a}(e,t))&&(e=splitPolygon(t,e),filterPoints(t,t.next),filterPoints(e,e.next))}(o[a],n),n=filterPoints(n,n.next);return n}(t,e,a,n,r)),t.length>80*n){d=g=t[0],h=u=t[1];for(let e=n;eg&&(g=s),A>u&&(u=A);c=0!==(c=Math.max(g-d,u-h))?1/c:0}return earcutLinked(a,l,n,d,h,c),l}function linkedList(e,t,n,r,i,o){let a,s;if(i===(o=void 0===o?getPolygonSignedArea(e,{start:t,end:n,size:r}):o)<0)for(a=t;a=t;a-=r)s=insertNode(a,e[a],e[a+1],s);return s&&equals(s,s.next)&&(removeNode(s),s=s.next),s}function filterPoints(e,t){if(!e)return e;t=t||e;let n=e,r;do{if(r=!1,n.steiner||!equals(n,n.next)&&0!==earcut_area(n.prev,n,n.next))n=n.next;else{if(removeNode(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function earcutLinked(t,n,r,i,o,a,s){if(t){!s&&a&&!function indexCurve(e,t,n,r){let i=e;for(;null===i.z&&(i.z=zOrder(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,function sortLinked(e){let t,n,r=1,i,o,a,s,A,l;do{for(o=e,e=null,l=null,i=0;o;){for(i++,s=o,a=0,n=0;no.x?i.x>a.x?i:a:o.x>a.x?o:a).x,c=(i.y>o.y?i.y>a.y?i:a:o.y>a.y?o:a).y,g=zOrder(s,A,t,n,r),u=zOrder(l,c,t,n,r);let d=e.prevZ,h=e.nextZ;for(;d&&d.z>=g&&h&&h.z<=u;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=earcut_area(d.prev,d,d.next))return;if(d=d.prevZ,h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=earcut_area(h.prev,h,h.next))return;h=h.nextZ}for(;d&&d.z>=g;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=earcut_area(d.prev,d,d.next))return;d=d.prevZ}for(;h&&h.z<=u;){if(h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=earcut_area(h.prev,h,h.next))return;h=h.nextZ}return 1}(t,i,o,a):function isEar(e){var t=e.prev,n=e,r=e.next;if(0<=earcut_area(t,n,r))return;let i=e.next.next;for(;i!==e.prev;){if(pointInTriangle(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=earcut_area(i.prev,i,i.next))return;i=i.next}return 1}(t))n.push(A.i/r),n.push(t.i/r),n.push(l.i/r),removeNode(t),t=l.next,e=l.next;else if((t=l)===e){s?1===s?earcutLinked(t=function cureLocalIntersections(e,t,n){let r=e;do{var i=r.prev,o=r.next.next;!equals(i,o)&&intersects(i,r,r.next,o)&&locallyInside(i,o)&&locallyInside(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),removeNode(r),removeNode(r.next),r=e=o),r=r.next}while(r!==e);return filterPoints(r)}(filterPoints(t),n,r),n,r,i,o,a,2):2===s&&function splitEarcut(e,t,n,r,i,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){var s;if(a.i!==e.i&&function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function intersectsPolygon(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&intersects(n,n.next,e,t))return 1}while(n=n.next,n!==e);return}(e,t)&&(locallyInside(e,t)&&locallyInside(t,e)&&function middleInside(e,t){let n=e,r=!1;var i=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(earcut_area(e.prev,e,t.prev)||earcut_area(e,t.prev,t))||equals(e,t)&&0=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function sign(e){return 0t[2]&&(n|=2),e[1]t[3]&&(n|=8),n}function cutPolylineByGrid(t,e={}){var{size:n=2,broken:r=!1,gridResolution:i=10,gridOffset:e=[0,0],startIndex:o=0,endIndex:a=t.length}=e,s=(a-o)/n;let A=[];const l=[A];var c=getPointAtIndex(t,0,n,o);let g,u;var d=getGridCell(c,i,e,[]),h=[];push(A,c);for(let e=1;en&&(A=[],l.push(A),push(A,c)),u=bitCode(g,d)}push(A,g),copy(c,g)}return r?l:l[0]}const B=0,m=1;function concatInPlace(t,n){for(let e=0;eo?A:o,a=ls?l:s}e[0][0]=i,e[0][1]=a,e[1][0]=o,e[1][1]=s}(g,r,d[0]||g.length,l),c=getGridCell(l[0],i,o,c),bitCode(l[1],c));if(h){var p=bisectPolygon(g,u,r,0,d[0]||g.length,c,h);const f={pos:p[0].pos,types:p[0].types,holes:[]},I={pos:p[1].pos,types:p[1].types,holes:[]};A.push(f,I);for(let e=0;eo&&(o=s,a=e-1)}return a}(t,i,A,c);for(let e=u;ee.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){e=Object(c.b)(this.gl,e),Object(o.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var r,i=Object(l.j)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))return r=n.webgl1,n="webgl2"in n?n.webgl2:n.webgl1,i?n:r}return this._getParameter(e,t)}getParameters(e={}){var{parameters:t,keys:n}=e,r=this.constructor.PARAMETERS||{},i=Object(l.j)(this.gl);const o={};for(const A of t||Object.keys(r)){var a,s=r[A];s&&(!("webgl2"in s)||i)&&(!("extension"in s)||this.gl.getExtension(s.extension))&&(a=n?Object(c.a)(this.gl,A):A,o[a]=this.getParameter(A,e),n&&"GLenum"===s.type&&(o[a]=Object(c.a)(this.gl,o[a])))}return o}setParameter(e,t){e=Object(c.b)(this.gl,e),Object(o.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var r=Object(l.j)(this.gl);if(!((!("webgl2"in n)||r)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(c.b)(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,n){return Object(a.a)(this,e,t,n)}initialize(e){}_createHandle(){throw new Error(s)}_deleteHandle(){throw new Error(s)}_bindHandle(e){throw new Error(s)}_getOptsFromHandle(){throw new Error(s)}_getParameter(e,t){throw new Error(s)}_setParameter(e,t){throw new Error(s)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){var e=this.constructor.name;const t=r.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(e+"s Created").incrementCount(),t.get(e+"s Active").incrementCount()}_removeStats(){var e=this.constructor.name;const t=r.a.get("Resource Counts");t.get(e+"s Active").decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const n=r.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get(t+" Memory").addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=r.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(e+" Memory").subtractCount(this.byteLength),this.byteLength=0}}},function(e,t,n){"use strict";n.r(t);var r=n(32);function bbox(e){var t=[1/0,1/0,-1/0,-1/0];return Object(r.coordEach)(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<+~=|^:(),"'`\s])/g,s="undefined"!=typeof CSS&&CSS.escape,e=function(){function BaseStyleRule(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return BaseStyleRule.prototype.prop=function prop(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t,n=null==(i=n&&!1===n.process?i:this.options.jss.plugins.onChangeValue(t,e,this))||!1===i,t=e in this.style;if(n&&!t&&!r)return this;r=n&&t;if(r?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return r?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;n=this.options.sheet;return n&&n.attached,this},BaseStyleRule}(),A=function(o){function StyleRule(e,t,n){var e=o.call(this,e,t,n)||this,t=n.selector,r=n.scoped,i=n.sheet,n=n.generateId;return t?e.selectorText=t:!1!==r&&(e.id=n(Object(a.a)(Object(a.a)(e)),i),e.selectorText="."+Wza(e.id)),e}Object(i.a)(StyleRule,o);var e=StyleRule.prototype;return e.applyTo=function applyTo(e){var t=this.renderer;if(t){var n,r=this.toJSON();for(n in r)t.setProperty(e,n,r[n])}return this},e.toJSON=function toJSON(){var e,t={};for(e in this.style){var n=this.style[e];"object"!=typeof n?t[e]=n:Array.isArray(n)&&(t[e]=I(n))}return t},e.toString=function toString(e){var t=this.options.sheet,t=!!t&&t.options.link?Object(l.a)({},e,{allowEmpty:!0}):e;return toCss(this.selectorText,this.style,t)},Object(r.a)(StyleRule,[{key:"selector",set:function set(e){var t,n;e!==this.selectorText&&(this.selectorText=e,t=this.renderer,(n=this.renderable)&&t&&(t.setSelector(n,e)||t.replaceRule(n,this)))},get:function get(){return this.selectorText}}]),StyleRule}(e),t={onCreateRule:function onCreateRule(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new A(e,t,n)}},c={indent:1,children:!0},G=/@([\w-]+)/,N=function(){function ConditionalRule(e,t,n){this.type="conditional",this.isProcessed=!1;var r,e=(this.key=e).match(G);for(r in this.at=e?e[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new y(Object(l.a)({},n,{parent:this})),t)this.rules.add(r,t[r]);this.rules.process()}var e=ConditionalRule.prototype;return e.getRule=function getRule(e){return this.rules.get(e)},e.indexOf=function indexOf(e){return this.rules.indexOf(e)},e.addRule=function addRule(e,t,n){e=this.rules.add(e,t,n);return e?(this.options.jss.plugins.onProcessRule(e),e):null},e.toString=function toString(e){var t=getWhitespaceSymbols(e=void 0===e?c:e).linebreak;if(null==e.indent&&(e.indent=c.indent),null==e.children&&(e.children=c.children),!1===e.children)return this.query+" {}";e=this.rules.toString(e);return e?this.query+" {"+t+e+t+"}":""},ConditionalRule}(),k=/@media|@supports\s+/,g={onCreateRule:function onCreateRule(e,t,n){return k.test(e)?new N(e,t,n):null}},u={indent:1,children:!0},T=/@keyframes\s+([\w-]+)/,d=function(){function KeyframesRule(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r,e=e.match(T),e=(e&&e[1]?this.name=e[1]:this.name="noname",this.key=this.type+"-"+this.name,(this.options=n).scoped),i=n.sheet,o=n.generateId;for(r in this.id=!1===e?this.name:Wza(o(this,i)),this.rules=new y(Object(l.a)({},n,{parent:this})),t)this.rules.add(r,t[r],Object(l.a)({},n,{parent:this}));this.rules.process()}return KeyframesRule.prototype.toString=function toString(e){var t=getWhitespaceSymbols(e=void 0===e?u:e).linebreak;if(null==e.indent&&(e.indent=u.indent),null==e.children&&(e.children=u.children),!1===e.children)return this.at+" "+this.id+" {}";e=(e=this.rules.toString(e))&&""+t+e+t;return this.at+" "+this.id+" {"+e+"}"},KeyframesRule}(),M=/@keyframes\s+/,U=/\$([\w-]+)/g,h=function findReferencedKeyframe(e,n){return"string"==typeof e?e.replace(U,function(e,t){return t in n?n[t]:e}):e},p=function replaceRef(e,t,n){var r=e[t],n=h(r,n);n!==r&&(e[t]=n)},f={onCreateRule:function onCreateRule(e,t,n){return"string"==typeof e&&M.test(e)?new d(e,t,n):null},onProcessStyle:function onProcessStyle(e,t,n){return"style"===t.type&&n&&("animation-name"in e&&p(e,"animation-name",n.keyframes),"animation"in e&&p(e,"animation",n.keyframes)),e},onChangeValue:function onChangeValue(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return h(e,r.keyframes);default:return e}}},O=function(e){function KeyframeRule(){return e.apply(this,arguments)||this}return Object(i.a)(KeyframeRule,e),KeyframeRule.prototype.toString=function toString(e){var t=this.options.sheet,t=!!t&&t.options.link?Object(l.a)({},e,{allowEmpty:!0}):e;return toCss(this.key,this.style,t)},KeyframeRule}(e),e={onCreateRule:function onCreateRule(e,t,n){return n.parent&&"keyframes"===n.parent.type?new O(e,t,n):null}},L=function(){function FontFaceRule(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return FontFaceRule.prototype.toString=function toString(e){var t=getWhitespaceSymbols(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},e.reset=function reset(){this.registry=[]},e.remove=function remove(e){e=this.registry.indexOf(e);this.registry.splice(e,1)},e.toString=function toString(e){for(var e=void 0===e?{}:e,t=e.attached,n=Object(R.a)(e,["attached"]),r=getWhitespaceSymbols(n).linebreak,i="",o=0;ot.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function findHighestSheet(e,t){for(var n=e.length-1;0<=n;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}t=e.insertionPoint;if(t&&"string"==typeof t){n=function findCommentNode(e){for(var t=Q(),n=0;n=n.length?(A=!!(g=h(o,l)))&&"get"in g&&!("originalValue"in g.get)?g.get:o[l]:(A=I(o,l),o[l]),A&&!a&&(p[c]=o)}}return o}},function(e,t,n){"use strict";n.d(t,"a",function(){return useEventCallback});var r=n(0),i="undefined"!=typeof window?r.useLayoutEffect:r.useEffect;function useEventCallback(e){var t=r.useRef(e);return i(function(){t.current=e}),r.useCallback(function(){return t.current.apply(void 0,arguments)},[])}},function(e,t,n){"use strict";n.d(t,"b",function(){return clone}),n.d(t,"g",function(){return fromValues}),n.d(t,"c",function(){return copy}),n.d(t,"l",function(){return set}),n.d(t,"a",function(){return add}),n.d(t,"k",function(){return scale}),n.d(t,"h",function(){return length}),n.d(t,"m",function(){return squaredLength}),n.d(t,"j",function(){return normalize}),n.d(t,"d",function(){return dot}),n.d(t,"i",function(){return lerp}),n.d(t,"n",function(){return transformMat4}),n.d(t,"o",function(){return transformQuat}),n.d(t,"f",function(){return exactEquals}),n.d(t,"e",function(){return equals});var A=n(17);function clone(e){var t=new A.a(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function fromValues(e,t,n,r){var i=new A.a(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function copy(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function set(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function add(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 scale(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 length(e){var t=e[0],n=e[1],r=e[2],e=e[3];return Math.hypot(t,n,r,e)}function squaredLength(e){var t=e[0],n=e[1],r=e[2],e=e[3];return t*t+n*n+r*r+e*e}function normalize(e,t){var n=t[0],r=t[1],i=t[2],t=t[3],o=n*n+r*r+i*i+t*t;return 0(t&&(e=e.replace(new RegExp("^".concat("/")),"")),e=t!==n.length-1?e.replace(new RegExp("".concat("/","$")),""):e))).join("/")}n.r(r),n.d(r,"dirname",function(){return dirname}),n.d(r,"join",function(){return join});n(316),n(552)},function(e,t,n){"use strict";n.r(t);var o=n(15),a=n(6);t.default=function distance(e,t,n){void 0===n&&(n={});var e=Object(o.getCoord)(e),t=Object(o.getCoord)(t),r=Object(a.degreesToRadians)(t[1]-e[1]),i=Object(a.degreesToRadians)(t[0]-e[0]),e=Object(a.degreesToRadians)(e[1]),t=Object(a.degreesToRadians)(t[1]),r=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(i/2),2)*Math.cos(e)*Math.cos(t);return Object(a.radiansToLength)(2*Math.atan2(Math.sqrt(r),Math.sqrt(1-r)),n.units)}},function(e,t,n){"use strict";n.d(t,"b",function(){return register}),n.d(t,"a",function(){return debug});var r=n(28);let i={};function register(e){i=e}function debug(e){0e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}(e);try{for(o.s();!(n=o.n()).done;){var a=n.value,s=a.properties,A=a.geometry,l=l.addFeature({type:"Feature",properties:s,geometry:A});i.push(r+i.length)}}catch(e){o.e(e)}finally{o.f()}return{updatedData:l.getObject(),editType:"addFeature",editContext:{featureIndexes:i}}}},{key:"getAddFeatureOrBooleanPolygonAction",value:function getAddFeatureOrBooleanPolygonAction(e,t){var n=e,r=this.getSelectedFeature(t),i=t.modeConfig;if(i&&i.booleanOperation){if(!r||"Polygon"!==r.geometry.type&&"MultiPolygon"!==r.geometry.type)return console.warn("booleanOperation only supported for single Polygon or MultiPolygon selection"),null;var o,n="Feature"===n.type?n:{type:"Feature",geometry:n};if("union"===i.booleanOperation)o=(0,a.default)(r,n);else if("difference"===i.booleanOperation)o=(0,s.default)(r,n);else{if("intersection"!==i.booleanOperation)return console.warn("Invalid booleanOperation ".concat(i.booleanOperation)),null;o=(0,A.default)(r,n)}if(!o)return console.warn("Canceling edit. Boolean operation erased entire polygon."),null;i=t.selectedIndexes[0];return{updatedData:new c.ImmutableFeatureCollection(t.data).replaceGeometry(i,o.geometry).getObject(),editType:"unionGeometry",editContext:{featureIndexes:[i]}}}return this.getAddFeatureAction(e,t.data)}},{key:"createTentativeFeature",value:function createTentativeFeature(e){return null}},{key:"handleClick",value:function handleClick(e,t){}},{key:"handlePointerMove",value:function handlePointerMove(e,t){var n=this.createTentativeFeature(t);n&&t.onEdit({updatedData:t.data,editType:"updateTentativeFeature",editContext:{feature:n}})}},{key:"handleStartDragging",value:function handleStartDragging(e,t){}},{key:"handleStopDragging",value:function handleStopDragging(e,t){}},{key:"handleDragging",value:function handleDragging(e,t){}},{key:"handleKeyUp",value:function handleKeyUp(e,t){"Escape"===e.key&&(this.resetClickSequence(),t.onEdit({updatedData:t.data,editType:"cancelFeature",editContext:{}}))}}]),GeoJsonEditMode}();t.GeoJsonEditMode=n},function(e,t,n){"use strict";var n=n(373),r="object"==typeof self&&self&&self.Object===Object&&self,n=n.a||r||Function("return this")();t.a=n},function(e,t,n){"use strict";n.d(t,"a",function(){return Buffer});var t=n(72),i=n(119),l=n(95),c=n(7),g=n(14),r=n(284);n={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"};const o={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:n},a={removedProps:n};class Buffer extends t.a{constructor(e,t={}){super(e,t),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=t.target||(this.gl.webgl2?36662:34962),this.initialize(t),Object.seal(this)}getElementCount(e=this.accessor){return Math.round(this.byteLength/i.a.getBytesPerElement(e))}getVertexCount(e=this.accessor){return Math.round(this.byteLength/i.a.getBytesPerVertex(e))}initialize(e={}){return ArrayBuffer.isView(e)&&(e={data:e}),Number.isFinite(e)&&(e={byteLength:e}),e=Object(r.a)("Buffer",e,o),this.usage=e.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},e,e.accessor)),e.data?this._setData(e.data,e.offset,e.byteLength):this._setByteLength(e.byteLength||0),this}setProps(e){return"accessor"in(e=Object(r.a)("Buffer",e,a))&&this.setAccessor(e.accessor),this}setAccessor(e){return delete(e=Object.assign({},e)).buffer,this.accessor=new i.a(e),this}reallocate(e){return e>this.byteLength?(this._setByteLength(e),!0):(this.bytesUsed=e,!1)}setData(e){return this.initialize(e)}subData(e){var{data:t,offset:n=0,srcOffset:r=0}=e=ArrayBuffer.isView(e)?{data:e}:e,e=e.byteLength||e.length,i=(Object(g.a)(t),this.gl.webgl2?36663:this.target);return this.gl.bindBuffer(i,this.handle),0!==r||void 0!==e?(Object(c.a)(this.gl),this.gl.bufferSubData(this.target,n,t,r,e)):this.gl.bufferSubData(i,n,t),this.gl.bindBuffer(i,null),this.debugData=null,this._inferType(t),this}copyData({sourceBuffer:e,readOffset:t=0,writeOffset:n=0,size:r}){const i=this["gl"];return Object(c.a)(i),i.bindBuffer(36662,e.handle),i.bindBuffer(36663,this.handle),i.copyBufferSubData(36662,36663,t,n,r),i.bindBuffer(36662,null),i.bindBuffer(36663,null),this.debugData=null,this}getData({dstData:e=null,srcByteOffset:t=0,dstOffset:n=0,length:r=0}={}){Object(c.a)(this.gl);const i=Object(l.c)(this.accessor.type||5126,{clamped:!1});var o=this._getAvailableElementCount(t),a=n;let s,A;e?(A=e.length,s=A-a):(s=Math.min(o,r||o),A=a+s);a=Math.min(o,s);return r=r||a,Object(g.a)(r<=a),e=e||new i(A),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,t,e,n,r),this.gl.bindBuffer(36662,null),e}bind({target:e=this.target,index:t=this.accessor&&this.accessor.index,offset:n=0,size:r}={}){return 35345===e||35982===e?void 0!==r?this.gl.bindBufferRange(e,t,this.handle,n,r):(Object(g.a)(0===n),this.gl.bindBufferBase(e,t,this.handle)):this.gl.bindBuffer(e,this.handle),this}unbind({target:e=this.target,index:t=this.accessor&&this.accessor.index}={}){return 35345===e||35982===e?this.gl.bindBufferBase(e,t,null):this.gl.bindBuffer(e,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(e,t=0,n=e.byteLength+t){Object(g.a)(ArrayBuffer.isView(e)),this._trackDeallocatedMemory();var r=this._getTarget(),r=(this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,this.usage),this.gl.bufferSubData(r,t,e),this.gl.bindBuffer(r,null),this.debugData=e.slice(0,10),this.bytesUsed=n,this._trackAllocatedMemory(n),Object(l.b)(e));return Object(g.a)(r),this.setAccessor(new i.a(this.accessor,{type:r})),this}_setByteLength(e,t=this.usage){Object(g.a)(0<=e),this._trackDeallocatedMemory();let n=e;0===e&&(n=new Float32Array(0));var r=this._getTarget();return this.gl.bindBuffer(r,this.handle),this.gl.bufferData(r,n,t),this.gl.bindBuffer(r,null),this.usage=t,this.debugData=null,this.bytesUsed=e,this._trackAllocatedMemory(e),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(e){e/=Object(l.c)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(e){this.accessor.type||this.setAccessor(new i.a(this.accessor,{type:Object(l.b)(e)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(e){this.gl.bindBuffer(this.target,this.handle);e=this.gl.getBufferParameter(this.target,e);return this.gl.bindBuffer(this.target,null),e}get type(){return c.k.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return c.k.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(e){return c.k.deprecated("setByteLength","reallocate")(),this.reallocate(e)}updateAccessor(e){return c.k.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new i.a(this.accessor,e),this}}},function(F,e,t){"use strict";t.d(e,"a",function(){return axis_aligned_bounding_box_AxisAlignedBoundingBox}),t.d(e,"b",function(){return bounding_sphere_BoundingSphere}),t.d(e,"d",function(){return oriented_bounding_box_OrientedBoundingBox}),t.d(e,"c",function(){return culling_volume_CullingVolume}),t.d(e,"e",function(){return plane_Plane}),t.d(e,"f",function(){return makeOrientedBoundingBoxFromPoints});const s=Object.freeze({OUTSIDE:-1,INTERSECTING:0,INSIDE:1});var Q=t(198);const i=new Q.a,r=new Q.a;class axis_aligned_bounding_box_AxisAlignedBoundingBox{constructor(e=[0,0,0],t=[0,0,0],n=null){n=n||i.copy(e).add(t).scale(.5),this.center=new Q.a(n),this.halfDiagonal=new Q.a(t).subtract(this.center),this.minimum=new Q.a(e),this.maximum=new Q.a(t)}clone(){return new axis_aligned_bounding_box_AxisAlignedBoundingBox(this.minimum,this.maximum,this.center)}equals(e){return this===e||Boolean(e)&&this.minimum.equals(e.minimum)&&this.maximum.equals(e.maximum)}transform(e){return this.center.transformAsPoint(e),this.halfDiagonal.transform(e),this.minimum.transform(e),this.maximum.transform(e),this}intersectPlane(e){var t=this["halfDiagonal"],n=r.from(e.normal),t=t.x*Math.abs(n.x)+t.y*Math.abs(n.y)+t.z*Math.abs(n.z),n=this.center.dot(n)+e.distance;return 0this.radius&&(this.radius=e),this}transform(e){this.center.transform(e);e=n.e(a,e);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(e){e=this.distanceTo(e);return e*e}distanceTo(e){const t=(e=a.from(e)).subtract(this.center);return Math.max(0,t.len()-this.radius)}intersectPlane(e){var t=this.center,n=this.radius;const r=e.normal;t=r.dot(t)+e.distance;return t<-n?s.OUTSIDE:te instanceof plane_Plane))}fromBoundingSphere(e){this.planes.length=2*y.length;var n=e.center,r=e.radius;let i=0;for(const a of y){let e=this.planes[i],t=this.planes[i+1];e=e||(this.planes[i]=new plane_Plane),t=t||(this.planes[i+1]=new plane_Plane);var o=B.copy(a).scale(-r).add(n),o=(a.dot(o),e.fromPointNormal(o,a),B.copy(a).scale(r).add(n));const s=G.copy(a).negate();s.dot(o);t.fromPointNormal(o,s),i+=2}return this}computeVisibility(e){Object(u.a)(e);let t=s.INSIDE;for(const n of this.planes)switch(e.intersectPlane(n)){case s.OUTSIDE:return s.OUTSIDE;case s.INTERSECTING:t=s.INTERSECTING}return t}computeVisibilityWithPlaneMask(t,n){if(Object(u.a)(t,"boundingVolume is required."),Object(u.a)(Number.isFinite(n),"parentPlaneMask is required."),n===culling_volume_CullingVolume.MASK_OUTSIDE||n===culling_volume_CullingVolume.MASK_INSIDE)return n;let r=culling_volume_CullingVolume.MASK_INSIDE;var i=this.planes;for(let e=0;es;)!function shurDecomposition(t,e){var n=b.a.EPSILON15;let r=0,i=1;for(let e=0;e<3;++e){var o=Math.abs(t[v.getElementIndex(x[e],_[e])]);o>r&&(i=e,r=o)}var a=_[i],s=x[i];let A=1,l=0;if(Math.abs(t[v.getElementIndex(s,a)])>n){var n=t[v.getElementIndex(s,s)],c=t[v.getElementIndex(a,a)],g=t[v.getElementIndex(s,a)],n=(n-c)/2/g;let e;e=n<0?-1/(-n+Math.sqrt(1+n*n)):1/(n+Math.sqrt(1+n*n)),A=1/Math.sqrt(1+e*e),l=e*A}w.a.IDENTITY.to(e),e[v.getElementIndex(a,a)]=e[v.getElementIndex(s,s)]=A,e[v.getElementIndex(s,a)]=l,e[v.getElementIndex(a,s)]=-l}(a,E),S.copy(E).transpose(),a.multiplyRight(E),a.multiplyLeft(S),o.multiplyRight(E),2<++r&&(++i,r=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}const _=[1,0,0],x=[2,2,1];const R=new Q.a,T=new Q.a,M=new Q.a,U=new Q.a,O=new Q.a,L=new w.a,P={diagonal:new w.a,unitary:new w.a};function makeOrientedBoundingBoxFromPoints(e,t=new oriented_bounding_box_OrientedBoundingBox){if(!e||0===e.length)return t.halfAxes=new w.a([0,0,0,0,0,0,0,0,0]),t.center=new Q.a,t;var n=e.length;const r=new Q.a(0,0,0);for(const b of e)r.add(b);n=1/n;r.multiplyByScalar(n);let i=0,o=0,a=0,s=0,A=0,l=0;for(const v of e){var c=R.copy(v).subtract(r);i+=c.x*c.x,o+=c.x*c.y,a+=c.x*c.z,s+=c.y*c.y,A+=c.y*c.z,l+=c.z*c.z}i*=n,o*=n,a*=n,s*=n,A*=n,l*=n;const g=L;g[0]=i,g[1]=o,g[2]=a,g[3]=o,g[4]=s,g[5]=A,g[6]=a,g[7]=A,g[8]=l;n=computeEigenDecomposition(g,P).unitary;const u=t.halfAxes.copy(n);let d=u.getColumn(0,M),h=u.getColumn(1,U),p=u.getColumn(2,O),f=-Number.MAX_VALUE,I=-Number.MAX_VALUE,C=-Number.MAX_VALUE,m=Number.MAX_VALUE,y=Number.MAX_VALUE,B=Number.MAX_VALUE;for(const E of e)R.copy(E),f=Math.max(R.dot(d),f),I=Math.max(R.dot(h),I),C=Math.max(R.dot(p),C),m=Math.min(R.dot(d),m),y=Math.min(R.dot(h),y),B=Math.min(R.dot(p),B);d=d.multiplyByScalar(.5*(m+f)),h=h.multiplyByScalar(.5*(y+I)),p=p.multiplyByScalar(.5*(B+C)),t.center.copy(d).add(h).add(p);n=T.set(f-m,I-y,C-B).multiplyByScalar(.5),e=new w.a([n[0],0,0,0,n[1],0,0,0,n[2]]);return t.halfAxes.multiplyRight(e),t}},function(e,t){var n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.d(t,"a",function(){return createMat4}),n.d(t,"e",function(){return mod}),n.d(t,"c",function(){return getCameraPosition}),n.d(t,"d",function(){return getFrustumPlanes}),n.d(t,"b",function(){return fp64LowPart}),n.d(t,"f",function(){return toDoublePrecisionArray});var A=n(125),o=n(12);function createMat4(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function mod(e,t){e%=t;return e<0?t+e:e}function getCameraPosition(e){return[e[12],e[13],e[14]]}function getFrustumPlanes(e){const t={};return t.left=getFrustumPlane(e[3]+e[0],e[7]+e[4],e[11]+e[8],e[15]+e[12]),t.right=getFrustumPlane(e[3]-e[0],e[7]-e[4],e[11]-e[8],e[15]-e[12]),t.bottom=getFrustumPlane(e[3]+e[1],e[7]+e[5],e[11]+e[9],e[15]+e[13]),t.top=getFrustumPlane(e[3]-e[1],e[7]-e[5],e[11]-e[9],e[15]-e[13]),t.near=getFrustumPlane(e[3]+e[2],e[7]+e[6],e[11]+e[10],e[15]+e[14]),t.far=getFrustumPlane(e[3]-e[2],e[7]-e[6],e[11]-e[10],e[15]-e[14]),t}const a=new o.Vector3;function getFrustumPlane(e,t,n,r){a.set(e,t,n);var i=a.len();return{distance:r/i,normal:new o.Vector3(-e/i,-t/i,-n/i)}}function fp64LowPart(e){return e-Math.fround(e)}let l;function toDoublePrecisionArray(t,{size:n=1,startIndex:e=0,endIndex:r}){var i=((r=Number.isFinite(r)?r:t.length)-e)/n;l=A.a.allocate(l,i,{type:Float32Array,size:2*n});let o=e,a=0;for(;o=n.next.y&&n.next.y!==n.y){var s=n.x+(i-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(s<=r&&s>o){if((o=s)===r){if(i===n.y)return n;if(i===n.next.y)return n.next}a=n.x=n.x&&n.x>=l&&r!==n.x&&pointInTriangle(ia.x||n.x===a.x&&function sectorContainsSector(e,t){return earcut_area(e.prev,e,t.prev)<0&&earcut_area(t.next,e,e.next)<0}(a,n)))&&(a=n,g=u)),n=n.next,n!==A;);return a}(e,t))&&(e=splitPolygon(t,e),filterPoints(t,t.next),filterPoints(e,e.next))}(o[a],n),n=filterPoints(n,n.next);return n}(t,e,a,n,r)),t.length>80*n){d=g=t[0],h=u=t[1];for(let e=n;eg&&(g=s),A>u&&(u=A);c=0!==(c=Math.max(g-d,u-h))?1/c:0}return earcutLinked(a,l,n,d,h,c),l}function linkedList(e,t,n,r,i,o){let a,s;if(i===(o=void 0===o?getPolygonSignedArea(e,{start:t,end:n,size:r}):o)<0)for(a=t;a=t;a-=r)s=insertNode(a,e[a],e[a+1],s);return s&&equals(s,s.next)&&(removeNode(s),s=s.next),s}function filterPoints(e,t){if(!e)return e;t=t||e;let n=e,r;do{if(r=!1,n.steiner||!equals(n,n.next)&&0!==earcut_area(n.prev,n,n.next))n=n.next;else{if(removeNode(n),(n=t=n.prev)===n.next)break;r=!0}}while(r||n!==t);return t}function earcutLinked(t,n,r,i,o,a,s){if(t){!s&&a&&!function indexCurve(e,t,n,r){let i=e;for(;null===i.z&&(i.z=zOrder(i.x,i.y,t,n,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next,i!==e;);i.prevZ.nextZ=null,i.prevZ=null,function sortLinked(e){let t,n,r=1,i,o,a,s,A,l;do{for(o=e,e=null,l=null,i=0;o;){for(i++,s=o,a=0,n=0;no.x?i.x>a.x?i:a:o.x>a.x?o:a).x,c=(i.y>o.y?i.y>a.y?i:a:o.y>a.y?o:a).y,g=zOrder(s,A,t,n,r),u=zOrder(l,c,t,n,r);let d=e.prevZ,h=e.nextZ;for(;d&&d.z>=g&&h&&h.z<=u;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=earcut_area(d.prev,d,d.next))return;if(d=d.prevZ,h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=earcut_area(h.prev,h,h.next))return;h=h.nextZ}for(;d&&d.z>=g;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=earcut_area(d.prev,d,d.next))return;d=d.prevZ}for(;h&&h.z<=u;){if(h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=earcut_area(h.prev,h,h.next))return;h=h.nextZ}return 1}(t,i,o,a):function isEar(e){var t=e.prev,n=e,r=e.next;if(0<=earcut_area(t,n,r))return;let i=e.next.next;for(;i!==e.prev;){if(pointInTriangle(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=earcut_area(i.prev,i,i.next))return;i=i.next}return 1}(t))n.push(A.i/r),n.push(t.i/r),n.push(l.i/r),removeNode(t),t=l.next,e=l.next;else if((t=l)===e){s?1===s?earcutLinked(t=function cureLocalIntersections(e,t,n){let r=e;do{var i=r.prev,o=r.next.next;!equals(i,o)&&intersects(i,r,r.next,o)&&locallyInside(i,o)&&locallyInside(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),removeNode(r),removeNode(r.next),r=e=o),r=r.next}while(r!==e);return filterPoints(r)}(filterPoints(t),n,r),n,r,i,o,a,2):2===s&&function splitEarcut(e,t,n,r,i,o){let a=e;do{let e=a.next.next;for(;e!==a.prev;){var s;if(a.i!==e.i&&function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function intersectsPolygon(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&intersects(n,n.next,e,t))return 1}while(n=n.next,n!==e);return}(e,t)&&(locallyInside(e,t)&&locallyInside(t,e)&&function middleInside(e,t){let n=e,r=!1;var i=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(earcut_area(e.prev,e,t.prev)||earcut_area(e,t.prev,t))||equals(e,t)&&0=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function sign(e){return 0t[2]&&(n|=2),e[1]t[3]&&(n|=8),n}function cutPolylineByGrid(t,e={}){var{size:n=2,broken:r=!1,gridResolution:i=10,gridOffset:e=[0,0],startIndex:o=0,endIndex:a=t.length}=e,s=(a-o)/n;let A=[];const l=[A];var c=getPointAtIndex(t,0,n,o);let g,u;var d=getGridCell(c,i,e,[]),h=[];push(A,c);for(let e=1;en&&(A=[],l.push(A),push(A,c)),u=bitCode(g,d)}push(A,g),copy(c,g)}return r?l:l[0]}const B=0,m=1;function concatInPlace(t,n){for(let e=0;eo?A:o,a=ls?l:s}e[0][0]=i,e[0][1]=a,e[1][0]=o,e[1][1]=s}(g,r,d[0]||g.length,l),c=getGridCell(l[0],i,o,c),bitCode(l[1],c));if(h){var p=bisectPolygon(g,u,r,0,d[0]||g.length,c,h);const f={pos:p[0].pos,types:p[0].types,holes:[]},I={pos:p[1].pos,types:p[1].types,holes:[]};A.push(f,I);for(let e=0;eo&&(o=s,a=e-1)}return a}(t,i,A,c);for(let e=u;ee.delete()),this}bind(e=this.handle){if("function"!=typeof e)return this._bindHandle(e),this;let t;return this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t}unbind(){this.bind(null)}getParameter(e,t={}){e=Object(c.b)(this.gl,e),Object(o.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var r,i=Object(l.j)(this.gl);if(!((!("webgl2"in n)||i)&&(!("extension"in n)||this.gl.getExtension(n.extension))))return r=n.webgl1,n="webgl2"in n?n.webgl2:n.webgl1,i?n:r}return this._getParameter(e,t)}getParameters(e={}){var{parameters:t,keys:n}=e,r=this.constructor.PARAMETERS||{},i=Object(l.j)(this.gl);const o={};for(const A of t||Object.keys(r)){var a,s=r[A];s&&(!("webgl2"in s)||i)&&(!("extension"in s)||this.gl.getExtension(s.extension))&&(a=n?Object(c.a)(this.gl,A):A,o[a]=this.getParameter(A,e),n&&"GLenum"===s.type&&(o[a]=Object(c.a)(this.gl,o[a])))}return o}setParameter(e,t){e=Object(c.b)(this.gl,e),Object(o.a)(e);var n=(this.constructor.PARAMETERS||{})[e];if(n){var r=Object(l.j)(this.gl);if(!((!("webgl2"in n)||r)&&(!("extension"in n)||this.gl.getExtension(n.extension))))throw new Error("Parameter not available on this platform");"GLenum"===n.type&&(t=Object(c.b)(t))}return this._setParameter(e,t),this}setParameters(e){for(const t in e)this.setParameter(t,e[t]);return this}stubRemovedMethods(e,t,n){return Object(a.a)(this,e,t,n)}initialize(e){}_createHandle(){throw new Error(s)}_deleteHandle(){throw new Error(s)}_bindHandle(e){throw new Error(s)}_getOptsFromHandle(){throw new Error(s)}_getParameter(e,t){throw new Error(s)}_setParameter(e,t){throw new Error(s)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){var e=this.constructor.name;const t=r.a.get("Resource Counts");t.get("Resources Created").incrementCount(),t.get(e+"s Created").incrementCount(),t.get(e+"s Active").incrementCount()}_removeStats(){var e=this.constructor.name;const t=r.a.get("Resource Counts");t.get(e+"s Active").decrementCount()}_trackAllocatedMemory(e,t=this.constructor.name){const n=r.a.get("Memory Usage");n.get("GPU Memory").addCount(e),n.get(t+" Memory").addCount(e),this.byteLength=e}_trackDeallocatedMemory(e=this.constructor.name){const t=r.a.get("Memory Usage");t.get("GPU Memory").subtractCount(this.byteLength),t.get(e+" Memory").subtractCount(this.byteLength),this.byteLength=0}}},function(e,t,n){"use strict";n.r(t);var r=n(31);function bbox(e){var t=[1/0,1/0,-1/0,-1/0];return Object(r.coordEach)(e,function(e){t[0]>e[0]&&(t[0]=e[0]),t[1]>e[1]&&(t[1]=e[1]),t[2]e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<+~=|^:(),"'`\s])/g,s="undefined"!=typeof CSS&&CSS.escape,e=function(){function BaseStyleRule(e,t,n){this.type="style",this.isProcessed=!1;var r=n.sheet,i=n.Renderer;this.key=e,this.options=n,this.style=t,r?this.renderer=r.renderer:i&&(this.renderer=new i)}return BaseStyleRule.prototype.prop=function prop(e,t,n){if(void 0===t)return this.style[e];var r=!!n&&n.force;if(!r&&this.style[e]===t)return this;var i=t,n=null==(i=n&&!1===n.process?i:this.options.jss.plugins.onChangeValue(t,e,this))||!1===i,t=e in this.style;if(n&&!t&&!r)return this;r=n&&t;if(r?delete this.style[e]:this.style[e]=i,this.renderable&&this.renderer)return r?this.renderer.removeProperty(this.renderable,e):this.renderer.setProperty(this.renderable,e,i),this;n=this.options.sheet;return n&&n.attached,this},BaseStyleRule}(),A=function(o){function StyleRule(e,t,n){var e=o.call(this,e,t,n)||this,t=n.selector,r=n.scoped,i=n.sheet,n=n.generateId;return t?e.selectorText=t:!1!==r&&(e.id=n(Object(a.a)(Object(a.a)(e)),i),e.selectorText="."+gBa(e.id)),e}Object(i.a)(StyleRule,o);var e=StyleRule.prototype;return e.applyTo=function applyTo(e){var t=this.renderer;if(t){var n,r=this.toJSON();for(n in r)t.setProperty(e,n,r[n])}return this},e.toJSON=function toJSON(){var e,t={};for(e in this.style){var n=this.style[e];"object"!=typeof n?t[e]=n:Array.isArray(n)&&(t[e]=I(n))}return t},e.toString=function toString(e){var t=this.options.sheet,t=!!t&&t.options.link?Object(l.a)({},e,{allowEmpty:!0}):e;return toCss(this.selectorText,this.style,t)},Object(r.a)(StyleRule,[{key:"selector",set:function set(e){var t,n;e!==this.selectorText&&(this.selectorText=e,t=this.renderer,(n=this.renderable)&&t&&(t.setSelector(n,e)||t.replaceRule(n,this)))},get:function get(){return this.selectorText}}]),StyleRule}(e),t={onCreateRule:function onCreateRule(e,t,n){return"@"===e[0]||n.parent&&"keyframes"===n.parent.type?null:new A(e,t,n)}},c={indent:1,children:!0},G=/@([\w-]+)/,N=function(){function ConditionalRule(e,t,n){this.type="conditional",this.isProcessed=!1;var r,e=(this.key=e).match(G);for(r in this.at=e?e[1]:"unknown",this.query=n.name||"@"+this.at,this.options=n,this.rules=new y(Object(l.a)({},n,{parent:this})),t)this.rules.add(r,t[r]);this.rules.process()}var e=ConditionalRule.prototype;return e.getRule=function getRule(e){return this.rules.get(e)},e.indexOf=function indexOf(e){return this.rules.indexOf(e)},e.addRule=function addRule(e,t,n){e=this.rules.add(e,t,n);return e?(this.options.jss.plugins.onProcessRule(e),e):null},e.toString=function toString(e){var t=getWhitespaceSymbols(e=void 0===e?c:e).linebreak;if(null==e.indent&&(e.indent=c.indent),null==e.children&&(e.children=c.children),!1===e.children)return this.query+" {}";e=this.rules.toString(e);return e?this.query+" {"+t+e+t+"}":""},ConditionalRule}(),k=/@media|@supports\s+/,g={onCreateRule:function onCreateRule(e,t,n){return k.test(e)?new N(e,t,n):null}},u={indent:1,children:!0},T=/@keyframes\s+([\w-]+)/,d=function(){function KeyframesRule(e,t,n){this.type="keyframes",this.at="@keyframes",this.isProcessed=!1;var r,e=e.match(T),e=(e&&e[1]?this.name=e[1]:this.name="noname",this.key=this.type+"-"+this.name,(this.options=n).scoped),i=n.sheet,o=n.generateId;for(r in this.id=!1===e?this.name:gBa(o(this,i)),this.rules=new y(Object(l.a)({},n,{parent:this})),t)this.rules.add(r,t[r],Object(l.a)({},n,{parent:this}));this.rules.process()}return KeyframesRule.prototype.toString=function toString(e){var t=getWhitespaceSymbols(e=void 0===e?u:e).linebreak;if(null==e.indent&&(e.indent=u.indent),null==e.children&&(e.children=u.children),!1===e.children)return this.at+" "+this.id+" {}";e=(e=this.rules.toString(e))&&""+t+e+t;return this.at+" "+this.id+" {"+e+"}"},KeyframesRule}(),M=/@keyframes\s+/,U=/\$([\w-]+)/g,h=function findReferencedKeyframe(e,n){return"string"==typeof e?e.replace(U,function(e,t){return t in n?n[t]:e}):e},p=function replaceRef(e,t,n){var r=e[t],n=h(r,n);n!==r&&(e[t]=n)},f={onCreateRule:function onCreateRule(e,t,n){return"string"==typeof e&&M.test(e)?new d(e,t,n):null},onProcessStyle:function onProcessStyle(e,t,n){return"style"===t.type&&n&&("animation-name"in e&&p(e,"animation-name",n.keyframes),"animation"in e&&p(e,"animation",n.keyframes)),e},onChangeValue:function onChangeValue(e,t,n){var r=n.options.sheet;if(!r)return e;switch(t){case"animation":case"animation-name":return h(e,r.keyframes);default:return e}}},O=function(e){function KeyframeRule(){return e.apply(this,arguments)||this}return Object(i.a)(KeyframeRule,e),KeyframeRule.prototype.toString=function toString(e){var t=this.options.sheet,t=!!t&&t.options.link?Object(l.a)({},e,{allowEmpty:!0}):e;return toCss(this.key,this.style,t)},KeyframeRule}(e),e={onCreateRule:function onCreateRule(e,t,n){return n.parent&&"keyframes"===n.parent.type?new O(e,t,n):null}},L=function(){function FontFaceRule(e,t,n){this.type="font-face",this.at="@font-face",this.isProcessed=!1,this.key=e,this.style=t,this.options=n}return FontFaceRule.prototype.toString=function toString(e){var t=getWhitespaceSymbols(e).linebreak;if(Array.isArray(this.style)){for(var n="",r=0;r=this.index)t.push(e);else for(var r=0;rn)return void t.splice(r,0,e)},e.reset=function reset(){this.registry=[]},e.remove=function remove(e){e=this.registry.indexOf(e);this.registry.splice(e,1)},e.toString=function toString(e){for(var e=void 0===e?{}:e,t=e.attached,n=Object(R.a)(e,["attached"]),r=getWhitespaceSymbols(n).linebreak,i="",o=0;ot.index&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e);if(n&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element};if((n=function findHighestSheet(e,t){for(var n=e.length-1;0<=n;n--){var r=e[n];if(r.attached&&r.options.insertionPoint===t.insertionPoint)return r}return null}(t,e))&&n.renderer)return{parent:n.renderer.element.parentNode,node:n.renderer.element.nextSibling}}t=e.insertionPoint;if(t&&"string"==typeof t){n=function findCommentNode(e){for(var t=Q(),n=0;n{if(!g){var r=t*d+h;for(let e=0;e=i&&(c=l.distanceTo(t.cameraPosition)*t.scale/t.height,e+=Math.floor(Math.log2(c))),e>=o)return this.selected=!0}this.selected=!1,this.childVisible=!0;for(const g of this.children)g.update(e);return!0}getSelected(e=[]){if(this.selected&&e.push(this),this._children)for(const t of this._children)t.getSelected(e);return e}insideBounds([e,t,n,r]){var i=Math.pow(2,this.z),i=f/i;return this.x*ie&&(this.y+1)*i>t}getBoundingVolume(e,t,n){if(n){const o=[];for(const a of this.z<1?c:this.z<2?l:A){const s=osmTile2lngLat(this.x+a[0],this.y+a[1],this.z);s[2]=e[0],o.push(n(s)),e[0]!==e[1]&&(s[2]=e[1],o.push(n(s)))}return Object(h.f)(o)}var r=Math.pow(2,this.z),r=f/r,t=this.x*r+t*f,i=f-(this.y+1)*r;return new h.a([t,i,e[0]],[t+r,i+r,e[1]])}}const g=512,u=[-1/0,-1/0,1/0,1/0],r={type:"url",value:null,validate:(e,t)=>t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every(e=>"string"==typeof e),equals:(t,n)=>{if(t===n)return!0;if(!Array.isArray(t)||!Array.isArray(n))return!1;var r=t.length;if(r!==n.length)return!1;for(let e=0;ee[0])),Math.min(...n.map(e=>e[1])),Math.max(...n.map(e=>e[0])),Math.max(...n.map(e=>e[1]))]}function getURLFromTemplate(e,t){if(!e||!e.length)return null;var{x:n,y:r,z:i}=t;return(e=Array.isArray(e)?e[Math.abs(t.x+t.y)%e.length]:e).replace("{x}",n).replace("{y}",r).replace("{z}",i).replace("{-y}",Math.pow(2,i)-r-1)}function getScale(e,t){return Math.pow(2,e)*g/t}function osmTile2lngLat(e,t,n){n=getScale(n,g),t=Math.PI-2*Math.PI*t/n;return[e/n*360-180,180/Math.PI*Math.atan(.5*(Math.exp(t)-Math.exp(-t)))]}function tile2XY(e,t,n,r){n=getScale(n,r);return[e/n*g,t/n*g]}function tileToBoundingBox(e,t,n,r,i=g){if(e.isGeospatial)return[e,o]=osmTile2lngLat(t,n,r),[a,s]=osmTile2lngLat(t+1,n+1,r),{west:e,north:o,east:a,south:s};var[e,o]=tile2XY(t,n,r,i),[a,s]=tile2XY(t+1,n+1,r,i);return{left:e,top:o,right:a,bottom:s}}function getIdentityTileIndices(e,n,t,r,i){var[e,o,a,s]=function getIndexingCoords(e,t,n){return n?transformBox(e,n).map(e=>e*t/g):e.map(e=>e*t/g)}(function getBoundingBox(e,t,n){let r;var i;return r=t&&2===t.length?([t,i]=t,t=e.getBounds({z:t}),i=e.getBounds({z:i}),[Math.min(t[0],i[0]),Math.min(t[1],i[1]),Math.max(t[2],i[2]),Math.max(t[3],i[3])]):e.getBounds(),e.isGeospatial?[Math.max(r[0],n[0]),Math.max(r[1],n[1]),Math.min(r[2],n[2]),Math.min(r[3],n[3])]:[Math.max(Math.min(r[0],n[2]),n[0]),Math.max(Math.min(r[1],n[3]),n[1]),Math.min(Math.max(r[2],n[0]),n[2]),Math.min(Math.max(r[3],n[1]),n[3])]}(e,null,r),getScale(n,t),i);const A=[];for(let t=Math.floor(e);tt&&(l=t);let c=i;return a&&s&&i&&!e.isGeospatial&&(c=transformBox(i,a)),e.isGeospatial?function getOSMTileIndices(e,t,n,r){var i,o,a,s,A=e.resolution?e.projectPosition:null,l=Object.values(e.getFrustumPlanes()).map(({normal:e,distance:t})=>new h.e(e.clone().negate(),t)),l=new h.c(l),c=e.distanceScales.unitsPerMeter[2],g=n&&n[0]*c||0,n=n&&n[1]*c||0,c=e.pitch<=60?t:0;r&&([a,i,o,s]=r,a=Object(p.n)([a,s]),s=Object(p.n)([o,i]),r=[a[0],f-a[1],s[0],f-s[1]]);const u=new tile_2d_traversal_OSMNode(0,0,0),d={viewport:e,project:A,cullingVolume:l,elevationBounds:[g,n],minZ:c,maxZ:t,bounds:r,offset:0};if(u.update(d),e.subViewports&&1I););}return u.getSelected()}(e,l,r,i):getIdentityTileIndices(e,l,o,c||u,s)}function isURLTemplate(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}},function(f,e,t){"use strict";t.r(e),t.d(e,"UNITS",function(){return s}),t.d(e,"h3IndexToSplitLong",function(){return h3IndexToSplitLong}),t.d(e,"splitLongToh3Index",function(){return splitLongToh3Index}),t.d(e,"h3IsValid",function(){return h3IsValid}),t.d(e,"h3IsPentagon",function(){return h3IsPentagon}),t.d(e,"h3IsResClassIII",function(){return h3IsResClassIII}),t.d(e,"h3GetBaseCell",function(){return h3GetBaseCell}),t.d(e,"h3GetFaces",function(){return h3GetFaces}),t.d(e,"h3GetResolution",function(){return h3GetResolution}),t.d(e,"geoToH3",function(){return geoToH3}),t.d(e,"h3ToGeo",function(){return h3ToGeo}),t.d(e,"h3ToGeoBoundary",function(){return h3ToGeoBoundary}),t.d(e,"h3ToParent",function(){return h3ToParent}),t.d(e,"h3ToChildren",function(){return h3ToChildren}),t.d(e,"h3ToCenterChild",function(){return h3ToCenterChild}),t.d(e,"kRing",function(){return kRing}),t.d(e,"kRingDistances",function(){return kRingDistances}),t.d(e,"hexRing",function(){return hexRing}),t.d(e,"polyfill",function(){return polyfill}),t.d(e,"h3SetToMultiPolygon",function(){return h3SetToMultiPolygon}),t.d(e,"compact",function(){return compact}),t.d(e,"uncompact",function(){return uncompact}),t.d(e,"h3IndexesAreNeighbors",function(){return h3IndexesAreNeighbors}),t.d(e,"getH3UnidirectionalEdge",function(){return getH3UnidirectionalEdge}),t.d(e,"getOriginH3IndexFromUnidirectionalEdge",function(){return getOriginH3IndexFromUnidirectionalEdge}),t.d(e,"getDestinationH3IndexFromUnidirectionalEdge",function(){return getDestinationH3IndexFromUnidirectionalEdge}),t.d(e,"h3UnidirectionalEdgeIsValid",function(){return h3UnidirectionalEdgeIsValid}),t.d(e,"getH3IndexesFromUnidirectionalEdge",function(){return getH3IndexesFromUnidirectionalEdge}),t.d(e,"getH3UnidirectionalEdgesFromHexagon",function(){return getH3UnidirectionalEdgesFromHexagon}),t.d(e,"getH3UnidirectionalEdgeBoundary",function(){return getH3UnidirectionalEdgeBoundary}),t.d(e,"h3Distance",function(){return h3Distance}),t.d(e,"h3Line",function(){return h3Line}),t.d(e,"experimentalH3ToLocalIj",function(){return experimentalH3ToLocalIj}),t.d(e,"experimentalLocalIjToH3",function(){return experimentalLocalIjToH3}),t.d(e,"pointDist",function(){return pointDist}),t.d(e,"cellArea",function(){return cellArea}),t.d(e,"exactEdgeLength",function(){return exactEdgeLength}),t.d(e,"hexArea",function(){return hexArea}),t.d(e,"edgeLength",function(){return edgeLength}),t.d(e,"numHexagons",function(){return numHexagons}),t.d(e,"getRes0Indexes",function(){return getRes0Indexes}),t.d(e,"getPentagonIndexes",function(){return getPentagonIndexes}),t.d(e,"degsToRads",function(){return degsToRads}),t.d(e,"radsToDegs",function(){return radsToDegs});var Ee=function(s){var e,r=void 0!==(s=(typeof Ee==="object"?Ee:{})||{})?s:{},A={};for(e in r)r.hasOwnProperty(e)&&(A[e]=r[e]);var l="";var l=0!==(l=document.currentScript?document.currentScript.src:l).indexOf("blob:")?l.substr(0,l.lastIndexOf("/")+1):"",h=function readAsync(t,n,r){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function xhr_onload(){var e;200==i.status||0==i.status&&i.response?n(i.response):(e=tryParseAsDataURI(t))?n(e.buffer):r()},i.onerror=r,i.send(null)},p=r.print||console.log.bind(console),f=r.printErr||console.warn.bind(console);for(e in A)A.hasOwnProperty(e)&&(r[e]=A[e]);A=null,r.arguments&&r.arguments;function hUa(){return I}var I=0;var C=!1;function getCFunc(e){var t=r["_"+e];return function assert(e,t){e||abort("Assertion failed: "+t)}(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function ccall(e,t,n,r){var i={string:function(e){var t,n=0;return null!=e&&0!==e&&(t=1+(e.length<<2),function stringToUTF8(e,t,n){(function stringToUTF8Array(e,t,n,r){if(!(0>6,t[n++]=128|63&A}else if(A<=65535){if(o<=n+2)break;t[n++]=224|A>>12,t[n++]=128|A>>6&63,t[n++]=128|63&A}else{if(o<=n+3)break;t[n++]=240|A>>18,t[n++]=128|A>>12&63,t[n++]=128|A>>6&63,t[n++]=128|63&A}}t[n]=0})(e,E,t,n)}(e,n=Be(t),t)),n},array:function(e){var t=Be(e.length);return function writeArrayToMemory(e,t){v.set(e,t)}(e,t),t}};var e=getCFunc(e),o=[],a=0;if(r)for(var s=0;s>10,56320|1023&s)))):o+=String.fromCharCode(A)}return o}(E,e,t):""}var b,v,E,Q,w,S,x;"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");function alignUp(e,t){return 0>2,n=(3&o)<<6|(a=s.indexOf(e.charAt(l++))),A+=String.fromCharCode(r<<2|i>>4),64!==o&&(A+=String.fromCharCode(t)),64!==a&&(A+=String.fromCharCode(n)),l>2]=e),e},f:_emscripten_get_heap_size,g:function _emscripten_memcpy_big(e,t,n){E.set(E.subarray(t,t+n),e)},h:function _emscripten_resize_heap(e){var t=v.length,n=16777216;if(2130706432>2]))){if(i=+sb(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1!=(0|t))for(e=1;i+=+sb(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n),(0|e)<(0|t););}else i=0;return U=o,6371.007180918475*i*6371.007180918475},_cellAreaM2:function vb(e,t){var n,r,i=0,o=U;if(U=U+192|0,Vb(e|=0,t|=0,n=(r=o)+168|0),Wb(e,t,r),0<(0|(t=0|G[r>>2]))){if(i=+sb(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1!=(0|t))for(e=1;i+=+sb(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n),(0|e)<(0|t););}else i=0;return U=o,6371.007180918475*i*6371.007180918475*1e3*1e3},_cellAreaRads2:function tb(e,t){var n,r,i=0,o=U;if(U=U+192|0,Vb(e|=0,t|=0,n=(r=o)+168|0),Wb(e,t,r),(0|(t=0|G[r>>2]))<=0)return U=o,+(i=0);if(i=+sb(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1==(0|t))return U=o,+i;for(e=1;i+=+sb(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n),(0|e)<(0|t););return U=o,+i},_compact:function Hb(e,t,n){t|=0;var r,i,o,a,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0,E=0;if(!(n|=0))return(v=0)|v;if(s=0|G[(A=e|=0)>>2],!0&0==(15728640&(A=0|G[A+4>>2])|0)){if((0|n)<=0)return(v=0)|v;if(G[(v=t)>>2]=s,G[v+4>>2]=A,1==(0|n))return(v=0)|v;for(s=1;b=0|G[(B=e+(s<<3)|0)+4>>2],G[(v=t+(s<<3)|0)>>2]=G[B>>2],G[v+4>>2]=b,(0|(s=s+1|0))!=(0|n););return(s=0)|s}if(!(b=0|Wc(B=n<<3)))return 0|(v=-3);if(gd(0|b,0|e,0|B),!(a=0|Yc(n,8)))return Xc(b),0|(v=-3);s=n;e:for(;;){y=0|cd(0|(h=0|G[(c=b)>>2]),0|(c=0|G[c+4>>2]),52),T(),o=(y&=15)-1|0,i=0<(0|s);t:do{if(i){if(r=((0|s)<0)<<31>>31,C=0|dd(0|o,0,52),m=0|T(),15>>0)for(A=0,e=h,n=c;;){if(!(0==(0|e)&0==(0|n))){if(l=0|cd(0|e,0|n,52),T(),g=(0|(l&=15))<(0|o),l=(0|l)==(0|o),n=0|bd(0|(d=!g&&l?e:0),0|(e=!g&&l?n:0),0|s,0|r),T(),0==(0|(u=0|G[(g=l=a+(n<<3)|0)>>2]))&0==(0|(g=0|G[g+4>>2])))n=d;else for(C=0,I=n,f=g,n=d;;){if((0|s)<(0|C)){v=41;break e}if((0|u)==(0|n)&(-117440513&f|0)==(0|e)){d=0|cd(0|u,0|f,56),T(),p=(d&=7)+1|0,m=0|cd(0|u,0|f,45),T();n:do{if(0|la(127&m)){if(u=0|cd(0|u,0|f,52),T(),!(u&=15)){g=6;break}for(g=1;;){if(!(0==((m=0|dd(7,0,3*(15-g|0)|0))&n|0)&0==((0|T())&e|0))){g=7;break n}if(!(g>>>0>>0)){g=6;break}g=g+1|0}}else g=7}while(0);if(g>>>0<(d+2|0)>>>0){v=51;break e}m=0|dd(0|p,0,56),e=0|T()|-117440513&e,G[(g=l)>>2]=0,G[g+4>>2]=0,g=I,n|=m}else g=(I+1|0)%(0|s)|0;if(0==(0|(u=0|G[(f=l=a+(g<<3)|0)>>2]))&0==(0|(f=0|G[f+4>>2])))break;C=C+1|0,I=g}G[(m=l)>>2]=n,G[m+4>>2]=e}if((0|s)<=(0|(A=A+1|0)))break t;e=0|G[(n=b+(A<<3)|0)>>2],n=0|G[n+4>>2]}for(A=0,e=h,n=c;;){if(!(0==(0|e)&0==(0|n))){if(g=0|cd(0|e,0|n,52),T(),(0|o)<=(0|(g&=15))){if((0|g)!=(0|o)&&(e|=C,n=-15728641&n|m,y>>>0<=g>>>0))for(l=o;I=0|dd(7,0,3*(14-l|0)|0),l=l+1|0,e|=I,n=0|T()|n,l>>>0>>0;);}else n=e=0;if(g=0|bd(0|e,0|n,0|s,0|r),T(),!(0==(0|(d=0|G[(u=l=a+(g<<3)|0)>>2]))&0==(0|(u=0|G[u+4>>2]))))for(I=0;;){if((0|s)<(0|I)){v=41;break e}if((0|d)==(0|e)&(-117440513&u|0)==(0|n)){p=0|cd(0|d,0|u,56),T(),f=(p&=7)+1|0,E=0|cd(0|d,0|u,45),T();n:do{if(0|la(127&E)){if(d=0|cd(0|d,0|u,52),T(),!(d&=15)){u=6;break}for(u=1;;){if(!(0==((E=0|dd(7,0,3*(15-u|0)|0))&e|0)&0==((0|T())&n|0))){u=7;break n}if(!(u>>>0>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if(u>>>0<(p+2|0)>>>0){v=51;break e}E=0|dd(0|f,0,56),n=0|T()|-117440513&n,G[(f=l)>>2]=0,G[f+4>>2]=0,e|=E}else g=(g+1|0)%(0|s)|0;if(0==(0|(d=0|G[(u=l=a+(g<<3)|0)>>2]))&0==(0|(u=0|G[u+4>>2])))break;I=I+1|0}G[(E=l)>>2]=e,G[E+4>>2]=n}if((0|s)<=(0|(A=A+1|0)))break t;e=0|G[(n=b+(A<<3)|0)>>2],n=0|G[n+4>>2]}}}while(0);if((s+5|0)>>>0<11){v=99;break}if(!(m=0|Yc((0|s)/6|0,8))){v=58;break}t:do{if(i){f=I=0;do{if(!(0==(0|(A=0|G[(e=g=a+(I<<3)|0)>>2]))&0==(0|(e=0|G[e+4>>2])))){u=0|cd(0|A,0|e,56),T(),n=(u&=7)+1|0,d=-117440513&e,E=0|cd(0|A,0|e,45),T();n:do{if(0|la(127&E)){if(p=0|cd(0|A,0|e,52),T(),0|(p&=15))for(l=1;;){if(!(0==(A&(E=0|dd(7,0,3*(15-l|0)|0))|0)&0==(d&(0|T())|0)))break n;if(!(l>>>0

>>0))break;l=l+1|0}A|=e=0|dd(0|n,0,56),e=0|T()|d,G[(n=g)>>2]=A,G[n+4>>2]=e,n=u+2|0}}while(0);7==(0|n)&&(G[(E=m+(f<<3)|0)>>2]=A,G[E+4>>2]=-117440513&e,f=f+1|0)}}while((0|(I=I+1|0))!=(0|s));if(i){if(C=((0|s)<0)<<31>>31,p=0|dd(0|o,0,52),I=0|T(),15>>0)for(A=e=0;;){do{if(!(0==(0|h)&0==(0|c))){for(u=0|cd(0|h,0|c,52),T(),l=(0|(u&=15))<(0|o),u=(0|u)==(0|o),l=0|bd(0|(g=!l&&u?h:0),0|(u=!l&&u?c:0),0|s,0|C),T(),n=0;;){if((0|s)<(0|n)){v=98;break e}if((-117440513&(d=0|G[(E=a+(l<<3)|0)+4>>2])|0)==(0|u)&&(0|G[E>>2])==(0|g)){v=70;break}if((0|G[(E=a+((l=(l+1|0)%(0|s)|0)<<3)|0)>>2])==(0|g)&&(0|G[E+4>>2])==(0|u))break;n=n+1|0}if(70==(0|v)&&!(v=0)&100663296==(117440512&d|0))break;G[(E=t+(A<<3)|0)>>2]=h,G[E+4>>2]=c,A=A+1|0}}while(0);if((0|s)<=(0|(e=e+1|0))){s=f;break t}h=0|G[(c=b+(e<<3)|0)>>2],c=0|G[c+4>>2]}for(A=e=0;;){do{if(!(0==(0|h)&0==(0|c))){if(u=0|cd(0|h,0|c,52),T(),(0|o)<=(0|(u&=15)))if((0|u)!=(0|o))if(n=h|p,l=-15728641&c|I,u>>>0>>0)u=l;else{for(g=o;E=0|dd(7,0,3*(14-g|0)|0),g=g+1|0,n|=E,l=0|T()|l,g>>>0>>0;);u=l}else n=h,u=c;else u=n=0;for(g=0|bd(0|n,0|u,0|s,0|C),T(),l=0;;){if((0|s)<(0|l)){v=98;break e}if((-117440513&(d=0|G[(E=a+(g<<3)|0)+4>>2])|0)==(0|u)&&(0|G[E>>2])==(0|n)){v=93;break}if((0|G[(E=a+((g=(g+1|0)%(0|s)|0)<<3)|0)>>2])==(0|n)&&(0|G[E+4>>2])==(0|u))break;l=l+1|0}if(93==(0|v)&&!(v=0)&100663296==(117440512&d|0))break;G[(E=t+(A<<3)|0)>>2]=h,G[E+4>>2]=c,A=A+1|0}}while(0);if((0|s)<=(0|(e=e+1|0))){s=f;break t}h=0|G[(c=b+(e<<3)|0)>>2],c=0|G[c+4>>2]}}else A=0,s=f}else s=A=0}while(0);if(hd(0|a,0,0|B),gd(0|b,0|m,s<<3|0),Xc(m),!s)break;t=t+(A<<3)|0}return 41==(0|v)?(Xc(b),Xc(a),0|(E=-1)):51==(0|v)?(Xc(b),Xc(a),0|(E=-2)):58==(0|v)?(Xc(b),Xc(a),0|(E=-3)):98==(0|v)?(Xc(m),Xc(b),Xc(a),0|(E=-1)):(99==(0|v)&&gd(0|t,0|b,s<<3|0),Xc(b),Xc(a),(E=0)|E)},_destroyLinkedPolygon:function jc(e){var t=0,n=0,r=0,i=0;if(e|=0)for(r=1;;){if(0|(t=0|G[e>>2]))do{if(0|(n=0|G[t>>2]))for(;n=0|G[(i=n)+16>>2],Xc(i),0!=(0|n););}while(t=0|G[(i=t)+8>>2],Xc(i),0!=(0|t));if(e=0|G[(t=e)+8>>2],r||Xc(t),!e)break;r=0}},_edgeLengthKm:function pb(e){return+N[20752+((e|=0)<<3)>>3]},_edgeLengthM:function qb(e){return+N[20880+((e|=0)<<3)>>3]},_emscripten_replace_memory:function V(e){return m=new Int8Array(e),new Uint8Array(e),G=new Int32Array(e),new Float32Array(e),N=new Float64Array(e),!0},_exactEdgeLengthKm:function xb(e,t){var n,r,i,o=0,a=0,s=0,A=0,l=U;if(U=U+176|0,gc(e|=0,t|=0,n=l),(0|(e=0|G[n>>2]))<=1)return U=l,+(s=0);for(t=e+-1|0,o=e=0,a=+N[n+8>>3],s=+N[n+16>>3];i=a,a=+N[n+8+((e=e+1|0)<<4)>>3],A=+u(.5*(a-i)),r=s,s=+N[n+8+(e<<4)+8>>3],r=A*A+(r=+u(.5*(s-r)))*(+g(+i)*+g(+a)*r),o+=2*+d(+c(r),+c(1-r)),(0|e)!=(0|t););return U=l,+(A=6371.007180918475*o)},_exactEdgeLengthM:function yb(e,t){var n,r,i,o=0,a=0,s=0,A=0,l=U;if(U=U+176|0,gc(e|=0,t|=0,n=l),(0|(e=0|G[n>>2]))<=1)return U=l,+(s=0);for(t=e+-1|0,o=e=0,a=+N[n+8>>3],s=+N[n+16>>3];i=a,a=+N[n+8+((e=e+1|0)<<4)>>3],A=+u(.5*(a-i)),r=s,s=+N[n+8+(e<<4)+8>>3],r=A*A+(r=+u(.5*(s-r)))*(+g(+i)*+g(+a)*r),o+=2*+d(+c(r),+c(1-r)),(0|e)!=(0|t););return U=l,+(A=6371.007180918475*o*1e3)},_exactEdgeLengthRads:function wb(e,t){var n,r,i,o,a=0,s=0,A=0,l=U;if(U=U+176|0,gc(e|=0,t|=0,n=l),(0|(e=0|G[n>>2]))<=1)return U=l,+(A=0);for(t=e+-1|0,a=e=0,s=+N[n+8>>3],A=+N[n+16>>3];i=s,s=+N[n+8+((e=e+1|0)<<4)>>3],o=+u(.5*(s-i)),r=A,A=+N[n+8+(e<<4)+8>>3],r=o*o+(r=+u(.5*(A-r)))*(+g(+s)*+g(+i)*r),a+=2*+d(+c(r),+c(1-r)),(0|e)<(0|t););return U=l,+a},_experimentalH3ToLocalIj:function oc(e,t,n,r,i){i|=0;var o=U;return U=U+16|0,(e=0|mc(e|=0,t|=0,n|=0,r|=0,t=o))||(function Ua(e,t){var n=0|G[(e|=0)+8>>2];G[(t|=0)>>2]=(0|G[e>>2])-n,G[t+4>>2]=(0|G[e+4>>2])-n}(t,i),e=0),U=o,0|e},_experimentalLocalIjToH3:function pc(e,t,n,r){e|=0,t|=0,r|=0;var i=U;return U=U+16|0,function Va(e,t){var n,r,i,o=0,a=0,s=0,a=0|G[(e|=0)>>2];G[(t|=0)>>2]=a,e=0|G[e+4>>2],o=(G[(r=t+4|0)>>2]=e)-a|(G[(i=t+8|0)>>2]=0),(0|a)<0?(e=0-a|0,G[r>>2]=o,G[i>>2]=e,a=G[t>>2]=0):(o=e,e=0),(0|o)<0&&(G[t>>2]=a=a-o|0,G[i>>2]=e=e-o|0,o=G[r>>2]=0),n=a-e|0,s=o-e|0,(0|e)<0?(G[t>>2]=n,o=G[r>>2]=s,s=n,e=G[i>>2]=0):s=a,(0|(a=(0|e)<(0|(a=(0|o)<(0|s)?o:s))?e:a))<=0||(G[t>>2]=s-a,G[r>>2]=o-a,G[i>>2]=e-a)}(n|=0,n=i),r=0|nc(e,t,n,r),U=i,0|r},_free:Xc,_geoToH3:Sb,_getDestinationH3IndexFromUnidirectionalEdge:function cc(e,t){e|=0;var n,r=0,i=U;return U=U+16|0,r=i,U=(!0&268435456==(2013265920&(t|=0)|0)?(n=0|cd(0|e,0|t,56),T(),r=(G[r>>2]=0)|da(e,-2130706433&t|134217728,7&n,r),t=0|T(),y(0|t)):y((r=t=0)|t),i),0|r},_getH3IndexesFromUnidirectionalEdge:function ec(e,t,n){e|=0;var r,i,o,a=0,s=U;U=U+16|0,r=s,i=-2130706433&(t|=0)|134217728,G[(a=n|=0)>>2]=(o=!0&268435456==(2013265920&t|0))?e:0,G[a+4>>2]=o?i:0,t=o?(t=0|cd(0|e,0|t,56),T(),e=(G[r>>2]=0)|da(e,i,7&t,r),0|T()):e=0,G[(a=n+8|0)>>2]=e,G[4+a>>2]=t,U=s},_getH3UnidirectionalEdge:function ac(e,t,n,r){var i,o,a=0,s=0,A=0,l=0,c=U;if(U=U+16|0,o=c,!(0|$b(e|=0,t|=0,n|=0,r|=0)))return y((A=s=0)|s),U=c,0|A;for(s=-2130706433&t,a=(a=0==(0|Fb(e,t)))?1:2;;){if(i=a+1|(G[o>>2]=0),(0|(l=0|da(e,t,a,o)))==(0|n)&(0|T())==(0|r))break;if(!(i>>>0<7)){e=a=0,A=6;break}a=i}return 6==(0|A)?(y(0|a),U=c,0|e):(l=0|dd(0|a,0,56),A=0|s|T()|268435456,l|=e,y(0|A),U=c,0|l)},_getH3UnidirectionalEdgeBoundary:gc,_getH3UnidirectionalEdgesFromHexagon:function fc(e,t,n){n|=0;var r,i=0==(0|Fb(e|=0,t|=0));t&=-2130706433,G[(r=n)>>2]=i?e:0,G[r+4>>2]=i?285212672|t:0,G[(r=n+8|0)>>2]=e,G[4+r>>2]=301989888|t,G[(r=n+16|0)>>2]=e,G[4+r>>2]=318767104|t,G[(r=n+24|0)>>2]=e,G[4+r>>2]=335544320|t,G[(r=n+32|0)>>2]=e,G[4+r>>2]=352321536|t,G[(n=n+40|0)>>2]=e,G[n+4>>2]=369098752|t},_getOriginH3IndexFromUnidirectionalEdge:function bc(e,t){var n;return e|=0,y(0|((n=!0&268435456==(2013265920&(t|=0)|0))?-2130706433&t|134217728:0)),0|(n?e:0)},_getPentagonIndexes:_b,_getRes0Indexes:function va(e){e|=0;for(var t,n,r=0,r=0;dd(0|r,0,45),n=134225919|T(),G[(t=e+(r<<3)|0)>>2]=-1,G[4+t>>2]=n,122!=(0|(r=r+1|0)););},_h3Distance:function qc(e,t,n,r){n|=0,r|=0;var i,o,a=U;return U=U+32|0,e=0==(0|mc(e|=0,t|=0,e,t,i=(o=a)+12|0))&&0==(0|mc(e,t,n,r,o))?0|Ta(i,o):-1,U=a,0|e},_h3GetBaseCell:Ab,_h3GetFaces:function Yb(e,t,n){n|=0;var r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=U;U=U+128|0,l=g+112|0,o=g+96|0,c=g,i=0|cd(0|(e|=0),0|(t|=0),52),T(),G[l>>2]=s=15&i,a=0|cd(0|e,0|t,45),T(),a&=127;e:do{if(0|la(a)){if(0|s)for(r=1;;){if(!(0==((A=0|dd(7,0,3*(15-r|0)|0))&e|0)&0==((0|T())&t|0))){i=0;break e}if(!(r>>>0>>0))break;r=r+1|0}if(!(1&i))return A=0|dd(s+1|0,0,52),c=0|T()|-15728641&t,Yb((A|e)&~(l=0|dd(7,0,3*(14-s|0)|0)),c&~(0|T()),n),void(U=g);i=1}else i=0}while(0);Ub(e,t,o),A=i?(bb(o,l,c),5):(fb(o,l,c),6);e:do{if(0|la(a))if(s)for(r=1;;){if(!(0==((a=0|dd(7,0,3*(15-r|0)|0))&e|0)&0==((0|T())&t|0))){r=8;break e}if(!(r>>>0>>0)){r=20;break}r=r+1|0}else r=20;else r=8}while(0);if(hd(0|n,-1,0|r),i){i=0;do{for(function db(e,t){e|=0,t|=0;for(;2==(0|(0|cb(e,t,0,1))););}(o=c+(i<<4)|0,0|G[l>>2]),o=0|G[o>>2],r=0;!(-1==(0|(s=0|G[(a=n+(r<<2)|0)>>2]))|(0|s)==(0|o));)r=r+1|0}while(G[a>>2]=o,(0|(i=i+1|0))!=(0|A))}else{i=0;do{for(cb(o=c+(i<<4)|0,0|G[l>>2],0,1),o=0|G[o>>2],r=0;!(-1==(0|(s=0|G[(a=n+(r<<2)|0)>>2]))|(0|s)==(0|o));)r=r+1|0}while(G[a>>2]=o,(0|(i=i+1|0))!=(0|A))}U=g},_h3GetResolution:function zb(e,t){return t=0|cd(0|(e|=0),0|(t|=0),52),T(),15&t|0},_h3IndexesAreNeighbors:$b,_h3IsPentagon:Fb,_h3IsResClassIII:function Kb(e,t){return t=0|cd(0|(e|=0),0|(t|=0),52),T(),1&t|0},_h3IsValid:Bb,_h3Line:function sc(e,t,n,r,i){n|=0,r|=0,i|=0;var o,a,s,A,l,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=U;if(U=U+48|0,g=b+12|0,0!=(0|mc(e|=0,t|=0,e,t,c=(B=b)+24|0))||0!=(0|mc(e,t,n,r,g)))return U=b,0|(B=-1);if((0|(A=0|Ta(c,g)))<0)return U=b,0|(B=A);for(G[c>>2]=0,G[c+4>>2]=0,G[c+8>>2]=0,G[g>>2]=0,G[g+4>>2]=0,G[g+8>>2]=0,mc(e,t,e,t,c),mc(e,t,n,r,g),Wa(c),Wa(g),p=A?(n=u=0|G[(y=c)>>2],r=d=0|G[(C=c+4|0)>>2],c=h=0|G[(m=c+8|0)>>2],f=((0|G[g>>2])-u|0)/(p=0|A),I=((0|G[g+4>>2])-d|0)/p,((0|G[g+8>>2])-h|0)/p):(C=r=c+4|0,m=h=c+8|0,n=0|G[(y=c)>>2],r=0|G[r>>2],c=0|G[h>>2],I=f=0),G[B>>2]=n,G[(h=B+4|0)>>2]=r,G[(d=B+8|0)>>2]=c,u=0;;){l=f*(a=0|u)+(0|n),o=I*a+(0|G[C>>2]),a=p*a+(0|G[m>>2]),r=~~+fd(l),g=~~+fd(o),n=~~+fd(a),l=+k((0|r)-l),o=+k((0|g)-o),a=+k((0|n)-a);do{if(!(o>2]=r,G[h>>2]=c,G[d>>2]=n,!function Xa(e){var t,n,r,i=0,o=0,a=0,s=0,i=0-(o=0|G[(e|=0)>>2])|0;G[e>>2]=i,s=(a=(G[(n=e+8|0)>>2]=0)|G[(r=e+4|0)>>2])+o|0,0<(0|o)?(G[r>>2]=s,G[n>>2]=o,i=G[e>>2]=0,a=s):o=0,(0|a)<0?(s=(G[e>>2]=t=i-a|0)-(G[n>>2]=o=o-a|0)|(G[r>>2]=0),i=0-o|0,(0|o)<0?(G[e>>2]=s,a=G[r>>2]=i,o=G[n>>2]=0):(a=0,s=t)):s=i,(0|(i=(0|o)<(0|(i=(0|a)<(0|s)?a:s))?o:i))<=0||(G[e>>2]=s-i,G[r>>2]=a-i,G[n>>2]=o-i)}(B),nc(e,t,B,i+(u<<3)|0),(0|u)==(0|A))break;u=u+1|0,n=0|G[y>>2]}return U=b,(B=0)|B},_h3LineSize:function rc(e,t,n,r){n|=0,r|=0;var i,o,a=U;return U=U+32|0,e=0==(0|mc(e|=0,t|=0,e,t,i=(o=a)+12|0))&&0==(0|mc(e,t,n,r,o))?0|Ta(i,o):-1,U=a,(e>>>31^1)+e|0},_h3SetToLinkedGeo:function ka(e,t,n){n|=0;var r,i,o,a=U;if(U=U+32|0,ja(e|=0,t|=0,i=(r=a)+16|0),G[n>>2]=0,G[n+4>>2]=0,!(e=(G[n+8>>2]=0)|Oc(i)))return kc(n),Nc(i),void(U=a);do{for(t=0|function hc(e){e|=0;var t=0,n=0,r=0;(t=0|Yc(1,12))||M(22691,22646,49,22704);if(0|(r=0|G[(n=e+4|0)>>2]))return G[(r=r+8|0)>>2]=t,0|(G[n>>2]=t);0|G[e>>2]&&M(22721,22646,61,22744);return G[(r=e)>>2]=t,0|(G[n>>2]=t)}(n);function ic(e,t){e|=0,t|=0;var n=0,r=0;(r=0|Wc(24))||M(22758,22646,78,22772);if(G[r>>2]=G[t>>2],G[4+r>>2]=G[t+4>>2],G[8+r>>2]=G[t+8>>2],G[12+r>>2]=G[t+12>>2],G[16+r>>2]=0,0|(n=0|G[(t=e+4|0)>>2]))return G[16+n>>2]=r,G[t>>2]=r;0|G[e>>2]&&M(22787,22646,82,22772);G[e>>2]=r,G[t>>2]=r}(t,e),G[r>>2]=G[(o=e+16|0)>>2],G[r+4>>2]=G[4+o>>2],G[r+8>>2]=G[8+o>>2],G[r+12>>2]=G[12+o>>2],Pc(i,e),0!=(0|(e=0|function Sc(e,t){t|=0;var n=0;if(n=~~(+k(+ie(10,15-(0|G[12+(e|=0)>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0,!(e=0|G[(0|G[e>>2])+(n<<2)>>2]))return n=0;for(;;){if(0|hb(e,t)){t=5;break}if(!(e=0|G[e+32>>2])){e=0,t=5;break}}return 5!=(0|t)?0:0|e}(i,r))););}while(0!=(0|(e=0|Oc(i))));kc(n),Nc(i),U=a},_h3ToCenterChild:function Gb(e,t,n){n|=0;var r,i=0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),(0|n)<16&(0|(i&=15))<=(0|n)){if((0|i)!=(0|n)&&(e|=0|dd(0|n,0,52),t=0|T()|-15728641&t,(0|i)<(0|n)))for(;r=0|dd(7,0,3*(14-i|0)|0),i=i+1|0,e&=~r,t&=~(0|T()),(0|i)<(0|n););}else e=t=0;return y(0|t),0|e},_h3ToChildren:Eb,_h3ToGeo:Vb,_h3ToGeoBoundary:Wb,_h3ToParent:Cb,_h3UnidirectionalEdgeIsValid:function dc(e,t){var n=0;if(!(!0&268435456==(2013265920&(t|=0)|0)))return(n=0)|n;switch(n=0|cd(0|(e|=0),0|t,56),T(),7&n){case 0:case 7:return(n=0)|n}return!0&16777216==(117440512&t|0)&0!=(0|Fb(e,n=-2130706433&t|134217728))?(n=0)|n:0|(n=0|Bb(e,n))},_hexAreaKm2:function nb(e){return+N[20496+((e|=0)<<3)>>3]},_hexAreaM2:function ob(e){return+N[20624+((e|=0)<<3)>>3]},_hexRing:function ea(e,t,n,r){e|=0,t|=0,r|=0;var i,o=0,a=0,s=0,A=0,l=0,c=0,g=U;if(U=U+16|0,c=g,!(n|=0))return G[(c=r)>>2]=e,G[c+4>>2]=t,U=g,(c=0)|c;G[c>>2]=0;e:do{if(0|Fb(e,t))e=1;else{if(a=0<(0|n)){o=0,l=e;do{if(0==(0|(l=0|da(l,t,4,c)))&0==(0|(t=0|T()))){e=2;break e}if(o=o+1|0,0|Fb(l,t)){e=1;break e}}while((0|o)<(0|n));if(G[(i=r)>>2]=l,G[i+4>>2]=t,i=n+-1|0,a){a=0,s=1,o=l,e=t;do{if(0==(0|(o=0|da(o,e,2,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(s<<3)|0,s=s+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(a=a+1|0))<(0|n));A=0,a=s;do{if(0==(0|(o=0|da(o,e,3,c)))&0==(0|(e=0|T()))){e=2;break e}if(s=r+(a<<3)|0,a=a+1|0,0|Fb(G[s>>2]=o,G[s+4>>2]=e)){e=1;break e}}while((0|(A=A+1|0))<(0|n));s=0;do{if(0==(0|(o=0|da(o,e,1,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(a<<3)|0,a=a+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(s=s+1|0))<(0|n));s=0;do{if(0==(0|(o=0|da(o,e,5,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(a<<3)|0,a=a+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(s=s+1|0))<(0|n));s=0;do{if(0==(0|(o=0|da(o,e,4,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(a<<3)|0,a=a+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(s=s+1|0))<(0|n));for(s=0;;){if(0==(0|(o=0|da(o,e,6,c)))&0==(0|(e=0|T()))){e=2;break e}if((0|s)!=(0|i)){if(0|Fb(G[(A=r+(a<<3)|0)>>2]=o,G[A+4>>2]=e)){e=1;break e}a=a+1|0}if((0|n)<=(0|(s=s+1|0))){s=l,a=t;break}}}else o=s=l,e=a=t}else G[(s=r)>>2]=e,G[s+4>>2]=t,o=s=e,e=a=t;e=1&((0|s)!=(0|o)|(0|a)!=(0|e))}}while(0);return U=g,0|(c=e)},_i64Subtract:_c,_kRing:$,_kRingDistances:function aa(e,t,n,r,i){var o;if(0|ba(e|=0,t|=0,n|=0,r|=0,i|=0)){if(hd(0|r,0,(o=1+(0|a(3*n|0,n+1|0))|0)<<3|0),0|i)return hd(0|i,0,o<<2|0),void ca(e,t,n,r,i,o,0);(i=0|Yc(o,4))&&(ca(e,t,n,r,i,o,0),Xc(i))}},_llvm_minnum_f64:ed,_llvm_round_f64:fd,_malloc:Wc,_maxFaceCount:function Xb(e,t){var n=0,r=0,r=0|cd(0|(e|=0),0|(t|=0),45);if(T(),!(0|la(127&r)))return 0|(r=2);if(r=0|cd(0|e,0|t,52),T(),!(r&=15))return 0|(r=5);for(n=1;;){if(!(0==((0|dd(7,0,3*(15-n|0)|0))&e|0)&0==((0|T())&t|0))){n=2,e=6;break}if(!(n>>>0>>0)){n=5,e=6;break}n=n+1|0}return 6==(0|e)?0|n:0},_maxH3ToChildrenSize:function Db(e,t,n){return n|=0,e=0|cd(0|(e|=0),0|(t|=0),52),T(),(0|n)<16&(0|(e&=15))<=(0|n)?0|(n=0|tc(7,n-e|0)):(n=0)|n},_maxKringSize:function _(e){return 1+(0|a(3*(e|=0)|0,e+1|0))|0},_maxPolyfillSize:function fa(e,t){t|=0;var n,r,i,o=0,a=0,s=U;if(U=U+48|0,r=s+8|0,i=0|G[(a=e|=0)+4>>2],G[(o=n=s)>>2]=G[a>>2],G[o+4>>2]=i,vc(n,r),r=0|ya(r,t),t=0|G[n>>2],(0|(n=0|G[e+8>>2]))<=0)return U=s,0|(a=(a=(0|r)<(0|(a=t))?a:r)+12|0);for(o=0|G[e+12>>2],e=0;t=(0|G[o+(e<<3)>>2])+t|0,(0|(e=e+1|0))<(0|n););return U=s,0|(a=(a=(a=(0|r)<(0|t))?t:r)+12|0)},_maxUncompactSize:function Jb(e,t,n){e|=0,n|=0;var r,i=0,o=0,a=0;if((0|(t|=0))<=0)return(n=0)|n;if(16<=(0|n)){for(i=0;;){if(!(0==(0|G[(a=e+(i<<3)|0)>>2])&0==(0|G[a+4>>2]))){i=-1,o=13;break}if((0|t)<=(0|(i=i+1|0))){i=0,o=13;break}}if(13==(0|o))return 0|i}a=i=0;e:for(;;){r=0|G[(o=e+(a<<3)|0)>>2],o=0|G[o+4>>2];do{if(!(0==(0|r)&0==(0|o))){if(o=0|cd(0|r,0|o,52),T(),(0|n)<(0|(o&=15))){i=-1,o=13;break e}if((0|o)==(0|n)){i=i+1|0;break}i=(0|tc(7,n-o|0))+i|0;break}}while(0);if((0|t)<=(0|(a=a+1|0))){o=13;break}}return 13==(0|o)?0|i:0},_memcpy:gd,_memset:hd,_numHexagons:function rb(e){var t;return e=0|G[(t=21008+((e|=0)<<3)|0)>>2],y(0|G[4+t>>2]),0|e},_pentagonIndexCount:function Zb(){return 12},_pointDistKm:jb,_pointDistM:function kb(e,t){var n,r=+N[(t|=0)>>3],i=+N[(e|=0)>>3];return n=(n=+u(.5*(r-i)))*n+(n=+u(.5*(+N[t+8>>3]-+N[e+8>>3])))*(+g(r)*+g(i)*n),2*+d(+c(n),+c(1-n))*6371.007180918475*1e3},_pointDistRads:function ib(e,t){var n,r=+N[(t|=0)>>3],i=+N[(e|=0)>>3];return n=(n=+u(.5*(r-i)))*n+(n=+u(.5*(+N[t+8>>3]-+N[e+8>>3])))*(+g(r)*+g(i)*n),2*+d(+c(n),+c(1-n))},_polyfill:function ga(e,t,n){var r,i,o,a,s=0,A=U;if(U=U+48|0,s=A+8|0,r=A,0|function ha(e,t,n){t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0,E=0,Q=0,w=0,S=0,_=0,x=0,R=0,F=0,D=0;U=(D=U)+112|0,_=D+80|0,A=D+72|0,R=(x=D)+56|0,(F=0|Wc(32+(G[(l=8+(e|=0)|0)>>2]<<5)|0))||M(22848,22448,800,22456);if(function wc(e,t){t|=0;var n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0;if(h=0|G[(e|=0)>>2]){if(N[(p=t+8|0)>>3]=17976931348623157e292,N[(f=t+24|0)>>3]=17976931348623157e292,N[t>>3]=-17976931348623157e292,N[(I=t+16|0)>>3]=-17976931348623157e292,0<(0|h)){for(i=0|G[e+4>>2],d=-(u=17976931348623157e292),n=-1,a=g=-(l=A=17976931348623157e292),C=r=0;;){if(o=+N[i+(C<<4)>>3],c=+N[i+(C<<4)+8>>3],s=+N[i+(((0|(b=n+2|0))==(0|h)?0:b)<<4)+8>>3],o>3]=o,A=o),c>3]=c,l=c),g>3]=o:o=g,a>3]=c,a=c),u=0>3]=d,N[f>>3]=u)}}else G[t>>2]=0,G[t+4>>2]=0,G[t+8>>2]=0,G[t+12>>2]=0,G[t+16>>2]=0,G[t+20>>2]=0,G[t+24>>2]=0,G[t+28>>2]=0;if(!((0|(n=G[(b=e+8|0)>>2]|0))<=0)){B=e+12|0,y=0;do{if(i=0|G[B>>2],f=t+((y=(r=y)+1|0)<<5)|0,I=0|G[i+(r<<3)>>2]){if(N[(C=t+(y<<5)+8|0)>>3]=17976931348623157e292,N[(e=t+(y<<5)+24|0)>>3]=17976931348623157e292,N[f>>3]=-17976931348623157e292,N[(m=t+(y<<5)+16|0)>>3]=-17976931348623157e292,0<(0|I)){for(h=0|G[i+(r<<3)+4>>2],d=-(u=17976931348623157e292),r=-1,p=i=0,a=c=-(l=A=17976931348623157e292);;){if(o=+N[h+(p<<4)>>3],g=+N[h+(p<<4)+8>>3],s=+N[h+(((0|(r=r+2|0))==(0|I)?0:r)<<4)+8>>3],o>3]=o,A=o),g>3]=g,l=g),c>3]=o:o=c,a>3]=g,a=g),u=0>3]=d,N[e>>3]=u)}}else G[f>>2]=0,G[f+4>>2]=0,G[f+8>>2]=0,G[f+12>>2]=0,G[f+16>>2]=0,G[f+20>>2]=0,G[f+24>>2]=0,G[f+28>>2]=0,n=0|G[b>>2]}while((0|y)<(0|n))}}(e,F),r=0|G[(o=e)+4>>2],G[(s=A)>>2]=G[o>>2],G[s+4>>2]=r,vc(A,_),s=0|ya(_,t),r=0|G[A>>2],0<(0|(o=0|G[l>>2])))for(a=0|G[e+12>>2],i=0;r=(0|G[a+(i<<3)>>2])+r|0,(0|(i=i+1|0))!=(0|o););if(i=0|Yc(S=(s=(0|s)<(0|r)?r:s)+12|0,8),c=0|Yc(S,8),G[_>>2]=0,w=0|G[(Q=e)+4>>2],G[(r=A)>>2]=G[Q>>2],G[r+4>>2]=w,0|(r=0|ia(A,S,t,_,i,c)))return Xc(i),Xc(c),Xc(F),U=D,0|(F=r);e:do{if(0<(0|G[l>>2])){for(o=e+12|0,r=0;;){if(a=0|ia((0|G[o>>2])+(r<<3)|0,S,t,_,i,c),r=r+1|0,0|a)break;if((0|r)>=(0|G[l>>2]))break e}return Xc(i),Xc(c),Xc(F),U=D,0|(F=a)}}while(0);-12<(0|s)&&hd(0|c,0,(1<(0|S)?S:1)<<3|0);e:do{if(0<(0|G[_>>2])){w=((0|S)<0)<<31>>31,f=r=Q=v=b=y=i,i=m=C=I=E=B=c;t:for(;;){for(p=0|G[_>>2],o=h=d=0;;){for(s=(a=x)+56|0;((G[a>>2]=0)|(a=a+4|0))<(0|s););if(A=0|G[(t=y+(d<<3)|0)>>2],t=0|G[t+4>>2],0|ba(A,t,1,x,0)){for(s=(a=x)+56|0;((G[a>>2]=0)|(a=a+4|0))<(0|s););0|(a=0|Yc(7,4))&&(ca(A,t,1,x,a,7,0),Xc(a))}u=0;do{c=0|G[(g=x+(u<<3)|0)>>2],g=0|G[g+4>>2];n:do{if(!(0==(0|c)&0==(0|g))){if(A=0|bd(0|c,0|g,0|S,0|w),T(),t=0|G[(s=a=n+(A<<3)|0)>>2],s=0|G[s+4>>2],!(0==(0|t)&0==(0|s)))for(l=0;;){if((0|S)<(0|l))break t;if((0|t)==(0|c)&(0|s)==(0|g))break n;if(t=0|G[(s=a=n+((A=(A+1|0)%(0|S)|0)<<3)|0)>>2],s=0|G[s+4>>2],0==(0|t)&0==(0|s))break;l=l+1|0}0==(0|c)&0==(0|g)||(Vb(c,g,R),0|function xc(e,t,n){var r=0,i=0,o=0;if(!(0|uc(e|=0,t|=0,n|=0)))return(i=0)|i;if((0|G[(i=e+8|0)>>2])<=0)return 0|(i=1);r=e+12|0,e=0;for(;;){if(e=(o=e)+1|0,0|uc((0|G[r>>2])+(o<<3)|0,t+(e<<5)|0,n)){e=0,r=6;break}if((0|e)>=(0|G[i>>2])){e=1,r=6;break}}return 6!=(0|r)?0:0|e}(e,F,R)&&(G[(l=a)>>2]=c,G[l+4>>2]=g,G[(l=B+(o<<3)|0)>>2]=c,G[l+4>>2]=g,o=o+1|0))}}while(0)}while((u=u+1|0)>>>0<7);if((0|p)<=(0|(h=h+1|0)))break;d=d+1|0}if(0<(0|p)&&hd(0|b,0,p<<3|0),!(0<(0|(G[_>>2]=o))))break e;c=i,g=m,u=Q,d=C,h=I,p=B,i=f,m=r,C=v,I=b,f=c,r=g,Q=E,E=u,v=d,b=h,B=y,y=p}return Xc(v),Xc(E),Xc(F),U=D,0|(F=-1)}}while(r=c,0);return Xc(F),Xc(i),Xc(r),U=D,0|(F=0)}(e|=0,t|=0,n|=0)){if(i=0|G[(a=e)+4>>2],G[(o=r)>>2]=G[a>>2],G[o+4>>2]=i,vc(r,s),o=0|ya(s,t),t=0|G[r>>2],0<(0|(i=0|G[e+8>>2])))for(r=0|G[e+12>>2],s=0;t=(0|G[r+(s<<3)>>2])+t|0,(0|(s=s+1|0))!=(0|i););U=((0|(t=(0|o)<(0|t)?t:o))<=-12||hd(0|n,0,8+((0<(0|(a=t+11|0))?a:0)<<3)|0),A)}else U=A},_res0IndexCount:function ua(){return 122},_round:id,_sbrk:jd,_sizeOfCoordIJ:function Ec(){return 8},_sizeOfGeoBoundary:function Ac(){return 168},_sizeOfGeoCoord:function zc(){return 16},_sizeOfGeoPolygon:function Cc(){return 16},_sizeOfGeofence:function Bc(){return 8},_sizeOfH3Index:function yc(){return 8},_sizeOfLinkedGeoPolygon:function Dc(){return 12},_uncompact:function Ib(e,t,n,r,i){e|=0,n|=0,r|=0,i|=0;var o=0,a=0,s=0,A=0,l=0,c=0;if((0|(t|=0))<=0)return(i=0)|i;if(16<=(0|i)){for(o=0;;){if(!(0==(0|G[(c=e+(o<<3)|0)>>2])&0==(0|G[c+4>>2]))){o=14;break}if((0|t)<=(0|(o=o+1|0))){a=0,o=16;break}}if(14==(0|o))return 0|(0<(0|r)?-2:-1);if(16==(0|o))return 0|a}c=o=0;e:for(;;){a=0|G[(s=l=e+(c<<3)|0)>>2],s=0|G[s+4>>2];do{if(!(0==(0|a)&0==(0|s))){if((0|r)<=(0|o)){a=-1,o=16;break e}if(A=0|cd(0|a,0|s,52),T(),(0|i)<(0|(A&=15))){a=-2,o=16;break e}if((0|A)==(0|i)){G[(l=n+(o<<3)|0)>>2]=a,G[l+4>>2]=s,o=o+1|0;break}if((0|r)<(0|(a=(0|tc(7,i-A|0))+o|0))){a=-1,o=16;break e}Eb(0|G[l>>2],0|G[l+4>>2],i,n+(o<<3)|0),o=a}}while(0);if((0|t)<=(0|(c=c+1|0))){a=0,o=16;break}}return 16==(0|o)?0|a:0},establishStackSpace:function Z(e,t){U=e|=0},stackAlloc:function W(e){var t=U;return U=(U=U+(e|=0)|0)+15&-16,0|t},stackRestore:function Y(e){U=e|=0},stackSave:function X(){return 0|U}});function $(e,t,n,r){var i,o;0|ba(e|=0,t|=0,n|=0,r|=0,0)&&(hd(0|r,0,(o=1+(0|a(3*n|0,n+1|0))|0)<<3|0),(i=0|Yc(o,4))&&(ca(e,t,n,r,i,o,0),Xc(i)))}function ba(e,t,n,r,i){t|=0,n|=0,i|=0;var o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=U;if(U=U+16|0,u=d,G[(o=r|=0)>>2]=e|=0,G[o+4>>2]=t,(o=0!=(0|i))&&(G[i>>2]=0),0|Fb(e,t))return U=d,0|(u=1);G[u>>2]=0;e:do{if(1<=(0|n))if(o)for(g=c=1,a=l=0,o=e;;){if(!(a|l)){if(0==(0|(o=0|da(o,t,4,u)))&0==(0|(t=0|T()))){o=2;break e}if(0|Fb(o,t)){o=1;break e}}if(0==(0|(o=0|da(o,t,0|G[16+(l<<2)>>2],u)))&0==(0|(t=0|T()))){o=2;break e}if(G[(e=r+(g<<3)|0)>>2]=o,G[e+4>>2]=t,e=(0|(a=a+1|0))==(0|(G[i+(g<<2)>>2]=c)),A=6==(0|(s=l+1|0)),0|Fb(o,t)){o=1;break e}if((0|n)<(0|(c=c+(A&e&1)|0))){o=0;break}l=e?A?0:s:l,g=g+1|0,a=e?0:a}else for(g=c=1,a=l=0,o=e;;){if(!(a|l)){if(0==(0|(o=0|da(o,t,4,u)))&0==(0|(t=0|T()))){o=2;break e}if(0|Fb(o,t)){o=1;break e}}if(0==(0|(o=0|da(o,t,0|G[16+(l<<2)>>2],u)))&0==(0|(t=0|T()))){o=2;break e}if(G[(e=r+(g<<3)|0)>>2]=o,G[e+4>>2]=t,e=(0|(a=a+1|0))==(0|c),A=6==(0|(s=l+1|0)),0|Fb(o,t)){o=1;break e}if((0|n)<(0|(c=c+(A&e&1)|0))){o=0;break}l=e?A?0:s:l,g=g+1|0,a=e?0:a}else o=0}while(0);return U=d,0|(u=o)}function ca(e,t,n,r,i,o,a){n|=0,r|=0,i|=0,o|=0,a|=0;var s,A=0,l=0,c=0,g=0,u=0,d=U;if(U=U+16|0,s=d,0==(0|(e|=0))&0==(0|(t|=0)))U=d;else{if(A=0|bd(0|e,0|t,0|o,((0|o)<0)<<31>>31|0),T(),!(0==(0|(u=0|G[(g=l=r+(A<<3)|0)>>2]))&0==(0|(g=0|G[g+4>>2]))|(c=(0|u)==(0|e)&(0|g)==(0|t))))for(;c=(0|(g=0|G[(u=l=r+((A=(A+1|0)%(0|o)|0)<<3)|0)>>2]))==(0|e)&(0|(u=0|G[u+4>>2]))==(0|t),!(0==(0|g)&0==(0|u)|c););A=i+(A<<2)|0,U=(c&&(0|G[A>>2])<=(0|a)||(G[(u=l)>>2]=e,G[u+4>>2]=t,(0|n)<=(0|(G[A>>2]=a))||(u=a+1|0,ca(g=(G[s>>2]=0)|da(e,t,2,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,3,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,1,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,5,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,4,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,6,s),0|T(),n,r,i,o,u))),d)}}function da(e,t,n,r){e|=0,t|=0,n|=0;var i,o,a,s,A=0,l=0,c=0,g=0,u=0;if(0<(0|G[(r|=0)>>2]))for(A=0;n=0|Pa(n),(0|(A=A+1|0))<(0|G[r>>2]););i=0|cd(0|e,0|t,45),T(),o=127&i,l=0|Lb(e,t),A=0|cd(0|e,0|t,52),T(),A&=15;e:do{if(A)for(;;){if(g=0|cd(0|e,0|t,0|(s=3*(15-A|0)|0)),T(),g&=7,u=0==(0|Rb(A)),A=A+-1|0,a=0|dd(7,0,0|s),t&=~(0|T()),e=0|dd(0|G[(u?464:48)+(28*g|0)+(n<<2)>>2],0,0|s)|e&~a,t|=0|T(),!(n=0|G[(u?672:256)+(28*g|0)+(n<<2)>>2])){n=0;break e}if(!A){c=6;break}}else c=6}while(0);6==(0|c)&&(e|=g=0|dd(0|(u=0|G[880+(28*o|0)+(n<<2)>>2]),0,45),t=0|T()|-1040385&t,n=0|G[4304+(28*o|0)+(n<<2)>>2],127==(127&u|0)&&(u=0|dd(0|G[880+(28*o|0)+20>>2],0,45),t=0|T()|-1040385&t,n=0|G[4304+(28*o|0)+20>>2],e=0|Nb(u|e,t),t=0|T(),G[r>>2]=1+(0|G[r>>2]))),c=0|cd(0|e,0|t,45),T(),c&=127;e:do{if(0|la(c)){t:do{if(1==(0|Lb(e,t))){if((0|o)!=(0|c)){if(0|ra(c,0|G[7728+(28*o|0)>>2])){e=0|Pb(e,t),l=1,t=0|T();break}e=0|Nb(e,t),l=1,t=0|T();break}switch(0|l){case 5:e=0|Pb(e,t),t=0|T(),G[r>>2]=5+(0|G[r>>2]),l=0;break t;case 3:e=0|Nb(e,t),t=0|T(),G[r>>2]=1+(0|G[r>>2]),l=0;break t;default:return y((u=g=0)|g),0|u}}else l=0}while(0);if(0<(0|n))for(A=0;e=0|Mb(e,t),t=0|T(),(0|(A=A+1|0))!=(0|n););if((0|o)!=(0|c)){if(!(0|ma(c))){if(0!=(0|l)|5!=(0|Lb(e,t)))break;G[r>>2]=1+(0|G[r>>2]);break}switch(127&i){case 8:case 118:break e}3!=(0|Lb(e,t))&&(G[r>>2]=1+(0|G[r>>2]))}}else if(0<(0|n))for(A=0;e=0|Nb(e,t),t=0|T(),(0|(A=A+1|0))!=(0|n););}while(0);return G[r>>2]=((0|G[r>>2])+n|0)%6|0,u=e,y(0|(g=t)),0|u}function ia(e,t,n,r,i,o){n|=0,r|=0,i|=0,o|=0;var a,s,A,l,c,g,u,d,h,p,f,I,C,m=0,y=0,B=0,b=0,v=0,E=0,Q=0,w=0,S=0,_=U;if(U=U+48|0,(0|(m=0|G[(e|=0)>>2]))<=0)return U=_,(S=0)|S;l=e+4|0,c=8+(h=_+32|0)|0,g=8+(p=_+16|0)|0,u=(f=_)+8|0,d=((0|(t|=0))<0)<<31>>31,w=0;e:for(;;){y=0|G[l>>2],G[h>>2]=G[(Q=y+(w<<4)|0)>>2],G[4+h>>2]=G[Q+4>>2],G[8+h>>2]=G[Q+8>>2],G[12+h>>2]=G[Q+12>>2],(0|w)==(m+-1|0)?(G[p>>2]=G[y>>2],G[4+p>>2]=G[y+4>>2],G[8+p>>2]=G[y+8>>2],G[12+p>>2]=G[y+12>>2]):(G[p>>2]=G[(Q=y+(w+1<<4)|0)>>2],G[4+p>>2]=G[Q+4>>2],G[8+p>>2]=G[Q+8>>2],G[12+p>>2]=G[Q+12>>2]),Q=0|function za(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=0,l=0;U=(s=U)+288|0,r=s+264|0,i=s+96|0,A=(a=o=s)+96|0;for(;G[a>>2]=0,a=a+4|0,(0|a)<(0|A););return _b(n,o),a=0|G[(A=o)>>2],A=0|G[A+4>>2],Vb(a,A,r),Wb(a,A,i),l=+jb(r,8+i|0),A=~~+le(+jb(e,t)/(2*l)),U=s,0|(0==(0|A)?1:A)}(h,p,n);t:do{if(0<(0|Q)){A=0|Q,E=0;n:for(;;){N[f>>3]=+N[h>>3]*(C=Q-E|0)/A+ +N[p>>3]*(I=0|E)/A,N[u>>3]=+N[c>>3]*C/A+ +N[g>>3]*I/A,y=0|bd(0|(a=0|Sb(f,n)),0|(s=0|T()),0|t,0|d),T(),b=0|G[(B=m=o+(y<<3)|0)>>2],B=0|G[B+4>>2];r:do{if(0==(0|b)&0==(0|B))S=14;else for(v=0;;){if((0|t)<(0|v)){m=1;break r}if((0|b)==(0|a)&(0|B)==(0|s)){m=7;break r}if(0==(0|(b=0|G[(B=m=o+((y=(y+1|0)%(0|t)|0)<<3)|0)>>2]))&0==(0|(B=0|G[B+4>>2]))){S=14;break}v=v+1|0}}while(0);switch(7&(m=14==(0|S)?(S=0)==(0|a)&0==(0|s)?7:(G[m>>2]=a,G[m+4>>2]=s,m=0|G[r>>2],G[(v=i+(m<<3)|0)>>2]=a,G[v+4>>2]=s,G[r>>2]=m+1,0):m)){case 7:case 0:break;default:break n}if((0|Q)<=(0|(E=E+1|0))){S=8;break t}}if(0|m){m=-1,S=20;break e}}else S=8}while(0);if(8==(0|S)&&(S=0),(0|(m=0|G[e>>2]))<=(0|(w=w+1|0))){m=0,S=20;break}}return 20==(0|S)?(U=_,0|m):0}function ja(e,t,n){e|=0,n|=0;var r,i,o,a=0,s=0,A=0,l=U;if(U=U+176|0,o=l,(0|(t|=0))<1)return Mc(n,0,0),void(U=l);s=0|cd(0|G[(s=e)>>2],0|G[s+4>>2],52),T(),Mc(n,6<(0|t)?t:6,15&s),s=0;do{if(Wb(0|G[(a=e+(s<<3)|0)>>2],0|G[a+4>>2],o),0<(0|(a=0|G[o>>2])))for(A=0;i=o+8+(A<<4)|0,(r=0|function Rc(e,t,n){t|=0,n|=0;var r=0,i=0;if(i=~~(+k(+ie(10,15-(0|G[12+(e|=0)>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0,!(i=0|G[(0|G[e>>2])+(i<<2)>>2]))return(n=0)|n;if(!n){for(e=i;;){if(0|hb(e,t)){r=10;break}if(!(e=0|G[e+32>>2])){e=0,r=10;break}}if(10==(0|r))return 0|e}e=i;for(;;){if(0|hb(e,t)&&0|hb(e+16|0,n)){r=10;break}if(!(e=0|G[e+32>>2])){e=0,r=10;break}}return 10!=(0|r)?0:0|e}(n,a=o+8+(((0|(A=A+1|0))%(0|a)|0)<<4)|0,i))?Pc(n,r):function Qc(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0;(o=0|Wc(40))||M(23283,23253,98,23296);G[o>>2]=G[t>>2],G[4+o>>2]=G[t+4>>2],G[8+o>>2]=G[t+8>>2],G[12+o>>2]=G[t+12>>2],G[(i=16+o|0)>>2]=G[n>>2],G[i+4>>2]=G[n+4>>2],G[i+8>>2]=G[n+8>>2],G[i+12>>2]=G[n+12>>2],G[32+o>>2]=0,i=~~(+k(+ie(10,15-(0|G[e+12>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0,i=(0|G[e>>2])+(i<<2)|0,r=0|G[i>>2];do{if(r){for(;;){if(0|hb(r,t)&&0|hb(r+16|0,n))break;if(i=0|G[r+32>>2],!(0|G[(r=0==(0|i)?r:i)+32>>2])){a=10;break}}if(10!=(0|a))return Xc(o),a=r;G[r+32>>2]=o;break}}while(G[i>>2]=o,0);G[(a=e+8|0)>>2]=1+(0|G[a>>2]),a=o}(n,i,a),(0|A)<(0|(a=0|G[o>>2])););}while((0|(s=s+1|0))!=(0|t));U=l}function la(e){return 0|G[7728+(28*(e|=0)|0)+16>>2]}function ma(e){return 4==(0|(e|=0))|117==(0|e)|0}function na(e){return 0|G[11152+(216*(0|G[(e|=0)>>2])|0)+(72*(0|G[e+4>>2])|0)+(24*(0|G[e+8>>2])|0)+(G[e+12>>2]<<3)>>2]}function ra(e,t){return(0|G[7728+(28*(e|=0)|0)+20>>2])==(0|(t|=0))?0|(t=1):0|(t=(0|G[7728+(28*e|0)+24>>2])==(0|t))}function sa(e,t){return 0|G[880+(28*(e|=0)|0)+((t|=0)<<2)>>2]}function ta(e,t){return(0|G[880+(28*(e|=0)|0)>>2])==(0|(t|=0))?(t=0)|t:(0|G[880+(28*e|0)+4>>2])==(0|t)?0|(t=1):(0|G[880+(28*e|0)+8>>2])==(0|t)?0|(t=2):(0|G[880+(28*e|0)+12>>2])==(0|t)?0|(t=3):(0|G[880+(28*e|0)+16>>2])==(0|t)?0|(t=4):(0|G[880+(28*e|0)+20>>2])==(0|t)?0|(t=5):0|((0|G[880+(28*e|0)+24>>2])==(0|t)?6:7)}function wa(e){return+N[(e|=0)+16>>3]<+N[e+24>>3]|0}function xa(e,t){var n,r,i;return(i=+N[(t|=0)>>3])>=+N[(e|=0)+8>>3]&&i<=+N[e>>3]?(n=+N[e+16>>3],t=(i=+N[e+24>>3])<=(r=+N[t+8>>3]),e=r<=n&1,n>2]=0)))<(0|a););return _b(t,i),Vb(a=0|G[(o=i)>>2],o=0|G[o+4>>2],n),Wb(a,o,r),t=+jb(n,8+r|0),N[n>>3]=+N[e>>3],N[(o=8+n|0)>>3]=+N[e+16>>3],N[r>>3]=+N[e+8>>3],N[(a=8+r|0)>>3]=+N[e+24>>3],i=+jb(n,r),a=~~+le(i*i/+ed(+k((+N[o>>3]-+N[a>>3])/(+N[n>>3]-+N[r>>3])),3)/(2.59807621135*t*t*.8)),U=s,0|(0==(0|a)?1:a)}function Ca(e){var t,n=0,r=0,i=0,o=0,a=0,n=0|G[(e|=0)>>2],r=0|G[(t=e+4|0)>>2];(0|n)<0&&(G[t>>2]=r=r-n|0,G[(a=e+8|0)>>2]=(0|G[a>>2])-n,n=G[e>>2]=0),(0|r)<0?(G[e>>2]=n=n-r|0,o=(0|G[(a=e+8|0)>>2])-r|0,G[a>>2]=o,r=G[t>>2]=0):o=0|G[(a=o=e+8|0)>>2],(0|o)<0&&(G[e>>2]=n=n-o|0,G[t>>2]=r=r-o|0,o=G[a>>2]=0),(0|(i=(0|o)<(0|(i=(0|r)<(0|n)?r:n))?o:i))<=0||(G[e>>2]=n-i,G[t>>2]=r-i,G[a>>2]=o-i)}function Da(e,t){var n=0|G[(e|=0)+8>>2],r=(0|G[e+4>>2])-n|0;N[(t|=0)>>3]=((0|G[e>>2])-n|0)-.5*r,N[t+8>>3]=.8660254037844386*r}function Ea(e,t,n){G[(n|=0)>>2]=(0|G[(t|=0)>>2])+(0|G[(e|=0)>>2]),G[n+4>>2]=(0|G[t+4>>2])+(0|G[e+4>>2]),G[n+8>>2]=(0|G[t+8>>2])+(0|G[e+8>>2])}function Fa(e,t,n){G[(n|=0)>>2]=(0|G[(e|=0)>>2])-(0|G[(t|=0)>>2]),G[n+4>>2]=(0|G[e+4>>2])-(0|G[t+4>>2]),G[n+8>>2]=(0|G[e+8>>2])-(0|G[t+8>>2])}function Ga(e,t){var n,r=0|a(0|G[(e|=0)>>2],t|=0);G[e>>2]=r,n=0|a(0|G[(r=e+4|0)>>2],t),G[r>>2]=n,t=0|a(0|G[(e=e+8|0)>>2],t),G[e>>2]=t}function Ha(e){var t,n,r=0,i=0,o=0,a=0,s=0,s=(0|(t=0|G[(e|=0)>>2]))<0;e=(e=(i=(0|(a=((n=(0|(o=(0|G[e+4>>2])-(s?t:0)|0))<0)?0-o|0:0)+((0|G[e+8>>2])-(s?t:0))|0))<0)?0:a)-((o=0<(0|(i=(0|e)<(0|(i=(0|(r=(n?0:o)-(i?a:0)|0))<(0|(a=(s?0:t)-(n?o:0)-(i?a:0)|0))?r:a))?e:i)))?i:0)|0,r=r-(o?i:0)|0;e:do{switch(a-(o?i:0)|0){case 0:switch(0|r){case 0:return 0|(s=0==(0|e)?0:1==(0|e)?1:7);case 1:return 0|(s=0==(0|e)?2:1==(0|e)?3:7);default:break e}case 1:switch(0|r){case 0:return 0|(s=0==(0|e)?4:1==(0|e)?5:7);case 1:if(e)break e;return 0|(e=6);default:break e}}}while(0);return 0|(s=7)}function Ia(e){var t,n,r=0,i=0,o=0,a=0,s=0,i=0|G[(t=(e|=0)+8|0)>>2],o=0|Vc(((3*(r=(0|G[e>>2])-i|0)|0)-(i=(0|G[(n=e+4|0)>>2])-i|0)|0)/7);G[e>>2]=o,r=0|Vc(((i<<1)+r|0)/7),i=(G[n>>2]=r)-o|(G[t>>2]=0),i=(0|o)<0?(s=0-o|0,G[n>>2]=i,G[t>>2]=s,r=i,o=G[e>>2]=0,s):0,(0|r)<0&&(G[e>>2]=o=o-r|0,G[t>>2]=i=i-r|0,r=G[n>>2]=0),s=o-i|0,a=r-i|0,(0|i)<0?(G[e>>2]=s,r=G[n>>2]=a,a=s,i=G[t>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|a)?r:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=r-o,G[t>>2]=i-o)}function Ja(e){var t,n,r=0,i=0,o=0,a=0,s=0,i=0|G[(t=(e|=0)+8|0)>>2],o=0|Vc((((r=(0|G[e>>2])-i|0)<<1)+(i=(0|G[(n=e+4|0)>>2])-i|0)|0)/7);G[e>>2]=o,r=0|Vc(((3*i|0)-r|0)/7),i=(G[n>>2]=r)-o|(G[t>>2]=0),i=(0|o)<0?(s=0-o|0,G[n>>2]=i,G[t>>2]=s,r=i,o=G[e>>2]=0,s):0,(0|r)<0&&(G[e>>2]=o=o-r|0,G[t>>2]=i=i-r|0,r=G[n>>2]=0),s=o-i|0,a=r-i|0,(0|i)<0?(G[e>>2]=s,r=G[n>>2]=a,a=s,i=G[t>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|a)?r:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=r-o,G[t>>2]=i-o)}function Ka(e){var t,n,r,i=0,o=0,a=0,s=0,i=0|G[(e|=0)>>2],o=0|G[(n=e+4|0)>>2],a=0|G[(r=e+8|0)>>2],s=o+(3*i|0)|0;G[e>>2]=s,G[n>>2]=o=a+(3*o|0)|0,G[r>>2]=i=(3*a|0)+i|0,a=o-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=a,G[r>>2]=i,o=a,G[e>>2]=0):s,(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function La(e){var t,n,r,i=0,o=0,a=0,s=0,s=0|G[(e|=0)>>2],i=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],a=(3*i|0)+s|0;G[e>>2]=s=o+(3*s|0)|0,G[n>>2]=a,G[r>>2]=i=(3*o|0)+i|0,o=a-s|0,(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,s=G[e>>2]=0):o=a,(0|o)<0&&(G[e>>2]=s=s-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=s-i|0,a=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=a,s=t,i=G[r>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(G[e>>2]=s-o,G[n>>2]=a-o,G[r>>2]=i-o)}function Ma(e,t){e|=0;var n,r,i,o=0,a=0,s=0;6<=((t|=0)+-1|0)>>>0||(s=(0|G[15472+(12*t|0)>>2])+(0|G[e>>2])|0,G[e>>2]=s,a=(0|G[15472+(12*t|0)+4>>2])+(0|G[(i=e+4|0)>>2])|0,G[i>>2]=a,t=(0|G[15472+(12*t|0)+8>>2])+(0|G[(r=e+8|0)>>2])|0,G[r>>2]=t,o=a-s|0,a=(0|s)<0?(t=t-s|0,G[i>>2]=o,G[r>>2]=t,G[e>>2]=0):(o=a,s),(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=t=t-o|0,o=G[i>>2]=0),n=a-t|0,s=o-t|0,(0|t)<0?(G[e>>2]=n,G[i>>2]=s,a=n,t=G[r>>2]=0):s=o,(0|(o=(0|t)<(0|(o=(0|s)<(0|a)?s:a))?t:o))<=0||(G[e>>2]=a-o,G[i>>2]=s-o,G[r>>2]=t-o))}function Na(e){var t,n,r,i=0,o=0,a=0,s=0,s=0|G[(e|=0)>>2],i=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],a=i+s|0;G[e>>2]=s=o+s|0,G[n>>2]=a,G[r>>2]=i=o+i|0,o=a-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,G[e>>2]=0):(o=a,s),(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function Oa(e){var t,n,r,i=0,o=0,a=0,s=0,i=0|G[(e|=0)>>2],a=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],s=a+i|0;G[e>>2]=s,G[n>>2]=a=o+a|0,G[r>>2]=i=o+i|0,o=a-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,G[e>>2]=0):(o=a,s),(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function Pa(e){switch(0|(e|=0)){case 1:e=5;break;case 5:e=4;break;case 4:e=6;break;case 6:e=2;break;case 2:e=3;break;case 3:e=1}return 0|e}function Qa(e){switch(0|(e|=0)){case 1:e=3;break;case 3:e=2;break;case 2:e=6;break;case 6:e=4;break;case 4:e=5;break;case 5:e=1}return 0|e}function Ra(e){var t,n,r,i=0,o=0,a=0,s=0,i=0|G[(e|=0)>>2],o=0|G[(n=e+4|0)>>2],a=0|G[(r=e+8|0)>>2],s=o+(i<<1)|0;G[e>>2]=s,G[n>>2]=o=a+(o<<1)|0,G[r>>2]=i=(a<<1)+i|0,a=o-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=a,G[r>>2]=i,o=a,G[e>>2]=0):s,(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function Sa(e){var t,n,r,i=0,o=0,a=0,s=0,s=0|G[(e|=0)>>2],i=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],a=(i<<1)+s|0;G[e>>2]=s=o+(s<<1)|0,G[n>>2]=a,G[r>>2]=i=(o<<1)+i|0,o=a-s|0,(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,s=G[e>>2]=0):o=a,(0|o)<0&&(G[e>>2]=s=s-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=s-i|0,a=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=a,s=t,i=G[r>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(G[e>>2]=s-o,G[n>>2]=a-o,G[r>>2]=i-o)}function Ta(e,t){var n,r,i=0,o=0,a=0,s=(0|G[(e|=0)>>2])-(0|G[(t|=0)>>2])|0,o=(0|G[e+4>>2])-(0|G[t+4>>2])-((n=(0|s)<0)?s:0)|0;return 0|((0|(t=(0|(t=-1<(0|(t=(t=(e=(0|(a=(n?0-s|0:0)+(0|G[e+8>>2])-(0|G[t+8>>2])+((r=(0|o)<0)?0-o|0:0)|0))<0)?0:a)-((o=0<(0|(e=(0|t)<(0|(e=(0|(i=(r?0:o)-(e?a:0)|0))<(0|(a=(n?0:s)-(r?o:0)-(e?a:0)|0))?i:a))?t:e)))?e:0)|0))?t:0-t|0))<(0|(i=-1<(0|(i=i-(o?e:0)|0))?i:0-i|0))?i:t))<(0|(e=-1<(0|(e=a-(o?e:0)|0))?e:0-e|0))?e:t)}function Wa(e){var t,n,r,i=(r=0|G[(n=(e|=0)+8|0)>>2])-(0|G[e>>2])|0;G[e>>2]=i,e=(0|G[(t=e+4|0)>>2])-r|0,G[t>>2]=e,G[n>>2]=0-(e+i)}function Ya(e,t,n){var r=U;U=U+16|0,function Za(e,t,n,r){t|=0,n|=0,r|=0;var i=0,o=0,a=0,s=0,A=0;U=(A=U)+32|0,function Jc(e,t){t|=0;var n=0,r=0,i=0;n=+N[(e|=0)>>3],r=+g(n),n=+u(n),N[t+16>>3]=n,n=+N[e+8>>3],i=r*+g(n),N[t>>3]=i,n=r*+u(n),N[t+8>>3]=n}(e|=0,o=A),G[n>>2]=0,i=+Ic(15888,o),(a=+Ic(15912,o))>2]=1,i=a);(a=+Ic(15936,o))>2]=2,i=a);(a=+Ic(15960,o))>2]=3,i=a);(a=+Ic(15984,o))>2]=4,i=a);(a=+Ic(16008,o))>2]=5,i=a);(a=+Ic(16032,o))>2]=6,i=a);(a=+Ic(16056,o))>2]=7,i=a);(a=+Ic(16080,o))>2]=8,i=a);(a=+Ic(16104,o))>2]=9,i=a);(a=+Ic(16128,o))>2]=10,i=a);(a=+Ic(16152,o))>2]=11,i=a);(a=+Ic(16176,o))>2]=12,i=a);(a=+Ic(16200,o))>2]=13,i=a);(a=+Ic(16224,o))>2]=14,i=a);(a=+Ic(16248,o))>2]=15,i=a);(a=+Ic(16272,o))>2]=16,i=a);(a=+Ic(16296,o))>2]=17,i=a);(a=+Ic(16320,o))>2]=18,i=a);(a=+Ic(16344,o))>2]=19,i=a);if((a=+ae(+(1-i*.5)))<1e-16)G[r>>2]=0,G[r+4>>2]=0,G[r+8>>2]=0,G[r+12>>2]=0,U=A;else{if(n=0|G[n>>2],i=+gb((i=+N[16368+(24*n|0)>>3])-+gb(+function lb(e,t){e|=0;var n=0,r=0,i=0,o=0,a=0;return o=+N[(t|=0)>>3],r=+g(o),i=+N[t+8>>3]-+N[e+8>>3],a=r*+u(i),n=+N[e>>3],+d(a,+u(o)*+g(n)-+g(i)*(r*+u(n)))}(15568+(n<<4)|0,e))),s=0|Rb(t)?+gb(i+-.3334731722518321):i,i=+oe(+a)/.381966011250105,0<(0|t))for(o=0;i*=2.6457513110645907,(0|(o=o+1|0))!=(0|t););a=+g(+s)*i,N[r>>3]=a,s=+u(+s)*i,N[r+8>>3]=s,U=A}}(e|=0,t|=0,n|=0,e=r),function Ba(e,t){e|=0;var n,r,i,o,a=0,s=0,A=0,l=0,c=0,g=0;G[(o=(t|=0)+8|0)>>2]=0,n=+N[e>>3],l=+k(n),r=+N[e+8>>3],l=(l+=.5*(c=+k(r)/.8660254037844386))-(0|(a=~~l)),c-=0|(e=~~c);do{if(l<.5){if(l<.3333333333333333){if(G[t>>2]=a,c<.5*(1+l)){G[t+4>>2]=e;break}G[t+4>>2]=e=e+1|0;break}if(G[t+4>>2]=e=(1&!(c<(i=1-l)))+e|0,i<=c&c<2*l){G[t>>2]=a=a+1|0;break}G[t>>2]=a;break}if(!(l<.6666666666666666)){if(G[t>>2]=a=a+1|0,c<.5*l){G[t+4>>2]=e;break}G[t+4>>2]=e=e+1|0;break}if(c<1-l){if(G[t+4>>2]=e,2*l-1>2]=a;break}}else G[t+4>>2]=e=e+1|0}while(G[t>>2]=a=a+1|0,0);do{if(n<0){if(1&e){a=~~((0|a)-(2*(((g=0|_c(0|a,((0|a)<0)<<31>>31|0,0|(g=(e+1|0)/2|0),((0|g)<0)<<31>>31|0))>>>0)+4294967296*(0|T()))+1)),G[t>>2]=a;break}a=~~((0|a)-2*(((g=0|_c(0|a,((0|a)<0)<<31>>31|0,0|(g=(0|e)/2|0),((0|g)<0)<<31>>31|0))>>>0)+4294967296*(0|T()))),G[t>>2]=a;break}}while(0);g=t+4|0,r<0&&(G[t>>2]=a=a-((e<<1|1)/2|0)|0,G[g>>2]=e=0-e|0),s=e-a|0,(0|a)<0?(A=0-a|0,G[g>>2]=s,G[o>>2]=A,e=s,a=G[t>>2]=0):A=0,(0|e)<0&&(G[t>>2]=a=a-e|0,G[o>>2]=A=A-e|0,e=G[g>>2]=0),r=a-A|0,s=e-A|0,(0|A)<0&&(G[t>>2]=r,e=G[g>>2]=s,a=r,A=G[o>>2]=0),(0|(s=(0|A)<(0|(s=(0|e)<(0|a)?e:a))?A:s))<=0||(G[t>>2]=a-s,G[g>>2]=e-s,G[o>>2]=A-s)}(e,n+4|0),U=r}function _a(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var o=0,a=0;if((o=+function Fc(e){var t=0,n=0;return n=+N[(e|=0)>>3],t=+N[e+8>>3],+c(n*n+t*t)}(e|=0))<1e-16)return G[i>>2]=G[(t=15568+(t<<4)|0)>>2],G[i+4>>2]=G[t+4>>2],G[i+8>>2]=G[t+8>>2],void(G[i+12>>2]=G[t+12>>2]);if(a=+d(+N[e+8>>3],+N[e>>3]),0<(0|n))for(e=0;o/=2.6457513110645907,(0|(e=e+1|0))!=(0|n););r?(o/=3,n=0==(0|Rb(n)),o=+Ae(.381966011250105*(n?o:o/2.6457513110645907))):(o=+Ae(.381966011250105*o),0|Rb(n)&&(a=+gb(a+.3334731722518321))),function mb(e,t,n,r){e|=0,t=+t,r|=0;var i=0,o=0,a=0,s=0;if((n=+n)<1e-16)G[r>>2]=G[e>>2],G[r+4>>2]=G[e+4>>2],G[r+8>>2]=G[e+8>>2],G[r+12>>2]=G[e+12>>2];else{o=t<0?t+6.283185307179586:t,o=6.283185307179586<=t?o+-6.283185307179586:o;do{if(!(o<1e-16)){if(i=+k(+(o+-3.141592653589793))<1e-16,t=+N[e>>3],i){t-=n,N[r>>3]=t,i=r;break}if(a=+g(+n),n=+u(+n),t=a*+u(+t)+ +g(+o)*(n*+g(+t)),t=+se(+((t=1>3]=t,+k(+(t+-1.5707963267948966))<1e-16)return N[r>>3]=1.5707963267948966,N[r+8>>3]=0;if(+k(+(t+1.5707963267948966))<1e-16)return N[r>>3]=-1.5707963267948966,N[r+8>>3]=0;if(s=+g(+t),o=n*+u(+o)/s,n=+N[e>>3],t=(a-+u(+t)*+u(+n))/+g(+n)/s,a=1>3]+ +d(+(a<-1?-1:a),+(t<-1?-1:t))))for(;3.141592653589793<(t+=-6.283185307179586););if(t<-3.141592653589793)for(;(t+=6.283185307179586)<-3.141592653589793;);return N[r+8>>3]=t}}while(t=+N[e>>3]+n,N[r>>3]=t,i=r,0);if(+k(+(t+-1.5707963267948966))<1e-16)N[i>>3]=1.5707963267948966,N[r+8>>3]=0;else if(+k(+(t+1.5707963267948966))<1e-16)N[i>>3]=-1.5707963267948966,N[r+8>>3]=0;else{if(3.141592653589793<(t=+N[e+8>>3]))for(;3.141592653589793<(t+=-6.283185307179586););if(t<-3.141592653589793)for(;(t+=6.283185307179586)<-3.141592653589793;);N[r+8>>3]=t}}}(15568+(t<<4)|0,+gb(+N[16368+(24*t|0)>>3]-a),o,i)}function ab(e,t,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q,w,S,_,x,R=0,F=0,D=U;if(U=U+272|0,f=D+240|0,w=(Q=D)+224|0,S=D+208|0,I=D+176|0,C=D+160|0,m=D+192|0,y=D+144|0,B=D+128|0,b=D+112|0,v=D+96|0,E=D+80|0,G[(o=D+256|0)>>2]=t|=0,G[f>>2]=G[e>>2],G[4+f>>2]=G[e+4>>2],G[8+f>>2]=G[e+8>>2],G[12+f>>2]=G[e+12>>2],bb(f,o,Q),((G[i>>2]=0)|(f=r+n+(5==(0|r)&1)|0))<=(0|n))U=D;else{s=4+w|0,A=4+I|0,l=n+5|0,c=16848+((a=0|G[o>>2])<<2)|0,g=16928+(a<<2)|0,u=8+B|0,d=8+b|0,h=8+v|0,p=4+S|0,F=n;e:for(;;){for(G[S>>2]=G[(R=Q+(((0|F)%5|0)<<4)|0)>>2],G[4+S>>2]=G[R+4>>2],G[8+S>>2]=G[R+8>>2],G[12+S>>2]=G[R+12>>2];2==(0|cb(S,a,0,1)););if((0|n)<(0|F)&0!=(0|Rb(t))){if(G[I>>2]=G[S>>2],G[4+I>>2]=G[4+S>>2],G[8+I>>2]=G[8+S>>2],G[12+I>>2]=G[12+S>>2],Da(s,C),r=0|G[I>>2],o=0|G[17008+(80*r|0)+(G[w>>2]<<2)>>2],G[I>>2]=G[18608+(80*r|0)+(20*o|0)>>2],0<(0|(R=0|G[18608+(80*r|0)+(20*o|0)+16>>2])))for(e=0;Na(A),(0|(e=e+1|0))<(0|R););switch(G[m>>2]=G[(R=18608+(80*r|0)+(20*o|0)+4|0)>>2],G[4+m>>2]=G[R+4>>2],G[8+m>>2]=G[R+8>>2],Ga(m,3*(0|G[c>>2])|0),Ea(A,m,A),Ca(A),Da(A,y),_=0|G[g>>2],N[B>>3]=3*_,N[u>>3]=0,N[b>>3]=x=-1.5*_,N[d>>3]=2.598076211353316*_,N[v>>3]=x,N[h>>3]=-2.598076211353316*_,0|G[17008+(80*(0|G[I>>2])|0)+(G[S>>2]<<2)>>2]){case 1:e=b,r=B;break;case 3:e=v,r=b;break;case 2:e=B,r=v;break;default:e=12;break e}Gc(C,y,r,e,E),_a(E,0|G[I>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2])}if((0|F)<(0|l)&&(Da(p,I),_a(I,0|G[S>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2])),G[w>>2]=G[S>>2],G[4+w>>2]=G[4+S>>2],G[8+w>>2]=G[8+S>>2],G[12+w>>2]=G[12+S>>2],(0|f)<=(0|(F=F+1|0))){e=3;break}}3==(0|e)?U=D:12==(0|e)&&M(22474,22521,581,22531)}}function bb(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=U;for(U=U+128|0,a=20208,s=(o=r=(i=A)+64|0)+60|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););for(a=20272,s=(o=i)+60|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););r=(s=0==(0|Rb(0|G[t>>2])))?r:i,Ra(i=e+4|0),Sa(i),0|Rb(0|G[t>>2])&&(La(i),G[t>>2]=1+(0|G[t>>2])),G[n>>2]=G[e>>2],Ea(i,r,t=n+4|0),Ca(t),G[n+16>>2]=G[e>>2],Ea(i,r+12|0,t=n+20|0),Ca(t),G[n+32>>2]=G[e>>2],Ea(i,r+24|0,t=n+36|0),Ca(t),G[n+48>>2]=G[e>>2],Ea(i,r+36|0,t=n+52|0),Ca(t),G[n+64>>2]=G[e>>2],Ea(i,r+48|0,n=n+68|0),Ca(n),U=A}function cb(e,t,n,r){n|=0;var i,o,a,s,A,l=0,c=0,g=0,u=0,d=0,h=U;if(U=U+32|0,A=h+12|0,o=h,u=0|G[16928+((t|=0)<<2)>>2],u=(s=0!=(0|(r|=0)))?3*u|0:u,l=0|G[(d=(e|=0)+4|0)>>2],i=0|G[(a=e+8|0)>>2],s){if((0|(l=i+l+(r=0|G[(c=e+12|0)>>2])|0))==(0|u))return U=h,0|(d=1);g=c}else l=i+l+(r=0|G[(g=e+12|0)>>2])|0;if((0|l)<=(0|u))return U=h,(d=0)|d;do{if(0<(0|r)){if(r=0|G[e>>2],0<(0|i)){c=18608+(80*r|0)+60|0,r=e;break}r=18608+(80*r|0)+40|0,r=(c=(n&&(function Aa(e,t,n,r){n|=0,r|=0,G[(e|=0)>>2]=t|=0,G[e+4>>2]=n,G[e+8>>2]=r}(A,u,0,0),Fa(d,A,o),Oa(o),Ea(o,A,d)),r),e)}else c=18608+(80*(0|G[e>>2])|0)+20|0,r=e}while(0);if(G[r>>2]=G[c>>2],0<(0|G[(l=c+16|0)>>2]))for(r=0;Na(d),(0|(r=r+1|0))<(0|G[l>>2]););return G[A>>2]=G[(e=c+4|0)>>2],G[4+A>>2]=G[e+4>>2],G[8+A>>2]=G[e+8>>2],t=0|G[16848+(t<<2)>>2],Ga(A,s?3*t|0:t),Ea(d,A,d),Ca(d),r=s&&((0|G[a>>2])+(0|G[d>>2])+(0|G[g>>2])|0)==(0|u)?1:2,U=h,0|(d=r)}function eb(e,t,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q=0,w=0,S=U;if(U=U+240|0,m=S+208|0,B=(y=S)+192|0,b=S+176|0,h=S+160|0,p=S+144|0,f=S+128|0,I=S+112|0,C=S+96|0,G[(o=S+224|0)>>2]=t|=0,G[m>>2]=G[e>>2],G[4+m>>2]=G[e+4>>2],G[8+m>>2]=G[e+8>>2],G[12+m>>2]=G[e+12>>2],fb(m,o,y),((G[i>>2]=0)|(d=r+n+(6==(0|r)&1)|0))<=(0|n))U=S;else{s=n+6|0,A=16928+((a=0|G[o>>2])<<2)|0,l=8+p|0,c=8+f|0,g=8+I|0,u=4+B|0,Q=0,w=n,r=-1;e:for(;;){if(G[B>>2]=G[(e=y+((o=(0|w)%6|0)<<4)|0)>>2],G[4+B>>2]=G[e+4>>2],G[8+B>>2]=G[e+8>>2],G[12+B>>2]=G[e+12>>2],e=Q,Q=0|cb(B,a,0,1),(0|n)<(0|w)&0!=(0|Rb(t))&&(1!=(0|e)&&(0|G[B>>2])!=(0|r))){switch(Da(y+(((5+o|0)%6|0)<<4)+4|0,b),Da(y+(o<<4)+4|0,h),v=0|G[A>>2],N[p>>3]=3*v,N[l>>3]=0,N[f>>3]=E=-1.5*v,N[c>>3]=2.598076211353316*v,N[I>>3]=E,N[g>>3]=-2.598076211353316*v,o=0|G[m>>2],0|G[17008+(80*o|0)+(((0|r)==(0|o)?0|G[B>>2]:r)<<2)>>2]){case 1:e=f,r=p;break;case 3:e=I,r=f;break;case 2:e=p,r=I;break;default:e=8;break e}Gc(b,h,r,e,C),0|Hc(b,C)||0|Hc(h,C)||(_a(C,0|G[m>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2]))}if((0|w)<(0|s)&&(Da(u,b),_a(b,0|G[B>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2])),(0|d)<=(0|(w=w+1|0))){e=3;break}r=0|G[B>>2]}3==(0|e)?U=S:8==(0|e)&&M(22557,22521,746,22602)}}function fb(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=U;for(U=U+160|0,a=20336,s=(o=r=(i=A)+80|0)+72|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););for(a=20416,s=(o=i)+72|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););r=(s=0==(0|Rb(0|G[t>>2])))?r:i,Ra(i=e+4|0),Sa(i),0|Rb(0|G[t>>2])&&(La(i),G[t>>2]=1+(0|G[t>>2])),G[n>>2]=G[e>>2],Ea(i,r,t=n+4|0),Ca(t),G[n+16>>2]=G[e>>2],Ea(i,r+12|0,t=n+20|0),Ca(t),G[n+32>>2]=G[e>>2],Ea(i,r+24|0,t=n+36|0),Ca(t),G[n+48>>2]=G[e>>2],Ea(i,r+36|0,t=n+52|0),Ca(t),G[n+64>>2]=G[e>>2],Ea(i,r+48|0,t=n+68|0),Ca(t),G[n+80>>2]=G[e>>2],Ea(i,r+60|0,n=n+84|0),Ca(n),U=A}function gb(e){var t=(e=+e)<0?e+6.283185307179586:e;return+(6.283185307179586<=e?t+-6.283185307179586:t)}function hb(e,t){return+k(+N[(e|=0)>>3]-+N[(t|=0)>>3])<17453292519943298e-27?0|(t=+k(+N[e+8>>3]-+N[t+8>>3])<17453292519943298e-27):(t=0)|t}function jb(e,t){var n,r=+N[(t|=0)>>3],i=+N[(e|=0)>>3];return n=(n=+u(.5*(r-i)))*n+(n=+u(.5*(+N[t+8>>3]-+N[e+8>>3])))*(+g(r)*+g(i)*n),2*+d(+c(n),+c(1-n))*6371.007180918475}function sb(e,t,n){n|=0;var r,i=+N[(t|=0)>>3],o=+N[(e|=0)>>3],a=+u(.5*(i-o)),t=+N[t+8>>3],e=+N[e+8>>3],s=+u(.5*(t-e)),A=+g(o),l=+g(i);return s=2*+d(+c(s=a*a+l*A*s*s),+c(1-s)),a=+N[n>>3],i=+u(.5*(a-i)),n=+N[n+8>>3],t=+u(.5*(n-t)),r=+g(a),t=2*+d(+c(t=i*i+l*r*t*t),+c(1-t)),a=+u(.5*(o-a)),n=+u(.5*(e-n)),n=2*+d(+c(n=a*a+A*r*n*n),+c(1-n)),4*+Ae(+c(+oe(.5*(r=.5*(s+t+n)))*+oe(.5*(r-s))*+oe(.5*(r-t))*+oe(.5*(r-n))))}function Ab(e,t){return t=0|cd(0|(e|=0),0|(t|=0),45),T(),127&t|0}function Bb(e,t){var n=0,r=0,i=0,o=0,a=0,s=0;if(!(!0&134217728==(-16777216&(t|=0)|0)))return(t=0)|t;if(a=0|cd(0|(e|=0),0|t,45),T(),121<(a&=127)>>>0)return(t=0)|t;n=0|cd(0|e,0|t,52),T(),n&=15;do{if(0|n){for(i=1,r=0;;){if(o=0|cd(0|e,0|t,3*(15-i|0)|0),T(),0!=(0|(o&=7))&(1^r)){if(1==(0|o)&0!=(0|la(a))){s=0,r=13;break}r=1}if(7==(0|o)){s=0,r=13;break}if(!(i>>>0>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|cd(0|e,0|t,3*(14-n|0)|0),T(),!(7==(7&s|0)&!0)){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function Cb(e,t,n){n|=0;var r,i=0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),(0|n)<=(0|(i&=15))){if((0|i)!=(0|n))if(n>>>0<=15){if(e|=0|dd(0|n,0,52),t=0|T()|-15728641&t,(0|n)<(0|i))for(;r=0|dd(7,0,3*(14-n|0)|0),n=n+1|0,e|=r,t=0|T()|t,(0|n)<(0|i););}else e=t=0}else e=t=0;return y(0|t),0|e}function Eb(e,t,n,r){n|=0,r|=0;var i,o,a=0,s=0,A=0,l=0,c=0,A=0|cd(0|(e|=0),0|(t|=0),52);if(T(),(0|n)<16&(0|(A&=15))<=(0|n)){if((0|A)==(0|n))return G[(n=r)>>2]=e,void(G[n+4>>2]=t);if(o=(0|(l=0|tc(7,n-A|0)))/7|0,i=0|cd(0|e,0|t,45),T(),0|la(127&i)){e:do{if(A)for(s=1;;){if(a=0|cd(0|e,0|t,3*(15-s|0)|0),T(),0|(a&=7))break e;if(!(s>>>0>>0)){a=0;break}s=s+1|0}else a=0}while(0);s=0==(0|a)}else s=0;if(c=0|dd(A+1|0,0,52),a=0|T()|-15728641&t,Eb(t=(c|e)&~(t=0|dd(7,0,0|(i=3*(14-A|0)|0))),A=a&~(0|T()),n,r),a=r+(o<<3)|0,!s)return Eb((c=0|dd(1,0,0|i))|t,0|T()|A,n,a),c=a+(o<<3)|0,Eb((l=0|dd(2,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(3,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(4,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(5,0,0|i))|t,0|T()|A,n,c),void Eb((l=0|dd(6,0,0|i))|t,0|T()|A,n,c+(o<<3)|0);s=a+(o<<3)|0,6<(0|l)&&(hd(0|a,0,(c=((l=a+8|0)>>>0>>0?s:l)+-1+(0-a)|0)+8&-8|0),a=l+(c>>>3<<3)|0),Eb((c=0|dd(2,0,0|i))|t,0|T()|A,n,a),c=a+(o<<3)|0,Eb((l=0|dd(3,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(4,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(5,0,0|i))|t,0|T()|A,n,c),Eb((l=0|dd(6,0,0|i))|t,0|T()|A,n,c+(o<<3)|0)}}function Fb(e,t){var n=0,r=0,i=0,i=0|cd(0|(e|=0),0|(t|=0),45);if(T(),!(0|la(127&i)))return(i=0)|i;i=0|cd(0|e,0|t,52),T(),i&=15;e:do{if(i)for(r=1;;){if(n=0|cd(0|e,0|t,3*(15-r|0)|0),T(),0|(n&=7))break e;if(!(r>>>0>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=0==(0|n)&1)}function Lb(e,t){var n=0,r=0,i=0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(i&=15))return(i=0)|i;for(r=1;;){if(n=0|cd(0|e,0|t,3*(15-r|0)|0),T(),0|(n&=7)){r=5;break}if(!(r>>>0>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Mb(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0,A=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(A&=15))return A=e,y(0|(s=t)),0|A;for(s=1,n=0;;){r=0|dd(7,0,0|(o=3*(15-s|0)|0)),i=0|T(),a=0|cd(0|e,0|t,0|o),T(),e=(o=0|dd(0|Pa(7&a),0,0|o))|e&~r,t=(a=0|T())|t&~i;e:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|cd(0|e,0|t,52),T(),r&=15){n=1;t:for(;;){switch(a=0|cd(0|e,0|t,3*(15-n|0)|0),T(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(i=0|cd(0|e,0|t,0|(a=3*(15-n|0)|0)),T(),o=0|dd(7,0,0|a),t&=~(0|T()),e=e&~o|(a=0|dd(0|Pa(7&i),0,0|a)),t=0|t|T(),!(n>>>0>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>0))break;s=s+1|0}return y(0|t),0|e}function Nb(e,t){var n,r,i,o=0,a=0,a=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(a&=15))return a=e,y(0|(o=t)),0|a;for(o=1;;){if(i=0|cd(0|e,0|t,0|(r=3*(15-o|0)|0)),T(),n=0|dd(7,0,0|r),t&=~(0|T()),e=0|dd(0|Pa(7&i),0,0|r)|e&~n,t=0|T()|t,!(o>>>0>>0))break;o=o+1|0}return y(0|t),0|e}function Pb(e,t){var n,r,i,o=0,a=0,a=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(a&=15))return a=e,y(0|(o=t)),0|a;for(o=1;;){if(r=0|dd(7,0,0|(i=3*(15-o|0)|0)),n=t&~(0|T()),t=0|cd(0|e,0|t,0|i),T(),e=(t=0|dd(0|Qa(7&t),0,0|i))|e&~r,t=0|T()|n,!(o>>>0>>0))break;o=o+1|0}return y(0|t),0|e}function Qb(e,t){e|=0;var n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=U;if(U=U+64|0,s=c+40|0,r=c+24|0,i=c+12|0,o=c,dd(0|(t|=0),0,52),n=134225919|T(),!t)return U=(2<(0|G[e+4>>2])||2<(0|G[e+8>>2])||2<(0|G[e+12>>2])?y((s=a=0)|a):(dd(0|na(e),0,45),a=0|T()|n,s=-1,y(0|a)),c),0|s;if(G[s>>2]=G[e>>2],G[s+4>>2]=G[e+4>>2],G[s+8>>2]=G[e+8>>2],G[s+12>>2]=G[e+12>>2],a=s+4|0,0<(0|t))for(e=-1;;){if(G[r>>2]=G[a>>2],G[r+4>>2]=G[a+4>>2],G[r+8>>2]=G[a+8>>2],1&t?(Ia(a),G[i>>2]=G[a>>2],G[i+4>>2]=G[a+4>>2],G[i+8>>2]=G[a+8>>2],Ka(i)):(Ja(a),G[i>>2]=G[a>>2],G[i+4>>2]=G[a+4>>2],G[i+8>>2]=G[a+8>>2],La(i)),Fa(r,i,o),Ca(o),A=0|dd(7,0,0|(l=3*(15-t|0)|0)),n&=~(0|T()),e=(l=0|dd(0|Ha(o),0,0|l))|e&~A,n=0|T()|n,!(1<(0|t)))break;t=t+-1|0}else e=-1;e:do{if((0|G[a>>2])<=2&&(0|G[s+8>>2])<=2&&(0|G[s+12>>2])<=2){if(t=0|dd(0|(r=0|na(s)),0,45),t|=e,e=0|T()|-1040385&n,o=0|function oa(e){return 0|G[11152+(216*(0|G[(e|=0)>>2])|0)+(72*(0|G[e+4>>2])|0)+(24*(0|G[e+8>>2])|0)+(G[e+12>>2]<<3)+4>>2]}(s),!(0|la(r))){if((0|o)<=0)break;for(i=0;;){if(r=0|cd(0|t,0|e,52),T(),r&=15)for(n=1;;){if(s=0|cd(0|t,0|e,0|(l=3*(15-n|0)|0)),T(),A=0|dd(7,0,0|l),e&=~(0|T()),t=t&~A|(l=0|dd(0|Pa(7&s),0,0|l)),e=0|e|T(),!(n>>>0>>0))break;n=n+1|0}if((0|(i=i+1|0))==(0|o))break e}}i=0|cd(0|t,0|e,52),T(),i&=15;t:do{if(i){n=1;n:for(;;){switch(l=0|cd(0|t,0|e,3*(15-n|0)|0),T(),7&l){case 1:break n;case 0:break;default:break t}if(!(n>>>0>>0))break t;n=n+1|0}if(0|ra(r,0|G[s>>2]))for(n=1;;){if(A=0|dd(7,0,0|(s=3*(15-n|0)|0)),l=e&~(0|T()),e=0|cd(0|t,0|e,0|s),T(),t=t&~A|(e=0|dd(0|Qa(7&e),0,0|s)),e=0|l|T(),!(n>>>0>>0))break;n=n+1|0}else for(n=1;;){if(s=0|cd(0|t,0|e,0|(l=3*(15-n|0)|0)),T(),A=0|dd(7,0,0|l),e&=~(0|T()),t=t&~A|(l=0|dd(0|Pa(7&s),0,0|l)),e=0|e|T(),!(n>>>0>>0))break;n=n+1|0}}}while(0);if(0<(0|o))for(n=0;t=0|Mb(t,e),e=0|T(),(0|(n=n+1|0))!=(0|o););}else e=t=0}while(0);return l=t,y(0|(A=e)),U=c,0|l}function Rb(e){return(0|(e|=0))%2|0}function Sb(e,t){e|=0;var n,r=U;return U=U+16|0,n=r,(t|=0)>>>0<=15&&2146435072!=(2146435072&G[e+4>>2]|0)&&2146435072!=(2146435072&G[e+8+4>>2]|0)?(Ya(e,t,n),t=0|Qb(n,t),e=0|T()):t=e=0,y(0|e),U=r,0|t}function Tb(e,t,n){var r=0,i=0,o=0,a=(n|=0)+4|0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),i&=15,o=0|cd(0|e,0|t,45),T(),r=0==(0|i),0|la(127&o)){if(r)return 0|(o=1);r=1}else{if(r)return(o=0)|o;r=0==(0|G[a>>2])&&0==(0|G[n+8>>2])?0!=(0|G[n+12>>2])&1:1}for(n=1;;){if((1&n?Ka:La)(a),o=0|cd(0|e,0|t,3*(15-n|0)|0),T(),Ma(a,7&o),!(n>>>0>>0))break;n=n+1|0}return 0|r}function Ub(e,t,n){n|=0;var r,i=0,o=0,a=0,s=0,A=0,l=0,c=U;U=U+16|0,r=c,l=0|cd(0|(e|=0),0|(t|=0),45),T(),l&=127;e:do{if(0!=(0|la(l))&&(a=0|cd(0|e,0|t,52),T(),0!=(0|(a&=15)))){i=1;t:for(;;){switch(A=0|cd(0|e,0|t,3*(15-i|0)|0),T(),7&A){case 5:break t;case 0:break;default:i=t;break e}if(!(i>>>0>>0)){i=t;break e}i=i+1|0}for(o=1,i=t;;){if(s=0|dd(7,0,0|(t=3*(15-o|0)|0)),A=i&~(0|T()),i=0|cd(0|e,0|i,0|t),T(),e=e&~s|(i=0|dd(0|Qa(7&i),0,0|t)),i=0|A|T(),!(o>>>0>>0))break;o=o+1|0}}else i=t}while(0);if(G[n>>2]=G[(A=7728+(28*l|0)|0)>>2],G[n+4>>2]=G[A+4>>2],G[n+8>>2]=G[A+8>>2],G[n+12>>2]=G[A+12>>2],0|Tb(e,i,n)){if(G[r>>2]=G[(s=n+4|0)>>2],G[r+4>>2]=G[s+4>>2],G[r+8>>2]=G[s+8>>2],a=0|cd(0|e,0|i,52),T(),A=15&a,a=1&a?(La(s),A+1|0):A,0|la(l)){e:do{if(A)for(t=1;;){if(o=0|cd(0|e,0|i,3*(15-t|0)|0),T(),0|(o&=7)){i=o;break e}if(!(t>>>0>>0)){i=0;break}t=t+1|0}else i=0}while(0);i=4==(0|i)&1}else i=0;if(0|cb(n,a,i,0)){if(0|la(l))for(;0!=(0|cb(n,a,0,0)););(0|a)!=(0|A)&&Ja(s)}else(0|a)!=(0|A)&&(G[s>>2]=G[r>>2],G[s+4>>2]=G[r+4>>2],G[s+8>>2]=G[r+8>>2]);U=c}else U=c}function Vb(e,t,n){n|=0;var r,i=U;U=U+16|0,Ub(e|=0,t|=0,r=i),t=0|cd(0|e,0|t,52),T(),function $a(e,t,n){t|=0,n|=0;var r,i=U;U=U+16|0,Da((e|=0)+4|0,r=i),_a(r,0|G[e>>2],t,0,n),U=i}(r,15&t,n),U=i}function Wb(e,t,n){n|=0;var r,i=0,o=0,a=U;U=U+16|0,Ub(e|=0,t|=0,r=a),i=0|cd(0|e,0|t,45),T(),i=0==(0|la(127&i)),o=0|cd(0|e,0|t,52),T(),o&=15;e:do{if(!i){if(0|o)for(i=1;;){if(!(0==((0|dd(7,0,3*(15-i|0)|0))&e|0)&0==((0|T())&t|0)))break e;if(!(i>>>0>>0))break;i=i+1|0}return ab(r,o,0,5,n),void(U=a)}}while(0);eb(r,o,0,6,n),U=a}function _b(e,t){t|=0;var n,r=0,i=0,o=0,a=0,s=0,A=0;if(dd(0|(e|=0),0,52),n=134225919|T(),(0|e)<1)for(r=i=0;0|la(i)&&(dd(0|i,0,45),s=0|n|T(),G[(e=t+(r<<3)|0)>>2]=-1,G[e+4>>2]=s,r=r+1|0),122!=(0|(i=i+1|0)););else{r=s=0;do{if(0|la(s)){for(dd(0|s,0,45),o=-(i=1),a=0|n|T();;){if(o&=~(A=0|dd(7,0,3*(15-i|0)|0)),a&=~(0|T()),(0|i)==(0|e))break;i=i+1|0}G[(A=t+(r<<3)|0)>>2]=o,G[A+4>>2]=a,r=r+1|0}}while(122!=(0|(s=s+1|0)))}}function $b(e,t,n,r){var i,o=0,a=0,s=0,A=0,l=U;if(U=U+64|0,s=l,(0|(e|=0))==(0|(n|=0))&(0|(t|=0))==(0|(r|=0))|!1|134217728!=(2013265920&t|0)|!1|134217728!=(2013265920&r|0))return U=l,(s=0)|s;if(o=0|cd(0|e,0|t,52),T(),o&=15,a=0|cd(0|n,0|r,52),T(),(0|o)!=(15&a|0))return U=l,(s=0)|s;if(a=o+-1|0,1>>0&&(A=0|Cb(e,t,a),i=0|T(),(0|A)==(0|(a=0|Cb(n,r,a)))&(0|i)==(0|T()))){if(o=0|cd(0|e,0|t,0|(a=3*(15^o)|0)),T(),o&=7,a=0|cd(0|n,0|r,0|a),T(),0==(0|o)|0==(0|(a&=7)))return U=l,0|(A=1);if((0|G[21136+(o<<2)>>2])==(0|a))return U=l,0|(A=1);if((0|G[21168+(o<<2)>>2])==(0|a))return U=l,0|(A=1)}for(a=(o=s)+56|0;(0|(o=o+4|(G[o>>2]=0)))<(0|a););return $(e,t,1,s),o=(0|G[(A=s)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+8|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+16|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+24|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+32|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+40|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)?1:1&((0|G[(o=s+48|0)>>2])==(0|n)?(0|G[o+4>>2])==(0|r):0),U=l,0|(A=o)}function gc(e,t,n){n|=0;var r,i,o,a=0,s=U;if(U=U+16|0,i=s,a=0|cd(0|(e|=0),0|(t|=0),56),T(),-1==(0|(t=0|function Lc(e,t,n){n|=0;var r=0,i=0;if(r=0|Fb(e|=0,t|=0),5<(n+-1|0)>>>0)return 0|(n=-1);if(1==(0|n)&(i=0!=(0|r)))return 0|(n=-1);return r=0|function Kc(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0;if(U=(l=U)+32|0,Ub(e|=0,t|=0,i=(o=l)+16|0),a=0|Ab(e,t),A=0|Lb(e,t),function pa(e,t){G[(t|=0)>>2]=G[(e=7728+(28*(e|=0)|0)|0)>>2],G[t+4>>2]=G[e+4>>2],G[t+8>>2]=G[e+8>>2],G[t+12>>2]=G[e+12>>2]}(a,o),t=0|function qa(e,t){e|=0;var n=0,r=0;if(20<(t|=0)>>>0)return 0|(t=-1);do{if((0|G[11152+(216*t|0)>>2])!=(0|e))if((0|G[11152+(216*t|0)+8>>2])!=(0|e))if((0|G[11152+(216*t|0)+16>>2])!=(0|e))if((0|G[11152+(216*t|0)+24>>2])!=(0|e))if((0|G[11152+(216*t|0)+32>>2])!=(0|e))if((0|G[11152+(216*t|0)+40>>2])!=(0|e))if((0|G[11152+(216*t|0)+48>>2])!=(0|e))if((0|G[11152+(216*t|0)+56>>2])!=(0|e))if((0|G[11152+(216*t|0)+64>>2])!=(0|e))if((0|G[11152+(216*t|0)+72>>2])!=(0|e))if((0|G[11152+(216*t|0)+80>>2])!=(0|e))if((0|G[11152+(216*t|0)+88>>2])!=(0|e))if((0|G[11152+(216*t|0)+96>>2])!=(0|e))if((0|G[11152+(216*t|0)+104>>2])!=(0|e))if((0|G[11152+(216*t|0)+112>>2])!=(0|e))if((0|G[11152+(216*t|0)+120>>2])!=(0|e))if((0|G[11152+(216*t|0)+128>>2])!=(0|e)){if((0|G[11152+(216*t|0)+136>>2])!=(0|e)){if((0|G[11152+(216*t|0)+144>>2])==(0|e)){n=2,r=e=0;break}if((0|G[11152+(216*t|0)+152>>2])==(0|e)){e=0,n=2,r=1;break}if((0|G[11152+(216*t|0)+160>>2])==(0|e)){e=0,r=n=2;break}if((0|G[11152+(216*t|0)+168>>2])==(0|e)){e=1,n=2,r=0;break}if((0|G[11152+(216*t|0)+176>>2])==(0|e)){n=2,r=e=1;break}if((0|G[11152+(216*t|0)+184>>2])==(0|e)){e=1,r=n=2;break}if((0|G[11152+(216*t|0)+192>>2])==(0|e)){n=e=2,r=0;break}if((0|G[11152+(216*t|0)+200>>2])==(0|e)){n=e=2,r=1;break}if((0|G[11152+(216*t|0)+208>>2])!=(0|e))return 0|(e=-1);r=n=e=2;break}n=1,r=e=2}else e=2,r=n=1;else e=2,n=1,r=0;else n=e=1,r=2;else r=n=e=1;else n=e=1,r=0;else e=0,n=1,r=2;else e=0,r=n=1;else n=1,r=e=0;else n=0,r=e=2;else e=2,n=0,r=1;else e=2,r=n=0;else e=1,n=0,r=2;else n=0,r=e=1;else e=1,r=n=0;else n=e=0,r=2;else n=e=0,r=1;else r=n=e=0}while(0);return 0|(t=0|G[11152+(216*t|0)+(72*n|0)+(24*e|0)+(r<<3)+4>>2])}(a,0|G[i>>2]),!(0|la(a)))return U=l,0|(A=t);{switch(0|a){case 4:e=0,n=14;break;case 14:e=1,n=14;break;case 24:e=2,n=14;break;case 38:e=3,n=14;break;case 49:e=4,n=14;break;case 58:e=5,n=14;break;case 63:e=6,n=14;break;case 72:e=7,n=14;break;case 83:e=8,n=14;break;case 97:e=9,n=14;break;case 107:e=10,n=14;break;case 117:e=11,n=14;break;default:r=s=0}}14==(0|n)&&(s=0|G[22096+(24*e|0)+8>>2],r=0|G[22096+(24*e|0)+16>>2]);(0|(e=0|G[i>>2]))!=(0|G[o>>2])&&(a=0|ma(a),e=0|G[i>>2],a|(0|e)==(0|r)&&(t=(t+1|0)%6|0));if(3==(0|A)&(0|e)==(0|r))return U=l,0|(A=(t+5|0)%6|0);return 5==(0|A)&(0|e)==(0|s)?(U=l,0|(A=(t+1|0)%6|0)):(U=l,0|(A=t))}(e,t),i?0|(n=(5-r+(0|G[22384+(n<<2)>>2])|0)%5|0):0|(n=(6-r+(0|G[22416+(n<<2)>>2])|0)%6|0)}(r=(o=!0&268435456==(2013265920&t|0))?e:0,e=o?-2130706433&t|134217728:0,7&a))))return G[n>>2]=0,void(U=s);Ub(r,e,i),a=0|cd(0|r,0|e,52),T(),a&=15,(0|Fb(r,e)?ab:eb)(i,a,t,2,n),U=s}function kc(e){var t,n,r,i,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0,E=0,Q=0,w=0,S=0,_=0,x=0,R=0,F=0,D=0;if(0|G[(A=(e|=0)+8|0)>>2])return 0|(D=1);if(!(s=0|G[e>>2]))return(D=0)|D;for(o=s,a=0;a=a+1|0,0!=(0|(o=0|G[o+8>>2])););if(a>>>0<2)return(D=0)|D;(i=0|Wc(a<<2))||M(22807,22646,317,22826),(r=0|Wc(a<<5))||M(22848,22646,321,22826),G[e>>2]=0,G[(w=e+4|0)>>2]=0,p=Q=R=a=G[A>>2]=0;e:for(;;){if(h=0|G[s>>2]){l=0,c=h;do{if(u=+N[c+8>>3],c=0|G[(o=c)+16>>2],g=+N[(A=(d=0==(0|c))?h:c)+8>>3],3.141592653589793<+k(u-g)){D=14;break}}while(l+=(g-u)*(+N[o>>3]+ +N[A>>3]),!d);if(14==(0|D))for(l=D=0,o=h;E=+N[o+8>>3],_=0|G[(x=o+16|0)>>2],v=+N[(_=0==(0|_)?h:_)+8>>3],l+=(+N[o>>3]+ +N[_>>3])*((v<0?v+6.283185307179586:v)-(E<0?E+6.283185307179586:E)),0!=(0|(o=0|G[(0==(0|o)?s:x)>>2])););0>2]=s,R=R+1|0,A=Q,o=p):D=19}else D=19;if(19==(0|D)){D=0;do{if(!a){if(p){A=w,c=p+8|0,o=s,a=e;break}if(0|G[e>>2]){D=27;break e}A=w,o=s,a=c=e;break}if(0|G[(o=a+8|0)>>2]){D=21;break e}if(!(a=0|Yc(1,12))){D=23;break e}}while(A=(G[o>>2]=a)+4|0,c=a,o=p,0);if(G[c>>2]=s,G[A>>2]=s,c=r+(Q<<5)|0,d=0|G[s>>2]){for(N[(h=r+(Q<<5)+8|0)>>3]=17976931348623157e292,N[(p=r+(Q<<5)+24|0)>>3]=17976931348623157e292,N[c>>3]=-17976931348623157e292,N[(f=r+(Q<<5)+16|0)>>3]=-17976931348623157e292,b=-(B=17976931348623157e292),A=0,I=d,g=y=-(m=u=17976931348623157e292);;){if(l=+N[I>>3],E=+N[I+8>>3],I=0|G[I+16>>2],v=+N[((C=0==(0|I))?d:I)+8>>3],l>3]=l),E>3]=E),y>3]=l:l=y,g>3]=E),B=0>3]=b,N[p>>3]=B)}else G[c>>2]=0,G[c+4>>2]=0,G[c+8>>2]=0,G[c+12>>2]=0,G[c+16>>2]=0,G[c+20>>2]=0,G[c+24>>2]=0,G[c+28>>2]=0;A=Q+1|0}if(s=0|G[(x=s+8|0)>>2],G[x>>2]=0,!s){D=45;break}Q=A,p=o}if(21==(0|D))M(22624,22646,35,22658);else if(23==(0|D))M(22678,22646,37,22658);else if(27==(0|D))M(22721,22646,61,22744);else if(45==(0|D)){e:do{if(0<(0|R)){for(x=0==(0|A),n=A<<2,_=0==(0|e),o=S=0;;){if(t=0|G[i+(S<<2)>>2],x)D=73;else{if(!(Q=0|Wc(n))){D=50;break}if(!(w=0|Wc(n))){D=52;break}t:do{if(_)a=0;else{for(a=A=0,c=e;;){if(C=0|lc(0|G[c>>2],s=r+(A<<5)|0,0|G[t>>2])?(G[Q+(a<<2)>>2]=c,G[w+(a<<2)>>2]=s,a+1|0):a,!(c=0|G[c+8>>2]))break;A=A+1|0,a=C}if(0<(0|C))if(s=0|G[Q>>2],1==(0|C))a=s;else for(f=0,I=-1,p=a=s;;){for(d=0|G[p>>2],c=s=0;;){if(h=(0|(A=0|G[G[Q+(c<<2)>>2]>>2]))==(0|d)?s:s+(1&(0|lc(A,0|G[w+(c<<2)>>2],0|G[d>>2])))|0,(0|(c=c+1|0))==(0|C))break;s=h}if(a=(A=(0|I)<(0|h))?p:a,(0|(s=f+1|0))==(0|C))break t;I=A?h:I,p=0|G[Q+((f=s)<<2)>>2]}else a=0}}while(0);if(Xc(Q),Xc(w),a){if(s=0|G[(A=a+4|0)>>2])a=s+8|0;else if(0|G[a>>2]){D=70;break}G[a>>2]=t,G[A>>2]=t}else D=73}if(73==(0|D)){if((D=0)|(o=0|G[t>>2]))for(;o=0|G[(w=o)+16>>2],Xc(w),0!=(0|o););Xc(t),o=2}if((0|R)<=(0|(S=S+1|0))){F=o;break e}}50==(0|D)?M(22863,22646,249,22882):52==(0|D)?M(22901,22646,252,22882):70==(0|D)&&M(22721,22646,61,22744)}else F=0}while(0);return Xc(i),Xc(r),0|(D=F)}return 0}function lc(e,t,n){e|=0;var r,i=0,o=0,a=0,s=0,A=0,l=0,c=0;if(!(0|xa(t|=0,n|=0)))return(e=0)|e;if(t=0|wa(t),r=+N[n>>3],i=t&(i=+N[n+8>>3])<0?i+6.283185307179586:i,!(e=0|G[e>>2]))return(e=0)|e;if(t){t=0,n=e;e:for(;;){for(;;){if(s=+N[n>>3],l=+N[n+8>>3],c=0|G[(n=n+16|0)>>2],a=+N[(c=0==(0|c)?e:c)>>3],o=+N[c+8>>3],a>2])){n=22;break e}}if((i=(s=s<0?s+6.283185307179586:s)==i|(l=o<0?o+6.283185307179586:o)==i?i+-2220446049250313e-31:i)<((l+=(r-a)/(A-a)*(s-l))<0?l+6.283185307179586:l)&&(t^=1),!(n=0|G[n>>2])){n=22;break}}if(22==(0|n))return 0|t}else{t=0,n=e;e:for(;;){for(;;){if(s=+N[n>>3],l=+N[n+8>>3],c=0|G[(n=n+16|0)>>2],a=+N[(c=0==(0|c)?e:c)>>3],o=+N[c+8>>3],a>2])){n=22;break e}}if((i=s==i|o==i?i+-2220446049250313e-31:i)>2])){n=22;break}}if(22==(0|n))return 0|t}return 0}function mc(e,t,n,r,i){n|=0,r|=0,i|=0;var o,a,s,A,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=U;if(U=U+32|0,I=C+16|0,A=C,l=0|cd(0|(e|=0),0|(t|=0),52),T(),l&=15,s=0|cd(0|n,0|r,52),T(),(0|l)!=(15&s|0))return U=C,0|(I=1);if(d=0|cd(0|e,0|t,45),T(),d&=127,h=0|cd(0|n,0|r,45),T(),s=(0|d)!=(0|(h&=127))){if(7==(0|(g=0|ta(d,h))))return U=C,0|(I=2);7==(0|(u=0|ta(h,d)))?M(22925,22949,151,22959):(p=g,c=u)}else c=p=0;o=0|la(d),a=0|la(h),G[I>>2]=0,G[I+4>>2]=0,G[I+8>>2]=0,G[I+12>>2]=0;do{if(p){if(g=0<(0|(h=0|G[4304+(28*d|0)+(p<<2)>>2])),a)if(g){for(d=0,u=n,g=r;u=0|function Ob(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0,A=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(A&=15))return A=e,y(0|(s=t)),0|A;for(s=1,n=0;;){r=0|dd(7,0,0|(o=3*(15-s|0)|0)),i=0|T(),a=0|cd(0|e,0|t,0|o),T(),e=(o=0|dd(0|Qa(7&a),0,0|o))|e&~r,t=(a=0|T())|t&~i;e:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|cd(0|e,0|t,52),T(),r&=15){n=1;t:for(;;){switch(a=0|cd(0|e,0|t,3*(15-n|0)|0),T(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(o=0|dd(7,0,0|(i=3*(15-n|0)|0)),a=t&~(0|T()),t=0|cd(0|e,0|t,0|i),T(),e=e&~o|(t=0|dd(0|Qa(7&t),0,0|i)),t=0|a|T(),!(n>>>0>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>0))break;s=s+1|0}return y(0|t),0|e}(u,g),g=0|T(),1==(0|(c=0|Qa(c)))&&(c=0|Qa(1)),(0|(d=d+1|0))!=(0|h););h=c,d=u,u=g}else h=c,d=n,u=r;else if(g){for(d=0,u=n,g=r;u=0|Pb(u,g),g=0|T(),c=0|Qa(c),(0|(d=d+1|0))!=(0|h););h=c,d=u,u=g}else h=c,d=n,u=r;if(Tb(d,u,I),s||M(22972,22949,181,22959),(g=0!=(0|o))&(c=0!=(0|a))&&M(22999,22949,182,22959),g){if(c=0|Lb(e,t),0|m[22032+(7*c|0)+p>>0]){l=3;break}d=u=0|G[21200+(28*c|0)+(p<<2)>>2],f=26}else if(c){if(c=0|Lb(d,u),0|m[22032+(7*c|0)+h>>0]){l=4;break}u=(d=0)|G[21200+(28*h|0)+(c<<2)>>2],f=26}else c=0;if(26==(0|f))if((0|u)<=-1&&M(23030,22949,212,22959),(0|d)<=-1&&M(23053,22949,213,22959),0<(0|u)){for(g=I+4|0,c=0;Oa(g),(0|(c=c+1|0))!=(0|u););c=d}else c=d;if(G[A>>2]=0,G[A+4>>2]=0,G[A+8>>2]=0,Ma(A,p),0|l)for(;;){if((0|Rb(l)?Ka:La)(A),!(1<(0|l)))break;l=l+-1|0}if(0<(0|c))for(l=0;Oa(A),(0|(l=l+1|0))!=(0|c););Ea(f=I+4|0,A,f),Ca(f),f=50}else if(Tb(n,r,I),0!=(0|o)&0!=(0|a))if((0|h)!=(0|d)&&M(23077,22949,243,22959),c=0|Lb(e,t),l=0|Lb(n,r),0|m[22032+(7*c|0)+l>>0])l=5;else if(0<(0|(c=0|G[21200+(28*c|0)+(l<<2)>>2]))){for(g=I+4|0,l=0;Oa(g),(0|(l=l+1|0))!=(0|c););f=50}else f=50;else f=50}while(0);return 50==(0|f)&&(G[i>>2]=G[(l=I+4|0)>>2],G[i+4>>2]=G[l+4>>2],G[i+8>>2]=G[l+8>>2],l=0),U=C,0|(I=l)}function nc(e,t,n,r){n|=0,r|=0;var i,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=U;if(U=U+48|0,s=C+36|0,A=C+24|0,l=C+12|0,c=C,a=0|cd(0|(e|=0),0|(t|=0),52),T(),a&=15,u=0|cd(0|e,0|t,45),T(),i=0|la(u&=127),dd(0|a,0,52),p=134225919|T(),G[(h=r)>>2]=-1,G[h+4>>2]=p,!a)return 1<(0|G[n>>2])||1<(0|G[n+4>>2])||1<(0|G[n+8>>2])||127==(0|(o=0|sa(u,0|Ha(n))))?(U=C,0|(p=1)):(d=0|dd(0|o,0,45),h=0|T(),h=-1040385&G[(u=r)+4>>2]|h,G[(p=r)>>2]=G[u>>2]|d,G[p+4>>2]=h,U=C,(p=0)|p);for(G[s>>2]=G[n>>2],G[s+4>>2]=G[n+4>>2],G[s+8>>2]=G[n+8>>2];;){if(G[A>>2]=G[s>>2],G[A+4>>2]=G[s+4>>2],G[A+8>>2]=G[s+8>>2],0|Rb(a)?(Ia(s),G[l>>2]=G[s>>2],G[l+4>>2]=G[s+4>>2],G[l+8>>2]=G[s+8>>2],Ka(l)):(Ja(s),G[l>>2]=G[s>>2],G[l+4>>2]=G[s+4>>2],G[l+8>>2]=G[s+8>>2],La(l)),Fa(A,l,c),Ca(c),f=0|G[(h=r)>>2],h=0|G[h+4>>2],n=0|dd(7,0,0|(I=3*(15-a|0)|0)),h&=~(0|T()),I=0|dd(0|Ha(c),0,0|I),h=0|T()|h,G[(p=r)>>2]=I|f&~n,G[p+4>>2]=h,!(1<(0|a)))break;a=a+-1|0}e:do{if((0|G[s>>2])<=1&&(0|G[s+4>>2])<=1&&(0|G[s+8>>2])<=1){c=127==(0|(A=0|sa(u,a=0|Ha(s))))?0:0|la(A);t:do{if(a){if(i){if(s=21408+(28*(0|Lb(e,t))|0)+(a<<2)|0,0<(0|(s=0|G[s>>2])))for(n=0;a=0|Pa(a),(0|(n=n+1|0))!=(0|s););if(1==(0|a)){o=3;break e}127==(0|(n=0|sa(u,a)))&&M(23104,22949,376,23134),0|la(n)?M(23147,22949,377,23134):(d=s,g=a,o=n)}else d=0,g=a,o=A;if((0|(l=0|G[4304+(28*u|0)+(g<<2)>>2]))<=-1&&M(23178,22949,384,23134),!c){if((0|d)<=-1&&M(23030,22949,417,23134),0|d)for(n=(a=0)|G[(s=r)>>2],s=0|G[s+4>>2];n=0|Nb(n,s),s=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=s,(0|(a=a+1|0))<(0|d););if((0|l)<=0){a=54;break}for(n=(a=0)|G[(s=r)>>2],s=0|G[s+4>>2];;)if(n=0|Nb(n,s),s=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=s,(0|(a=a+1|0))==(0|l)){a=54;break t}}if(7==(0|(A=0|ta(o,u)))&&M(22925,22949,393,23134),n=0|G[(a=r)>>2],a=0|G[a+4>>2],0<(0|l))for(s=0;n=0|Nb(n,a),a=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=a,(0|(s=s+1|0))!=(0|l););if(n=0|Lb(n,a),I=0|ma(o),(0|(n=0|G[(I?21824:21616)+(28*A|0)+(n<<2)>>2]))<=-1&&M(23030,22949,412,23134),n){for(s=(a=0)|G[(A=r)>>2],A=0|G[A+4>>2];s=0|Mb(s,A),A=0|T(),G[(I=r)>>2]=s,G[I+4>>2]=A,(0|(a=a+1|0))<(0|n););a=54}else a=54}else if(0!=(0|i)&0!=(0|c))if(a=21408+(28*(I=0|Lb(e,t))|0)+((0|Lb(0|G[(a=r)>>2],0|G[a+4>>2]))<<2)|0,(0|(a=0|G[a>>2]))<=-1&&M(23201,22949,433,23134),a){for(n=(o=0)|G[(s=r)>>2],s=0|G[s+4>>2];n=0|Nb(n,s),s=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=s,(0|(o=o+1|0))<(0|a););o=A,a=54}else o=A,a=55;else o=A,a=54}while(0);if(55==(0|(a=54==(0|a)&&c?55:a))&&1==(0|Lb(0|G[(I=r)>>2],0|G[I+4>>2]))){o=4;break}p=0|G[(I=r)>>2],I=-1040385&G[I+4>>2],f=0|dd(0|o,0,45),I=0|I|T(),G[(o=r)>>2]=p|f,G[o+4>>2]=I,o=0}else o=2}while(0);return U=C,0|(I=o)}function tc(e,t){e|=0;var n=0;if(!(t|=0))return 0|(n=1);for(n=e,e=1;e=0|a(0==(1&t|0)?1:n,e),t>>=1,n=0|a(n,n),0!=(0|t););return 0|e}function uc(e,t,n){var r,i,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0;if(!(0|xa(t|=0,n|=0)))return(u=0)|u;if(t=0|wa(t),i=+N[n>>3],o=t&(o=+N[n+8>>3])<0?o+6.283185307179586:o,(0|(u=0|G[(e|=0)>>2]))<=0)return(u=0)|u;if(r=0|G[e+4>>2],t){n=-1,e=t=0;e:for(;;){for(g=e;;){if(A=+N[r+(g<<4)>>3],c=+N[r+(g<<4)+8>>3],s=+N[r+((e=(n+2|0)%(0|u)|0)<<4)>>3],a=+N[r+(e<<4)+8>>3],s>3],c=+N[r+(g<<4)+8>>3],s=+N[r+((e=(n+2|0)%(0|u)|0)<<4)>>3],a=+N[r+(e<<4)+8>>3],s>2]))return G[t>>2]=0,G[t+4>>2]=0,G[t+8>>2]=0,G[t+12>>2]=0,G[t+16>>2]=0,G[t+20>>2]=0,G[t+24>>2]=0,void(G[t+28>>2]=0);if(N[(i=t+8|0)>>3]=17976931348623157e292,N[(o=t+24|0)>>3]=17976931348623157e292,N[t>>3]=-17976931348623157e292,N[(a=t+16|0)>>3]=-17976931348623157e292,!((0|A)<=0)){for(r=0|G[e+4>>2],p=-(h=17976931348623157e292),e=-1,c=d=-(u=g=17976931348623157e292),I=f=0;;){if(l=+N[r+(I<<4)>>3],s=+N[r+(I<<4)+8>>3],n=+N[r+(((0|(e=e+2|0))==(0|A)?0:e)<<4)+8>>3],l>3]=l),s>3]=s),d>3]=l:l=d,c>3]=s),h=0>3]=p,N[o>>3]=h)}}function Gc(e,t,n,r,i){var o=+N[(e|=0)>>3],a=+N[(t|=0)>>3]-o,e=+N[e+8>>3],t=+N[t+8>>3]-e,s=+N[(n|=0)>>3],A=+N[(r|=0)>>3]-s,n=+N[n+8>>3],r=+N[r+8>>3]-n;N[(i|=0)>>3]=o+a*(A=(A*(e-n)-(o-s)*r)/(a*r-t*A)),N[i+8>>3]=e+t*A}function Hc(e,t){return+N[(e|=0)>>3]!=+N[(t|=0)>>3]?(t=0)|t:0|(t=+N[e+8>>3]==+N[t+8>>3])}function Ic(e,t){var n;return(n=+N[(e|=0)>>3]-+N[(t|=0)>>3])*n+(n=+N[e+8>>3]-+N[t+8>>3])*n+(n=+N[e+16>>3]-+N[t+16>>3])*n}function Mc(e,t,n){e|=0,n|=0;var r;0<(0|(t|=0))?(r=0|Yc(t,4),(G[e>>2]=r)||M(23230,23253,40,23267)):G[e>>2]=0,G[e+4>>2]=t,G[e+8>>2]=0,G[e+12>>2]=n}function Nc(e){var t=0,n=0,r=0,i=0,o=(e|=0)+4|0,a=e+12|0,s=e+8|0;e:for(;;){for(n=0|G[o>>2],t=0;;){if((0|n)<=(0|t))break e;if(r=0|G[e>>2],i=0|G[r+(t<<2)>>2])break;t=t+1|0}t=r+(~~(+k(+ie(10,15-(0|G[a>>2])|0)*(+N[i>>3]+ +N[i+8>>3]))%(0|n))>>>0<<2)|0,n=0|G[t>>2];t:do{if(0|n){if(r=i+32|0,(0|n)==(0|i))G[t>>2]=G[r>>2];else{if(!(t=0|G[(n=n+32|0)>>2]))break;for(;;){if((0|t)==(0|i))break;if(!(t=0|G[(n=t+32|0)>>2]))break t}G[n>>2]=G[r>>2]}Xc(i),G[s>>2]=(0|G[s>>2])-1}}while(0)}Xc(0|G[e>>2])}function Oc(e){for(var t=0,n=0,r=0|G[(e|=0)+4>>2],n=0;;){if((0|r)<=(0|n)){t=0,n=4;break}if(t=0|G[(0|G[e>>2])+(n<<2)>>2]){n=4;break}n=n+1|0}return 4==(0|n)?0|t:0}function Pc(e,t){t|=0;var n=0,r=0,i=0,o=0,n=~~(+k(+ie(10,15-(0|G[(e|=0)+12>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0;if(n=(0|G[e>>2])+(n<<2)|0,!(r=0|G[n>>2]))return 0|(o=1);o=t+32|0;do{if((0|r)!=(0|t)){if(!(n=0|G[r+32>>2]))return 0|(o=1);for(i=n;;){if((0|i)==(0|t)){i=8;break}if(!(n=0|G[i+32>>2])){n=1,i=10;break}r=i,i=n}if(8==(0|i)){G[r+32>>2]=G[o>>2];break}if(10==(0|i))return 0|n}else G[n>>2]=G[o>>2]}while(0);return Xc(t),G[(o=e+8|0)>>2]=(0|G[o>>2])-1,(o=0)|o}function Vc(e){return 0|~~+function Uc(e){return+id(+(e=+e))}(e=+e)}function Wc(e){e|=0;var t=0,n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=U;U=U+16|0,u=B;do{if(e>>>0<245){if(3&(n=(g=0|G[5829])>>>(e=(l=e>>>0<11?16:e+11&-8)>>>3))|0)return r=0|G[(n=(e=23356+((t=(1&n^1)+e|0)<<1<<2)|0)+8|0)>>2],(0|(o=0|G[(i=r+8|0)>>2]))==(0|e)?G[5829]=g&~(1<>2]=e,G[n>>2]=o),G[r+4>>2]=3|(y=t<<3),G[(y=r+y+4|0)>>2]=1|G[y>>2],U=B,0|(y=i);if((c=0|G[5831])>>>0>>0){if(0|n)return t=((t=n<>>=s=t>>>12&16)>>>5&8)|s|(o=(t>>>=n)>>>2&4)|(e=(t>>>=o)>>>1&2)|(r=(t>>>=e)>>>1&1))+(t>>>r)|0)<<1<<2)|0)+8|0)>>2],(0|(n=0|G[(s=o+8|0)>>2]))==(0|t)?G[5829]=e=g&~(1<>2]=t,G[e>>2]=n,e=g),a=(y=r<<3)-l|0,G[o+4>>2]=3|l,G[(i=o+l|0)+4>>2]=1|a,G[o+y>>2]=a,0|c&&(r=0|G[5834],n=23356+((t=c>>>3)<<1<<2)|0,e&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=r,G[t+12>>2]=r,G[r+8>>2]=t,G[r+12>>2]=n),G[5831]=a,G[5834]=i,U=B,0|(y=s);if(o=0|G[5830]){for(n=(o&0-o)-1|0,A=0|G[23620+(((r=(n>>>=i=n>>>12&16)>>>5&8)|i|(a=(n>>>=r)>>>2&4)|(s=(n>>>=a)>>>1&2)|(A=(n>>>=s)>>>1&1))+(n>>>A)<<2)>>2],A=(-8&G[(s=n=A)+4>>2])-l|0;;){if(!(e=0|G[n+16>>2])&&!(e=0|G[n+20>>2]))break;s=(i=(a=(-8&G[(n=e)+4>>2])-l|0)>>>0>>0)?e:s,A=i?a:A}if(s>>>0<(a=s+l|0)>>>0){i=0|G[s+24>>2],t=0|G[s+12>>2];do{if((0|t)==(0|s)){if(!(t=0|G[(e=s+20|0)>>2])&&!(t=0|G[(e=s+16|0)>>2])){n=0;break}for(;;)if(n=0|G[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|G[(r=t+16|0)>>2]))break;t=n,e=r}G[e>>2]=0,n=t}else n=0|G[s+8>>2],G[n+12>>2]=t,G[t+8>>2]=n,n=t}while(0);do{if(0|i){if(t=0|G[s+28>>2],(0|s)==(0|G[(e=23620+(t<<2)|0)>>2])){if(!(G[e>>2]=n)){G[5830]=o&~(1<>2])==(0|s)?y:i+20|0)>>2]=n))break;G[n+24>>2]=i,0|(t=0|G[s+16>>2])&&(G[n+16>>2]=t,G[t+24>>2]=n),0|(t=0|G[s+20>>2])&&(G[n+20>>2]=t,G[t+24>>2]=n)}}while(0);return A>>>0<16?(G[s+4>>2]=3|(y=A+l|0),G[(y=s+y+4|0)>>2]=1|G[y>>2]):(G[s+4>>2]=3|l,G[a+4>>2]=1|A,G[a+A>>2]=A,0|c&&(r=0|G[5834],n=23356+((t=c>>>3)<<1<<2)|0,(t=1<>2]:(G[5829]=t|g,e=(t=n)+8|0),G[e>>2]=r,G[t+12>>2]=r,G[r+8>>2]=t,G[r+12>>2]=n),G[5831]=A,G[5834]=a),U=B,0|(y=s+8|0)}g=l}else g=l}else g=l}else if(e>>>0<=4294967231)if(l=-8&(e=e+11|0),r=0|G[5830]){i=0-l|0,A=(e>>>=8)?16777215>>0?31:l>>>((A=14-((s=((p=e<<(g=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|g|(A=((p<<=s)+245760|0)>>>16&2))+(p<>>15)|0)+7|0)&1|A<<1:0,n=0|G[23620+(A<<2)>>2];e:do{if(n)for(s=l<<(31==((e=0)|A)?0:25-(A>>>1)|0),o=0;;){if((a=(-8&G[n+4>>2])-l|0)>>>0>>0){if(!a){e=n,i=0,p=65;break e}e=n,i=a}if(o=0==(0|(p=0|G[n+20>>2]))|(0|p)==(0|(n=0|G[n+16+(s>>>31<<2)>>2]))?o:p,!n){n=o,p=61;break}s<<=1}else e=n=0,p=61}while(0);if(61==(0|p)){if(0==(0|n)&0==(0|e)){if(!(e=((e=2<>>=a=g>>>12&16)>>>5&8)|a|(s=(g>>>=o)>>>2&4)|(A=(g>>>=s)>>>1&2)|(n=(g>>>=A)>>>1&1))+(g>>>n)<<2)>>2]}n?p=65:(s=e,a=i)}if(65==(0|p))for(o=n;;){if(i=(n=(g=(-8&G[o+4>>2])-l|0)>>>0>>0)?g:i,e=n?o:e,!(n=(n=0|G[o+16>>2])||0|G[o+20>>2])){s=e,a=i;break}o=n}if(0!=(0|s)&&a>>>0<((0|G[5831])-l|0)>>>0&&s>>>0<(c=s+l|0)>>>0){o=0|G[s+24>>2],t=0|G[s+12>>2];do{if((0|t)==(0|s)){if(!(t=0|G[(e=s+20|0)>>2])&&!(t=0|G[(e=s+16|0)>>2])){t=0;break}for(;;)if(n=0|G[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|G[(i=t+16|0)>>2]))break;t=n,e=i}G[e>>2]=0}else y=0|G[s+8>>2],G[y+12>>2]=t,G[t+8>>2]=y}while(0);do{if(o){if(e=0|G[s+28>>2],(0|s)==(0|G[(n=23620+(e<<2)|0)>>2])){if(!(G[n>>2]=t)){r&=~(1<>2])==(0|s)?y:o+20|0)>>2]=t))break;G[t+24>>2]=o,0|(e=0|G[s+16>>2])&&(G[t+16>>2]=e,G[e+24>>2]=t),(e=0|G[s+20>>2])&&(G[t+20>>2]=e,G[e+24>>2]=t)}}while(0);e:do{if(a>>>0<16)G[s+4>>2]=3|(y=a+l|0),G[(y=s+y+4|0)>>2]=1|G[y>>2];else{if(G[s+4>>2]=3|l,G[c+4>>2]=1|a,t=(G[c+a>>2]=a)>>>3,a>>>0<256){n=23356+(t<<1<<2)|0,(e=0|G[5829])&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=c,G[t+12>>2]=c,G[c+8>>2]=t,G[c+12>>2]=n;break}if(t=23620+((n=(t=a>>>8)?16777215>>0?31:a>>>((n=14-((C=((y=t<<(m=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(n=((y<<=C)+245760|0)>>>16&2))+(y<>>15)|0)+7|0)&1|n<<1:0)<<2)|0,G[c+28>>2]=n,G[(e=c+16|0)+4>>2]=0,G[e>>2]=0,!(r&(e=1<>2]=c,G[c+24>>2]=t,G[c+12>>2]=c,G[c+8>>2]=c;break}t=0|G[t>>2];t:do{if((-8&G[t+4>>2]|0)!=(0|a)){for(r=a<<(31==(0|n)?0:25-(n>>>1)|0);;){if(!(e=0|G[(n=t+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[e+4>>2]|0)==(0|a)){t=e;break t}r<<=1,t=e}G[n>>2]=c,G[c+24>>2]=t,G[c+12>>2]=c,G[c+8>>2]=c;break e}}while(0);y=0|G[(m=t+8|0)>>2],G[y+12>>2]=c,G[m>>2]=c,G[c+8>>2]=y,G[c+12>>2]=t,G[c+24>>2]=0}}while(0);return U=B,0|(y=s+8|0)}g=l}else g=l;else g=-1}while(0);if(g>>>0<=(n=0|G[5831])>>>0)return e=0|G[5834],15<(t=n-g|0)>>>0?(G[5834]=y=e+g|0,G[5831]=t,G[y+4>>2]=1|t,G[e+n>>2]=t,G[e+4>>2]=3|g):(G[5831]=0,G[5834]=0,G[e+4>>2]=3|n,G[(y=e+n+4|0)>>2]=1|G[y>>2]),U=B,0|(y=e+8|0);if(g>>>0<(a=0|G[5832])>>>0)return G[5832]=C=a-g|0,y=0|G[5835],G[5835]=m=y+g|0,G[m+4>>2]=1|C,G[y+4>>2]=3|g,U=B,0|(y=y+8|0);if(s=g+48|0,(l=(o=(e=0|G[5947]?0|G[5949]:(G[5949]=4096,G[5948]=4096,G[5950]=-1,G[5951]=-1,G[5952]=0,G[5940]=0,G[5947]=-16&u^1431655768,4096))+(A=g+47|0)|0)&(i=0-e|0))>>>0<=g>>>0)return U=B,(y=0)|y;if(0|(e=0|G[5939])&&(u=(c=0|G[5937])+l|0)>>>0<=c>>>0|e>>>0>>0)return U=B,(y=0)|y;e:do{if(4&G[5940])t=0,p=143;else{n=0|G[5835];t:do{if(n){for(r=23764;;){if((u=0|G[r>>2])>>>0<=n>>>0&&(u+(0|G[r+4>>2])|0)>>>0>n>>>0)break;if(!(e=0|G[r+8>>2])){p=128;break t}r=e}if((t=o-a&i)>>>0<2147483647)if((0|(e=0|jd(0|t)))==((0|G[r>>2])+(0|G[r+4>>2])|0)){if(-1!=(0|e)){a=t,o=e,p=145;break e}}else r=e,p=136;else t=0}else p=128}while(0);do{if(128==(0|p))if(-1!=(0|(n=0|jd(0)))&&(t=n,h=(t=(0==((h=(d=0|G[5948])+-1|0)&t|0)?0:(h+t&0-d)-t|0)+l|0)+(d=0|G[5937])|0,g>>>0>>0&t>>>0<2147483647)){if(0|(u=0|G[5939])&&h>>>0<=d>>>0|u>>>0>>0){t=0;break}if((0|(e=0|jd(0|t)))==(0|n)){a=t,o=n,p=145;break e}r=e,p=136}else t=0}while(0);do{if(136==(0|p)){if(n=0-t|0,!(t>>>0>>0&t>>>0<2147483647&-1!=(0|r))){if(-1==(0|r)){t=0;break}a=t,o=r,p=145;break e}if(2147483647<=(e=A-t+(e=0|G[5949])&0-e)>>>0){a=t,o=r,p=145;break e}if(-1==(0|jd(0|e))){jd(0|n),t=0;break}a=e+t|0,o=r,p=145;break e}}while(0);G[5940]=4|G[5940],p=143}}while(0);if(143==(0|p)&&l>>>0<2147483647&&!(-1==(0|(C=0|jd(0|l)))|1^(I=(g+40|0)>>>0<(f=(h=0|jd(0))-C|0)>>>0)|C>>>0>>0&-1!=(0|C)&-1!=(0|h)^1)&&(a=I?f:t,o=C,p=145),145==(0|p)){t=(0|G[5937])+a|0,(G[5937]=t)>>>0>(0|G[5938])>>>0&&(G[5938]=t),A=0|G[5835];e:do{if(A){for(t=23764;;){if((0|o)==((e=0|G[t>>2])+(n=0|G[t+4>>2])|0)){p=154;break}if(!(r=0|G[t+8>>2]))break;t=r}if(154==(0|p)&&(m=t+4|0,0==(8&G[t+12>>2]|0))&&A>>>0>>0&e>>>0<=A>>>0){G[m>>2]=n+a,m=A+(C=0==(7&(C=A+8|0)|0)?0:0-C&7)|0,C=(y=(0|G[5832])+a|0)-C|0,G[5835]=m,G[5832]=C,G[m+4>>2]=1|C,G[A+y+4>>2]=40,G[5836]=G[5951];break}for(o>>>0<(0|G[5833])>>>0&&(G[5833]=o),n=o+a|0,t=23764;;){if((0|G[t>>2])==(0|n)){p=162;break}if(!(e=0|G[t+8>>2]))break;t=e}if(162==(0|p)&&0==(8&G[t+12>>2]|0)){G[t>>2]=o,G[(c=t+4|0)>>2]=(0|G[c>>2])+a,l=(c=o+(0==(7&(c=o+8|0)|0)?0:0-c&7)|0)+g|0,s=(t=n+(0==(7&(t=n+8|0)|0)?0:0-t&7)|0)-c-g|0,G[c+4>>2]=3|g;t:do{if((0|A)==(0|t))y=(0|G[5832])+s|0,G[5832]=y,G[5835]=l,G[l+4>>2]=1|y;else{if((0|G[5834])==(0|t)){y=(0|G[5831])+s|0,G[5831]=y,G[5834]=l,G[l+4>>2]=1|y,G[l+y>>2]=y;break}if(1==(3&(e=0|G[t+4>>2])|0)){a=-8&e,r=e>>>3;n:do{if(e>>>0<256){if(e=0|G[t+8>>2],(0|(n=0|G[t+12>>2]))==(0|e)){G[5829]=G[5829]&~(1<>2]=n,G[n+8>>2]=e;break}o=0|G[t+24>>2],e=0|G[t+12>>2];do{if((0|e)==(0|t)){if(e=0|G[(r=(n=t+16|0)+4|0)>>2])n=r;else if(!(e=0|G[n>>2])){e=0;break}for(;;)if(r=0|G[(i=e+20|0)>>2])e=r,n=i;else{if(!(r=0|G[(i=e+16|0)>>2]))break;e=r,n=i}G[n>>2]=0}else y=0|G[t+8>>2],G[y+12>>2]=e,G[e+8>>2]=y}while(0);if(!o)break;r=23620+((n=0|G[t+28>>2])<<2)|0;do{if((0|G[r>>2])==(0|t)){if(0|(G[r>>2]=e))break;G[5830]=G[5830]&~(1<>2])==(0|t)?y:o+20|0)>>2]=e))break n}while(0)}while((G[e+24>>2]=o,0|(r=0|G[(n=t+16|0)>>2])&&(G[e+16>>2]=r,G[r+24>>2]=e),n=0|G[n+4>>2])&&(G[e+20>>2]=n,G[n+24>>2]=e,0));t=t+a|0,i=a+s|0}else i=s;if(G[(t=t+4|0)>>2]=-2&G[t>>2],G[l+4>>2]=1|i,t=(G[l+i>>2]=i)>>>3,i>>>0<256){n=23356+(t<<1<<2)|0,(e=0|G[5829])&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=l,G[t+12>>2]=l,G[l+8>>2]=t,G[l+12>>2]=n;break}t=i>>>8;do{if(t){if(16777215>>0){r=31;break}r=i>>>((r=14-((C=((y=t<<(m=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((y<<=C)+245760|0)>>>16&2))+(y<>>15)|0)+7|0)&1|r<<1}else r=0}while(0);if(t=23620+(r<<2)|0,G[l+28>>2]=r,G[(e=l+16|0)+4>>2]=0,!((e=(G[e>>2]=0)|G[5830])&(n=1<>2]=l,G[l+24>>2]=t,G[l+12>>2]=l,G[l+8>>2]=l;break}t=0|G[t>>2];n:do{if((-8&G[t+4>>2]|0)!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1)|0);;){if(!(e=0|G[(n=t+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[e+4>>2]|0)==(0|i)){t=e;break n}r<<=1,t=e}G[n>>2]=l,G[l+24>>2]=t,G[l+12>>2]=l,G[l+8>>2]=l;break t}}while(0);y=0|G[(m=t+8|0)>>2],G[y+12>>2]=l,G[m>>2]=l,G[l+8>>2]=y,G[l+12>>2]=t,G[l+24>>2]=0}}while(0);return U=B,0|(y=c+8|0)}for(t=23764;;){if((e=0|G[t>>2])>>>0<=A>>>0&&A>>>0<(y=e+(0|G[t+4>>2])|0)>>>0)break;t=0|G[t+8>>2]}for(t=(e=(e=(i=y+-47|0)+(0==(7&(e=i+8|0)|0)?0:0-e&7)|0)>>>0<(i=A+16|0)>>>0?A:e)+8|0,m=o+(C=0==(7&(C=o+8|0)|0)?0:0-C&7)|0,C=(n=a+-40|0)-C|0,G[5835]=m,G[5832]=C,G[m+4>>2]=1|C,G[o+n+4>>2]=40,G[5836]=G[5951],G[(n=e+4|0)>>2]=27,G[t>>2]=G[5941],G[t+4>>2]=G[5942],G[t+8>>2]=G[5943],G[t+12>>2]=G[5944],G[5941]=o,G[5942]=a,G[5944]=0,G[5943]=t,t=e+24|0;G[(t=(m=t)+4|0)>>2]=7,(m+8|0)>>>0>>0;);if((0|e)!=(0|A)){if(o=e-A|0,G[n>>2]=-2&G[n>>2],G[A+4>>2]=1|o,t=(G[e>>2]=o)>>>3,o>>>0<256){n=23356+(t<<1<<2)|0,(e=0|G[5829])&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=A,G[t+12>>2]=A,G[A+8>>2]=t,G[A+12>>2]=n;break}if(n=23620+((r=(t=o>>>8)?16777215>>0?31:o>>>((r=14-((C=((y=t<<(m=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((y<<=C)+245760|0)>>>16&2))+(y<>>15)|0)+7|0)&1|r<<1:0)<<2)|0,G[A+28>>2]=r,G[A+20>>2]=0,!((t=(G[i>>2]=0)|G[5830])&(e=1<>2]=A,G[A+24>>2]=n,G[A+12>>2]=A,G[A+8>>2]=A;break}t=0|G[n>>2];t:do{if((-8&G[t+4>>2]|0)!=(0|o)){for(r=o<<(31==(0|r)?0:25-(r>>>1)|0);;){if(!(e=0|G[(n=t+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[e+4>>2]|0)==(0|o)){t=e;break t}r<<=1,t=e}G[n>>2]=A,G[A+24>>2]=t,G[A+12>>2]=A,G[A+8>>2]=A;break e}}while(0);y=0|G[(m=t+8|0)>>2],G[y+12>>2]=A,G[m>>2]=A,G[A+8>>2]=y,G[A+12>>2]=t,G[A+24>>2]=0}}else 0==(0|(y=0|G[5833]))|o>>>0>>0&&(G[5833]=o),G[5941]=o,G[5942]=a,G[5944]=0,G[5838]=G[5947],G[5837]=-1,G[5842]=23356,G[5841]=23356,G[5844]=23364,G[5843]=23364,G[5846]=23372,G[5845]=23372,G[5848]=23380,G[5847]=23380,G[5850]=23388,G[5849]=23388,G[5852]=23396,G[5851]=23396,G[5854]=23404,G[5853]=23404,G[5856]=23412,G[5855]=23412,G[5858]=23420,G[5857]=23420,G[5860]=23428,G[5859]=23428,G[5862]=23436,G[5861]=23436,G[5864]=23444,G[5863]=23444,G[5866]=23452,G[5865]=23452,G[5868]=23460,G[5867]=23460,G[5870]=23468,G[5869]=23468,G[5872]=23476,G[5871]=23476,G[5874]=23484,G[5873]=23484,G[5876]=23492,G[5875]=23492,G[5878]=23500,G[5877]=23500,G[5880]=23508,G[5879]=23508,G[5882]=23516,G[5881]=23516,G[5884]=23524,G[5883]=23524,G[5886]=23532,G[5885]=23532,G[5888]=23540,G[5887]=23540,G[5890]=23548,G[5889]=23548,G[5892]=23556,G[5891]=23556,G[5894]=23564,G[5893]=23564,G[5896]=23572,G[5895]=23572,G[5898]=23580,G[5897]=23580,G[5900]=23588,G[5899]=23588,G[5902]=23596,G[5901]=23596,G[5904]=23604,G[5903]=23604,m=o+(C=0==(7&(C=o+8|0)|0)?0:0-C&7)|0,C=(y=a+-40|0)-C|0,G[5835]=m,G[5832]=C,G[m+4>>2]=1|C,G[o+y+4>>2]=40,G[5836]=G[5951]}while(0);if(g>>>0<(t=0|G[5832])>>>0)return G[5832]=C=t-g|0,y=0|G[5835],G[5835]=m=y+g|0,G[m+4>>2]=1|C,G[y+4>>2]=3|g,U=B,0|(y=y+8|0)}return G[(y=23312)>>2]=12,U=B,(y=0)|y}function Xc(e){var t=0,n=0,r=0,i=0,o=0,a=0,s=0,A=0;if(e|=0){i=0|G[5833],A=(n=e+-8|0)+(t=-8&(e=0|G[e+-4>>2]))|0;do{if(1&e)a=s=n;else{if(r=0|G[n>>2],!(3&e))return;if(o=r+t|0,(a=n+(0-r)|0)>>>0>>0)return;if((0|G[5834])==(0|a)){if(3==(3&(t=0|G[(e=A+4|0)>>2])|0))return G[5831]=o,G[e>>2]=-2&t,G[a+4>>2]=1|o,void(G[a+o>>2]=o);s=a,t=o;break}if(n=r>>>3,r>>>0<256){if(e=0|G[a+8>>2],(0|(t=0|G[a+12>>2]))==(0|e)){G[5829]=G[5829]&~(1<>2]=t,G[t+8>>2]=e,s=a,t=o;break}i=0|G[a+24>>2],e=0|G[a+12>>2];do{if((0|e)==(0|a)){if(e=0|G[(n=(t=a+16|0)+4|0)>>2])t=n;else if(!(e=0|G[t>>2])){e=0;break}for(;;)if(n=0|G[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|G[(r=e+16|0)>>2]))break;e=n,t=r}G[t>>2]=0}else s=0|G[a+8>>2],G[s+12>>2]=e,G[e+8>>2]=s}while(0);if(i){if(t=0|G[a+28>>2],(0|G[(n=23620+(t<<2)|0)>>2])==(0|a)){if(!(G[n>>2]=e)){G[5830]=G[5830]&~(1<>2])==(0|a)?s:i+20|0)>>2]=e)){s=a,t=o;break}G[e+24>>2]=i,0|(n=0|G[(t=a+16|0)>>2])&&(G[e+16>>2]=n,G[n+24>>2]=e),t=(s=((t=0|G[t+4>>2])&&(G[e+20>>2]=t,G[t+24>>2]=e),a),o)}else s=a,t=o}}while(0);if(!(A>>>0<=a>>>0)&&1&(r=0|G[(e=A+4|0)>>2])){if(2&r)G[e>>2]=-2&r,G[s+4>>2]=1|t,i=G[a+t>>2]=t;else{if((0|G[5835])==(0|A))return A=(0|G[5832])+t|0,G[5832]=A,G[5835]=s,G[s+4>>2]=1|A,(0|s)!=(0|G[5834])?void 0:(G[5834]=0,void(G[5831]=0));if((0|G[5834])==(0|A))return A=(0|G[5831])+t|0,G[5831]=A,G[5834]=a,G[s+4>>2]=1|A,void(G[a+A>>2]=A);i=(-8&r)+t|0,n=r>>>3;do{if(r>>>0<256){if(t=0|G[A+8>>2],(0|(e=0|G[A+12>>2]))==(0|t)){G[5829]=G[5829]&~(1<>2]=e,G[e+8>>2]=t;break}o=0|G[A+24>>2],e=0|G[A+12>>2];do{if((0|e)==(0|A)){if(e=0|G[(n=(t=A+16|0)+4|0)>>2])t=n;else if(!(e=0|G[t>>2])){n=0;break}for(;;)if(n=0|G[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|G[(r=e+16|0)>>2]))break;e=n,t=r}G[t>>2]=0,n=e}else n=0|G[A+8>>2],G[n+12>>2]=e,G[e+8>>2]=n,n=e}while(0);if(0|o){if(e=0|G[A+28>>2],(0|G[(t=23620+(e<<2)|0)>>2])==(0|A)){if(!(G[t>>2]=n)){G[5830]=G[5830]&~(1<>2])==(0|A)?r:o+20|0)>>2]=n))break;G[n+24>>2]=o,0|(t=0|G[(e=A+16|0)>>2])&&(G[n+16>>2]=t,G[t+24>>2]=n),0|(e=0|G[e+4>>2])&&(G[n+20>>2]=e,G[e+24>>2]=n)}}while(0);if(G[s+4>>2]=1|i,G[a+i>>2]=i,(0|s)==(0|G[5834]))return void(G[5831]=i)}if(e=i>>>3,i>>>0<256)return n=23356+(e<<1<<2)|0,(t=0|G[5829])&(e=1<>2]:(G[5829]=t|e,t=(e=n)+8|0),G[t>>2]=s,G[e+12>>2]=s,G[s+8>>2]=e,void(G[s+12>>2]=n);e=23620+((r=(e=i>>>8)?16777215>>0?31:i>>>((r=14-((o=((A=e<<(a=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|a|(r=((A<<=o)+245760|0)>>>16&2))+(A<>>15)|0)+7|0)&1|r<<1:0)<<2)|0,G[s+28>>2]=r,G[s+20>>2]=0,t=(G[s+16>>2]=0)|G[5830],n=1<>2];t:do{if((-8&G[e+4>>2]|0)!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1)|0);;){if(!(t=0|G[(n=e+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[t+4>>2]|0)==(0|i)){e=t;break t}r<<=1,e=t}G[n>>2]=s,G[s+24>>2]=e,G[s+12>>2]=s,G[s+8>>2]=s;break e}}while(0);A=0|G[(a=e+8|0)>>2],G[A+12>>2]=s,G[a>>2]=s,G[s+8>>2]=A,G[s+12>>2]=e,G[s+24>>2]=0}else G[5830]=t|n,G[e>>2]=s,G[s+24>>2]=e,G[s+12>>2]=s,G[s+8>>2]=s}while(0);if(A=(0|G[5837])-1|0,!(0|(G[5837]=A))){for(e=23772;;){if(!(e=0|G[e>>2]))break;e=e+8|0}G[5837]=-1}}}}function Yc(e,t){t|=0;var n=0;return(e|=0)?(n=0|a(t,e),65535<(t|e)>>>0&&(n=((n>>>0)/(e>>>0)|0)==(0|t)?n:-1)):n=0,(e=0|Wc(n))&&3&G[e+-4>>2]&&hd(0|e,0,0|n),0|e}function _c(e,t,n,r){return 0|(y(0|(r=(t|=0)-(r|=0)-((e|=0)>>>0<(n|=0)>>>0|0)>>>0)),e-n>>>0|0)}function $c(e){return 0|((e|=0)?31-(0|ge(e^e-1))|0:32)}function ad(e,t,n,r,i){i|=0;var o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,c=e|=0,a=n|=0,s=u=r|=0;if(!(l=A=t|=0))return o=0!=(0|i),s?(o&&(G[i>>2]=0|e,G[i+4>>2]=0&t),(i=u=0)|(y(0|u),i)):(o&&(G[i>>2]=(c>>>0)%(a>>>0),G[i+4>>2]=0),i=(c>>>(u=0))/(a>>>0)>>>0,0|(y(0|u),i));o=0==(0|s);do{if(a){if(!o){if((o=(0|ge(0|s))-(0|ge(0|l))|0)>>>0<=31){e=c>>>((a=g=o+1|0)>>>0)&(t=o-31>>31)|l<<(s=31-o|0),t&=l>>>(g>>>0),o=0,s=c<>2]=0|e,G[i+4>>2]=A|0&t,(i=u=0)|(y(0|u),i)):(i=u=0)|(y(0|u),i)}if((o=a-1|0)&a|0){e=(g=32-(s=33+(0|ge(0|a))-(0|ge(0|l))|0)|0)-1>>31&l>>>((d=s-32|0)>>>0)|(l<>>((a=s)>>>0))&(t=d>>31),t&=l>>>(s>>>0),o=c<<(h=64-s|0)&(A=g>>31),s=(l<>>(d>>>0))&A|c<>31;break}return 0|i&&(G[i>>2]=o&c,G[i+4>>2]=0),1==(0|a)?(h=0|e,0|(y(0|(d=A|0&t)),h)):(d=l>>>((h=0|$c(0|a))>>>0)|0,h=l<<32-h|c>>>(h>>>0)|0,0|(y(0|d),h))}if(o)return 0|i&&(G[i>>2]=(l>>>0)%(a>>>0),G[i+4>>2]=0),h=(l>>>(d=0))/(a>>>0)>>>0,0|(y(0|d),h);if(!c)return 0|i&&(G[i>>2]=0,G[i+4>>2]=(l>>>0)%(s>>>0)),h=(l>>>(d=0))/(s>>>0)>>>0,0|(y(0|d),h);if(!((o=s-1|0)&s))return 0|i&&(G[i>>2]=0|e,G[i+4>>2]=o&l|0&t),h=l>>>(((d=0)|$c(0|s))>>>0),0|(y(0|d),h);if((o=(0|ge(0|s))-(0|ge(0|l))|0)>>>0<=30){e=l<<(s=31-o|0)|c>>>((a=t=o+1|0)>>>0),t=l>>>(t>>>0),o=0,s=c<>2]=0|e,G[i+4>>2]=A|0&t),(h=d=0)|(y(0|d),h)}while(0);if(a){for(l=0|function Zc(e,t,n,r){return 0|(y((t|=0)+(r|=0)+((n=(e|=0)+(n|=0)>>>0)>>>0>>0|0)>>>0|0),0|n)}(0|(g=0|n),0|(c=u|0&r),-1,-1),n=0|T(),A=s,s=0;A=o>>>31|(r=A)<<1,o=s|o<<1,_c(0|l,0|n,0|(r=e<<1|r>>>31|0),0|(u=e>>>31|t<<1|0)),s=1&(d=(h=0|T())>>31|((0|h)<0?-1:0)<<1),e=0|_c(0|r,0|u,d&g|0,(((0|h)<0?-1:0)>>31|((0|h)<0?-1:0)<<1)&c|0),t=0|T(),0!=(0|(a=a-1|0)););l=A,A=0}else l=s,s=A=0;return(a=0)|i&&(G[i>>2]=e,G[i+4>>2]=t),h=-2&(o<<1|0)|s,0|(y(0|(d=(0|o)>>>31|(l|a)<<1|0&(a<<1|o>>>31)|A)),h)}function bd(e,t,n,r){var i=U;return U=U+16|0,ad(e|=0,t|=0,n|=0,r|=0,e=0|i),U=i,0|(y(0|G[4+e>>2]),0|G[e>>2])}function cd(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(y(t>>>n|0),e>>>n|(t&(1<>>n-32|0)}function dd(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(y(t<>>32-n|0),e<>0]=0|m[t>>0],e=e+1|0,t=t+1|0,n=n-1|0}for(r=(n=-4&i|0)-64|0;(0|e)<=(0|r);)G[e>>2]=G[t>>2],G[e+4>>2]=G[t+4>>2],G[e+8>>2]=G[t+8>>2],G[e+12>>2]=G[t+12>>2],G[e+16>>2]=G[t+16>>2],G[e+20>>2]=G[t+20>>2],G[e+24>>2]=G[t+24>>2],G[e+28>>2]=G[t+28>>2],G[e+32>>2]=G[t+32>>2],G[e+36>>2]=G[t+36>>2],G[e+40>>2]=G[t+40>>2],G[e+44>>2]=G[t+44>>2],G[e+48>>2]=G[t+48>>2],G[e+52>>2]=G[t+52>>2],G[e+56>>2]=G[t+56>>2],G[e+60>>2]=G[t+60>>2],e=e+64|0,t=t+64|0;for(;(0|e)<(0|n);)G[e>>2]=G[t>>2],e=e+4|0,t=t+4|0}else for(n=i-4|0;(0|e)<(0|n);)m[e>>0]=0|m[t>>0],m[e+1>>0]=0|m[t+1>>0],m[e+2>>0]=0|m[t+2>>0],m[e+3>>0]=0|m[t+3>>0],e=e+4|0,t=t+4|0;for(;(0|e)<(0|i);)m[e>>0]=0|m[t>>0],e=e+1|0,t=t+1|0;return 0|o}function hd(e,t,n){var r,i,o,a=(e|=0)+(n|=0)|0;if(t=(t|0)&255,67<=(0|n)){for(;3&e;)m[e>>0]=t,e=e+1|0;for(o=t|t<<8|t<<16|t<<24,i=(r=-4&a|0)-64|0;(0|e)<=(0|i);)G[e>>2]=o,G[e+4>>2]=o,G[e+8>>2]=o,G[e+12>>2]=o,G[e+16>>2]=o,G[e+20>>2]=o,G[e+24>>2]=o,G[e+28>>2]=o,G[e+32>>2]=o,G[e+36>>2]=o,G[e+40>>2]=o,G[e+44>>2]=o,G[e+48>>2]=o,G[e+52>>2]=o,G[e+56>>2]=o,G[e+60>>2]=o,e=e+64|0;for(;(0|e)<(0|r);)G[e>>2]=o,e=e+4|0}for(;(0|e)<(0|a);)m[e>>0]=t,e=e+1|0;return a-n|0}function id(e){return 0<=(e=+e)?+re(e+.5):+le(e-.5)}function jd(e){e|=0;var t,n=0|de();return 0<(0|e)&(0|(e=(t=0|G[ne>>2])+e|0))<(0|t)|(0|e)<0?(fe(0|e),ue(12),-1):(0|n)<(0|e)&&!(0|pe(0|e))?(ue(12),-1):(G[ne>>2]=e,0|t)}r.___uremdi3=n.___uremdi3,r._bitshift64Lshr=n._bitshift64Lshr,r._bitshift64Shl=n._bitshift64Shl,r._calloc=n._calloc,r._cellAreaKm2=n._cellAreaKm2,r._cellAreaM2=n._cellAreaM2,r._cellAreaRads2=n._cellAreaRads2,r._compact=n._compact,r._destroyLinkedPolygon=n._destroyLinkedPolygon,r._edgeLengthKm=n._edgeLengthKm,r._edgeLengthM=n._edgeLengthM;var Ie,Ce,o,me,ye=r._emscripten_replace_memory=n._emscripten_replace_memory,Be=(r._exactEdgeLengthKm=n._exactEdgeLengthKm,r._exactEdgeLengthM=n._exactEdgeLengthM,r._exactEdgeLengthRads=n._exactEdgeLengthRads,r._experimentalH3ToLocalIj=n._experimentalH3ToLocalIj,r._experimentalLocalIjToH3=n._experimentalLocalIjToH3,r._free=n._free,r._geoToH3=n._geoToH3,r._getDestinationH3IndexFromUnidirectionalEdge=n._getDestinationH3IndexFromUnidirectionalEdge,r._getH3IndexesFromUnidirectionalEdge=n._getH3IndexesFromUnidirectionalEdge,r._getH3UnidirectionalEdge=n._getH3UnidirectionalEdge,r._getH3UnidirectionalEdgeBoundary=n._getH3UnidirectionalEdgeBoundary,r._getH3UnidirectionalEdgesFromHexagon=n._getH3UnidirectionalEdgesFromHexagon,r._getOriginH3IndexFromUnidirectionalEdge=n._getOriginH3IndexFromUnidirectionalEdge,r._getPentagonIndexes=n._getPentagonIndexes,r._getRes0Indexes=n._getRes0Indexes,r._h3Distance=n._h3Distance,r._h3GetBaseCell=n._h3GetBaseCell,r._h3GetFaces=n._h3GetFaces,r._h3GetResolution=n._h3GetResolution,r._h3IndexesAreNeighbors=n._h3IndexesAreNeighbors,r._h3IsPentagon=n._h3IsPentagon,r._h3IsResClassIII=n._h3IsResClassIII,r._h3IsValid=n._h3IsValid,r._h3Line=n._h3Line,r._h3LineSize=n._h3LineSize,r._h3SetToLinkedGeo=n._h3SetToLinkedGeo,r._h3ToCenterChild=n._h3ToCenterChild,r._h3ToChildren=n._h3ToChildren,r._h3ToGeo=n._h3ToGeo,r._h3ToGeoBoundary=n._h3ToGeoBoundary,r._h3ToParent=n._h3ToParent,r._h3UnidirectionalEdgeIsValid=n._h3UnidirectionalEdgeIsValid,r._hexAreaKm2=n._hexAreaKm2,r._hexAreaM2=n._hexAreaM2,r._hexRing=n._hexRing,r._i64Subtract=n._i64Subtract,r._kRing=n._kRing,r._kRingDistances=n._kRingDistances,r._llvm_minnum_f64=n._llvm_minnum_f64,r._llvm_round_f64=n._llvm_round_f64,r._malloc=n._malloc,r._maxFaceCount=n._maxFaceCount,r._maxH3ToChildrenSize=n._maxH3ToChildrenSize,r._maxKringSize=n._maxKringSize,r._maxPolyfillSize=n._maxPolyfillSize,r._maxUncompactSize=n._maxUncompactSize,r._memcpy=n._memcpy,r._memset=n._memset,r._numHexagons=n._numHexagons,r._pentagonIndexCount=n._pentagonIndexCount,r._pointDistKm=n._pointDistKm,r._pointDistM=n._pointDistM,r._pointDistRads=n._pointDistRads,r._polyfill=n._polyfill,r._res0IndexCount=n._res0IndexCount,r._round=n._round,r._sbrk=n._sbrk,r._sizeOfCoordIJ=n._sizeOfCoordIJ,r._sizeOfGeoBoundary=n._sizeOfGeoBoundary,r._sizeOfGeoCoord=n._sizeOfGeoCoord,r._sizeOfGeoPolygon=n._sizeOfGeoPolygon,r._sizeOfGeofence=n._sizeOfGeofence,r._sizeOfH3Index=n._sizeOfH3Index,r._sizeOfLinkedGeoPolygon=n._sizeOfLinkedGeoPolygon,r._uncompact=n._uncompact,r.establishStackSpace=n.establishStackSpace,r.stackAlloc=n.stackAlloc),be=r.stackRestore=n.stackRestore,ve=r.stackSave=n.stackSave;function run(e){function doRun(){me||(me=!0,C||(function initRuntime(){callRuntimeCallbacks(F)}(),function preMain(){callRuntimeCallbacks(D)}(),r.onRuntimeInitialized&&r.onRuntimeInitialized(),postRun()))}0>0]=t;break;case"i16":Q[e>>1]=t;break;case"i32":w[e>>2]=t;break;case"i64":q=[t>>>0,1<=+L(q=t)?0>>0:~~+P((q-(~~q>>>0))/4294967296)>>>0:0],w[e>>2]=q[0],w[e+4>>2]=q[1];break;case"float":S[e>>2]=t;break;case"double":x[e>>3]=t;break;default:abort("invalid type for setValue: "+n)}},r.getValue=function getValue(e,t,n){switch(t="*"===(t=t||"i8").charAt(t.length-1)?"i32":t){case"i1":case"i8":return v[e>>0];case"i16":return Q[e>>1];case"i32":case"i64":return w[e>>2];case"float":return S[e>>2];case"double":return x[e>>3];default:abort("invalid type for getValue: "+t)}return null},r.getTempRet0=hUa,i&&(isDataURI(i)||(i=function locateFile(e){return r.locateFile?r.locateFile(e,l):l+e}(i)),function addRunDependency(){z++,r.monitorRunDependencies&&r.monitorRunDependencies(z)}(),Ie=function(e){e.byteLength&&(e=new Uint8Array(e)),E.set(e,8),r.memoryInitializerRequest&&delete r.memoryInitializerRequest.response,function removeRunDependency(){var e;z--,r.monitorRunDependencies&&r.monitorRunDependencies(z),0==z&&(null!==J&&(clearInterval(J),J=null),K&&(e=K,K=null,e()))}()},Ce=function(){h(i,Ie,function(){throw"could not load memory initializer "+i})},(t=tryParseAsDataURI(i))?Ie(t.buffer):r.memoryInitializerRequest?(o=function(){var e=r.memoryInitializerRequest,t=e.response;if(200!==e.status&&0!==e.status){var n=tryParseAsDataURI(r.memoryInitializerRequestURL);if(!n)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+e.status+", retrying "+i),void Ce();t=n.buffer}Ie(t)},r.memoryInitializerRequest.response?setTimeout(o,0):r.memoryInitializerRequest.addEventListener("load",o)):Ce()),K=function runCaller(){me||run(),me||(K=runCaller)},r.run=run,r.abort=abort,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;var n="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyStatethis.initialize(t)),this;var{pixels:r=null,format:i=6408,border:o=0,recreate:a=!1,parameters:s={},pixelStore:A={},textureUnit:l=void 0}=t;e=e||r;let{width:c,height:g,dataFormat:u,type:d,compressed:h=!1,mipmaps:p=!0}=t;var{depth:r=0}=t;return{width:c,height:g,compressed:h,dataFormat:u,type:d}=this._deduceParameters({format:i,type:d,dataFormat:u,compressed:h,data:e,width:c,height:g}),this.width=c,this.height=g,this.depth=r,this.format=i,this.type=d,this.dataFormat=u,this.border=o,this.textureUnit=l,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),p&&this._isNPOT()&&(C.k.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),p=!1,this._updateForNPOT(s)),this.mipmaps=p,this.setImageData({data:e,width:c,height:g,depth:r,format:i,type:d,dataFormat:u,border:o,mipmaps:p,parameters:A,compressed:h}),p&&this.generateMipmap(),this.setParameters(s),a&&(this.data=e),n&&(this._video={video:e,parameters:s,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){var e,t,n;this._video&&({video:e,parameters:t,lastTime:n}=this._video,n===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null)),this}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:n=this.target,pixels:t=null,level:r=0,format:i=this.format,border:o=this.border,offset:a=0,parameters:s={}}=e;let{data:A=null,type:l=this.type,width:c=this.width,height:g=this.height,dataFormat:u=this.dataFormat,compressed:d=!1}=e;A=A||t,{type:l,dataFormat:u,compressed:d,width:c,height:g}=this._deduceParameters({format:i,type:l,dataFormat:u,compressed:d,data:A,width:c,height:g});const h=this["gl"];h.bindTexture(this.target,this.handle);let p=null;({data:A,dataType:p}=this._getDataType({data:A,compressed:d}));let f;var I;return Object(C.o)(this.gl,s,()=>{switch(p){case"null":h.texImage2D(n,r,i,c,g,o,u,l,A);break;case"typed-array":h.texImage2D(n,r,i,c,g,o,u,l,A,a);break;case"buffer":(f=Object(C.a)(h)).bindBuffer(35052,A.handle||A),f.texImage2D(n,r,i,c,g,o,u,l,a),f.bindBuffer(35052,null);break;case"browser-object":Object(C.j)(h)?h.texImage2D(n,r,i,c,g,o,u,l,A):h.texImage2D(n,r,i,u,l,A);break;case"compressed":for(var[e,t]of A.entries())h.compressedTexImage2D(n,e,t.format,t.width,t.height,o,t.data);break;default:Object(y.a)(!1,"Unknown image data type")}}),A&&A.byteLength?this._trackAllocatedMemory(A.byteLength,"Texture"):(e=m.a[this.dataFormat]||4,I=m.c[this.type]||1,this._trackAllocatedMemory(this.width*this.height*e*I,"Texture")),this.loaded=!0,this}setSubImageData({target:n=this.target,pixels:e=null,data:r=null,x:i=0,y:o=0,width:a=this.width,height:s=this.height,level:A=0,format:l=this.format,type:c=this.type,dataFormat:g=this.dataFormat,compressed:u=!1,offset:d=0,border:t=this.border,parameters:h={}}){({type:c,dataFormat:g,compressed:u,width:a,height:s}=this._deduceParameters({format:l,type:c,dataFormat:g,compressed:u,data:r,width:a,height:s})),Object(y.a)(0===this.depth,"texSubImage not supported for 3D textures"),(r=r||e)&&r.data&&(r=(e=r).data,a=e.shape[0],s=e.shape[1]),r instanceof p.a&&(r=r.handle),this.gl.bindTexture(this.target,this.handle),Object(C.o)(this.gl,h,()=>{if(u)this.gl.compressedTexSubImage2D(n,A,i,o,a,s,l,r);else if(null===r)this.gl.texSubImage2D(n,A,i,o,a,s,g,c,null);else if(ArrayBuffer.isView(r))this.gl.texSubImage2D(n,A,i,o,a,s,g,c,r,d);else if(r instanceof f){const e=Object(C.a)(this.gl);e.bindBuffer(35052,r),e.texSubImage2D(n,A,i,o,a,s,g,c,d),e.bindBuffer(35052,null)}else if(Object(C.j)(this.gl)){const t=Object(C.a)(this.gl);t.texSubImage2D(n,A,i,o,a,s,g,c,r)}else this.gl.texSubImage2D(n,A,i,o,g,c,r)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e=0){return C.k.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const t=this["gl"];return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const t=this["gl"];return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof p.a?{data:e.handle,dataType:"buffer"}:e instanceof f?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){var{format:t,data:n}=e,{width:e,height:r,dataFormat:i,type:o,compressed:a}=e,s=m.b[t],i=i||s&&s.dataFormat,o=o||s&&s.types[0],a=a||s&&s.compressed;return{width:e,height:r}=this._deduceImageSize(n,e,r),{dataFormat:i,type:o,compressed:a,width:e,height:r,format:t,data:n}}_deduceImageSize(e,t,n){let r;return r="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||"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:0<=t?t:1,height:0<=n?n:1},Object(y.a)(r,"Could not deduced texture size"),Object(y.a)(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),Object(y.a)(void 0===n||r.height===n,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(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}}_setParameter(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(y.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!Object(C.j)(this.gl)&&(!(!this.width||!this.height)&&(!Object(i.b)(this.width)||!Object(i.b)(this.height)))}_updateForNPOT(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)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===o.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}},function(e,t,n){var d=n(143),h=n(693),p=n(391),f=Math.max,I=Math.min;e.exports=function debounce(r,n,e){var i,o,a,s,A,l,c=0,g=!1,u=!1,t=!0;if("function"!=typeof r)throw new TypeError("Expected a function");function invokeFunc(e){var t=i,n=o;return i=o=void 0,c=e,s=r.apply(n,t)}function shouldInvoke(e){var t=e-l;return void 0===l||n<=t||t<0||u&&a<=e-c}function timerExpired(){var e=h();if(shouldInvoke(e))return trailingEdge(e);A=setTimeout(timerExpired,function remainingWait(e){var t=n-(e-l);return u?I(t,a-(e-c)):t}(e))}function trailingEdge(e){return A=void 0,t&&i?invokeFunc(e):(i=o=void 0,s)}function debounced(){var e=h(),t=shouldInvoke(e);if(i=arguments,o=this,l=e,t){if(void 0===A)return function leadingEdge(e){return c=e,A=setTimeout(timerExpired,n),g?invokeFunc(e):s}(l);if(u)return clearTimeout(A),A=setTimeout(timerExpired,n),invokeFunc(l)}return void 0===A&&(A=setTimeout(timerExpired,n)),s}return n=p(n)||0,d(e)&&(g=!!e.leading,u="maxWait"in e,a=u?f(p(e.maxWait)||0,n):a,t="trailing"in e?!!e.trailing:t),debounced.cancel=function cancel(){void 0!==A&&clearTimeout(A),i=l=o=A=void(c=0)},debounced.flush=function flush(){return void 0===A?s:trailingEdge(h())},debounced}},function(e,t,n){"use strict";function vec2_transformMat4AsVector(e,t,n){var r=t[0],t=t[1],i=n[3]*r+n[7]*t||1;return e[0]=(n[0]*r+n[4]*t)/i,e[1]=(n[1]*r+n[5]*t)/i,e}function vec3_transformMat4AsVector(e,t,n){var r=t[0],i=t[1],t=t[2],o=n[3]*r+n[7]*i+n[11]*t||1;return e[0]=(n[0]*r+n[4]*i+n[8]*t)/o,e[1]=(n[1]*r+n[5]*i+n[9]*t)/o,e[2]=(n[2]*r+n[6]*i+n[10]*t)/o,e}function vec3_transformMat2(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e[2]=t[2],e}function vec4_transformMat2(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e[2]=t[2],e[3]=t[3],e}function vec4_transformMat3(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=n[0]*r+n[3]*i+n[6]*o,e[1]=n[1]*r+n[4]*i+n[7]*o,e[2]=n[2]*r+n[5]*i+n[8]*o,e[3]=t[3],e}n.d(t,"a",function(){return vec2_transformMat4AsVector}),n.d(t,"c",function(){return vec3_transformMat4AsVector}),n.d(t,"b",function(){return vec3_transformMat2}),n.d(t,"d",function(){return vec4_transformMat2}),n.d(t,"e",function(){return vec4_transformMat3})},function(e,t,n){"use strict";n.d(t,"a",function(){return create}),n.d(t,"i",function(){return transpose}),n.d(t,"d",function(){return invert}),n.d(t,"b",function(){return determinant}),n.d(t,"e",function(){return multiply}),n.d(t,"h",function(){return translate}),n.d(t,"f",function(){return rotate}),n.d(t,"g",function(){return scale}),n.d(t,"c",function(){return fromQuat});var r=n(17);function create(){var e=new r.a(9);return r.a!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function transpose(e,t){var n,r,i;return e===t?(n=t[1],r=t[2],i=t[5],e[1]=t[3],e[2]=t[6],e[3]=n,e[5]=t[7],e[6]=r,e[7]=i):(e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8]),e}function invert(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],A=t[6],l=t[7],t=t[8],c=t*a-s*l,g=-t*o+s*A,u=l*o-a*A,d=n*c+r*g+i*u;return d?(e[0]=c*(d=1/d),e[1]=(-t*r+i*l)*d,e[2]=(s*r-i*a)*d,e[3]=g*d,e[4]=(t*n-i*A)*d,e[5]=(-s*n+i*o)*d,e[6]=u*d,e[7]=(-l*n+r*A)*d,e[8]=(a*n-r*o)*d,e):null}function determinant(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],A=e[7],e=e[8];return t*(e*o-a*A)+n*(-e*i+a*s)+r*(A*i-o*s)}function multiply(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],A=t[5],l=t[6],c=t[7],t=t[8],g=n[0],u=n[1],d=n[2],h=n[3],p=n[4],f=n[5],I=n[6],C=n[7],n=n[8];return e[0]=g*r+u*a+d*l,e[1]=g*i+u*s+d*c,e[2]=g*o+u*A+d*t,e[3]=h*r+p*a+f*l,e[4]=h*i+p*s+f*c,e[5]=h*o+p*A+f*t,e[6]=I*r+C*a+n*l,e[7]=I*i+C*s+n*c,e[8]=I*o+C*A+n*t,e}function translate(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],A=t[5],l=t[6],c=t[7],t=t[8],g=n[0],n=n[1];return e[0]=r,e[1]=i,e[2]=o,e[3]=a,e[4]=s,e[5]=A,e[6]=g*r+n*a+l,e[7]=g*i+n*s+c,e[8]=g*o+n*A+t,e}function rotate(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],A=t[5],l=t[6],c=t[7],t=t[8],g=Math.sin(n),n=Math.cos(n);return e[0]=n*r+g*a,e[1]=n*i+g*s,e[2]=n*o+g*A,e[3]=n*a-g*r,e[4]=n*s-g*i,e[5]=n*A-g*o,e[6]=l,e[7]=c,e[8]=t,e}function scale(e,t,n){var r=n[0],n=n[1];return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=n*t[3],e[4]=n*t[4],e[5]=n*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function fromQuat(e,t){var n=t[0],r=t[1],i=t[2],t=t[3],o=n+n,a=r+r,s=i+i,n=n*o,A=r*o,r=r*a,l=i*o,c=i*a,i=i*s,o=t*o,a=t*a,t=t*s;return e[0]=1-r-i,e[3]=A-t,e[6]=l+a,e[1]=A+t,e[4]=1-n-i,e[7]=c-o,e[2]=l-a,e[5]=c+o,e[8]=1-n-r,e}},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"c",function(){return s});var r=n(44),i=n(24);function weekday(t){return Object(r.a)(function(e){e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+7*t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.c)/i.f})}var o=weekday(0),a=weekday(1),t=weekday(2),n=weekday(3),s=weekday(4),A=weekday(5),l=weekday(6);o.range,a.range,t.range,n.range,s.range,A.range,l.range},function(e,t,n){"use strict";n.d(t,"b",function(){return o}),n.d(t,"a",function(){return a}),n.d(t,"c",function(){return s});var r=n(44),i=n(24);function utcWeekday(t){return Object(r.a)(function(e){e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+7*t)},function(e,t){return(t-e)/i.f})}var o=utcWeekday(0),a=utcWeekday(1),t=utcWeekday(2),n=utcWeekday(3),s=utcWeekday(4),A=utcWeekday(5),l=utcWeekday(6);o.range,a.range,t.range,n.range,s.range,A.range,l.range},function(e,t,n){var a=n(220);function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}e.exports=function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!==a(e)&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var n,r,i={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&((r=o?Object.getOwnPropertyDescriptor(e,n):null)&&(r.get||r.set)?Object.defineProperty(i,n,r):i[n]=e[n]);return i.default=e,t&&t.set(e,i),i}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function get(){return r.createSvgIcon}});var r=n(608)},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,n){"use strict";n.d(t,"a",function(){return defaultLocale}),n.d(t,"b",function(){return locale}),n.d(t,"c",function(){return numberFormatDefaultLocale}),n.d(t,"d",function(){return resetDefaultLocale}),n.d(t,"e",function(){return timeFormatDefaultLocale});var l=n(476),c=n(290),g=n(1075),u=n(1076),d=n(1077),r=n(661),i=n(472),y=n(33),B=n(1),o=n(383),a=n(468);function memoize(t){const n={};return e=>n[e]||(n[e]=t(e))}function trimZeroes(i,o){return e=>{const t=i(e),n=t.indexOf(o);if(n<0)return t;let r=function rightmostDigit(e,t){let n=e.lastIndexOf("e"),r;if(0t;)if(48<=(r=e.charCodeAt(n))&&r<=57)return n+1}(t,n);for(e=rn;)if("0"!==t[r]){++r;break}return t.slice(0,r)+e}}function numberLocale(e){const s=memoize(e.format),A=e.formatPrefix;return{format:s,formatPrefix:A,formatFloat(e){const t=Object(c.a)(e||",");if(null!=t.precision)return s(t);switch(t.precision=12,t.type){case"%":t.precision-=2;break;case"e":--t.precision}return trimZeroes(s(t),s(".1f")(1)[1])},formatSpan(e,t,n,r){r=Object(c.a)(null==r?",f":r);var i=Object(l.c)(e,t,n),o=Math.max(Math.abs(e),Math.abs(t));let a;if(null==r.precision)switch(r.type){case"s":return isNaN(a=Object(g.a)(i,o))||(r.precision=a),A(r,o);case"":case"e":case"g":case"p":case"r":isNaN(a=Object(u.a)(i,o))||(r.precision=a-("e"===r.type));break;case"f":case"%":isNaN(a=Object(d.a)(i))||(r.precision=a-2*("%"===r.type))}return s(r)}}}let s;function resetNumberFormatDefaultLocale(){s=numberLocale({format:r.a,formatPrefix:r.b})}function numberFormatLocale(e){return numberLocale(Object(i.a)(e))}function numberFormatDefaultLocale(e){return arguments.length?s=numberFormatLocale(e):s}function timeMultiFormat(e,t,n){n=n||{},Object(B.H)(n)||Object(B.o)("Invalid time multi-format specifier: ".concat(n));const r=t(y.i),i=t(y.f),o=t(y.d),a=t(y.a),s=t(y.k),A=t(y.g),l=t(y.h),c=t(y.l),g=e(n[y.e]||".%L"),u=e(n[y.i]||":%S"),d=e(n[y.f]||"%I:%M"),h=e(n[y.d]||"%I %p"),p=e(n[y.a]||n[y.b]||"%a %d"),f=e(n[y.k]||"%b %d"),I=e(n[y.g]||"%B"),C=e(n[y.h]||"%B"),m=e(n[y.l]||"%Y");return e=>(r(e)Object(B.J)(e)?t(e):timeMultiFormat(t,y.p,e),utcFormat:e=>Object(B.J)(e)?n(e):timeMultiFormat(n,y.v,e),timeParse:memoize(e.parse),utcParse:memoize(e.utcParse)}}resetNumberFormatDefaultLocale();let A;function resetTimeFormatDefaultLocale(){A=timeLocale({format:o.a,parse:o.b,utcFormat:o.c,utcParse:o.d})}function timeFormatLocale(e){return timeLocale(Object(a.a)(e))}function timeFormatDefaultLocale(e){return arguments.length?A=timeFormatLocale(e):A}resetTimeFormatDefaultLocale();const h=(e,t)=>Object(B.p)({},e,t);function locale(e,t){e=e?numberFormatLocale(e):numberFormatDefaultLocale(),t=t?timeFormatLocale(t):timeFormatDefaultLocale();return h(e,t)}function defaultLocale(e,t){var n=arguments.length;return n&&2!==n&&Object(B.o)("defaultLocale expects either zero or two arguments."),n?h(numberFormatDefaultLocale(e),timeFormatDefaultLocale(t)):h(numberFormatDefaultLocale(),timeFormatDefaultLocale())}function resetDefaultLocale(){return resetNumberFormatDefaultLocale(),resetTimeFormatDefaultLocale(),defaultLocale()}},function(e,i,o){"use strict";!function(e,t){o.d(i,"b",function(){return n}),o.d(i,"a",function(){return r});e={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"==typeof t&&t};const n=e.window||e.self||e.global;const r=e.process||{};console}.call(this,o(59),o(97))},function(e,t,n){"use strict";n.d(t,"a",function(){return Controller});var r=n(272),i=n(273);const o={transitionDuration:0},a={transitionDuration:300,transitionEasing:e=>e,transitionInterruption:r.a.BREAK},s=e=>1-(1-e)*(1-e),l={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],TRIPLE_PAN:["tripanstart","tripanmove","tripanend"],DOUBLE_TAP:["doubletap"],KEYBOARD:["keydown"]};class Controller{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new r.b(e,{...t,onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)});e=this.linearTransitionProps;this._transition=e&&{...a,transitionInterpolator:new i.a({transitionProps:e})},this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const t=this["ControllerState"];this.controllerState=new t({makeViewport:this.makeViewport,...this.controllerStateProps,...this._state});var n=this._eventStartBlocked;switch(e.type){case"panstart":return!n&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!n&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!n&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){var{x:t,y:n}=this.controllerStateProps,e=e["offsetCenter"];return[e.x-t,e.y-n]}isPointInBounds(e,t){var{width:n,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;n=0<=e[0]&&e[0]<=n&&0<=e[1]&&e[1]<=r;return n&&t&&t.stopPropagation(),n}isFunctionKeyPressed(e){e=e.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),"eventManager"in(this.controllerStateProps=e)&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let t=e["inertia"];!0===t&&(t=300),this.inertia=t;var{scrollZoom:e=!0,dragPan:n=!0,dragRotate:r=!0,doubleClickZoom:i=!0,touchZoom:o=!0,touchRotate:a=!1,keyboard:s=!0}=e,A=Boolean(this.onViewStateChange);this.toggleEvents(l.WHEEL,A&&e),this.toggleEvents(l.PAN,A&&(n||r)),this.toggleEvents(l.PINCH,A&&(o||a)),this.toggleEvents(l.TRIPLE_PAN,A&&a),this.toggleEvents(l.DOUBLE_TAP,A&&i),this.toggleEvents(l.KEYBOARD,A&&s),this.scrollZoom=e,this.dragPan=n,this.dragRotate=r,this.doubleClickZoom=i,this.touchZoom=o,this.touchRotate=a,this.keyboard=s}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(e=>{this._events[e]!==t&&((this._events[e]=t)?this.eventManager.on(e,this.handleEvent):this.eventManager.off(e,this.handleEvent))})}updateViewport(e,t={},n={}){var t={...e.getViewportProps(),...t},r=this.controllerState!==e;this._state=e.getState(),this._setInteractionState(n),r&&(e=this.controllerState?this.controllerState.getViewportProps():null,this.onViewStateChange&&this.onViewStateChange({viewState:t,interactionState:this._interactionState,oldViewState:e}))}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let n=this.isFunctionKeyPressed(e)||e.rightButton;!this.invertPan&&"pan"!==this.dragMode||(n=!n);e=this.controllerState[n?"panStart":"rotateStart"]({pos:t});return this._panMove=n,this.updateViewport(e,o,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;e=this.getCenter(e),e=this.controllerState.pan({pos:e});return this.updateViewport(e,o,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){var t,n=this["inertia"];return this.dragPan&&n&&e.velocity?(t=[(t=this.getCenter(e))[0]+e.velocityX*n/2,t[1]+e.velocityY*n/2],e=this.controllerState.pan({pos:t}).panEnd(),this.updateViewport(e,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:s},{isDragging:!1,isPanning:!0})):(t=this.controllerState.panEnd(),this.updateViewport(t,null,{isDragging:!1,isPanning:!1})),!0}_onPanRotate(e){if(!this.dragRotate)return!1;e=this.getCenter(e),e=this.controllerState.rotate({pos:e});return this.updateViewport(e,o,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){var t,n=this["inertia"];return this.dragRotate&&n&&e.velocity?(t=[(t=this.getCenter(e))[0]+e.velocityX*n/2,t[1]+e.velocityY*n/2],e=this.controllerState.rotate({pos:t}).rotateEnd(),this.updateViewport(e,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:s},{isDragging:!1,isRotating:!0})):(t=this.controllerState.rotateEnd(),this.updateViewport(t,null,{isDragging:!1,isRotating:!1})),!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var{speed:n=.01,smooth:r=!1}=this.scrollZoom,e=e["delta"];let i=2/(1+Math.exp(-Math.abs(e*n)));e<0&&0!==i&&(i=1/i);n=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(n,{...this._getTransitionProps({around:t}),transitionDuration:r?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;e=this.controllerState.rotateStart({pos:t});return this.updateViewport(e,o,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;e=this.controllerState.rotate({pos:t});return this.updateViewport(e,o,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;var t=this["inertia"];if(this.touchRotate&&t&&e.velocityY){const n=this.getCenter(e);e=[n[0],n[1]+=e.velocityY*t/2],e=this.controllerState.rotate({pos:e});this.updateViewport(e,{...this._getTransitionProps(),transitionDuration:t,transitionEasing:s},{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{e=this.controllerState.rotateEnd();this.updateViewport(e,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;t=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(t,o,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let t=this.controllerState;var n,r;return this.touchZoom&&(n=e["scale"],r=this.getCenter(e),t=t.zoom({pos:r,scale:n})),this.touchRotate&&(r=e["rotation"],t=t.rotate({deltaAngleX:this._startPinchRotation-r})),this.updateViewport(t,o,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(t){if(!this.isDragging())return!1;var{inertia:n,_lastPinchEvent:r}=this;if(this.touchZoom&&n&&r&&t.scale!==r.scale){var i=this.getCenter(t);let e=this.controllerState.rotateEnd();var o=Math.log2(t.scale),t=(o-Math.log2(r.scale))/(t.deltaTime-r.deltaTime),r=Math.pow(2,o+t*n/2);e=e.zoom({pos:i,scale:r}).zoomEnd(),this.updateViewport(e,{...this._getTransitionProps({around:i}),transitionDuration:n,transitionEasing:s},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(n)}else{o=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(o,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,!(this._lastPinchEvent=null)}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;e=this.isFunctionKeyPressed(e),e=this.controllerState.zoom({pos:t,scale:e?.5:2});return this.updateViewport(e,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;var t=this.isFunctionKeyPressed(e),{zoomSpeed:n,moveSpeed:r,rotateSpeedX:i,rotateSpeedY:o}=this.keyboard;const a=this["controllerState"];let s;const A={};switch(e.srcEvent.code){case"Minus":s=(t?a.zoomOut(n):a).zoomOut(n),A.isZooming=!0;break;case"Equal":s=(t?a.zoomIn(n):a).zoomIn(n),A.isZooming=!0;break;case"ArrowLeft":t?(s=a.rotateLeft(i),A.isRotating=!0):(s=a.moveLeft(r),A.isPanning=!0);break;case"ArrowRight":t?(s=a.rotateRight(i),A.isRotating=!0):(s=a.moveRight(r),A.isPanning=!0);break;case"ArrowUp":t?(s=a.rotateUp(o),A.isRotating=!0):(s=a.moveUp(r),A.isPanning=!0);break;case"ArrowDown":t?(s=a.rotateDown(o),A.isRotating=!0):(s=a.moveDown(r),A.isPanning=!0);break;default:return!1}return this.updateViewport(s,this._getTransitionProps(),A),!0}_getTransitionProps(e){var t=this["_transition"];return t?e?{...t,transitionInterpolator:new i.a({...e,transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport})}:t:o}}},function(e,t,n){"use strict";n.d(t,"a",function(){return view_View});var d=n(76);const r=/([0-9]+\.?[0-9]*)(%|px)/;function parsePosition(e){switch(typeof e){case"number":return{position:e,relative:!1};case"string":var t,n=e.match(r);if(n&&3<=n.length)return t="%"===n[2],n=parseFloat(n[1]),{position:t?n/100:n,relative:t};default:throw new Error("Could not parse position string ".concat(e))}}function getPosition(e,t){return e.relative?Math.round(e.position*t):e.position}var i=n(136),h=n(68);class view_View{constructor(e={}){var{id:t=null,x:n=0,y:r=0,width:i="100%",height:o="100%",projectionMatrix:a=null,fovy:s=50,near:A=.1,far:l=1e3,modelMatrix:c=null,viewportInstance:g=null,type:u=d.a}=e;Object(h.a)(!g||g instanceof d.a),this.viewportInstance=g,this.id=t||this.constructor.displayName||"view",this.type=u,this.props={...e,id:this.id,projectionMatrix:a,fovy:s,near:A,far:l,modelMatrix:c},this._parseDimensions({x:n,y:r,width:i,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(i.a)(this.props,e.props))}makeViewport({width:e,height:t,viewState:n}){if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);e=this.getDimensions({width:e,height:t});return this._getViewport(n,e)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t={...e};for(const n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}getDimensions({width:e,height:t}){return{x:getPosition(this._x,e),y:getPosition(this._y,t),width:getPosition(this._width,e),height:getPosition(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),{...e,...t}):null}_getViewport(e,t){const n=this["type"];return new n({...e,...this.props,...t})}_parseDimensions({x:e,y:t,width:n,height:r}){this._x=parsePosition(e),this._y=parsePosition(t),this._width=parsePosition(n),this._height=parsePosition(r)}}},function(e,t,n){"use strict";function setRef(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,"a",function(){return setRef})},function(e,t,n){"use strict";n.d(t,"a",function(){return Geometry});var o=n(85),s=n(14);const a={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class Geometry{static get DRAW_MODE(){return a}constructor(e={}){var{id:e=Object(o.c)("geometry"),drawMode:t=a.TRIANGLES,attributes:n={},indices:r=null,vertexCount:i=null}=e;this.id=e,this.drawMode=0|t,this.attributes={},this.userData={},this._setAttributes(n,r),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute `+e}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const n in t){let e=t[n];e=ArrayBuffer.isView(e)?{value:e}:e,Object(s.a)(ArrayBuffer.isView(e.value),this._print(n)+": must be typed array or object with value as typed array"),"POSITION"!==n&&"positions"!==n||e.size||(e.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=e):this.attributes[n]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let n=1/0;for(const a in e){var{value:r,size:i,constant:o}=e[a];!o&&r&&1<=i&&(n=Math.min(n,r.length/i))}return Object(s.a)(Number.isFinite(n)),n}}},function(e,t,n){"use strict";n.d(t,"a",function(){return _toConsumableArray});var r=n(276);var i=n(347),o=n(242);function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function _assertThisInitialized(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 _assertThisInitialized})},function(e,t,n){"use strict";n.d(t,"a",function(){return Accessor});var r=n(93),i=n(14),o=n(278);const a={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},s={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class Accessor{static getBytesPerElement(e){return Object(r.c)(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return Object(i.a)(e.size),Object(r.c)(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new Accessor(a,...e)}constructor(...e){e.forEach(e=>this._assign(e)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Accessor.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Accessor.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=Object(o.a)("Accessor",e,s)).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 e.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}}},function(e,t,n){var n=n(490),r="object"==typeof self&&self&&self.Object===Object&&self,n=n||r||Function("return this")();e.exports=n},function(e,t,n){"use strict";function flatten(e,t=()=>!0){return Array.isArray(e)?function flattenArray(e,t,n){let r=-1;for(;++rr&&(i=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*i;t=o.findIndex(e=>e.byteLength>=a);if(0<=t){const s=new e(o.splice(t,1)[0],0,i);return n&&s.fill(0),s}return new e(i)}_release(e){if(ArrayBuffer.isView(e)){const n=this._pool;e=e["buffer"];const r=e["byteLength"];var t=n.findIndex(e=>e.byteLength>=r);t<0?n.push(e):(0this.props.poolSize&&n.shift()}}}},function(e,t,n){var a=n(712),s=n(713);e.exports=function v4(e,t,n){var r=t&&n||0,i=("string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),(e=e||{}).random||(e.rng||a)());if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||s(i)}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return s}),n.d(t,"b",function(){return A}),n.d(t,"d",function(){return l});var r=n(54);const i={[3042]:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0};var t=(e,t,n)=>t?e.enable(n):e.disable(n),n=(e,t,n)=>e.hint(n,t),o=(e,t,n)=>e.pixelStorei(n,t);function isArray(e){return Array.isArray(e)||ArrayBuffer.isView(e)}const a={[3042]:t,32773:(e,t)=>e.blendColor(...t),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(e,t)=>e.clearColor(...t),3107:(e,t)=>e.colorMask(...t),2884:t,2885:(e,t)=>e.cullFace(t),2929:t,2931:(e,t)=>e.clearDepth(t),2932:(e,t)=>e.depthFunc(t),2928:(e,t)=>e.depthRange(...t),2930:(e,t)=>e.depthMask(t),3024:t,35723:n,36006:(e,t)=>{var n=Object(r.e)(e)?36009:36160;return e.bindFramebuffer(n,t)},2886:(e,t)=>e.frontFace(t),33170:n,2849:(e,t)=>e.lineWidth(t),32823:t,32824:"polygonOffset",10752:"polygonOffset",35977:t,32938:"sampleCoverage",32939:"sampleCoverage",3089:t,3088:(e,t)=>e.scissor(...t),2960:t,2961:(e,t)=>e.clearStencil(t),2968:(e,t)=>e.stencilMaskSeparate(1028,t),36005:(e,t)=>e.stencilMaskSeparate(1029,t),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(e,t)=>e.viewport(...t),3333:o,3317:o,37440:o,37441:o,37443:o,3330:o,3332:o,3331:o,36010:(e,t)=>e.bindFramebuffer(36008,t),3314:o,32878:o,3316:o,3315:o,32877:o,framebuffer:(e,t)=>{t=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,t)},blend:(e,t)=>t?e.enable(3042):e.disable(3042),blendColor:(e,t)=>e.blendColor(...t),blendEquation:(e,t)=>{t=isArray(t)?t:[t,t],e.blendEquationSeparate(...t)},blendFunc:(e,t)=>{t=isArray(t)&&2===t.length?[...t,...t]:t,e.blendFuncSeparate(...t)},clearColor:(e,t)=>e.clearColor(...t),clearDepth:(e,t)=>e.clearDepth(t),clearStencil:(e,t)=>e.clearStencil(t),colorMask:(e,t)=>e.colorMask(...t),cull:(e,t)=>t?e.enable(2884):e.disable(2884),cullFace:(e,t)=>e.cullFace(t),depthTest:(e,t)=>t?e.enable(2929):e.disable(2929),depthFunc:(e,t)=>e.depthFunc(t),depthMask:(e,t)=>e.depthMask(t),depthRange:(e,t)=>e.depthRange(...t),dither:(e,t)=>t?e.enable(3024):e.disable(3024),derivativeHint:(e,t)=>{e.hint(35723,t)},frontFace:(e,t)=>e.frontFace(t),mipmapHint:(e,t)=>e.hint(33170,t),lineWidth:(e,t)=>e.lineWidth(t),polygonOffsetFill:(e,t)=>t?e.enable(32823):e.disable(32823),polygonOffset:(e,t)=>e.polygonOffset(...t),sampleCoverage:(e,t)=>e.sampleCoverage(...t),scissorTest:(e,t)=>t?e.enable(3089):e.disable(3089),scissor:(e,t)=>e.scissor(...t),stencilTest:(e,t)=>t?e.enable(2960):e.disable(2960),stencilMask:(e,t)=>{var[t,n]=t=isArray(t)?t:[t,t];e.stencilMaskSeparate(1028,t),e.stencilMaskSeparate(1029,n)},stencilFunc:(e,t)=>{var[t,n,r,i,o,a]=t=isArray(t)&&3===t.length?[...t,...t]:t;e.stencilFuncSeparate(1028,t,n,r),e.stencilFuncSeparate(1029,i,o,a)},stencilOp:(e,t)=>{var[t,n,r,i,o,a]=t=isArray(t)&&3===t.length?[...t,...t]:t;e.stencilOpSeparate(1028,t,n,r),e.stencilOpSeparate(1029,i,o,a)},viewport:(e,t)=>e.viewport(...t)};function getValue(e,t,n){return(void 0!==t[e]?t:n)[e]}const s={blendEquation:(e,t,n)=>e.blendEquationSeparate(getValue(32777,t,n),getValue(34877,t,n)),blendFunc:(e,t,n)=>e.blendFuncSeparate(getValue(32969,t,n),getValue(32968,t,n),getValue(32971,t,n),getValue(32970,t,n)),polygonOffset:(e,t,n)=>e.polygonOffset(getValue(32824,t,n),getValue(10752,t,n)),sampleCoverage:(e,t,n)=>e.sampleCoverage(getValue(32938,t,n),getValue(32939,t,n)),stencilFuncFront:(e,t,n)=>e.stencilFuncSeparate(1028,getValue(2962,t,n),getValue(2967,t,n),getValue(2963,t,n)),stencilFuncBack:(e,t,n)=>e.stencilFuncSeparate(1029,getValue(34816,t,n),getValue(36003,t,n),getValue(36004,t,n)),stencilOpFront:(e,t,n)=>e.stencilOpSeparate(1028,getValue(2964,t,n),getValue(2965,t,n),getValue(2966,t,n)),stencilOpBack:(e,t,n)=>e.stencilOpSeparate(1029,getValue(34817,t,n),getValue(34818,t,n),getValue(34819,t,n))},A={enable:(e,t)=>e({[t]:!0}),disable:(e,t)=>e({[t]:!1}),pixelStorei:(e,t,n)=>e({[t]:n}),hint:(e,t,n)=>e({[t]:n}),bindFramebuffer:(e,t,n)=>{switch(t){case 36160:return e({[36006]:n,36010:n});case 36009:return e({[36006]:n});case 36008:return e({[36010]:n});default:return null}},blendColor:(e,t,n,r,i)=>e({[32773]:new Float32Array([t,n,r,i])}),blendEquation:(e,t)=>e({[32777]:t,34877:t}),blendEquationSeparate:(e,t,n)=>e({[32777]:t,34877:n}),blendFunc:(e,t,n)=>e({[32969]:t,32968:n,32971:t,32970:n}),blendFuncSeparate:(e,t,n,r,i)=>e({[32969]:t,32968:n,32971:r,32970:i}),clearColor:(e,t,n,r,i)=>e({[3106]:new Float32Array([t,n,r,i])}),clearDepth:(e,t)=>e({[2931]:t}),clearStencil:(e,t)=>e({[2961]:t}),colorMask:(e,t,n,r,i)=>e({[3107]:[t,n,r,i]}),cullFace:(e,t)=>e({[2885]:t}),depthFunc:(e,t)=>e({[2932]:t}),depthRange:(e,t,n)=>e({[2928]:new Float32Array([t,n])}),depthMask:(e,t)=>e({[2930]:t}),frontFace:(e,t)=>e({[2886]:t}),lineWidth:(e,t)=>e({[2849]:t}),polygonOffset:(e,t,n)=>e({[32824]:t,10752:n}),sampleCoverage:(e,t,n)=>e({[32938]:t,32939:n}),scissor:(e,t,n,r,i)=>e({[3088]:new Int32Array([t,n,r,i])}),stencilMask:(e,t)=>e({[2968]:t,36005:t}),stencilMaskSeparate:(e,t,n)=>e({[1028===t?2968:36005]:n}),stencilFunc:(e,t,n,r)=>e({[2962]:t,2967:n,2963:r,34816:t,36003:n,36004:r}),stencilFuncSeparate:(e,t,n,r,i)=>e({[1028===t?2962:34816]:n,[1028===t?2967:36003]:r,[1028===t?2963:36004]:i}),stencilOp:(e,t,n,r)=>e({[2964]:t,2965:n,2966:r,34817:t,34818:n,34819:r}),stencilOpSeparate:(e,t,n,r,i)=>e({[1028===t?2964:34817]:n,[1028===t?2965:34818]:r,[1028===t?2966:34819]:i}),viewport:(e,t,n,r,i)=>e({[2978]:[t,n,r,i]})};n=(e,t)=>e.isEnabled(t);const l={[3042]:n,2884:n,2929:n,3024:n,32823:n,32926:n,32928:n,3089:n,2960:n,35977:n}},,function(e,t){e.exports=function isObjectLike(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";function deprecatedPropType(e,t){return function(){return null}}n.d(t,"a",function(){return deprecatedPropType})},function(e,t,n){"use strict";function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{}}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?Object(r.a)(e):Object.assign({},s.c),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e=0){this.stateStack.push({})}pop(){Object(A.a)(0{r[e]=null}),Object.assign(r,e);t=this.gl.bindFramebuffer(36160,this.handle);for(const A in r){Object(u.a)(void 0!==A,"Misspelled framebuffer binding point?");var i,o,a=Number(A),s=r[a];let e=s;e?e instanceof l.a?this._attachRenderbuffer({attachment:a,renderbuffer:e}):Array.isArray(s)?([s,i=0,o=0]=s,e=s,this._attachTexture({attachment:a,texture:s,layer:i,level:o})):this._attachTexture({attachment:a,texture:e,layer:0,level:0}):this._unattach(a),n&&e&&e.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,t||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(e=>!this.attachments[e]).forEach(e=>{delete this.attachments[e]})}checkStatus(){var{}=this,e=this.getStatus();if(36053!==e)throw new Error(function _getFrameBufferStatus(e){var t=Framebuffer.STATUS||{};return t[e]||"Framebuffer error "+e}(e));return this}getStatus(){const e=this["gl"];var t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),n}clear(e={}){const{color:t,depth:n,stencil:r,drawBuffers:i=[]}=e;e=this.gl.bindFramebuffer(36160,this.handle);return(t||n||r)&&Object(o.a)(this.gl,{color:t,depth:n,stencil:r}),i.forEach((e,t)=>{Object(o.b)(this.gl,{drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,e||null),this}readPixels(e=0){return s.k.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e=0){return s.k.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e=0){return s.k.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e=0){return s.k.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e=0){return s.k.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e=0){return s.k.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:n=0,width:r,height:i}){const o=Object(s.a)(this.gl);var a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===n&&void 0===r&&void 0===i?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,n,r,i),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,n){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r=n&&1e3s.k.level||"undefined"==typeof window)return this;t=t||"Framebuffer "+this.id;var n=Object(r.a)(this,{targetMaxHeight:100});return s.k.image({logLevel:e,message:t,image:n},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,n,r,i){let o=null;return e&&((o=o||{})[36064]=new a.a(this.gl,{id:this.id+"-color0",pixels:null,format:6408,type:5121,width:r,height:i,mipmaps:!1,parameters:{[10241]:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&n?((o=o||{})[33306]=new l.a(this.gl,{id:this.id+"-depth-stencil",format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new l.a(this.gl,{id:this.id+"-depth",format:33189,width:r,height:i}),this.ownResources.push(o[36096])):n&&Object(u.a)(!1),o}_unattach(e){var t=this.attachments[e];t&&(t instanceof l.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const n=this["gl"];n.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:n,level:r}){const i=this["gl"];switch(i.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:const a=Object(s.a)(i);a.framebufferTextureLayer(36160,e,t.target,r,n);break;case 34067:var o=function mapIndexToCubeMapFace(e){return e<34069?e+34069:e}(n);i.framebufferTexture2D(36160,e,o,t.handle,r);break;case 3553:i.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:Object(u.a)(!1,"Illegal texture type")}i.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=Object(s.g)(this.gl);t?t.readBuffer(e):Object(u.a)(36064===e||1029===e,c),this.readBuffer=e}_setDrawBuffers(e){const t=this["gl"],n=Object(s.a)(t);if(n)n.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):Object(u.a)(1===e.length&&(36064===e[0]||1029===e[0]),c)}this.drawBuffers=e}_getAttachmentParameterFallback(e){var t=Object(i.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}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Framebuffer.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";function noop(){}n.d(t,"a",function(){return Transition});const r={onStart:noop,onUpdate:noop,onInterrupt:noop,onEnd:noop};class Transition{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings={...r,...e},this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}},function(e,t,n){"use strict";function deepEqual(e,t){if(e===t)return!0;if(!e||!t)return!1;for(const i in e){var n=e[i],r=t[i];if(!(n===r||Array.isArray(n)&&Array.isArray(r)&&deepEqual(n,r)))return!1}return!0}n.d(t,"a",function(){return deepEqual})},function(e,t,n){"use strict";n.d(t,"a",function(){return BaseSource});class BaseSource{async fetch(e,t=void 0){return Promise.all(e.map(e=>this.fetchSlice(e,t)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}},function(e,t,n){"use strict";var r=n(154);t.a=function(e){return(e=Object(r.b)(Math.abs(e)))?e[1]:NaN}},function(e,a,s){"use strict";!function(e,t){s.d(a,"a",function(){return n}),s.d(a,"b",function(){return r}),s.d(a,"d",function(){return i}),s.d(a,"c",function(){return o});e={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document};const n=e.global||e.self||e.window||{};const r="object"!=typeof t||"[object process]"!==String(t)||t.browser,i="function"==typeof importScripts,o="undefined"!=typeof window&&void 0!==window.orientation;e=void 0!==t&&t.version&&/v([0-9]*)/.exec(t.version);e&&parseFloat(e[1])}.call(this,s(59),s(97))},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});const r="vs",i="fs"},function(g,e,t){"use strict";t.r(e),t.d(e,"Debug",function(){return B.a}),t.d(e,"Error",function(){return B.b}),t.d(e,"Info",function(){return B.c}),t.d(e,"None",function(){return B.d}),t.d(e,"Warn",function(){return B.e}),t.d(e,"accessor",function(){return B.f}),t.d(e,"accessorFields",function(){return B.g}),t.d(e,"accessorName",function(){return B.h}),t.d(e,"array",function(){return B.i}),t.d(e,"ascending",function(){return B.j}),t.d(e,"clampRange",function(){return B.k}),t.d(e,"compare",function(){return B.l}),t.d(e,"constant",function(){return B.m}),t.d(e,"debounce",function(){return B.n}),t.d(e,"error",function(){return B.o}),t.d(e,"extend",function(){return B.p}),t.d(e,"extent",function(){return B.q}),t.d(e,"extentIndex",function(){return B.r}),t.d(e,"falsy",function(){return B.s}),t.d(e,"fastmap",function(){return B.t}),t.d(e,"field",function(){return B.u}),t.d(e,"flush",function(){return B.v}),t.d(e,"hasOwnProperty",function(){return B.w}),t.d(e,"id",function(){return B.x}),t.d(e,"identity",function(){return B.y}),t.d(e,"inherits",function(){return B.z}),t.d(e,"inrange",function(){return B.A}),t.d(e,"isArray",function(){return B.B}),t.d(e,"isBoolean",function(){return B.C}),t.d(e,"isDate",function(){return B.D}),t.d(e,"isFunction",function(){return B.E}),t.d(e,"isIterable",function(){return B.F}),t.d(e,"isNumber",function(){return B.G}),t.d(e,"isObject",function(){return B.H}),t.d(e,"isRegExp",function(){return B.I}),t.d(e,"isString",function(){return B.J}),t.d(e,"key",function(){return B.K}),t.d(e,"lerp",function(){return B.L}),t.d(e,"logger",function(){return B.M}),t.d(e,"lruCache",function(){return B.N}),t.d(e,"merge",function(){return B.O}),t.d(e,"mergeConfig",function(){return B.P}),t.d(e,"one",function(){return B.Q}),t.d(e,"pad",function(){return B.R}),t.d(e,"panLinear",function(){return B.S}),t.d(e,"panLog",function(){return B.T}),t.d(e,"panPow",function(){return B.U}),t.d(e,"panSymlog",function(){return B.V}),t.d(e,"peek",function(){return B.W}),t.d(e,"quarter",function(){return B.X}),t.d(e,"repeat",function(){return B.Y}),t.d(e,"span",function(){return B.Z}),t.d(e,"splitAccessPath",function(){return B.ab}),t.d(e,"stringValue",function(){return B.bb}),t.d(e,"toBoolean",function(){return B.cb}),t.d(e,"toDate",function(){return B.db}),t.d(e,"toNumber",function(){return B.eb}),t.d(e,"toSet",function(){return B.fb}),t.d(e,"toString",function(){return B.gb}),t.d(e,"truncate",function(){return B.hb}),t.d(e,"truthy",function(){return B.ib}),t.d(e,"utcquarter",function(){return B.jb}),t.d(e,"visitArray",function(){return B.kb}),t.d(e,"writeConfig",function(){return B.lb}),t.d(e,"zero",function(){return B.mb}),t.d(e,"zoomLinear",function(){return B.nb}),t.d(e,"zoomLog",function(){return B.ob}),t.d(e,"zoomPow",function(){return B.pb}),t.d(e,"zoomSymlog",function(){return B.qb}),t.d(e,"Dataflow",function(){return Dataflow}),t.d(e,"EventStream",function(){return EventStream}),t.d(e,"MultiPulse",function(){return MultiPulse}),t.d(e,"Operator",function(){return Operator}),t.d(e,"Parameters",function(){return Parameters}),t.d(e,"Pulse",function(){return Pulse}),t.d(e,"Transform",function(){return Transform}),t.d(e,"changeset",function(){return changeset}),t.d(e,"definition",function(){return definition}),t.d(e,"ingest",function(){return ingest$1}),t.d(e,"isTuple",function(){return isTuple}),t.d(e,"transform",function(){return vega_dataflow_module_transform}),t.d(e,"transforms",function(){return J}),t.d(e,"tupleid",function(){return tupleid}),t.d(e,"bandwidthNRD",function(){return estimateBandwidth}),t.d(e,"bin",function(){return vega_statistics_module_bin}),t.d(e,"bootstrapCI",function(){return bootstrapCI}),t.d(e,"cumulativeLogNormal",function(){return cumulativeLogNormal}),t.d(e,"cumulativeNormal",function(){return cumulativeNormal}),t.d(e,"cumulativeUniform",function(){return cumulativeUniform}),t.d(e,"densityLogNormal",function(){return densityLogNormal}),t.d(e,"densityNormal",function(){return densityNormal}),t.d(e,"densityUniform",function(){return densityUniform}),t.d(e,"dotbin",function(){return dotbin}),t.d(e,"quantileLogNormal",function(){return quantileLogNormal}),t.d(e,"quantileNormal",function(){return quantileNormal}),t.d(e,"quantileUniform",function(){return quantileUniform}),t.d(e,"quantiles",function(){return quantiles}),t.d(e,"quartiles",function(){return quartiles}),t.d(e,"random",function(){return ee}),t.d(e,"randomInteger",function(){return integer}),t.d(e,"randomKDE",function(){return vega_statistics_module_kde}),t.d(e,"randomLCG",function(){return lcg}),t.d(e,"randomLogNormal",function(){return lognormal}),t.d(e,"randomMixture",function(){return mixture}),t.d(e,"randomNormal",function(){return gaussian}),t.d(e,"randomUniform",function(){return uniform}),t.d(e,"regressionExp",function(){return exp}),t.d(e,"regressionLinear",function(){return linear}),t.d(e,"regressionLoess",function(){return loess}),t.d(e,"regressionLog",function(){return log}),t.d(e,"regressionPoly",function(){return poly}),t.d(e,"regressionPow",function(){return pow}),t.d(e,"regressionQuad",function(){return vega_statistics_module_quad}),t.d(e,"sampleCurve",function(){return sampleCurve}),t.d(e,"sampleLogNormal",function(){return sampleLogNormal}),t.d(e,"sampleNormal",function(){return sampleNormal}),t.d(e,"sampleUniform",function(){return sampleUniform}),t.d(e,"setRandom",function(){return setRandom}),t.d(e,"DATE",function(){return h.a}),t.d(e,"DAY",function(){return h.b}),t.d(e,"DAYOFYEAR",function(){return h.c}),t.d(e,"HOURS",function(){return h.d}),t.d(e,"MILLISECONDS",function(){return h.e}),t.d(e,"MINUTES",function(){return h.f}),t.d(e,"MONTH",function(){return h.g}),t.d(e,"QUARTER",function(){return h.h}),t.d(e,"SECONDS",function(){return h.i}),t.d(e,"TIME_UNITS",function(){return h.j}),t.d(e,"WEEK",function(){return h.k}),t.d(e,"YEAR",function(){return h.l}),t.d(e,"dayofyear",function(){return h.m}),t.d(e,"timeBin",function(){return h.n}),t.d(e,"timeFloor",function(){return h.o}),t.d(e,"timeInterval",function(){return h.p}),t.d(e,"timeOffset",function(){return h.q}),t.d(e,"timeSequence",function(){return h.r}),t.d(e,"timeUnitSpecifier",function(){return h.s}),t.d(e,"timeUnits",function(){return h.t}),t.d(e,"utcFloor",function(){return h.u}),t.d(e,"utcInterval",function(){return h.v}),t.d(e,"utcOffset",function(){return h.w}),t.d(e,"utcSequence",function(){return h.x}),t.d(e,"utcdayofyear",function(){return h.y}),t.d(e,"utcweek",function(){return h.z}),t.d(e,"week",function(){return h.A}),t.d(e,"format",function(){return Q.a}),t.d(e,"formats",function(){return Q.b}),t.d(e,"inferType",function(){return Q.c}),t.d(e,"inferTypes",function(){return Q.d}),t.d(e,"loader",function(){return Q.e}),t.d(e,"read",function(){return Q.f}),t.d(e,"responseType",function(){return Q.g}),t.d(e,"typeParsers",function(){return Q.h}),t.d(e,"Bounds",function(){return Bounds}),t.d(e,"CanvasHandler",function(){return CanvasHandler}),t.d(e,"CanvasRenderer",function(){return CanvasRenderer}),t.d(e,"Gradient",function(){return Gradient}),t.d(e,"GroupItem",function(){return GroupItem}),t.d(e,"Handler",function(){return vega_scenegraph_module_Handler}),t.d(e,"Item",function(){return Item}),t.d(e,"Marks",function(){return Ei}),t.d(e,"RenderType",function(){return so}),t.d(e,"Renderer",function(){return vega_scenegraph_module_Renderer}),t.d(e,"ResourceLoader",function(){return ResourceLoader}),t.d(e,"SVGHandler",function(){return SVGHandler}),t.d(e,"SVGRenderer",function(){return SVGRenderer}),t.d(e,"SVGStringRenderer",function(){return SVGStringRenderer}),t.d(e,"Scenegraph",function(){return Scenegraph}),t.d(e,"boundClip",function(){return boundClip}),t.d(e,"boundContext",function(){return boundContext}),t.d(e,"boundItem",function(){return boundItem}),t.d(e,"boundMark",function(){return boundMark}),t.d(e,"boundStroke",function(){return boundStroke}),t.d(e,"domChild",function(){return domChild}),t.d(e,"domClear",function(){return domClear}),t.d(e,"domCreate",function(){return domCreate}),t.d(e,"domFind",function(){return domFind}),t.d(e,"font",function(){return vega_scenegraph_module_font}),t.d(e,"fontFamily",function(){return fontFamily}),t.d(e,"fontSize",function(){return vega_scenegraph_module_fontSize}),t.d(e,"intersect",function(){return vega_scenegraph_module_intersect}),t.d(e,"intersectBoxLine",function(){return intersectBoxLine}),t.d(e,"intersectPath",function(){return intersectPath}),t.d(e,"intersectPoint",function(){return intersectPoint}),t.d(e,"intersectRule",function(){return intersectRule}),t.d(e,"lineHeight",function(){return lineHeight}),t.d(e,"markup",function(){return markup}),t.d(e,"multiLineOffset",function(){return multiLineOffset}),t.d(e,"pathCurves",function(){return curves}),t.d(e,"pathEqual",function(){return pathEqual}),t.d(e,"pathParse",function(){return pathParse}),t.d(e,"pathRectangle",function(){return vg_rect}),t.d(e,"pathRender",function(){return pathRender}),t.d(e,"pathSymbols",function(){return vega_scenegraph_module_symbols}),t.d(e,"pathTrail",function(){return vg_trail}),t.d(e,"point",function(){return vega_scenegraph_module_point}),t.d(e,"renderModule",function(){return renderModule}),t.d(e,"resetSVGClipId",function(){return resetSVGClipId}),t.d(e,"resetSVGDefIds",function(){return resetSVGDefIds}),t.d(e,"sceneEqual",function(){return sceneEqual}),t.d(e,"sceneFromJSON",function(){return sceneFromJSON}),t.d(e,"scenePickVisit",function(){return pickVisit}),t.d(e,"sceneToJSON",function(){return sceneToJSON}),t.d(e,"sceneVisit",function(){return vega_scenegraph_module_visit}),t.d(e,"sceneZOrder",function(){return zorder}),t.d(e,"serializeXML",function(){return qi}),t.d(e,"textMetrics",function(){return Bi}),t.d(e,"interpolate",function(){return vega_scale_module_interpolate}),t.d(e,"interpolateColors",function(){return interpolateColors}),t.d(e,"interpolateRange",function(){return interpolateRange}),t.d(e,"quantizeInterpolator",function(){return quantizeInterpolator}),t.d(e,"scale",function(){return vega_scale_module_scale}),t.d(e,"scheme",function(){return vega_scale_module_scheme}),t.d(e,"projection",function(){return vega_projection_module_projection}),t.d(e,"View",function(){return View}),t.d(e,"defaultLocale",function(){return O.a}),t.d(e,"formatLocale",function(){return O.c}),t.d(e,"locale",function(){return O.b}),t.d(e,"resetDefaultLocale",function(){return O.d}),t.d(e,"timeFormatLocale",function(){return O.e}),t.d(e,"expressionFunction",function(){return expressionFunction}),t.d(e,"parse",function(){return vega_parser_module_parse}),t.d(e,"runtimeContext",function(){return vega_runtime_module_context}),t.d(e,"codegenExpression",function(){return vega_expression_module_codegen}),t.d(e,"parseExpression",function(){return parser}),t.d(e,"parseSelector",function(){return eventSelector}),t.d(e,"version",function(){return yh});var e={},r=(t.r(e),t.d(e,"aggregate",function(){return Aggregate}),t.d(e,"bin",function(){return Bin}),t.d(e,"collect",function(){return Collect}),t.d(e,"compare",function(){return Compare}),t.d(e,"countpattern",function(){return CountPattern}),t.d(e,"cross",function(){return Cross}),t.d(e,"density",function(){return Density}),t.d(e,"dotbin",function(){return DotBin}),t.d(e,"expression",function(){return Expression}),t.d(e,"extent",function(){return Extent}),t.d(e,"facet",function(){return Facet}),t.d(e,"field",function(){return Field}),t.d(e,"filter",function(){return Filter}),t.d(e,"flatten",function(){return Flatten}),t.d(e,"fold",function(){return Fold}),t.d(e,"formula",function(){return Formula}),t.d(e,"generate",function(){return Generate}),t.d(e,"impute",function(){return Impute}),t.d(e,"joinaggregate",function(){return JoinAggregate}),t.d(e,"kde",function(){return KDE}),t.d(e,"key",function(){return Key}),t.d(e,"load",function(){return Load}),t.d(e,"lookup",function(){return Lookup}),t.d(e,"multiextent",function(){return MultiExtent}),t.d(e,"multivalues",function(){return MultiValues}),t.d(e,"params",function(){return Params}),t.d(e,"pivot",function(){return Pivot}),t.d(e,"prefacet",function(){return PreFacet}),t.d(e,"project",function(){return Project}),t.d(e,"proxy",function(){return Proxy}),t.d(e,"quantile",function(){return Quantile}),t.d(e,"relay",function(){return Relay}),t.d(e,"sample",function(){return Sample}),t.d(e,"sequence",function(){return Sequence}),t.d(e,"sieve",function(){return Sieve}),t.d(e,"subflow",function(){return Subflow}),t.d(e,"timeunit",function(){return TimeUnit}),t.d(e,"tupleindex",function(){return TupleIndex}),t.d(e,"values",function(){return Values}),t.d(e,"window",function(){return Window}),{}),u=(t.r(r),t.d(r,"interpolate",function(){return rn}),t.d(r,"interpolateArray",function(){return Jt}),t.d(r,"interpolateBasis",function(){return Vt}),t.d(r,"interpolateBasisClosed",function(){return Zt}),t.d(r,"interpolateDate",function(){return Kt}),t.d(r,"interpolateDiscrete",function(){return on}),t.d(r,"interpolateHue",function(){return an}),t.d(r,"interpolateNumber",function(){return Xt}),t.d(r,"interpolateNumberArray",function(){return zt}),t.d(r,"interpolateObject",function(){return qt}),t.d(r,"interpolateRound",function(){return sn}),t.d(r,"interpolateString",function(){return nn}),t.d(r,"interpolateTransformCss",function(){return cn}),t.d(r,"interpolateTransformSvg",function(){return gn}),t.d(r,"interpolateZoom",function(){return un}),t.d(r,"interpolateRgb",function(){return Ht}),t.d(r,"interpolateRgbBasis",function(){return jt}),t.d(r,"interpolateRgbBasisClosed",function(){return Yt}),t.d(r,"interpolateHsl",function(){return dn}),t.d(r,"interpolateHslLong",function(){return hn}),t.d(r,"interpolateLab",function(){return lab_lab}),t.d(r,"interpolateHcl",function(){return En}),t.d(r,"interpolateHclLong",function(){return Qn}),t.d(r,"interpolateCubehelix",function(){return Dn}),t.d(r,"interpolateCubehelixLong",function(){return Gn}),t.d(r,"piecewise",function(){return src_piecewise_piecewise}),t.d(r,"quantize",function(){return Nn}),{}),d=(t.r(u),t.d(u,"bound",function(){return Bound}),t.d(u,"identifier",function(){return Identifier}),t.d(u,"mark",function(){return Mark}),t.d(u,"overlap",function(){return Overlap}),t.d(u,"render",function(){return Render}),t.d(u,"viewlayout",function(){return ViewLayout}),{}),p=(t.r(d),t.d(d,"axisticks",function(){return AxisTicks}),t.d(d,"datajoin",function(){return DataJoin}),t.d(d,"encode",function(){return Encode}),t.d(d,"legendentries",function(){return LegendEntries}),t.d(d,"linkpath",function(){return LinkPath}),t.d(d,"pie",function(){return Pie}),t.d(d,"scale",function(){return Scale}),t.d(d,"sortitems",function(){return SortItems}),t.d(d,"stack",function(){return Stack}),{}),f=(t.r(p),t.d(p,"contour",function(){return Contour}),t.d(p,"geojson",function(){return GeoJSON}),t.d(p,"geopath",function(){return GeoPath}),t.d(p,"geopoint",function(){return GeoPoint}),t.d(p,"geoshape",function(){return GeoShape}),t.d(p,"graticule",function(){return Graticule}),t.d(p,"heatmap",function(){return Heatmap}),t.d(p,"isocontour",function(){return Isocontour}),t.d(p,"kde2d",function(){return KDE2D}),t.d(p,"projection",function(){return Projection}),{}),I=(t.r(f),t.d(f,"force",function(){return Force}),{}),C=(t.r(I),t.d(I,"nest",function(){return Nest}),t.d(I,"pack",function(){return Pack}),t.d(I,"partition",function(){return Partition}),t.d(I,"stratify",function(){return Stratify}),t.d(I,"tree",function(){return Tree}),t.d(I,"treelinks",function(){return TreeLinks}),t.d(I,"treemap",function(){return Treemap}),{}),m=(t.r(C),t.d(C,"label",function(){return Label}),{}),y=(t.r(m),t.d(m,"loess",function(){return Loess}),t.d(m,"regression",function(){return Regression}),{}),b=(t.r(y),t.d(y,"voronoi",function(){return vega_voronoi_module_Voronoi}),{}),v=(t.r(b),t.d(b,"wordcloud",function(){return Wordcloud}),{}),B=(t.r(v),t.d(v,"crossfilter",function(){return CrossFilter}),t.d(v,"resolvefilter",function(){return ResolveFilter}),t(1)),Q=t(153),O=t(109);function UniqueList(e){const n=e||B.y,r=[],i={};return r.add=e=>{var t=n(e);return i[t]||(i[t]=1,r.push(e)),r},r.remove=e=>{var t=n(e);return i[t]&&(i[t]=0)<=(t=r.indexOf(e))&&r.splice(t,1),r},r}async function asyncCallback(t,e){try{await e(t)}catch(e){t.error(e)}}const L=Symbol("vega_id");let P=1;function isTuple(e){return!(!e||!tupleid(e))}function tupleid(e){return e[L]}function setid(e,t){return e[L]=t,e}function ingest$1(e){e=e===Object(e)?e:{data:e};return tupleid(e)?e:setid(e,P++)}function vega_dataflow_module_derive(e){return rederive(e,ingest$1({}))}function rederive(e,t){for(const n in e)t[n]=e[n];return t}function replace(e,t){return setid(t,tupleid(e))}function stableCompare(n,r){return n?r?(e,t)=>n(e,t)||tupleid(r(e))-tupleid(r(t)):(e,t)=>n(e,t)||tupleid(e)-tupleid(t):null}function isChangeSet(e){return e&&e.constructor===changeset}function changeset(){const c=[],g=[],u=[],d=[],h=[];let p=null,f=!1;return{constructor:changeset,insert(e){var t=Object(B.i)(e),n=t.length;for(let e=0;e{s(e)&&(t[tupleid(e)]=-1)});for(n=0,o=c.length;n{s(e)&&00{n instanceof Operator?(n!==this&&(r&&n.targets().add(this),a.push(n)),o.push({op:n,name:e,index:t})):i.set(e,t,n)};for(n in e)if(s=e[n],"pulse"===n)Object(B.i)(s).forEach(e=>{e instanceof Operator?e!==this&&(e.targets().add(this),a.push(e)):Object(B.o)("Pulse parameters must be operator instances.")}),this.source=s;else if(Object(B.B)(s))for(i.set(n,-1,Array(A=s.length)),l=0;l{var e=Date.now();return e-n>t?(n=e,1):0})},debounce(e){const n=vega_dataflow_module_stream();return this.targets().add(vega_dataflow_module_stream(null,null,Object(B.n)(e,e=>{const t=e.dataflow;n.receive(e),t&&t.run&&t.run()}))),n},between(e,t){let n=!1;return e.targets().add(new EventStream(null,null,()=>n=!0)),t.targets().add(new EventStream(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=B.ib,this._targets=null}};const j={skip:!0};function onStream(n,e,r,t,i,o){const a=Object(B.p)({},o,j);let s,A;Object(B.E)(r)||(r=Object(B.m)(r)),s=void 0===t?e=>n.touch(r(e)):Object(B.E)(t)?(A=new Operator(null,t,i,!1),e=>{A.evaluate(e);var e=r(e),t=A.value;isChangeSet(t)?n.pulse(e,t,o):n.update(e,t,a)}):e=>n.update(r(e),t,a),e.apply(s)}function onOperator(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new Operator(null,function updater(n,r){return r=Object(B.E)(r)?r:Object(B.m)(r),n?function(e,t){e=r(e,t);return n.skip()||(n.skip(e!==this.value).value=e),e}:r}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const Y={};function Pulse(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function materialize(e,t){const n=[];return Object(B.kb)(e,t,e=>n.push(e)),n}function vega_dataflow_module_filter(e,t){const n={};return e.visit(t,e=>{n[tupleid(e)]=1}),e=>n[tupleid(e)]?null:e}function addFilter(n,r){return n?(e,t)=>n(e,t)&&r(e,t):r}function MultiPulse(e,t,n,r){var i=n.length;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(let e=0;et[e]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?Object(B.B)(e)?e.some(e=>n[e]):n[e]:!!n)},filter(e,t){return 1&e&&(this.addF=addFilter(this.addF,t)),2&e&&(this.remF=addFilter(this.remF,t)),4&e&&(this.modF=addFilter(this.modF,t)),16&e&&(this.srcF=addFilter(this.srcF,t)),this},materialize(e){var t=this;return 1&(e=e||7)&&t.addF&&(t.add=materialize(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=materialize(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=materialize(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){var n=this;if(16&e)return Object(B.kb)(n.source,n.srcF,t),n;1&e&&Object(B.kb)(n.add,n.addF,t),2&e&&Object(B.kb)(n.rem,n.remF,t),4&e&&Object(B.kb)(n.mod,n.modF,t);var r=n.source;return 8&e&&r&&((e=n.add.length+n.mod.length)!==r.length&&(e?Object(B.kb)(r,vega_dataflow_module_filter(n,5),t):Object(B.kb)(r,n.srcF,t))),n}},Object(B.z)(MultiPulse,Pulse,{fork(e){const t=new Pulse(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,e=>t.add.push(e)),e&t.REM&&this.visit(t.REM,e=>t.rem.push(e)),e&t.MOD&&this.visit(t.MOD,e=>t.mod.push(e))),t},changed(e){return this.changes&e},modified(e){const t=this.fields;return t&&this.changes&this.MOD?Object(B.B)(e)?e.some(e=>t[e]):t[e]:0},filter(){Object(B.o)("MultiPulse does not support filtering.")},materialize(){Object(B.o)("MultiPulse does not support materialization.")},visit(e,t){const n=this.pulses,r=n.length;let i=0;if(e&this.SOURCE)for(;ir=[],size:()=>r.length,peek:()=>r[0],push:e=>(r.push(e),siftdown(r,0,r.length-1,n)),pop:()=>{var e=r.pop();let t;return r.length?(t=r[0],r[0]=e,function siftup(e,t,n){var r=t,i=e.length,o=e[t];let a=1+(t<<1),s;for(;a>1])<0;)e[n]=i,n=o;return e[n]=a}function Dataflow(){this.logger(Object(B.M)()),this.logLevel(B.b),this._clock=0,this._rank=0,this._locale=Object(O.a)();try{this._loader=Object(Q.e)()}catch(e){}this._touched=UniqueList(B.x),this._input={},this._pulse=null,this._heap=Heap((e,t)=>e.qrank-t.qrank),this._postrun=[]}function logMethod(e){return function(){return this._log[e].apply(this,arguments)}}function Transform(e,t){Operator.call(this,e,null,t)}Dataflow.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:logMethod("error"),warn:logMethod("warn"),info:logMethod("info"),debug:logMethod("debug"),logLevel:logMethod("level"),cleanThreshold:1e4,add:function vega_dataflow_module_add(e,t,n,r){let i=1,o;return o=e instanceof Operator?e:e&&e.prototype instanceof Operator?new e:Object(B.E)(e)?new Operator(null,e):(i=0,new Operator(e,t)),this.rank(o),i&&(r=n,n=t),n&&this.connect(o,o.parameters(n,r)),this.touch(o),o},connect:function connect(t,n){var r=t.rank,i=n.length;for(let e=0;et=e);return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(this);return r.requests+=1,t=await this.request(t,n),this.pulse(e,this.changeset().remove(B.ib).insert(t.data||[])),r.done(),t},request:async function request(t,e){let n=0,r;try{r=await this.loader().load(t,{context:"dataflow",response:Object(Q.g)(e&&e.type)});try{r=this.parse(r,e)}catch(e){n=-2,this.warn("Data ingestion failed",t,e)}}catch(e){n=-1,this.warn("Loading failed",t,e)}return{data:r,status:n}},events:function vega_dataflow_module_events(e,t,n,r){function Gkb(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}}const i=this,o=vega_dataflow_module_stream(n,r);let a;var s=(a="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):Object(B.i)(e)).length;for(let e=0;er._enqueue(e,!0)),r._touched=UniqueList(B.x);let o=0,a,s,A;try{for(;0r._enqueue(e)),++o)}catch(e){r._heap.clear(),A=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${t}: ${o} operators`),A&&(r._postrun=[],r.error(A)),r._postrun.length){var l=r._postrun.sort((e,t)=>t.priority-e.priority);r._postrun=[];for(let e=0;er.runAsync(null,()=>{e.forEach(e=>{try{e(r)}catch(e){r.error(e)}})})),r},run:function vega_dataflow_module_run(e,t,n){return this._pulse?reentrant(this):(this.evaluate(e,t,n),this)},runAsync:async function runAsync(e,t,n){for(;this._running;)await this._running;var r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function runAfter(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function enqueue(e,t){var n=e.stampe.pulse),t):this._input[e.id]||function singlePulse(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==Y&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},Object(B.z)(Transform,Operator,{run(e){if(e.stampthis.pulse=e):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const J={};function definition(e){e=vega_dataflow_module_transform(e);return e&&e.Definition||null}function vega_dataflow_module_transform(e){return e=e&&e.toLowerCase(),Object(B.w)(J,e)?J[e]:null}var K=t(254),X=t(457);function min_min(t,n){let r;if(void 0===n)for(const e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let e=-1;for(var i of t)null!=(i=n(i,++e,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}var q=function(e){return null===e?NaN:+e};function quantile(e,t,n){if(n=(e=Float64Array.from(function*number_numbers(t,n){if(void 0===n)for(var e of t)null!=e&&(e=+e)>=e&&(yield e);else{let e=-1;for(var r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}(e,n))).length){if((t=+t)<=0||n<2)return min_min(e);if(1<=t)return Object(X.a)(e);var n=(n-1)*t,t=Math.floor(n),r=Object(X.a)(function quickselect(n,r,i=0,o=n.length-1,a=K.a){for(;i=e&&(i=e-o,o+=i/++r,a+=i*(e-o));else{let e=-1;for(var s of t)null!=(s=n(s,++e,t))&&(s=+s)>=s&&(i=s-o,o+=i/++r,a+=i*(s-o))}if(1=e&&(yield e);else{let e=-1;for(var r of t)null!=(r=n(r,++e,t))&&""!==r&&(r=+r)>=r&&(yield r)}}function quantiles(e,t,n){const r=Float64Array.from(vega_statistics_module_numbers(e,n));return r.sort(K.a),t.map(e=>quantileSorted(r,e))}function quartiles(e,t){return quantiles(e,[.25,.5,.75],t)}function estimateBandwidth(e,t){var n=e.length,r=deviation(e,t),e=quartiles(e,t),t=(e[2]-e[0])/1.34;return 1.06*(Math.min(r,t)||r||Math.abs(e[0])||1)*Math.pow(n,-.2)}function vega_statistics_module_bin(e){var t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o=e.extent[0],a=e.extent[1],s,A,l,c,g,u;var d=e.span||a-o||Math.abs(o)||1;if(e.step)s=e.step;else if(e.steps){for(c=d/t,g=0,u=e.steps.length;gt;)s*=n;for(g=0,u=i.length;g=l&&d/c<=t&&(s=c)}r=0<=(c=Math.log(s))?0:1+~~(-c/r),r=Math.pow(n,-r-1);return!e.nice&&void 0!==e.nice||(c=Math.floor(o/s+r)*s,o=oe);const i=e.length,o=new Float64Array(i);let a=0,s=1,A=r(e[0]),l=A,c=A+t,g;for(;s=c){for(l=(A+l)/2;a>1);ai;)e[a--]=e[r]}r=i,i=o}return e}(o,t+t/4):o}function lcg(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function integer(e,t){null==t&&(t=e,e=0);let n,r,i;const o={min(e){return arguments.length?(n=e||0,i=r-n,o):n},max(e){return arguments.length?(r=e||0,i=r-n,o):r},sample(){return n+Math.floor(i*ee())},pdf(e){return e===Math.floor(e)&&e>=n&&e=r?1:(e-n+1)/i},icdf(e){return 0<=e&&e<=1?n-1+Math.floor(e*i):NaN}};return o.min(e).max(t)}const te=Math.sqrt(2*Math.PI),ne=Math.SQRT2;let re=NaN;function sampleNormal(e,t){e=e||0,t=null==t?1:t;let n=0,r=0,i,o;if(re==re)n=re,re=NaN;else{for(;n=2*ee()-1,r=2*ee()-1,0===(i=n*n+r*r)||1sampleNormal(n,r),pdf:e=>densityNormal(e,n,r),cdf:e=>cumulativeNormal(e,n,r),icdf:e=>quantileNormal(e,n,r)};return i.mean(e).stdev(t)}function vega_statistics_module_kde(r,i){const o=gaussian();let a=0;const t={data(e){return arguments.length?(r=e,a=e?e.length:0,t.bandwidth(i)):r},bandwidth(e){return arguments.length?(!(i=e)&&r&&(i=estimateBandwidth(r)),t):i},sample(){return r[~~(ee()*a)]+i*o.sample()},pdf(e){let t=0,n=0;for(;nsampleLogNormal(n,r),pdf:e=>densityLogNormal(e,n,r),cdf:e=>cumulativeLogNormal(e,n,r),icdf:e=>quantileLogNormal(e,n,r)};return i.mean(e).stdev(t)}function mixture(i,t){let o=0,a;const n={weights(e){return arguments.length?(a=function normalize(e){const t=[];let n=0,r;for(r=0;rsampleUniform(n,r),pdf:e=>densityUniform(e,n,r),cdf:e=>cumulativeUniform(e,n,r),icdf:e=>quantileUniform(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function ols(e,t,n,r){r-=e*e,n=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-n*e,n]}function vega_statistics_module_points(e,r,i,t){e=e.filter(e=>{let t=r(e),n=i(e);return null!=t&&(t=+t)>=t&&null!=n&&(n=+n)>=n}),t&&e.sort((e,t)=>r(e)-r(t));const n=e.length,o=new Float64Array(n),a=new Float64Array(n);let s=0,A=0,l=0,c,g,u;for(u of e)o[s]=c=+r(u),a[s]=g=+i(u),++s,A+=(c-A)/s,l+=(g-l)/s;for(s=0;s=o&&null!=a&&(a=+a)>=a&&r(o,a,++i)}function rSquared(e,t,n,r,i){let o=0,a=0;return visitPoints(e,t,n,(e,t)=>{e=t-i(e),t-=r;o+=e*e,a+=t*t}),1-o/a}function linear(e,t,n){let r=0,i=0,o=0,a=0,s=0;visitPoints(e,t,n,(e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s});const A=ols(r,i,o,a),l=e=>A[0]+A[1]*e;return{coef:A,predict:l,rSquared:rSquared(e,t,n,i,l)}}function log(e,t,n){let r=0,i=0,o=0,a=0,s=0;visitPoints(e,t,n,(e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s});const A=ols(r,i,o,a),l=e=>A[0]+A[1]*Math.log(e);return{coef:A,predict:l,rSquared:rSquared(e,t,n,i,l)}}function exp(e,t,n){const[r,,i,o]=vega_statistics_module_points(e,t,n);let a=0,s=0,A=0,l=0,c=0,g,u,d;visitPoints(e,t,n,(e,t)=>{g=r[c++],u=Math.log(t),d=g*t,a+=(t*u-a)/c,s+=(d-s)/c,A+=(d*u-A)/c,l+=(g*d-l)/c});const[h,p]=ols(s/o,a/o,A/o,l/o),f=e=>Math.exp(h+p*(e-i));return{coef:[Math.exp(h-p*i),p],predict:f,rSquared:rSquared(e,t,n,o,f)}}function pow(e,t,n){let r=0,i=0,o=0,a=0,s=0,A=0;visitPoints(e,t,n,(e,t)=>{var e=Math.log(e),n=Math.log(t);++A,r+=(e-r)/A,i+=(n-i)/A,o+=(e*n-o)/A,a+=(e*e-a)/A,s+=(t-s)/A});const l=ols(r,i,o,a),c=e=>l[0]*Math.pow(e,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:rSquared(e,t,n,s,c)}}function vega_statistics_module_quad(e,t,n){const[r,i,o,a]=vega_statistics_module_points(e,t,n),s=r.length;let A=0,l=0,c=0,g=0,u=0,d,h,p,f;for(d=0;d(e-=o,m*e*e+y*e+B+a);return{coef:[B-y*o+m*o*o+a,y-2*m*o,m],predict:b,rSquared:rSquared(e,t,n,a,b)}}function poly(e,t,n,r){if(1===r)return linear(e,t,n);if(2===r)return vega_statistics_module_quad(e,t,n);const[i,o,a,s]=vega_statistics_module_points(e,t,n),A=i.length,l=[],c=[],g=r+1;let u,d,h,p,f;for(u=0;uMath.abs(e[r][a])&&(a=i);for(o=r;o<1+t;++o)s=e[o][r],e[o][r]=e[o][a],e[o][a]=s;for(i=r+1;i=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;0<=i;--i){for(s=0,o=i+1;o{e-=a;let t=s+I[0]+I[1]*e+I[2]*e*e;for(u=3;ua[f]-h?p:f;let t=0,n=0,r=0,i=0,o=0;var C=1/Math.abs(a[I]-h||1);for(let e=p;e<=f;++e){var m=a[e],y=s[e],B=function tricube(e){return(e=1-e*e*e)*e*e}(Math.abs(h-m)*C)*u[e],b=m*B;t+=B,n+=b,r+=y*B,i+=y*b,o+=m*b}var[I,p]=ols(n/t,r/t,i/t,o/t);c[e]=I+p*h,g[e]=Math.abs(s[e]-c[e]),!function updateInterval(e,t,n){var r=e[t];let i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}(a,e+1,d)}if(e===ie)break;var v=$(g);if(Math.abs(v)[e,t(e)],o=e[0],a=e[1],s=a-o,A=s/r,l=[i(o)],c=[];if(n===r){for(let e=1;er&&(r=o)}return 1/(r-n)}(g[1],c);u;){var p=i((g[0]+u[0])/2);p[0]-g[0]>=A&&function angleDelta(e,t,n,r,i){n=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),i=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(n-i)}(g,p,u,d,h)>ae?c.push(p):(g=u,l.push(u),c.pop()),u=c[c.length-1]}return l}var se=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r{var t=i.length;let n=1,r=String(i[0](e));for(;n{};const ce={init:le,add:le,rem:le,idx:0},ge={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>1e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>1111e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},ue=Object.keys(ge);function createMeasure(e,t){return ge[e](t)}function compareIndex(e,t){return e.idx-t.idx}function vega_transforms_module_init(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function vega_transforms_module_add(t,n){null==t||""===t?++this.missing:t==t&&(++this.valid,this._ops.forEach(e=>e.add(this,t,n)))}function vega_transforms_module_rem(t,n){null==t||""===t?--this.missing:t==t&&(--this.valid,this._ops.forEach(e=>e.rem(this,t,n)))}function vega_transforms_module_set(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function compileMeasures(e,t){const n=t||B.y,r=function resolve(e){const t={},n=(e.forEach(e=>t[e.name]=e),e=>{e.req&&e.req.forEach(e=>{t[e]||n(t[e]=ge[e]())})});return e.forEach(n),Object.values(t).sort(compareIndex)}(e),i=e.slice().sort(compareIndex);function ctr(e){this._ops=r,this._out=i,this.cell=e,this.init()}return ctr.prototype.init=vega_transforms_module_init,ctr.prototype.add=vega_transforms_module_add,ctr.prototype.rem=vega_transforms_module_rem,ctr.prototype.set=vega_transforms_module_set,ctr.prototype.get=n,ctr.fields=e.map(e=>e.out),ctr}function TupleStore(e){this._key=e?Object(B.u)(e):tupleid,this.reset()}ue.forEach(e=>{ge[e]=function measure(t,n){return e=>Object(B.p)({name:t,out:e||t},ce,n)}(e,ge[e])});const de=TupleStore.prototype;function Aggregate(e){Transform.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}de.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},de.add=function(e){this._add.push(e)},de.rem=function(e){this._rem.push(e)},de.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,A,l;for(s=0;sn.add(e))):(n.value=n.value||n.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&1this.clean()),n.changes(r)},cross(){const s=this,A=s.value,l=s._dnames,c=l.map(()=>({})),g=l.length;function collect(e){let t,n,r,i;for(t in e)for(r=e[t].tuple,n=0;n{var t=Object(B.h)(e);return inputVisit(e),n.push(t),t}),this.cellkey=e.key||groupkey(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const t=e.fields||[null],r=e.ops||["count"],i=e.as||[],s=t.length,A={};let l,c,g,u,d,h;for(s!==r.length&&Object(B.o)("Unmatched number of fields and aggregate ops."),h=0;hcompileMeasures(e,e.field)),{}},cellkey:groupkey(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stampo.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter(e=>!a[r(e)]),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?Object(B.O)(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function Collect(e){Transform.call(this,[],e)}function Compare(e){Operator.call(this,null,update$5,e)}function update$5(e){return this.value&&!e.modified()?this.value:Object(B.l)(e.fields,e.orders)}function CountPattern(e){Transform.call(this,null,e)}function Cross(e){Transform.call(this,null,e)}Bin.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},Object(B.z)(Bin,Transform,{transform(e,t){const n=!1!==e.interval,r=this._bins(e),i=r.start,o=r.step,a=e.as||["bin0","bin1"],s=a[0],A=a[1];let l;return l=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified(Object(B.g)(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?e=>{var t=r(e);e[s]=t,e[A]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const n=e.field,t=vega_statistics_module_bin(e),r=t.step;let i=t.start,o=i+Math.ceil((t.stop-i)/r)*r,a,s;null!=(a=e.anchor)&&(s=a-(i+r*Math.floor((a-i)/r)),i+=s,o+=s);function ADb(e){let t=Object(B.eb)(n(e));return null==t?null:to?1/0:(t=Math.max(i,Math.min(t,o-r)),i+r*Math.floor(1e-14+(t-i)/r))}return ADb.start=i,ADb.stop=t.stop,ADb.step=r,this.value=Object(B.f)(ADb,Object(B.g)(n),e.name||"bin_"+Object(B.h)(n))}}),Collect.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(B.z)(Collect,Transform,{transform(e,t){const n=t.fork(t.ALL),r=SortedList(tupleid,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(stableCompare(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),Object(B.z)(Compare,Operator),CountPattern.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},Object(B.z)(CountPattern,Transform,{transform(a,e){var t=o=>e=>{for(var t,n=function tokenize(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(l(e),a.case,s)||[],r=0,i=n.length;rr[e]=1+(r[e]||0)),c=t(e=>--r[e]);return n?e.visit(e.SOURCE,o):(e.visit(e.ADD,o),e.visit(e.REM,c)),this._finish(e,i)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(n=e.modified("field")||t.modified(e.field.fields)?!0:n)&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,A,l;for(s in n)A=r[s],l=n[s]||0,!A&&l?(r[s]=A=ingest$1({}),A[i]=s,A[o]=l,a.add.push(A)):0===l?(A&&a.rem.push(A),n[s]=null,r[s]=null):A[o]!==l&&(A[o]=l,a.mod.push(A));return a.modifies(t)}}),Cross.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(B.z)(Cross,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function cross(e,t,n,r){for(var i,o,a=[],s={},A=e.length,l=0;ln[t]||Object(B.h)(e)):null}function partition$1(e,t,n){const r=[],i=e=>e(A);let o,a,s,A,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;avega_transforms_module_parse(e,t))):"function"==typeof r[i]&&r[i](e[i]);return r}(t.distribution,function vega_transforms_module_source(e){return()=>e.materialize(e.SOURCE).source}(n)),o=t.steps||t.minsteps||25,a=t.steps||t.maxsteps||200;let e=t.method||"pdf";"pdf"!==e&&"cdf"!==e&&Object(B.o)("Invalid density method: "+e),t.extent||i.data||Object(B.o)("Missing density extent parameter."),e=i[e];const s=t.as||["value","density"],A=t.extent||Object(B.q)(i.data()),l=sampleCurve(e,A,o,a).map(e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],ingest$1(t)});this.value&&(r.rem=this.value),this.value=r.add=r.source=l}return r}});function DotBin(e){Transform.call(this,null,e)}DotBin.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function Expression(e){Operator.call(this,null,update$4,e),this.modified(!0)}function update$4(t){const n=t.expr;return this.value&&!t.modified("expr")?this.value:Object(B.f)(e=>n(e,t),Object(B.g)(n),Object(B.h)(n))}function Extent(e){Transform.call(this,[void 0,void 0],e)}function Subflow(e,t){Operator.call(this,e),this.parent=t,this.count=0}function Facet(e){Transform.call(this,{},e),this._keys=Object(B.t)();const r=this._targets=[];r.active=0,r.forEach=n=>{for(let e=0,t=r.active;eObject(B.u)(e)):Object(B.u)(e.name,e.as)}function Filter(e){Transform.call(this,Object(B.t)(),e)}function Flatten(e){Transform.call(this,[],e)}function Fold(e){Transform.call(this,[],e)}function Formula(e){Transform.call(this,null,e)}function Generate(e){Transform.call(this,[],e)}Object(B.z)(DotBin,Transform,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=partition$1(t.source,e.groupby,B.y),i=e.smooth||!1,o=e.field,a=e.step||(c=n,g=o,Object(B.Z)(Object(B.q)(c,g))/30),s=stableCompare((e,t)=>o(e)-o(t)),A=e.as||"bin",l=r.length;var c,g;let u=1/0,d=-1/0,h=0,p;for(;hd&&(d=I),f[++p][A]=I}return this.value={start:u,stop:d,step:a},t.reflow(!0).modifies(A)}}),Object(B.z)(Expression,Operator),Extent.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(B.z)(Extent,Transform,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if(!i&&null!=o||(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,e=>{e=Object(B.eb)(r(e));null!=e&&(ea&&(a=e))}),!Number.isFinite(o)||!Number.isFinite(a)){let e=Object(B.h)(r);e=e&&` for field "${e}"`,t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),Object(B.z)(Subflow,Operator,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){--this.count,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),Object(B.z)(Facet,Transform,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o=Object(B.w)(i,e)&&i[e],a,s;return o?o.value.stampe&&0this.subflow(e,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,e=>{var t=tupleid(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))}),t.visit(t.ADD,e=>{var t=i(e);o.set(tupleid(e),t),s(t).add(e)}),a||t.modified(i.fields)?t.visit(t.MOD,e=>{var t=tupleid(e),n=o.get(t),r=i(e);n===r?s(r).mod(e):(o.set(t,r),s(n).rem(e),s(r).add(e))}):t.changed(t.MOD)&&t.visit(t.MOD,e=>{s(o.get(tupleid(e))).mod(e)}),a&&t.visit(t.REFLOW,e=>{var t=tupleid(e),n=o.get(t),r=i(e);n!==r&&(o.set(t,r),s(n).rem(e),s(r).add(e))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),Object(B.z)(Field,Operator),Filter.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(B.z)(Filter,Transform,{transform(i,e){const t=e.dataflow,o=this.value,n=e.fork(),a=n.add,s=n.rem,A=n.mod,l=i.expr;let c=!0;function revisit(e){var t=tupleid(e),n=l(e,i),r=o.get(t);n&&r?(o.delete(t),a.push(e)):n||r?c&&n&&!r&&A.push(e):(o.set(t,1),s.push(e))}return e.visit(e.REM,e=>{var t=tupleid(e);o.has(t)?o.delete(t):s.push(e)}),e.visit(e.ADD,e=>{l(e,i)?a.push(e):o.set(tupleid(e),1)}),e.visit(e.MOD,revisit),i.modified()&&(c=!1,e.visit(e.REFLOW,revisit)),o.empty>t.cleanThreshold&&t.runAfter(o.clean),n}}),Flatten.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},Object(B.z)(Flatten,Transform,{transform(e,t){const s=t.fork(t.NO_SOURCE),A=e.fields,l=fieldNames(A,e.as||[]),c=e.index||null,g=l.length;return s.rem=this.value,t.visit(t.SOURCE,t=>{const e=A.map(e=>e(t)),n=e.reduce((e,t)=>Math.max(e,t.length),0);let r=0,i,o,a;for(;r{for(let e=0,t;ee[r]=n(e,t))}}),Object(B.z)(Generate,Transform,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i=this.value,o=e.size-i.length,a,s,A;if(0=e&&(++r,i+=e);else{let e=-1;for(var o of t)null!=(o=n(o,++e,t))&&(o=+o)>=o&&(++r,i+=o)}if(r)return i/r},min:min_min,max:X.a},Ie=[];function Impute(e){Transform.call(this,[],e)}function JoinAggregate(e){Aggregate.call(this,e)}function KDE(e){Transform.call(this,null,e)}function Key(e){Operator.call(this,null,update$2,e)}function update$2(e){return this.value&&!e.modified()?this.value:Object(B.K)(e.fields,e.flat)}function Load(e){Transform.call(this,[],e),this._pending=null}function vega_transforms_module_output(e,t,n){n.forEach(ingest$1);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Lookup(e){Transform.call(this,{},e)}function MultiExtent(e){Operator.call(this,null,update$1,e)}function update$1(e){if(this.value&&!e.modified())return this.value;var t=e.extents,n=t.length;let r=1/0,i=-1/0,o,a;for(o=0;oi&&(i=a[1]);return[r,i]}function MultiValues(e){Operator.call(this,null,vega_transforms_module_update,e)}function vega_transforms_module_update(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function Params(e){Transform.call(this,null,e)}function Pivot(e){Aggregate.call(this,e)}function PreFacet(e){Facet.call(this,e)}function Project(e){Transform.call(this,null,e)}function Proxy(e){Transform.call(this,null,e)}function Quantile(e){Transform.call(this,null,e)}Impute.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Object(B.z)(Impute,Transform,{transform(e,t){for(var n,r,i,o,a,s,A,l,c=t.fork(t.ALL),g=function getValue(e){var t,n=e.method||fe.value;if(null!=fe[n])return n===fe.value?(t=void 0!==e.value?e.value:0,()=>t):fe[n];Object(B.o)("Unrecognized imputation method: "+n)}(e),u=function getField(e){const t=e.field;return e=>e?t(e):NaN}(e),d=Object(B.h)(e.field),h=Object(B.h)(e.key),p=(e.groupby||[]).map(B.h),f=function vega_transforms_module_partition(e,t,n,r){var i,o,a,s,A,l,c,g=e=>e(c),u=[],d=r?r.slice():[],h={},p={};for(d.forEach((e,t)=>h[e]=t+1),s=0,l=e.length;sn.add(e))):(i=n.value=n.value||this.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),n.changes(),t.visit(t.SOURCE,e=>{Object(B.p)(e,i[n.cellkey(e)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const e=vega_statistics_module_kde(n,l)[c],r=s.counts?n.length:1,t=i||Object(B.q)(n);sampleCurve(e,t,o,a).forEach(e=>{const t={};for(let e=0;e(this._pending=Object(B.i)(e.data),e=>e.touch(this)))}:n.request(e.url,e.format).then(e=>vega_transforms_module_output(this,t,Object(B.i)(e.data)))}}),Lookup.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(B.z)(Lookup,Transform,{transform(e,t){const o=e.fields,a=e.index,s=e.values,A=null==e.default?null:e.default,n=e.modified(),l=o.length;let r=n?t.SOURCE:t.ADD,i=t,c=e.as,g,u,d;return g=s?(u=s.length,1t.modified(e.fields)),r|=d?t.MOD:0),t.visit(r,g),i.modifies(c)}}),Object(B.z)(MultiExtent,Operator),Object(B.z)(MultiValues,Operator),Object(B.z)(Params,Transform,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Pivot.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:ue,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},Object(B.z)(Pivot,Aggregate,{_transform:Aggregate.prototype.transform,transform(e,t){return this._transform(function aggregateParams(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=Object(B.g)(n).concat(Object(B.g)(r)),a=function pivotKeys(t,e,n){const r={},i=[];return n.visit(n.SOURCE,e=>{e=t(e);r[e]||(r[e]=1,i.push(e))}),i.sort(B.j),e?i.slice(0,e):i}(n,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:a.map(()=>i),fields:a.map(e=>function vega_transforms_module_get(t,n,r,e){return Object(B.f)(e=>n(e)===t?r(e):NaN,e,t+"")}(e,n,r,o)),as:a.map(e=>e+""),modified:e.modified.bind(e)}}(e,t),t)}}),Object(B.z)(PreFacet,Facet,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(tupleid(e),n,t,e);return(e.modified("field")||r&&t.modified(Object(B.g)(r)))&&Object(B.o)("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,e=>{const t=i(e);r(e).forEach(e=>t.mod(e))}),t.visit(t.ADD,e=>{const t=i(e);r(e).forEach(e=>t.add(ingest$1(e)))}),t.visit(t.REM,e=>{const t=i(e);r(e).forEach(e=>t.rem(e))})):(t.visit(t.MOD,e=>i(e).mod(e)),t.visit(t.ADD,e=>i(e).add(e)),t.visit(t.REM,e=>i(e).rem(e))),t.clean()&&t.runAfter(()=>this.clean()),t}}),Project.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(B.z)(Project,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=fieldNames(e.fields,e.as||[]),o=r?(e,t)=>function vega_transforms_module_project(n,r,i,o){for(let e=0,t=i.length;e{e=tupleid(e);n.rem.push(a[e]),a[e]=null}),t.visit(t.ADD,e=>{var t=o(e,ingest$1({}));a[tupleid(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(o(e,a[tupleid(e)]))}),n}}),Object(B.z)(Proxy,Transform,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Quantile.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function Relay(e){Transform.call(this,null,e)}function Sample(e){Transform.call(this,[],e),this.count=0}function Sequence(e){Transform.call(this,null,e)}function Sieve(e){Transform.call(this,null,e),this.modified(!0)}function TimeUnit(e){Transform.call(this,null,e)}Object(B.z)(Quantile,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,o=partition$1(r,e.groupby,e.field),a=(e.groupby||[]).map(B.h),s=[],A=e.step||.01,l=e.probs||se(A/2,1-1e-14,A),c=l.length;return o.forEach(t=>{var n=quantiles(t,l);for(let e=0;e{e=tupleid(e);r.rem.push(i[e]),i[e]=null}),t.visit(t.ADD,e=>{var t=vega_dataflow_module_derive(e);i[tupleid(e)]=t,r.add.push(t)}),t.visit(t.MOD,e=>{const t=i[tupleid(e)];for(const n in e)t[n]=e[n],r.modifies(n);r.mod.push(t)})),r}}),Sample.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(B.z)(Sample,Transform,{transform(e,t){const r=t.fork(t.NO_SOURCE),n=e.modified("size"),i=e.size,o=this.value.reduce((e,t)=>(e[tupleid(t)]=1,e),{});let a=this.value,s=this.count,A=0;function update(e){var t,n;a.length=A&&(t=a[n],o[tupleid(t)]&&r.rem.push(t),a[n]=e),++s}if(t.rem.length&&(t.visit(t.REM,e=>{var t=tupleid(e);o[t]&&(o[t]=-1,r.rem.push(e)),--s}),a=a.filter(e=>-1!==o[tupleid(e)])),(t.rem.length||n)&&a.length{o[tupleid(e)]||update(e)}),A=-1),n&&a.length>i){var l=a.length-i;for(let e=0;e{o[tupleid(e)]&&r.mod.push(e)}),t.add.length&&t.visit(t.ADD,update),(t.add.length||A<0)&&(r.add=a.filter(e=>!o[tupleid(e)])),this.count=s,this.value=r.source=a,r}}),Sequence.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(B.z)(Sequence,Transform,{transform(e,t){if(!this.value||e.modified()){const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=se(e.start,e.stop,e.step||1).map(e=>{const t={};return t[r]=e,ingest$1(t)}),n.add=t.add.concat(this.value),n}}}),Object(B.z)(Sieve,Transform,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const Ce=["unit0","unit1"];function TupleIndex(e){Transform.call(this,Object(B.t)(),e)}function Values(e){Transform.call(this,null,e)}TimeUnit.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:h.j,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Ce}]},Object(B.z)(TimeUnit,Transform,{transform(e,t){const i=e.field,o=!1!==e.interval,n="utc"===e.timezone,a=this._floor(e,t),s=(n?h.v:h.p)(a.unit).offset,r=e.as||Ce,A=r[0],l=r[1],c=a.step;let g=a.start||1/0,u=a.stop||-1/0,d=t.ADD;return(e.modified()||t.modified(Object(B.g)(i)))&&(t=t.reflow(!0),d=t.SOURCE,g=1/0,u=-1/0),t.visit(d,e=>{var t=i(e);let n,r;null==t?(e[A]=null,o&&(e[l]=null)):(e[A]=n=r=a(t),o&&(e[l]=r=s(n,c)),nu&&(u=r))}),a.start=g,a.stop=u,t.modifies(o?r:A)},_floor(e,t){var n="utc"===e.timezone,{units:t,step:e}=e.units?{units:e.units,step:e.step||1}:Object(h.n)({extent:e.extent||Object(B.q)(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins});const r=Object(h.t)(t),i=this.value||{},o=(n?h.u:h.o)(r,e);return o.unit=Object(B.W)(r),o.units=r,o.step=e,o.start=i.start,o.stop=i.stop,this.value=o}}),Object(B.z)(TupleIndex,Transform,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,e=>i.delete(r(e))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),Object(B.z)(Values,Transform,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(stableCompare(e.sort)):t.source).map(e.field))}});const me={row_number:function(){return{next:e=>e.index+1}},rank:function(){let r;return{init:()=>r=1,next:e=>{var t=e.index,n=e.data;return t&&e.compare(n[t-1],n[t])?r=t+1:r}}},dense_rank:function(){let r;return{init:()=>r=1,next:e=>{var t=e.index,n=e.data;return t&&e.compare(n[t-1],n[t])?++r:r}}},percent_rank:function(){const e=me.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let i;return{init:()=>i=0,next:e=>{const t=e.data,n=e.compare;let r=e.index;if(iMath.ceil(t*r(e))}},lag:function(n,r){return r=+r||1,{next:e=>{var t=e.index-r;return 0<=t?n(e.data[t]):null}}},lead:function(n,r){return r=+r||1,{next:e=>{var t=e.index+r,e=e.data;return tt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(n,r){return 0<(r=+r)||Object(B.o)("nth_value nth must be greater than zero."),{next:e=>{var t=e.i0+(r-1);return tn=null,next:e=>{e=t(e.data[e.index]);return null!=e?n=e:n}}},next_value:function(n){let r,i;return{init:()=>(r=null,i=-1),next:e=>{var t=e.data;return e.index<=i?r:r=(i=function find(e,t,n){for(var r=t.length;nn[e]=1)}visitInputs(e.sort),t.forEach((t,e)=>{var n=o[e],r=Object(B.h)(n),i=measureName(t,r,s[e]);if(visitInputs(n),A.push(i),Object(B.w)(me,t))l.push(function WindowOp(e,t,n,r){const i=me[e](t,n);return{init:i.init||B.mb,update:function(e,t){t[r]=i.next(e)}}}(t,o[e],a[e],i));else if(null==n&&"count"!==t&&Object(B.o)("Null aggregate field specified."),"count"===t)g.push(i);else{d=!1;let e=c[r];e||((e=c[r]=[]).field=n,u.push(e)),e.push(createMeasure(t,i))}}),(g.length||u.length)&&(this.cell=function cell(e,r,i){e=e.map(e=>compileMeasures(e,e.field));const o={num:0,agg:null,store:!1,count:r};if(!i)for(var n=e.length,a=o.agg=Array(n),t=0;te.init()),this.cell&&this.cell.init()},Be.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!t||(a=this.state=new WindowState(n)),t||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,e=>o(e).add(e))):(e.visit(e.REM,e=>o(e).remove(e)),e.visit(e.ADD,e=>o(e).add(e)));for(let e=0,t=this._mlen;eDe&&(r=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,i=3*e._l01_a*(e._l01_a+e._l12_a),o=(o*r-e._x0*e._l12_2a+e._x2*e._l01_2a)/i,a=(a*r-e._y0*e._l12_2a+e._y2*e._l01_2a)/i),e._l23_a>De&&(r=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,i=3*e._l23_a*(e._l23_a+e._l12_a),s=(s*r+e._x1*e._l23_2a-t*e._l12_2a)/i,A=(A*r+e._y1*e._l23_2a-n*e._l12_2a)/i),e._context.bezierCurveTo(o,a,s,A,e._x2,e._y2)}function CatmullRom(e,t){this._context=e,this._alpha=t}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n,r;switch(e=+e,t=+t,this._point&&(n=this._x2-e,r=this._y2-t,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var n=function custom(t){function catmullRom(e){return t?new CatmullRom(e,t):new Cardinal(e,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function CatmullRomClosed(e,t){this._context=e,this._alpha=t}CatmullRomClosed.prototype={areaStart:lX0,areaEnd:lX0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){var n,r;switch(e=+e,t=+t,this._point&&(n=this._x2-e,r=this._y2-t,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Te=function custom(t){function catmullRom(e){return t?new CatmullRomClosed(e,t):new CardinalClosed(e,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function CatmullRomOpen(e,t){this._context=e,this._alpha=t}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n,r;switch(e=+e,t=+t,this._point&&(n=this._x2-e,r=this._y2-t,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Me=function custom(t){function catmullRom(e){return t?new CatmullRomOpen(e,t):new CardinalOpen(e,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function Linear(e){this._context=e}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Ue=function(e){return new Linear(e)};function LinearClosed(e){this._context=e}LinearClosed.prototype={areaStart:lX0,areaEnd:lX0,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function slope3(e,t,n){var r=e._x1-e._x0,t=t-e._x1,i=(e._y1-e._y0)/(r||t<0&&-0),n=(n-e._y1)/(t||r<0&&-0),e=(i*t+n*r)/(r+t);return((i<0?-1:1)+(n<0?-1:1))*Math.min(Math.abs(i),Math.abs(n),.5*Math.abs(e))||0}function slope2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function monotone_point(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function MonotoneX(e){this._context=e}function MonotoneY(e){this._context=new ReflectContext(e)}function ReflectContext(e){this._context=e}function Natural(e){this._context=e}function controlPoints(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(o[i[0]=0]=2,a[0]=e[0]+2*e[1],t=1;tPe?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=A)+","+(this._y1=l):1e-6=Oe)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Ve=path_path,i=function(e){return function constant(){return e}};function arcInnerRadius(e){return e.innerRadius}function arcOuterRadius(e){return e.outerRadius}function arcStartAngle(e){return e.startAngle}function arcEndAngle(e){return e.endAngle}function arcPadAngle(e){return e&&e.padAngle}function cornerTangents(e,t,n,r,i,o,a){var s=e-n,A=t-r,a=(a?o:-o)/Fe(s*s+A*A),A=a*A,a=-a*s,s=e+A,e=t+a,t=n+A,n=r+a,r=(s+t)/2,l=(e+n)/2,c=t-s,g=n-e,u=c*c+g*g,o=i-o,s=s*n-t*e,n=(g<0?-1:1)*Fe(_e(0,o*o*u-s*s)),t=(s*g-c*n)/u,e=(-s*c-g*n)/u,d=(s*g+c*n)/u,s=(-s*c+g*n)/u,c=t-r,g=e-l,n=d-r,u=s-l;return n*n+u*u>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?rgba(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?rgba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=rt.exec(e))?new Rgb(t[1],t[2],t[3],1):(t=it.exec(e))?new Rgb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ot.exec(e))?rgba(t[1],t[2],t[3],t[4]):(t=at.exec(e))?rgba(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=st.exec(e))?hsla(t[1],t[2]/100,t[3]/100,1):(t=At.exec(e))?hsla(t[1],t[2]/100,t[3]/100,t[4]):lt.hasOwnProperty(e)?rgbn(lt[e]):"transparent"===e?new Rgb(NaN,NaN,NaN,0):null}function rgbn(e){return new Rgb(e>>16&255,e>>8&255,255&e,1)}function rgba(e,t,n,r){return new Rgb(e=r<=0?t=n=NaN:e,t,n,r)}function rgbConvert(e){return(e=e instanceof Color?e:color_color(e))?new Rgb((e=e.rgb()).r,e.g,e.b,e.opacity):new Rgb}function color_rgb(e,t,n,r){return 1===arguments.length?rgbConvert(e):new Rgb(e,t,n,null==r?1:r)}function Rgb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function hex(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function hsla(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||1<=n?e=t=NaN:t<=0&&(e=NaN),new Hsl(e,t,n,r)}function hslConvert(e){if(e instanceof Hsl)return new Hsl(e.h,e.s,e.l,e.opacity);if(!(e=e instanceof Color?e:color_color(e)))return new Hsl;if(e instanceof Hsl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,A=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(no&&(i=r.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(t=t[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,A.push({i:a,x:ht(t,n)})),o=It.lastIndex;return oe).right(A,r);if(i===A.length)return s.every(Object(Ke.c)(e/bt.g,t/bt.g,n));if(0===i)return vt.a.every(Math.max(Object(Ke.c)(e,t,n),1));const[o,a]=A[r/A[i-1][2]()=>e;function src_color_linear(t,n){return function(e){return t+e*n}}function src_color_hue(e,t){var n=t-e;return n?src_color_linear(e,180o&&(i=r.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(t=t[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,A.push({i:a,x:Xt(t,n)})),o=en.lastIndex;return oi+a*e);return c(t?o.reverse():o)}return delete t.unknown,t.domain=function(e){return arguments.length?(l(e),rescale()):l()},t.range=function(e){return arguments.length?(g=[+e[0],+e[1]],rescale()):g.slice()},t.rangeRound=function(e){return g=[+e[0],+e[1]],s=!0,rescale()},t.bandwidth=function(){return u},t.step=function(){return a},t.round=function(e){return arguments.length?(s=!!e,rescale()):s},t.padding=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),A=d,rescale()):A},t.paddingInner=function(e){return arguments.length?(A=Math.max(0,Math.min(1,e)),rescale()):A},t.paddingOuter=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),rescale()):d},t.align=function(e){return arguments.length?(h=Math.max(0,Math.min(1,e)),rescale()):h},t.invertRange=function(o){if(null!=o[0]&&null!=o[1]){var a=g[1]g[1-a])))return n=Math.max(0,je(s,e)-1),r=e===t?n:je(s,t)-1,e-s[n]>u+1e-10&&++n,a&&(i=n,n=A-r,r=A-i),n>r?void 0:l().slice(n,r+1)}},t.invert=function(e){e=t.invertRange([e,e]);return e&&e[0]},t.copy=function(){return vega_scale_module_band().domain(l()).range(g).round(s).paddingInner(A).paddingOuter(d).align(h)},rescale()}var nr=Array.prototype.map;const rr=Array.prototype.slice;const ir={};function vega_scale_module_create(t,n,e){var r=function scale(){const e=n();return e.invertRange||(e.invertRange=e.invert?function invertRange(i){return function(e){let t=e[0],n=e[1],r;return n=n&&t[s]<=r&&(i<0&&(i=s),o=s);if(!(i<0))return n=l.invertExtent(t[i]),r=l.invertExtent(t[o]),[void 0===n[0]?n[1]:n[0],void 0===r[1]?r[0]:r[1]]}}(e):void 0),e.type=t,e};return r.metadata=Object(B.fb)(Object(B.i)(e)),r}function vega_scale_module_scale(e,t,n){return 1t[e]?a[e](t[e]()):0),a):Object(B.m)(.5)}function vega_scale_module_interpolate(e,t){const n=r[function vega_scale_module_method(e){return"interpolate"+e.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function vega_scale_module_colors(t){const n=t.length/6|0,r=new Array(n);for(let e=0;einterpolateColors(vega_scale_module_colors(e)));const sr="symbol",Ar=e=>Object(B.B)(e)?e.map(e=>String(e)):String(e),lr=(e,t)=>e[1]-t[1],cr=(e,t)=>t[1]-e[1];function tickCount(e,t,n){let r;return Object(B.G)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Object(B.Z)(e.domain())/n||1)))),Object(B.H)(t)&&(r=t.step,t=t.interval),Object(B.J)(t)&&(t=e.type===Ln?Object(h.p)(t):e.type==Pn?Object(h.v)(t):Object(B.o)("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function validTicks(t,e,n){let r=t.range(),i=r[0],o=Object(B.W)(r),a=lr;if(i>o&&(r=o,o=i,i=r,a=cr),i=Math.floor(i),o=Math.ceil(o),e=e.map(e=>[e,t(e)]).filter(e=>i<=e[1]&&e[1]<=o).sort(a).map(e=>e[0]),0n&&3<=e.length;)e=e.filter((e,t)=>!(t%2));e.length<3&&(e=s)}return e}function tickValues(e,t){return e.bins?validTicks(e,e.bins):e.ticks?e.ticks(t):e.domain()}function vega_scale_module_tickFormat(e,t,n,r,i,o){var a=t.type;let s=Ar;if(a===Ln||i===Ln)s=e.timeFormat(r);else if(a===Pn||i===Pn)s=e.utcFormat(r);else if(isLogarithmic(a)){const A=e.formatFloat(r);if(o||t.bins)s=A;else{const l=tickLog(t,n,!1);s=e=>l(e)?A(e):""}}else t.tickFormat?(i=t.domain(),s=e.formatSpan(i[0],i[i.length-1],n,r)):r&&(s=e.format(r));return s}function tickLog(e,t,n){const r=tickValues(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length);e=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*i{t=dr(n[t+1],dr(n.max,1/0)),n=hr(e,l),e=hr(t,l);return n&&e?n+" – "+e:e?"< "+e:"≥ "+n}):"discrete"===r?(A=e,(e,t)=>t?A(e):null):(s=e,e=>s(e))}const dr=(e,t)=>null!=e?e:t,hr=(e,t)=>Number.isFinite(e)?t(e):null;function vega_scale_module_format(e,t,n,r){var i=r||t.type;return(n=Object(B.J)(n)&&function isTemporal(e){return hasType(e,tr)}(i)?n.replace(/%a/g,"%A").replace(/%b/g,"%B"):n)||i!==Ln?n||i!==Pn?labelFormat(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function domainCaption(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=vega_scale_module_format(e,t,n.format,n.formatType);if(isDiscretizing(t.type)){const o=labelValues(t).slice(1).map(i),a=o.length;return"".concat(a," boundar").concat(1===a?"y":"ies",": ").concat(o.join(", "))}if(isDiscrete(t.type)){const s=t.domain(),A=s.length,l=rs){const g=i.length;for(l=1,t.push([a].concat(i.slice(l,l+=s))),a="M"===a?"L":"m"===a?"l":a;l+e}function vega_scenegraph_module_clamp(e,t,n){return Math.max(t,Math.min(e,n))}function vg_rect(){var c=rectangleX,g=rectangleY,u=rectangleWidth,d=rectangleHeight,h=vega_scenegraph_module_number(0),p=h,f=h,I=h,C=null;function rectangle(e,t,n){var r,t=null!=t?t:+c.call(this,e),n=null!=n?n:+g.call(this,e),i=+u.call(this,e),o=+d.call(this,e),a=Math.min(i,o)/2,s=vega_scenegraph_module_clamp(+h.call(this,e),0,a),A=vega_scenegraph_module_clamp(+p.call(this,e),0,a),l=vega_scenegraph_module_clamp(+f.call(this,e),0,a),e=vega_scenegraph_module_clamp(+I.call(this,e),0,a);if(C=C||(r=Ve()),s<=0&&A<=0&&l<=0&&e<=0?C.rect(t,n,i,o):(a=t+i,i=n+o,C.moveTo(t+s,n),C.lineTo(a-A,n),C.bezierCurveTo(a-Rr*A,n,a,n+Rr*A,a,n+A),C.lineTo(a,i-e),C.bezierCurveTo(a,i-Rr*e,a-Rr*e,i,a-e,i),C.lineTo(t+l,i),C.bezierCurveTo(t+Rr*l,i,t,i-Rr*l,t,i-l),C.lineTo(t,n+s),C.bezierCurveTo(t,n+Rr*s,t+Rr*s,n,t+s,n),C.closePath()),r)return C=null,r+""||null}return rectangle.x=function(e){return arguments.length?(c=vega_scenegraph_module_number(e),rectangle):c},rectangle.y=function(e){return arguments.length?(g=vega_scenegraph_module_number(e),rectangle):g},rectangle.width=function(e){return arguments.length?(u=vega_scenegraph_module_number(e),rectangle):u},rectangle.height=function(e){return arguments.length?(d=vega_scenegraph_module_number(e),rectangle):d},rectangle.cornerRadius=function(e,t,n,r){return arguments.length?(h=vega_scenegraph_module_number(e),p=null!=t?vega_scenegraph_module_number(t):h,I=null!=n?vega_scenegraph_module_number(n):h,f=null!=r?vega_scenegraph_module_number(r):p,rectangle):h},rectangle.context=function(e){return arguments.length?(C=null==e?null:e,rectangle):C},rectangle}function vg_trail(){var a,s,A,l,c,g,u,d,h=null;function trail(e){var t,n,r,i=e.length,o=!1;for(null==h&&(h=r=Ve()),t=0;t<=i;++t)!(te.x||0,o=e=>e.y||0,q=e=>!(!1===e.defined);Nr=arcInnerRadius,kr=arcOuterRadius,Tr=i(0),Ur=arcStartAngle,Or=arcEndAngle,Lr=arcPadAngle,_=Mr=null,arc.centroid=function(){var e=(+Nr.apply(this,arguments)+ +kr.apply(this,arguments))/2,t=(+Ur.apply(this,arguments)+ +Or.apply(this,arguments))/2-Ge/2;return[Se(t)*e,Re(t)*e]},arc.innerRadius=function(e){return arguments.length?(Nr="function"==typeof e?e:i(+e),arc):Nr},arc.outerRadius=function(e){return arguments.length?(kr="function"==typeof e?e:i(+e),arc):kr},arc.cornerRadius=function(e){return arguments.length?(Tr="function"==typeof e?e:i(+e),arc):Tr},arc.padRadius=function(e){return arguments.length?(Mr=null==e?null:"function"==typeof e?e:i(+e),arc):Mr},arc.startAngle=function(e){return arguments.length?(Ur="function"==typeof e?e:i(+e),arc):Ur},arc.endAngle=function(e){return arguments.length?(Or="function"==typeof e?e:i(+e),arc):Or},arc.padAngle=function(e){return arguments.length?(Lr="function"==typeof e?e:i(+e),arc):Lr},arc.context=function(e){return arguments.length?(_=null==e?null:e,arc):_};const Pr=arc.startAngle(e=>e.startAngle||0).endAngle(e=>e.endAngle||0).padAngle(e=>e.padAngle||0).innerRadius(e=>e.innerRadius||0).outerRadius(e=>e.outerRadius||0).cornerRadius(e=>e.cornerRadius||0),Vr=UX0().x(He).y1(o).y0(e=>(e.y||0)+(e.height||0)).defined(q),Zr=UX0().y(o).x1(He).x0(e=>(e.x||0)+(e.width||0)).defined(q),Wr=TX0().x(He).y(o).defined(q),Hr=vg_rect().x(He).y(o).width(e=>e.width||0).height(e=>e.height||0).cornerRadius(e=>value$1(e.cornerRadiusTopLeft,e.cornerRadius)||0,e=>value$1(e.cornerRadiusTopRight,e.cornerRadius)||0,e=>value$1(e.cornerRadiusBottomRight,e.cornerRadius)||0,e=>value$1(e.cornerRadiusBottomLeft,e.cornerRadius)||0),jr=(Gr=null,Fr="function"==typeof Fr?Fr:i(Fr||We),Dr="function"==typeof Dr?Dr:i(void 0===Dr?64:+Dr),symbol.type=function(e){return arguments.length?(Fr="function"==typeof e?e:i(e),symbol):Fr},symbol.size=function(e){return arguments.length?(Dr="function"==typeof e?e:i(+e),symbol):Dr},symbol.context=function(e){return arguments.length?(Gr=null==e?null:e,symbol):Gr},symbol.type(e=>vega_scenegraph_module_symbols(e.shape||"circle")).size(e=>value$1(e.size,64))),Yr=vg_trail().x(He).y(o).defined(q).size(e=>e.size||1);function symbol(){var e;if(Gr=Gr||(e=Ve()),Fr.apply(this,arguments).draw(Gr,+Dr.apply(this,arguments)),e)return Gr=null,e+""||null}function arc(){var e,t,n,r,i,o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b=+Nr.apply(this,arguments),v=+kr.apply(this,arguments),E=Ur.apply(this,arguments)-Ne,Q=Or.apply(this,arguments)-Ne,w=Qe(Q-E),S=EDe?(r+=g*=S?1:-1,i-=g):(o=0,r=i=(E+Q)/2),(a-=2*u)>De?(t+=u*=S?1:-1,n-=u):(a=0,t=n=(E+Q)/2)),c=v*Se(t),g=v*Re(t),u=b*Se(i),E=b*Re(i),Dethis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){e=this.rotatedPoints(e,t,n);return this.clear().add(e[0],e[1]).add(e[2],e[3]).add(e[4],e[5]).add(e[6],e[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),e=Math.sin(e),A=t-t*s+n*e,t=n-t*e-n*s;return[s*r-e*i+A,e*r+s*i+t,s*r-e*a+A,e*r+s*a+t,s*o-e*i+A,e*o+s*i+t,s*o-e*a+A,e*o+s*a+t]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},Object(B.z)(GroupItem,Item),ResourceLoader.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return increment(t),t._loader.sanitize(e,{context:"href"}).then(e=>(decrement(t),e)).catch(()=>(decrement(t),null))},loadImage(e){const r=this,i="undefined"!=typeof Image?Image:null;return increment(r),r._loader.sanitize(e,{context:"image"}).then(e=>{var t=e.href;if(!t||!i)throw{url:t};const n=new i;e=Object(B.w)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=e&&(n.crossOrigin=e),n.onload=()=>decrement(r),n.onerror=()=>decrement(r),n.src=t,n}).catch(e=>(decrement(r),{complete:!1,width:0,height:0,src:e&&e.url||""}))},ready(){const n=this;return new Promise(t=>{!function poll(e){n.pending()?setTimeout(()=>{poll(!0)},10):t(e)}(!1)})}};const Jr=Br-1e-8;let Kr,Xr,qr,$r,ei,ti,ni,ri;const ii=(e,t)=>Kr.add(e,t),oi=(e,t)=>ii(Xr=e,qr=t),ai=e=>ii(e,Kr.y1),si=e=>ii(Kr.x1,e),Ai=(e,t)=>ei*e+ni*t,li=(e,t)=>ti*e+ri*t,ci=(e,t)=>ii(Ai(e,t),li(e,t)),gi=(e,t)=>oi(Ai(e,t),li(e,t));function boundContext(e,t){return Kr=e,t?($r=t*mr,ei=ri=Math.cos($r),ti=Math.sin($r),ni=-ti):(ei=ri=1,$r=ti=ni=0),ui}const ui={beginPath(){},closePath(){},moveTo:gi,lineTo:gi,rect(e,t,n,r){$r?(ci(e+n,t),ci(e+n,t+r),ci(e,t+r),gi(e,t)):(ii(e+n,t+r),oi(e,t))},quadraticCurveTo(e,t,n,r){var i=Ai(e,t),e=li(e,t),t=Ai(n,r),n=li(n,r);quadExtrema(Xr,i,t,ai),quadExtrema(qr,e,n,si),oi(t,n)},bezierCurveTo(e,t,n,r,i,o){var a=Ai(e,t),e=li(e,t),t=Ai(n,r),n=li(n,r),r=Ai(i,o),i=li(i,o);cubicExtrema(Xr,a,t,r,ai),cubicExtrema(qr,e,n,i,si),oi(r,i)},arc(n,r,i,o,a,s){if(o+=$r,a+=$r,Xr=i*Math.cos(a)+n,qr=i*Math.sin(a)+r,Math.abs(a-o)>Jr)ii(n-i,r-i),ii(n+i,r+i);else{var A=e=>ii(i*Math.cos(e)+n,i*Math.sin(e)+r);let e,t;if(A(o),A(a),a!==o)if((o%=Br)<0&&(o+=Br),(a%=Br)<0&&(a+=Br),aa;++t,e-=yr)A(e);else for(e=o-o%yr+yr,t=0;t<4&&eu)return!1;p>g&&(g=p)}else if(0{n&&!n.intersects(e.bounds)||drawPath(r,t,e,e)})}}function drawPath(e,t,n,r){var i=null==n.opacity?1:n.opacity;0===i||e(t,r)||(blend(t,n),n.fill&&fill(t,n,i)&&t.fill(),n.stroke&&stroke(t,n,i)&&t.stroke())}function pick$1(s){return s=s||B.ib,function(n,e,r,i,o,a){return r*=n.pixelRatio,i*=n.pixelRatio,pickVisit(e,e=>{const t=e.bounds;if((!t||t.contains(o,a))&&t)return s(n,e,r,i,o,a)?e:void 0})}}function hitPath(A,l){return function(e,t,n,r){var i,o=Array.isArray(t)?t[0]:t,a=null==l?o.fill:l,s=o.stroke&&e.isPointInStroke;return s&&(i=o.strokeWidth,o=o.strokeCap,e.lineWidth=null!=i?i:1,e.lineCap=null!=o?o:"butt"),!A(e,t)&&(a&&e.isPointInPath(n,r)||s&&e.isPointInStroke(n,r))}}function pickPath(e){return pick$1(hitPath(e))}function translateItem(e){return"translate("+(e.x||0)+","+(e.y||0)+")"}function transformItem(e){return"translate("+(e.x||0)+","+(e.y||0)+")"+(e.angle?" rotate("+e.angle+")":"")+(e.scaleX||e.scaleY?" "+function vega_scenegraph_module_scale(e,t){return"scale("+e+","+t+")"}(e.scaleX||1,e.scaleY||1):"")}function markItemPath(e,o,t){function draw(e,t){var n=t.x||0,r=t.y||0,i=t.angle||0;e.translate(n,r),i&&e.rotate(i*=mr),e.beginPath(),o(e,t),i&&e.rotate(-i),e.translate(-n,-r)}return{type:e,tag:"path",nested:!1,attr:function attr(e,t){e("transform",function rotateItem(e){return"translate("+(e.x||0)+","+(e.y||0)+")"+(e.angle?" rotate("+e.angle+")":"")}(t)),e("d",o(null,t))},bound:function bound(e,t){return o(boundContext(e,t.angle),t),boundStroke(e,t).translate(t.x||0,t.y||0)},draw:drawAll(draw),pick:pickPath(draw),isect:t||intersectPath(draw)}}le=markItemPath("arc",function arc$1(e,t){return Pr.context(e)(t)});function markMultiItemPath(e,n,t){function draw(e,t){e.beginPath(),n(e,t)}const s=hitPath(draw);return{type:e,tag:"path",nested:!0,attr:function attr(e,t){(t=t.mark.items).length&&e("d",n(null,t))},bound:function bound(e,t){return 0===(t=t.items).length?e:(n(boundContext(e),t),boundStroke(e,t[0]))},draw:function drawOne(r){return function(e,t,n){!t.items.length||n&&!n.intersects(t.bounds)||drawPath(r,e,t.items[0],t.items)}}(draw),pick:function pick(e,t,n,r,i,o){var a=t.items,t=t.bounds;return!a||!a.length||t&&!t.contains(i,o)?null:(n*=e.pixelRatio,r*=e.pixelRatio,s(e,a,n,r)?a[0]:null)},isect:intersectPoint,tip:t}}be=markMultiItemPath("area",function area$1(e,t){var n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Zr:Vr).curve(curves(r,n.orient,n.tension)).context(e)(t)},function pickArea(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;0<=--a;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)){var t=e.x||0,n=e.y||0,r=e.strokeForeground,i=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&i&&(rectanglePath(o,e,t,n),blend(o,e),e.fill&&fill(o,e,i)&&o.fill(),e.stroke&&!r&&stroke(o,e,i)&&o.stroke()),o.save(),o.translate(t,n),e.clip&&clipGroup(o,e),a&&a.translate(-t,-n),vega_scenegraph_module_visit(e,e=>{this.draw(o,e,a)}),a&&a.translate(t,n),o.restore(),r&&e.stroke&&i&&(rectanglePath(o,e,t,n),blend(o,e),stroke(o,e,i)&&o.stroke())})},pick:function pick(A,l,c,g,u,d){if(l.bounds&&!l.bounds.contains(u,d)||!l.items)return null;const h=c*A.pixelRatio,p=g*A.pixelRatio;return pickVisit(l,e=>{let t,n,r;const i=e.bounds;if(!i||i.contains(u,d)){n=e.x||0,r=e.y||0;var o=n+(e.width||0),a=r+(e.height||0),s=e.clip;if(!s||!(ufunction pickMark(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,n,r)?this.pick(e,c,g,n,r):null))&&a&&(e.fill||!o&&e.stroke)&&fi(A,e,h,p)&&(t=e),A.restore(),t||null)}}})},isect:intersectRect,content:function content(e,t,n){e("clip-path",t.clip?clip$1(n,t,t):null)},background:function background(e,t){e("class","background"),e("aria-hidden",!0),emitRectangle(e,t)},foreground:function foreground(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?emitRectangle(e,t):e("d","")}},mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function getImage(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function imageWidth(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function imageHeight(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function imageXOffset(e,t){return"center"===e?t/2:"right"===e?t:0}function imageYOffset(e,t){return"middle"===e?t/2:"bottom"===e?t:0}Ee={type:"image",tag:"image",nested:!1,attr:function attr$4(e,t,n){const r=getImage(t,n),i=imageWidth(t,r),o=imageHeight(t,r),a=(t.x||0)-imageXOffset(t.align,i),s=(t.y||0)-imageYOffset(t.baseline,o),A=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",A,mi["xmlns:xlink"],"xlink:href"),e("transform","translate("+a+","+s+")"),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function bound$4(e,t){var n=t.image,r=imageWidth(t,n),n=imageHeight(t,n),i=(t.x||0)-imageXOffset(t.align,r),t=(t.y||0)-imageYOffset(t.baseline,n);return e.set(i,t,i+r,t+n)},draw:function draw$3(c,e,t){vega_scenegraph_module_visit(e,A=>{if(!t||t.intersects(A.bounds)){var l=getImage(A,this);let a=imageWidth(A,l),s=imageHeight(A,l);if(0!==a&&0!==s){let e=(A.x||0)-imageXOffset(A.align,a),t=(A.y||0)-imageYOffset(A.baseline,s),n,r,i,o;!1!==A.aspect&&(r=l.width/l.height,i=A.width/A.height,r==r&&i==i&&r!=i&&(i{var t;r&&!r.intersects(e.bounds)||(t=null==e.opacity?1:e.opacity)&&vega_scenegraph_module_path(n,e,t)&&(blend(n,e),n.stroke())})},pick:pick$1(function hit$1(e,t,n,r){return!!e.isPointInStroke&&(vega_scenegraph_module_path(e,t,1)&&e.isPointInStroke(n,r))}),isect:intersectRule},He=markItemPath("shape",function shape$1(e,t){return(t.mark.shape||t.shape).context(e)(t)}),o=markItemPath("symbol",function symbol$1(e,t){return jr.context(e)(t)},intersectPoint);const yi=Object(B.N)();var Bi={height:vega_scenegraph_module_fontSize,measureWidth:measureWidth,estimateWidth:estimateWidth,width:estimateWidth,canvas:useCanvas};function useCanvas(e){Bi.width=e&&di?measureWidth:estimateWidth}function estimateWidth(e,t){return _estimateWidth(textValue(e,t),vega_scenegraph_module_fontSize(e))}function _estimateWidth(e,t){return~~(.8*e.length*t)}function measureWidth(e,t){return vega_scenegraph_module_fontSize(e)<=0||!(t=textValue(e,t))?0:_measureWidth(t,vega_scenegraph_module_font(e))}function _measureWidth(e,t){var n=`(${t}) `+e;let r=yi.get(n);return void 0===r&&(di.font=t,r=di.measureText(e).width,yi.set(n,r)),r}function vega_scenegraph_module_fontSize(e){return null!=e.fontSize?+e.fontSize||0:11}function lineHeight(e){return null!=e.lineHeight?e.lineHeight:vega_scenegraph_module_fontSize(e)+2}function textLines(e){return function lineArray(e){return!Object(B.B)(e)||1_measureWidth(e,t)}{const n=vega_scenegraph_module_fontSize(e);return e=>_estimateWidth(e,n)}}}(e);if(r(t)>>1,r(t.slice(i))>n?a=i+1:s=i;return o+t.slice(a)}for(;a>>1),r(t.slice(0,i))Math.max(e,Bi.width(n,t)),0)):Bi.width(n,l);if("center"===i?s-=l/2:"right"===i&&(s-=l),e.set(s+=a,A+=o,s+l,A+r),n.angle&&!t)e.rotate(n.angle*mr,a,o);else if(2===t)return e.rotatedPoints(n.angle*mr,a,o);return e}var Ei={arc:le,area:be,group:ve,image:Ee,line:n,path:Te,rect:Me,rule:We,shape:He,symbol:o,text:{type:"text",tag:"text",nested:!1,attr:function attr(e,t){var n,r=t.dx||0,i=(t.dy||0)+vega_scenegraph_module_offset(t),o=(a=anchorPoint(t)).x1,a=a.y1,s=t.angle||0;e("text-anchor",bi[t.align]||"start"),s?(n="translate("+o+","+a+") rotate("+s+")",(r||i)&&(n+=" translate("+r+","+i+")")):n="translate("+(o+r)+","+(a+i)+")",e("transform",n)},bound:vega_scenegraph_module_bound,draw:function draw(l,e,c){vega_scenegraph_module_visit(e,e=>{var t,n,r,i,o,a,s,A=null==e.opacity?1:e.opacity;if(!(c&&!c.intersects(e.bounds)||0===A||e.fontSize<=0||null==e.text||0===e.text.length)){if(l.font=vega_scenegraph_module_font(e),l.textAlign=e.align||"left",n=(t=anchorPoint(e)).x1,r=t.y1,e.angle&&(l.save(),l.translate(n,r),l.rotate(e.angle*mr),n=r=0),n+=e.dx||0,r+=(e.dy||0)+vega_scenegraph_module_offset(e),a=textLines(e),blend(l,e),Object(B.B)(a))for(o=lineHeight(e),i=0;i{const t=new MouseEvent(i.type,i),n=domCreate(null,"a");for(const r in e)n.setAttribute(r,e[r]);n.dispatchEvent(t)}).catch(()=>{})},handleTooltip(e,t,n){t&&null!=t.tooltip&&(t=function resolveItem(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=Ei[a.marktype]).tip){for((o=vega_scenegraph_module_point(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin),n=n&&t&&t.tooltip||null,this._tooltip.call(this._obj,this,e,t,n))},getItemBoundingClientRect(n){const r=this.canvas();if(r){const i=r.getBoundingClientRect(),o=this._origin,a=n.bounds,s=a.width(),A=a.height();let e=a.x1+o[0]+i.left,t=a.y1+o[1]+i.top;for(;n.mark&&(n=n.mark.group);)e+=n.x||0,t+=n.y||0;return{x:e,y:t,width:s,height:A,left:e,top:t,right:e+s,bottom:t+A}}}},vega_scenegraph_module_Renderer.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,e=n._loader[e](t);if(!n._ready){const r=n._call;n._ready=n._loader.ready().then(e=>{e&&r(),n._ready=null})}return e},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Si="dragleave";const _i="mousedown";const xi="mousemove",Ri="mouseout";const Fi="click";const Di="mousewheel",Gi="touchstart",Ni="touchmove",ki="touchend";q=["keydown","keypress","keyup","dragenter",Si,"dragover",_i,"mouseup",xi,Ri,"mouseover",Fi,"dblclick","wheel",Di,Gi,Ni,ki];const Ti=xi,Mi=Ri;Fi;function CanvasHandler(e,t){vega_scenegraph_module_Handler.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function eventListenerCheck(t,e){((e=e)===Gi||e===Ni||e===ki?[Gi,Ni,ki]:[e]).forEach(e=>function addEventListener(t,n){const e=t.canvas();e&&!t._events[n]&&(t._events[n]=1,e.addEventListener(n,t[n]?e=>t[n](e):e=>t.fire(n,e)))}(t,e))}function move(r,i,o){return function(e){var t=this._active,n=this.pickEvent(e);n!==t&&(t&&t.exit||this.fire(o,e),this._active=n,this.fire(i,e)),this.fire(r,e)}}function inactive(t){return function(e){this.fire(t,e),this._active=null}}Object(B.z)(CanvasHandler,vega_scenegraph_module_Handler,{initialize(e,t,n){return this._canvas=e&&domFind(e,"canvas"),[Fi,_i,xi,Ri,Si].forEach(e=>eventListenerCheck(this,e)),vega_scenegraph_module_Handler.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:q,DOMMouseScroll(e){this.fire(Di,e)},mousemove:move(xi,"mouseover",Ri),dragover:move("dragover","dragenter",Si),mouseout:inactive(Ri),dragleave:inactive(Si),mousedown(e){this._down=this._active,this.fire(_i,e)},click(e){this._down===this._active&&(this.fire(Fi,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Gi,e,!0)},touchmove(e){this.fire(Ni,e,!0)},touchend(e){this.fire(ki,e,!0),this._touch=null},fire(e,n,t){const r=t?this._touch:this._active,i=this._handlers[e];if("click"===(n.vegaType=e)&&r&&r.href?this.handleHref(n,r,r.href):e!==Ti&&e!==Mi||this.handleTooltip(n,r,e!==Mi),i)for(let e=0,t=i.length;e{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=Li(n,(e,t)=>{n.handleTooltip(e,t,e.type!==Mi)})}Object(B.z)(CanvasRenderer,vega_scenegraph_module_Renderer,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:domCanvas(1,1,this._options.type),e&&this._canvas&&(domClear(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Oi.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(Oi.resize.call(this,e,t,n,r),this._canvas)!function resize(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),A=a?Ui:i;e.width=t*A,e.height=n*A;for(const l in o)s[l]=o[l];a&&1!==A&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=A,s.setTransform(A,0,0,A,A*r[0],A*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const i=this._options.externalContext;i||Object(B.o)("CanvasRenderer is missing a valid canvas or context"),i.scale(this._scale,this._scale),i.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=(s=n,l=r,A=i,(new Bounds).set(0,0,l,A).translate(-s[0],-s[1]));t.save();var s,A,l=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function clipToBounds(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,l),t.restore(),o.clear(),this},draw(e,t,n){const r=Ei[t.marktype];t.clip&&!function vega_scenegraph_module_clip(e,t){var n=t.clip;e.save(),Object(B.E)(n)?(e.beginPath(),n(e),e.clip()):clipGroup(e,t.group)}(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});const Li=(n,r)=>e=>{let t=e.target.__data__;t=Array.isArray(t)?t[0]:t,e.vegaType=e.type,r.call(n._obj,e,t)},Pi=(Object(B.z)(SVGHandler,vega_scenegraph_module_Handler,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener("click",this._hrefHandler),r.removeEventListener(Ti,this._tooltipHandler),r.removeEventListener(Mi,this._tooltipHandler)),this._svg=r=e&&domFind(e,"svg"),r&&(r.addEventListener("click",this._hrefHandler),r.addEventListener(Ti,this._tooltipHandler),r.addEventListener(Mi,this._tooltipHandler)),vega_scenegraph_module_Handler.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers,i=this._handlerIndex(r[n],e,t);return i<0&&(e={type:e,handler:t,listener:Li(this,t)},(r[n]||(r[n]=[])).push(e),this._svg&&this._svg.addEventListener(n,e.listener)),this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return 0<=i&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}}),"aria-hidden"),Vi="aria-label",Zi="aria-roledescription",Wi="graphics-object",Hi="graphics-symbol",ji=(e,t,n)=>({role:e,"aria-roledescription":t,"aria-label":n||void 0}),Yi=Object(B.fb)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),zi={axis:{desc:"axis",caption:function axisCaption(e){const t=e.datum,n=e.orient,r=t.title?extractTitle(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type,A="left"===n||"right"===n?"Y":"X";return A+"-axis"+(r?` titled '${r}'`:"")+` for a ${isDiscrete(s)?"discrete":s} scale`+" with "+domainCaption(a,o,e)}},legend:{desc:"legend",caption:function legendCaption(e){const t=e.datum,n=t.title?extractTitle(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,A=a.dataflow.locale();return function capitalize(e){return e.length?e[0].toUpperCase()+e.slice(1):e}(r)+(n?` titled '${n}'`:"")+" for "+function channelCaption(e){return(e=e.map(e=>e+("fill"===e||"stroke"===e?" color":""))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Object(B.W)(e)}(o)+" with "+domainCaption(A,s,e)}},"title-text":{desc:"title",caption:e=>`Title text '${titleCaption(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${titleCaption(e)}'`}},Ji={ariaRole:"role",ariaRoleDescription:Zi,description:Vi};function ariaItemAttributes(e,t){var n=!1===t.aria;if(e(Pi,n||void 0),n||null==t.description)for(const r in Ji)e(Ji[r],void 0);else{n=t.mark.marktype;e(Vi,t.description),e("role",t.ariaRole||("group"===n?Wi:Hi)),e(Zi,t.ariaRoleDescription||n+" mark")}}function ariaMarkAttributes(e){return!1===e.aria?{"aria-hidden":!0}:Yi[e.role]?null:zi[e.role]?function ariaGuide(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return ji(t.role||Hi,t.desc,n.description||r(n))}catch(e){return null}}(e,zi[e.role]):function ariaMark(e){var t=e.marktype,n="group"===t||"text"===t||e.items.some(e=>null!=e.description&&!1!==e.aria);return ji(n?Wi:Hi,t+" mark container",e.description)}(e)}function titleCaption(e){return Object(B.i)(e.text).join(" ")}function extractTitle(e){try{return Object(B.i)(Object(B.W)(e.items).items[0].text).join(" ")}catch(e){return null}}const Ki=e=>(e+"").replace(/&/g,"&").replace(//g,">"),Xi=e=>Ki(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function markup(){let o="",a="",s="";const A=[],l=()=>a=s="",c=(e,t)=>(null!=t&&(a+=` ${e}="${Xi(t)}"`),g),g={open(e,...t){var n;n=e,a&&(o+=a+">"+s,l()),A.push(n),a="<"+e;for(const r of t)for(const i in r)c(i,r[i]);return g},close(){var e=A.pop();return a?o+=a+(s?`>${s}`:"/>"):o+=``,l(),g},attr:c,text:e=>(s+=Ki(e),g),toString:()=>o};return g}const qi=e=>function _serialize(t,e){t.open(e.tagName);if(e.hasAttributes()){const n=e.attributes,r=n.length;for(let e=0;e{e.dirty=t})),r.zdirty||(n.exit?(o.nested&&r.items.length?(A=r.items[0])._svg&&this._update(o,A._svg,A):n._svg&&(A=n._svg.parentNode)&&A.removeChild(n._svg),n._svg=null):(n=o.nested?r.items[0]:n)._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,dirtyParents(n,t)),n._update=t));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=Ei[t.marktype],o=!1===t.interactive?"none":null,a="g"===i.tag;let s=null,A=0;const l=vega_scenegraph_module_bind(t,e,n,"g",r);l.setAttribute("class",cssClass(t));var c=ariaMarkAttributes(t);for(const g in c)setAttribute(l,g,c[g]);a||setAttribute(l,"pointer-events",o),setAttribute(l,"clip-path",t.clip?clip$1(this,t,t.group):null);e=e=>{var t=this.isDirty(e),n=vega_scenegraph_module_bind(e,l,s,i.tag,r);t&&(this._update(i,n,e),a&&function recurse(t,n,e){n=n.lastChild.previousSibling;let r,i=0;vega_scenegraph_module_visit(e,e=>{r=t.mark(n,e,r),++i}),domClear(n,1+i)}(this,n,e)),s=n,++A};return i.nested?t.items.length&&e(t.items[0]):vega_scenegraph_module_visit(t,e),domClear(l,A),l},_update(e,t,n){io=t,oo=t.__values__,ariaItemAttributes(emit,n),e.attr(emit,n,this);const r=ao[e.type];r&&r.call(this,e,t,n),io&&this.style(io,n)},style(t,n){if(null!=n)for(const i in $i){let e="font"===i?fontFamily(n):n[i];var r;e!==oo[i]&&(r=$i[i],null==e?t.removeAttribute(r):(isGradient(e)&&(e=gradientRef(e,this._defs.gradient,vega_scenegraph_module_href())),t.setAttribute(r,e+"")),oo[i]=e)}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=domChild(e,1,"defs",no)),r=function updateGradient(e,t,n){let r,i,o;{var a;"radial"===t.gradient?(setAttributes(a=domChild(e,n++,"pattern",no),{id:"p_"+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),setAttributes(a=domChild(a,0,"rect",no),{width:1,height:1,fill:`url(${vega_scenegraph_module_href()}#${t.id})`}),setAttributes(e=domChild(e,n++,"radialGradient",no),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})):setAttributes(e=domChild(e,n++,"linearGradient",no),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2})}for(r=0,i=t.stops.length;rtextValue(i,e))).join("\n"))!==oo.text&&(domClear(r,0),a=r.ownerDocument,s=lineHeight(i),o.forEach((e,t)=>{const n=domCreate(a,"tspan",no);n.__data__=i,n.textContent=e,t&&(n.setAttribute("x",0),n.setAttribute("dy",s)),r.appendChild(n)}),oo.text=n):(o=textValue(i,t))!==oo.text&&(r.textContent=o,oo.text=o),setAttribute(r,"font-family",fontFamily(i)),setAttribute(r,"font-size",vega_scenegraph_module_fontSize(i)+"px"),setAttribute(r,"font-style",i.fontStyle),setAttribute(r,"font-variant",i.fontVariant),setAttribute(r,"font-weight",i.fontWeight)}};function emit(e,t,n){t!==oo[e]&&(n?function setAttributeNS(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(io,e,t,n):setAttribute(io,e,t),oo[e]=t)}function setStyle(e,t,n){n!==oo[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),oo[t]=n)}function setAttributes(e,t){for(const n in t)setAttribute(e,n,t[n])}function setAttribute(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function vega_scenegraph_module_href(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function SVGStringRenderer(e){vega_scenegraph_module_Renderer.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}Object(B.z)(SVGStringRenderer,vega_scenegraph_module_Renderer,{svg(){return this._text},_render(e){const t=markup();t.open("svg",Object(B.p)({},mi,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} `+this._height}));var n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",eo,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(s,A){const l=Ei[A.marktype],c=l.tag,g=[ariaItemAttributes,l.attr];s.open("g",{class:cssClass(A),"clip-path":A.clip?clip$1(this,A,A.group):null},ariaMarkAttributes(A),{"pointer-events":"g"!==c&&!1===A.interactive?"none":null});var e=t=>{var e,n,r,i=this.href(t);if(i&&s.open("a",i),s.open(c,this.attr(A,t,g,"g"!==c?c:null)),"text"===c){var o=textLines(t);if(Object(B.B)(o)){var a={x:0,dy:lineHeight(t)};for(let e=0;ethis.mark(s,e)),s.close(),e&&r?(n&&(t.fill=null),t.stroke=r,s.open("path",this.attr(A,t,l.foreground,"bgrect")).close(),n&&(t.fill=n)):s.open("path",this.attr(A,t,l.foreground,"bgfore")).close());s.close(),i&&s.close()};return l.nested?A.items&&A.items.length&&e(A.items[0]):vega_scenegraph_module_visit(A,e),s.close()},href(e){const t=e.href;if(t){if(e=this._hrefs&&this._hrefs[t])return e;this.sanitizeURL(t).then(e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e})}return null},attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach(e=>e(o,t,this)):n(o,t,this),r&&function vega_scenegraph_module_style(t,n,e,r,i){if(null==n)return;"bgrect"===r&&!1===e.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===e.interactive&&(t["pointer-events"]="none"),t.display="none",null!==n.fill))return;"image"===r&&!1===n.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(t["font-family"]=fontFamily(n),t["font-size"]=vega_scenegraph_module_fontSize(n)+"px",t["font-style"]=n.fontStyle,t["font-variant"]=n.fontVariant,t["font-weight"]=n.fontWeight);for(const a in $i){let e=n[a];var o=$i[a];("transparent"!==e||"fill"!==o&&"stroke"!==o)&&null!=e&&(isGradient(e)&&(e=gradientRef(e,i.gradient,"")),t[o]=e)}}(i,t,e,r,this._defs),i},defs(t){var e=this._defs.gradient,n=this._defs.clipping,r=Object.keys(e).length+Object.keys(n).length;if(0!==r){t.open("defs");for(const s in e){var i=e[s],o=i.stops;"radial"===i.gradient?(t.open("pattern",{id:"p_"+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):t.open("linearGradient",{id:s,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let e=0;e{e.bounds.clear().union(s)});else if(i===Qo||e.modified())switch(t.visit(t.MOD,e=>n.dirty(e)),s.clear(),r.items.forEach(e=>s.union(vega_view_transforms_module_boundItem(e,a))),r.role){case wo:case _o:case So:t.reflow()}else A=t.changed(t.REM),t.visit(t.ADD,e=>{s.union(vega_view_transforms_module_boundItem(e,a))}),t.visit(t.MOD,e=>{A=A||s.alignsWith(e.bounds),n.dirty(e),s.union(vega_view_transforms_module_boundItem(e,a))}),A&&(s.clear(),r.items.forEach(e=>s.union(e.bounds)));return boundClip(r),t.modifies("bounds")}});const Yo=":vega_identifier:";function Identifier(e){Transform.call(this,0,e)}function Mark(e){Transform.call(this,null,e)}function Overlap(e){Transform.call(this,null,e)}Identifier.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(B.z)(Identifier,Transform,{transform(e,t){const n=function getCounter(e){return e._signals[Yo]||(e._signals[Yo]=e.add(0))}(t.dataflow),r=e.as;let i=n.value;return t.visit(t.ADD,e=>e[r]=e[r]||++i),n.set(this.value=i),t}}),Object(B.z)(Mark,Transform,{transform(e,t){let n=this.value;n||((n=t.dataflow.scenegraph().mark(e.markdef,function vega_view_transforms_module_lookup(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index)).group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===Qo?GroupItem:Item;return t.visit(t.ADD,e=>r.call(e,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const zo={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,n)=>{let r;return e.filter((e,t)=>t&&Jo(r.bounds,e.bounds,n)?e.opacity=0:(r=e,1))}},Jo=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),Ko=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return 1(e.forEach(e=>e.opacity=1),e),$o=(e,t)=>e.reflow(t.modified()).modifies("opacity");function Render(e){Transform.call(this,null,e)}Object(B.z)(Overlap,Transform,{transform(e,t){const n=zo[e.method]||zo.parity,r=e.separation||0;let i=t.materialize(t.SOURCE).source,o,a;if(i&&i.length){if(!e.method)return e.modified("method")&&(qo(i),t=$o(t,e)),t;if((i=i.filter(Xo)).length){if(e.sort&&(i=i.slice().sort(e.sort)),o=qo(i),t=$o(t,e),3<=o.length&&Ko(o,r)){for(;3<=(o=n(o,r)).length&&Ko(o,r););o.length<3&&!Object(B.W)(i).opacity&&(1l.encloses(e.bounds)),i.forEach(e=>{a(e)||(e.opacity=0)}));const c=o[0].mark.bounds.clear();return i.forEach(e=>{e.opacity&&c.union(e.bounds)}),t}}}}),Object(B.z)(Render,Transform,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,e=>n.dirty(e)),t.fields&&t.fields.zindex){const r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});const ea=new Bounds;function vega_view_transforms_module_set(e,t,n){return e[t]===n?0:(e[t]=n,1)}function axisLayout(e,t,n,r){var i,o=t.items[0],t=o.datum,a=null!=o.translate?o.translate:.5,s=o.orient,A=function axisIndices(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(t),l=o.range,c=o.offset,g=o.position,u=o.minExtent,d=o.maxExtent,h=t.title&&o.items[A[2]].items[0],p=o.titlePadding,f=o.bounds,I=h&&multiLineOffset(h),C=0,m=0;switch(ea.clear().union(f),f.clear(),-1<(t=A[0])&&f.union(o.items[t].bounds),-1<(t=A[1])&&f.union(o.items[t].bounds),s){case go:C=g||0,m=-c,i=Math.max(u,Math.min(d,-f.y1)),f.add(0,-i).add(l,0),h&&axisTitleLayout(e,h,i,p,I,0,-1,f);break;case uo:C=-c,m=g||0,i=Math.max(u,Math.min(d,-f.x1)),f.add(-i,0).add(0,l),h&&axisTitleLayout(e,h,i,p,I,1,-1,f);break;case ho:C=n+c,m=g||0,i=Math.max(u,Math.min(d,f.x2)),f.add(0,0).add(i,l),h&&axisTitleLayout(e,h,i,p,I,1,1,f);break;case po:C=g||0,m=r+c,i=Math.max(u,Math.min(d,f.y2)),f.add(0,0).add(l,i),h&&axisTitleLayout(e,h,i,p,0,0,1,f);break;default:C=o.x,m=o.y}return boundStroke(f.translate(C,m),o),vega_view_transforms_module_set(o,"x",C+a)|vega_view_transforms_module_set(o,"y",m+a)&&(o.bounds=ea,e.dirty(o),o.bounds=f,e.dirty(o)),o.mark.bounds.clear().union(f)}function axisTitleLayout(n,r,i,o,a,s,A,e){const l=r.bounds;if(r.auto){A=A*(i+a+o);let e=0,t=0;n.dirty(r),s?e=(r.x||0)-(r.x=A):t=(r.y||0)-(r.y=A),r.mark.bounds.clear().union(l.translate(-e,-t)),n.dirty(r)}e.union(l)}const ta=(e,t)=>Math.floor(Math.min(e,t)),na=(e,t)=>Math.ceil(Math.max(e,t));function bboxFlush(e){return(new Bounds).set(0,0,e.width||0,e.height||0)}function bboxFull(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function vega_view_transforms_module_get(e,t,n){t=Object(B.H)(e)?e[t]:e;return null!=t?t:void 0!==n?n:0}function offsetValue(e){return e<0?Math.ceil(-e):0}function gridLayout(e,t,n){for(var r,i,o,a,s,A,l,c,g,u,d=!n.nodirty,h=n.bounds===Wo?bboxFlush:bboxFull,p=ea.set(0,0,0,0),f=vega_view_transforms_module_get(n.align,Ho),I=vega_view_transforms_module_get(n.align,jo),C=vega_view_transforms_module_get(n.padding,Ho),m=vega_view_transforms_module_get(n.padding,jo),y=n.columns||t.length,B=y<=0?1:Math.ceil(t.length/y),b=t.length,v=Array(b),E=Array(y),Q=0,w=Array(b),S=Array(B),_=0,x=Array(b),R=Array(b),F=Array(b),D=0;Di&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),E+=o,p=0,I=t.length;pnull!=r[e]?r[e]:null!=n[e]?n[e]:t}(n,t),A=function vega_view_transforms_module_offsets(e,t){let n=-1/0;return e.forEach(e=>{null!=e.offset&&(n=Math.max(n,e.offset))}),n>-1/0?n:t}(e,s("offset",0)),l=s("anchor",yo),c=l===bo?1:l===Bo?.5:0,g={align:Zo,bounds:s("bounds",Wo),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case uo:g.anchor={x:Math.floor(r.x1)-A,column:bo,y:c*(a||r.height()+2*r.y1),row:l};break;case ho:g.anchor={x:Math.ceil(r.x2)+A,y:c*(a||r.height()+2*r.y1),row:l};break;case go:g.anchor={y:Math.floor(i.y1)-A,row:bo,x:c*(o||i.width()+2*i.x1),column:l};break;case po:g.anchor={y:Math.ceil(i.y2)+A,x:c*(o||i.width()+2*i.x1),column:l};break;case fo:g.anchor={x:A,y:A};break;case Io:g.anchor={x:o-A,y:A,column:bo};break;case Co:g.anchor={x:A,y:a-A,row:bo};break;case mo:g.anchor={x:o-A,y:a-A,column:bo,row:bo}}return g}function legendLayout(e,t){var n,t=t.items[0],r=t.datum,i=t.orient,o=t.bounds,a=t.x,s=t.y;return t._bounds?t._bounds.clear().union(o):t._bounds=o.clone(),o.clear(),function legendGroupLayout(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,A=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case uo:i+=Math.ceil(a.bounds.width())+A;break;case ho:case po:break;default:o+=a.bounds.height()+A}switch((i||o)&&vega_view_transforms_module_translate(e,n,i,o),a.orient){case uo:c+=legendTitleOffset(t,n,a,s,1,1);break;case ho:l+=legendTitleOffset(t,n,a,bo,0,0)+A,c+=legendTitleOffset(t,n,a,s,1,1);break;case po:l+=legendTitleOffset(t,n,a,s,0,0),c+=legendTitleOffset(t,n,a,bo,-1,0,1)+A;break;default:l+=legendTitleOffset(t,n,a,s,0,0)}(l||c)&&vega_view_transforms_module_translate(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(vega_view_transforms_module_translate(e,n,-l,0),vega_view_transforms_module_translate(e,a,-l,0))}else(i||o)&&vega_view_transforms_module_translate(e,n,i,o)}(e,t,t.items[0].items[0]),o=function legendBounds(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.x1=e.padding,t.y1=e.padding,t}(t,o),e=2*t.padding,n=2*t.padding,o.empty()||(e=Math.ceil(o.width()+e),n=Math.ceil(o.height()+n)),r.type===To&&function legendEntryLayout(e){const t=e.reduce((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e),{});e.forEach(e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y})}(t.items[0].items[0].items[0].items),i!==Po&&(t.x=a=0,t.y=s=0),t.width=e,t.height=n,boundStroke(o.set(a,s,a+e,s+n),t),t.mark.bounds.clear().union(o),t}function legendTitleOffset(e,t,n,r,i,o,a){var s="symbol"!==e.datum.type,A=n.datum.vgrad,s=(!s||!o&&A||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,a=A&&o?s:0,t=A&&o?0:s,e=i<=0?0:multiLineOffset(n);return Math.round(r===yo?a:r===bo?t-e:.5*(s-e))}function vega_view_transforms_module_translate(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function ViewLayout(e){Transform.call(this,null,e)}Object(B.z)(ViewLayout,Transform,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(e=>{t.layout&&trellisLayout(n,e,t.layout),function layoutGroup(n,e,r){var t,i,o,a,s,A=e.items,l=Math.max(0,e.width||0),c=Math.max(0,e.height||0),g=(new Bounds).set(0,0,l,c),u=g.clone(),d=g.clone(),h=[];for(a=0,s=A.length;a{(o=e.orient||ho)!==Po&&(f[o]||(f[o]=[])).push(e)});for(const o in f){var p=f[o];gridLayout(n,p,legendParams(p,o,r.legends,u,d,l,c))}h.forEach(e=>{const t=e.bounds;if(t.equals(e._bounds)||(e.bounds=e._bounds,n.dirty(e),e.bounds=t,n.dirty(e)),r.autosize&&r.autosize.type===Mo)switch(e.orient){case uo:case ho:g.add(t.x1,0).add(t.x2,0);break;case go:case po:g.add(0,t.y1).add(0,t.y2)}else g.union(t)})}g.union(u).union(d),t&&g.union(function titleLayout(e,t,n,r,i){var o,a=t.items[0],s=a.frame,A=a.orient,l=a.anchor,c=a.offset,g=a.padding,u=a.items[0].items[0],d=a.items[1]&&a.items[1].items[0],n=A===uo||A===ho?r:n,h=0,p=0,f=0,I=0,C=0;if(s!==Qo?n=A===uo?(h=i.y2,i.y1):A===ho?(h=i.y1,i.y2):(h=i.x1,i.x2):A===uo&&(h=r,n=0),o=l===yo?h:l===bo?n:(h+n)/2,d&&d.text){switch(A){case go:case po:C=u.bounds.height()+g;break;case uo:I=u.bounds.width()+g;break;case ho:I=-u.bounds.width()-g}ea.clear().union(d.bounds),ea.translate(I-(d.x||0),C-(d.y||0)),vega_view_transforms_module_set(d,"x",I)|vega_view_transforms_module_set(d,"y",C)&&(e.dirty(d),d.bounds.clear().union(ea),d.mark.bounds.clear().union(ea),e.dirty(d)),ea.clear().union(d.bounds)}else ea.clear();switch(ea.union(u.bounds),A){case go:p=o,f=i.y1-ea.height()-c;break;case uo:p=i.x1-ea.width()-c,f=o;break;case ho:p=i.x2+ea.width()+c,f=o;break;case po:p=o,f=i.y2+c;break;default:p=a.x,f=a.y}return vega_view_transforms_module_set(a,"x",p)|vega_view_transforms_module_set(a,"y",f)&&(ea.translate(p,f),e.dirty(a),a.bounds.clear().union(ea),t.bounds.clear().union(ea),e.dirty(a)),a.bounds}(n,t,l,c,g));e.clip&&g.set(0,0,e.width||0,e.height||0);!function viewSizeLayout(a,s,A,l){var l=l.autosize||{},c=l.type;if(!(a._autosize<1)&&c){let e=a._width,t=a._height,n=Math.max(0,s.width||0),r=Math.max(0,Math.ceil(-A.x1)),i=Math.max(0,s.height||0),o=Math.max(0,Math.ceil(-A.y1));var g,s=Math.max(0,Math.ceil(A.x2-n)),A=Math.max(0,Math.ceil(A.y2-i));l.contains===ko&&(g=a.padding(),e-=g.left+g.right,t-=g.top+g.bottom),c===Po?(r=0,o=0,n=e,i=t):c===Mo?(n=Math.max(0,e-r-s),i=Math.max(0,t-o-A)):c===Uo?(n=Math.max(0,e-r-s),t=i+o+A):c===Oo?(e=n+r+s,i=Math.max(0,t-o-A)):c===Lo&&(e=n+r+s,t=i+o+A),a._resizeView(e,t,n,i,[r,o],l.resize)}}(n,e,g,r)}(n,e,t)}),function shouldReflow(e){return e&&"legend-entry"!==e.mark.role}(t.mark.group)?e.reflow():e}});function Ubb(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var ra=t(1151);function d3_interpolate_src_basis_basis(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}var ia=e=>()=>e;function d3_interpolate_src_color_linear(t,n){return function(e){return t+e*n}}function d3_interpolate_src_color_gamma(n){return 1==(n=+n)?src_color_nogamma:function(e,t){return t-e?function src_color_exponential(t,n,r){return t=Math.pow(t,r),n=Math.pow(n,r)-t,r=1/r,function(e){return Math.pow(t+e*n,r)}}(e,t,n):ia(isNaN(e)?t:e)}}function src_color_nogamma(e,t){var n=t-e;return n?d3_interpolate_src_color_linear(e,n):ia(isNaN(e)?t:e)}var oa=function rgbGamma(e){var a=d3_interpolate_src_color_gamma(e);function rgb(t,e){var n=a((t=color_rgb(t)).r,(e=color_rgb(e)).r),r=a(t.g,e.g),i=a(t.b,e.b),o=src_color_nogamma(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=r(e),t.b=i(e),t.opacity=o(e),t+""}}return rgb.gamma=rgbGamma,rgb}(1);function src_rgb_rgbSpline(s){return function(e){for(var t,n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a=0;ao&&(i=r.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(t=t[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,A.push({i:a,x:Aa(t,n)})),o=ga.lastIndex;return oingest$1({index:t/(s.length-1||1),value:e,label:a(e)})),e.extra&&r.length&&r.push(ingest$1({index:-1,extra:{value:r[0].value},label:""})),t.source=r,t.add=r,this.value=r,t}}),Object(B.z)(DataJoin,Transform,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||defaultItemCreate,o=e.key||tupleid,a=this.value;return Object(B.B)(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&Object(B.o)("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function newMap(t){const n=Object(B.t)().test(e=>e.exit);return n.lookup=e=>n.get(t(e)),n}(o)),t.visit(t.ADD,e=>{var t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1}),t.visit(t.MOD,e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))}),t.visit(t.REM,e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),Object(B.z)(Encode,Transform,{transform(n,e){var r=e.fork(e.ADD_REM),i=n.mod||!1,t=n.encoders,o=e.encode;if(Object(B.B)(o)){if(!r.changed()&&!o.every(e=>t[e]))return e.StopPropagation;o=o[0],r.encode=null}var a="enter"===o,s=t.update||B.s,A=t.enter||B.s,l=t.exit||B.s,c=(o&&!a?t[o]:s)||B.s;return e.changed(e.ADD)&&(e.visit(e.ADD,e=>{A(e,n),s(e,n)}),r.modifies(A.output),r.modifies(s.output),c!==B.s&&c!==s&&(e.visit(e.ADD,e=>{c(e,n)}),r.modifies(c.output))),e.changed(e.REM)&&l!==B.s&&(e.visit(e.REM,e=>{l(e,n)}),r.modifies(l.output)),!a&&c===B.s||(o=e.MOD|(n.modified()?e.REFLOW:0),a?(e.visit(o,e=>{var t=A(e,n)||i;(c(e,n)||t)&&r.mod.push(e)}),r.mod.length&&r.modifies(A.output)):e.visit(o,e=>{(c(e,n)||i)&&r.mod.push(e)}),r.mod.length&&r.modifies(c.output)),r.changed()?r:e.StopPropagation}}),Object(B.z)(LegendEntries,Transform,{transform(n,e){if(null!=this.value&&!n.modified())return e.StopPropagation;var r,i,o,t,a=e.dataflow.locale(),s=e.fork(e.NO_SOURCE|e.NO_FIELDS),A=this.value,l=n.type||sr,c=n.scale,g=+n.limit,u=tickCount(c,null==n.count?5:n.count,n.minstep),d=!!n.values||l===sr,h=n.format||labelFormat(a,c,u,l,n.formatSpecifier,n.formatType,d),p=n.values||labelValues(c,u);return A&&(s.rem=A),l===sr?(g&&p.length>g?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),A=p.slice(0,g-1),t=!0):A=p,Object(B.E)(i=n.size)?(n.values||0!==c(A[0])||(A=A.slice(1)),o=A.reduce((e,t)=>Math.max(e,i(t,n)),0)):i=Object(B.m)(o=i||8),A=A.map((e,t)=>ingest$1({index:t,label:h(e,t,A),value:e,offset:o,size:i(e,n)})),t&&(t=p[A.length],A.push(ingest$1({index:A.length,label:"…".concat(p.length-A.length," entries"),value:t,offset:o,size:i(t,n)})))):A="gradient"===l?(a=c.domain(),r=scaleFraction(c,a[0],Object(B.W)(a)),(p=p.length<3&&!n.values&&a[0]!==Object(B.W)(a)?[a[0],Object(B.W)(a)]:p).map((e,t)=>ingest$1({index:t,label:h(e,t,p),value:e,perc:r(e)}))):(i=p.length-1,r=function labelFraction(e){var t=e.domain(),n=t.length-1;let r=+t[0],i=+Object(B.W)(t),o=i-r;return e.type===jn&&(t=n?o/n:.1,r-=t,i+=t,o=i-r),e=>(e-r)/o}(c),p.map((e,t)=>ingest$1({index:t,label:h(e,t,p),value:e,perc:t?r(e):0,perc2:t===i?1:r(p[t+1])}))),s.source=A,s.add=A,this.value=A,s}});const da=e=>e.source.x,ha=e=>e.source.y,pa=e=>e.target.x,fa=e=>e.target.y;function LinkPath(e){Transform.call(this,{},e)}LinkPath.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},Object(B.z)(LinkPath,Transform,{transform(e,t){var n=e.sourceX||da,r=e.sourceY||ha,i=e.targetX||pa,o=e.targetY||fa,a=e.as||"path",s=e.orient||"vertical",A=e.shape||"line",l=ya.get(A+"-"+s)||ya.get(A);return l||Object(B.o)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,e=>{e[a]=l(n(e),r(e),i(e),o(e))}),t.reflow(e.modified()).modifies(a)}});const Ia=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r;const Ca=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.sqrt(i*i+o*o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r};const ma=(e,t,n,r)=>{var i=n-e,o=r-t,a=.2*(i+o),o=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+o)+" "+(n+o)+","+(r-a)+" "+n+","+r};const ya=Object(B.t)({line:Ia,"line-radial":(e,t,n,r)=>Ia(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:Ca,"arc-radial":(e,t,n,r)=>Ca(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:ma,"curve-radial":(e,t,n,r)=>ma(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{var i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:e{var i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{var i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{var i=Math.cos(e),e=Math.sin(e),o=Math.cos(n),n=Math.sin(n),a=(t+r)/2;return"M"+t*i+","+t*e+"C"+a*i+","+a*e+" "+a*o+","+a*n+" "+r*o+","+r*n}});function Pie(e){Transform.call(this,null,e)}Pie.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Object(B.z)(Pie,Transform,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],A=e.field||B.Q,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,g=t.source,u=g.map(A),d=u.length,h=l,p=(c-l)/Object(ra.a)(u),f=se(d);for(e.sort&&f.sort((e,t)=>u[e]-u[t]),n=0;ne+(t<0?-1:0i&&(t=a*Math.floor(i/a)),r=se(e,t+a/2,a)}r?n.bins=r:n.bins&&delete n.bins;n.type===Kn&&(r?e.domain||e.domainRaw||(n.domain(r),t=r.length):n.bins=n.domain());return t}(r,e,function configureDomain(e,t,n){var r=function rawDomain(e,t,n){return t?(e.domain(domainCheck(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(-1r[i]?i+1:ae(A);if(null==t)d.push(e.slice());else for(i={},o=0,a=e.length;oe;function streamGeometry(e,t){e&&wa.hasOwnProperty(e.type)&&wa[e.type](e,t)}var Qa={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++rx?Fa((N(t)*(i=G(r))*N(n)-N(r)*(n=G(t))*N(e))/(n*i*o)):(t+r)/2}(a,s,e,t),i.point(A,s),i.lineEnd(),i.lineStart(),i.point(n,s),o=0),i.point(a=e,s=t),A=n},lineEnd:function(){i.lineEnd(),a=s=NaN},clean:function(){return 2-o}}},function clipAntimeridianInterpolate(e,t,n,r){var i;null==e?(i=n*R,r.point(-S,i),r.point(0,i),r.point(S,i),r.point(S,0),r.point(S,-i),r.point(0,-i),r.point(-S,-i),r.point(-S,0),r.point(-S,i)):D(e[0]-t[0])>x?(e=e[0]S?e+Math.round(-e/xa)*xa:e,t]}function rotateRadians(e,t,n){return(e%=xa)?t||n?Wcb(rotationLambda(e),rotationPhiGamma(t,n)):rotationLambda(e):t||n?rotationPhiGamma(t,n):rotationIdentity}function forwardRotationLambda(n){return function(e,t){return[S<(e+=n)?e-xa:e<-S?e+xa:e,t]}}function rotationLambda(e){var t=forwardRotationLambda(e);return t.invert=forwardRotationLambda(-e),t}function rotationPhiGamma(e,t){var i=G(e),o=N(e),a=G(t),s=N(t);function rotation(e,t){var n=G(t),r=G(e)*n,e=N(e)*n,n=N(t),t=n*i+r*o;return[Da(e*a-t*s,r*i-n*o),math_asin(t*a+e*s)]}return rotation.invert=function(e,t){var n=G(t),r=G(e)*n,e=N(e)*n,n=N(t),t=n*a-e*s;return[Da(e*a+n*s,r*i+t*o),math_asin(t*i-r*o)]},rotation}rotationIdentity.invert=rotationIdentity;var Ss=function(t){function forward(e){return(e=t(e[0]*F,e[1]*F))[0]*=Ra,e[1]*=Ra,e}return t=rotateRadians(t[0]*F,t[1]*F,2x;function visible(e,t){return G(e)*G(t)>d}function intersect(e,t,n){var r=[1,0,0],i=cartesianCross(cartesian_cartesian(e),cartesian_cartesian(t)),o=cartesianDot(i,i),a=i[0],s=o-a*a;if(!s)return!n&&e;var A=cartesianCross(r,i),r=cartesianScale(r,d*o/s),o=(cartesianAddInPlace(r,cartesianScale(i,-d*a/s)),A),i=cartesianDot(r,o),a=cartesianDot(o,o),s=i*i-a*(cartesianDot(r,r)-1);if(!(s<0)){A=Ma(s),s=cartesianScale(o,(-i-A)/a);if(cartesianAddInPlace(s,r),s=cartesian_spherical(s),!n)return s;var l,n=e[0],c=t[0],e=e[1],t=t[1],g=(cx&&0<--r);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]};function orthographicRaw(e,t){return[G(t)*N(e),N(t)]}orthographicRaw.invert=azimuthalInvert(math_asin);function stereographicRaw(e,t){var n=G(t),r=1+G(e)*n;return[n*N(e)/r,N(t)/r]}stereographicRaw.invert=azimuthalInvert(function(e){return 2*Fa(e)});function transverseMercatorRaw(e,t){return[Na(Ua((R+t)/2)),-e]}transverseMercatorRaw.invert=function(e,t){return[-t,2*Fa(Ga(e))-R]};function src_noop_noop(){}function E2b(){var r,t=[];return{point:function(e,t,n){r.push([e,t,n])},lineStart:function(){t.push(r=[])},lineEnd:src_noop_noop,rejoin:function(){1k?js((U(t)*(i=M(r))*U(n)-U(r)*(n=M(t))*U(e))/(n*i*o)):(t+r)/2}(a,s,e,t),i.point(A,s),i.lineEnd(),i.lineStart(),i.point(n,s),o=0),i.point(a=e,s=t),A=n},lineEnd:function(){i.lineEnd(),a=s=NaN},clean:function(){return 2-o}}},function antimeridian_clipAntimeridianInterpolate(e,t,n,r){var i;null==e?(i=n*Ps,r.point(-w,i),r.point(0,i),r.point(w,i),r.point(w,0),r.point(w,-i),r.point(0,-i),r.point(-w,-i),r.point(-w,0),r.point(-w,i)):T(e[0]-t[0])>k?(e=e[0]w?e+Math.round(-e/Zs)*Zs:e,t]}function rotation_rotateRadians(e,t,n){return(e%=Zs)?t||n?Udb(rotation_rotationLambda(e),rotation_rotationPhiGamma(t,n)):rotation_rotationLambda(e):t||n?rotation_rotationPhiGamma(t,n):rotation_rotationIdentity}function rotation_forwardRotationLambda(n){return function(e,t){return[w<(e+=n)?e-Zs:e<-w?e+Zs:e,t]}}function rotation_rotationLambda(e){var t=rotation_forwardRotationLambda(e);return t.invert=rotation_forwardRotationLambda(-e),t}function rotation_rotationPhiGamma(e,t){var i=M(e),o=U(e),a=M(t),s=U(t);function rotation(e,t){var n=M(t),r=M(e)*n,e=U(e)*n,n=U(t),t=n*i+r*o;return[Ys(e*a-t*s,r*i-n*o),src_math_asin(t*a+e*s)]}return rotation.invert=function(e,t){var n=M(t),r=M(e)*n,e=U(e)*n,n=U(t),t=n*a-e*s;return[Ys(e*a+n*s,r*i+t*o),src_math_asin(t*i-r*o)]},rotation}rotation_rotationIdentity.invert=rotation_rotationIdentity;function circle_circleStream(e,t,n,r,i,o){if(n){var a=M(t),s=U(t),A=r*n;null==i?(i=t+r*Zs,o=t-A/2):(i=circle_circleRadius(a,i),o=circle_circleRadius(a,o),(0k;function visible(e,t){return M(e)*M(t)>d}function intersect(e,t,n){var r=[1,0,0],i=cartesian_cartesianCross(src_cartesian_cartesian(e),src_cartesian_cartesian(t)),o=cartesian_cartesianDot(i,i),a=i[0],s=o-a*a;if(!s)return!n&&e;var A=cartesian_cartesianCross(r,i),r=cartesian_cartesianScale(r,d*o/s),o=(cartesian_cartesianAddInPlace(r,cartesian_cartesianScale(i,-d*a/s)),A),i=cartesian_cartesianDot(r,o),a=cartesian_cartesianDot(o,o),s=i*i-a*(cartesian_cartesianDot(r,r)-1);if(!(s<0)){A=Js(s),s=cartesian_cartesianScale(o,(-i-A)/a);if(cartesian_cartesianAddInPlace(s,r),s=src_cartesian_spherical(s),!n)return s;var l,n=e[0],c=t[0],e=e[1],t=t[1],g=(cpA&&0<--i;);return t/2}(i,t)),r*hA(t)]}return forward.invert=function(e,t){return t=d3_geo_projection_src_math_asin(t/r),[e/(n*dA(t)),d3_geo_projection_src_math_asin((2*t+hA(2*t))/i)]},forward}(Ee/fA,Ee,ve);const CA=Bs(),mA=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function vega_projection_module_projection(e,t){if(e&&"string"==typeof e)return e=e.toLowerCase(),1{n[e]&&t[e](n[e]())}),t.path.pointRadius(n.path.pointRadius()),t},n}}(e,t),this):yA[e]||null;throw new Error("Projection type must be a name string.")}function getProjectionPath(e){return e&&e.path||CA}const yA={albers:h2b,albersusa:function(){var t,n,i,o,a,r,s=h2b(),A=g2b().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=g2b().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(e,t){r=[e,t]}};function albersUsa(e){var t=e[0],e=e[1];return r=null,i.point(t,e),r||(o.point(t,e),r)||(a.point(t,e),r)}function reset(){return t=n=null,albersUsa}return albersUsa.invert=function(e){var t=s.scale(),n=s.translate(),r=(e[0]-n[0])/t,n=(e[1]-n[1])/t;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?A:.166<=n&&n<.234&&-.214<=r&&r<-.115?l:s).invert(e)},albersUsa.stream=function(e){return t&&n===e?t:t=function multiplex(r){var i=r.length;return{point:function(e,t){for(var n=-1;++nBA}).map(l)).concat(se(vA(a/h)*h,o,h).filter(function(e){return bA(e%f)>BA}).map(c))}return graticule.lines=function(){return lines().map(function(e){return{type:"LineString",coordinates:e}})},graticule.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(u(s).slice(1),g(r).reverse().slice(1),u(A).reverse().slice(1))]}},graticule.extent=function(e){return arguments.length?graticule.extentMajor(e).extentMinor(e):graticule.extentMinor()},graticule.extentMajor=function(e){return arguments.length?(i=+e[0][0],r=+e[1][0],A=+e[0][1],s=+e[1][1],r>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?color_rgba(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?color_rgba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=QA.exec(e))?new color_Rgb(t[1],t[2],t[3],1):(t=wA.exec(e))?new color_Rgb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=SA.exec(e))?color_rgba(t[1],t[2],t[3],t[4]):(t=_A.exec(e))?color_rgba(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=xA.exec(e))?color_hsla(t[1],t[2]/100,t[3]/100,1):(t=RA.exec(e))?color_hsla(t[1],t[2]/100,t[3]/100,t[4]):FA.hasOwnProperty(e)?color_rgbn(FA[e]):"transparent"===e?new color_Rgb(NaN,NaN,NaN,0):null}function color_rgbn(e){return new color_Rgb(e>>16&255,e>>8&255,255&e,1)}function color_rgba(e,t,n,r){return new color_Rgb(e=r<=0?t=n=NaN:e,t,n,r)}function src_color_rgb(e,t,n,r){return 1===arguments.length?function color_rgbConvert(e){return(e=e instanceof color_Color?e:src_color_color(e))?new color_Rgb((e=e.rgb()).r,e.g,e.b,e.opacity):new color_Rgb}(e):new color_Rgb(e,t,n,null==r?1:r)}function color_Rgb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function color_rgb_formatHex(){return"#"+color_hex(this.r)+color_hex(this.g)+color_hex(this.b)}function color_rgb_formatRgb(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function color_hex(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function color_hsla(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||1<=n?e=t=NaN:t<=0&&(e=NaN),new color_Hsl(e,t,n,r)}function color_hslConvert(e){if(e instanceof color_Hsl)return new color_Hsl(e.h,e.s,e.l,e.opacity);if(!(e=e instanceof color_Color?e:src_color_color(e)))return new color_Hsl;if(e instanceof color_Hsl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,A=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(ncontour(t,e))}function contour(t,n){var i=[],r=[];return function isorings(e,t,a){var s,A,n,r,i,o,l=new Array,c=new Array;s=A=-1,r=e[0]>=t,DA[r<<1].forEach(stitch);for(;++s=t,DA[n|r<<1].forEach(stitch);DA[r<<0].forEach(stitch);for(;++A=t,i=e[A*g]>=t,DA[r<<1|i<<2].forEach(stitch);++s=t,o=i,i=e[A*g+s+1]>=t,DA[n|r<<1|i<<2|o<<3].forEach(stitch);DA[r|i<<3].forEach(stitch)}s=-1,i=e[A*g]>=t,DA[i<<2].forEach(stitch);for(;++s=t,DA[i<<2|o<<3].forEach(stitch);function stitch(e){var t,n,r=[e[0][0]+s,e[0][1]+A],e=[e[1][0]+s,e[1][1]+A],i=index(r),o=index(e);(t=c[i])?(n=l[o])?(delete c[t.end],delete l[n.start],t===n?(t.ring.push(e),a(t.ring)):l[t.start]=c[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete c[t.end],t.ring.push(e),c[t.end=o]=t):(t=l[o])?(n=c[i])?(delete l[t.start],delete c[n.end],t===n?(t.ring.push(e),a(t.ring)):l[n.start]=c[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete l[t.start],t.ring.unshift(r),l[t.start=i]=t):l[i]=c[o]={start:i,end:o,ring:[r,e]}}DA[i<<3].forEach(stitch)}(t,n,e=>{o(e,t,n),0{for(var t,n=0,r=i.length;n{var t,n=e[0],r=e[1],i=0|n,o=0|r,a=s[o*g+i];0e[0],d=e=>e[1],h=B.Q,p=[-1,-1],f=960,I=500,C=2;function density(e,t){const n=vega_geo_module_radius(p[0],e,u)>>C,r=vega_geo_module_radius(p[1],e,d)>>C,i=n?2+n:0,o=r?2+r:0,a=2*i+(f>>C),s=2*o+(I>>C),A=new Float32Array(a*s),l=new Float32Array(a*s);let c=A;e.forEach(e=>{var t=i+(+u(e)>>C),n=o+(+d(e)>>C);0<=t&&t>C),y2:o+(I>>C)}}return density.x=function(e){return arguments.length?(u=vega_geo_module_number(e),density):u},density.y=function(e){return arguments.length?(d=vega_geo_module_number(e),density):d},density.weight=function(e){return arguments.length?(h=vega_geo_module_number(e),density):h},density.size=function(e){if(!arguments.length)return[f,I];var t=+e[0],e=+e[1];return 0<=t&&0<=e||Object(B.o)("invalid size"),f=t,I=e,density},density.cellSize=function(e){return arguments.length?(1<=(e=+e)||Object(B.o)("invalid cell size"),C=Math.floor(Math.log(e)/Math.LN2),density):1<=a&&(e>=s&&(t-=i[e-s+n*r]),o[e-a+n*r]=t/Math.min(e+1,r-1+s-e,s))}function blurY(r,i,o,a,s){var A=1+(s<<1);for(let n=0;n=s&&(e>=A&&(t-=o[n+(e-A)*r]),a[n+(e-s)*r]=t/Math.min(e+1,i-1+A-e,A))}function KDE2D(e){Transform.call(this,null,e)}Isocontour.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},Object(B.z)(Isocontour,Transform,{transform(r,e){if(this.value&&!e.changed()&&!r.modified())return e.StopPropagation;var t=e.fork(e.NO_SOURCE|e.NO_FIELDS),e=e.materialize(e.SOURCE).source,i=r.field||B.y,o=vega_geo_module_contours().smooth(!1!==r.smooth),a=r.thresholds||function levels(e,t,n){const r=vega_geo_module_quantize(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map(e=>Object(X.a)(t(e).values)))}(e,i,r),s=null===r.as?null:r.as||"contour",A=[];return e.forEach(t=>{var e=i(t);const n=o.size([e.width,e.height])(e.values,Object(B.B)(a)?a:a(e.values));!function transformPaths(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;Object(B.E)(i)&&(i=i(n,r));Object(B.E)(o)&&(o=o(n,r));var a,s;(1!==i&&null!=i||o)&&(n=(Object(B.G)(i)?i:i[0])||1,r=(Object(B.G)(i)?i:i[1])||1,a=o&&o[0]||0,s=o&&o[1]||0,e.forEach(vega_geo_module_transform(t,n,r,a,s)))}(n,e,t,r),n.forEach(e=>{A.push(rederive(t,ingest$1(null!=s?{[s]:e}:e)))})}),this.value&&(t.rem=this.value),this.value=t.source=t.add=A,t}}),KDE2D.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const GA=["x","y","weight","size","cellSize","bandwidth"];function vega_geo_module_params(t,n){return GA.forEach(e=>null!=n[e]?t[e](n[e]):0),t}function Contour(e){Transform.call(this,null,e)}Object(B.z)(KDE2D,Transform,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),e=function vega_geo_module_partition(e,t){var n,r,i,o,a,s,A=[],l=e=>e(o);if(null==t)A.push(e);else for(n={},r=0,i=e.length;ringest$1(function set(t,n){for(let e=0;en.push(s(e))),o&&a&&(t.visit(i,e=>{var t=o(e),e=a(e);null!=t&&null!=e&&(t=+t)===t&&(e=+e)===e&&r.push([t,e])}),n=n.concat({type:NA,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:kA,features:n}}}),GeoPath.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(B.z)(GeoPath,Transform,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||B.y,o=e.as||"path",a=n.SOURCE,t=(!r||e.modified()?(this.value=r=getProjectionPath(e.projection),n.materialize().reflow()):a=i===B.y||t.modified(i.fields)?n.ADD_MOD:n.ADD,function initPath(e,t){var n=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return n}(r,e.pointRadius));return n.visit(a,e=>e[o]=r(i(e))),r.pointRadius(t),n.modifies(o)}}),GeoPoint.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(B.z)(GeoPoint,Transform,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],a=o[0],s=o[1];function set(e){var t=n([r(e),i(e)]);t?(e[a]=t[0],e[s]=t[1]):(e[a]=void 0,e[s]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,set):(e=t.modified(r.fields)||t.modified(i.fields),t.visit(e?t.ADD_MOD:t.ADD,set)),t.modifies(o)}}),GeoShape.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(B.z)(GeoShape,Transform,{transform(e,t){var t=t.fork(t.ALL),n=this.value,r=e.as||"shape",i=t.ADD;return n&&!e.modified()||(this.value=n=function shapeGenerator(n,r,i){const t=null==i?e=>n(r(e)):e=>{var t=n.pointRadius(),e=n.pointRadius(i)(r(e));return n.pointRadius(t),e};return t.context=e=>(n.context(e),t),t}(getProjectionPath(e.projection),e.field||Object(B.u)("datum"),e.pointRadius),t.materialize().reflow(),i=t.SOURCE),t.visit(i,e=>e[r]=n),t.modifies(r)}}),Graticule.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(B.z)(Graticule,Transform,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const o in e)Object(B.E)(i[o])&&i[o](e[o]);return n=i(),r.length?t.mod.push(replace(r[0],n)):t.add.push(ingest$1(n)),r[0]=n,t}}),Heatmap.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Object(B.z)(Heatmap,Transform,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||B.y,o=function opacity_(t,n){let e;Object(B.E)(t)?(e=e=>t(e,n)).dep=dependency(t):t?e=Object(B.m)(t):(e=e=>e.$value/e.$max||0).dep=!0;return e}(e.opacity,e),a=function color_(t,n){let e;Object(B.E)(t)?(e=e=>src_color_rgb(t(e,n))).dep=dependency(t):e=Object(B.m)(src_color_rgb(t||"#888"));return e}(e.color,e),s=e.as||"image",A={$x:0,$y:0,$value:0,$max:r?Object(X.a)(n.map(e=>Object(X.a)(i(e).values))):0};return n.forEach(e=>{var t=i(e);const n=Object(B.p)({},e,A);r||(n.$max=Object(X.a)(t.values||[])),e[s]=function toCanvas(e,i,o,a){const s=e.width,t=e.height,A=e.x1||0,l=e.y1||0,c=e.x2||s,g=e.y2||t,n=e.values,u=n?e=>n[e]:B.mb,r=domCanvas(c-A,g-l),d=r.getContext("2d"),h=d.getImageData(0,0,c-A,g-l),p=h.data;for(let n=l,r=0;n{null!=t[e]&&vega_geo_module_set(n,e,t[e])})):mA.forEach(e=>{t.modified(e)&&vega_geo_module_set(n,e,t[e])}),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function vega_geo_module_fit(e,t){var n=function collectGeoJSON(e){return 1===(e=Object(B.i)(e)).length?e[0]:{type:kA,features:e.reduce((e,t)=>e.concat(function featurize(e){return e.type===kA?e.features:Object(B.i)(e).filter(e=>null!=e).map(e=>e.type===NA?e:{type:NA,geometry:e})}(t)),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function Ieb(e){return function(){return e}}function Jeb(e){return 1e-6*(e()-.5)}var TA=t(1153);function collide_x(e){return e.x+e.vx}function collide_y(e){return e.y+e.vy}var MA=t(473);function link_index(e){return e.index}function link_find(e,t){e=e.get(t);if(e)return e;throw new Error("node not found: "+t)}const UA={center:function(o,a){var s,A=1;function force(){for(var e,t=s.length,n=0,r=0,i=0;is.index&&((n=(t=A-o.x-o.vx)*t+(r=l-o.y-o.vy)*r)e.r&&(e.r=e[t].r)}function initialize(){if(i){var e,t,n=i.length;for(o=new Array(n),e=0;e[s(e,t,o),e])),i=0;for(a=new Array(t);it(e,n):t)}(t[n],e[n],e);return t}(a[s]):r&&function modified(e,t){var n,r;for(n in e)if(Object(B.E)(r=e[n])&&t.modified(Object(B.g)(r)))return 1;return}(a[s],r)?e.force(o):null)&&e.force(o,i);for(A=e.numForces||0;so,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),setup(n,t,!0).on("end",()=>o=!0)}(t.source,e),n.on("tick",function rerun(e,t){return()=>e.touch(t).run()}(t.dataflow,this)),e.static||(r=!0,n.tick()),t.modifies("index")),i||r||e.modified(PA)||t.changed()&&e.restart)if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();0<=--o;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const i=t.dataflow;for(let e=this._argops,t=0,n=e.length,r;t{var t=e.data;r(t)&&(i[n(t)]=e)}),e.lookup=i,e}function Nest(e){Transform.call(this,null,e)}Nest.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const zA=e=>e.values;function HierarchyLayout(e){Transform.call(this,null,e)}Object(B.z)(Nest,Transform,{transform(e,t){t.source||Object(B.o)("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return o&&!r&&!t.changed()||(o&&o.each(e=>{e.children&&isTuple(e.data)&&i.rem.push(e.data)}),this.value=o=hierarchy({values:Object(B.i)(e.keys).reduce((e,t)=>(e.key(t),e),function nest(){const c=[],t={entries:e=>function entries(e,t){if(++t>c.length)return e;const n=[];for(const r in e)n.push({key:r,values:entries(e[r],t)});return n}(function apply(e,t){if(t>=c.length)return e;const n=e.length,r=c[t++],i={},o={};let a=-1,s,A,l;for(;++a(c.push(e),t)};return t}()).entries(i.source)},zA),n&&o.each(e=>{e.children&&(e=ingest$1(e.data),i.add.push(e),i.source.push(e))}),vega_hierarchy_module_lookup(o,tupleid,tupleid)),i.source.root=o,i}});const JA=(e,t)=>e.parent===t.parent?1:2;Object(B.z)(HierarchyLayout,Transform,{transform(e,t){t.source&&t.source.root||Object(B.o)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(stableCompare(e.sort,e=>e.data)),function setParams(r,i,o){for(let e,t=0,n=i.length;tfunction setFields(t,n,r){const i=t.data,o=n.length-1;for(let e=0;en.x&&(n=e),e.depth>r.depth&&(r=e)}),s=t===n?1:u(t,n)/2,i=s-t.x,o=A/(n.x+s+i),a=l/(r.depth||1),e.eachBefore(function(e){e.x=(e.x+i)*o,e.y=e.depth*a})),e}function firstWalk(e){var t=e.children,n=e.parent.children,r=e.i?n[e.i-1]:null;t?(function executeShifts(e){for(var t,n=0,r=0,i=e.children,o=i.length;0<=--o;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(e),t=(t[0].z+t[t.length-1].z)/2,r?(e.z=r.z+u(e._,r._),e.m=e.z-t):e.z=t):r&&(e.z=r.z+u(e._,r._)),e.parent.A=function apportion(e,t,n){if(t){for(var r,i=e,o=e,a=t,s=i.parent.children[0],A=i.m,l=o.m,c=a.m,g=s.m;a=nextRight(a),i=nextLeft(i),a&&i;)s=nextLeft(s),(o=nextRight(o)).a=e,0<(r=a.z+c-i.z-A+u(a._,i._))&&(function moveSubtree(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}(function nextAncestor(e,t,n){return e.a.parent===t.parent?e.a:n}(a,e,n),e,r),A+=r,l+=r),c+=a.m,A+=i.m,g+=s.m,l+=o.m;a&&!nextRight(o)&&(o.t=a,o.m+=c-l),i&&!nextLeft(s)&&(s.t=i,s.m+=A-g,n=e)}return n}(e,r,e.parent.A||n[0])}function secondWalk(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function sizeNode(e){e.x*=A,e.y=e.depth*l}return tree.separation=function(e){return arguments.length?(u=e,tree):u},tree.size=function(e){return arguments.length?(c=!1,A=+e[0],l=+e[1],tree):c?null:[A,l]},tree.nodeSize=function(e){return arguments.length?(c=!0,A=+e[0],l=+e[1],tree):c?[A,l]:null},tree},cluster:function(){var s=cluster_defaultSeparation,A=1,l=1,c=!1;function cluster(t){var n,r=0,e=(t.eachAfter(function(e){var t=e.children;t?(e.x=function meanX(e){return e.reduce(meanXReduce,0)/e.length}(t),e.y=function maxY(e){return 1+e.reduce(maxYReduce,0)}(t)):(e.x=n?r+=s(e,n):0,e.y=0,n=e)}),function leafLeft(e){for(var t;t=e.children;)e=t[0];return e}(t)),i=function leafRight(e){for(var t;t=e.children;)e=t[t.length-1];return e}(t),o=e.x-s(e,i)/2,a=i.x+s(i,e)/2;return t.eachAfter(c?function(e){e.x=(e.x-t.x)*A,e.y=(t.y-e.y)*l}:function(e){e.x=(e.x-o)/(a-o)*A,e.y=(1-(t.y?e.y/t.y:1))*l})}return cluster.separation=function(e){return arguments.length?(s=e,cluster):s},cluster.size=function(e){return arguments.length?(c=!1,A=+e[0],l=+e[1],cluster):c?null:[A,l]},cluster.nodeSize=function(e){return arguments.length?(c=!0,A=+e[0],l=+e[1],cluster):c?[A,l]:null},cluster}};le=["x","y","depth","children"];function Tree(e){HierarchyLayout.call(this,e)}function TreeLinks(e){Transform.call(this,[],e)}Tree.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:le.length,default:le}]},Object(B.z)(Tree,HierarchyLayout,{layout(e){e=e||"tidy";if(Object(B.w)(KA,e))return KA[e]();Object(B.o)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:le}),TreeLinks.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(B.z)(TreeLinks,Transform,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||Object(B.o)("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,e=>o[tupleid(e)]=1),r.each(e=>{var t=e.data,e=e.parent&&e.parent.data;e&&o[tupleid(t)]&&o[tupleid(e)]&&i.add.push(ingest$1({source:e,target:t}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>o[tupleid(e)]=1),n.forEach(e=>{(o[tupleid(e.source)]||o[tupleid(e.target)])&&i.mod.push(e)})),i}});const XA={binary:function(e,t,n,r,i){var o,a,h=e.children,s=h.length,p=new Array(s+1);for(p[0]=a=o=0;o>>1;p[g]{const t=n.tile();t.ratio&&n.tile(t.ratio(e))},n.method=e=>{Object(B.w)(XA,e)?n.tile(XA[e]):Object(B.o)("Unrecognized Treemap layout method: "+e)},n},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:be});const qA=4278190080,$A=268435456,el=.0625;function markBitmaps(e,t,n,r){const i=e.width,o=e.height,a=n||r,s=domCanvas(i,o).getContext("2d"),A=(t.forEach(e=>function vega_label_module_draw(t,e,n){if(!e.length)return;const r=e[0].mark.marktype;"group"===r?e.forEach(e=>{e.items.forEach(e=>vega_label_module_draw(t,e.items,n))}):Ei[r].draw(t,{items:n?e.map(vega_label_module_prepare):e})}(s,e,a)),new Uint32Array(s.getImageData(0,0,i,o).data.buffer)),l=e.bitmap(),c=a&&e.bitmap();let g,u,d,h,p;for(u=0;u~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function Bitmap(l,i){const c=new Uint32Array(~~((l*i+rl)/rl));function _set(e,t){c[e]|=t}function _clear(e,t){c[e]&=t}return{array:c,get:(e,t)=>{t=t*l+e;return c[t>>>tl]&1<<(t&nl)},set:(e,t)=>{t=t*l+e;_set(t>>>tl,1<<(t&nl))},clear:(e,t)=>{t=t*l+e;_clear(t>>>tl,~(1<<(t&nl)))},getRange:(e,t,n,r)=>{let i=r,o,a,s,A;for(;i>=t;--i)if(o=i*l+e,a=i*l+n,(s=o>>>tl)==(A=a>>>tl)){if(c[s]&il[o&nl]&ol[1+(a&nl)])return!0}else{if(c[s]&il[o&nl])return!0;if(c[A]&ol[1+(a&nl)])return!0;for(let e=1+s;e{let i,o,a,s,A;for(;t<=r;++t)if(o=t*l+n,(a=(i=t*l+e)>>>tl)==(s=o>>>tl))_set(a,il[i&nl]&ol[1+(o&nl)]);else for(_set(a,il[i&nl]),_set(s,ol[1+(o&nl)]),A=1+a;A{let i,o,a,s,A;for(;t<=r;++t)if(o=t*l+n,(a=(i=t*l+e)>>>tl)==(s=o>>>tl))_clear(a,ol[i&nl]|il[1+(o&nl)]);else for(_clear(a,ol[i&nl]),_clear(s,il[1+(o&nl)]),A=1+a;Ae<0||t<0||i<=r||l<=n}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}function vega_label_module_outOfBounds(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function _outOfBounds(){return!1}function vega_label_module_collision(e,t,n,r,i,o,a,s){i=i*o/(2*r),r=e(t-i),t=e(t+i),i=e(n-(o/=2)),e=e(n+o);return a.outOfBounds(r,i,t,e)||a.getRange(r,i,t,e)||s&&s.getRange(r,i,t,e)}function _collision(e,t,n,r,i,o,a,s){i=i*o/(2*r);let A=e(t-i),l=e(t+i),c=e(n-(o/=2)),g=e(n+o);return A=0=o&&(o=u,t.x=c,t.y=g);return c=i/2,g=e/2,a=t.x-c,s=t.x+c,A=t.y-g,l=t.y+g,t.align="center",a<0&&s<=h?t.align="left":0<=a&&hn)return[o,a,s,!0]}}return function(t){var n=t.datum.datum.items[x].items,r=n.length,i=t.datum.fontSize,o=Bi.width(t.datum,t.datum.text);let a=_?i:0,s=!1,A=!1,l=0,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q,w;for(let e=0;eg&&(w=c,c=g,g=w),u>d&&(w=u,u=d,d=w),m=~~(((C=S(c))+(y=S(g)))/2),b=~~(((B=S(u))+(v=S(d)))/2),f=m;f>=C;--f)for(I=b;I>=B;--I)(Q=tryLabel(f,I,a,o,i))&&([t.x,t.y,a,s]=Q);for(f=m;f<=y;++f)for(I=b;I<=v;++I)(Q=tryLabel(f,I,a,o,i))&&([t.x,t.y,a,s]=Q);s||_||(E=Math.abs(g-c+d-u),h=(c+g)/2,p=(u+d)/2,E>=l&&!G(h,p,o,i,R,F)&&!D(S,h,p,i,o,i,N,null)&&(l=E,t.x=h,t.y=p,A=!0))}return!(!s&&!A)&&(h=o/2,p=i/2,N.setRange(S(t.x-h),S(t.y-p),S(t.x+h),S(t.y+p)),t.align="center",t.baseline="middle",!0)}},floodfill:function placeAreaLabelFloodFill(v,e,E,Q,t){const w=v.width,S=v.height,[_,x]=getTests(t),R=e[0],F=e[1],D=v.bitmap();return function(t){const n=t.datum.datum.items[Q].items,r=n.length,i=t.datum.fontSize,o=Bi.width(t.datum,t.datum.text),a=[];let s=E?i:0,A=!1,l=!1,c=0,g,u,d,h,p,f,I,C,m,y,B,b;for(let e=0;es&&(t.x=p,t.y=f,s=m,A=!0)}}A||E||(b=Math.abs(u-g+h-d),p=(g+u)/2,f=(d+h)/2,b>=c&&!x(p,f,o,i,w,S)&&!_(v,p,f,i,o,i,R,null)&&(c=b,t.x=p,t.y=f,l=!0))}return!(!A&&!l)&&(p=o/2,f=i/2,R.setRange(v(t.x-p),v(t.y-f),v(t.x+p),v(t.y+f)),t.align="center",t.baseline="middle",!0)}}};function labelLayout(e,t,n,r,i,o,a,s,A,l,c){if(!e.length)return e;const g=Math.max(r.length,i.length),u=function getOffsets(t,n){const r=new Float64Array(n),i=t.length;for(let e=0;e[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{e=e.datum.items[r].items;return i(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:e=>{e=e.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:i}(h,p,s,A),C=null===l||l===1/0,m=scaler(t[0],t[1],C?0:l),y=f&&"naive"===c,B=e.map(e=>({datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:I(e)}));let b;if(!y){n&&B.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;ee.datum)].concat(o)),b=o.length?markBitmaps(m,o,t,f):function baseBitmaps(t,e){const n=t.bitmap();return(e||[]).forEach(e=>n.set(t(e.boundary[0]),t(e.boundary[3]))),[n,void 0]}(m,a&&B)}const v=f?gl[c](m,b,a,A,C):function placeMarkLabel(y,e,B,b,v){const E=y.width,Q=y.height,w=e[0],S=e[1],_=b.length;return function(t){var n=t.boundary,r=t.datum.fontSize;if(!v&&(n[2]<0||n[5]<0||n[0]>E||n[3]>Q))return!1;let i=0,o,a,s,A,l,c,g,u,d,h,p,f,I,C,m;for(let e=0;e<_;++e){if(o=(3&B[e])-1,a=(B[e]>>>2&3)-1,s=0==o&&0==a||b[e]<0,A=o&&a?Math.SQRT1_2:1,l=b[e]<0?-1:1,c=n[1+o]+b[e]*o*A,u=(p=n[4+a]+l*r*a/2+b[e]*a*A)-r/2,d=p+r/2,f=y(c),C=y(u),m=y(d),v&&(f=f<0?0:f,C=C<0?0:C,m=m>=y.height?y.height-1:m),!i){if(!vega_label_module_test(f,f,C,m,w,S,c,c,u,d,n,s))continue;i=Bi.width(t.datum,t.datum.text)}if(h=c+l*i*o/2,c=h-i/2,g=h+i/2,f=y(c),I=y(g),v&&(f=f<0?0:f,I=I>=y.width?y.width-1:I),vega_label_module_test(f,I,C,m,w,S,c,g,u,d,n,s))return t.x=o?o*l<0?g:c:h,t.y=a?a*l<0?d:u:p,t.align=Al[o*l+1],t.baseline=ll[a*l+1],w.setRange(f,C,I,m),!0}return!1}}(m,b,d,u,C);return B.forEach(e=>e.opacity=+v(e)),B}const ul=["x","y","opacity","align","baseline"],dl=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Label(e){Transform.call(this,null,e)}function vega_regression_module_partition(e,t){function LQc(e){return e(o)}var n,r,i,o,a,s,A=[];if(null==t)A.push(e);else for(n={},r=0,i=e.length;r{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline}),n.reflow(e).modifies(r)}}}),Loess.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(B.z)(Loess,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=vega_regression_module_partition(r,e.groupby),o=(e.groupby||[]).map(B.h),a=o.length,s=e.as||[Object(B.h)(e.x),Object(B.h)(e.y)],A=[];i.forEach(n=>{loess(n,e.x,e.y,e.bandwidth||.3).forEach(e=>{const t={};for(let e=0;e{if(n.length<=g)a.dataflow.warn("Skipping regression with more parameters than data points.");else{const t=d(n,o.x,o.y,c);if(o.params)h.push(ingest$1({keys:n.dims,coef:t.coef,rSquared:t.rSquared}));else{const e=i||Object(B.q)(n,o.x),r=e=>{const t={};for(let e=0;er([e,t.predict(e)])):sampleCurve(t.predict,e,25,200).forEach(r)}}}),this.value&&(e.rem=this.value),this.value=e.add=e.source=h}var t,n;return e}});const pl=Math.pow(2,-52),fl=new Uint32Array(512);class Delaunator{static from(t,n=function defaultGetX(e){return e[0]},r=function defaultGetY(e){return e[1]}){var i=t.length;const o=new Float64Array(2*i);for(let e=0;e>1;if(0>1;let t=1/0,n=1/0,i=-1/0,c=-1/0;for(let e=0;ei&&(i=g),u>c&&(c=u),this._ids[e]=e}var T=(t+i)/2,M=(n+c)/2;let d=1/0,h,p,f;for(let e=0;et&&(k[n++]=x,t=this._dists[x])}return this.hull=k.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}delaunator_orient(b,v,E,Q,S,_)&&(e=p,y=E,B=Q,p=f,E=S,Q=_,f=e,S=y,_=B);var R=function circumcenter(e,t,n,r,i,o){var n=n-e,r=r-t,i=i-e,o=o-t,a=n*n+r*r,s=i*i+o*o,A=.5/(n*o-r*i),e=e+(o*a-r*s)*A,o=t+(n*s-i*a)*A;return{x:e,y:o}}(b,v,E,Q,S,_);this._cx=R.x,this._cy=R.y;for(let e=0;e=33306690738754716e-32*Math.abs(r+i)?r-i:0}function delaunator_orient(e,t,n,r,i,o){return(orientIfSure(i,o,e,t,n,r)||orientIfSure(e,t,n,r,i,o)||orientIfSure(n,r,i,o,e,t))<0}function quicksort(n,r,i,o){if(o-i<=20)for(let t=i+1;t<=o;t++){var a=n[t],s=r[a];let e=t-1;for(;e>=i&&r[n[e]]>s;)n[e+1]=n[e--];n[e+1]=a}else{let e=i+1,t=o;delaunator_swap(n,i+o>>1,e),r[n[i]]>r[n[o]]&&delaunator_swap(n,i,o),r[n[e]]>r[n[o]]&&delaunator_swap(n,e,o),r[n[i]]>r[n[e]]&&delaunator_swap(n,i,e);for(var A=n[e],l=r[A];;){for(;r[n[++e]]l;);if(t=t-i?(quicksort(n,r,e,o),quicksort(n,r,i,t-1)):(quicksort(n,r,i,t-1),quicksort(n,r,e,o))}}function delaunator_swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}class path_Path{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},`+(this._y0=this._y1=+t)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},`+(this._y1=+t)}arc(e,t,n){var r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},`+i:(1e-6=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:o,hull:t,triangles:a},vectors:n}=this,s=this.circumcenters=this._circumcenters.subarray(0,a.length/3*2);for(let e=0,t=0,n=a.length,r,i;e=this.ymax)return null;(o=(this.ymax-t)/r)=this.xmax)return null;(o=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}}const Il=2*Math.PI,Cl=Math.pow;class delaunay_Delaunay{static from(e,t=function pointX(e){return e[0]},n=function pointY(e){return e[1]},r){return new delaunay_Delaunay("length"in e?function flatArray(t,n,r,i){const o=t.length,a=new Float64Array(2*o);for(let e=0;et).sort((e,t)=>n[2*e]-n[2*t]||n[2*e+1]-n[2*t+1]);var t=this.collinear[0],r=this.collinear[this.collinear.length-1],t=[n[2*t],n[2*t+1],n[2*r],n[2*r+1]],i=1e-8*Math.hypot(t[3]-t[1],t[2]-t[0]);for(let e=0,t=n.length/2;e>1);let l=e,c=Cl(t-A[2*e],2)+Cl(n-A[2*e+1],2);var g=r[e];let u=g;do{var d=s[u],h=Cl(t-A[2*d],2)+Cl(n-A[2*d+1],2);if(h>2),e=(e.width=(Bl<<5)/t,e.height=bl/t,e.getContext("2d"));return e.fillStyle=e.strokeStyle="red",e.textAlign="center",{context:e,ratio:t}}(domCanvas()),t=function zeroArray(e){var t=[],n=-1;for(;++n>5)*b[1]),n=null,r=p.length,i=-1,o=[],a=p.map(e=>({text:A(e),font:l(e),style:g(e),weight:u(e),rotate:d(e),size:~~(c(e)+1e-14),padding:h(e),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:e})).sort((e,t)=>t.size-e.size);++i>1,s.y=b[1]*(E()+.5)>>1,!function cloudSprite(e,t,n,r){if(!t.sprite){var i,o,a,s,A,l,c,g,u,d=e.context,h=e.ratio,p=(d.clearRect(0,0,(Bl<<5)/h,bl/h),0),f=0,I=0,C=n.length;for(--r;++r>5<<5,a=~~Math.max(Math.abs(c+g),Math.abs(c-g))):i=i+31>>5<<5,I>1))/h,(f+(a>>1))/h),t.rotate&&d.rotate(t.rotate*yl),d.fillText(t.text,0,0),t.padding&&(d.lineWidth=2*t.padding,d.strokeText(t.text,0,0)),d.restore(),t.width=i,t.height=a,t.xoff=p,t.yoff=f,t.x1=i>>1,t.y1=a>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,p+=i}for(var m=d.getImageData(0,0,(Bl<<5)/h,bl/h).data,y=[];0<=--r;)if((t=n[r]).hasText){for(i=t.width,o=i>>5,a=t.y1-t.y0,s=0;s>5),E=m[(f+A)*(Bl<<5)+(p+s)<<2]?1<<31-s%32:0;y[v]|=E,B|=E}B?b=A:(t.y0++,a--,A--,f++)}t.y1=t.y0+b,t.sprite=y.slice(0,(t.y1-t.y0)*o)}}}(e,s,a,i),s.hasText&&function place(e,t,n){var r,i,o=t.x,a=t.y,s=Math.sqrt(b[0]*b[0]+b[1]*b[1]),A=v(b),l=E()<.5?1:-1,c=-l;for(;(p=A(c+=l))&&(r=~~p[0],i=~~p[1],!(Math.min(Math.abs(r),Math.abs(i))>=s));)if(t.x=o+r,t.y=a+i,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!n||!function cloudCollide(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,A=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),g=0;g>>s:0))&t[c+u])return 1;c+=n}return}(t,e,b[0]))&&(!n||function collideRects(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0>5,h=b[0]>>5,p=t.x-(d<<4),f=127&p,I=32-f,C=t.y1-t.y0,m=(t.y+t.y0)*h+(p>>5),y=0;y>>f:0);m+=h}return t.sprite=null,1}return}(t,s,n)&&(o.push(s),n?function cloudBounds(e,t){var n=e[0],e=e[1];t.x+t.x0e.x&&(e.x=t.x+t.x1);t.y+t.y1>e.y&&(e.y=t.y+t.y1)}(n,s):n=[{x:s.x+s.x0,y:s.y+s.y0},{x:s.x+s.x1,y:s.y+s.y1}],s.x-=b[0]>>1,s.y-=b[1]>>1)}return o},t.words=function(e){return arguments.length?(p=e,t):p},t.size=function(e){return arguments.length?(b=[+e[0],+e[1]],t):b},t.font=function(e){return arguments.length?(l=functor(e),t):l},t.fontStyle=function(e){return arguments.length?(g=functor(e),t):g},t.fontWeight=function(e){return arguments.length?(u=functor(e),t):u},t.rotate=function(e){return arguments.length?(d=functor(e),t):d},t.text=function(e){return arguments.length?(A=functor(e),t):A},t.spiral=function(e){return arguments.length?(v=vl[e]||e,t):v},t.fontSize=function(e){return arguments.length?(c=functor(e),t):c},t.padding=function(e){return arguments.length?(h=functor(e),t):h},t.random=function(e){return arguments.length?(E=e,t):E},t}function archimedeanSpiral(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function functor(e){return"function"==typeof e?e:function(){return e}}var vl={archimedean:archimedeanSpiral,rectangular:function rectangularSpiral(e){var n=4*e[0]/e[1],r=0,i=0;return function(e){var t=e<0?-1:1;switch(Math.sqrt(1+4*t*e)-t&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};const El=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Ql=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Wordcloud(e){Transform.call(this,vega_wordcloud_module_cloud(),e)}Wordcloud.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:El}]},Object(B.z)(Wordcloud,Transform,{transform(n,r){!n.size||n.size[0]&&n.size[1]||Object(B.o)("Wordcloud size dimensions must be non-zero.");var i=n.modified();if(i||r.changed(r.ADD_REM)||Ql.some(function modp(e){return e=n[e],Object(B.E)(e)&&r.modified(e.fields)})){const c=r.materialize(r.SOURCE).source,g=this.value,u=n.as||El;let e=n.fontSize||14,t;if(Object(B.E)(e)?t=n.fontSizeRange:e=Object(B.m)(e),t){const d=e,h=vega_scale_module_scale("sqrt")().domain(Object(B.q)(c,d)).range(t);e=e=>h(d(e))}c.forEach(e=>{e[u[0]]=NaN,e[u[1]]=NaN,e[u[3]]=0});var o=g.words(c).text(n.text).size(n.size||[500,500]).padding(n.padding||1).spiral(n.spiral||"archimedean").rotate(n.rotate||0).font(n.font||"sans-serif").fontStyle(n.fontStyle||"normal").fontWeight(n.fontWeight||"normal").fontSize(e).random(ee).layout(),a=g.size(),s=a[0]>>1,A=a[1]>>1,l=o.length;for(let e=0,t,n;et[e])};const _l=e=>new Uint8Array(e),xl=e=>new Uint16Array(e),Rl=e=>new Uint32Array(e);function Bitmaps(){let n=8,A=[],e=Rl(0),l=vega_crossfilter_module_array(0,n),c=vega_crossfilter_module_array(0,n);return{data:()=>A,seen:()=>e=function lengthen(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(e,A.length),add(i){for(let e=0,t=A.length,n=i.length,r;eA.length,curr:()=>l,prev:()=>c,reset:e=>c[e]=l[e],all:()=>n<257?255:n<65537?65535:4294967295,set(e,t){l[e]|=t},clear(e,t){l[e]&=~t},resize(e,t){(l.lengthn)&&(n=Math.max(t,n),l=vega_crossfilter_module_array(e,n,l),c=vega_crossfilter_module_array(e,n))}}}function vega_crossfilter_module_array(e,t,n){const r=(t<257?_l:t<65537?xl:Rl)(e);return n&&r.set(n),r}function Dimension(e,t,n){const s=1<{e=n[e],t=n[t];return ec,size:()=>u}}function CrossFilter(e){Transform.call(this,Bitmaps(),e),this._indices=null,this._dims=null}function ResolveFilter(e){Transform.call(this,null,e)}CrossFilter.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},Object(B.z)(CrossFilter,Transform,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some(e=>t.modified(e.fields))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s=0,A,l;for(;s{var e=o.remove(n,r);for(const t in i)i[t].reindex(e)})},update(e,t,n){var r=this._dims,i=e.query,o=t.stamp,a=r.length;let s=0,A,l;for(n.filters=0,l=0;ls[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,e=>{var t=s[e]&n;return!t&&t^A[e]&n?a[e]:null}),o.filter(o.REM,e=>{var t=s[e]&n;return t&&!(t^(t^A[e]&n))?a[e]:null})):(o.filter(o.ADD,l),o.filter(o.REM,e=>(s[e]&n)===i?a[e]:null)),o.filter(o.SOURCE,e=>l(e._index))}});const Fl="Literal",Dl="CallExpression";function ASTNode(e){this.type=e}ASTNode.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function vega_expression_module_children(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case Dl:return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];case"Identifier":case Fl:default:return[]}}(this),n=0,r=t.length;n",Ee[3]="Identifier",Ee[4]="Keyword",Ee[5]="Null",Ee[6]="Numeric",Ee[Nl]="Punctuator",Ee[8]="String",Ee[9]="RegularExpression","ConditionalExpression"),Tl="Identifier",Ml="Unexpected token %0",Ul="Invalid regular expression",Ol="Invalid regular expression: missing /",Ll="Octal literals are not allowed in strict mode.",Pl="ILLEGAL",Vl="Disabled.",Zl=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Wl=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function assert(e,t){if(!e)throw new Error("ASSERT: "+t)}function isDecimalDigit(e){return 48<=e&&e<=57}function isHexDigit(e){return 0<="0123456789abcdefABCDEF".indexOf(e)}function isOctalDigit(e){return 0<="01234567".indexOf(e)}function isLineTerminator(e){return 10===e||13===e||8232===e||8233===e}function isIdentifierStart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||92===e||128<=e&&Zl.test(String.fromCharCode(e))}function isIdentifierPart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||48<=e&&e<=57||92===e||128<=e&&Wl.test(String.fromCharCode(e))}const Hl={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function skipComment(){for(;s>>="===(t=a.substr(s,4))?{type:Nl,value:t,start:n,end:s+=4}:">>>"===(t=t.substr(0,3))||"<<="===t||">>="===t?{type:Nl,value:t,start:n,end:s+=3}:i===(t=t.substr(0,2))[1]&&0<="+-<>&|".indexOf(i)||"=>"===t?{type:Nl,value:t,start:n,end:s+=2}:("//"===t&&throwError({},Ml,Pl),0<="<>=!+-*%&|^/".indexOf(i)?{type:Nl,value:i,start:n,end:++s}:void throwError({},Ml,Pl))}function scanNumericLiteral(){var e,t,n=a[s];if(assert(isDecimalDigit(n.charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=s,e="","."!==n){if(e=a[s++],n=a[s],"0"===e){if("x"===n||"X"===n)return++s,function scanHexLiteral(e){let t="";for(;s>10),56320+(t-65536&1023))}()):r+=scanHexEscape(t);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:isOctalDigit(t)?(0!==(n="01234567".indexOf(t))&&(i=!0),s{if(parseInt(t,16)<=1114111)return"x";throwError({},Ul)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){throwError({},Ul)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:s}}function advance(){if(skipComment(),wl<=s)return{type:Gl,start:s,end:s};var e=a.charCodeAt(s);return(isIdentifierStart(e)?scanIdentifier:40===e||41===e||59===e?scanPunctuator:39===e||34===e?scanStringLiteral:46===e?isDecimalDigit(a.charCodeAt(s+1))?scanNumericLiteral:scanPunctuator:isDecimalDigit(e)?scanNumericLiteral:scanPunctuator)()}function lex(){var e=c;return s=e.end,c=advance(),s=e.end,e}function peek(){var e=s;c=advance(),s=e}function finishBinaryExpression(e,t,n){const r=new ASTNode("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return r.operator=e,r.left=t,r.right=n,r}function finishIdentifier(e){const t=new ASTNode(Tl);return t.name=e,t}function finishLiteral(e){const t=new ASTNode("Literal");return t.value=e.value,t.raw=a.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function finishMemberExpression(e,t,n){const r=new ASTNode("MemberExpression");return r.computed="["===e,r.object=t,r.property=n,r.computed||(n.member=!0),r}function finishProperty(e,t,n){const r=new ASTNode("Property");return r.key=t,r.value=n,r.kind=e,r}function throwError(e,t){var n=Array.prototype.slice.call(arguments,2),t=t.replace(/%(\d)/g,(e,t)=>(assert(t":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function parseConditionalExpression(){var e,t=function parseBinaryExpression(){var e,t,n,r,i,o,a=c,s=parseUnaryExpression(),A=c,l=binaryPrecedence(A);if(0===l)return s;for(A.prec=l,lex(),e=[a,c],n=[s,A,parseUnaryExpression()];0<(l=binaryPrecedence(c));){for(;2function fncall(e,t,n,r){let i=o(t[0]);return n&&(i=n+"("+i+")",0===n.lastIndexOf("new ",0)&&(i="("+i+")")),i+"."+e+(r<0?"":0===r?"()":"("+t.slice(1).map(o).join(",")+")")}(t,e,n,r)}var e="new Date",t="String";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&Object(B.o)("Missing arguments to clamp function."),3o+`["${e}"]`;let A={},l={},c=0;function visit(e){if(Object(B.J)(e))return e;const t=g[e.type];return null==t&&Object(B.o)("Unsupported type: "+e.type),t(e)}const g={Literal:e=>e.raw,Identifier:e=>{e=e.name;return 0{var t=!e.computed,n=visit(e.object),e=(t&&(c+=1),visit(e.property));return n===a&&(l[function stripQuotes(e){var t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(e)]=1),t&&--c,n+(t?"."+e:"["+e+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&Object(B.o)("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=Object(B.w)(i,t)&&i[t];return r||Object(B.o)("Unrecognized function: "+t),Object(B.E)(r)?r(n):r+"("+n.map(visit).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(visit).join(",")+"]",BinaryExpression:e=>"("+visit(e.left)+" "+e.operator+" "+visit(e.right)+")",UnaryExpression:e=>"("+e.operator+visit(e.argument)+")",ConditionalExpression:e=>"("+visit(e.test)+"?"+visit(e.consequent)+":"+visit(e.alternate)+")",LogicalExpression:e=>"("+visit(e.left)+e.operator+visit(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(visit).join(",")+"}",Property:e=>{c+=1;var t=visit(e.key);return--c,t+":"+visit(e.value)}};function codegen(e){e={code:visit(e),globals:Object.keys(A),fields:Object.keys(l)};return A={},l={},e}return codegen.functions=i,codegen.constants=r,codegen}var ve=Math.PI,zl=ve/2,Jl=ve/4,Kl=2*ve,Xl=180/ve,ql=ve/180,$l=Math.abs,ec=(Math.atan,Math.atan2),tc=Math.cos,nc=(Math.ceil,Math.exp,Math.floor,Math.hypot),rc=(Math.log,Math.pow,Math.sin),ic=(Math.sign,Math.sqrt);Math.tan;function node_modules_d3_geo_src_math_asin(e){return 1bounds_angle(A,l)&&(l=e):bounds_angle(e,l)>bounds_angle(A,l)&&(A=e):A<=l?(ebounds_angle(A,l)&&(l=e):bounds_angle(e,l)>bounds_angle(A,l)&&(A=e)):bc.push(vc=[A=e,l=e]),t>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?src_color_rgba(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?src_color_rgba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Zc.exec(e))?new src_color_Rgb(t[1],t[2],t[3],1):(t=Wc.exec(e))?new src_color_Rgb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Hc.exec(e))?src_color_rgba(t[1],t[2],t[3],t[4]):(t=jc.exec(e))?src_color_rgba(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Yc.exec(e))?src_color_hsla(t[1],t[2]/100,t[3]/100,1):(t=zc.exec(e))?src_color_hsla(t[1],t[2]/100,t[3]/100,t[4]):Jc.hasOwnProperty(e)?src_color_rgbn(Jc[e]):"transparent"===e?new src_color_Rgb(NaN,NaN,NaN,0):null}function src_color_rgbn(e){return new src_color_Rgb(e>>16&255,e>>8&255,255&e,1)}function src_color_rgba(e,t,n,r){return new src_color_Rgb(e=r<=0?t=n=NaN:e,t,n,r)}function src_color_rgbConvert(e){return(e=e instanceof src_color_Color?e:d3_color_src_color_color(e))?new src_color_Rgb((e=e.rgb()).r,e.g,e.b,e.opacity):new src_color_Rgb}function d3_color_src_color_rgb(e,t,n,r){return 1===arguments.length?src_color_rgbConvert(e):new src_color_Rgb(e,t,n,null==r?1:r)}function src_color_Rgb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function src_color_rgb_formatHex(){return"#"+src_color_hex(this.r)+src_color_hex(this.g)+src_color_hex(this.b)}function src_color_rgb_formatRgb(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function src_color_hex(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function src_color_hsla(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||1<=n?e=t=NaN:t<=0&&(e=NaN),new src_color_Hsl(e,t,n,r)}function src_color_hslConvert(e){if(e instanceof src_color_Hsl)return new src_color_Hsl(e.h,e.s,e.l,e.opacity);if(!(e=e instanceof src_color_Color?e:d3_color_src_color_color(e)))return new src_color_Hsl;if(e instanceof src_color_Hsl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,A=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(nrg?Math.pow(e,1/3):e/ng+tg}function lab_lab2xyz(e){return 6/29>>1;o(e[i],t)<0?n=1+i:r=i}return n}return 1===n.length&&(i=(e,t)=>n(e)-t,o=function vega_selection_module_ascendingComparator(n){return(e,t)=>function vega_selection_module_ascending(e,t){return e-i(e[r],t)?r-1:r},right:function right(e,t,n,r){for(null==n&&(n=0),null==r&&(r=e.length);n>>1;00<=t.indexOf(e)):t},R_union:function(e,t){var n=Object(B.eb)(t[0]),r=Object(B.eb)(t[1]);return rn&&(e[0]=n),e[1]r&&(e[1]=r),e):[n,r]}};function selectionVisitor(e,t,n,r){t[0].type!==Fl&&Object(B.o)("First argument to selection functions must be a string literal.");var i=t[0].value,o=":"+i;(2<=t.length&&Object(B.W)(t).value)!==ig||Object(B.w)(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),Object(B.w)(r,o)||(r[o]=n.getData(i).tuplesRef())}function vega_functions_module_data(e){e=this.context.data[e];return e?e.values.value:[]}We=r=>function(e,t){const n=this.context.dataflow.locale();return n[r](t)(e)},o=We("format");const fg=We("timeFormat");q=We("utcFormat"),le=We("timeParse"),He=We("utcParse");const Ig=new Date(2e3,0,1);function vega_functions_module_time(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(Ig.setYear(2e3),Ig.setMonth(e),Ig.setDate(t),fg.call(this,Ig,n)):""}const Cg="%",mg="$";function dataVisitor(e,t,n,r){t[0].type!==Fl&&Object(B.o)("First argument to data functions must be a string literal.");var t=t[0].value,i=":"+t;if(!Object(B.w)(i,r))try{r[i]=n.getData(t).tuplesRef()}catch(e){}}function scaleVisitor(e,t,n,r){if(t[0].type===Fl)addScaleDependency(n,r,t[0].value);else for(e in n.scales)addScaleDependency(n,r,e)}function addScaleDependency(e,t,n){var r=Cg+n;if(!Object(B.w)(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function getScale(e,t){return Object(B.E)(e)?e:Object(B.J)(e)?(t=t.scales[e])&&t.value:void 0}function geoMethod(i,o){return function(e,t,n){if(e){const r=getScale(e,(n||this).context);return r&&r.path[i](t)}return o(t)}}be=geoMethod("area",function(e){return dc=new Adder,S5b(e,hc),2*dc}),Ee=geoMethod("bounds",function(e){var t,n,r,i,o,a,s;if(fc=l=-(A=pc=1/0),bc=[],S5b(e,Ec),n=bc.length){for(bc.sort(rangeCompare),t=1,o=[r=bc[0]];tbounds_angle(r[0],r[1])&&(r[1]=i[1]),bounds_angle(i[0],r[1])>bounds_angle(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=bounds_angle(r[1],i[0]))>a&&(a=s,A=i[0],l=r[1])}return bc=vc=null,A===1/0||pc===1/0?[[NaN,NaN],[NaN,NaN]]:[[A,pc],[l,fc]]}),ve=geoMethod("centroid",function(e){Qc=wc=Sc=_c=xc=Rc=Fc=Dc=0,Gc=new Adder,Nc=new Adder,kc=new Adder,S5b(e,Pc);var e=+Gc,t=+Nc,n=+kc,r=nc(e,t,n);return r<1e-12&&(e=Rc,t=Fc,n=Dc,wc<1e-6&&(e=Sc,t=_c,n=xc),(r=nc(e,t,n))<1e-12)?[NaN,NaN]:[ec(t,e)*Xl,node_modules_d3_geo_src_math_asin(n/r)*Xl]});function vega_functions_module_log(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function channel_luminance_value(e){e/=255;return e<=.03928?e/12.92:Math.pow((.055+e)/1.055,2.4)}function luminance(e){e=d3_color_src_color_rgb(e);return.2126*channel_luminance_value(e.r)+.7152*channel_luminance_value(e.g)+.0722*channel_luminance_value(e.b)}function equal(e,t){return e===t||e!=e&&t!=t||(Object(B.B)(e)?Object(B.B)(t)&&e.length===t.length&&function equalArray(n,r){for(let e=0,t=n.length;eequalObject(t,e)}const yg={};function vega_functions_module_array(e){return Object(B.B)(e)||ArrayBuffer.isView(e)?e:null}function sequence(e){return vega_functions_module_array(e)||(Object(B.J)(e)?e:null)}const Bg=e=>e.data;function treeNodes(e,t){t=vega_functions_module_data.call(t,e);return t.root&&t.root.lookup||{}}const bg=()=>"undefined"!=typeof window&&window||null;const vg={random(){return ee()},cumulativeNormal:cumulativeNormal,cumulativeLogNormal:cumulativeLogNormal,cumulativeUniform:cumulativeUniform,densityNormal:densityNormal,densityLogNormal:densityLogNormal,densityUniform:densityUniform,quantileNormal:quantileNormal,quantileLogNormal:quantileLogNormal,quantileUniform:quantileUniform,sampleNormal:sampleNormal,sampleLogNormal:sampleLogNormal,sampleUniform:sampleUniform,isArray:B.B,isBoolean:B.C,isDate:B.D,isDefined(e){return void 0!==e},isNumber:B.G,isObject:B.H,isRegExp:B.I,isString:B.J,isTuple:isTuple,isValid(e){return null!=e&&e==e},toBoolean:B.cb,toDate:B.db,toNumber:B.eb,toString:B.gb,indexof:function indexof(e,...t){return sequence(e).indexOf(...t)},join:function vega_functions_module_join(e,...t){return vega_functions_module_array(e).join(...t)},lastindexof:function lastindexof(e,...t){return sequence(e).lastIndexOf(...t)},replace:function vega_functions_module_replace(e,t,n){return Object(B.E)(n)&&Object(B.o)("Function argument passed to replace."),String(e).replace(t,n)},reverse:function vega_functions_module_reverse(e){return vega_functions_module_array(e).slice().reverse()},slice:function vega_functions_module_slice(e,...t){return sequence(e).slice(...t)},flush:B.v,lerp:B.L,merge:function vega_functions_module_merge(){const e=[].slice.call(arguments);return e.unshift({}),Object(B.p)(...e)},pad:B.R,peek:B.W,pluck:function pluck(e,t){const n=yg[t]||(yg[t]=Object(B.u)(t));return Object(B.B)(e)?e.map(n):n(e)},span:B.Z,inrange:B.A,truncate:B.hb,rgb:d3_color_src_color_rgb,lab:src_lab_lab,hcl:lab_hcl,hsl:src_color_hsl,luminance:luminance,contrast:function contrast(e,t){return e=luminance(e),t=luminance(t),(Math.max(e,t)+.05)/(Math.min(e,t)+.05)},sequence:se,format:o,utcFormat:q,utcParse:He,utcOffset:h.w,utcSequence:h.x,timeFormat:fg,timeParse:le,timeOffset:h.q,timeSequence:h.r,timeUnitSpecifier:h.s,monthFormat:function monthFormat(e){return vega_functions_module_time.call(this,e,1,"%B")},monthAbbrevFormat:function monthAbbrevFormat(e){return vega_functions_module_time.call(this,e,1,"%b")},dayFormat:function dayFormat(e){return vega_functions_module_time.call(this,0,2+e,"%A")},dayAbbrevFormat:function dayAbbrevFormat(e){return vega_functions_module_time.call(this,0,2+e,"%a")},quarter:B.X,utcquarter:B.jb,week:h.A,utcweek:h.z,dayofyear:h.m,utcdayofyear:h.y,warn:function warn(){return vega_functions_module_log(this.context.dataflow,"warn",arguments)},info:function info(){return vega_functions_module_log(this.context.dataflow,"info",arguments)},debug:function debug(){return vega_functions_module_log(this.context.dataflow,"debug",arguments)},extent:B.q,inScope:function inScope(e){var t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:function vega_functions_module_intersect(e,t,n){if(!e)return[];var[e,r]=e,e=(new Bounds).set(e[0],e[1],r[0],r[1]);return vega_scenegraph_module_intersect(n||this.context.dataflow.scenegraph().root,e,function vega_functions_module_filter(e){let t=null;if(e){const n=Object(B.i)(e.marktype),r=Object(B.i)(e.markname);t=t=>(!n.length||n.some(e=>t.marktype===e))&&(!r.length||r.some(e=>t.name===e))}return t}(t))},clampRange:B.k,pinchDistance:function pinchDistance(e){var t=(e=e.touches)[0].clientX-e[1].clientX,e=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+e*e)},pinchAngle:function pinchAngle(e){return e=e.touches,Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function screen(){var e=bg();return e?e.screen:{}},containerSize:function containerSize(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function windowSize(){var e=bg();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function bandspace(e,t,n){return bandSpace(e||0,t||0,n||0)},setdata:function setdata(e,t){const n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(B.ib).insert(t)),1},pathShape:function pathShape(t){let n=null;return function(e){return e?pathRender(e,n=n||pathParse(t)):t}},panLinear:B.S,panLog:B.T,panPow:B.U,panSymlog:B.V,zoomLinear:B.nb,zoomLog:B.ob,zoomPow:B.pb,zoomSymlog:B.qb,encode:function vega_functions_module_encode(e,t,n){if(e){const r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return void 0!==n?n:e},modify:function vega_functions_module_modify(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],A=s.input,l=a.stamp();let c=s.changes,g,u;if(!1===a._trigger||!(A.value.length||t||r))return 0;if((!c||c.stamp{s.modified=!0,a.pulse(A,c).run()},!0,1)),n&&(g=!0===n?B.ib:Object(B.B)(n)||isTuple(n)?n:removePredicate(n),c.remove(g)),t&&c.insert(t),r&&(g=removePredicate(r),A.value.some(g)?c.remove(g):c.insert(r)),i)for(u in o)c.modify(i,u,o[u]);return 1}},Eg=["view","item","group","xy","x","y"],Qg="this.",wg={},Sg={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Object(B.bb)(mg+e)}]`,functions:function buildFunctions(e){const t=Functions(e);Eg.forEach(e=>t[e]="event.vega."+e);for(const n in vg)t[n]=Qg+n;return Object(B.p)(t,function internalScaleFunctions(t,e,n){e.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=scaleVisitor,n._range=scaleVisitor,n._scale=scaleVisitor;const r=e=>"_["+(e.type===Fl?Object(B.bb)(Cg+e.value):Object(B.bb)(Cg)+"+"+t(e))+"]";return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>r(e[0])+".range()",_scale:e=>`${r(e[0])}(${t(e[1])})`}}(e,vg,wg)),t},constants:Yl,visitors:wg},_g=vega_expression_module_codegen(Sg);function expressionFunction(e,t,n){return 1===arguments.length?vg[e]:(vg[e]=t,n&&(wg[e]=n),_g&&(_g.functions[e]=Qg+e),this)}function vega_functions_module_parser(t,r){const i={};let e;try{t=Object(B.J)(t)?t:Object(B.bb)(t)+"",e=parser(t)}catch(e){Object(B.o)("Expression parse error: "+t)}e.visit(e=>{if(e.type===Dl){const t=e.callee.name,n=Sg.visitors[t];n&&n(t,e.arguments,r,i)}});const n=_g(e);return n.globals.forEach(e=>{var t=mg+e;!Object(B.w)(i,t)&&r.getSignal(e)&&(i[t]=r.signalRef(e))}),{$expr:Object(B.p)({code:n.code},r.options.ast?{ast:e}:null),$fields:n.fields,$params:i}}expressionFunction("bandwidth",function vega_functions_module_bandwidth(e,t){const n=getScale(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0},scaleVisitor),expressionFunction("copy",function vega_functions_module_copy(e,t){const n=getScale(e,(t||this).context);return n?n.copy():void 0},scaleVisitor),expressionFunction("domain",function vega_functions_module_domain(e,t){const n=getScale(e,(t||this).context);return n?n.domain():[]},scaleVisitor),expressionFunction("range",function vega_functions_module_range(e,t){const n=getScale(e,(t||this).context);return n&&n.range?n.range():[]},scaleVisitor),expressionFunction("invert",function vega_functions_module_invert(e,t,n){const r=getScale(e,(n||this).context);return r?(Object(B.B)(t)?r.invertRange||r.invert:r.invert||r.invertExtent)(t):void 0},scaleVisitor),expressionFunction("scale",function vega_functions_module_scale(e,t,n){const r=getScale(e,(n||this).context);return r?r(t):void 0},scaleVisitor),expressionFunction("gradient",function scaleGradient(t,e,n,r,i){t=getScale(t,(i||this).context);const o=Gradient(e,n);let a=t.domain(),s=a[0],A=Object(B.W)(a),l=B.y;return A-s?l=scaleFraction(t,s,A):t=(t.interpolator?vega_scale_module_scale("sequential")().interpolator(t.interpolator()):vega_scale_module_scale("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,A=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),A!==Object(B.W)(a)&&a.push(A)),a.forEach(e=>o.stop(l(e),t(e))),o},scaleVisitor),expressionFunction("geoArea",be,scaleVisitor),expressionFunction("geoBounds",Ee,scaleVisitor),expressionFunction("geoCentroid",ve,scaleVisitor),expressionFunction("geoShape",function geoShape(e,t,n){const r=getScale(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}},scaleVisitor),expressionFunction("indata",function indata(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count},function indataVisitor(e,t,n,r){t[0].type!==Fl&&Object(B.o)("First argument to indata must be a string literal."),t[1].type!==Fl&&Object(B.o)("Second argument to indata must be a string literal.");var i=t[0].value,o="@"+(t=t[1].value);Object(B.w)(o,r)||(r[o]=n.getData(i).indataRef(n,t))}),expressionFunction("data",vega_functions_module_data,dataVisitor),expressionFunction("treePath",function treePath(e,t,n){const r=treeNodes(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(Bg):void 0},dataVisitor),expressionFunction("treeAncestors",function treeAncestors(e,t){const n=treeNodes(e,this)[t];return n?n.ancestors().map(Bg):void 0},dataVisitor),expressionFunction("vlSelectionTest",function selectionTest(e,t,n){for(var r,i,o,a,s,A=(e=this.context.data[e])?e.values.value:[],l=e?e[cg]&&e[cg].value:void 0,c=n===ig,g=A.length,u=0;u(e[o[n].field]=t,e),{}))}return r=r||"union",Object.keys(h).forEach(n=>{h[n]=Object.keys(h[n]).map(e=>h[n][e]).reduce((e,t)=>void 0===e?t:pg[f[n]+"_"+r](e,t))}),d=Object.keys(p),t&&d.length&&(h[n?"vlPoint":"vlMulti"]="union"===r?{or:d.reduce((e,t)=>(e.push(...p[t]),e),[])}:{and:d.map(e=>({or:p[e]}))}),h},selectionVisitor),expressionFunction("vlSelectionTuples",function selectionTuples(e,n){return e.map(t=>Object(B.p)({values:n.fields.map(e=>(e.getter||(e.getter=Object(B.u)(e.field)))(t.datum))},n))});const xg=Object(B.fb)(["rule"]),Rg=Object(B.fb)(["group","image","rect"]);function canonicalType(e){return(e+"").toLowerCase()}function expression(e,t,n){";"!==n[n.length-1]&&(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var Fg={operator:(e,t)=>expression(e,["_"],t.code),parameter:(e,t)=>expression(e,["datum","_"],t.code),event:(e,t)=>expression(e,["event"],t.code),handler:(e,t)=>{return expression(e,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(t.code,";"))},encode:(e,t)=>{var{marktype:t,channels:n}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in n){var i="o["+Object(B.bb)(o)+"]";r+="$=".concat(n[o].code,";if(").concat(i,"!==$)").concat(i,"=$,m=1;")}return expression(e,["item","_"],r=r+function adjustSpatial(e,t){let n="";return xg[t]||(e.x2&&(e.x?(Rg[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(Rg[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(n,t)+"return m;")},codegen:{get(e){e="[".concat(e.map(B.bb).join("]["),"]");const t=Function("_","return _".concat(e,";"));return t.path=e,t},comparator(e,o){let a;const t=Function("a","b","var u, v; return "+e.map((e,t)=>{var n=o[t];let r,i;return i=e.path?(r="a".concat(e.path),"b".concat(e.path)):((a=a||{})["f"+t]=e,r="this.f".concat(t,"(a)"),"this.f".concat(t,"(b)")),function _compare(e,t,n,r){return"((u = ".concat(e,") < (v = ").concat(t,") || u == null) && v != null ? ").concat(n,"\n : (u > v || v == null) && u != null ? ").concat(r,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(r," : ")}(r,i,-n,n)}).join("")+"0;");return a?t.bind(a):t}}};function parseParameter(r,i,o){if(!r||!Object(B.H)(r))return r;for(let e=0,t=Dg.length,n;ee&&e.$tupleid?tupleid:e);return t.fn[n]||(t.fn[n]=Object(B.l)(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function vega_runtime_module_getContext(e,t){return t}},{key:"$subflow",parse:function getSubflow(e,a){const s=e.$subflow;return function(e,t,n){const r=a.fork().parse(s),i=r.get(s.operators[0].id),o=r.signals.parent;return o&&o.set(n),i.detachSubflow=()=>a.detach(r),i}}},{key:"$tupleid",parse:function getTupleId(){return tupleid}}];const Gg={skip:!0};function vega_runtime_module_context(e,t,n,r){return new Context(e,t,n,r)}function Context(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||Fg,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Subcontext(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}Context.prototype=Subcontext.prototype={fork(){var e=new Subcontext(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(t){this.subcontext=this.subcontext.filter(e=>e!==t);var e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const r of e)t.nodes[r].detach();t.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(t,n){const r=this,i=r.dataflow,o=t.value;if(r.set(t.id,n),function isCollect(e){return"collect"===canonicalType(e)}(t.type)&&o&&(o.$ingest?i.ingest(n,o.$ingest,o.$format):o.$request?i.preload(n,o.$request,o.$format):i.pulse(n,i.changeset().insert(o))),t.root&&(r.root=n),t.parent){let e=r.get(t.parent.$ref);e?(i.connect(e,[n]),n.targets().add(e)):(r.unresolved=r.unresolved||[]).push(()=>{e=r.get(t.parent.$ref),i.connect(e,[n]),n.targets().add(e)})}if(t.signal&&(r.signals[t.signal]=n),t.scale&&(r.scales[t.scale]=n),t.data)for(const e in t.data){const o=r.data[e]||(r.data[e]={});t.data[e].forEach(e=>o[e]=n)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[canonicalType(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function vega_runtime_module_parse(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(e=>t.parseOperator(e)),n.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()},parseOperator:function parseOperator(e){!function isOperator(e){return"operator"===canonicalType(e)}(e.type)&&e.type?this.transform(e,e.type):this.operator(e,e.update?this.operatorExpression(e.update):null)},parseOperatorParameters:function parseOperatorParameters(e){if(e.params){const t=this.get(e.id);t||Object(B.o)("Invalid operator id: "+e.id),this.dataflow.connect(t,t.parameters(this.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function parseParameters(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=Object(B.B)(i)?i.map(e=>parseParameter(e,n,t)):parseParameter(i,n,t)}return t},parseStream:function parseStream(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map(e=>n.get(e)))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map(e=>n.get(e)),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null==(i=null!=e.debounce?i.debounce(+e.debounce):i)&&Object(B.o)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function parseUpdate(e){var t,n=Object(B.H)(n=e.source)?n.$ref:n,n=this.get(n),r=e.update,i=void 0;n||Object(B.o)("Source not defined: "+e.source),t=e.target&&e.target.$expr?this.eventExpression(e.target.$expr):this.get(e.target),r&&r.$expr&&(r.$params&&(i=this.parseParameters(r.$params)),r=this.handlerExpression(r.$expr)),this.update(e,n,t,r,i)},getState:function getState(n){var r,i,o=this,e={};return n.signals&&(r=e.signals={},Object.keys(o.signals).forEach(e=>{var t=o.signals[e];n.signals(e,t)&&(r[e]=t.value)})),n.data&&(i=e.data={},Object.keys(o.data).forEach(e=>{var t=o.data[e];n.data(e,t)&&(i[e]=t.input.value)})),o.subcontext&&!1!==n.recurse&&(e.subcontext=o.subcontext.map(e=>e.getState(n))),e},setState:function setState(e){var r=this,t=r.dataflow,n=e.data,i=e.signals;Object.keys(i||{}).forEach(e=>{t.update(r.signals[e],i[e],Gg)}),Object.keys(n||{}).forEach(e=>{t.pulse(r.data[e].input,t.changeset().remove(B.ib).insert(n[e]))}),(e.subcontext||[]).forEach((e,t)=>{const n=r.subcontext[t];n&&n.setState(e)})}};var Ng=t(461);function ariaLabel(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}const kg="default";function setCursor(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function dataref(e,t){e=e._runtime.data;return Object(B.w)(e,t)||Object(B.o)("Unrecognized data set: "+t),e[t]}function change(e,t){isChangeSet(t)||Object(B.o)("Second argument to changes must be a changeset.");const n=dataref(this,e);return n.modified=!0,this.pulse(n.input,t)}function vega_view_module_width(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function vega_view_module_height(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function vega_view_module_offset(e){var t=e.padding(),e=e._origin;return[t.left+e[0],t.top+e[1]]}function eventExtend(e,t,n){var r,i,o=e._renderer,o=o&&o.canvas();return o&&(i=vega_view_module_offset(e),(r=vega_scenegraph_module_point(t.changedTouches?t.changedTouches[0]:t,o))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function extension(e,r,n){const i=r?"group"===r.mark.marktype?r:r.mark.group:null;function group(e){var t,n=i;if(e)for(t=r;t;t=t.mark.group)if(t.mark.name===e){n=t;break}return n&&n.mark&&n.mark.interactive?n:{}}function xy(e){if(!e)return n;Object(B.J)(e)&&(e=group(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:Object(B.m)(e),item:Object(B.m)(r||{}),group:group,xy:xy,x:e=>xy(e)[0],y:e=>xy(e)[1]}}(e,n,r),t}const Tg={trap:!1};function trackEventListener(e,t,n,r){e._eventListeners.push({type:n,sources:Object(B.i)(t),handler:r})}function permit(e,t,n){var r=e._eventConfig&&e._eventConfig[t];if(!1!==r&&(!Object(B.H)(r)||r[n]))return 1;e.warn(`Blocked ${t} ${n} event listener.`)}function itemFilter(e){return e.item}function markTarget(e){return e.item.mark.source}function invoke(n){return function(e,t){return t.vega.view().changeset().encode(t.item,n)}}function vega_view_module_element(e,t,n){const r=document.createElement(e);for(const i in t)r.setAttribute(i,t[i]);return null!=n&&(r.textContent=n),r}const Mg="vega-bind",Ug="vega-bind-name",Og="vega-bind-radio";function vega_view_module_target(e,t,n,r){const i=n.event||"input";var o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),trackEventListener(r,t,i,o),e.set=e=>{t.value=e,t.dispatchEvent(function vega_view_module_event(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(i))}}function vega_view_module_generate(e,t,n,r){r=r.signal(n.signal);const i=vega_view_module_element("div",{class:Mg}),o="radio"===n.input?i:i.appendChild(vega_view_module_element("label"));o.appendChild(vega_view_module_element("span",{class:Ug},n.name||n.signal)),t.appendChild(i);let a=vega_view_module_form;switch(n.input){case"checkbox":a=vega_view_module_checkbox;break;case"select":a=vega_view_module_select;break;case"radio":a=vega_view_module_radio;break;case"range":a=vega_view_module_range}a(e,o,n,r)}function vega_view_module_form(e,t,n,r){const i=vega_view_module_element("input");for(const o in n)"signal"!==o&&"element"!==o&&i.setAttribute("input"===o?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=e=>i.value=e}function vega_view_module_checkbox(e,t,n,r){const i={type:"checkbox",name:n.signal},o=(r&&(i.checked=!0),vega_view_module_element("input",i));t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=e=>o.checked=!!e||null}function vega_view_module_select(e,t,r,i){const o=vega_view_module_element("select",{name:r.signal}),a=r.labels||[];r.options.forEach((e,t)=>{const n={value:e};valuesEqual(e,i)&&(n.selected=!0),o.appendChild(vega_view_module_element("option",n,(a[t]||e)+""))}),t.appendChild(o),o.addEventListener("change",()=>{e.update(r.options[o.selectedIndex])}),e.elements=[o],e.set=n=>{for(let e=0,t=r.options.length;e{const n={type:"radio",name:a.signal,value:e},r=(valuesEqual(e,s)&&(n.checked=!0),vega_view_module_element("input",n)),i=(r.addEventListener("change",()=>o.update(e)),vega_view_module_element("label",{},(l[t]||e)+""));return i.prepend(r),A.appendChild(i),r}),o.set=t=>{const n=o.elements,r=n.length;for(let e=0;e{A.textContent=s.value,e.update(+s.value)};s.addEventListener("input",n),s.addEventListener("change",n),e.elements=[s],e.set=e=>{s.value=e,A.textContent=e}}function valuesEqual(e,t){return e===t||e+""==t+""}function initializeRenderer(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,vega_view_module_width(e),vega_view_module_height(e),vega_view_module_offset(e),i,o).background(e.background())}function trap(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function vega_view_module_lookup(t,n,e){if("string"==typeof n){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(n=document.querySelector(n)))return t.error("Signal bind element not found: "+n),null}if(n&&e)try{n.innerHTML=""}catch(e){n=null,t.error(e)}return n}const Lg=e=>+e||0;function vega_view_module_padding(e){return Object(B.H)(e)?{top:Lg(e.top),bottom:Lg(e.bottom),left:Lg(e.left),right:Lg(e.right)}:{top:e=+e||0,bottom:e,left:e,right:e}}async function renderHeadless(e,t,n,r){var i=renderModule(t),i=i&&i.headless;return i||Object(B.o)("Unrecognized renderer type: "+t),await e.runAsync(),initializeRenderer(e,null,null,i,n,r).renderAsync(e._scenegraph.root)}var Pg="width",Vg="height",Zg="padding",Wg={skip:!0};function viewWidth(e,t){var n=e.autosize(),e=e.padding();return t-(n&&n.contains===Zg?e.left+e.right:0)}function viewHeight(e,t){var n=e.autosize(),e=e.padding();return t-(n&&n.contains===Zg?e.top+e.bottom:0)}function dataTest(e,t){return t.modified&&Object(B.B)(t.input.value)&&e.indexOf("_:vega:_")}function signalTest(e,t){return!("parent"===e||t instanceof J.proxy)}function vega_view_module_defaultTooltip(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function formatTooltip(e){return null==e?"":Object(B.B)(e)?formatArray(e):Object(B.H)(e)&&!Object(B.D)(e)?function formatObject(n){return Object.keys(n).map(e=>{var t=n[e];return e+": "+(Object(B.B)(t)?formatArray:vega_view_module_formatValue)(t)}).join("\n")}(e):e+""}(r))}function formatArray(e){return"["+e.map(vega_view_module_formatValue).join(", ")+"]"}function vega_view_module_formatValue(e){return Object(B.B)(e)?"[…]":Object(B.H)(e)&&!Object(B.D)(e)?"{…}":e}function View(e,t){var n,r=this;t=t||{},Dataflow.call(r),t.loader&&r.loader(t.loader),t.logger&&r.logger(t.logger),null!=t.logLevel&&r.logLevel(t.logLevel),(t.locale||e.locale)&&(n=Object(B.p)({},e.locale,t.locale),r.locale(Object(O.b)(n.number,n.time))),r._el=null,r._elBind=null,r._renderType=t.renderer||so.Canvas,r._scenegraph=new Scenegraph;const i=r._scenegraph.root,o=(r._renderer=null,r._tooltip=t.tooltip||vega_view_module_defaultTooltip,r._redraw=!0,r._handler=(new CanvasHandler).scene(i),r._globalCursor=!1,r._preventDefault=!1,r._timers=[],r._eventListeners=[],r._resizeListeners=[],r._eventConfig=function initializeEventConfig(e){var e=Object(B.p)({defaults:{}},e),t=(t,e)=>{e.forEach(e=>{Object(B.B)(t[e])&&(t[e]=Object(B.fb)(t[e]))})};return t(e.defaults,["prevent","allow"]),t(e,["view","window","selector"]),e}(e.eventConfig),r.globalCursor(r._eventConfig.globalCursor),function runtime(e,t,n){return vega_runtime_module_context(e,J,vg,n).parse(t)}(r,e,t.expr));r._runtime=o,r._signals=o.signals,r._bind=(e.bindings||[]).map(e=>({state:null,param:Object(B.p)({},e)})),o.root&&o.root.set(i),i.source=o.data.root.input,r.pulse(o.data.root.input,r.changeset().insert(i.items)),r._width=r.width(),r._height=r.height(),r._viewWidth=viewWidth(r,r._width),r._viewHeight=viewHeight(r,r._height),r._origin=[0,0],r._resize=0,r._autosize=1,function initializeResize(t){var e=(r=t._signals)[Pg],n=r[Vg],r=r[Zg];function resetSize(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,e=>{t._width=e.size,t._viewWidth=viewWidth(t,e.size),resetSize()},{size:e}),t._resizeHeight=t.add(null,e=>{t._height=e.size,t._viewHeight=viewHeight(t,e.size),resetSize()},{size:n});const i=t.add(null,resetSize,{pad:r});t._resizeWidth.rank=e.rank+1,t._resizeHeight.rank=n.rank+1,i.rank=r.rank+1}(r),function vega_view_module_background(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}(r),function vega_view_module_cursor(r){const i=r._signals.cursor||(r._signals.cursor=r.add({user:kg,item:null}));r.on(r.events("view","mousemove"),i,(e,t)=>{var n=i.value,r=n?Object(B.J)(n)?n:n.user:kg,t=t.item&&t.item.cursor||null;return n&&r===n.user&&t==n.item?n:{user:r,item:t}}),r.add(null,function(e){let t=e.cursor,n=this.value;return Object(B.J)(t)||(n=t.item,t=t.user),setCursor(r,(!t||t===kg)&&n||t),n},{cursor:i})}(r),r.description(e.description),t.hover&&r.hover(),t.container&&r.initialize(t.container,t.bind)}function lookupSignal(e,t){return Object(B.w)(e._signals,t)?e._signals[t]:Object(B.o)("Unrecognized signal name: "+Object(B.bb)(t))}function findOperatorHandler(e,t){e=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return e.length?e[0]:null}function addOperatorListener(e,t,n,r){let i=findOperatorHandler(n,r);return i||((i=trap(e,()=>r(t,n.value))).handler=r,e.on(n,null,i)),e}function removeOperatorListener(e,t,n){n=findOperatorHandler(t,n);return n&&t._targets.remove(n),e}Object(B.z)(View,Dataflow,{async evaluate(e,t,n){if(await Dataflow.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function resizeRenderer(t){var e=vega_view_module_offset(t),n=vega_view_module_width(t),r=vega_view_module_height(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach(e=>{try{e(n,r)}catch(e){t.error(e)}})}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}return n&&asyncCallback(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){return arguments.length?((e=null!=e?e+"":null)!==this._desc&&ariaLabel(this._el,this._desc=e),this):this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){e=lookupSignal(this,e);return 1===arguments.length?e.value:this.update(e,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",vega_view_module_padding(e)):vega_view_module_padding(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(renderModule(e)||Object(B.o)("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Dataflow.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(lookupSignal(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function resizeView(n,r,i,o,a,s){this.runAfter(e=>{let t=0;e._autosize=0,e.width()!==i&&(t=1,e.signal(Pg,i,Wg),e._resizeWidth.skip(!0)),e.height()!==o&&(t=1,e.signal(Vg,o,Wg),e._resizeHeight.skip(!0)),e._viewWidth!==n&&(e._resize=1,e._viewWidth=n),e._viewHeight!==r&&(e._resize=1,e._viewHeight=r),e._origin[0]===a[0]&&e._origin[1]===a[1]||(e._resize=1,e._origin=a),t&&e.run("enter"),s&&e.runAfter(e=>e.resize())},!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||((r=trap(this,t)).raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;0<=--o;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,e=t.indexOf(e);return 0<=e&&t.splice(e,1),this},addSignalListener(e,t){return addOperatorListener(this,e,lookupSignal(this,e),t)},removeSignalListener(e,t){return removeOperatorListener(this,lookupSignal(this,e),t)},addDataListener(e,t){return addOperatorListener(this,e,dataref(this,e).values,t)},removeDataListener(e,t){return removeOperatorListener(this,dataref(this,e).values,t)},globalCursor(e){var t;return arguments.length?(this._globalCursor!==!!e&&(t=setCursor(this,null),this._globalCursor=!!e,t&&setCursor(this,t)),this):this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function vega_view_module_timer(t,e){var n,r,i,o;this._timers.push((n=function tick(e){t({timestamp:Date.now(),elapsed:e})},e=e,i=new Ng.a,null!=(o=e)&&(i._restart=i.restart,i.restart=function(t,n,r){n=+n,r=null==r?Object(Ng.b)():+r,i._restart(function tick(e){e+=o,i._restart(tick,o+=n,r),t(e)},n,r)}),i.restart(n,e,r),i))},events:function vega_view_module_events(n,r,e){function Kq2(e,t){i.runAsync(null,()=>{"view"===n&&function prevent(e,t){var n=(r=e._eventConfig.defaults).prevent,r=r.allow;return!1!==n&&!0!==r&&(!0===n||!1===r||(n?n[t]:r?!r[t]:e.preventDefault()))}(i,r)&&e.preventDefault(),o.receive(eventExtend(i,e,t))})}var t,i=this,o=new EventStream(e);if("timer"===n)permit(i,"timer",r)&&i.timer(Kq2,r);else if("view"===n)permit(i,"view",r)&&i.addEventListener(r,Kq2,Tg);else if("window"===n?permit(i,"window",r)&&"undefined"!=typeof window&&(t=[window]):"undefined"!=typeof document&&permit(i,"selector",r)&&(t=document.querySelectorAll(n)),t){for(var a=0,s=t.length;a{i.on(e.type,e.handler)}),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=vega_view_module_lookup(n,t,!0):e.appendChild(vega_view_module_element("form",{class:"vega-bindings"})),n._bind.forEach(e=>{e.param.element&&"container"!==i&&(e.element=vega_view_module_lookup(n,e.param.element,!!e.param.input))}),n._bind.forEach(e=>{!function vega_view_module_bind(n,e,r){if(e){const i=r.param;let t=r.state;t||(t=r.state={elements:null,active:!1,set:null,update:e=>{e!=n.signal(i.signal)&&n.runAsync(null,()=>{t.source=!0,n.signal(i.signal,e)})}},i.debounce&&(t.update=Object(B.n)(i.debounce,t.update)));const o=null==i.input&&i.element?vega_view_module_target:vega_view_module_generate;o(t,e,i,n),t.active||(n.on(n._signals[i.signal],null,()=>{t.source?t.source=!1:t.set(n.signal(i.signal))}),t.active=!0),t}}(n,e.element||t,e)})),n},toImageURL:async function renderToImageURL(e,t){e!==so.Canvas&&e!==so.SVG&&e!==so.PNG&&Object(B.o)("Unrecognized image type: "+e);const n=await renderHeadless(this,e,t);return e===so.SVG?function toBlobURL(e,t){e=new Blob([e],{type:t});return window.URL.createObjectURL(e)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function renderToCanvas(e,t){const n=await renderHeadless(this,so.Canvas,e,t);return n.canvas()},toSVG:async function renderToSVG(e){const t=await renderHeadless(this,so.SVG,e);return t.svg()},getState:function vega_view_module_getState(e){return this._runtime.getState(e||{data:dataTest,signals:signalTest,recurse:!0})},setState:function vega_view_module_setState(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},e=>{e._trigger=!0}),this}});const Hg="view",jg="[",Yg="]",zg="{",Jg="}",Kg=":",Xg=",",qg="@",$g=">",eu=/[[\]{}]/,tu={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let nu,ru;function eventSelector(e,t,n){return nu=t||Hg,ru=n||tu,parseMerge(e.trim()).map(parseSelector)}function vega_event_selector_module_find(e,t,n,r,i){var o=e.length;let a=0,s;for(;t' after between selector: "+e;r=r.map(parseSelector);const i=parseSelector(e.slice(1).trim());{if(i.between)return{between:r,stream:i};i.between=r}return i}:function vega_event_selector_module_parseStream(t){const e={source:nu},n=[];let r=[0,0],i=0,o=0,a=t.length,s=0,A,l;if(t[a-1]===Jg){if(!(0<=(s=t.lastIndexOf(zg))))throw"Unmatched right brace: "+t;try{r=function parseThrottle(t){const e=t.split(Xg);if(!t.length||2{e=+e;if(e!=e)throw t;return e})}(t.substring(s+1,a-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,s).trim(),a=t.length,s=0}if(!a)throw t;t[0]===qg&&(i=++s);(A=vega_event_selector_module_find(t,s,Kg))+e||0;const ou=e=>Object(B.H)(e)&&!Object(B.B)(e)?Object(B.p)({},e):{value:e};function addEncode(e,t,n,r){null!=n&&(Object(B.H)(n)&&!Object(B.B)(n)||Object(B.B)(n)&&n.length&&Object(B.H)(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n})}function addEncoders(e,t,n){for(const r in t)addEncode(e,r,t[r]);for(const i in n)addEncode(e,i,n[i],"update")}function extendEncode(e,t,n){for(const r in t)n&&Object(B.w)(n,r)||(e[r]=Object(B.p)(e[r]||{},t[r]));return e}function has(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const au="mark",su="frame",Au="scope",lu="axis",cu="axis-domain",gu="axis-grid",uu="axis-label",du="axis-tick",hu="axis-title",pu="legend",fu="legend-band",Iu="legend-entry",Cu="legend-gradient",mu="legend-label",yu="legend-symbol",Bu="legend-title",bu="title",vu="title-text",Eu="title-subtitle";function applyDefault(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const Qu=e=>Object(B.J)(e)?Object(B.bb)(e):e.signal?`(${e.signal})`:vega_parser_module_field(e);function entry$1(e){if(null!=e.gradient)return function vega_parser_module_gradient(e){const t=[e.start,e.stop,e.count].map(e=>null==e?null:Object(B.bb)(e));for(;t.length&&null==Object(B.W)(t);)t.pop();return t.unshift(Qu(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function vega_parser_module_color(e){return e.c?wu("hcl",e.h,e.c,e.l):e.h||e.s?wu("hsl",e.h,e.s,e.l):e.l||e.a?wu("lab",e.l,e.a,e.b):e.r||e.g||e.b?wu("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?vega_parser_module_field(e.field):void 0!==e.value?Object(B.bb)(e.value):void 0;return void 0===(t=null!=e.scale?function vega_parser_module_scale(e,t){var n=Qu(e.scale);null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+vega_parser_module_property(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0"));return t}(e,t):t)&&(t=null),null!=e.exponent&&(t=`pow(${t},${vega_parser_module_property(e.exponent)})`),null!=e.mult&&(t+="*"+vega_parser_module_property(e.mult)),null!=e.offset&&(t+="+"+vega_parser_module_property(e.offset)),t=e.round?`round(${t})`:t}const wu=(e,t,n,r)=>`(${e}(${[t,n,r].map(entry$1).join(",")})+'')`;function vega_parser_module_property(e){return Object(B.H)(e)?"("+entry$1(e)+")":e}function vega_parser_module_field(e){return function resolveField(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";0{var t=i.style&&i.style[e];for(const n in t)has(n,r)||applyDefault(o,n,t[n])}),r=Object(B.p)({},r),o)(l=o[A]).signal?(s=s||{})[A]=l:a[A]=l;return r.enter=Object(B.p)(a,r.enter),s&&(r.update=Object(B.p)(s,r.update)),r}(e,t,n,r,i.config))a[s]=function parseBlock(e,t,n,r){const i={},o={};for(const a in e)null!=e[a]&&(i[a]=function parse$1(e,t,n,r){const i=vega_functions_module_parser(e,t);return i.$fields.forEach(e=>r[e]=1),Object(B.p)(n,i.$params),i.$expr}(function vega_parser_module_expr(e){return(Object(B.B)(e)?function vega_parser_module_rule(e){let n="";return e.forEach(e=>{var t=entry$1(e);n+=e.test?`(${e.test})?${t}:`:t}),":"===Object(B.W)(n)&&(n+="null"),n}:entry$1)(e)}(e[a]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}(e[s],t,o,i);return o}const Su="outer",_u=["value","update","init","react","bind"];function outerError(e,t){Object(B.o)(e+' for "outer" push: '+Object(B.bb)(t))}function parseSignal(t,e){var n=t.name;if(t.push===Su)e.signals[n]||outerError("No prior signal definition",n),_u.forEach(e=>{void 0!==t[e]&&outerError("Invalid property ",e)});else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function Entry(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function vega_parser_module_entry(e,t,n,r){return new Entry(e,t,n,r)}function operator(e,t){return vega_parser_module_entry("operator",e,t)}function vega_parser_module_ref(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function fieldRef$1(e,t){return t?{$field:e,$name:t}:{$field:e}}const xu=fieldRef$1("key");function compareRef(e,t){return{$compare:e,$order:t}}const Ru="descending";function aggrField(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const Fu="scope",Du="view";function isSignal(e){return e&&e.signal}function hasSignal(e){if(isSignal(e))return 1;if(Object(B.H)(e))for(const t in e)if(hasSignal(e[t]))return 1}function vega_parser_module_value(e,t){return null!=e?e:t}function deref(e){return e&&e.signal||e}const Gu="timer";function vega_parser_module_parseStream(e,t){const n=e.merge?mergeStream:e.stream?nestedStream:e.type?eventStream:Object(B.o)("Invalid stream specification: "+Object(B.bb)(e));return n(e,t)}function mergeStream(e,t){e=streamParameters({merge:e.merge.map(e=>vega_parser_module_parseStream(e,t))},e,t);return t.addStream(e).id}function nestedStream(e,t){e=streamParameters({stream:vega_parser_module_parseStream(e.stream,t)},e,t);return t.addStream(e).id}function eventStream(e,t){let n;e.type===Gu?(n=t.event(Gu,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function eventSource(e){return e!==Fu&&e||Du}(e.source),e.type);e=streamParameters({stream:n},e,t);return 1===Object.keys(e).length?n:t.addStream(e).id}function streamParameters(e,t,n){let r=t.between;return r&&(2!==r.length&&Object(B.o)('Stream "between" parameter must have 2 entries: '+Object(B.bb)(t)),e.between=[vega_parser_module_parseStream(r[0],n),vega_parser_module_parseStream(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function filterMark(e,t,n){var r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===Fu&&r.push("inScope(event.item)"),r.length&&(e.filter=vega_functions_module_parser("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const Nu={code:"_.$value",ast:{type:"Identifier",value:"value"}};function vega_parser_module_parseUpdate(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||Object(B.o)("Signal update missing events specification."),Object(B.J)(o)&&(o=eventSelector(o,t.isSubscope()?Fu:Du)),o=Object(B.i)(o).filter(e=>e.signal||e.scale?(s.push(e),0):1),1e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}(s)]),o.length&&s.push(1t.addUpdate(Object(B.p)(function streamSource(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):vega_parser_module_parseStream(e,t)}}(e,t),i)))}n=r=>(e,t,n)=>vega_parser_module_entry(r,t,e||void 0,n);const ku=n("aggregate"),Tu=n("axisticks"),Mu=n("bound"),Uu=n("collect"),Ou=n("compare"),Lu=n("datajoin"),Pu=n("encode"),Vu=n("expression"),Zu=n("facet"),Wu=n("field"),Hu=n("key"),ju=n("legendentries"),Yu=n("load"),zu=n("mark"),Ju=n("multiextent"),Ku=n("multivalues"),Xu=n("overlap"),qu=n("params"),$u=n("prefacet"),ed=n("projection"),td=n("proxy"),nd=n("relay"),rd=n("render"),id=n("scale"),od=n("sieve"),ad=n("sortitems"),sd=n("viewlayout"),Ad=n("values");let ld=0;const cd={min:"min",max:"max",count:"sum"};function parseScale(e,t){const n=t.getScale(e.name).params;let r;for(r in n.domain=parseScaleDomain(e.domain,e,t),null!=e.range&&(n.range=function parseScaleRange(e,t,n){const r=t.config.range;let i=e.range;{if(i.signal)return t.signalRef(i.signal);if(Object(B.J)(i)){if(r&&Object(B.w)(r,i))return e=Object(B.p)({},e,{range:r[i]}),parseScaleRange(e,t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=isDiscrete(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(B.o)("Unrecognized scale range value: "+Object(B.bb)(i))}else{if(i.scheme)return n.scheme=(Object(B.B)(i.scheme)?parseArray:parseLiteral)(i.scheme,t),i.extent&&(n.schemeExtent=parseArray(i.extent,t)),void(i.count&&(n.schemeCount=parseLiteral(i.count,t)));if(i.step)return void(n.rangeStep=parseLiteral(i.step,t));if(isDiscrete(e.type)&&!Object(B.B)(i))return parseScaleDomain(i,e,t);Object(B.B)(i)||Object(B.o)("Unsupported range type: "+Object(B.bb)(i))}}return i.map(e=>(Object(B.B)(e)?parseArray:parseLiteral)(e,t))}(e,t,n)),null!=e.interpolate&&!function parseScaleInterpolate(e,t){t.interpolate=parseLiteral(e.type||e),null!=e.gamma&&(t.interpolateGamma=parseLiteral(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function parseScaleNice(e){return Object(B.H)(e)?{interval:parseLiteral(e.interval),step:parseLiteral(e.step)}:parseLiteral(e)}(e.nice)),null!=e.bins&&(n.bins=function parseScaleBins(e,t){return e.signal||Object(B.B)(e)?parseArray(e,t):t.objectProperty(e)}(e.bins,t)),e)Object(B.w)(n,r)||"name"===r||(n[r]=parseLiteral(e[r],t))}function parseLiteral(e,t){return Object(B.H)(e)?e.signal?t.signalRef(e.signal):Object(B.o)("Unsupported object: "+Object(B.bb)(e)):e}function parseArray(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>parseLiteral(e,t))}function dataLookupError(e){Object(B.o)("Can not find data set: "+Object(B.bb)(e))}function parseScaleDomain(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Object(B.B)(e)?explicitDomain:e.fields?multipleDomain:singularDomain)(e,t,n);null==t.domainMin&&null==t.domainMax||Object(B.o)("No scale domain defined for domainMin/domainMax to override.")}function explicitDomain(e,t,n){return e.map(e=>parseLiteral(e,n))}function singularDomain(e,t,n){const r=n.getData(e.data);return r||dataLookupError(e.data),isDiscrete(t.type)?r.valuesRef(n,e.field,parseSort(e.sort,!1)):isQuantile(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function multipleDomain(e,t,n){const r=e.data,i=e.fields.reduce((e,t)=>(t=Object(B.J)(t)?{data:r,field:t}:Object(B.B)(t)||t.signal?function fieldRef(e,t){const n="_:vega:_"+ld++,r=Uu({});Object(B.B)(e)?r.value={$ingest:e}:e.signal&&(e="setdata("+Object(B.bb)(n)+","+e.signal+")",r.params.input=t.signalRef(e));return t.addDataPipeline(n,[r,od({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e),[]);return(isDiscrete(t.type)?function ordinalMultipleDomain(e,n,t){const r=parseSort(e.sort,!0);let i,o;const a=t.map(e=>{const t=n.getData(e.data);return t||dataLookupError(e.data),t.countsRef(n,e.field,r)}),s={groupby:xu,pulse:a};r&&(i=r.op||"count",o=r.field?aggrField(i,r.field):"count",s.ops=[cd[i]],s.fields=[n.fieldRef(o)],s.as=[o]);i=n.add(ku(s));e=n.add(Uu({pulse:vega_parser_module_ref(i)}));return o=n.add(Ad({field:xu,sort:n.sortRef(r),pulse:vega_parser_module_ref(e)})),vega_parser_module_ref(o)}:isQuantile(t.type)?function quantileMultipleDomain(e,n,t){t=t.map(e=>{const t=n.getData(e.data);return t||dataLookupError(e.data),t.domainRef(n,e.field)});return vega_parser_module_ref(n.add(Ku({values:t})))}:function numericMultipleDomain(e,n,t){t=t.map(e=>{const t=n.getData(e.data);return t||dataLookupError(e.data),t.extentRef(n,e.field)});return vega_parser_module_ref(n.add(Ju({extents:t})))})(e,n,i)}function parseSort(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!cd[e.op]&&Object(B.o)("Multiple domain scales can not be sorted using "+e.op):Object(B.o)("No field provided for sort aggregate op: "+e.op):Object(B.H)(e)?e.field="key":e={field:"key"}),e}function parseParameter$1(e,t,n){return Object(B.B)(e)?e.map(e=>parseParameter$1(e,t,n)):Object(B.H)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:Object(B.o)("Unsupported parameter object: "+Object(B.bb)(e)):e}const gd="top",ud="left",dd="right",hd="bottom";const pd="vertical";const fd="index",Id="label",Cd="offset",md="perc",yd="perc2",Bd="value",bd="guide-label",vd="guide-title",Ed="group-title",Qd="group-subtitle",wd="symbol",Sd="gradient",_d="discrete",xd="size";const Rd=[xd,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Fd={name:1,style:1,interactive:1},E={value:0},Dd={value:1},Gd="group",Nd="rect",kd="rule",Td="symbol",Md="text";function guideGroup(e){return e.type=Gd,e.interactive=e.interactive||!1,e}function vega_parser_module_lookup(n,r){const e=(e,t)=>vega_parser_module_value(n[e],vega_parser_module_value(r[e],t));return e.isVertical=e=>pd===vega_parser_module_value(n.direction,r.direction||(e?r.symbolDirection:r.gradientDirection)),e.gradientLength=()=>vega_parser_module_value(n.gradientLength,r.gradientLength||r.gradientWidth),e.gradientThickness=()=>vega_parser_module_value(n.gradientThickness,r.gradientThickness||r.gradientHeight),e.entryColumns=()=>vega_parser_module_value(n.columns,vega_parser_module_value(r.columns,+e.isVertical(!0))),e}function getEncoding(e,t){t=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return t&&t.signal?t:t?t.value:null}function anchorExpr(e,t,n){return`item.anchor === 'start' ? ${e} : item.anchor === 'end' ? ${t} : `+n}const Ud=anchorExpr(Object(B.bb)(ud),Object(B.bb)(dd),Object(B.bb)("center"));function guideMark(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=extendEncode(e.encode,t,Fd)):e.interactive=!1,e}const Od=`datum.${md}<=0?"${ud}":datum.${md}>=1?"${dd}":"center"`,Ld=`datum.${md}<=0?"${hd}":datum.${md}>=1?"${gd}":"middle"`;function legendGradientLabels(e,t,n,r){const i=vega_parser_module_lookup(e,t),o=i.isVertical(),a=ou(i.gradientThickness()),s=i.gradientLength();let A=i("labelOverlap"),l,c,g,u,d="";var h={enter:l={opacity:E},update:c={opacity:Dd,text:{field:Id}},exit:{opacity:E}};return addEncoders(h,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:vega_parser_module_value(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:Ld},g="y",u="x",d="1-"):(l.align=c.align={signal:Od},l.baseline={value:"top"},g="x",u="y"),l[g]=c[g]={signal:d+"datum."+md,mult:s},(l[u]=c[u]=a).offset=vega_parser_module_value(e.labelOffset,t.gradientLabelOffset)||0,A=A?{separation:i("labelSeparation"),method:A,order:"datum."+fd}:void 0,guideMark({type:Md,role:mu,style:bd,key:Bd,from:r,encode:h,overlap:A},n)}const Pd='item.orient === "left"',Vd='item.orient === "right"',Zd=`(${Pd} || ${Vd})`,Wd=`datum.vgrad && ${Vd} ? (item.anchor === 'start' ? "right" : item.anchor === 'end' ? "left" : "center") : (${Zd} && !(datum.vgrad && ${Pd})) ? "left" : `+Ud,Hd=`item._anchor || (${Zd} ? "middle" : "start")`,jd=`datum.vgrad && (item.orient === "left" || item.orient === "right") ? (${Pd} ? -90 : 90) : 0`,Yd=Zd+` ? (datum.vgrad ? (${Vd} ? "bottom" : "top") : item.anchor === 'start' ? "top" : item.anchor === 'end' ? "bottom" : "middle") : "top"`;function vega_parser_module_param(e){return Object(B.H)(e)&&e.signal?e.signal:Object(B.bb)(e)}function getRole(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===Gd?Au:t||au:t}function parseTransform(e,t){const n=definition(e.type),r=(n||Object(B.o)("Unrecognized transform type: "+Object(B.bb)(e.type)),vega_parser_module_entry(n.type.toLowerCase(),null,vega_parser_module_parseParameters(n,e,t)));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function vega_parser_module_parseParameters(t,n,r){const i={},o=t.params.length;for(let e=0;eparseSubParameter(t,e,n))):parseSubParameter(t,r,n)}(t,e,n);if("projection"===r)return n.projectionRef(e[t.name])}return t.array&&!isSignal(i)?i.map(e=>parameterValue(t,e,n)):parameterValue(t,i,n)}(a,n,r)}return i}function parameterValue(e,t,n){var r=e.type;return isSignal(t)?Xd(r)?Object(B.o)("Expression references can not be signals."):qd(r)?n.fieldRef(t):$d(r)?n.compareRef(t):n.signalRef(t.signal):(e=e.expr||qd(r))&&zd(t)?n.exprRef(t.expr,t.as):e&&Jd(t)?fieldRef$1(t.field,t.as):Xd(r)?vega_functions_module_parser(t,n):Kd(r)?vega_parser_module_ref(n.getData(t).values):qd(r)?fieldRef$1(t):$d(r)?n.compareRef(t):t}function parseSubParameter(t,n,e){var r=t.params.length;let i;for(let e=0;ee&&e.expr,Jd=e=>e&&e.field,Kd=e=>"data"===e,Xd=e=>"expr"===e,qd=e=>"field"===e,$d=e=>"compare"===e;function getDataRef(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:vega_parser_module_ref(t.getData(e.data).output)}function DataScope(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function fieldKey(e){return Object(B.J)(e)?e:null}function addSortField(e,n,t){var r,i=aggrField(t.op,t.field);if(n.ops){for(let e=0,t=n.as.length;enull==e?"null":e).join(",")+"),0)",t);A.update=e.$expr,A.params=e.$params}function parseMark(e,r){var t=getRole(e),n=e.type===Gd,i=e.from&&e.from.facet,o=e.overlap;let a=e.layout||t===Au||t===su,s,A,l,c,g,u,d;var h=t===au||a||i,p=function parseData$1(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||Object(B.o)("Only group marks can be faceted."),null!=r.field?a=s=getDataRef(r,n):(e.data?s=vega_parser_module_ref(n.getData(e.data).aggregate):((o=parseTransform(Object(B.p)({type:"aggregate",groupby:Object(B.i)(r.groupby)},r.aggregate),n)).params.key=n.keyRef(r.groupby),o.params.pulse=getDataRef(r,n),a=s=vega_parser_module_ref(n.add(o))),i=n.keyRef(r.groupby,!0))):a=vega_parser_module_ref(n.add(Uu(null,[{}]))),a=a||getDataRef(e,n),{key:i,pulse:a,parent:s}}(e.from,n,r),f=vega_parser_module_ref(A=r.add(Lu({key:p.key||(e.key?fieldRef$1(e.key):void 0),pulse:p.pulse,clean:!n}))),I=(A=l=r.add(Uu({pulse:f})),A=r.add(zu({markdef:function vega_parser_module_definition(e){return{marktype:e.type,name:e.name||void 0,role:e.role||getRole(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}(e),interactive:function vega_parser_module_interactive(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}(e.interactive,r),clip:function vega_parser_module_clip(e,t){let n;return Object(B.H)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+vega_parser_module_param(e.path)+")":e.sphere&&(n="geoShape("+vega_parser_module_param(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}(e.clip,r),context:{$context:!0},groups:r.lookup(),parent:r.signals.parent?r.signalRef("parent"):null,index:r.markpath(),pulse:vega_parser_module_ref(A)})),vega_parser_module_ref(A)),t=((A=c=r.add(Pu(parseEncode(e.encode,e.type,t,e.style,r,{mod:!1,pulse:I})))).params.parent=r.encode(),e.transform&&e.transform.forEach(e=>{const t=parseTransform(e,r),n=t.metadata;(n.generates||n.changes)&&Object(B.o)("Mark transforms should not generate new data."),n.nomod||(c.params.mod=!0),t.params.pulse=vega_parser_module_ref(A),r.add(A=t)}),e.sort&&(A=r.add(ad({sort:r.compareRef(e.sort),pulse:vega_parser_module_ref(A)}))),vega_parser_module_ref(A)),I=((i||a)&&(a=r.add(sd({layout:r.objectProperty(e.layout),legends:r.legends,mark:I,pulse:t})),u=vega_parser_module_ref(a)),r.add(Mu({mark:I,pulse:u||t}))),n=(d=vega_parser_module_ref(I),n&&(h&&((s=r.operators).pop(),a&&s.pop()),r.pushState(t,u||d,f),i?function parseFacet(e,t,n){var r=e.from.facet,i=r.name,o=getDataRef(r,t);let a;r.name||Object(B.o)("Facet must have a name: "+Object(B.bb)(r)),r.data||Object(B.o)("Facet must reference a data set: "+Object(B.bb)(r)),r.field?a=t.add($u({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(Zu({key:t.keyRef(r.groupby),group:vega_parser_module_ref(t.proxy(n.parent)),pulse:o})):Object(B.o)("Facet must specify groupby or field: "+Object(B.bb)(r));const s=t.fork(),A=s.add(Uu()),l=s.add(od({pulse:vega_parser_module_ref(A)}));s.addData(i,new DataScope(s,A,A,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,r,p):h?function parseSubflow(e,t,n){const r=t.add($u({pulse:n.pulse})),i=t.fork();i.add(od()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,r,p):r.parse(e),r.popState(),h&&(a&&s.push(a),s.push(I))),o&&(d=function parseOverlap(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:isSignal(o)?n.signalRef(o.signal):o,method:isSignal(r)?n.signalRef(r.signal):r,pulse:t};e.order&&(a.sort=n.compareRef({field:e.order}));i&&(t=i.tolerance,a.boundTolerance=isSignal(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient);return vega_parser_module_ref(n.add(Xu(a)))}(o,d,r)),r.add(rd({pulse:d}))),t=r.add(od({pulse:vega_parser_module_ref(n)},void 0,r.parent()));null!=e.name&&(g=e.name,r.addData(g,new DataScope(r,l,n,t)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&Object(B.o)("Marks only support modify triggers."),parseTrigger(e,r,g)}))}function parseLegend(t,e){const n=e.config.legend,r=t.encode||{},i=vega_parser_module_lookup(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,A=o.style,l={};let c=0,g,u,d;Rd.forEach(e=>t[e]?(l[e]=t[e],c=c||t[e]):0),c||Object(B.o)("Missing valid scale for legend.");var h=function legendType(e,t){let n=e.type||wd;e.type||1!==function scaleCount(n){return Rd.reduce((e,t)=>e+(n[t]?1:0),0)}(e)||!e.fill&&!e.stroke||(n=isContinuous(t)?Sd:isDiscretizing(t)?_d:wd);return n!==Sd?n:isDiscretizing(t)?_d:Sd}(t,e.scaleType(c)),p={title:null!=t.title,scales:l,type:h,vgrad:"symbol"!==h&&i.isVertical()},f=vega_parser_module_ref(e.add(Uu(null,[p]))),I=vega_parser_module_ref(e.add(ju(u={type:h,scale:e.scaleRef(c),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return h===Sd?(d=[function legendGradient(e,t,n,r){const i=vega_parser_module_lookup(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let A,l,c,g,u;return u=o?(l=[0,1],c=[0,0],g=a,s):(l=[0,0],c=[1,0],g=s,a),addEncoders(e={enter:A={opacity:E,x:E,y:E,width:ou(g),height:ou(u)},update:Object(B.p)({},A,{opacity:Dd,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:E}},{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),guideMark({type:Nd,role:Cu,encode:e},r)}(t,c,n,r.gradient),legendGradientLabels(t,n,r.labels,I)],u.count=u.count||e.signalRef(`max(2,2*floor((${deref(i.gradientLength())})/100))`)):h===_d?d=[function legendGradientDiscrete(e,t,n,r,i){const o=vega_parser_module_lookup(e,n),a=o.isVertical(),s=o.gradientThickness(),A=o.gradientLength();let l,c,g,u,d="";a?(l="y",g="y2",c="x",u="width",d="1-"):(l="x",g="x2",c="y",u="height");const h={opacity:E,fill:{scale:t,field:Bd}};return h[l]={signal:d+"datum."+md,mult:A},h[c]=E,h[g]={signal:d+"datum."+yd,mult:A},h[u]=ou(s),addEncoders(e={enter:h,update:Object(B.p)({},h,{opacity:Dd}),exit:{opacity:E}},{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),guideMark({type:Nd,role:fu,key:Bd,from:i,encode:e},r)}(t,c,n,r.gradient,I),legendGradientLabels(t,n,r.labels,I)]:(g=function legendSymbolLayout(e,t){const n=vega_parser_module_lookup(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[function legendSymbolGroups(t,e,n,r,i){const o=vega_parser_module_lookup(t,e),a=n.entries,s=!(!a||!a.interactive),A=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),g={data:"value"},u=`(${i}) ? datum.${Cd} : datum.`+xd,d=l?ou(l):{field:xd},h="datum."+fd,p=`max(1, ${i})`;let f,I,C,m,y,B=(d.mult=.5,f={enter:I={opacity:E,x:{signal:u,mult:.5,offset:c},y:d},update:C={opacity:Dd,x:I.x,y:I.y},exit:{opacity:E}},null),b=null;t.fill||(B=e.symbolBaseFillColor,b=e.symbolBaseStrokeColor),addEncoders(f,{fill:o("symbolFillColor",B),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",b),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),Rd.forEach(e=>{t[e]&&(C[e]=I[e]={scale:t[e],field:Bd})}),e=guideMark({type:Td,role:yu,key:Bd,from:g,clip:!!l||void 0,encode:f},n.symbols);const v=ou(c);return v.offset=o("labelOffset"),addEncoders(f={enter:I={opacity:E,x:{signal:u,offset:v},y:d},update:C={opacity:Dd,text:{field:Id},x:I.x,y:I.y},exit:{opacity:E}},{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")}),n=guideMark({type:Md,role:mu,style:bd,key:Bd,from:g,encode:f},n.labels),f={enter:{noBound:{value:!l},width:E,height:l?ou(l):E,opacity:E},exit:{opacity:E},update:C={opacity:Dd,row:{signal:null},column:{signal:null}}},y=o.isVertical(!0)?(m=`ceil(item.mark.items.length / ${p})`,C.row.signal=h+"%"+m,C.column.signal=`floor(${h} / ${m})`,{field:["row",h]}):(C.row.signal=`floor(${h} / ${p})`,C.column.signal=h+" % "+p,{field:h}),C.column.signal=`(${i})?${C.column.signal}:`+h,r={facet:{data:r,name:"value",groupby:fd}},guideGroup({role:Au,from:r,encode:extendEncode(f,a,Fd),marks:[e,n],name:A,interactive:s,sort:y})}(t,n,r,I,deref(g.columns))],u.size=function sizeExpression(e,t,n){var r=deref(getChannel("size",e,n)),e=deref(getChannel("strokeWidth",e,n)),n=deref(function getFontSize(e,t,n){return getEncoding("fontSize",e)||function getStyle(e,t,n){return(t=t.config.style[n])&&t[e]}("fontSize",t,n)}(n[1].encode,t,bd));return vega_functions_module_parser(`max(ceil(sqrt(${r})+${e}),${n})`,t)}(t,e,d[0].marks)),d=[guideGroup({role:Iu,from:f,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:g,interactive:s})],p.title&&d.push(function legendTitle(e,t,n,r){const i=vega_parser_module_lookup(e,t);return addEncoders(t={enter:{opacity:E},update:{opacity:Dd,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:E}},{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Hd},angle:{signal:jd},align:{signal:Wd},baseline:{signal:Yd},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),guideMark({type:Md,role:Bu,style:vd,from:r,encode:t},n)}(t,n,r.title,f)),parseMark(guideGroup({role:pu,from:f,encode:extendEncode(function buildLegendEncode(e,t,n){var r={enter:{},update:{}};return addEncoders(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}(i,t,n),o,Fd),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:A}),e)}function getChannel(e,t,n){return t[e]?`scale("${t[e]}",datum)`:getEncoding(e,n[0].encode)}DataScope.fromEntries=function(e,t){var n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);s{r.push(parseTransform(e,n))}),t.on&&t.on.forEach(e=>{parseTrigger(e,n,t.name)}),n.addDataPipeline(t.name,function analyze(e,t,n){const r=[];let i=null,o=!1,a=!1,s,A,l,c,g;e.values?isSignal(e.values)||hasSignal(e.format)?(r.push(load(t,e)),r.push(i=collect())):r.push(i=collect({$ingest:e.values,$format:e.format})):e.url?hasSignal(e.url)||hasSignal(e.format)?(r.push(load(t,e)),r.push(i=collect())):r.push(i=collect({$request:e.url,$format:e.format})):e.source&&(i=s=Object(B.i)(e.source).map(e=>vega_parser_module_ref(t.getData(e).output)),r.push(null));for(A=0,l=n.length;Ae===hd||e===gd,nh=(e,t,n)=>isSignal(e)?lh(e.signal,t,n):e===ud||e===gd?t:n,rh=(e,t,n)=>isSignal(e)?sh(e.signal,t,n):th(e)?t:n,ih=(e,t,n)=>isSignal(e)?Ah(e.signal,t,n):th(e)?n:t,oh=(e,t,n)=>isSignal(e)?ch(e.signal,t,n):e===gd?{value:t}:{value:n},ah=(e,t,n)=>isSignal(e)?gh(e.signal,t,n):e===dd?{value:t}:{value:n},sh=(e,t,n)=>uh(`${e} === '${gd}' || ${e} === '${hd}'`,t,n),Ah=(e,t,n)=>uh(`${e} !== '${gd}' && ${e} !== '${hd}'`,t,n),lh=(e,t,n)=>hh(`${e} === '${ud}' || ${e} === '${gd}'`,t,n),ch=(e,t,n)=>hh(`${e} === '${gd}'`,t,n),gh=(e,t,n)=>hh(`${e} === '${dd}'`,t,n),uh=(e,t,n)=>(t=null!=t?ou(t):t,n=null!=n?ou(n):n,dh(t)&&dh(n)?{signal:e+` ? (${t=t?t.signal||Object(B.bb)(t.value):null}) : (${n=n?n.signal||Object(B.bb)(n.value):null})`}:[Object(B.p)({test:e},t)].concat(n||[])),dh=e=>null==e||1===Object.keys(e).length,hh=(e,t,n)=>({signal:`${e} ? (${fh(t)}) : (${fh(n)})`}),ph=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${ud}' ? (${fh(r)}) : `:"")+(null!=n?`${e} === '${hd}' ? (${fh(n)}) : `:"")+(null!=i?`${e} === '${dd}' ? (${fh(i)}) : `:"")+(null!=t?`${e} === '${gd}' ? (${fh(t)}) : `:"")+"(null)"}),fh=e=>isSignal(e)?e.signal:null==e?null:Object(B.bb)(e),Ih=(e,t)=>0===t?0:isSignal(e)?{signal:`(${e.signal}) * `+t}:{value:e*t},Ch=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function fallback(e,t,n,r){let i;if(t&&Object(B.w)(t,e))return t[e];if(Object(B.w)(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[vd][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[bd][i]}return null}function vega_parser_module_keys(e){const t={};for(const n of e)if(n)for(const r in n)t[r]=1;return Object.keys(t)}function vega_parser_module_position(e,t){return{scale:e.scale,range:t}}function axisGrid(e,t,n,r,i){const o=vega_parser_module_lookup(e,t),a=e.orient,s=e.gridScale,A=nh(a,1,-1),l=function vega_parser_module_offsetValue(t,n){if(1!==n)if(Object(B.H)(t)){let e=t=Object(B.p)({},t);for(;null!=e.mult;){if(!Object(B.H)(e.mult))return e.mult=isSignal(n)?{signal:`(${e.mult}) * (${n.signal})`}:e.mult*n,t;e=e.mult=Object(B.p)({},e.mult)}e.mult=n}else t=isSignal(n)?{signal:`(${n.signal}) * (${t||0})`}:n*(t||0);return t}(e.offset,A);let c,g,u;var t={enter:c={opacity:E},update:u={opacity:Dd},exit:g={opacity:E}},e=(addEncoders(t,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")}),{scale:e.scale,field:Bd,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")}),i=rh(a,{signal:"height"},{signal:"width"}),d=s?{scale:s,range:0,mult:A,offset:l}:{value:0,offset:l},i=s?{scale:s,range:1,mult:A,offset:l}:Object(B.p)(i,{mult:A,offset:l});return c.x=u.x=rh(a,e,d),c.y=u.y=ih(a,e,d),c.x2=u.x2=ih(a,i),c.y2=u.y2=rh(a,i),g.x=rh(a,e),g.y=ih(a,e),guideMark({type:kd,role:gu,key:Bd,from:r,encode:t},n)}function flushExpr(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function axisLabels(e,t,n,r,i,o){const a=vega_parser_module_lookup(e,t),s=e.orient,A=e.scale,l=nh(s,-1,1),c=deref(a("labelFlush")),g=deref(a("labelFlushOffset")),u=a("labelAlign"),d=a("labelBaseline");let h=0===c||!!c,p;const f=ou(i);f.mult=l,f.offset=ou(a("labelPadding")||0),f.offset.mult=l;t={scale:A,field:Bd,band:.5,offset:function extendOffset(e,t){return t?e?Object(B.H)(e)?Object.assign({},e,{offset:extendOffset(e.offset,t)}):{value:e,offset:t}:t:e}(o.offset,a("labelOffset"))},e=rh(s,h?flushExpr(A,c,'"left"','"right"','"center"'):{value:"center"},ah(s,"left","right")),i=rh(s,oh(s,"bottom","top"),h?flushExpr(A,c,'"top"','"bottom"','"middle"'):{value:"middle"}),o=flushExpr(A,c,`-(${g})`,g,0),h=h&&g,t={opacity:E,x:rh(s,t,f),y:ih(s,t,f)},t={enter:t,update:p={opacity:Dd,text:{field:Id},x:t.x,y:t.y,align:e,baseline:i},exit:{opacity:E,x:t.x,y:t.y}},addEncoders(t,{dx:!u&&h?rh(s,o):null,dy:!d&&h?ih(s,o):null}),addEncoders(t,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:u,baseline:d}),o=a("labelBound");let I=a("labelOverlap");return I=I||o?{separation:a("labelSeparation"),method:I,order:"datum.index",bound:o?{scale:A,orient:s,tolerance:o}:null}:void 0,p.align!==e&&(p.align=Ch(p.align,e)),p.baseline!==i&&(p.baseline=Ch(p.baseline,i)),guideMark({type:Md,role:uu,style:bd,key:Bd,from:r,encode:t,overlap:I},n)}function axisTitle(e,t,n,r){const i=vega_parser_module_lookup(e,t),o=e.orient,a=nh(o,-1,1);let s,A;const l={enter:s={opacity:E,anchor:ou(i("titleAnchor",null)),align:{signal:Ud}},update:A=Object(B.p)({},s,{opacity:Dd,text:ou(e.title)}),exit:{opacity:E}};t={signal:`lerp(range("${e.scale}"), ${anchorExpr(0,1,.5)})`};return A.x=rh(o,t),A.y=ih(o,t),s.angle=rh(o,E,Ih(a,90)),s.baseline=rh(o,oh(o,hd,gd),{value:hd}),A.angle=s.angle,A.baseline=s.baseline,addEncoders(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function autoLayout(e,t,n,r){var i=(e,t)=>null!=e?(n.update[t]=Ch(ou(e),n.update[t]),!1):!has(t,r),o=i(e("titleX"),"x"),i=i(e("titleY"),"y");n.enter.auto=i===o?ou(i):rh(t,ou(i),ou(o))}(i,o,l,n),l.update.align=Ch(l.update.align,s.align),l.update.angle=Ch(l.update.angle,s.angle),l.update.baseline=Ch(l.update.baseline,s.baseline),guideMark({type:Md,role:hu,style:vd,from:r,encode:l},n)}function parseAxis(e,t){const n=function vega_parser_module_axisConfig(e,t){var n,r,i=t.config,o=i.style,a=i.axis,t="band"===t.scaleType(e.scale)&&i.axisBand,s=e.orient;if(isSignal(s)){var e=vega_parser_module_keys([i.axisX,i.axisY]),A=vega_parser_module_keys([i.axisTop,i.axisBottom,i.axisLeft,i.axisRight]),l={};for(r of e)l[r]=rh(s,fallback(r,i.axisX,a,o),fallback(r,i.axisY,a,o));n={};for(r of A)n[r]=ph(s.signal,fallback(r,i.axisTop,a,o),fallback(r,i.axisBottom,a,o),fallback(r,i.axisLeft,a,o),fallback(r,i.axisRight,a,o))}else l=s===gd||s===hd?i.axisX:i.axisY,n=i["axis"+s[0].toUpperCase()+s.slice(1)];return l||n||t?Object(B.p)({},a,l,n,t):a}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,A=vega_parser_module_lookup(e,n),l=function tickBand(e){var t=e("tickBand");let n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},Object(B.H)(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : `+n})):"extent"===t?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}(A);var c={scale:e.scale,ticks:!!A("ticks"),labels:!!A("labels"),grid:!!A("grid"),domain:!!A("domain"),title:null!=e.title},g=vega_parser_module_ref(t.add(Uu({},[c]))),u=vega_parser_module_ref(t.add(Tu({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));const d=[];let h;return c.grid&&d.push(axisGrid(e,n,r.grid,u,l)),c.ticks&&(h=A("tickSize"),d.push(function axisTicks(e,t,n,r,i,o){const a=vega_parser_module_lookup(e,t),s=e.orient,A=nh(s,-1,1);let l,c,g;addEncoders(t={enter:l={opacity:E},update:g={opacity:Dd},exit:c={opacity:E}},{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const u=ou(i);return u.mult=A,i={scale:e.scale,field:Bd,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")},g.y=l.y=rh(s,E,i),g.y2=l.y2=rh(s,u),c.x=rh(s,i),g.x=l.x=ih(s,E,i),g.x2=l.x2=ih(s,u),c.y=ih(s,i),guideMark({type:kd,role:du,key:Bd,from:r,encode:t},n)}(e,n,r.ticks,u,h,l))),c.labels&&(h=c.ticks?h:0,d.push(axisLabels(e,n,r.labels,u,h,l))),c.domain&&d.push(function axisDomain(e,t,n,r){const i=vega_parser_module_lookup(e,t),o=e.orient;let a,s;addEncoders(t={enter:a={opacity:E},update:s={opacity:Dd},exit:{opacity:E}},{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});var A=vega_parser_module_position(e,0),e=vega_parser_module_position(e,1);return a.x=s.x=rh(o,A,E),a.x2=s.x2=rh(o,e),a.y=s.y=ih(o,A,E),a.y2=s.y2=ih(o,e),guideMark({type:kd,role:cu,from:r,encode:t},n)}(e,n,r.domain,g)),c.title&&d.push(axisTitle(e,n,r.title,g)),parseMark(guideGroup({role:lu,from:g,encode:extendEncode(function buildAxisEncode(e,t){var n={enter:{},update:{}};return addEncoders(n,{orient:e("orient"),offset:e("offset")||0,position:vega_parser_module_value(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}(A,e),i,Fd),marks:d,aria:A("aria"),description:A("description"),zindex:A("zindex"),name:o,interactive:a,style:s}),t)}function parseScope(e,t,n){const r=Object(B.i)(e.signals),i=Object(B.i)(e.scales);return n||r.forEach(e=>parseSignal(e,t)),Object(B.i)(e.projections).forEach(e=>function parseProjection(e,t){const n=t.config.projection||{},r={};for(const i in e)"name"!==i&&(r[i]=parseParameter$1(e[i],i,t));for(const o in n)null==r[o]&&(r[o]=parseParameter$1(n[o],o,t));t.addProjection(e.name,r)}(e,t)),i.forEach(e=>function initScale(e,t){var n=e.type||"linear";isValidScaleType(n)||Object(B.o)("Unrecognized scale type: "+Object(B.bb)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t)),Object(B.i)(e.data).forEach(e=>parseData(e,t)),i.forEach(e=>parseScale(e,t)),(n||r).forEach(e=>function parseSignalUpdates(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?Object(B.o)("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=vega_functions_module_parser(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(e=>vega_parser_module_parseUpdate(e,t,n.id))}(e,t)),Object(B.i)(e.axes).forEach(e=>parseAxis(e,t)),Object(B.i)(e.marks).forEach(e=>parseMark(e,t)),Object(B.i)(e.legends).forEach(e=>parseLegend(e,t)),e.title&&parseTitle(e.title,t),t.parseLambdas(),t}const mh=e=>extendEncode({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function parseView(e,t){var n=t.config,r=vega_parser_module_ref(t.root=t.add(operator()));const i=function collectSignals(t,n){const e=e=>vega_parser_module_value(t[e],n[e]),r=[signalObject("background",e("background")),signalObject("autosize",function parseAutosize(e){return Object(B.H)(e)?e:{type:e||"pad"}}(e("autosize"))),signalObject("padding",function parsePadding(e){return Object(B.H)(e)?e.signal?e:{top:iu(e.top),bottom:iu(e.bottom),left:iu(e.left),right:iu(e.right)}:{top:e=+e||0,bottom:e,left:e,right:e}}(e("padding"))),signalObject("width",e("width")||0),signalObject("height",e("height")||0)],i=r.reduce((e,t)=>(e[t.name]=t,e),{}),o={};return Object(B.i)(t.signals).forEach(e=>{Object(B.w)(i,e.name)?e=Object(B.p)(i[e.name],e):r.push(e),o[e.name]=e}),Object(B.i)(n.signals).forEach(e=>{Object(B.w)(o,e.name)||Object(B.w)(i,e.name)||r.push(e)}),r}(e,n);i.forEach(e=>parseSignal(e,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;var n=t.add(Uu()),o=t.add(Pu(parseEncode(mh(e.encode),Gd,su,e.style,t,{pulse:vega_parser_module_ref(n)}))),a=t.add(sd({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:vega_parser_module_ref(o)})),o=(t.operators.pop(),t.pushState(vega_parser_module_ref(o),vega_parser_module_ref(a),null),parseScope(e,t,i),t.operators.push(a),t.add(Mu({mark:r,pulse:vega_parser_module_ref(a)}))),o=t.add(rd({pulse:vega_parser_module_ref(o)}));return o=t.add(od({pulse:vega_parser_module_ref(o)})),t.addData("root",new DataScope(t,n,n,o)),t}function signalObject(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Scope(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Subscope(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function propertyLambda(e){return(Object(B.B)(e)?arrayLambda:objectLambda)(e)}function arrayLambda(t){var n=t.length;let r="[";for(let e=0;e{e.$ref=t.id}),t.refs=null),t},proxy(e){e=e instanceof Entry?vega_parser_module_ref(e):e;return this.add(td({value:e}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function annotate(e,t,n){let r,i;e&&(r=e.data||(e.data={}),(i=r[t]||(r[t]=[])).push(n))}for(e in this.data){annotate((t=this.data[e]).input,e,"input"),annotate(t.output,e,"output"),annotate(t.values,e,"values");for(const n in t.index)annotate(t.index[n],e,"index:"+n)}return this},pushState(e,t,n){this._encode.push(vega_parser_module_ref(this.add(od({pulse:e})))),this._parent.push(t),this._lookup.push(n?vega_parser_module_ref(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Object(B.W)(this._parent)},encode(){return Object(B.W)(this._encode)},lookup(){return Object(B.W)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Object(B.J)(e))return fieldRef$1(e,t);e.signal||Object(B.o)("Unsupported field reference: "+Object(B.bb)(e));e=e.signal;let n=this.field[e];if(!n){const r={name:this.signalRef(e)};t&&(r.as=t),this.field[e]=n=vega_parser_module_ref(this.add(Wu(r)))}return n},compareRef(e){let t=!1;var n=e=>isSignal(e)?(t=!0,this.signalRef(e.signal)):function isExpr$1(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=Object(B.i)(e.field).map(n),e=Object(B.i)(e.order).map(n);return t?vega_parser_module_ref(this.add(Ou({fields:r,orders:e}))):compareRef(r,e)},keyRef(e,t){let n=!1;const r=this.signals;return e=Object(B.i)(e).map(e=>isSignal(e)?(n=!0,vega_parser_module_ref(r[e.signal])):e),n?vega_parser_module_ref(this.add(Hu({fields:e,flat:t}))):function keyRef(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;var t=aggrField(e.op,e.field),e=e.order||"ascending";return e.signal?vega_parser_module_ref(this.add(Ou({fields:t,orders:this.signalRef(e.signal)}))):compareRef(t,e)},event(e,t){var n,r=e+":"+t;return this.events[r]||(n=this.id(),this.streams.push({id:n,source:e,type:t}),this.events[r]=n),this.events[r]},hasOwnSignal(e){return Object(B.w)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&Object(B.o)("Duplicate signal name: "+Object(B.bb)(e));t=t instanceof Entry?t:this.add(operator(t));return this.signals[e]=t},getSignal(e){return this.signals[e]||Object(B.o)("Unrecognized signal name: "+Object(B.bb)(e)),this.signals[e]},signalRef(e){return this.signals[e]?vega_parser_module_ref(this.signals[e]):(Object(B.w)(this.lambdas,e)||(this.lambdas[e]=this.add(operator(null))),vega_parser_module_ref(this.lambdas[e]))},parseLambdas(){var n=Object.keys(this.lambdas);for(let e=0,t=n.length;e{for(const t in e)if(!function isEqual(t,n){if(t===n)return 1;if(Array.isArray(t)){var r=t.length;if(!n||n.length!==r)return;for(let e=0;eMath.PI/2&&(o=0null!=e&&e==e;const t=e=>!(Number.isNaN(+e)||e instanceof Date);const p={boolean:A.cb,integer:A.eb,number:A.eb,date:A.db,string:A.gb,unknown:A.y},f=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>t(e)&&Number.isInteger(+e),t,e=>!Number.isNaN(Date.parse(e))],e=["boolean","integer","number","date"];function inferType(i,o){if(!i||!i.length)return"unknown";const a=i.length,s=f.length,A=f.map((e,t)=>t+1);for(let e=0,t=0,n,r;e0===e?t:e,0)-1]}function inferTypes(n,e){return e.reduce((e,t)=>(e[t]=inferType(n,t),e),{})}function delimitedFormat(r){function $S2(e,t){var n={delimiter:r};return dsv(e,t?Object(A.p)(t,n):n)}return $S2.responseType="text",$S2}function dsv(e,t){return t.header&&(e=t.header.map(A.bb).join(t.delimiter)+"\n"+e),Object(n.a)(t.delimiter).parse(e+"")}function json(e,t){const n=t&&t.property?Object(A.u)(t.property):A.y;return Object(A.H)(e)&&!function isBuffer(e){return"function"==typeof r&&Object(A.E)(r.isBuffer)&&r.isBuffer(e)}(e)?function parseJSON(e,t){!Object(A.B)(e)&&Object(A.F)(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t):n(JSON.parse(e))}dsv.responseType="text";const s={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function topojson(e,t){let n,r,i,o;return e=json(e,t),t&&t.feature?(n=a.a,i=t.feature):t&&t.mesh?(n=a.b,i=t.mesh,o=s[t.filter]):Object(A.o)("Missing TopoJSON feature or mesh parameter."),(r=(r=e.objects[i])?n(e,r,o):Object(A.o)("Invalid TopoJSON object: "+i))&&r.features||[r]}topojson.responseType=json.responseType="json";const i={dsv:dsv,csv:delimitedFormat(","),tsv:delimitedFormat("\t"),json:json,topojson:topojson};function formats(e,t){return 1{const t=A[e];let n,r;if(t&&(t.startsWith("date:")||t.startsWith("utc:"))){n=t.split(/:(.+)?/,2),("'"===(r=n[1])[0]&&"'"===r[r.length-1]||'"'===r[0]&&'"'===r[r.length-1])&&(r=r.slice(1,-1));const i="utc"===n[0]?c:l;return i(r)}if(p[t])return p[t];throw Error("Illegal format pattern: "+e+":"+t)});for(r=0,o=s.length,a=e.length;r({options:e||{},sanitize:async function sanitize(e,t){t=Object(A.p)({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,a;var s=c.test(e.replace(g,""));null!=e&&"string"==typeof e&&s||Object(A.o)("Sanitize failure, invalid URI: "+Object(A.bb)(e));s=l.test(e);(a=t.baseURL)&&!s&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e);o=(i=e.startsWith(u))||"file"===t.mode||"http"!==t.mode&&!s&&n,i?e=e.slice(u.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e);Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+"");t.rel&&(r.rel=t.rel+"");"image"===t.context&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+"");return r},load:async function load(e,t){var e=await this.sanitize(e,t),n=e.href;return e.localFile?this.file(n):this.http(n,t)},fileAccess:!!n,file:function fileLoader(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(e,t)=>{e?r(e):n(t)})}):fileReject}(n),http:function httpLoader(o){return o?async function(e,t){const n=Object(A.p)({},this.options.http,t),r=t&&t.response,i=await o(e,n);return i.ok?Object(A.E)(i[r])?i[r]():i.text():Object(A.o)(i.status+""+i.statusText)}:httpReject}(t)})}("undefined"!=typeof fetch&&fetch,null)}.call(this,C(301).Buffer)},function(e,t,n){"use strict";function formatDecimalParts(e,t){if((t=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n=e.slice(0,t);return[1{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const s={fetch:null,mimeType:void 0,nothrow:!1,log:new class loggers_ConsoleLog{constructor(){Object(a.a)(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},A={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function getGlobalLoaderState(){r.a.loaders=r.a.loaders||{};const e=r.a["loaders"];return e._state=e._state||{},e._state}const l=()=>{const e=getGlobalLoaderState();return e.globalOptions=e.globalOptions||{...s},e.globalOptions};function normalizeOptions(e,t,n,r){return n=n||[],function validateOptions(e,t){validateOptionsObject(e,null,s,A,t);for(const o of t){var n=e&&e[o.id]||{},r=o.options&&o.options[o.id]||{},i=o.deprecatedOptions&&o.deprecatedOptions[o.id]||{};validateOptionsObject(n,o.id,r,i,t)}}(e,n=Array.isArray(n)?n:[n]),normalizeOptionsInternal(t,e,r)}function getFetchFunction(e,t){var n=l();const r=e||n;return"function"==typeof r.fetch?r.fetch:Object(g.f)(r.fetch)?e=>fetchFile(e,r):null!=t&&t.fetch?null==t?void 0:t.fetch:fetchFile}function validateOptionsObject(e,t,n,r,i){var o=t||"Top level",a=t?"".concat(t,"."):"";for(const c in e){var s=!t&&Object(g.f)(e[c]),A="baseUri"===c&&!t,l="workerUrl"===c&&t;c in n||A||l||(c in r?u.warn("".concat(o," loader option '").concat(a).concat(c,"' no longer supported, use '").concat(r[c],"'"))():s||(A=function findSimilarOption(e,t){const n=e.toLowerCase();let r="";for(const i of t)for(const o in i.options){if(e===o)return"Did you mean '".concat(i.id,".").concat(o,"'?");const a=o.toLowerCase();(n.startsWith(a)||a.startsWith(n))&&(r=r||"Did you mean '".concat(i.id,".").concat(o,"'?"))}return r}(c,i),u.warn("".concat(o," loader option '").concat(a).concat(c,"' not recognized. ").concat(A))()))}}function normalizeOptionsInternal(e,t,n){const r={...e.options||{}};return function addUrlOptions(e,t){!t||"baseUri"in e||(e.baseUri=t)}(r,n),null===r.log&&(r.log=new NullLog),mergeNestedFields(r,l()),mergeNestedFields(r,t),r}function mergeNestedFields(e,t){for(const r in t){var n;r in t&&(n=t[r],Object(g.g)(n)&&Object(g.g)(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r])}}},function(e,t,n){"use strict";n.d(t,"b",function(){return BaseResponse}),n.d(t,"a",function(){return BaseClient});class BaseResponse{get ok(){return 200<=this.status&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(e){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class BaseClient{constructor(e){this.url=e}async request({}={}){throw new Error("request is not implemented")}}},function(g,e,u){!function(e){for(var r,i,o,a=u(965),t="undefined"==typeof window?e:window,n=["moz","webkit"],s="AnimationFrame",A=t["request"+s],l=t["cancel"+s]||t["cancelRequest"+s],c=0;!A&&ce instanceof ArrayBuffer?new Uint8Array(e):e);e=t.reduce((e,t)=>e+t.byteLength,0);const n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.byteLength;return n.buffer}function sliceArrayBuffer(e,t,n){n=void 0!==n?new Uint8Array(e).subarray(t,t+n):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}},function(e,t,n){"use strict";n.d(t,"c",function(){return setParameters}),n.d(t,"a",function(){return getParameters}),n.d(t,"b",function(){return resetParameters}),n.d(t,"d",function(){return withParameters});var l=n(124),o=n(132),c=n(65),g=n(54),u=n(277);function setParameters(e,t){if(Object(c.a)(Object(g.d)(e),"setParameters requires a WebGL context"),!Object(u.b)(t)){const i={};for(const o in t){var n=Number(o);const a=l.e[o];a&&("string"==typeof a?i[a]=!0:a(e,t[o],n))}var r=e.state&&e.state.cache;if(r)for(const s in i){const A=l.a[s];A(e,t,r)}}}function getParameters(e,t){if("number"==typeof(t=t||l.c)){var n=t;const i=l.d[n];return i?i(e,n):e.getParameter(n)}const r={};for(const o of Array.isArray(t)?t:Object.keys(t)){const a=l.d[o];r[o]=a?a(e,Number(o)):e.getParameter(Number(o))}return r}function resetParameters(e){setParameters(e,l.c)}function withParameters(e,t,n){if(Object(u.b)(t))return n(e);var{nocatch:r=!0}=t;Object(o.b)(e),setParameters(e,t);let i;if(r)i=n(e),Object(o.a)(e);else try{i=n(e)}finally{Object(o.a)(e)}return i}},function(e,t,n){"use strict";n.d(t,"a",function(){return useIsFocusVisible});var r=n(0),i=n(25),o=!0,a=!1,s=null,A={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function handleKeyDown(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function handlePointerDown(){o=!1}function handleVisibilityChange(){"hidden"===this.visibilityState&&a&&(o=!0)}function isFocusVisible(e){e=e.target;try{return e.matches(":focus-visible")}catch(e){}return o||function focusTriggersKeyboardModality(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!A[t]||e.readOnly)||("TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable)}(e)}function handleBlurVisible(){a=!0,window.clearTimeout(s),s=window.setTimeout(function(){a=!1},100)}function useIsFocusVisible(){return{isFocusVisible:isFocusVisible,onBlurVisible:handleBlurVisible,ref:r.useCallback(function(e){e=i.findDOMNode(e);null!=e&&!function prepare(e){e.addEventListener("keydown",handleKeyDown,!0),e.addEventListener("mousedown",handlePointerDown,!0),e.addEventListener("pointerdown",handlePointerDown,!0),e.addEventListener("touchstart",handlePointerDown,!0),e.addEventListener("visibilitychange",handleVisibilityChange,!0)}(e.ownerDocument)},[])}}},function(e,t,n){"use strict";n.d(t,"a",function(){return ownerWindow});var r=n(53);function ownerWindow(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";n.d(t,"a",function(){return Euler});var t=n(176),g=n(18),r=n(19),a=n(275);const h="Unknown Euler angle order",u=.99999;class Euler extends t.a{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Euler.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Euler.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,n=0,r=Euler.DefaultOrder){super(-0,-0,-0,-0),0{const n=e.props._offset,r=e.id,i=e.parent&&e.parent.id;let o;if(!i||i in A||c(e.parent,!1),i in l){const a=l[i]=l[i]||layerIndexResolver(A[i],A);o=a(e,t),l[r]=a}else Number.isFinite(n)?(o=n+(A[i]||0),l[r]=null):o=s;return t&&o>=s&&(s=o+1),A[r]=o};return c}();var A={viewport:e,isPicking:n.startsWith("picking"),renderPass:n};for(let e=0;eObject(p.a)(e,A))}const s={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Object(h.n)(e,{viewport:a});for(let e=0;e>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(tinycolor(r));return o}function monochromatic(e,t){t=t||6;for(var e=tinycolor(e).toHsv(),n=e.h,r=e.s,i=e.v,o=[],a=1/t;t--;)o.push(tinycolor({h:n,s:r,v:i})),i=(i+a)%1;return o}function boundAlpha(e){return e=parseFloat(e),e=isNaN(e)||e<0||1e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.c)/i.a,e=>e.getDate()-1);(t.a=n).range},function(e,t,n){"use strict";var r=n(44),i=n(24),n=Object(r.a)(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/i.a},function(e){return e.getUTCDate()-1});(t.a=n).range},function(e,t,n){"use strict";var r=n(44),n=Object(r.a)(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});n.every=function(n){return isFinite(n=Math.floor(n))&&0e.isSelected?1:-1);if(A)if(this._isCancelled)A.done();else{let e,t;try{e=await n({x:r,y:i,z:o,bbox:a,signal:s})}catch(e){t=e||!0}finally{A.done(),this._isCancelled&&!e?this._isLoaded=!1:(this._isLoaded=!0,this._isCancelled=!1)}this._isLoaded&&(t?this.onTileError(t,this):(this.content=e,this.onTileLoad(this)))}else this._isCancelled=!0}loadData(e,t){e&&(this._isCancelled=!1,this._loader=this._loadData(e,t),this._loader.finally(()=>{this._loader=void 0}))}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}}var l=n(94),a=n(501),s=n(12);const A="best-available";class tileset_2d_Tileset2D{constructor(t){this.opts=t,this._getTileData=t.getTileData,this.onTileError=t.onTileError,this.onTileLoad=e=>{t.onTileLoad(e),this.opts.maxCacheByteSize&&(this._cacheByteSize+=e.byteLength,this._resizeCache())},this.onTileUnload=t.onTileUnload,this._requestScheduler=new a.a({maxRequests:t.maxRequests,throttleRequests:0e.isLoaded)}setOptions(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}finalize(){for(const e of this._cache.values())e.isLoading&&e.abort()}update(e,{zRange:t,modelMatrix:n}={}){const r=new s.Matrix4(n);var i=!r.equals(this._modelMatrix);if(!e.equals(this._viewport)||i){i&&(this._modelMatrixInverse=n&&r.clone().invert(),this._modelMatrix=n&&r),this._viewport=e;const o=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=o.map(e=>this._getTile(e,!0)),this._dirty&&this._rebuildTree()}i=this.updateTileStates();return this._dirty&&this._resizeCache(),i&&this._frameNumber++,this._frameNumber}getTileIndices({viewport:e,maxZoom:t,minZoom:n,zRange:r,modelMatrix:i,modelMatrixInverse:o}){var{tileSize:a,extent:s,zoomOffset:A}=this.opts;return Object(l.a)({viewport:e,maxZoom:t,minZoom:n,zRange:r,tileSize:a,extent:s,modelMatrix:i,modelMatrixInverse:o,zoomOffset:A})}getTileMetadata({x:e,y:t,z:n}){var r=this.opts["tileSize"];return{bbox:Object(l.e)(this._viewport,e,t,n,r)}}getParentIndex(e){return e.x=Math.floor(e.x/2),e.y=Math.floor(e.y/2),--e.z,e}updateTileStates(){this._updateTileStates(this.selectedTiles);var e=this.opts["maxRequests"];const t=[];let n=0,r=!1;for(const o of this._cache.values()){var i=Boolean(1&o.state);o.isVisible!==i&&(r=!0,o.isVisible=i),o.isSelected=5===o.state,o.isLoading&&(n++,o.isSelected||t.push(o))}if(0e&&0n||this._cacheByteSize>r){for(var[i,o]of e)if(o.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?o.byteLength:0,e.delete(i),this.onTileUnload(o)),e.size<=n&&this._cacheByteSize<=r)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((e,t)=>e.z-t.z),this._dirty=!1)}_getTile({x:e,y:t,z:n},r){var i="".concat(e,",").concat(t,",").concat(n);let o=this._cache.get(i);return!o&&r?(o=new tile_2d_header_Tile2DHeader({x:e,y:t,z:n,onTileLoad:this.onTileLoad,onTileError:this.onTileError}),Object.assign(o,this.getTileMetadata(o)),o.loadData(this._getTileData,this._requestScheduler),this._cache.set(i,o),this._dirty=!0):o&&o.isCancelled&&!o.isLoading&&o.loadData(this._getTileData,this._requestScheduler),o}_getNearestAncestor(e,t,n){var{_minZoom:r=0}=this;let i={x:e,y:t,z:n};for(;i.z>r;){i=this.getParentIndex(i);var o=this._getTile(i);if(o)return o}return null}}n={data:[],dataComparator:l.f.equals,renderSubLayers:{type:"function",value:e=>new i.a(e),compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:e=>console.error(e),compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:A,zRange:null,maxRequests:6,zoomOffset:0};class tile_layer_TileLayer extends t.a{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var e;null!=(e=this.state.tileset)&&e.finalize()}get isLoaded(){const e=this.state["tileset"];return e.selectedTiles.every(e=>e.layers&&e.layers.every(e=>e.isLoaded))}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,changeFlags:t}){let n=this.state["tileset"];!n||t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData)?(n&&n.finalize(),n=new tileset_2d_Tileset2D({...this._getTilesetOptions(e),getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}),this.setState({tileset:n})):(t.propsChanged||t.updateTriggersChanged)&&(n.setOptions(this._getTilesetOptions(e)),this.state.tileset.tiles.forEach(e=>{e.layers=null})),this._updateTileset()}_getTilesetOptions(e){var{tileSize:e,maxCacheSize:t,maxCacheByteSize:n,refinementStrategy:r,extent:i,maxZoom:o,minZoom:a,maxRequests:s,zoomOffset:A}=e;return{maxCacheSize:t,maxCacheByteSize:n,maxZoom:o,minZoom:a,tileSize:e,refinementStrategy:r,extent:i,maxRequests:s,zoomOffset:A}}_updateTileset(){const e=this.state["tileset"];var{zRange:t,modelMatrix:n}=this.props,t=e.update(this.context.viewport,{zRange:t,modelMatrix:n}),n=e["isLoaded"],r=this.state.isLoaded!==n,i=this.state.frameNumber!==t;n&&(r||i)&&this._onViewportLoad(),i&&this.setState({frameNumber:t}),this.state.isLoaded=n}_onViewportLoad(){var e=this.state["tileset"];const t=this.props["onViewportLoad"];t&&t(e.selectedTiles)}_onTileLoad(e){const t=this.getCurrentLayer();t.props.onTileLoad(e),e.isVisible&&this.setNeedsUpdate()}_onTileError(e,t){const n=this.getCurrentLayer();n.props.onTileError(e),n._updateTileset(),t.isVisible&&this.setNeedsUpdate()}_onTileUnload(e){const t=this.getCurrentLayer();t.props.onTileUnload(e)}getTileData(e){var t=this.getCurrentLayer();const{data:n,getTileData:r,fetch:i}=t.props;var o=e["signal"];return e.url=Object(l.b)(n,e),r?r(e):e.url?i(e.url,{propName:"data",layer:t,signal:o}):null}renderSubLayers(e){return this.props.renderSubLayers(e)}getHighlightedObjectIndex(){return-1}getPickingInfo({info:e,sourceLayer:t}){return e.tile=t.props.tile,e}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}renderLayers(){return this.state.tileset.tiles.map(t=>{const n=this.getHighlightedObjectIndex(t);var e;return t.isLoaded&&(t.layers?t.layers[0]&&t.layers[0].props.highlightedObjectIndex!==n&&(t.layers=t.layers.map(e=>e.clone({highlightedObjectIndex:n}))):(e=this.renderSubLayers({...this.props,id:"".concat(this.id,"-").concat(t.x,"-").concat(t.y,"-").concat(t.z),data:t.data,_offset:0,tile:t}),t.layers=Object(r.b)(e,Boolean).map(e=>e.clone({tile:t,highlightedObjectIndex:n})))),t.layers})}filterSubLayer({layer:e}){return this.props.visible&&e.props.tile.isVisible}}tile_layer_TileLayer.layerName="TileLayer",tile_layer_TileLayer.defaultProps=n},function(e,t,n){"use strict";var r=n(1147),i=n(22),o=Object.keys(i.a).map(e=>"const int COORDINATE_SYSTEM_".concat(e," = ").concat(i.a[e],";")).join(""),a=Object.keys(i.c).map(e=>"const int PROJECTION_MODE_".concat(e," = ").concat(i.c[e],";")).join(""),o="".concat(o,"\n").concat(a,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.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 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 + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\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) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),s=n(245);const A={};t.a={name:"project",dependencies:[r.a],vs:o,getUniforms:function getUniforms(e=A){return e.viewport?Object(s.b)(e):{}}}},function(e,t,n){"use strict";function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}n.d(t,"a",function(){return _inheritsLoose})},function(e,t,n){"use strict";n.d(t,"b",function(){return A});var a=n(9),s={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},A={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(e){return"".concat(Math.round(e),"ms")}t.a={easing:s,duration:A,create:function create(){var e=0n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}l.absoluteValue=l.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),finalise(e)},l.ceil=function(){return finalise(new this.constructor(this),this.e+1,2)},l.clampedTo=l.clamp=function(e,t){var n=this.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(d+t);return this.cmp(e)<0?e:0e.e^o<0?1:-1;for(t=0,n=(a=r.length)<(e=i.length)?a:e;ti[t]^o<0?1:-1;return a===e?0:ethis.d.length-2},l.isNaN=function(){return!this.s},l.isNegative=l.isNeg=function(){return this.s<0},l.isPositive=l.isPos=function(){return 0t&&(t=this.e+1)):t=NaN,t},l.round=function(){var e=this.constructor;return finalise(new e(this),this.e+1,e.rounding)},l.sine=l.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+F,r.rounding=1,n=function sine(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:taylorSeries(e,2,t,t);n=16<(n=1.4*Math.sqrt(r))?16:0|n,t=t.times(1/tinyPow(5,n)),t=taylorSeries(e,2,t,t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,toLessThanHalfPi(r,n)),r.precision=e,r.rounding=t,finalise(2=e.d.length-1&&(n=l<0?-l:l)<=9007199254740991)return i=intPow(A,s,n,r),e.s<0?new A(1).div(i):finalise(i,r,o);if((a=s.s)<0){if(tA.maxE+1||t=r.toExpPos):(checkInt32(e,1,h),void 0===t?t=r.rounding:checkInt32(t,0,8),finiteToString(n=finalise(new r(n),e,t),e<=n.e||n.e<=r.toExpNeg,e));return n.isNeg()&&!n.isZero()?"-"+t:t},l.toSignificantDigits=l.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(checkInt32(e,1,h),void 0===t?t=n.rounding:checkInt32(t,0,8)),finalise(new n(this),e,t)},l.toString=function(){var e=this.constructor,e=finiteToString(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+e:e},l.truncated=l.trunc=function(){return finalise(new this.constructor(this),this.e+1,1)},l.valueOf=l.toJSON=function(){var e=this.constructor,e=finiteToString(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+e:e};var y=function(e,t,n,r,i,o){var a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q=e.constructor,w=e.s==t.s?1:-1,S=e.d,_=t.d;if(!(S&&S[0]&&_&&_[0]))return new Q(e.s&&t.s&&(S?!_||S[0]!=_[0]:_)?S&&0==S[0]||!_?0*w:w/0:NaN);for(s=o?(c=1,e.e-t.e):(o=R,x(e.e/(c=F))-x(t.e/c)),v=_.length,B=S.length,h=(w=new Q(w)).d=[],A=0;_[A]==(S[A]||0);A++);if(_[A]>(S[A]||0)&&s--,null==n?(C=n=Q.precision,r=Q.rounding):C=i?n+(e.e-t.e)+1:n,C<0)h.push(1),g=!0;else{if(C=C/c+2|0,A=0,1==v){for(_=_[l=0],C++;(A=o/2&&++b;l=0,(a=compare(_,p,v,f))<0?(I=p[0],1<(l=(I=v!=f?I*o+(p[1]||0):I)/b|0)?1==(a=compare(u=multiplyInteger(_,l=o<=l?o-1:l,o),p,d=u.length,f=p.length))&&(l--,subtract(u,vt[i]?1:-1;break}return o}function subtract(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]u.maxE?(e.d=null,e.e=NaN):e.ee.constructor.maxE?(e.d=null,e.e=NaN):e.ei-1;)c[n]=0,n||(++o,c.unshift(1));for(s=c.length;!c[s-1];--s);for(a=0,l="";as)for(o-=s;o--;)l+="0";else ot&&(e.length=t,1)}function abs(e){return new this(e).abs()}function acos(e){return new this(e).acos()}function acosh(e){return new this(e).acosh()}function add(e,t){return new this(e).plus(t)}function asin(e){return new this(e).asin()}function asinh(e){return new this(e).asinh()}function atan(e){return new this(e).atan()}function atanh(e){return new this(e).atanh()}function atan2(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?getPi(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=getPi(this,o,1).times(.5)).s=e.s:n=t.s<0?(this.precision=o,this.rounding=1,n=this.atan(y(e,t,o,1)),t=getPi(this,o,1),this.precision=r,this.rounding=i,e.s<0?n.minus(t):n.plus(t)):this.atan(y(e,t,o,1)):(n=getPi(this,o,1).times(0Decimal.maxE?(i.e=NaN,i.d=null):e.e{try{const n=new Image;n.onload=()=>e(n),n.onerror=()=>t(new Error(`Could not load image ${r}.`)),n.crossOrigin=i&&i.crossOrigin||"anonymous",n.src=r}catch(e){t(e)}})}(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}},function(e,t,n){"use strict";var r="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="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;t.a=r},function(e,t,n){"use strict";n.d(t,"b",function(){return makeResponse}),n.d(t,"a",function(){return checkResponse});var i=n(39),o=n(179);async function makeResponse(e){if(Object(i.i)(e))return e;const t={};var n=Object(o.a)(e),{url:n,type:r}=(0<=n&&(t["content-length"]=String(n)),Object(o.b)(e)),r=(r&&(t["content-type"]=r),await async function getInitialDataUrl(e){if("string"==typeof e)return"data:,".concat(e.slice(0,5));if(e instanceof Blob){const n=e.slice(0,5);return new Promise(t=>{const e=new FileReader;e.onload=e=>{return t(null==e||null==(e=e.target)?void 0:e.result)},e.readAsDataURL(n)})}if(e instanceof ArrayBuffer)return e=function arrayBufferToBase64(e){let t="";var n=new Uint8Array(e);for(let e=0;e{if(!g){var r=t*d+h;for(let e=0;e=i&&(c=l.distanceTo(t.cameraPosition)*t.scale/t.height,e+=Math.floor(Math.log2(c))),e>=o)return this.selected=!0}this.selected=!1,this.childVisible=!0;for(const g of this.children)g.update(e);return!0}getSelected(e=[]){if(this.selected&&e.push(this),this._children)for(const t of this._children)t.getSelected(e);return e}insideBounds([e,t,n,r]){var i=Math.pow(2,this.z),i=f/i;return this.x*ie&&(this.y+1)*i>t}getBoundingVolume(e,t,n){if(n){const o=[];for(const a of this.z<1?c:this.z<2?l:A){const s=osmTile2lngLat(this.x+a[0],this.y+a[1],this.z);s[2]=e[0],o.push(n(s)),e[0]!==e[1]&&(s[2]=e[1],o.push(n(s)))}return Object(h.f)(o)}var r=Math.pow(2,this.z),r=f/r,t=this.x*r+t*f,i=f-(this.y+1)*r;return new h.a([t,i,e[0]],[t+r,i+r,e[1]])}}const g=512,u=[-1/0,-1/0,1/0,1/0],r={type:"url",value:null,validate:(e,t)=>t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every(e=>"string"==typeof e),equals:(t,n)=>{if(t===n)return!0;if(!Array.isArray(t)||!Array.isArray(n))return!1;var r=t.length;if(r!==n.length)return!1;for(let e=0;ee[0])),Math.min(...n.map(e=>e[1])),Math.max(...n.map(e=>e[0])),Math.max(...n.map(e=>e[1]))]}function getURLFromTemplate(e,t){if(!e||!e.length)return null;var{x:n,y:r,z:i}=t;return(e=Array.isArray(e)?e[Math.abs(t.x+t.y)%e.length]:e).replace("{x}",n).replace("{y}",r).replace("{z}",i).replace("{-y}",Math.pow(2,i)-r-1)}function getScale(e,t){return Math.pow(2,e)*g/t}function osmTile2lngLat(e,t,n){n=getScale(n,g),t=Math.PI-2*Math.PI*t/n;return[e/n*360-180,180/Math.PI*Math.atan(.5*(Math.exp(t)-Math.exp(-t)))]}function tile2XY(e,t,n,r){n=getScale(n,r);return[e/n*g,t/n*g]}function tileToBoundingBox(e,t,n,r,i=g){if(e.isGeospatial)return[e,o]=osmTile2lngLat(t,n,r),[a,s]=osmTile2lngLat(t+1,n+1,r),{west:e,north:o,east:a,south:s};var[e,o]=tile2XY(t,n,r,i),[a,s]=tile2XY(t+1,n+1,r,i);return{left:e,top:o,right:a,bottom:s}}function getIdentityTileIndices(e,n,t,r,i){var[e,o,a,s]=function getIndexingCoords(e,t,n){return n?transformBox(e,n).map(e=>e*t/g):e.map(e=>e*t/g)}(function getBoundingBox(e,t,n){let r;var i;return r=t&&2===t.length?([t,i]=t,t=e.getBounds({z:t}),i=e.getBounds({z:i}),[Math.min(t[0],i[0]),Math.min(t[1],i[1]),Math.max(t[2],i[2]),Math.max(t[3],i[3])]):e.getBounds(),e.isGeospatial?[Math.max(r[0],n[0]),Math.max(r[1],n[1]),Math.min(r[2],n[2]),Math.min(r[3],n[3])]:[Math.max(Math.min(r[0],n[2]),n[0]),Math.max(Math.min(r[1],n[3]),n[1]),Math.min(Math.max(r[2],n[0]),n[2]),Math.min(Math.max(r[3],n[1]),n[3])]}(e,null,r),getScale(n,t),i);const A=[];for(let t=Math.floor(e);tt&&(l=t);let c=i;return a&&s&&i&&!e.isGeospatial&&(c=transformBox(i,a)),e.isGeospatial?function getOSMTileIndices(e,t,n,r){var i,o,a,s,A=e.resolution?e.projectPosition:null,l=Object.values(e.getFrustumPlanes()).map(({normal:e,distance:t})=>new h.e(e.clone().negate(),t)),l=new h.c(l),c=e.distanceScales.unitsPerMeter[2],g=n&&n[0]*c||0,n=n&&n[1]*c||0,c=e.pitch<=60?t:0;r&&([a,i,o,s]=r,a=Object(p.n)([a,s]),s=Object(p.n)([o,i]),r=[a[0],f-a[1],s[0],f-s[1]]);const u=new tile_2d_traversal_OSMNode(0,0,0),d={viewport:e,project:A,cullingVolume:l,elevationBounds:[g,n],minZ:c,maxZ:t,bounds:r,offset:0};if(u.update(d),e.subViewports&&1I););}return u.getSelected()}(e,l,r,i):getIdentityTileIndices(e,l,o,c||u,s)}function isURLTemplate(e){return/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(e)}},function(f,e,t){"use strict";t.r(e),t.d(e,"UNITS",function(){return s}),t.d(e,"h3IndexToSplitLong",function(){return h3IndexToSplitLong}),t.d(e,"splitLongToh3Index",function(){return splitLongToh3Index}),t.d(e,"h3IsValid",function(){return h3IsValid}),t.d(e,"h3IsPentagon",function(){return h3IsPentagon}),t.d(e,"h3IsResClassIII",function(){return h3IsResClassIII}),t.d(e,"h3GetBaseCell",function(){return h3GetBaseCell}),t.d(e,"h3GetFaces",function(){return h3GetFaces}),t.d(e,"h3GetResolution",function(){return h3GetResolution}),t.d(e,"geoToH3",function(){return geoToH3}),t.d(e,"h3ToGeo",function(){return h3ToGeo}),t.d(e,"h3ToGeoBoundary",function(){return h3ToGeoBoundary}),t.d(e,"h3ToParent",function(){return h3ToParent}),t.d(e,"h3ToChildren",function(){return h3ToChildren}),t.d(e,"h3ToCenterChild",function(){return h3ToCenterChild}),t.d(e,"kRing",function(){return kRing}),t.d(e,"kRingDistances",function(){return kRingDistances}),t.d(e,"hexRing",function(){return hexRing}),t.d(e,"polyfill",function(){return polyfill}),t.d(e,"h3SetToMultiPolygon",function(){return h3SetToMultiPolygon}),t.d(e,"compact",function(){return compact}),t.d(e,"uncompact",function(){return uncompact}),t.d(e,"h3IndexesAreNeighbors",function(){return h3IndexesAreNeighbors}),t.d(e,"getH3UnidirectionalEdge",function(){return getH3UnidirectionalEdge}),t.d(e,"getOriginH3IndexFromUnidirectionalEdge",function(){return getOriginH3IndexFromUnidirectionalEdge}),t.d(e,"getDestinationH3IndexFromUnidirectionalEdge",function(){return getDestinationH3IndexFromUnidirectionalEdge}),t.d(e,"h3UnidirectionalEdgeIsValid",function(){return h3UnidirectionalEdgeIsValid}),t.d(e,"getH3IndexesFromUnidirectionalEdge",function(){return getH3IndexesFromUnidirectionalEdge}),t.d(e,"getH3UnidirectionalEdgesFromHexagon",function(){return getH3UnidirectionalEdgesFromHexagon}),t.d(e,"getH3UnidirectionalEdgeBoundary",function(){return getH3UnidirectionalEdgeBoundary}),t.d(e,"h3Distance",function(){return h3Distance}),t.d(e,"h3Line",function(){return h3Line}),t.d(e,"experimentalH3ToLocalIj",function(){return experimentalH3ToLocalIj}),t.d(e,"experimentalLocalIjToH3",function(){return experimentalLocalIjToH3}),t.d(e,"pointDist",function(){return pointDist}),t.d(e,"cellArea",function(){return cellArea}),t.d(e,"exactEdgeLength",function(){return exactEdgeLength}),t.d(e,"hexArea",function(){return hexArea}),t.d(e,"edgeLength",function(){return edgeLength}),t.d(e,"numHexagons",function(){return numHexagons}),t.d(e,"getRes0Indexes",function(){return getRes0Indexes}),t.d(e,"getPentagonIndexes",function(){return getPentagonIndexes}),t.d(e,"degsToRads",function(){return degsToRads}),t.d(e,"radsToDegs",function(){return radsToDegs});var Ee=function(s){var e,r=void 0!==(s=(typeof Ee==="object"?Ee:{})||{})?s:{},A={};for(e in r)r.hasOwnProperty(e)&&(A[e]=r[e]);var l="";var l=0!==(l=document.currentScript?document.currentScript.src:l).indexOf("blob:")?l.substr(0,l.lastIndexOf("/")+1):"",h=function readAsync(t,n,r){var i=new XMLHttpRequest;i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function xhr_onload(){var e;200==i.status||0==i.status&&i.response?n(i.response):(e=tryParseAsDataURI(t))?n(e.buffer):r()},i.onerror=r,i.send(null)},p=r.print||console.log.bind(console),f=r.printErr||console.warn.bind(console);for(e in A)A.hasOwnProperty(e)&&(r[e]=A[e]);A=null,r.arguments&&r.arguments;function UVa(){return I}var I=0;var C=!1;function getCFunc(e){var t=r["_"+e];return function assert(e,t){e||abort("Assertion failed: "+t)}(t,"Cannot call unknown function "+e+", make sure it is exported"),t}function ccall(e,t,n,r){var i={string:function(e){var t,n=0;return null!=e&&0!==e&&(t=1+(e.length<<2),function stringToUTF8(e,t,n){(function stringToUTF8Array(e,t,n,r){if(!(0>6,t[n++]=128|63&A}else if(A<=65535){if(o<=n+2)break;t[n++]=224|A>>12,t[n++]=128|A>>6&63,t[n++]=128|63&A}else{if(o<=n+3)break;t[n++]=240|A>>18,t[n++]=128|A>>12&63,t[n++]=128|A>>6&63,t[n++]=128|63&A}}t[n]=0})(e,E,t,n)}(e,n=Be(t),t)),n},array:function(e){var t=Be(e.length);return function writeArrayToMemory(e,t){v.set(e,t)}(e,t),t}};var e=getCFunc(e),o=[],a=0;if(r)for(var s=0;s>10,56320|1023&s)))):o+=String.fromCharCode(A)}return o}(E,e,t):""}var b,v,E,Q,w,S,x;"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");function alignUp(e,t){return 0>2,n=(3&o)<<6|(a=s.indexOf(e.charAt(l++))),A+=String.fromCharCode(r<<2|i>>4),64!==o&&(A+=String.fromCharCode(t)),64!==a&&(A+=String.fromCharCode(n)),l>2]=e),e},f:_emscripten_get_heap_size,g:function _emscripten_memcpy_big(e,t,n){E.set(E.subarray(t,t+n),e)},h:function _emscripten_resize_heap(e){var t=v.length,n=16777216;if(2130706432>2]))){if(i=+sb(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1!=(0|t))for(e=1;i+=+sb(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n),(0|e)<(0|t););}else i=0;return U=o,6371.007180918475*i*6371.007180918475},_cellAreaM2:function vb(e,t){var n,r,i=0,o=U;if(U=U+192|0,Vb(e|=0,t|=0,n=(r=o)+168|0),Wb(e,t,r),0<(0|(t=0|G[r>>2]))){if(i=+sb(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1!=(0|t))for(e=1;i+=+sb(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n),(0|e)<(0|t););}else i=0;return U=o,6371.007180918475*i*6371.007180918475*1e3*1e3},_cellAreaRads2:function tb(e,t){var n,r,i=0,o=U;if(U=U+192|0,Vb(e|=0,t|=0,n=(r=o)+168|0),Wb(e,t,r),(0|(t=0|G[r>>2]))<=0)return U=o,+(i=0);if(i=+sb(r+8|0,r+8+((1!=(0|t)&1)<<4)|0,n)+0,1==(0|t))return U=o,+i;for(e=1;i+=+sb(r+8+(e<<4)|0,r+8+(((0|(e=e+1|0))%(0|t)|0)<<4)|0,n),(0|e)<(0|t););return U=o,+i},_compact:function Hb(e,t,n){t|=0;var r,i,o,a,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0,E=0;if(!(n|=0))return(v=0)|v;if(s=0|G[(A=e|=0)>>2],!0&0==(15728640&(A=0|G[A+4>>2])|0)){if((0|n)<=0)return(v=0)|v;if(G[(v=t)>>2]=s,G[v+4>>2]=A,1==(0|n))return(v=0)|v;for(s=1;b=0|G[(B=e+(s<<3)|0)+4>>2],G[(v=t+(s<<3)|0)>>2]=G[B>>2],G[v+4>>2]=b,(0|(s=s+1|0))!=(0|n););return(s=0)|s}if(!(b=0|Wc(B=n<<3)))return 0|(v=-3);if(gd(0|b,0|e,0|B),!(a=0|Yc(n,8)))return Xc(b),0|(v=-3);s=n;e:for(;;){y=0|cd(0|(h=0|G[(c=b)>>2]),0|(c=0|G[c+4>>2]),52),T(),o=(y&=15)-1|0,i=0<(0|s);t:do{if(i){if(r=((0|s)<0)<<31>>31,C=0|dd(0|o,0,52),m=0|T(),15>>0)for(A=0,e=h,n=c;;){if(!(0==(0|e)&0==(0|n))){if(l=0|cd(0|e,0|n,52),T(),g=(0|(l&=15))<(0|o),l=(0|l)==(0|o),n=0|bd(0|(d=!g&&l?e:0),0|(e=!g&&l?n:0),0|s,0|r),T(),0==(0|(u=0|G[(g=l=a+(n<<3)|0)>>2]))&0==(0|(g=0|G[g+4>>2])))n=d;else for(C=0,I=n,f=g,n=d;;){if((0|s)<(0|C)){v=41;break e}if((0|u)==(0|n)&(-117440513&f|0)==(0|e)){d=0|cd(0|u,0|f,56),T(),p=(d&=7)+1|0,m=0|cd(0|u,0|f,45),T();n:do{if(0|la(127&m)){if(u=0|cd(0|u,0|f,52),T(),!(u&=15)){g=6;break}for(g=1;;){if(!(0==((m=0|dd(7,0,3*(15-g|0)|0))&n|0)&0==((0|T())&e|0))){g=7;break n}if(!(g>>>0>>0)){g=6;break}g=g+1|0}}else g=7}while(0);if(g>>>0<(d+2|0)>>>0){v=51;break e}m=0|dd(0|p,0,56),e=0|T()|-117440513&e,G[(g=l)>>2]=0,G[g+4>>2]=0,g=I,n|=m}else g=(I+1|0)%(0|s)|0;if(0==(0|(u=0|G[(f=l=a+(g<<3)|0)>>2]))&0==(0|(f=0|G[f+4>>2])))break;C=C+1|0,I=g}G[(m=l)>>2]=n,G[m+4>>2]=e}if((0|s)<=(0|(A=A+1|0)))break t;e=0|G[(n=b+(A<<3)|0)>>2],n=0|G[n+4>>2]}for(A=0,e=h,n=c;;){if(!(0==(0|e)&0==(0|n))){if(g=0|cd(0|e,0|n,52),T(),(0|o)<=(0|(g&=15))){if((0|g)!=(0|o)&&(e|=C,n=-15728641&n|m,y>>>0<=g>>>0))for(l=o;I=0|dd(7,0,3*(14-l|0)|0),l=l+1|0,e|=I,n=0|T()|n,l>>>0>>0;);}else n=e=0;if(g=0|bd(0|e,0|n,0|s,0|r),T(),!(0==(0|(d=0|G[(u=l=a+(g<<3)|0)>>2]))&0==(0|(u=0|G[u+4>>2]))))for(I=0;;){if((0|s)<(0|I)){v=41;break e}if((0|d)==(0|e)&(-117440513&u|0)==(0|n)){p=0|cd(0|d,0|u,56),T(),f=(p&=7)+1|0,E=0|cd(0|d,0|u,45),T();n:do{if(0|la(127&E)){if(d=0|cd(0|d,0|u,52),T(),!(d&=15)){u=6;break}for(u=1;;){if(!(0==((E=0|dd(7,0,3*(15-u|0)|0))&e|0)&0==((0|T())&n|0))){u=7;break n}if(!(u>>>0>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if(u>>>0<(p+2|0)>>>0){v=51;break e}E=0|dd(0|f,0,56),n=0|T()|-117440513&n,G[(f=l)>>2]=0,G[f+4>>2]=0,e|=E}else g=(g+1|0)%(0|s)|0;if(0==(0|(d=0|G[(u=l=a+(g<<3)|0)>>2]))&0==(0|(u=0|G[u+4>>2])))break;I=I+1|0}G[(E=l)>>2]=e,G[E+4>>2]=n}if((0|s)<=(0|(A=A+1|0)))break t;e=0|G[(n=b+(A<<3)|0)>>2],n=0|G[n+4>>2]}}}while(0);if((s+5|0)>>>0<11){v=99;break}if(!(m=0|Yc((0|s)/6|0,8))){v=58;break}t:do{if(i){f=I=0;do{if(!(0==(0|(A=0|G[(e=g=a+(I<<3)|0)>>2]))&0==(0|(e=0|G[e+4>>2])))){u=0|cd(0|A,0|e,56),T(),n=(u&=7)+1|0,d=-117440513&e,E=0|cd(0|A,0|e,45),T();n:do{if(0|la(127&E)){if(p=0|cd(0|A,0|e,52),T(),0|(p&=15))for(l=1;;){if(!(0==(A&(E=0|dd(7,0,3*(15-l|0)|0))|0)&0==(d&(0|T())|0)))break n;if(!(l>>>0

>>0))break;l=l+1|0}A|=e=0|dd(0|n,0,56),e=0|T()|d,G[(n=g)>>2]=A,G[n+4>>2]=e,n=u+2|0}}while(0);7==(0|n)&&(G[(E=m+(f<<3)|0)>>2]=A,G[E+4>>2]=-117440513&e,f=f+1|0)}}while((0|(I=I+1|0))!=(0|s));if(i){if(C=((0|s)<0)<<31>>31,p=0|dd(0|o,0,52),I=0|T(),15>>0)for(A=e=0;;){do{if(!(0==(0|h)&0==(0|c))){for(u=0|cd(0|h,0|c,52),T(),l=(0|(u&=15))<(0|o),u=(0|u)==(0|o),l=0|bd(0|(g=!l&&u?h:0),0|(u=!l&&u?c:0),0|s,0|C),T(),n=0;;){if((0|s)<(0|n)){v=98;break e}if((-117440513&(d=0|G[(E=a+(l<<3)|0)+4>>2])|0)==(0|u)&&(0|G[E>>2])==(0|g)){v=70;break}if((0|G[(E=a+((l=(l+1|0)%(0|s)|0)<<3)|0)>>2])==(0|g)&&(0|G[E+4>>2])==(0|u))break;n=n+1|0}if(70==(0|v)&&!(v=0)&100663296==(117440512&d|0))break;G[(E=t+(A<<3)|0)>>2]=h,G[E+4>>2]=c,A=A+1|0}}while(0);if((0|s)<=(0|(e=e+1|0))){s=f;break t}h=0|G[(c=b+(e<<3)|0)>>2],c=0|G[c+4>>2]}for(A=e=0;;){do{if(!(0==(0|h)&0==(0|c))){if(u=0|cd(0|h,0|c,52),T(),(0|o)<=(0|(u&=15)))if((0|u)!=(0|o))if(n=h|p,l=-15728641&c|I,u>>>0>>0)u=l;else{for(g=o;E=0|dd(7,0,3*(14-g|0)|0),g=g+1|0,n|=E,l=0|T()|l,g>>>0>>0;);u=l}else n=h,u=c;else u=n=0;for(g=0|bd(0|n,0|u,0|s,0|C),T(),l=0;;){if((0|s)<(0|l)){v=98;break e}if((-117440513&(d=0|G[(E=a+(g<<3)|0)+4>>2])|0)==(0|u)&&(0|G[E>>2])==(0|n)){v=93;break}if((0|G[(E=a+((g=(g+1|0)%(0|s)|0)<<3)|0)>>2])==(0|n)&&(0|G[E+4>>2])==(0|u))break;l=l+1|0}if(93==(0|v)&&!(v=0)&100663296==(117440512&d|0))break;G[(E=t+(A<<3)|0)>>2]=h,G[E+4>>2]=c,A=A+1|0}}while(0);if((0|s)<=(0|(e=e+1|0))){s=f;break t}h=0|G[(c=b+(e<<3)|0)>>2],c=0|G[c+4>>2]}}else A=0,s=f}else s=A=0}while(0);if(hd(0|a,0,0|B),gd(0|b,0|m,s<<3|0),Xc(m),!s)break;t=t+(A<<3)|0}return 41==(0|v)?(Xc(b),Xc(a),0|(E=-1)):51==(0|v)?(Xc(b),Xc(a),0|(E=-2)):58==(0|v)?(Xc(b),Xc(a),0|(E=-3)):98==(0|v)?(Xc(m),Xc(b),Xc(a),0|(E=-1)):(99==(0|v)&&gd(0|t,0|b,s<<3|0),Xc(b),Xc(a),(E=0)|E)},_destroyLinkedPolygon:function jc(e){var t=0,n=0,r=0,i=0;if(e|=0)for(r=1;;){if(0|(t=0|G[e>>2]))do{if(0|(n=0|G[t>>2]))for(;n=0|G[(i=n)+16>>2],Xc(i),0!=(0|n););}while(t=0|G[(i=t)+8>>2],Xc(i),0!=(0|t));if(e=0|G[(t=e)+8>>2],r||Xc(t),!e)break;r=0}},_edgeLengthKm:function pb(e){return+N[20752+((e|=0)<<3)>>3]},_edgeLengthM:function qb(e){return+N[20880+((e|=0)<<3)>>3]},_emscripten_replace_memory:function V(e){return m=new Int8Array(e),new Uint8Array(e),G=new Int32Array(e),new Float32Array(e),N=new Float64Array(e),!0},_exactEdgeLengthKm:function xb(e,t){var n,r,i,o=0,a=0,s=0,A=0,l=U;if(U=U+176|0,gc(e|=0,t|=0,n=l),(0|(e=0|G[n>>2]))<=1)return U=l,+(s=0);for(t=e+-1|0,o=e=0,a=+N[n+8>>3],s=+N[n+16>>3];i=a,a=+N[n+8+((e=e+1|0)<<4)>>3],A=+u(.5*(a-i)),r=s,s=+N[n+8+(e<<4)+8>>3],r=A*A+(r=+u(.5*(s-r)))*(+g(+i)*+g(+a)*r),o+=2*+d(+c(r),+c(1-r)),(0|e)!=(0|t););return U=l,+(A=6371.007180918475*o)},_exactEdgeLengthM:function yb(e,t){var n,r,i,o=0,a=0,s=0,A=0,l=U;if(U=U+176|0,gc(e|=0,t|=0,n=l),(0|(e=0|G[n>>2]))<=1)return U=l,+(s=0);for(t=e+-1|0,o=e=0,a=+N[n+8>>3],s=+N[n+16>>3];i=a,a=+N[n+8+((e=e+1|0)<<4)>>3],A=+u(.5*(a-i)),r=s,s=+N[n+8+(e<<4)+8>>3],r=A*A+(r=+u(.5*(s-r)))*(+g(+i)*+g(+a)*r),o+=2*+d(+c(r),+c(1-r)),(0|e)!=(0|t););return U=l,+(A=6371.007180918475*o*1e3)},_exactEdgeLengthRads:function wb(e,t){var n,r,i,o,a=0,s=0,A=0,l=U;if(U=U+176|0,gc(e|=0,t|=0,n=l),(0|(e=0|G[n>>2]))<=1)return U=l,+(A=0);for(t=e+-1|0,a=e=0,s=+N[n+8>>3],A=+N[n+16>>3];i=s,s=+N[n+8+((e=e+1|0)<<4)>>3],o=+u(.5*(s-i)),r=A,A=+N[n+8+(e<<4)+8>>3],r=o*o+(r=+u(.5*(A-r)))*(+g(+s)*+g(+i)*r),a+=2*+d(+c(r),+c(1-r)),(0|e)<(0|t););return U=l,+a},_experimentalH3ToLocalIj:function oc(e,t,n,r,i){i|=0;var o=U;return U=U+16|0,(e=0|mc(e|=0,t|=0,n|=0,r|=0,t=o))||(function Ua(e,t){var n=0|G[(e|=0)+8>>2];G[(t|=0)>>2]=(0|G[e>>2])-n,G[t+4>>2]=(0|G[e+4>>2])-n}(t,i),e=0),U=o,0|e},_experimentalLocalIjToH3:function pc(e,t,n,r){e|=0,t|=0,r|=0;var i=U;return U=U+16|0,function Va(e,t){var n,r,i,o=0,a=0,s=0,a=0|G[(e|=0)>>2];G[(t|=0)>>2]=a,e=0|G[e+4>>2],o=(G[(r=t+4|0)>>2]=e)-a|(G[(i=t+8|0)>>2]=0),(0|a)<0?(e=0-a|0,G[r>>2]=o,G[i>>2]=e,a=G[t>>2]=0):(o=e,e=0),(0|o)<0&&(G[t>>2]=a=a-o|0,G[i>>2]=e=e-o|0,o=G[r>>2]=0),n=a-e|0,s=o-e|0,(0|e)<0?(G[t>>2]=n,o=G[r>>2]=s,s=n,e=G[i>>2]=0):s=a,(0|(a=(0|e)<(0|(a=(0|o)<(0|s)?o:s))?e:a))<=0||(G[t>>2]=s-a,G[r>>2]=o-a,G[i>>2]=e-a)}(n|=0,n=i),r=0|nc(e,t,n,r),U=i,0|r},_free:Xc,_geoToH3:Sb,_getDestinationH3IndexFromUnidirectionalEdge:function cc(e,t){e|=0;var n,r=0,i=U;return U=U+16|0,r=i,U=(!0&268435456==(2013265920&(t|=0)|0)?(n=0|cd(0|e,0|t,56),T(),r=(G[r>>2]=0)|da(e,-2130706433&t|134217728,7&n,r),t=0|T(),y(0|t)):y((r=t=0)|t),i),0|r},_getH3IndexesFromUnidirectionalEdge:function ec(e,t,n){e|=0;var r,i,o,a=0,s=U;U=U+16|0,r=s,i=-2130706433&(t|=0)|134217728,G[(a=n|=0)>>2]=(o=!0&268435456==(2013265920&t|0))?e:0,G[a+4>>2]=o?i:0,t=o?(t=0|cd(0|e,0|t,56),T(),e=(G[r>>2]=0)|da(e,i,7&t,r),0|T()):e=0,G[(a=n+8|0)>>2]=e,G[4+a>>2]=t,U=s},_getH3UnidirectionalEdge:function ac(e,t,n,r){var i,o,a=0,s=0,A=0,l=0,c=U;if(U=U+16|0,o=c,!(0|$b(e|=0,t|=0,n|=0,r|=0)))return y((A=s=0)|s),U=c,0|A;for(s=-2130706433&t,a=(a=0==(0|Fb(e,t)))?1:2;;){if(i=a+1|(G[o>>2]=0),(0|(l=0|da(e,t,a,o)))==(0|n)&(0|T())==(0|r))break;if(!(i>>>0<7)){e=a=0,A=6;break}a=i}return 6==(0|A)?(y(0|a),U=c,0|e):(l=0|dd(0|a,0,56),A=0|s|T()|268435456,l|=e,y(0|A),U=c,0|l)},_getH3UnidirectionalEdgeBoundary:gc,_getH3UnidirectionalEdgesFromHexagon:function fc(e,t,n){n|=0;var r,i=0==(0|Fb(e|=0,t|=0));t&=-2130706433,G[(r=n)>>2]=i?e:0,G[r+4>>2]=i?285212672|t:0,G[(r=n+8|0)>>2]=e,G[4+r>>2]=301989888|t,G[(r=n+16|0)>>2]=e,G[4+r>>2]=318767104|t,G[(r=n+24|0)>>2]=e,G[4+r>>2]=335544320|t,G[(r=n+32|0)>>2]=e,G[4+r>>2]=352321536|t,G[(n=n+40|0)>>2]=e,G[n+4>>2]=369098752|t},_getOriginH3IndexFromUnidirectionalEdge:function bc(e,t){var n;return e|=0,y(0|((n=!0&268435456==(2013265920&(t|=0)|0))?-2130706433&t|134217728:0)),0|(n?e:0)},_getPentagonIndexes:_b,_getRes0Indexes:function va(e){e|=0;for(var t,n,r=0,r=0;dd(0|r,0,45),n=134225919|T(),G[(t=e+(r<<3)|0)>>2]=-1,G[4+t>>2]=n,122!=(0|(r=r+1|0)););},_h3Distance:function qc(e,t,n,r){n|=0,r|=0;var i,o,a=U;return U=U+32|0,e=0==(0|mc(e|=0,t|=0,e,t,i=(o=a)+12|0))&&0==(0|mc(e,t,n,r,o))?0|Ta(i,o):-1,U=a,0|e},_h3GetBaseCell:Ab,_h3GetFaces:function Yb(e,t,n){n|=0;var r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=U;U=U+128|0,l=g+112|0,o=g+96|0,c=g,i=0|cd(0|(e|=0),0|(t|=0),52),T(),G[l>>2]=s=15&i,a=0|cd(0|e,0|t,45),T(),a&=127;e:do{if(0|la(a)){if(0|s)for(r=1;;){if(!(0==((A=0|dd(7,0,3*(15-r|0)|0))&e|0)&0==((0|T())&t|0))){i=0;break e}if(!(r>>>0>>0))break;r=r+1|0}if(!(1&i))return A=0|dd(s+1|0,0,52),c=0|T()|-15728641&t,Yb((A|e)&~(l=0|dd(7,0,3*(14-s|0)|0)),c&~(0|T()),n),void(U=g);i=1}else i=0}while(0);Ub(e,t,o),A=i?(bb(o,l,c),5):(fb(o,l,c),6);e:do{if(0|la(a))if(s)for(r=1;;){if(!(0==((a=0|dd(7,0,3*(15-r|0)|0))&e|0)&0==((0|T())&t|0))){r=8;break e}if(!(r>>>0>>0)){r=20;break}r=r+1|0}else r=20;else r=8}while(0);if(hd(0|n,-1,0|r),i){i=0;do{for(function db(e,t){e|=0,t|=0;for(;2==(0|(0|cb(e,t,0,1))););}(o=c+(i<<4)|0,0|G[l>>2]),o=0|G[o>>2],r=0;!(-1==(0|(s=0|G[(a=n+(r<<2)|0)>>2]))|(0|s)==(0|o));)r=r+1|0}while(G[a>>2]=o,(0|(i=i+1|0))!=(0|A))}else{i=0;do{for(cb(o=c+(i<<4)|0,0|G[l>>2],0,1),o=0|G[o>>2],r=0;!(-1==(0|(s=0|G[(a=n+(r<<2)|0)>>2]))|(0|s)==(0|o));)r=r+1|0}while(G[a>>2]=o,(0|(i=i+1|0))!=(0|A))}U=g},_h3GetResolution:function zb(e,t){return t=0|cd(0|(e|=0),0|(t|=0),52),T(),15&t|0},_h3IndexesAreNeighbors:$b,_h3IsPentagon:Fb,_h3IsResClassIII:function Kb(e,t){return t=0|cd(0|(e|=0),0|(t|=0),52),T(),1&t|0},_h3IsValid:Bb,_h3Line:function sc(e,t,n,r,i){n|=0,r|=0,i|=0;var o,a,s,A,l,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=U;if(U=U+48|0,g=b+12|0,0!=(0|mc(e|=0,t|=0,e,t,c=(B=b)+24|0))||0!=(0|mc(e,t,n,r,g)))return U=b,0|(B=-1);if((0|(A=0|Ta(c,g)))<0)return U=b,0|(B=A);for(G[c>>2]=0,G[c+4>>2]=0,G[c+8>>2]=0,G[g>>2]=0,G[g+4>>2]=0,G[g+8>>2]=0,mc(e,t,e,t,c),mc(e,t,n,r,g),Wa(c),Wa(g),p=A?(n=u=0|G[(y=c)>>2],r=d=0|G[(C=c+4|0)>>2],c=h=0|G[(m=c+8|0)>>2],f=((0|G[g>>2])-u|0)/(p=0|A),I=((0|G[g+4>>2])-d|0)/p,((0|G[g+8>>2])-h|0)/p):(C=r=c+4|0,m=h=c+8|0,n=0|G[(y=c)>>2],r=0|G[r>>2],c=0|G[h>>2],I=f=0),G[B>>2]=n,G[(h=B+4|0)>>2]=r,G[(d=B+8|0)>>2]=c,u=0;;){l=f*(a=0|u)+(0|n),o=I*a+(0|G[C>>2]),a=p*a+(0|G[m>>2]),r=~~+fd(l),g=~~+fd(o),n=~~+fd(a),l=+k((0|r)-l),o=+k((0|g)-o),a=+k((0|n)-a);do{if(!(o>2]=r,G[h>>2]=c,G[d>>2]=n,!function Xa(e){var t,n,r,i=0,o=0,a=0,s=0,i=0-(o=0|G[(e|=0)>>2])|0;G[e>>2]=i,s=(a=(G[(n=e+8|0)>>2]=0)|G[(r=e+4|0)>>2])+o|0,0<(0|o)?(G[r>>2]=s,G[n>>2]=o,i=G[e>>2]=0,a=s):o=0,(0|a)<0?(s=(G[e>>2]=t=i-a|0)-(G[n>>2]=o=o-a|0)|(G[r>>2]=0),i=0-o|0,(0|o)<0?(G[e>>2]=s,a=G[r>>2]=i,o=G[n>>2]=0):(a=0,s=t)):s=i,(0|(i=(0|o)<(0|(i=(0|a)<(0|s)?a:s))?o:i))<=0||(G[e>>2]=s-i,G[r>>2]=a-i,G[n>>2]=o-i)}(B),nc(e,t,B,i+(u<<3)|0),(0|u)==(0|A))break;u=u+1|0,n=0|G[y>>2]}return U=b,(B=0)|B},_h3LineSize:function rc(e,t,n,r){n|=0,r|=0;var i,o,a=U;return U=U+32|0,e=0==(0|mc(e|=0,t|=0,e,t,i=(o=a)+12|0))&&0==(0|mc(e,t,n,r,o))?0|Ta(i,o):-1,U=a,(e>>>31^1)+e|0},_h3SetToLinkedGeo:function ka(e,t,n){n|=0;var r,i,o,a=U;if(U=U+32|0,ja(e|=0,t|=0,i=(r=a)+16|0),G[n>>2]=0,G[n+4>>2]=0,!(e=(G[n+8>>2]=0)|Oc(i)))return kc(n),Nc(i),void(U=a);do{for(t=0|function hc(e){e|=0;var t=0,n=0,r=0;(t=0|Yc(1,12))||M(22691,22646,49,22704);if(0|(r=0|G[(n=e+4|0)>>2]))return G[(r=r+8|0)>>2]=t,0|(G[n>>2]=t);0|G[e>>2]&&M(22721,22646,61,22744);return G[(r=e)>>2]=t,0|(G[n>>2]=t)}(n);function ic(e,t){e|=0,t|=0;var n=0,r=0;(r=0|Wc(24))||M(22758,22646,78,22772);if(G[r>>2]=G[t>>2],G[4+r>>2]=G[t+4>>2],G[8+r>>2]=G[t+8>>2],G[12+r>>2]=G[t+12>>2],G[16+r>>2]=0,0|(n=0|G[(t=e+4|0)>>2]))return G[16+n>>2]=r,G[t>>2]=r;0|G[e>>2]&&M(22787,22646,82,22772);G[e>>2]=r,G[t>>2]=r}(t,e),G[r>>2]=G[(o=e+16|0)>>2],G[r+4>>2]=G[4+o>>2],G[r+8>>2]=G[8+o>>2],G[r+12>>2]=G[12+o>>2],Pc(i,e),0!=(0|(e=0|function Sc(e,t){t|=0;var n=0;if(n=~~(+k(+ie(10,15-(0|G[12+(e|=0)>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0,!(e=0|G[(0|G[e>>2])+(n<<2)>>2]))return n=0;for(;;){if(0|hb(e,t)){t=5;break}if(!(e=0|G[e+32>>2])){e=0,t=5;break}}return 5!=(0|t)?0:0|e}(i,r))););}while(0!=(0|(e=0|Oc(i))));kc(n),Nc(i),U=a},_h3ToCenterChild:function Gb(e,t,n){n|=0;var r,i=0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),(0|n)<16&(0|(i&=15))<=(0|n)){if((0|i)!=(0|n)&&(e|=0|dd(0|n,0,52),t=0|T()|-15728641&t,(0|i)<(0|n)))for(;r=0|dd(7,0,3*(14-i|0)|0),i=i+1|0,e&=~r,t&=~(0|T()),(0|i)<(0|n););}else e=t=0;return y(0|t),0|e},_h3ToChildren:Eb,_h3ToGeo:Vb,_h3ToGeoBoundary:Wb,_h3ToParent:Cb,_h3UnidirectionalEdgeIsValid:function dc(e,t){var n=0;if(!(!0&268435456==(2013265920&(t|=0)|0)))return(n=0)|n;switch(n=0|cd(0|(e|=0),0|t,56),T(),7&n){case 0:case 7:return(n=0)|n}return!0&16777216==(117440512&t|0)&0!=(0|Fb(e,n=-2130706433&t|134217728))?(n=0)|n:0|(n=0|Bb(e,n))},_hexAreaKm2:function nb(e){return+N[20496+((e|=0)<<3)>>3]},_hexAreaM2:function ob(e){return+N[20624+((e|=0)<<3)>>3]},_hexRing:function ea(e,t,n,r){e|=0,t|=0,r|=0;var i,o=0,a=0,s=0,A=0,l=0,c=0,g=U;if(U=U+16|0,c=g,!(n|=0))return G[(c=r)>>2]=e,G[c+4>>2]=t,U=g,(c=0)|c;G[c>>2]=0;e:do{if(0|Fb(e,t))e=1;else{if(a=0<(0|n)){o=0,l=e;do{if(0==(0|(l=0|da(l,t,4,c)))&0==(0|(t=0|T()))){e=2;break e}if(o=o+1|0,0|Fb(l,t)){e=1;break e}}while((0|o)<(0|n));if(G[(i=r)>>2]=l,G[i+4>>2]=t,i=n+-1|0,a){a=0,s=1,o=l,e=t;do{if(0==(0|(o=0|da(o,e,2,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(s<<3)|0,s=s+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(a=a+1|0))<(0|n));A=0,a=s;do{if(0==(0|(o=0|da(o,e,3,c)))&0==(0|(e=0|T()))){e=2;break e}if(s=r+(a<<3)|0,a=a+1|0,0|Fb(G[s>>2]=o,G[s+4>>2]=e)){e=1;break e}}while((0|(A=A+1|0))<(0|n));s=0;do{if(0==(0|(o=0|da(o,e,1,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(a<<3)|0,a=a+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(s=s+1|0))<(0|n));s=0;do{if(0==(0|(o=0|da(o,e,5,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(a<<3)|0,a=a+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(s=s+1|0))<(0|n));s=0;do{if(0==(0|(o=0|da(o,e,4,c)))&0==(0|(e=0|T()))){e=2;break e}if(A=r+(a<<3)|0,a=a+1|0,0|Fb(G[A>>2]=o,G[A+4>>2]=e)){e=1;break e}}while((0|(s=s+1|0))<(0|n));for(s=0;;){if(0==(0|(o=0|da(o,e,6,c)))&0==(0|(e=0|T()))){e=2;break e}if((0|s)!=(0|i)){if(0|Fb(G[(A=r+(a<<3)|0)>>2]=o,G[A+4>>2]=e)){e=1;break e}a=a+1|0}if((0|n)<=(0|(s=s+1|0))){s=l,a=t;break}}}else o=s=l,e=a=t}else G[(s=r)>>2]=e,G[s+4>>2]=t,o=s=e,e=a=t;e=1&((0|s)!=(0|o)|(0|a)!=(0|e))}}while(0);return U=g,0|(c=e)},_i64Subtract:_c,_kRing:$,_kRingDistances:function aa(e,t,n,r,i){var o;if(0|ba(e|=0,t|=0,n|=0,r|=0,i|=0)){if(hd(0|r,0,(o=1+(0|a(3*n|0,n+1|0))|0)<<3|0),0|i)return hd(0|i,0,o<<2|0),void ca(e,t,n,r,i,o,0);(i=0|Yc(o,4))&&(ca(e,t,n,r,i,o,0),Xc(i))}},_llvm_minnum_f64:ed,_llvm_round_f64:fd,_malloc:Wc,_maxFaceCount:function Xb(e,t){var n=0,r=0,r=0|cd(0|(e|=0),0|(t|=0),45);if(T(),!(0|la(127&r)))return 0|(r=2);if(r=0|cd(0|e,0|t,52),T(),!(r&=15))return 0|(r=5);for(n=1;;){if(!(0==((0|dd(7,0,3*(15-n|0)|0))&e|0)&0==((0|T())&t|0))){n=2,e=6;break}if(!(n>>>0>>0)){n=5,e=6;break}n=n+1|0}return 6==(0|e)?0|n:0},_maxH3ToChildrenSize:function Db(e,t,n){return n|=0,e=0|cd(0|(e|=0),0|(t|=0),52),T(),(0|n)<16&(0|(e&=15))<=(0|n)?0|(n=0|tc(7,n-e|0)):(n=0)|n},_maxKringSize:function _(e){return 1+(0|a(3*(e|=0)|0,e+1|0))|0},_maxPolyfillSize:function fa(e,t){t|=0;var n,r,i,o=0,a=0,s=U;if(U=U+48|0,r=s+8|0,i=0|G[(a=e|=0)+4>>2],G[(o=n=s)>>2]=G[a>>2],G[o+4>>2]=i,vc(n,r),r=0|ya(r,t),t=0|G[n>>2],(0|(n=0|G[e+8>>2]))<=0)return U=s,0|(a=(a=(0|r)<(0|(a=t))?a:r)+12|0);for(o=0|G[e+12>>2],e=0;t=(0|G[o+(e<<3)>>2])+t|0,(0|(e=e+1|0))<(0|n););return U=s,0|(a=(a=(a=(0|r)<(0|t))?t:r)+12|0)},_maxUncompactSize:function Jb(e,t,n){e|=0,n|=0;var r,i=0,o=0,a=0;if((0|(t|=0))<=0)return(n=0)|n;if(16<=(0|n)){for(i=0;;){if(!(0==(0|G[(a=e+(i<<3)|0)>>2])&0==(0|G[a+4>>2]))){i=-1,o=13;break}if((0|t)<=(0|(i=i+1|0))){i=0,o=13;break}}if(13==(0|o))return 0|i}a=i=0;e:for(;;){r=0|G[(o=e+(a<<3)|0)>>2],o=0|G[o+4>>2];do{if(!(0==(0|r)&0==(0|o))){if(o=0|cd(0|r,0|o,52),T(),(0|n)<(0|(o&=15))){i=-1,o=13;break e}if((0|o)==(0|n)){i=i+1|0;break}i=(0|tc(7,n-o|0))+i|0;break}}while(0);if((0|t)<=(0|(a=a+1|0))){o=13;break}}return 13==(0|o)?0|i:0},_memcpy:gd,_memset:hd,_numHexagons:function rb(e){var t;return e=0|G[(t=21008+((e|=0)<<3)|0)>>2],y(0|G[4+t>>2]),0|e},_pentagonIndexCount:function Zb(){return 12},_pointDistKm:jb,_pointDistM:function kb(e,t){var n,r=+N[(t|=0)>>3],i=+N[(e|=0)>>3];return n=(n=+u(.5*(r-i)))*n+(n=+u(.5*(+N[t+8>>3]-+N[e+8>>3])))*(+g(r)*+g(i)*n),2*+d(+c(n),+c(1-n))*6371.007180918475*1e3},_pointDistRads:function ib(e,t){var n,r=+N[(t|=0)>>3],i=+N[(e|=0)>>3];return n=(n=+u(.5*(r-i)))*n+(n=+u(.5*(+N[t+8>>3]-+N[e+8>>3])))*(+g(r)*+g(i)*n),2*+d(+c(n),+c(1-n))},_polyfill:function ga(e,t,n){var r,i,o,a,s=0,A=U;if(U=U+48|0,s=A+8|0,r=A,0|function ha(e,t,n){t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0,E=0,Q=0,w=0,S=0,_=0,x=0,R=0,F=0,D=0;U=(D=U)+112|0,_=D+80|0,A=D+72|0,R=(x=D)+56|0,(F=0|Wc(32+(G[(l=8+(e|=0)|0)>>2]<<5)|0))||M(22848,22448,800,22456);if(function wc(e,t){t|=0;var n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0;if(h=0|G[(e|=0)>>2]){if(N[(p=t+8|0)>>3]=17976931348623157e292,N[(f=t+24|0)>>3]=17976931348623157e292,N[t>>3]=-17976931348623157e292,N[(I=t+16|0)>>3]=-17976931348623157e292,0<(0|h)){for(i=0|G[e+4>>2],d=-(u=17976931348623157e292),n=-1,a=g=-(l=A=17976931348623157e292),C=r=0;;){if(o=+N[i+(C<<4)>>3],c=+N[i+(C<<4)+8>>3],s=+N[i+(((0|(b=n+2|0))==(0|h)?0:b)<<4)+8>>3],o>3]=o,A=o),c>3]=c,l=c),g>3]=o:o=g,a>3]=c,a=c),u=0>3]=d,N[f>>3]=u)}}else G[t>>2]=0,G[t+4>>2]=0,G[t+8>>2]=0,G[t+12>>2]=0,G[t+16>>2]=0,G[t+20>>2]=0,G[t+24>>2]=0,G[t+28>>2]=0;if(!((0|(n=G[(b=e+8|0)>>2]|0))<=0)){B=e+12|0,y=0;do{if(i=0|G[B>>2],f=t+((y=(r=y)+1|0)<<5)|0,I=0|G[i+(r<<3)>>2]){if(N[(C=t+(y<<5)+8|0)>>3]=17976931348623157e292,N[(e=t+(y<<5)+24|0)>>3]=17976931348623157e292,N[f>>3]=-17976931348623157e292,N[(m=t+(y<<5)+16|0)>>3]=-17976931348623157e292,0<(0|I)){for(h=0|G[i+(r<<3)+4>>2],d=-(u=17976931348623157e292),r=-1,p=i=0,a=c=-(l=A=17976931348623157e292);;){if(o=+N[h+(p<<4)>>3],g=+N[h+(p<<4)+8>>3],s=+N[h+(((0|(r=r+2|0))==(0|I)?0:r)<<4)+8>>3],o>3]=o,A=o),g>3]=g,l=g),c>3]=o:o=c,a>3]=g,a=g),u=0>3]=d,N[e>>3]=u)}}else G[f>>2]=0,G[f+4>>2]=0,G[f+8>>2]=0,G[f+12>>2]=0,G[f+16>>2]=0,G[f+20>>2]=0,G[f+24>>2]=0,G[f+28>>2]=0,n=0|G[b>>2]}while((0|y)<(0|n))}}(e,F),r=0|G[(o=e)+4>>2],G[(s=A)>>2]=G[o>>2],G[s+4>>2]=r,vc(A,_),s=0|ya(_,t),r=0|G[A>>2],0<(0|(o=0|G[l>>2])))for(a=0|G[e+12>>2],i=0;r=(0|G[a+(i<<3)>>2])+r|0,(0|(i=i+1|0))!=(0|o););if(i=0|Yc(S=(s=(0|s)<(0|r)?r:s)+12|0,8),c=0|Yc(S,8),G[_>>2]=0,w=0|G[(Q=e)+4>>2],G[(r=A)>>2]=G[Q>>2],G[r+4>>2]=w,0|(r=0|ia(A,S,t,_,i,c)))return Xc(i),Xc(c),Xc(F),U=D,0|(F=r);e:do{if(0<(0|G[l>>2])){for(o=e+12|0,r=0;;){if(a=0|ia((0|G[o>>2])+(r<<3)|0,S,t,_,i,c),r=r+1|0,0|a)break;if((0|r)>=(0|G[l>>2]))break e}return Xc(i),Xc(c),Xc(F),U=D,0|(F=a)}}while(0);-12<(0|s)&&hd(0|c,0,(1<(0|S)?S:1)<<3|0);e:do{if(0<(0|G[_>>2])){w=((0|S)<0)<<31>>31,f=r=Q=v=b=y=i,i=m=C=I=E=B=c;t:for(;;){for(p=0|G[_>>2],o=h=d=0;;){for(s=(a=x)+56|0;((G[a>>2]=0)|(a=a+4|0))<(0|s););if(A=0|G[(t=y+(d<<3)|0)>>2],t=0|G[t+4>>2],0|ba(A,t,1,x,0)){for(s=(a=x)+56|0;((G[a>>2]=0)|(a=a+4|0))<(0|s););0|(a=0|Yc(7,4))&&(ca(A,t,1,x,a,7,0),Xc(a))}u=0;do{c=0|G[(g=x+(u<<3)|0)>>2],g=0|G[g+4>>2];n:do{if(!(0==(0|c)&0==(0|g))){if(A=0|bd(0|c,0|g,0|S,0|w),T(),t=0|G[(s=a=n+(A<<3)|0)>>2],s=0|G[s+4>>2],!(0==(0|t)&0==(0|s)))for(l=0;;){if((0|S)<(0|l))break t;if((0|t)==(0|c)&(0|s)==(0|g))break n;if(t=0|G[(s=a=n+((A=(A+1|0)%(0|S)|0)<<3)|0)>>2],s=0|G[s+4>>2],0==(0|t)&0==(0|s))break;l=l+1|0}0==(0|c)&0==(0|g)||(Vb(c,g,R),0|function xc(e,t,n){var r=0,i=0,o=0;if(!(0|uc(e|=0,t|=0,n|=0)))return(i=0)|i;if((0|G[(i=e+8|0)>>2])<=0)return 0|(i=1);r=e+12|0,e=0;for(;;){if(e=(o=e)+1|0,0|uc((0|G[r>>2])+(o<<3)|0,t+(e<<5)|0,n)){e=0,r=6;break}if((0|e)>=(0|G[i>>2])){e=1,r=6;break}}return 6!=(0|r)?0:0|e}(e,F,R)&&(G[(l=a)>>2]=c,G[l+4>>2]=g,G[(l=B+(o<<3)|0)>>2]=c,G[l+4>>2]=g,o=o+1|0))}}while(0)}while((u=u+1|0)>>>0<7);if((0|p)<=(0|(h=h+1|0)))break;d=d+1|0}if(0<(0|p)&&hd(0|b,0,p<<3|0),!(0<(0|(G[_>>2]=o))))break e;c=i,g=m,u=Q,d=C,h=I,p=B,i=f,m=r,C=v,I=b,f=c,r=g,Q=E,E=u,v=d,b=h,B=y,y=p}return Xc(v),Xc(E),Xc(F),U=D,0|(F=-1)}}while(r=c,0);return Xc(F),Xc(i),Xc(r),U=D,0|(F=0)}(e|=0,t|=0,n|=0)){if(i=0|G[(a=e)+4>>2],G[(o=r)>>2]=G[a>>2],G[o+4>>2]=i,vc(r,s),o=0|ya(s,t),t=0|G[r>>2],0<(0|(i=0|G[e+8>>2])))for(r=0|G[e+12>>2],s=0;t=(0|G[r+(s<<3)>>2])+t|0,(0|(s=s+1|0))!=(0|i););U=((0|(t=(0|o)<(0|t)?t:o))<=-12||hd(0|n,0,8+((0<(0|(a=t+11|0))?a:0)<<3)|0),A)}else U=A},_res0IndexCount:function ua(){return 122},_round:id,_sbrk:jd,_sizeOfCoordIJ:function Ec(){return 8},_sizeOfGeoBoundary:function Ac(){return 168},_sizeOfGeoCoord:function zc(){return 16},_sizeOfGeoPolygon:function Cc(){return 16},_sizeOfGeofence:function Bc(){return 8},_sizeOfH3Index:function yc(){return 8},_sizeOfLinkedGeoPolygon:function Dc(){return 12},_uncompact:function Ib(e,t,n,r,i){e|=0,n|=0,r|=0,i|=0;var o=0,a=0,s=0,A=0,l=0,c=0;if((0|(t|=0))<=0)return(i=0)|i;if(16<=(0|i)){for(o=0;;){if(!(0==(0|G[(c=e+(o<<3)|0)>>2])&0==(0|G[c+4>>2]))){o=14;break}if((0|t)<=(0|(o=o+1|0))){a=0,o=16;break}}if(14==(0|o))return 0|(0<(0|r)?-2:-1);if(16==(0|o))return 0|a}c=o=0;e:for(;;){a=0|G[(s=l=e+(c<<3)|0)>>2],s=0|G[s+4>>2];do{if(!(0==(0|a)&0==(0|s))){if((0|r)<=(0|o)){a=-1,o=16;break e}if(A=0|cd(0|a,0|s,52),T(),(0|i)<(0|(A&=15))){a=-2,o=16;break e}if((0|A)==(0|i)){G[(l=n+(o<<3)|0)>>2]=a,G[l+4>>2]=s,o=o+1|0;break}if((0|r)<(0|(a=(0|tc(7,i-A|0))+o|0))){a=-1,o=16;break e}Eb(0|G[l>>2],0|G[l+4>>2],i,n+(o<<3)|0),o=a}}while(0);if((0|t)<=(0|(c=c+1|0))){a=0,o=16;break}}return 16==(0|o)?0|a:0},establishStackSpace:function Z(e,t){U=e|=0},stackAlloc:function W(e){var t=U;return U=(U=U+(e|=0)|0)+15&-16,0|t},stackRestore:function Y(e){U=e|=0},stackSave:function X(){return 0|U}});function $(e,t,n,r){var i,o;0|ba(e|=0,t|=0,n|=0,r|=0,0)&&(hd(0|r,0,(o=1+(0|a(3*n|0,n+1|0))|0)<<3|0),(i=0|Yc(o,4))&&(ca(e,t,n,r,i,o,0),Xc(i)))}function ba(e,t,n,r,i){t|=0,n|=0,i|=0;var o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=U;if(U=U+16|0,u=d,G[(o=r|=0)>>2]=e|=0,G[o+4>>2]=t,(o=0!=(0|i))&&(G[i>>2]=0),0|Fb(e,t))return U=d,0|(u=1);G[u>>2]=0;e:do{if(1<=(0|n))if(o)for(g=c=1,a=l=0,o=e;;){if(!(a|l)){if(0==(0|(o=0|da(o,t,4,u)))&0==(0|(t=0|T()))){o=2;break e}if(0|Fb(o,t)){o=1;break e}}if(0==(0|(o=0|da(o,t,0|G[16+(l<<2)>>2],u)))&0==(0|(t=0|T()))){o=2;break e}if(G[(e=r+(g<<3)|0)>>2]=o,G[e+4>>2]=t,e=(0|(a=a+1|0))==(0|(G[i+(g<<2)>>2]=c)),A=6==(0|(s=l+1|0)),0|Fb(o,t)){o=1;break e}if((0|n)<(0|(c=c+(A&e&1)|0))){o=0;break}l=e?A?0:s:l,g=g+1|0,a=e?0:a}else for(g=c=1,a=l=0,o=e;;){if(!(a|l)){if(0==(0|(o=0|da(o,t,4,u)))&0==(0|(t=0|T()))){o=2;break e}if(0|Fb(o,t)){o=1;break e}}if(0==(0|(o=0|da(o,t,0|G[16+(l<<2)>>2],u)))&0==(0|(t=0|T()))){o=2;break e}if(G[(e=r+(g<<3)|0)>>2]=o,G[e+4>>2]=t,e=(0|(a=a+1|0))==(0|c),A=6==(0|(s=l+1|0)),0|Fb(o,t)){o=1;break e}if((0|n)<(0|(c=c+(A&e&1)|0))){o=0;break}l=e?A?0:s:l,g=g+1|0,a=e?0:a}else o=0}while(0);return U=d,0|(u=o)}function ca(e,t,n,r,i,o,a){n|=0,r|=0,i|=0,o|=0,a|=0;var s,A=0,l=0,c=0,g=0,u=0,d=U;if(U=U+16|0,s=d,0==(0|(e|=0))&0==(0|(t|=0)))U=d;else{if(A=0|bd(0|e,0|t,0|o,((0|o)<0)<<31>>31|0),T(),!(0==(0|(u=0|G[(g=l=r+(A<<3)|0)>>2]))&0==(0|(g=0|G[g+4>>2]))|(c=(0|u)==(0|e)&(0|g)==(0|t))))for(;c=(0|(g=0|G[(u=l=r+((A=(A+1|0)%(0|o)|0)<<3)|0)>>2]))==(0|e)&(0|(u=0|G[u+4>>2]))==(0|t),!(0==(0|g)&0==(0|u)|c););A=i+(A<<2)|0,U=(c&&(0|G[A>>2])<=(0|a)||(G[(u=l)>>2]=e,G[u+4>>2]=t,(0|n)<=(0|(G[A>>2]=a))||(u=a+1|0,ca(g=(G[s>>2]=0)|da(e,t,2,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,3,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,1,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,5,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,4,s),0|T(),n,r,i,o,u),ca(g=(G[s>>2]=0)|da(e,t,6,s),0|T(),n,r,i,o,u))),d)}}function da(e,t,n,r){e|=0,t|=0,n|=0;var i,o,a,s,A=0,l=0,c=0,g=0,u=0;if(0<(0|G[(r|=0)>>2]))for(A=0;n=0|Pa(n),(0|(A=A+1|0))<(0|G[r>>2]););i=0|cd(0|e,0|t,45),T(),o=127&i,l=0|Lb(e,t),A=0|cd(0|e,0|t,52),T(),A&=15;e:do{if(A)for(;;){if(g=0|cd(0|e,0|t,0|(s=3*(15-A|0)|0)),T(),g&=7,u=0==(0|Rb(A)),A=A+-1|0,a=0|dd(7,0,0|s),t&=~(0|T()),e=0|dd(0|G[(u?464:48)+(28*g|0)+(n<<2)>>2],0,0|s)|e&~a,t|=0|T(),!(n=0|G[(u?672:256)+(28*g|0)+(n<<2)>>2])){n=0;break e}if(!A){c=6;break}}else c=6}while(0);6==(0|c)&&(e|=g=0|dd(0|(u=0|G[880+(28*o|0)+(n<<2)>>2]),0,45),t=0|T()|-1040385&t,n=0|G[4304+(28*o|0)+(n<<2)>>2],127==(127&u|0)&&(u=0|dd(0|G[880+(28*o|0)+20>>2],0,45),t=0|T()|-1040385&t,n=0|G[4304+(28*o|0)+20>>2],e=0|Nb(u|e,t),t=0|T(),G[r>>2]=1+(0|G[r>>2]))),c=0|cd(0|e,0|t,45),T(),c&=127;e:do{if(0|la(c)){t:do{if(1==(0|Lb(e,t))){if((0|o)!=(0|c)){if(0|ra(c,0|G[7728+(28*o|0)>>2])){e=0|Pb(e,t),l=1,t=0|T();break}e=0|Nb(e,t),l=1,t=0|T();break}switch(0|l){case 5:e=0|Pb(e,t),t=0|T(),G[r>>2]=5+(0|G[r>>2]),l=0;break t;case 3:e=0|Nb(e,t),t=0|T(),G[r>>2]=1+(0|G[r>>2]),l=0;break t;default:return y((u=g=0)|g),0|u}}else l=0}while(0);if(0<(0|n))for(A=0;e=0|Mb(e,t),t=0|T(),(0|(A=A+1|0))!=(0|n););if((0|o)!=(0|c)){if(!(0|ma(c))){if(0!=(0|l)|5!=(0|Lb(e,t)))break;G[r>>2]=1+(0|G[r>>2]);break}switch(127&i){case 8:case 118:break e}3!=(0|Lb(e,t))&&(G[r>>2]=1+(0|G[r>>2]))}}else if(0<(0|n))for(A=0;e=0|Nb(e,t),t=0|T(),(0|(A=A+1|0))!=(0|n););}while(0);return G[r>>2]=((0|G[r>>2])+n|0)%6|0,u=e,y(0|(g=t)),0|u}function ia(e,t,n,r,i,o){n|=0,r|=0,i|=0,o|=0;var a,s,A,l,c,g,u,d,h,p,f,I,C,m=0,y=0,B=0,b=0,v=0,E=0,Q=0,w=0,S=0,_=U;if(U=U+48|0,(0|(m=0|G[(e|=0)>>2]))<=0)return U=_,(S=0)|S;l=e+4|0,c=8+(h=_+32|0)|0,g=8+(p=_+16|0)|0,u=(f=_)+8|0,d=((0|(t|=0))<0)<<31>>31,w=0;e:for(;;){y=0|G[l>>2],G[h>>2]=G[(Q=y+(w<<4)|0)>>2],G[4+h>>2]=G[Q+4>>2],G[8+h>>2]=G[Q+8>>2],G[12+h>>2]=G[Q+12>>2],(0|w)==(m+-1|0)?(G[p>>2]=G[y>>2],G[4+p>>2]=G[y+4>>2],G[8+p>>2]=G[y+8>>2],G[12+p>>2]=G[y+12>>2]):(G[p>>2]=G[(Q=y+(w+1<<4)|0)>>2],G[4+p>>2]=G[Q+4>>2],G[8+p>>2]=G[Q+8>>2],G[12+p>>2]=G[Q+12>>2]),Q=0|function za(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=0,l=0;U=(s=U)+288|0,r=s+264|0,i=s+96|0,A=(a=o=s)+96|0;for(;G[a>>2]=0,a=a+4|0,(0|a)<(0|A););return _b(n,o),a=0|G[(A=o)>>2],A=0|G[A+4>>2],Vb(a,A,r),Wb(a,A,i),l=+jb(r,8+i|0),A=~~+le(+jb(e,t)/(2*l)),U=s,0|(0==(0|A)?1:A)}(h,p,n);t:do{if(0<(0|Q)){A=0|Q,E=0;n:for(;;){N[f>>3]=+N[h>>3]*(C=Q-E|0)/A+ +N[p>>3]*(I=0|E)/A,N[u>>3]=+N[c>>3]*C/A+ +N[g>>3]*I/A,y=0|bd(0|(a=0|Sb(f,n)),0|(s=0|T()),0|t,0|d),T(),b=0|G[(B=m=o+(y<<3)|0)>>2],B=0|G[B+4>>2];r:do{if(0==(0|b)&0==(0|B))S=14;else for(v=0;;){if((0|t)<(0|v)){m=1;break r}if((0|b)==(0|a)&(0|B)==(0|s)){m=7;break r}if(0==(0|(b=0|G[(B=m=o+((y=(y+1|0)%(0|t)|0)<<3)|0)>>2]))&0==(0|(B=0|G[B+4>>2]))){S=14;break}v=v+1|0}}while(0);switch(7&(m=14==(0|S)?(S=0)==(0|a)&0==(0|s)?7:(G[m>>2]=a,G[m+4>>2]=s,m=0|G[r>>2],G[(v=i+(m<<3)|0)>>2]=a,G[v+4>>2]=s,G[r>>2]=m+1,0):m)){case 7:case 0:break;default:break n}if((0|Q)<=(0|(E=E+1|0))){S=8;break t}}if(0|m){m=-1,S=20;break e}}else S=8}while(0);if(8==(0|S)&&(S=0),(0|(m=0|G[e>>2]))<=(0|(w=w+1|0))){m=0,S=20;break}}return 20==(0|S)?(U=_,0|m):0}function ja(e,t,n){e|=0,n|=0;var r,i,o,a=0,s=0,A=0,l=U;if(U=U+176|0,o=l,(0|(t|=0))<1)return Mc(n,0,0),void(U=l);s=0|cd(0|G[(s=e)>>2],0|G[s+4>>2],52),T(),Mc(n,6<(0|t)?t:6,15&s),s=0;do{if(Wb(0|G[(a=e+(s<<3)|0)>>2],0|G[a+4>>2],o),0<(0|(a=0|G[o>>2])))for(A=0;i=o+8+(A<<4)|0,(r=0|function Rc(e,t,n){t|=0,n|=0;var r=0,i=0;if(i=~~(+k(+ie(10,15-(0|G[12+(e|=0)>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0,!(i=0|G[(0|G[e>>2])+(i<<2)>>2]))return(n=0)|n;if(!n){for(e=i;;){if(0|hb(e,t)){r=10;break}if(!(e=0|G[e+32>>2])){e=0,r=10;break}}if(10==(0|r))return 0|e}e=i;for(;;){if(0|hb(e,t)&&0|hb(e+16|0,n)){r=10;break}if(!(e=0|G[e+32>>2])){e=0,r=10;break}}return 10!=(0|r)?0:0|e}(n,a=o+8+(((0|(A=A+1|0))%(0|a)|0)<<4)|0,i))?Pc(n,r):function Qc(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0;(o=0|Wc(40))||M(23283,23253,98,23296);G[o>>2]=G[t>>2],G[4+o>>2]=G[t+4>>2],G[8+o>>2]=G[t+8>>2],G[12+o>>2]=G[t+12>>2],G[(i=16+o|0)>>2]=G[n>>2],G[i+4>>2]=G[n+4>>2],G[i+8>>2]=G[n+8>>2],G[i+12>>2]=G[n+12>>2],G[32+o>>2]=0,i=~~(+k(+ie(10,15-(0|G[e+12>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0,i=(0|G[e>>2])+(i<<2)|0,r=0|G[i>>2];do{if(r){for(;;){if(0|hb(r,t)&&0|hb(r+16|0,n))break;if(i=0|G[r+32>>2],!(0|G[(r=0==(0|i)?r:i)+32>>2])){a=10;break}}if(10!=(0|a))return Xc(o),a=r;G[r+32>>2]=o;break}}while(G[i>>2]=o,0);G[(a=e+8|0)>>2]=1+(0|G[a>>2]),a=o}(n,i,a),(0|A)<(0|(a=0|G[o>>2])););}while((0|(s=s+1|0))!=(0|t));U=l}function la(e){return 0|G[7728+(28*(e|=0)|0)+16>>2]}function ma(e){return 4==(0|(e|=0))|117==(0|e)|0}function na(e){return 0|G[11152+(216*(0|G[(e|=0)>>2])|0)+(72*(0|G[e+4>>2])|0)+(24*(0|G[e+8>>2])|0)+(G[e+12>>2]<<3)>>2]}function ra(e,t){return(0|G[7728+(28*(e|=0)|0)+20>>2])==(0|(t|=0))?0|(t=1):0|(t=(0|G[7728+(28*e|0)+24>>2])==(0|t))}function sa(e,t){return 0|G[880+(28*(e|=0)|0)+((t|=0)<<2)>>2]}function ta(e,t){return(0|G[880+(28*(e|=0)|0)>>2])==(0|(t|=0))?(t=0)|t:(0|G[880+(28*e|0)+4>>2])==(0|t)?0|(t=1):(0|G[880+(28*e|0)+8>>2])==(0|t)?0|(t=2):(0|G[880+(28*e|0)+12>>2])==(0|t)?0|(t=3):(0|G[880+(28*e|0)+16>>2])==(0|t)?0|(t=4):(0|G[880+(28*e|0)+20>>2])==(0|t)?0|(t=5):0|((0|G[880+(28*e|0)+24>>2])==(0|t)?6:7)}function wa(e){return+N[(e|=0)+16>>3]<+N[e+24>>3]|0}function xa(e,t){var n,r,i;return(i=+N[(t|=0)>>3])>=+N[(e|=0)+8>>3]&&i<=+N[e>>3]?(n=+N[e+16>>3],t=(i=+N[e+24>>3])<=(r=+N[t+8>>3]),e=r<=n&1,n>2]=0)))<(0|a););return _b(t,i),Vb(a=0|G[(o=i)>>2],o=0|G[o+4>>2],n),Wb(a,o,r),t=+jb(n,8+r|0),N[n>>3]=+N[e>>3],N[(o=8+n|0)>>3]=+N[e+16>>3],N[r>>3]=+N[e+8>>3],N[(a=8+r|0)>>3]=+N[e+24>>3],i=+jb(n,r),a=~~+le(i*i/+ed(+k((+N[o>>3]-+N[a>>3])/(+N[n>>3]-+N[r>>3])),3)/(2.59807621135*t*t*.8)),U=s,0|(0==(0|a)?1:a)}function Ca(e){var t,n=0,r=0,i=0,o=0,a=0,n=0|G[(e|=0)>>2],r=0|G[(t=e+4|0)>>2];(0|n)<0&&(G[t>>2]=r=r-n|0,G[(a=e+8|0)>>2]=(0|G[a>>2])-n,n=G[e>>2]=0),(0|r)<0?(G[e>>2]=n=n-r|0,o=(0|G[(a=e+8|0)>>2])-r|0,G[a>>2]=o,r=G[t>>2]=0):o=0|G[(a=o=e+8|0)>>2],(0|o)<0&&(G[e>>2]=n=n-o|0,G[t>>2]=r=r-o|0,o=G[a>>2]=0),(0|(i=(0|o)<(0|(i=(0|r)<(0|n)?r:n))?o:i))<=0||(G[e>>2]=n-i,G[t>>2]=r-i,G[a>>2]=o-i)}function Da(e,t){var n=0|G[(e|=0)+8>>2],r=(0|G[e+4>>2])-n|0;N[(t|=0)>>3]=((0|G[e>>2])-n|0)-.5*r,N[t+8>>3]=.8660254037844386*r}function Ea(e,t,n){G[(n|=0)>>2]=(0|G[(t|=0)>>2])+(0|G[(e|=0)>>2]),G[n+4>>2]=(0|G[t+4>>2])+(0|G[e+4>>2]),G[n+8>>2]=(0|G[t+8>>2])+(0|G[e+8>>2])}function Fa(e,t,n){G[(n|=0)>>2]=(0|G[(e|=0)>>2])-(0|G[(t|=0)>>2]),G[n+4>>2]=(0|G[e+4>>2])-(0|G[t+4>>2]),G[n+8>>2]=(0|G[e+8>>2])-(0|G[t+8>>2])}function Ga(e,t){var n,r=0|a(0|G[(e|=0)>>2],t|=0);G[e>>2]=r,n=0|a(0|G[(r=e+4|0)>>2],t),G[r>>2]=n,t=0|a(0|G[(e=e+8|0)>>2],t),G[e>>2]=t}function Ha(e){var t,n,r=0,i=0,o=0,a=0,s=0,s=(0|(t=0|G[(e|=0)>>2]))<0;e=(e=(i=(0|(a=((n=(0|(o=(0|G[e+4>>2])-(s?t:0)|0))<0)?0-o|0:0)+((0|G[e+8>>2])-(s?t:0))|0))<0)?0:a)-((o=0<(0|(i=(0|e)<(0|(i=(0|(r=(n?0:o)-(i?a:0)|0))<(0|(a=(s?0:t)-(n?o:0)-(i?a:0)|0))?r:a))?e:i)))?i:0)|0,r=r-(o?i:0)|0;e:do{switch(a-(o?i:0)|0){case 0:switch(0|r){case 0:return 0|(s=0==(0|e)?0:1==(0|e)?1:7);case 1:return 0|(s=0==(0|e)?2:1==(0|e)?3:7);default:break e}case 1:switch(0|r){case 0:return 0|(s=0==(0|e)?4:1==(0|e)?5:7);case 1:if(e)break e;return 0|(e=6);default:break e}}}while(0);return 0|(s=7)}function Ia(e){var t,n,r=0,i=0,o=0,a=0,s=0,i=0|G[(t=(e|=0)+8|0)>>2],o=0|Vc(((3*(r=(0|G[e>>2])-i|0)|0)-(i=(0|G[(n=e+4|0)>>2])-i|0)|0)/7);G[e>>2]=o,r=0|Vc(((i<<1)+r|0)/7),i=(G[n>>2]=r)-o|(G[t>>2]=0),i=(0|o)<0?(s=0-o|0,G[n>>2]=i,G[t>>2]=s,r=i,o=G[e>>2]=0,s):0,(0|r)<0&&(G[e>>2]=o=o-r|0,G[t>>2]=i=i-r|0,r=G[n>>2]=0),s=o-i|0,a=r-i|0,(0|i)<0?(G[e>>2]=s,r=G[n>>2]=a,a=s,i=G[t>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|a)?r:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=r-o,G[t>>2]=i-o)}function Ja(e){var t,n,r=0,i=0,o=0,a=0,s=0,i=0|G[(t=(e|=0)+8|0)>>2],o=0|Vc((((r=(0|G[e>>2])-i|0)<<1)+(i=(0|G[(n=e+4|0)>>2])-i|0)|0)/7);G[e>>2]=o,r=0|Vc(((3*i|0)-r|0)/7),i=(G[n>>2]=r)-o|(G[t>>2]=0),i=(0|o)<0?(s=0-o|0,G[n>>2]=i,G[t>>2]=s,r=i,o=G[e>>2]=0,s):0,(0|r)<0&&(G[e>>2]=o=o-r|0,G[t>>2]=i=i-r|0,r=G[n>>2]=0),s=o-i|0,a=r-i|0,(0|i)<0?(G[e>>2]=s,r=G[n>>2]=a,a=s,i=G[t>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|r)<(0|a)?r:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=r-o,G[t>>2]=i-o)}function Ka(e){var t,n,r,i=0,o=0,a=0,s=0,i=0|G[(e|=0)>>2],o=0|G[(n=e+4|0)>>2],a=0|G[(r=e+8|0)>>2],s=o+(3*i|0)|0;G[e>>2]=s,G[n>>2]=o=a+(3*o|0)|0,G[r>>2]=i=(3*a|0)+i|0,a=o-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=a,G[r>>2]=i,o=a,G[e>>2]=0):s,(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function La(e){var t,n,r,i=0,o=0,a=0,s=0,s=0|G[(e|=0)>>2],i=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],a=(3*i|0)+s|0;G[e>>2]=s=o+(3*s|0)|0,G[n>>2]=a,G[r>>2]=i=(3*o|0)+i|0,o=a-s|0,(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,s=G[e>>2]=0):o=a,(0|o)<0&&(G[e>>2]=s=s-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=s-i|0,a=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=a,s=t,i=G[r>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(G[e>>2]=s-o,G[n>>2]=a-o,G[r>>2]=i-o)}function Ma(e,t){e|=0;var n,r,i,o=0,a=0,s=0;6<=((t|=0)+-1|0)>>>0||(s=(0|G[15472+(12*t|0)>>2])+(0|G[e>>2])|0,G[e>>2]=s,a=(0|G[15472+(12*t|0)+4>>2])+(0|G[(i=e+4|0)>>2])|0,G[i>>2]=a,t=(0|G[15472+(12*t|0)+8>>2])+(0|G[(r=e+8|0)>>2])|0,G[r>>2]=t,o=a-s|0,a=(0|s)<0?(t=t-s|0,G[i>>2]=o,G[r>>2]=t,G[e>>2]=0):(o=a,s),(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=t=t-o|0,o=G[i>>2]=0),n=a-t|0,s=o-t|0,(0|t)<0?(G[e>>2]=n,G[i>>2]=s,a=n,t=G[r>>2]=0):s=o,(0|(o=(0|t)<(0|(o=(0|s)<(0|a)?s:a))?t:o))<=0||(G[e>>2]=a-o,G[i>>2]=s-o,G[r>>2]=t-o))}function Na(e){var t,n,r,i=0,o=0,a=0,s=0,s=0|G[(e|=0)>>2],i=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],a=i+s|0;G[e>>2]=s=o+s|0,G[n>>2]=a,G[r>>2]=i=o+i|0,o=a-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,G[e>>2]=0):(o=a,s),(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function Oa(e){var t,n,r,i=0,o=0,a=0,s=0,i=0|G[(e|=0)>>2],a=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],s=a+i|0;G[e>>2]=s,G[n>>2]=a=o+a|0,G[r>>2]=i=o+i|0,o=a-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,G[e>>2]=0):(o=a,s),(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function Pa(e){switch(0|(e|=0)){case 1:e=5;break;case 5:e=4;break;case 4:e=6;break;case 6:e=2;break;case 2:e=3;break;case 3:e=1}return 0|e}function Qa(e){switch(0|(e|=0)){case 1:e=3;break;case 3:e=2;break;case 2:e=6;break;case 6:e=4;break;case 4:e=5;break;case 5:e=1}return 0|e}function Ra(e){var t,n,r,i=0,o=0,a=0,s=0,i=0|G[(e|=0)>>2],o=0|G[(n=e+4|0)>>2],a=0|G[(r=e+8|0)>>2],s=o+(i<<1)|0;G[e>>2]=s,G[n>>2]=o=a+(o<<1)|0,G[r>>2]=i=(a<<1)+i|0,a=o-s|0,a=(0|s)<0?(i=i-s|0,G[n>>2]=a,G[r>>2]=i,o=a,G[e>>2]=0):s,(0|o)<0&&(G[e>>2]=a=a-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=a-i|0,s=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=s,a=t,i=G[r>>2]=0):s=o,(0|(o=(0|i)<(0|(o=(0|s)<(0|a)?s:a))?i:o))<=0||(G[e>>2]=a-o,G[n>>2]=s-o,G[r>>2]=i-o)}function Sa(e){var t,n,r,i=0,o=0,a=0,s=0,s=0|G[(e|=0)>>2],i=0|G[(n=e+4|0)>>2],o=0|G[(r=e+8|0)>>2],a=(i<<1)+s|0;G[e>>2]=s=o+(s<<1)|0,G[n>>2]=a,G[r>>2]=i=(o<<1)+i|0,o=a-s|0,(0|s)<0?(i=i-s|0,G[n>>2]=o,G[r>>2]=i,s=G[e>>2]=0):o=a,(0|o)<0&&(G[e>>2]=s=s-o|0,G[r>>2]=i=i-o|0,o=G[n>>2]=0),t=s-i|0,a=o-i|0,(0|i)<0?(G[e>>2]=t,G[n>>2]=a,s=t,i=G[r>>2]=0):a=o,(0|(o=(0|i)<(0|(o=(0|a)<(0|s)?a:s))?i:o))<=0||(G[e>>2]=s-o,G[n>>2]=a-o,G[r>>2]=i-o)}function Ta(e,t){var n,r,i=0,o=0,a=0,s=(0|G[(e|=0)>>2])-(0|G[(t|=0)>>2])|0,o=(0|G[e+4>>2])-(0|G[t+4>>2])-((n=(0|s)<0)?s:0)|0;return 0|((0|(t=(0|(t=-1<(0|(t=(t=(e=(0|(a=(n?0-s|0:0)+(0|G[e+8>>2])-(0|G[t+8>>2])+((r=(0|o)<0)?0-o|0:0)|0))<0)?0:a)-((o=0<(0|(e=(0|t)<(0|(e=(0|(i=(r?0:o)-(e?a:0)|0))<(0|(a=(n?0:s)-(r?o:0)-(e?a:0)|0))?i:a))?t:e)))?e:0)|0))?t:0-t|0))<(0|(i=-1<(0|(i=i-(o?e:0)|0))?i:0-i|0))?i:t))<(0|(e=-1<(0|(e=a-(o?e:0)|0))?e:0-e|0))?e:t)}function Wa(e){var t,n,r,i=(r=0|G[(n=(e|=0)+8|0)>>2])-(0|G[e>>2])|0;G[e>>2]=i,e=(0|G[(t=e+4|0)>>2])-r|0,G[t>>2]=e,G[n>>2]=0-(e+i)}function Ya(e,t,n){var r=U;U=U+16|0,function Za(e,t,n,r){t|=0,n|=0,r|=0;var i=0,o=0,a=0,s=0,A=0;U=(A=U)+32|0,function Jc(e,t){t|=0;var n=0,r=0,i=0;n=+N[(e|=0)>>3],r=+g(n),n=+u(n),N[t+16>>3]=n,n=+N[e+8>>3],i=r*+g(n),N[t>>3]=i,n=r*+u(n),N[t+8>>3]=n}(e|=0,o=A),G[n>>2]=0,i=+Ic(15888,o),(a=+Ic(15912,o))>2]=1,i=a);(a=+Ic(15936,o))>2]=2,i=a);(a=+Ic(15960,o))>2]=3,i=a);(a=+Ic(15984,o))>2]=4,i=a);(a=+Ic(16008,o))>2]=5,i=a);(a=+Ic(16032,o))>2]=6,i=a);(a=+Ic(16056,o))>2]=7,i=a);(a=+Ic(16080,o))>2]=8,i=a);(a=+Ic(16104,o))>2]=9,i=a);(a=+Ic(16128,o))>2]=10,i=a);(a=+Ic(16152,o))>2]=11,i=a);(a=+Ic(16176,o))>2]=12,i=a);(a=+Ic(16200,o))>2]=13,i=a);(a=+Ic(16224,o))>2]=14,i=a);(a=+Ic(16248,o))>2]=15,i=a);(a=+Ic(16272,o))>2]=16,i=a);(a=+Ic(16296,o))>2]=17,i=a);(a=+Ic(16320,o))>2]=18,i=a);(a=+Ic(16344,o))>2]=19,i=a);if((a=+ae(+(1-i*.5)))<1e-16)G[r>>2]=0,G[r+4>>2]=0,G[r+8>>2]=0,G[r+12>>2]=0,U=A;else{if(n=0|G[n>>2],i=+gb((i=+N[16368+(24*n|0)>>3])-+gb(+function lb(e,t){e|=0;var n=0,r=0,i=0,o=0,a=0;return o=+N[(t|=0)>>3],r=+g(o),i=+N[t+8>>3]-+N[e+8>>3],a=r*+u(i),n=+N[e>>3],+d(a,+u(o)*+g(n)-+g(i)*(r*+u(n)))}(15568+(n<<4)|0,e))),s=0|Rb(t)?+gb(i+-.3334731722518321):i,i=+oe(+a)/.381966011250105,0<(0|t))for(o=0;i*=2.6457513110645907,(0|(o=o+1|0))!=(0|t););a=+g(+s)*i,N[r>>3]=a,s=+u(+s)*i,N[r+8>>3]=s,U=A}}(e|=0,t|=0,n|=0,e=r),function Ba(e,t){e|=0;var n,r,i,o,a=0,s=0,A=0,l=0,c=0,g=0;G[(o=(t|=0)+8|0)>>2]=0,n=+N[e>>3],l=+k(n),r=+N[e+8>>3],l=(l+=.5*(c=+k(r)/.8660254037844386))-(0|(a=~~l)),c-=0|(e=~~c);do{if(l<.5){if(l<.3333333333333333){if(G[t>>2]=a,c<.5*(1+l)){G[t+4>>2]=e;break}G[t+4>>2]=e=e+1|0;break}if(G[t+4>>2]=e=(1&!(c<(i=1-l)))+e|0,i<=c&c<2*l){G[t>>2]=a=a+1|0;break}G[t>>2]=a;break}if(!(l<.6666666666666666)){if(G[t>>2]=a=a+1|0,c<.5*l){G[t+4>>2]=e;break}G[t+4>>2]=e=e+1|0;break}if(c<1-l){if(G[t+4>>2]=e,2*l-1>2]=a;break}}else G[t+4>>2]=e=e+1|0}while(G[t>>2]=a=a+1|0,0);do{if(n<0){if(1&e){a=~~((0|a)-(2*(((g=0|_c(0|a,((0|a)<0)<<31>>31|0,0|(g=(e+1|0)/2|0),((0|g)<0)<<31>>31|0))>>>0)+4294967296*(0|T()))+1)),G[t>>2]=a;break}a=~~((0|a)-2*(((g=0|_c(0|a,((0|a)<0)<<31>>31|0,0|(g=(0|e)/2|0),((0|g)<0)<<31>>31|0))>>>0)+4294967296*(0|T()))),G[t>>2]=a;break}}while(0);g=t+4|0,r<0&&(G[t>>2]=a=a-((e<<1|1)/2|0)|0,G[g>>2]=e=0-e|0),s=e-a|0,(0|a)<0?(A=0-a|0,G[g>>2]=s,G[o>>2]=A,e=s,a=G[t>>2]=0):A=0,(0|e)<0&&(G[t>>2]=a=a-e|0,G[o>>2]=A=A-e|0,e=G[g>>2]=0),r=a-A|0,s=e-A|0,(0|A)<0&&(G[t>>2]=r,e=G[g>>2]=s,a=r,A=G[o>>2]=0),(0|(s=(0|A)<(0|(s=(0|e)<(0|a)?e:a))?A:s))<=0||(G[t>>2]=a-s,G[g>>2]=e-s,G[o>>2]=A-s)}(e,n+4|0),U=r}function _a(e,t,n,r,i){t|=0,n|=0,r|=0,i|=0;var o=0,a=0;if((o=+function Fc(e){var t=0,n=0;return n=+N[(e|=0)>>3],t=+N[e+8>>3],+c(n*n+t*t)}(e|=0))<1e-16)return G[i>>2]=G[(t=15568+(t<<4)|0)>>2],G[i+4>>2]=G[t+4>>2],G[i+8>>2]=G[t+8>>2],void(G[i+12>>2]=G[t+12>>2]);if(a=+d(+N[e+8>>3],+N[e>>3]),0<(0|n))for(e=0;o/=2.6457513110645907,(0|(e=e+1|0))!=(0|n););r?(o/=3,n=0==(0|Rb(n)),o=+Ae(.381966011250105*(n?o:o/2.6457513110645907))):(o=+Ae(.381966011250105*o),0|Rb(n)&&(a=+gb(a+.3334731722518321))),function mb(e,t,n,r){e|=0,t=+t,r|=0;var i=0,o=0,a=0,s=0;if((n=+n)<1e-16)G[r>>2]=G[e>>2],G[r+4>>2]=G[e+4>>2],G[r+8>>2]=G[e+8>>2],G[r+12>>2]=G[e+12>>2];else{o=t<0?t+6.283185307179586:t,o=6.283185307179586<=t?o+-6.283185307179586:o;do{if(!(o<1e-16)){if(i=+k(+(o+-3.141592653589793))<1e-16,t=+N[e>>3],i){t-=n,N[r>>3]=t,i=r;break}if(a=+g(+n),n=+u(+n),t=a*+u(+t)+ +g(+o)*(n*+g(+t)),t=+se(+((t=1>3]=t,+k(+(t+-1.5707963267948966))<1e-16)return N[r>>3]=1.5707963267948966,N[r+8>>3]=0;if(+k(+(t+1.5707963267948966))<1e-16)return N[r>>3]=-1.5707963267948966,N[r+8>>3]=0;if(s=+g(+t),o=n*+u(+o)/s,n=+N[e>>3],t=(a-+u(+t)*+u(+n))/+g(+n)/s,a=1>3]+ +d(+(a<-1?-1:a),+(t<-1?-1:t))))for(;3.141592653589793<(t+=-6.283185307179586););if(t<-3.141592653589793)for(;(t+=6.283185307179586)<-3.141592653589793;);return N[r+8>>3]=t}}while(t=+N[e>>3]+n,N[r>>3]=t,i=r,0);if(+k(+(t+-1.5707963267948966))<1e-16)N[i>>3]=1.5707963267948966,N[r+8>>3]=0;else if(+k(+(t+1.5707963267948966))<1e-16)N[i>>3]=-1.5707963267948966,N[r+8>>3]=0;else{if(3.141592653589793<(t=+N[e+8>>3]))for(;3.141592653589793<(t+=-6.283185307179586););if(t<-3.141592653589793)for(;(t+=6.283185307179586)<-3.141592653589793;);N[r+8>>3]=t}}}(15568+(t<<4)|0,+gb(+N[16368+(24*t|0)>>3]-a),o,i)}function ab(e,t,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q,w,S,_,x,R=0,F=0,D=U;if(U=U+272|0,f=D+240|0,w=(Q=D)+224|0,S=D+208|0,I=D+176|0,C=D+160|0,m=D+192|0,y=D+144|0,B=D+128|0,b=D+112|0,v=D+96|0,E=D+80|0,G[(o=D+256|0)>>2]=t|=0,G[f>>2]=G[e>>2],G[4+f>>2]=G[e+4>>2],G[8+f>>2]=G[e+8>>2],G[12+f>>2]=G[e+12>>2],bb(f,o,Q),((G[i>>2]=0)|(f=r+n+(5==(0|r)&1)|0))<=(0|n))U=D;else{s=4+w|0,A=4+I|0,l=n+5|0,c=16848+((a=0|G[o>>2])<<2)|0,g=16928+(a<<2)|0,u=8+B|0,d=8+b|0,h=8+v|0,p=4+S|0,F=n;e:for(;;){for(G[S>>2]=G[(R=Q+(((0|F)%5|0)<<4)|0)>>2],G[4+S>>2]=G[R+4>>2],G[8+S>>2]=G[R+8>>2],G[12+S>>2]=G[R+12>>2];2==(0|cb(S,a,0,1)););if((0|n)<(0|F)&0!=(0|Rb(t))){if(G[I>>2]=G[S>>2],G[4+I>>2]=G[4+S>>2],G[8+I>>2]=G[8+S>>2],G[12+I>>2]=G[12+S>>2],Da(s,C),r=0|G[I>>2],o=0|G[17008+(80*r|0)+(G[w>>2]<<2)>>2],G[I>>2]=G[18608+(80*r|0)+(20*o|0)>>2],0<(0|(R=0|G[18608+(80*r|0)+(20*o|0)+16>>2])))for(e=0;Na(A),(0|(e=e+1|0))<(0|R););switch(G[m>>2]=G[(R=18608+(80*r|0)+(20*o|0)+4|0)>>2],G[4+m>>2]=G[R+4>>2],G[8+m>>2]=G[R+8>>2],Ga(m,3*(0|G[c>>2])|0),Ea(A,m,A),Ca(A),Da(A,y),_=0|G[g>>2],N[B>>3]=3*_,N[u>>3]=0,N[b>>3]=x=-1.5*_,N[d>>3]=2.598076211353316*_,N[v>>3]=x,N[h>>3]=-2.598076211353316*_,0|G[17008+(80*(0|G[I>>2])|0)+(G[S>>2]<<2)>>2]){case 1:e=b,r=B;break;case 3:e=v,r=b;break;case 2:e=B,r=v;break;default:e=12;break e}Gc(C,y,r,e,E),_a(E,0|G[I>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2])}if((0|F)<(0|l)&&(Da(p,I),_a(I,0|G[S>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2])),G[w>>2]=G[S>>2],G[4+w>>2]=G[4+S>>2],G[8+w>>2]=G[8+S>>2],G[12+w>>2]=G[12+S>>2],(0|f)<=(0|(F=F+1|0))){e=3;break}}3==(0|e)?U=D:12==(0|e)&&M(22474,22521,581,22531)}}function bb(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=U;for(U=U+128|0,a=20208,s=(o=r=(i=A)+64|0)+60|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););for(a=20272,s=(o=i)+60|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););r=(s=0==(0|Rb(0|G[t>>2])))?r:i,Ra(i=e+4|0),Sa(i),0|Rb(0|G[t>>2])&&(La(i),G[t>>2]=1+(0|G[t>>2])),G[n>>2]=G[e>>2],Ea(i,r,t=n+4|0),Ca(t),G[n+16>>2]=G[e>>2],Ea(i,r+12|0,t=n+20|0),Ca(t),G[n+32>>2]=G[e>>2],Ea(i,r+24|0,t=n+36|0),Ca(t),G[n+48>>2]=G[e>>2],Ea(i,r+36|0,t=n+52|0),Ca(t),G[n+64>>2]=G[e>>2],Ea(i,r+48|0,n=n+68|0),Ca(n),U=A}function cb(e,t,n,r){n|=0;var i,o,a,s,A,l=0,c=0,g=0,u=0,d=0,h=U;if(U=U+32|0,A=h+12|0,o=h,u=0|G[16928+((t|=0)<<2)>>2],u=(s=0!=(0|(r|=0)))?3*u|0:u,l=0|G[(d=(e|=0)+4|0)>>2],i=0|G[(a=e+8|0)>>2],s){if((0|(l=i+l+(r=0|G[(c=e+12|0)>>2])|0))==(0|u))return U=h,0|(d=1);g=c}else l=i+l+(r=0|G[(g=e+12|0)>>2])|0;if((0|l)<=(0|u))return U=h,(d=0)|d;do{if(0<(0|r)){if(r=0|G[e>>2],0<(0|i)){c=18608+(80*r|0)+60|0,r=e;break}r=18608+(80*r|0)+40|0,r=(c=(n&&(function Aa(e,t,n,r){n|=0,r|=0,G[(e|=0)>>2]=t|=0,G[e+4>>2]=n,G[e+8>>2]=r}(A,u,0,0),Fa(d,A,o),Oa(o),Ea(o,A,d)),r),e)}else c=18608+(80*(0|G[e>>2])|0)+20|0,r=e}while(0);if(G[r>>2]=G[c>>2],0<(0|G[(l=c+16|0)>>2]))for(r=0;Na(d),(0|(r=r+1|0))<(0|G[l>>2]););return G[A>>2]=G[(e=c+4|0)>>2],G[4+A>>2]=G[e+4>>2],G[8+A>>2]=G[e+8>>2],t=0|G[16848+(t<<2)>>2],Ga(A,s?3*t|0:t),Ea(d,A,d),Ca(d),r=s&&((0|G[a>>2])+(0|G[d>>2])+(0|G[g>>2])|0)==(0|u)?1:2,U=h,0|(d=r)}function eb(e,t,n,r,i){e|=0,n|=0,r|=0,i|=0;var o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q=0,w=0,S=U;if(U=U+240|0,m=S+208|0,B=(y=S)+192|0,b=S+176|0,h=S+160|0,p=S+144|0,f=S+128|0,I=S+112|0,C=S+96|0,G[(o=S+224|0)>>2]=t|=0,G[m>>2]=G[e>>2],G[4+m>>2]=G[e+4>>2],G[8+m>>2]=G[e+8>>2],G[12+m>>2]=G[e+12>>2],fb(m,o,y),((G[i>>2]=0)|(d=r+n+(6==(0|r)&1)|0))<=(0|n))U=S;else{s=n+6|0,A=16928+((a=0|G[o>>2])<<2)|0,l=8+p|0,c=8+f|0,g=8+I|0,u=4+B|0,Q=0,w=n,r=-1;e:for(;;){if(G[B>>2]=G[(e=y+((o=(0|w)%6|0)<<4)|0)>>2],G[4+B>>2]=G[e+4>>2],G[8+B>>2]=G[e+8>>2],G[12+B>>2]=G[e+12>>2],e=Q,Q=0|cb(B,a,0,1),(0|n)<(0|w)&0!=(0|Rb(t))&&(1!=(0|e)&&(0|G[B>>2])!=(0|r))){switch(Da(y+(((5+o|0)%6|0)<<4)+4|0,b),Da(y+(o<<4)+4|0,h),v=0|G[A>>2],N[p>>3]=3*v,N[l>>3]=0,N[f>>3]=E=-1.5*v,N[c>>3]=2.598076211353316*v,N[I>>3]=E,N[g>>3]=-2.598076211353316*v,o=0|G[m>>2],0|G[17008+(80*o|0)+(((0|r)==(0|o)?0|G[B>>2]:r)<<2)>>2]){case 1:e=f,r=p;break;case 3:e=I,r=f;break;case 2:e=p,r=I;break;default:e=8;break e}Gc(b,h,r,e,C),0|Hc(b,C)||0|Hc(h,C)||(_a(C,0|G[m>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2]))}if((0|w)<(0|s)&&(Da(u,b),_a(b,0|G[B>>2],a,1,i+8+(G[i>>2]<<4)|0),G[i>>2]=1+(0|G[i>>2])),(0|d)<=(0|(w=w+1|0))){e=3;break}r=0|G[B>>2]}3==(0|e)?U=S:8==(0|e)&&M(22557,22521,746,22602)}}function fb(e,t,n){e|=0,t|=0,n|=0;var r=0,i=0,o=0,a=0,s=0,A=U;for(U=U+160|0,a=20336,s=(o=r=(i=A)+80|0)+72|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););for(a=20416,s=(o=i)+72|0;G[o>>2]=G[a>>2],a=a+4|0,(0|(o=o+4|0))<(0|s););r=(s=0==(0|Rb(0|G[t>>2])))?r:i,Ra(i=e+4|0),Sa(i),0|Rb(0|G[t>>2])&&(La(i),G[t>>2]=1+(0|G[t>>2])),G[n>>2]=G[e>>2],Ea(i,r,t=n+4|0),Ca(t),G[n+16>>2]=G[e>>2],Ea(i,r+12|0,t=n+20|0),Ca(t),G[n+32>>2]=G[e>>2],Ea(i,r+24|0,t=n+36|0),Ca(t),G[n+48>>2]=G[e>>2],Ea(i,r+36|0,t=n+52|0),Ca(t),G[n+64>>2]=G[e>>2],Ea(i,r+48|0,t=n+68|0),Ca(t),G[n+80>>2]=G[e>>2],Ea(i,r+60|0,n=n+84|0),Ca(n),U=A}function gb(e){var t=(e=+e)<0?e+6.283185307179586:e;return+(6.283185307179586<=e?t+-6.283185307179586:t)}function hb(e,t){return+k(+N[(e|=0)>>3]-+N[(t|=0)>>3])<17453292519943298e-27?0|(t=+k(+N[e+8>>3]-+N[t+8>>3])<17453292519943298e-27):(t=0)|t}function jb(e,t){var n,r=+N[(t|=0)>>3],i=+N[(e|=0)>>3];return n=(n=+u(.5*(r-i)))*n+(n=+u(.5*(+N[t+8>>3]-+N[e+8>>3])))*(+g(r)*+g(i)*n),2*+d(+c(n),+c(1-n))*6371.007180918475}function sb(e,t,n){n|=0;var r,i=+N[(t|=0)>>3],o=+N[(e|=0)>>3],a=+u(.5*(i-o)),t=+N[t+8>>3],e=+N[e+8>>3],s=+u(.5*(t-e)),A=+g(o),l=+g(i);return s=2*+d(+c(s=a*a+l*A*s*s),+c(1-s)),a=+N[n>>3],i=+u(.5*(a-i)),n=+N[n+8>>3],t=+u(.5*(n-t)),r=+g(a),t=2*+d(+c(t=i*i+l*r*t*t),+c(1-t)),a=+u(.5*(o-a)),n=+u(.5*(e-n)),n=2*+d(+c(n=a*a+A*r*n*n),+c(1-n)),4*+Ae(+c(+oe(.5*(r=.5*(s+t+n)))*+oe(.5*(r-s))*+oe(.5*(r-t))*+oe(.5*(r-n))))}function Ab(e,t){return t=0|cd(0|(e|=0),0|(t|=0),45),T(),127&t|0}function Bb(e,t){var n=0,r=0,i=0,o=0,a=0,s=0;if(!(!0&134217728==(-16777216&(t|=0)|0)))return(t=0)|t;if(a=0|cd(0|(e|=0),0|t,45),T(),121<(a&=127)>>>0)return(t=0)|t;n=0|cd(0|e,0|t,52),T(),n&=15;do{if(0|n){for(i=1,r=0;;){if(o=0|cd(0|e,0|t,3*(15-i|0)|0),T(),0!=(0|(o&=7))&(1^r)){if(1==(0|o)&0!=(0|la(a))){s=0,r=13;break}r=1}if(7==(0|o)){s=0,r=13;break}if(!(i>>>0>>0)){r=9;break}i=i+1|0}if(9==(0|r)){if(15!=(0|n))break;return 0|(s=1)}if(13==(0|r))return 0|s}}while(0);for(;;){if(s=0|cd(0|e,0|t,3*(14-n|0)|0),T(),!(7==(7&s|0)&!0)){s=0,r=13;break}if(!(n>>>0<14)){s=1,r=13;break}n=n+1|0}return 13==(0|r)?0|s:0}function Cb(e,t,n){n|=0;var r,i=0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),(0|n)<=(0|(i&=15))){if((0|i)!=(0|n))if(n>>>0<=15){if(e|=0|dd(0|n,0,52),t=0|T()|-15728641&t,(0|n)<(0|i))for(;r=0|dd(7,0,3*(14-n|0)|0),n=n+1|0,e|=r,t=0|T()|t,(0|n)<(0|i););}else e=t=0}else e=t=0;return y(0|t),0|e}function Eb(e,t,n,r){n|=0,r|=0;var i,o,a=0,s=0,A=0,l=0,c=0,A=0|cd(0|(e|=0),0|(t|=0),52);if(T(),(0|n)<16&(0|(A&=15))<=(0|n)){if((0|A)==(0|n))return G[(n=r)>>2]=e,void(G[n+4>>2]=t);if(o=(0|(l=0|tc(7,n-A|0)))/7|0,i=0|cd(0|e,0|t,45),T(),0|la(127&i)){e:do{if(A)for(s=1;;){if(a=0|cd(0|e,0|t,3*(15-s|0)|0),T(),0|(a&=7))break e;if(!(s>>>0>>0)){a=0;break}s=s+1|0}else a=0}while(0);s=0==(0|a)}else s=0;if(c=0|dd(A+1|0,0,52),a=0|T()|-15728641&t,Eb(t=(c|e)&~(t=0|dd(7,0,0|(i=3*(14-A|0)|0))),A=a&~(0|T()),n,r),a=r+(o<<3)|0,!s)return Eb((c=0|dd(1,0,0|i))|t,0|T()|A,n,a),c=a+(o<<3)|0,Eb((l=0|dd(2,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(3,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(4,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(5,0,0|i))|t,0|T()|A,n,c),void Eb((l=0|dd(6,0,0|i))|t,0|T()|A,n,c+(o<<3)|0);s=a+(o<<3)|0,6<(0|l)&&(hd(0|a,0,(c=((l=a+8|0)>>>0>>0?s:l)+-1+(0-a)|0)+8&-8|0),a=l+(c>>>3<<3)|0),Eb((c=0|dd(2,0,0|i))|t,0|T()|A,n,a),c=a+(o<<3)|0,Eb((l=0|dd(3,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(4,0,0|i))|t,0|T()|A,n,c),c=c+(o<<3)|0,Eb((l=0|dd(5,0,0|i))|t,0|T()|A,n,c),Eb((l=0|dd(6,0,0|i))|t,0|T()|A,n,c+(o<<3)|0)}}function Fb(e,t){var n=0,r=0,i=0,i=0|cd(0|(e|=0),0|(t|=0),45);if(T(),!(0|la(127&i)))return(i=0)|i;i=0|cd(0|e,0|t,52),T(),i&=15;e:do{if(i)for(r=1;;){if(n=0|cd(0|e,0|t,3*(15-r|0)|0),T(),0|(n&=7))break e;if(!(r>>>0>>0)){n=0;break}r=r+1|0}else n=0}while(0);return 0|(i=0==(0|n)&1)}function Lb(e,t){var n=0,r=0,i=0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(i&=15))return(i=0)|i;for(r=1;;){if(n=0|cd(0|e,0|t,3*(15-r|0)|0),T(),0|(n&=7)){r=5;break}if(!(r>>>0>>0)){n=0,r=5;break}r=r+1|0}return 5==(0|r)?0|n:0}function Mb(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0,A=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(A&=15))return A=e,y(0|(s=t)),0|A;for(s=1,n=0;;){r=0|dd(7,0,0|(o=3*(15-s|0)|0)),i=0|T(),a=0|cd(0|e,0|t,0|o),T(),e=(o=0|dd(0|Pa(7&a),0,0|o))|e&~r,t=(a=0|T())|t&~i;e:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|cd(0|e,0|t,52),T(),r&=15){n=1;t:for(;;){switch(a=0|cd(0|e,0|t,3*(15-n|0)|0),T(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(i=0|cd(0|e,0|t,0|(a=3*(15-n|0)|0)),T(),o=0|dd(7,0,0|a),t&=~(0|T()),e=e&~o|(a=0|dd(0|Pa(7&i),0,0|a)),t=0|t|T(),!(n>>>0>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>0))break;s=s+1|0}return y(0|t),0|e}function Nb(e,t){var n,r,i,o=0,a=0,a=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(a&=15))return a=e,y(0|(o=t)),0|a;for(o=1;;){if(i=0|cd(0|e,0|t,0|(r=3*(15-o|0)|0)),T(),n=0|dd(7,0,0|r),t&=~(0|T()),e=0|dd(0|Pa(7&i),0,0|r)|e&~n,t=0|T()|t,!(o>>>0>>0))break;o=o+1|0}return y(0|t),0|e}function Pb(e,t){var n,r,i,o=0,a=0,a=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(a&=15))return a=e,y(0|(o=t)),0|a;for(o=1;;){if(r=0|dd(7,0,0|(i=3*(15-o|0)|0)),n=t&~(0|T()),t=0|cd(0|e,0|t,0|i),T(),e=(t=0|dd(0|Qa(7&t),0,0|i))|e&~r,t=0|T()|n,!(o>>>0>>0))break;o=o+1|0}return y(0|t),0|e}function Qb(e,t){e|=0;var n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=U;if(U=U+64|0,s=c+40|0,r=c+24|0,i=c+12|0,o=c,dd(0|(t|=0),0,52),n=134225919|T(),!t)return U=(2<(0|G[e+4>>2])||2<(0|G[e+8>>2])||2<(0|G[e+12>>2])?y((s=a=0)|a):(dd(0|na(e),0,45),a=0|T()|n,s=-1,y(0|a)),c),0|s;if(G[s>>2]=G[e>>2],G[s+4>>2]=G[e+4>>2],G[s+8>>2]=G[e+8>>2],G[s+12>>2]=G[e+12>>2],a=s+4|0,0<(0|t))for(e=-1;;){if(G[r>>2]=G[a>>2],G[r+4>>2]=G[a+4>>2],G[r+8>>2]=G[a+8>>2],1&t?(Ia(a),G[i>>2]=G[a>>2],G[i+4>>2]=G[a+4>>2],G[i+8>>2]=G[a+8>>2],Ka(i)):(Ja(a),G[i>>2]=G[a>>2],G[i+4>>2]=G[a+4>>2],G[i+8>>2]=G[a+8>>2],La(i)),Fa(r,i,o),Ca(o),A=0|dd(7,0,0|(l=3*(15-t|0)|0)),n&=~(0|T()),e=(l=0|dd(0|Ha(o),0,0|l))|e&~A,n=0|T()|n,!(1<(0|t)))break;t=t+-1|0}else e=-1;e:do{if((0|G[a>>2])<=2&&(0|G[s+8>>2])<=2&&(0|G[s+12>>2])<=2){if(t=0|dd(0|(r=0|na(s)),0,45),t|=e,e=0|T()|-1040385&n,o=0|function oa(e){return 0|G[11152+(216*(0|G[(e|=0)>>2])|0)+(72*(0|G[e+4>>2])|0)+(24*(0|G[e+8>>2])|0)+(G[e+12>>2]<<3)+4>>2]}(s),!(0|la(r))){if((0|o)<=0)break;for(i=0;;){if(r=0|cd(0|t,0|e,52),T(),r&=15)for(n=1;;){if(s=0|cd(0|t,0|e,0|(l=3*(15-n|0)|0)),T(),A=0|dd(7,0,0|l),e&=~(0|T()),t=t&~A|(l=0|dd(0|Pa(7&s),0,0|l)),e=0|e|T(),!(n>>>0>>0))break;n=n+1|0}if((0|(i=i+1|0))==(0|o))break e}}i=0|cd(0|t,0|e,52),T(),i&=15;t:do{if(i){n=1;n:for(;;){switch(l=0|cd(0|t,0|e,3*(15-n|0)|0),T(),7&l){case 1:break n;case 0:break;default:break t}if(!(n>>>0>>0))break t;n=n+1|0}if(0|ra(r,0|G[s>>2]))for(n=1;;){if(A=0|dd(7,0,0|(s=3*(15-n|0)|0)),l=e&~(0|T()),e=0|cd(0|t,0|e,0|s),T(),t=t&~A|(e=0|dd(0|Qa(7&e),0,0|s)),e=0|l|T(),!(n>>>0>>0))break;n=n+1|0}else for(n=1;;){if(s=0|cd(0|t,0|e,0|(l=3*(15-n|0)|0)),T(),A=0|dd(7,0,0|l),e&=~(0|T()),t=t&~A|(l=0|dd(0|Pa(7&s),0,0|l)),e=0|e|T(),!(n>>>0>>0))break;n=n+1|0}}}while(0);if(0<(0|o))for(n=0;t=0|Mb(t,e),e=0|T(),(0|(n=n+1|0))!=(0|o););}else e=t=0}while(0);return l=t,y(0|(A=e)),U=c,0|l}function Rb(e){return(0|(e|=0))%2|0}function Sb(e,t){e|=0;var n,r=U;return U=U+16|0,n=r,(t|=0)>>>0<=15&&2146435072!=(2146435072&G[e+4>>2]|0)&&2146435072!=(2146435072&G[e+8+4>>2]|0)?(Ya(e,t,n),t=0|Qb(n,t),e=0|T()):t=e=0,y(0|e),U=r,0|t}function Tb(e,t,n){var r=0,i=0,o=0,a=(n|=0)+4|0,i=0|cd(0|(e|=0),0|(t|=0),52);if(T(),i&=15,o=0|cd(0|e,0|t,45),T(),r=0==(0|i),0|la(127&o)){if(r)return 0|(o=1);r=1}else{if(r)return(o=0)|o;r=0==(0|G[a>>2])&&0==(0|G[n+8>>2])?0!=(0|G[n+12>>2])&1:1}for(n=1;;){if((1&n?Ka:La)(a),o=0|cd(0|e,0|t,3*(15-n|0)|0),T(),Ma(a,7&o),!(n>>>0>>0))break;n=n+1|0}return 0|r}function Ub(e,t,n){n|=0;var r,i=0,o=0,a=0,s=0,A=0,l=0,c=U;U=U+16|0,r=c,l=0|cd(0|(e|=0),0|(t|=0),45),T(),l&=127;e:do{if(0!=(0|la(l))&&(a=0|cd(0|e,0|t,52),T(),0!=(0|(a&=15)))){i=1;t:for(;;){switch(A=0|cd(0|e,0|t,3*(15-i|0)|0),T(),7&A){case 5:break t;case 0:break;default:i=t;break e}if(!(i>>>0>>0)){i=t;break e}i=i+1|0}for(o=1,i=t;;){if(s=0|dd(7,0,0|(t=3*(15-o|0)|0)),A=i&~(0|T()),i=0|cd(0|e,0|i,0|t),T(),e=e&~s|(i=0|dd(0|Qa(7&i),0,0|t)),i=0|A|T(),!(o>>>0>>0))break;o=o+1|0}}else i=t}while(0);if(G[n>>2]=G[(A=7728+(28*l|0)|0)>>2],G[n+4>>2]=G[A+4>>2],G[n+8>>2]=G[A+8>>2],G[n+12>>2]=G[A+12>>2],0|Tb(e,i,n)){if(G[r>>2]=G[(s=n+4|0)>>2],G[r+4>>2]=G[s+4>>2],G[r+8>>2]=G[s+8>>2],a=0|cd(0|e,0|i,52),T(),A=15&a,a=1&a?(La(s),A+1|0):A,0|la(l)){e:do{if(A)for(t=1;;){if(o=0|cd(0|e,0|i,3*(15-t|0)|0),T(),0|(o&=7)){i=o;break e}if(!(t>>>0>>0)){i=0;break}t=t+1|0}else i=0}while(0);i=4==(0|i)&1}else i=0;if(0|cb(n,a,i,0)){if(0|la(l))for(;0!=(0|cb(n,a,0,0)););(0|a)!=(0|A)&&Ja(s)}else(0|a)!=(0|A)&&(G[s>>2]=G[r>>2],G[s+4>>2]=G[r+4>>2],G[s+8>>2]=G[r+8>>2]);U=c}else U=c}function Vb(e,t,n){n|=0;var r,i=U;U=U+16|0,Ub(e|=0,t|=0,r=i),t=0|cd(0|e,0|t,52),T(),function $a(e,t,n){t|=0,n|=0;var r,i=U;U=U+16|0,Da((e|=0)+4|0,r=i),_a(r,0|G[e>>2],t,0,n),U=i}(r,15&t,n),U=i}function Wb(e,t,n){n|=0;var r,i=0,o=0,a=U;U=U+16|0,Ub(e|=0,t|=0,r=a),i=0|cd(0|e,0|t,45),T(),i=0==(0|la(127&i)),o=0|cd(0|e,0|t,52),T(),o&=15;e:do{if(!i){if(0|o)for(i=1;;){if(!(0==((0|dd(7,0,3*(15-i|0)|0))&e|0)&0==((0|T())&t|0)))break e;if(!(i>>>0>>0))break;i=i+1|0}return ab(r,o,0,5,n),void(U=a)}}while(0);eb(r,o,0,6,n),U=a}function _b(e,t){t|=0;var n,r=0,i=0,o=0,a=0,s=0,A=0;if(dd(0|(e|=0),0,52),n=134225919|T(),(0|e)<1)for(r=i=0;0|la(i)&&(dd(0|i,0,45),s=0|n|T(),G[(e=t+(r<<3)|0)>>2]=-1,G[e+4>>2]=s,r=r+1|0),122!=(0|(i=i+1|0)););else{r=s=0;do{if(0|la(s)){for(dd(0|s,0,45),o=-(i=1),a=0|n|T();;){if(o&=~(A=0|dd(7,0,3*(15-i|0)|0)),a&=~(0|T()),(0|i)==(0|e))break;i=i+1|0}G[(A=t+(r<<3)|0)>>2]=o,G[A+4>>2]=a,r=r+1|0}}while(122!=(0|(s=s+1|0)))}}function $b(e,t,n,r){var i,o=0,a=0,s=0,A=0,l=U;if(U=U+64|0,s=l,(0|(e|=0))==(0|(n|=0))&(0|(t|=0))==(0|(r|=0))|!1|134217728!=(2013265920&t|0)|!1|134217728!=(2013265920&r|0))return U=l,(s=0)|s;if(o=0|cd(0|e,0|t,52),T(),o&=15,a=0|cd(0|n,0|r,52),T(),(0|o)!=(15&a|0))return U=l,(s=0)|s;if(a=o+-1|0,1>>0&&(A=0|Cb(e,t,a),i=0|T(),(0|A)==(0|(a=0|Cb(n,r,a)))&(0|i)==(0|T()))){if(o=0|cd(0|e,0|t,0|(a=3*(15^o)|0)),T(),o&=7,a=0|cd(0|n,0|r,0|a),T(),0==(0|o)|0==(0|(a&=7)))return U=l,0|(A=1);if((0|G[21136+(o<<2)>>2])==(0|a))return U=l,0|(A=1);if((0|G[21168+(o<<2)>>2])==(0|a))return U=l,0|(A=1)}for(a=(o=s)+56|0;(0|(o=o+4|(G[o>>2]=0)))<(0|a););return $(e,t,1,s),o=(0|G[(A=s)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+8|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+16|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+24|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+32|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)||(0|G[(A=s+40|0)>>2])==(0|n)&&(0|G[A+4>>2])==(0|r)?1:1&((0|G[(o=s+48|0)>>2])==(0|n)?(0|G[o+4>>2])==(0|r):0),U=l,0|(A=o)}function gc(e,t,n){n|=0;var r,i,o,a=0,s=U;if(U=U+16|0,i=s,a=0|cd(0|(e|=0),0|(t|=0),56),T(),-1==(0|(t=0|function Lc(e,t,n){n|=0;var r=0,i=0;if(r=0|Fb(e|=0,t|=0),5<(n+-1|0)>>>0)return 0|(n=-1);if(1==(0|n)&(i=0!=(0|r)))return 0|(n=-1);return r=0|function Kc(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0;if(U=(l=U)+32|0,Ub(e|=0,t|=0,i=(o=l)+16|0),a=0|Ab(e,t),A=0|Lb(e,t),function pa(e,t){G[(t|=0)>>2]=G[(e=7728+(28*(e|=0)|0)|0)>>2],G[t+4>>2]=G[e+4>>2],G[t+8>>2]=G[e+8>>2],G[t+12>>2]=G[e+12>>2]}(a,o),t=0|function qa(e,t){e|=0;var n=0,r=0;if(20<(t|=0)>>>0)return 0|(t=-1);do{if((0|G[11152+(216*t|0)>>2])!=(0|e))if((0|G[11152+(216*t|0)+8>>2])!=(0|e))if((0|G[11152+(216*t|0)+16>>2])!=(0|e))if((0|G[11152+(216*t|0)+24>>2])!=(0|e))if((0|G[11152+(216*t|0)+32>>2])!=(0|e))if((0|G[11152+(216*t|0)+40>>2])!=(0|e))if((0|G[11152+(216*t|0)+48>>2])!=(0|e))if((0|G[11152+(216*t|0)+56>>2])!=(0|e))if((0|G[11152+(216*t|0)+64>>2])!=(0|e))if((0|G[11152+(216*t|0)+72>>2])!=(0|e))if((0|G[11152+(216*t|0)+80>>2])!=(0|e))if((0|G[11152+(216*t|0)+88>>2])!=(0|e))if((0|G[11152+(216*t|0)+96>>2])!=(0|e))if((0|G[11152+(216*t|0)+104>>2])!=(0|e))if((0|G[11152+(216*t|0)+112>>2])!=(0|e))if((0|G[11152+(216*t|0)+120>>2])!=(0|e))if((0|G[11152+(216*t|0)+128>>2])!=(0|e)){if((0|G[11152+(216*t|0)+136>>2])!=(0|e)){if((0|G[11152+(216*t|0)+144>>2])==(0|e)){n=2,r=e=0;break}if((0|G[11152+(216*t|0)+152>>2])==(0|e)){e=0,n=2,r=1;break}if((0|G[11152+(216*t|0)+160>>2])==(0|e)){e=0,r=n=2;break}if((0|G[11152+(216*t|0)+168>>2])==(0|e)){e=1,n=2,r=0;break}if((0|G[11152+(216*t|0)+176>>2])==(0|e)){n=2,r=e=1;break}if((0|G[11152+(216*t|0)+184>>2])==(0|e)){e=1,r=n=2;break}if((0|G[11152+(216*t|0)+192>>2])==(0|e)){n=e=2,r=0;break}if((0|G[11152+(216*t|0)+200>>2])==(0|e)){n=e=2,r=1;break}if((0|G[11152+(216*t|0)+208>>2])!=(0|e))return 0|(e=-1);r=n=e=2;break}n=1,r=e=2}else e=2,r=n=1;else e=2,n=1,r=0;else n=e=1,r=2;else r=n=e=1;else n=e=1,r=0;else e=0,n=1,r=2;else e=0,r=n=1;else n=1,r=e=0;else n=0,r=e=2;else e=2,n=0,r=1;else e=2,r=n=0;else e=1,n=0,r=2;else n=0,r=e=1;else e=1,r=n=0;else n=e=0,r=2;else n=e=0,r=1;else r=n=e=0}while(0);return 0|(t=0|G[11152+(216*t|0)+(72*n|0)+(24*e|0)+(r<<3)+4>>2])}(a,0|G[i>>2]),!(0|la(a)))return U=l,0|(A=t);{switch(0|a){case 4:e=0,n=14;break;case 14:e=1,n=14;break;case 24:e=2,n=14;break;case 38:e=3,n=14;break;case 49:e=4,n=14;break;case 58:e=5,n=14;break;case 63:e=6,n=14;break;case 72:e=7,n=14;break;case 83:e=8,n=14;break;case 97:e=9,n=14;break;case 107:e=10,n=14;break;case 117:e=11,n=14;break;default:r=s=0}}14==(0|n)&&(s=0|G[22096+(24*e|0)+8>>2],r=0|G[22096+(24*e|0)+16>>2]);(0|(e=0|G[i>>2]))!=(0|G[o>>2])&&(a=0|ma(a),e=0|G[i>>2],a|(0|e)==(0|r)&&(t=(t+1|0)%6|0));if(3==(0|A)&(0|e)==(0|r))return U=l,0|(A=(t+5|0)%6|0);return 5==(0|A)&(0|e)==(0|s)?(U=l,0|(A=(t+1|0)%6|0)):(U=l,0|(A=t))}(e,t),i?0|(n=(5-r+(0|G[22384+(n<<2)>>2])|0)%5|0):0|(n=(6-r+(0|G[22416+(n<<2)>>2])|0)%6|0)}(r=(o=!0&268435456==(2013265920&t|0))?e:0,e=o?-2130706433&t|134217728:0,7&a))))return G[n>>2]=0,void(U=s);Ub(r,e,i),a=0|cd(0|r,0|e,52),T(),a&=15,(0|Fb(r,e)?ab:eb)(i,a,t,2,n),U=s}function kc(e){var t,n,r,i,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=0,b=0,v=0,E=0,Q=0,w=0,S=0,_=0,x=0,R=0,F=0,D=0;if(0|G[(A=(e|=0)+8|0)>>2])return 0|(D=1);if(!(s=0|G[e>>2]))return(D=0)|D;for(o=s,a=0;a=a+1|0,0!=(0|(o=0|G[o+8>>2])););if(a>>>0<2)return(D=0)|D;(i=0|Wc(a<<2))||M(22807,22646,317,22826),(r=0|Wc(a<<5))||M(22848,22646,321,22826),G[e>>2]=0,G[(w=e+4|0)>>2]=0,p=Q=R=a=G[A>>2]=0;e:for(;;){if(h=0|G[s>>2]){l=0,c=h;do{if(u=+N[c+8>>3],c=0|G[(o=c)+16>>2],g=+N[(A=(d=0==(0|c))?h:c)+8>>3],3.141592653589793<+k(u-g)){D=14;break}}while(l+=(g-u)*(+N[o>>3]+ +N[A>>3]),!d);if(14==(0|D))for(l=D=0,o=h;E=+N[o+8>>3],_=0|G[(x=o+16|0)>>2],v=+N[(_=0==(0|_)?h:_)+8>>3],l+=(+N[o>>3]+ +N[_>>3])*((v<0?v+6.283185307179586:v)-(E<0?E+6.283185307179586:E)),0!=(0|(o=0|G[(0==(0|o)?s:x)>>2])););0>2]=s,R=R+1|0,A=Q,o=p):D=19}else D=19;if(19==(0|D)){D=0;do{if(!a){if(p){A=w,c=p+8|0,o=s,a=e;break}if(0|G[e>>2]){D=27;break e}A=w,o=s,a=c=e;break}if(0|G[(o=a+8|0)>>2]){D=21;break e}if(!(a=0|Yc(1,12))){D=23;break e}}while(A=(G[o>>2]=a)+4|0,c=a,o=p,0);if(G[c>>2]=s,G[A>>2]=s,c=r+(Q<<5)|0,d=0|G[s>>2]){for(N[(h=r+(Q<<5)+8|0)>>3]=17976931348623157e292,N[(p=r+(Q<<5)+24|0)>>3]=17976931348623157e292,N[c>>3]=-17976931348623157e292,N[(f=r+(Q<<5)+16|0)>>3]=-17976931348623157e292,b=-(B=17976931348623157e292),A=0,I=d,g=y=-(m=u=17976931348623157e292);;){if(l=+N[I>>3],E=+N[I+8>>3],I=0|G[I+16>>2],v=+N[((C=0==(0|I))?d:I)+8>>3],l>3]=l),E>3]=E),y>3]=l:l=y,g>3]=E),B=0>3]=b,N[p>>3]=B)}else G[c>>2]=0,G[c+4>>2]=0,G[c+8>>2]=0,G[c+12>>2]=0,G[c+16>>2]=0,G[c+20>>2]=0,G[c+24>>2]=0,G[c+28>>2]=0;A=Q+1|0}if(s=0|G[(x=s+8|0)>>2],G[x>>2]=0,!s){D=45;break}Q=A,p=o}if(21==(0|D))M(22624,22646,35,22658);else if(23==(0|D))M(22678,22646,37,22658);else if(27==(0|D))M(22721,22646,61,22744);else if(45==(0|D)){e:do{if(0<(0|R)){for(x=0==(0|A),n=A<<2,_=0==(0|e),o=S=0;;){if(t=0|G[i+(S<<2)>>2],x)D=73;else{if(!(Q=0|Wc(n))){D=50;break}if(!(w=0|Wc(n))){D=52;break}t:do{if(_)a=0;else{for(a=A=0,c=e;;){if(C=0|lc(0|G[c>>2],s=r+(A<<5)|0,0|G[t>>2])?(G[Q+(a<<2)>>2]=c,G[w+(a<<2)>>2]=s,a+1|0):a,!(c=0|G[c+8>>2]))break;A=A+1|0,a=C}if(0<(0|C))if(s=0|G[Q>>2],1==(0|C))a=s;else for(f=0,I=-1,p=a=s;;){for(d=0|G[p>>2],c=s=0;;){if(h=(0|(A=0|G[G[Q+(c<<2)>>2]>>2]))==(0|d)?s:s+(1&(0|lc(A,0|G[w+(c<<2)>>2],0|G[d>>2])))|0,(0|(c=c+1|0))==(0|C))break;s=h}if(a=(A=(0|I)<(0|h))?p:a,(0|(s=f+1|0))==(0|C))break t;I=A?h:I,p=0|G[Q+((f=s)<<2)>>2]}else a=0}}while(0);if(Xc(Q),Xc(w),a){if(s=0|G[(A=a+4|0)>>2])a=s+8|0;else if(0|G[a>>2]){D=70;break}G[a>>2]=t,G[A>>2]=t}else D=73}if(73==(0|D)){if((D=0)|(o=0|G[t>>2]))for(;o=0|G[(w=o)+16>>2],Xc(w),0!=(0|o););Xc(t),o=2}if((0|R)<=(0|(S=S+1|0))){F=o;break e}}50==(0|D)?M(22863,22646,249,22882):52==(0|D)?M(22901,22646,252,22882):70==(0|D)&&M(22721,22646,61,22744)}else F=0}while(0);return Xc(i),Xc(r),0|(D=F)}return 0}function lc(e,t,n){e|=0;var r,i=0,o=0,a=0,s=0,A=0,l=0,c=0;if(!(0|xa(t|=0,n|=0)))return(e=0)|e;if(t=0|wa(t),r=+N[n>>3],i=t&(i=+N[n+8>>3])<0?i+6.283185307179586:i,!(e=0|G[e>>2]))return(e=0)|e;if(t){t=0,n=e;e:for(;;){for(;;){if(s=+N[n>>3],l=+N[n+8>>3],c=0|G[(n=n+16|0)>>2],a=+N[(c=0==(0|c)?e:c)>>3],o=+N[c+8>>3],a>2])){n=22;break e}}if((i=(s=s<0?s+6.283185307179586:s)==i|(l=o<0?o+6.283185307179586:o)==i?i+-2220446049250313e-31:i)<((l+=(r-a)/(A-a)*(s-l))<0?l+6.283185307179586:l)&&(t^=1),!(n=0|G[n>>2])){n=22;break}}if(22==(0|n))return 0|t}else{t=0,n=e;e:for(;;){for(;;){if(s=+N[n>>3],l=+N[n+8>>3],c=0|G[(n=n+16|0)>>2],a=+N[(c=0==(0|c)?e:c)>>3],o=+N[c+8>>3],a>2])){n=22;break e}}if((i=s==i|o==i?i+-2220446049250313e-31:i)>2])){n=22;break}}if(22==(0|n))return 0|t}return 0}function mc(e,t,n,r,i){n|=0,r|=0,i|=0;var o,a,s,A,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=U;if(U=U+32|0,I=C+16|0,A=C,l=0|cd(0|(e|=0),0|(t|=0),52),T(),l&=15,s=0|cd(0|n,0|r,52),T(),(0|l)!=(15&s|0))return U=C,0|(I=1);if(d=0|cd(0|e,0|t,45),T(),d&=127,h=0|cd(0|n,0|r,45),T(),s=(0|d)!=(0|(h&=127))){if(7==(0|(g=0|ta(d,h))))return U=C,0|(I=2);7==(0|(u=0|ta(h,d)))?M(22925,22949,151,22959):(p=g,c=u)}else c=p=0;o=0|la(d),a=0|la(h),G[I>>2]=0,G[I+4>>2]=0,G[I+8>>2]=0,G[I+12>>2]=0;do{if(p){if(g=0<(0|(h=0|G[4304+(28*d|0)+(p<<2)>>2])),a)if(g){for(d=0,u=n,g=r;u=0|function Ob(e,t){var n=0,r=0,i=0,o=0,a=0,s=0,A=0,A=0|cd(0|(e|=0),0|(t|=0),52);if(T(),!(A&=15))return A=e,y(0|(s=t)),0|A;for(s=1,n=0;;){r=0|dd(7,0,0|(o=3*(15-s|0)|0)),i=0|T(),a=0|cd(0|e,0|t,0|o),T(),e=(o=0|dd(0|Qa(7&a),0,0|o))|e&~r,t=(a=0|T())|t&~i;e:do{if(!n)if(0==(o&r|0)&0==(a&i|0))n=0;else if(r=0|cd(0|e,0|t,52),T(),r&=15){n=1;t:for(;;){switch(a=0|cd(0|e,0|t,3*(15-n|0)|0),T(),7&a){case 1:break t;case 0:break;default:n=1;break e}if(!(n>>>0>>0)){n=1;break e}n=n+1|0}for(n=1;;){if(o=0|dd(7,0,0|(i=3*(15-n|0)|0)),a=t&~(0|T()),t=0|cd(0|e,0|t,0|i),T(),e=e&~o|(t=0|dd(0|Qa(7&t),0,0|i)),t=0|a|T(),!(n>>>0>>0)){n=1;break}n=n+1|0}}else n=1}while(0);if(!(s>>>0>>0))break;s=s+1|0}return y(0|t),0|e}(u,g),g=0|T(),1==(0|(c=0|Qa(c)))&&(c=0|Qa(1)),(0|(d=d+1|0))!=(0|h););h=c,d=u,u=g}else h=c,d=n,u=r;else if(g){for(d=0,u=n,g=r;u=0|Pb(u,g),g=0|T(),c=0|Qa(c),(0|(d=d+1|0))!=(0|h););h=c,d=u,u=g}else h=c,d=n,u=r;if(Tb(d,u,I),s||M(22972,22949,181,22959),(g=0!=(0|o))&(c=0!=(0|a))&&M(22999,22949,182,22959),g){if(c=0|Lb(e,t),0|m[22032+(7*c|0)+p>>0]){l=3;break}d=u=0|G[21200+(28*c|0)+(p<<2)>>2],f=26}else if(c){if(c=0|Lb(d,u),0|m[22032+(7*c|0)+h>>0]){l=4;break}u=(d=0)|G[21200+(28*h|0)+(c<<2)>>2],f=26}else c=0;if(26==(0|f))if((0|u)<=-1&&M(23030,22949,212,22959),(0|d)<=-1&&M(23053,22949,213,22959),0<(0|u)){for(g=I+4|0,c=0;Oa(g),(0|(c=c+1|0))!=(0|u););c=d}else c=d;if(G[A>>2]=0,G[A+4>>2]=0,G[A+8>>2]=0,Ma(A,p),0|l)for(;;){if((0|Rb(l)?Ka:La)(A),!(1<(0|l)))break;l=l+-1|0}if(0<(0|c))for(l=0;Oa(A),(0|(l=l+1|0))!=(0|c););Ea(f=I+4|0,A,f),Ca(f),f=50}else if(Tb(n,r,I),0!=(0|o)&0!=(0|a))if((0|h)!=(0|d)&&M(23077,22949,243,22959),c=0|Lb(e,t),l=0|Lb(n,r),0|m[22032+(7*c|0)+l>>0])l=5;else if(0<(0|(c=0|G[21200+(28*c|0)+(l<<2)>>2]))){for(g=I+4|0,l=0;Oa(g),(0|(l=l+1|0))!=(0|c););f=50}else f=50;else f=50}while(0);return 50==(0|f)&&(G[i>>2]=G[(l=I+4|0)>>2],G[i+4>>2]=G[l+4>>2],G[i+8>>2]=G[l+8>>2],l=0),U=C,0|(I=l)}function nc(e,t,n,r){n|=0,r|=0;var i,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=U;if(U=U+48|0,s=C+36|0,A=C+24|0,l=C+12|0,c=C,a=0|cd(0|(e|=0),0|(t|=0),52),T(),a&=15,u=0|cd(0|e,0|t,45),T(),i=0|la(u&=127),dd(0|a,0,52),p=134225919|T(),G[(h=r)>>2]=-1,G[h+4>>2]=p,!a)return 1<(0|G[n>>2])||1<(0|G[n+4>>2])||1<(0|G[n+8>>2])||127==(0|(o=0|sa(u,0|Ha(n))))?(U=C,0|(p=1)):(d=0|dd(0|o,0,45),h=0|T(),h=-1040385&G[(u=r)+4>>2]|h,G[(p=r)>>2]=G[u>>2]|d,G[p+4>>2]=h,U=C,(p=0)|p);for(G[s>>2]=G[n>>2],G[s+4>>2]=G[n+4>>2],G[s+8>>2]=G[n+8>>2];;){if(G[A>>2]=G[s>>2],G[A+4>>2]=G[s+4>>2],G[A+8>>2]=G[s+8>>2],0|Rb(a)?(Ia(s),G[l>>2]=G[s>>2],G[l+4>>2]=G[s+4>>2],G[l+8>>2]=G[s+8>>2],Ka(l)):(Ja(s),G[l>>2]=G[s>>2],G[l+4>>2]=G[s+4>>2],G[l+8>>2]=G[s+8>>2],La(l)),Fa(A,l,c),Ca(c),f=0|G[(h=r)>>2],h=0|G[h+4>>2],n=0|dd(7,0,0|(I=3*(15-a|0)|0)),h&=~(0|T()),I=0|dd(0|Ha(c),0,0|I),h=0|T()|h,G[(p=r)>>2]=I|f&~n,G[p+4>>2]=h,!(1<(0|a)))break;a=a+-1|0}e:do{if((0|G[s>>2])<=1&&(0|G[s+4>>2])<=1&&(0|G[s+8>>2])<=1){c=127==(0|(A=0|sa(u,a=0|Ha(s))))?0:0|la(A);t:do{if(a){if(i){if(s=21408+(28*(0|Lb(e,t))|0)+(a<<2)|0,0<(0|(s=0|G[s>>2])))for(n=0;a=0|Pa(a),(0|(n=n+1|0))!=(0|s););if(1==(0|a)){o=3;break e}127==(0|(n=0|sa(u,a)))&&M(23104,22949,376,23134),0|la(n)?M(23147,22949,377,23134):(d=s,g=a,o=n)}else d=0,g=a,o=A;if((0|(l=0|G[4304+(28*u|0)+(g<<2)>>2]))<=-1&&M(23178,22949,384,23134),!c){if((0|d)<=-1&&M(23030,22949,417,23134),0|d)for(n=(a=0)|G[(s=r)>>2],s=0|G[s+4>>2];n=0|Nb(n,s),s=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=s,(0|(a=a+1|0))<(0|d););if((0|l)<=0){a=54;break}for(n=(a=0)|G[(s=r)>>2],s=0|G[s+4>>2];;)if(n=0|Nb(n,s),s=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=s,(0|(a=a+1|0))==(0|l)){a=54;break t}}if(7==(0|(A=0|ta(o,u)))&&M(22925,22949,393,23134),n=0|G[(a=r)>>2],a=0|G[a+4>>2],0<(0|l))for(s=0;n=0|Nb(n,a),a=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=a,(0|(s=s+1|0))!=(0|l););if(n=0|Lb(n,a),I=0|ma(o),(0|(n=0|G[(I?21824:21616)+(28*A|0)+(n<<2)>>2]))<=-1&&M(23030,22949,412,23134),n){for(s=(a=0)|G[(A=r)>>2],A=0|G[A+4>>2];s=0|Mb(s,A),A=0|T(),G[(I=r)>>2]=s,G[I+4>>2]=A,(0|(a=a+1|0))<(0|n););a=54}else a=54}else if(0!=(0|i)&0!=(0|c))if(a=21408+(28*(I=0|Lb(e,t))|0)+((0|Lb(0|G[(a=r)>>2],0|G[a+4>>2]))<<2)|0,(0|(a=0|G[a>>2]))<=-1&&M(23201,22949,433,23134),a){for(n=(o=0)|G[(s=r)>>2],s=0|G[s+4>>2];n=0|Nb(n,s),s=0|T(),G[(I=r)>>2]=n,G[I+4>>2]=s,(0|(o=o+1|0))<(0|a););o=A,a=54}else o=A,a=55;else o=A,a=54}while(0);if(55==(0|(a=54==(0|a)&&c?55:a))&&1==(0|Lb(0|G[(I=r)>>2],0|G[I+4>>2]))){o=4;break}p=0|G[(I=r)>>2],I=-1040385&G[I+4>>2],f=0|dd(0|o,0,45),I=0|I|T(),G[(o=r)>>2]=p|f,G[o+4>>2]=I,o=0}else o=2}while(0);return U=C,0|(I=o)}function tc(e,t){e|=0;var n=0;if(!(t|=0))return 0|(n=1);for(n=e,e=1;e=0|a(0==(1&t|0)?1:n,e),t>>=1,n=0|a(n,n),0!=(0|t););return 0|e}function uc(e,t,n){var r,i,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0;if(!(0|xa(t|=0,n|=0)))return(u=0)|u;if(t=0|wa(t),i=+N[n>>3],o=t&(o=+N[n+8>>3])<0?o+6.283185307179586:o,(0|(u=0|G[(e|=0)>>2]))<=0)return(u=0)|u;if(r=0|G[e+4>>2],t){n=-1,e=t=0;e:for(;;){for(g=e;;){if(A=+N[r+(g<<4)>>3],c=+N[r+(g<<4)+8>>3],s=+N[r+((e=(n+2|0)%(0|u)|0)<<4)>>3],a=+N[r+(e<<4)+8>>3],s>3],c=+N[r+(g<<4)+8>>3],s=+N[r+((e=(n+2|0)%(0|u)|0)<<4)>>3],a=+N[r+(e<<4)+8>>3],s>2]))return G[t>>2]=0,G[t+4>>2]=0,G[t+8>>2]=0,G[t+12>>2]=0,G[t+16>>2]=0,G[t+20>>2]=0,G[t+24>>2]=0,void(G[t+28>>2]=0);if(N[(i=t+8|0)>>3]=17976931348623157e292,N[(o=t+24|0)>>3]=17976931348623157e292,N[t>>3]=-17976931348623157e292,N[(a=t+16|0)>>3]=-17976931348623157e292,!((0|A)<=0)){for(r=0|G[e+4>>2],p=-(h=17976931348623157e292),e=-1,c=d=-(u=g=17976931348623157e292),I=f=0;;){if(l=+N[r+(I<<4)>>3],s=+N[r+(I<<4)+8>>3],n=+N[r+(((0|(e=e+2|0))==(0|A)?0:e)<<4)+8>>3],l>3]=l),s>3]=s),d>3]=l:l=d,c>3]=s),h=0>3]=p,N[o>>3]=h)}}function Gc(e,t,n,r,i){var o=+N[(e|=0)>>3],a=+N[(t|=0)>>3]-o,e=+N[e+8>>3],t=+N[t+8>>3]-e,s=+N[(n|=0)>>3],A=+N[(r|=0)>>3]-s,n=+N[n+8>>3],r=+N[r+8>>3]-n;N[(i|=0)>>3]=o+a*(A=(A*(e-n)-(o-s)*r)/(a*r-t*A)),N[i+8>>3]=e+t*A}function Hc(e,t){return+N[(e|=0)>>3]!=+N[(t|=0)>>3]?(t=0)|t:0|(t=+N[e+8>>3]==+N[t+8>>3])}function Ic(e,t){var n;return(n=+N[(e|=0)>>3]-+N[(t|=0)>>3])*n+(n=+N[e+8>>3]-+N[t+8>>3])*n+(n=+N[e+16>>3]-+N[t+16>>3])*n}function Mc(e,t,n){e|=0,n|=0;var r;0<(0|(t|=0))?(r=0|Yc(t,4),(G[e>>2]=r)||M(23230,23253,40,23267)):G[e>>2]=0,G[e+4>>2]=t,G[e+8>>2]=0,G[e+12>>2]=n}function Nc(e){var t=0,n=0,r=0,i=0,o=(e|=0)+4|0,a=e+12|0,s=e+8|0;e:for(;;){for(n=0|G[o>>2],t=0;;){if((0|n)<=(0|t))break e;if(r=0|G[e>>2],i=0|G[r+(t<<2)>>2])break;t=t+1|0}t=r+(~~(+k(+ie(10,15-(0|G[a>>2])|0)*(+N[i>>3]+ +N[i+8>>3]))%(0|n))>>>0<<2)|0,n=0|G[t>>2];t:do{if(0|n){if(r=i+32|0,(0|n)==(0|i))G[t>>2]=G[r>>2];else{if(!(t=0|G[(n=n+32|0)>>2]))break;for(;;){if((0|t)==(0|i))break;if(!(t=0|G[(n=t+32|0)>>2]))break t}G[n>>2]=G[r>>2]}Xc(i),G[s>>2]=(0|G[s>>2])-1}}while(0)}Xc(0|G[e>>2])}function Oc(e){for(var t=0,n=0,r=0|G[(e|=0)+4>>2],n=0;;){if((0|r)<=(0|n)){t=0,n=4;break}if(t=0|G[(0|G[e>>2])+(n<<2)>>2]){n=4;break}n=n+1|0}return 4==(0|n)?0|t:0}function Pc(e,t){t|=0;var n=0,r=0,i=0,o=0,n=~~(+k(+ie(10,15-(0|G[(e|=0)+12>>2])|0)*(+N[t>>3]+ +N[t+8>>3]))%(0|G[e+4>>2]))>>>0;if(n=(0|G[e>>2])+(n<<2)|0,!(r=0|G[n>>2]))return 0|(o=1);o=t+32|0;do{if((0|r)!=(0|t)){if(!(n=0|G[r+32>>2]))return 0|(o=1);for(i=n;;){if((0|i)==(0|t)){i=8;break}if(!(n=0|G[i+32>>2])){n=1,i=10;break}r=i,i=n}if(8==(0|i)){G[r+32>>2]=G[o>>2];break}if(10==(0|i))return 0|n}else G[n>>2]=G[o>>2]}while(0);return Xc(t),G[(o=e+8|0)>>2]=(0|G[o>>2])-1,(o=0)|o}function Vc(e){return 0|~~+function Uc(e){return+id(+(e=+e))}(e=+e)}function Wc(e){e|=0;var t=0,n=0,r=0,i=0,o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,p=0,f=0,I=0,C=0,m=0,y=0,B=U;U=U+16|0,u=B;do{if(e>>>0<245){if(3&(n=(g=0|G[5829])>>>(e=(l=e>>>0<11?16:e+11&-8)>>>3))|0)return r=0|G[(n=(e=23356+((t=(1&n^1)+e|0)<<1<<2)|0)+8|0)>>2],(0|(o=0|G[(i=r+8|0)>>2]))==(0|e)?G[5829]=g&~(1<>2]=e,G[n>>2]=o),G[r+4>>2]=3|(y=t<<3),G[(y=r+y+4|0)>>2]=1|G[y>>2],U=B,0|(y=i);if((c=0|G[5831])>>>0>>0){if(0|n)return t=((t=n<>>=s=t>>>12&16)>>>5&8)|s|(o=(t>>>=n)>>>2&4)|(e=(t>>>=o)>>>1&2)|(r=(t>>>=e)>>>1&1))+(t>>>r)|0)<<1<<2)|0)+8|0)>>2],(0|(n=0|G[(s=o+8|0)>>2]))==(0|t)?G[5829]=e=g&~(1<>2]=t,G[e>>2]=n,e=g),a=(y=r<<3)-l|0,G[o+4>>2]=3|l,G[(i=o+l|0)+4>>2]=1|a,G[o+y>>2]=a,0|c&&(r=0|G[5834],n=23356+((t=c>>>3)<<1<<2)|0,e&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=r,G[t+12>>2]=r,G[r+8>>2]=t,G[r+12>>2]=n),G[5831]=a,G[5834]=i,U=B,0|(y=s);if(o=0|G[5830]){for(n=(o&0-o)-1|0,A=0|G[23620+(((r=(n>>>=i=n>>>12&16)>>>5&8)|i|(a=(n>>>=r)>>>2&4)|(s=(n>>>=a)>>>1&2)|(A=(n>>>=s)>>>1&1))+(n>>>A)<<2)>>2],A=(-8&G[(s=n=A)+4>>2])-l|0;;){if(!(e=0|G[n+16>>2])&&!(e=0|G[n+20>>2]))break;s=(i=(a=(-8&G[(n=e)+4>>2])-l|0)>>>0>>0)?e:s,A=i?a:A}if(s>>>0<(a=s+l|0)>>>0){i=0|G[s+24>>2],t=0|G[s+12>>2];do{if((0|t)==(0|s)){if(!(t=0|G[(e=s+20|0)>>2])&&!(t=0|G[(e=s+16|0)>>2])){n=0;break}for(;;)if(n=0|G[(r=t+20|0)>>2])t=n,e=r;else{if(!(n=0|G[(r=t+16|0)>>2]))break;t=n,e=r}G[e>>2]=0,n=t}else n=0|G[s+8>>2],G[n+12>>2]=t,G[t+8>>2]=n,n=t}while(0);do{if(0|i){if(t=0|G[s+28>>2],(0|s)==(0|G[(e=23620+(t<<2)|0)>>2])){if(!(G[e>>2]=n)){G[5830]=o&~(1<>2])==(0|s)?y:i+20|0)>>2]=n))break;G[n+24>>2]=i,0|(t=0|G[s+16>>2])&&(G[n+16>>2]=t,G[t+24>>2]=n),0|(t=0|G[s+20>>2])&&(G[n+20>>2]=t,G[t+24>>2]=n)}}while(0);return A>>>0<16?(G[s+4>>2]=3|(y=A+l|0),G[(y=s+y+4|0)>>2]=1|G[y>>2]):(G[s+4>>2]=3|l,G[a+4>>2]=1|A,G[a+A>>2]=A,0|c&&(r=0|G[5834],n=23356+((t=c>>>3)<<1<<2)|0,(t=1<>2]:(G[5829]=t|g,e=(t=n)+8|0),G[e>>2]=r,G[t+12>>2]=r,G[r+8>>2]=t,G[r+12>>2]=n),G[5831]=A,G[5834]=a),U=B,0|(y=s+8|0)}g=l}else g=l}else g=l}else if(e>>>0<=4294967231)if(l=-8&(e=e+11|0),r=0|G[5830]){i=0-l|0,A=(e>>>=8)?16777215>>0?31:l>>>((A=14-((s=((p=e<<(g=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|g|(A=((p<<=s)+245760|0)>>>16&2))+(p<>>15)|0)+7|0)&1|A<<1:0,n=0|G[23620+(A<<2)>>2];e:do{if(n)for(s=l<<(31==((e=0)|A)?0:25-(A>>>1)|0),o=0;;){if((a=(-8&G[n+4>>2])-l|0)>>>0>>0){if(!a){e=n,i=0,p=65;break e}e=n,i=a}if(o=0==(0|(p=0|G[n+20>>2]))|(0|p)==(0|(n=0|G[n+16+(s>>>31<<2)>>2]))?o:p,!n){n=o,p=61;break}s<<=1}else e=n=0,p=61}while(0);if(61==(0|p)){if(0==(0|n)&0==(0|e)){if(!(e=((e=2<>>=a=g>>>12&16)>>>5&8)|a|(s=(g>>>=o)>>>2&4)|(A=(g>>>=s)>>>1&2)|(n=(g>>>=A)>>>1&1))+(g>>>n)<<2)>>2]}n?p=65:(s=e,a=i)}if(65==(0|p))for(o=n;;){if(i=(n=(g=(-8&G[o+4>>2])-l|0)>>>0>>0)?g:i,e=n?o:e,!(n=(n=0|G[o+16>>2])||0|G[o+20>>2])){s=e,a=i;break}o=n}if(0!=(0|s)&&a>>>0<((0|G[5831])-l|0)>>>0&&s>>>0<(c=s+l|0)>>>0){o=0|G[s+24>>2],t=0|G[s+12>>2];do{if((0|t)==(0|s)){if(!(t=0|G[(e=s+20|0)>>2])&&!(t=0|G[(e=s+16|0)>>2])){t=0;break}for(;;)if(n=0|G[(i=t+20|0)>>2])t=n,e=i;else{if(!(n=0|G[(i=t+16|0)>>2]))break;t=n,e=i}G[e>>2]=0}else y=0|G[s+8>>2],G[y+12>>2]=t,G[t+8>>2]=y}while(0);do{if(o){if(e=0|G[s+28>>2],(0|s)==(0|G[(n=23620+(e<<2)|0)>>2])){if(!(G[n>>2]=t)){r&=~(1<>2])==(0|s)?y:o+20|0)>>2]=t))break;G[t+24>>2]=o,0|(e=0|G[s+16>>2])&&(G[t+16>>2]=e,G[e+24>>2]=t),(e=0|G[s+20>>2])&&(G[t+20>>2]=e,G[e+24>>2]=t)}}while(0);e:do{if(a>>>0<16)G[s+4>>2]=3|(y=a+l|0),G[(y=s+y+4|0)>>2]=1|G[y>>2];else{if(G[s+4>>2]=3|l,G[c+4>>2]=1|a,t=(G[c+a>>2]=a)>>>3,a>>>0<256){n=23356+(t<<1<<2)|0,(e=0|G[5829])&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=c,G[t+12>>2]=c,G[c+8>>2]=t,G[c+12>>2]=n;break}if(t=23620+((n=(t=a>>>8)?16777215>>0?31:a>>>((n=14-((C=((y=t<<(m=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(n=((y<<=C)+245760|0)>>>16&2))+(y<>>15)|0)+7|0)&1|n<<1:0)<<2)|0,G[c+28>>2]=n,G[(e=c+16|0)+4>>2]=0,G[e>>2]=0,!(r&(e=1<>2]=c,G[c+24>>2]=t,G[c+12>>2]=c,G[c+8>>2]=c;break}t=0|G[t>>2];t:do{if((-8&G[t+4>>2]|0)!=(0|a)){for(r=a<<(31==(0|n)?0:25-(n>>>1)|0);;){if(!(e=0|G[(n=t+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[e+4>>2]|0)==(0|a)){t=e;break t}r<<=1,t=e}G[n>>2]=c,G[c+24>>2]=t,G[c+12>>2]=c,G[c+8>>2]=c;break e}}while(0);y=0|G[(m=t+8|0)>>2],G[y+12>>2]=c,G[m>>2]=c,G[c+8>>2]=y,G[c+12>>2]=t,G[c+24>>2]=0}}while(0);return U=B,0|(y=s+8|0)}g=l}else g=l;else g=-1}while(0);if(g>>>0<=(n=0|G[5831])>>>0)return e=0|G[5834],15<(t=n-g|0)>>>0?(G[5834]=y=e+g|0,G[5831]=t,G[y+4>>2]=1|t,G[e+n>>2]=t,G[e+4>>2]=3|g):(G[5831]=0,G[5834]=0,G[e+4>>2]=3|n,G[(y=e+n+4|0)>>2]=1|G[y>>2]),U=B,0|(y=e+8|0);if(g>>>0<(a=0|G[5832])>>>0)return G[5832]=C=a-g|0,y=0|G[5835],G[5835]=m=y+g|0,G[m+4>>2]=1|C,G[y+4>>2]=3|g,U=B,0|(y=y+8|0);if(s=g+48|0,(l=(o=(e=0|G[5947]?0|G[5949]:(G[5949]=4096,G[5948]=4096,G[5950]=-1,G[5951]=-1,G[5952]=0,G[5940]=0,G[5947]=-16&u^1431655768,4096))+(A=g+47|0)|0)&(i=0-e|0))>>>0<=g>>>0)return U=B,(y=0)|y;if(0|(e=0|G[5939])&&(u=(c=0|G[5937])+l|0)>>>0<=c>>>0|e>>>0>>0)return U=B,(y=0)|y;e:do{if(4&G[5940])t=0,p=143;else{n=0|G[5835];t:do{if(n){for(r=23764;;){if((u=0|G[r>>2])>>>0<=n>>>0&&(u+(0|G[r+4>>2])|0)>>>0>n>>>0)break;if(!(e=0|G[r+8>>2])){p=128;break t}r=e}if((t=o-a&i)>>>0<2147483647)if((0|(e=0|jd(0|t)))==((0|G[r>>2])+(0|G[r+4>>2])|0)){if(-1!=(0|e)){a=t,o=e,p=145;break e}}else r=e,p=136;else t=0}else p=128}while(0);do{if(128==(0|p))if(-1!=(0|(n=0|jd(0)))&&(t=n,h=(t=(0==((h=(d=0|G[5948])+-1|0)&t|0)?0:(h+t&0-d)-t|0)+l|0)+(d=0|G[5937])|0,g>>>0>>0&t>>>0<2147483647)){if(0|(u=0|G[5939])&&h>>>0<=d>>>0|u>>>0>>0){t=0;break}if((0|(e=0|jd(0|t)))==(0|n)){a=t,o=n,p=145;break e}r=e,p=136}else t=0}while(0);do{if(136==(0|p)){if(n=0-t|0,!(t>>>0>>0&t>>>0<2147483647&-1!=(0|r))){if(-1==(0|r)){t=0;break}a=t,o=r,p=145;break e}if(2147483647<=(e=A-t+(e=0|G[5949])&0-e)>>>0){a=t,o=r,p=145;break e}if(-1==(0|jd(0|e))){jd(0|n),t=0;break}a=e+t|0,o=r,p=145;break e}}while(0);G[5940]=4|G[5940],p=143}}while(0);if(143==(0|p)&&l>>>0<2147483647&&!(-1==(0|(C=0|jd(0|l)))|1^(I=(g+40|0)>>>0<(f=(h=0|jd(0))-C|0)>>>0)|C>>>0>>0&-1!=(0|C)&-1!=(0|h)^1)&&(a=I?f:t,o=C,p=145),145==(0|p)){t=(0|G[5937])+a|0,(G[5937]=t)>>>0>(0|G[5938])>>>0&&(G[5938]=t),A=0|G[5835];e:do{if(A){for(t=23764;;){if((0|o)==((e=0|G[t>>2])+(n=0|G[t+4>>2])|0)){p=154;break}if(!(r=0|G[t+8>>2]))break;t=r}if(154==(0|p)&&(m=t+4|0,0==(8&G[t+12>>2]|0))&&A>>>0>>0&e>>>0<=A>>>0){G[m>>2]=n+a,m=A+(C=0==(7&(C=A+8|0)|0)?0:0-C&7)|0,C=(y=(0|G[5832])+a|0)-C|0,G[5835]=m,G[5832]=C,G[m+4>>2]=1|C,G[A+y+4>>2]=40,G[5836]=G[5951];break}for(o>>>0<(0|G[5833])>>>0&&(G[5833]=o),n=o+a|0,t=23764;;){if((0|G[t>>2])==(0|n)){p=162;break}if(!(e=0|G[t+8>>2]))break;t=e}if(162==(0|p)&&0==(8&G[t+12>>2]|0)){G[t>>2]=o,G[(c=t+4|0)>>2]=(0|G[c>>2])+a,l=(c=o+(0==(7&(c=o+8|0)|0)?0:0-c&7)|0)+g|0,s=(t=n+(0==(7&(t=n+8|0)|0)?0:0-t&7)|0)-c-g|0,G[c+4>>2]=3|g;t:do{if((0|A)==(0|t))y=(0|G[5832])+s|0,G[5832]=y,G[5835]=l,G[l+4>>2]=1|y;else{if((0|G[5834])==(0|t)){y=(0|G[5831])+s|0,G[5831]=y,G[5834]=l,G[l+4>>2]=1|y,G[l+y>>2]=y;break}if(1==(3&(e=0|G[t+4>>2])|0)){a=-8&e,r=e>>>3;n:do{if(e>>>0<256){if(e=0|G[t+8>>2],(0|(n=0|G[t+12>>2]))==(0|e)){G[5829]=G[5829]&~(1<>2]=n,G[n+8>>2]=e;break}o=0|G[t+24>>2],e=0|G[t+12>>2];do{if((0|e)==(0|t)){if(e=0|G[(r=(n=t+16|0)+4|0)>>2])n=r;else if(!(e=0|G[n>>2])){e=0;break}for(;;)if(r=0|G[(i=e+20|0)>>2])e=r,n=i;else{if(!(r=0|G[(i=e+16|0)>>2]))break;e=r,n=i}G[n>>2]=0}else y=0|G[t+8>>2],G[y+12>>2]=e,G[e+8>>2]=y}while(0);if(!o)break;r=23620+((n=0|G[t+28>>2])<<2)|0;do{if((0|G[r>>2])==(0|t)){if(0|(G[r>>2]=e))break;G[5830]=G[5830]&~(1<>2])==(0|t)?y:o+20|0)>>2]=e))break n}while(0)}while((G[e+24>>2]=o,0|(r=0|G[(n=t+16|0)>>2])&&(G[e+16>>2]=r,G[r+24>>2]=e),n=0|G[n+4>>2])&&(G[e+20>>2]=n,G[n+24>>2]=e,0));t=t+a|0,i=a+s|0}else i=s;if(G[(t=t+4|0)>>2]=-2&G[t>>2],G[l+4>>2]=1|i,t=(G[l+i>>2]=i)>>>3,i>>>0<256){n=23356+(t<<1<<2)|0,(e=0|G[5829])&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=l,G[t+12>>2]=l,G[l+8>>2]=t,G[l+12>>2]=n;break}t=i>>>8;do{if(t){if(16777215>>0){r=31;break}r=i>>>((r=14-((C=((y=t<<(m=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((y<<=C)+245760|0)>>>16&2))+(y<>>15)|0)+7|0)&1|r<<1}else r=0}while(0);if(t=23620+(r<<2)|0,G[l+28>>2]=r,G[(e=l+16|0)+4>>2]=0,!((e=(G[e>>2]=0)|G[5830])&(n=1<>2]=l,G[l+24>>2]=t,G[l+12>>2]=l,G[l+8>>2]=l;break}t=0|G[t>>2];n:do{if((-8&G[t+4>>2]|0)!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1)|0);;){if(!(e=0|G[(n=t+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[e+4>>2]|0)==(0|i)){t=e;break n}r<<=1,t=e}G[n>>2]=l,G[l+24>>2]=t,G[l+12>>2]=l,G[l+8>>2]=l;break t}}while(0);y=0|G[(m=t+8|0)>>2],G[y+12>>2]=l,G[m>>2]=l,G[l+8>>2]=y,G[l+12>>2]=t,G[l+24>>2]=0}}while(0);return U=B,0|(y=c+8|0)}for(t=23764;;){if((e=0|G[t>>2])>>>0<=A>>>0&&A>>>0<(y=e+(0|G[t+4>>2])|0)>>>0)break;t=0|G[t+8>>2]}for(t=(e=(e=(i=y+-47|0)+(0==(7&(e=i+8|0)|0)?0:0-e&7)|0)>>>0<(i=A+16|0)>>>0?A:e)+8|0,m=o+(C=0==(7&(C=o+8|0)|0)?0:0-C&7)|0,C=(n=a+-40|0)-C|0,G[5835]=m,G[5832]=C,G[m+4>>2]=1|C,G[o+n+4>>2]=40,G[5836]=G[5951],G[(n=e+4|0)>>2]=27,G[t>>2]=G[5941],G[t+4>>2]=G[5942],G[t+8>>2]=G[5943],G[t+12>>2]=G[5944],G[5941]=o,G[5942]=a,G[5944]=0,G[5943]=t,t=e+24|0;G[(t=(m=t)+4|0)>>2]=7,(m+8|0)>>>0>>0;);if((0|e)!=(0|A)){if(o=e-A|0,G[n>>2]=-2&G[n>>2],G[A+4>>2]=1|o,t=(G[e>>2]=o)>>>3,o>>>0<256){n=23356+(t<<1<<2)|0,(e=0|G[5829])&(t=1<>2]:(G[5829]=e|t,e=(t=n)+8|0),G[e>>2]=A,G[t+12>>2]=A,G[A+8>>2]=t,G[A+12>>2]=n;break}if(n=23620+((r=(t=o>>>8)?16777215>>0?31:o>>>((r=14-((C=((y=t<<(m=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|m|(r=((y<<=C)+245760|0)>>>16&2))+(y<>>15)|0)+7|0)&1|r<<1:0)<<2)|0,G[A+28>>2]=r,G[A+20>>2]=0,!((t=(G[i>>2]=0)|G[5830])&(e=1<>2]=A,G[A+24>>2]=n,G[A+12>>2]=A,G[A+8>>2]=A;break}t=0|G[n>>2];t:do{if((-8&G[t+4>>2]|0)!=(0|o)){for(r=o<<(31==(0|r)?0:25-(r>>>1)|0);;){if(!(e=0|G[(n=t+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[e+4>>2]|0)==(0|o)){t=e;break t}r<<=1,t=e}G[n>>2]=A,G[A+24>>2]=t,G[A+12>>2]=A,G[A+8>>2]=A;break e}}while(0);y=0|G[(m=t+8|0)>>2],G[y+12>>2]=A,G[m>>2]=A,G[A+8>>2]=y,G[A+12>>2]=t,G[A+24>>2]=0}}else 0==(0|(y=0|G[5833]))|o>>>0>>0&&(G[5833]=o),G[5941]=o,G[5942]=a,G[5944]=0,G[5838]=G[5947],G[5837]=-1,G[5842]=23356,G[5841]=23356,G[5844]=23364,G[5843]=23364,G[5846]=23372,G[5845]=23372,G[5848]=23380,G[5847]=23380,G[5850]=23388,G[5849]=23388,G[5852]=23396,G[5851]=23396,G[5854]=23404,G[5853]=23404,G[5856]=23412,G[5855]=23412,G[5858]=23420,G[5857]=23420,G[5860]=23428,G[5859]=23428,G[5862]=23436,G[5861]=23436,G[5864]=23444,G[5863]=23444,G[5866]=23452,G[5865]=23452,G[5868]=23460,G[5867]=23460,G[5870]=23468,G[5869]=23468,G[5872]=23476,G[5871]=23476,G[5874]=23484,G[5873]=23484,G[5876]=23492,G[5875]=23492,G[5878]=23500,G[5877]=23500,G[5880]=23508,G[5879]=23508,G[5882]=23516,G[5881]=23516,G[5884]=23524,G[5883]=23524,G[5886]=23532,G[5885]=23532,G[5888]=23540,G[5887]=23540,G[5890]=23548,G[5889]=23548,G[5892]=23556,G[5891]=23556,G[5894]=23564,G[5893]=23564,G[5896]=23572,G[5895]=23572,G[5898]=23580,G[5897]=23580,G[5900]=23588,G[5899]=23588,G[5902]=23596,G[5901]=23596,G[5904]=23604,G[5903]=23604,m=o+(C=0==(7&(C=o+8|0)|0)?0:0-C&7)|0,C=(y=a+-40|0)-C|0,G[5835]=m,G[5832]=C,G[m+4>>2]=1|C,G[o+y+4>>2]=40,G[5836]=G[5951]}while(0);if(g>>>0<(t=0|G[5832])>>>0)return G[5832]=C=t-g|0,y=0|G[5835],G[5835]=m=y+g|0,G[m+4>>2]=1|C,G[y+4>>2]=3|g,U=B,0|(y=y+8|0)}return G[(y=23312)>>2]=12,U=B,(y=0)|y}function Xc(e){var t=0,n=0,r=0,i=0,o=0,a=0,s=0,A=0;if(e|=0){i=0|G[5833],A=(n=e+-8|0)+(t=-8&(e=0|G[e+-4>>2]))|0;do{if(1&e)a=s=n;else{if(r=0|G[n>>2],!(3&e))return;if(o=r+t|0,(a=n+(0-r)|0)>>>0>>0)return;if((0|G[5834])==(0|a)){if(3==(3&(t=0|G[(e=A+4|0)>>2])|0))return G[5831]=o,G[e>>2]=-2&t,G[a+4>>2]=1|o,void(G[a+o>>2]=o);s=a,t=o;break}if(n=r>>>3,r>>>0<256){if(e=0|G[a+8>>2],(0|(t=0|G[a+12>>2]))==(0|e)){G[5829]=G[5829]&~(1<>2]=t,G[t+8>>2]=e,s=a,t=o;break}i=0|G[a+24>>2],e=0|G[a+12>>2];do{if((0|e)==(0|a)){if(e=0|G[(n=(t=a+16|0)+4|0)>>2])t=n;else if(!(e=0|G[t>>2])){e=0;break}for(;;)if(n=0|G[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|G[(r=e+16|0)>>2]))break;e=n,t=r}G[t>>2]=0}else s=0|G[a+8>>2],G[s+12>>2]=e,G[e+8>>2]=s}while(0);if(i){if(t=0|G[a+28>>2],(0|G[(n=23620+(t<<2)|0)>>2])==(0|a)){if(!(G[n>>2]=e)){G[5830]=G[5830]&~(1<>2])==(0|a)?s:i+20|0)>>2]=e)){s=a,t=o;break}G[e+24>>2]=i,0|(n=0|G[(t=a+16|0)>>2])&&(G[e+16>>2]=n,G[n+24>>2]=e),t=(s=((t=0|G[t+4>>2])&&(G[e+20>>2]=t,G[t+24>>2]=e),a),o)}else s=a,t=o}}while(0);if(!(A>>>0<=a>>>0)&&1&(r=0|G[(e=A+4|0)>>2])){if(2&r)G[e>>2]=-2&r,G[s+4>>2]=1|t,i=G[a+t>>2]=t;else{if((0|G[5835])==(0|A))return A=(0|G[5832])+t|0,G[5832]=A,G[5835]=s,G[s+4>>2]=1|A,(0|s)!=(0|G[5834])?void 0:(G[5834]=0,void(G[5831]=0));if((0|G[5834])==(0|A))return A=(0|G[5831])+t|0,G[5831]=A,G[5834]=a,G[s+4>>2]=1|A,void(G[a+A>>2]=A);i=(-8&r)+t|0,n=r>>>3;do{if(r>>>0<256){if(t=0|G[A+8>>2],(0|(e=0|G[A+12>>2]))==(0|t)){G[5829]=G[5829]&~(1<>2]=e,G[e+8>>2]=t;break}o=0|G[A+24>>2],e=0|G[A+12>>2];do{if((0|e)==(0|A)){if(e=0|G[(n=(t=A+16|0)+4|0)>>2])t=n;else if(!(e=0|G[t>>2])){n=0;break}for(;;)if(n=0|G[(r=e+20|0)>>2])e=n,t=r;else{if(!(n=0|G[(r=e+16|0)>>2]))break;e=n,t=r}G[t>>2]=0,n=e}else n=0|G[A+8>>2],G[n+12>>2]=e,G[e+8>>2]=n,n=e}while(0);if(0|o){if(e=0|G[A+28>>2],(0|G[(t=23620+(e<<2)|0)>>2])==(0|A)){if(!(G[t>>2]=n)){G[5830]=G[5830]&~(1<>2])==(0|A)?r:o+20|0)>>2]=n))break;G[n+24>>2]=o,0|(t=0|G[(e=A+16|0)>>2])&&(G[n+16>>2]=t,G[t+24>>2]=n),0|(e=0|G[e+4>>2])&&(G[n+20>>2]=e,G[e+24>>2]=n)}}while(0);if(G[s+4>>2]=1|i,G[a+i>>2]=i,(0|s)==(0|G[5834]))return void(G[5831]=i)}if(e=i>>>3,i>>>0<256)return n=23356+(e<<1<<2)|0,(t=0|G[5829])&(e=1<>2]:(G[5829]=t|e,t=(e=n)+8|0),G[t>>2]=s,G[e+12>>2]=s,G[s+8>>2]=e,void(G[s+12>>2]=n);e=23620+((r=(e=i>>>8)?16777215>>0?31:i>>>((r=14-((o=((A=e<<(a=(e+1048320|0)>>>16&8))+520192|0)>>>16&4)|a|(r=((A<<=o)+245760|0)>>>16&2))+(A<>>15)|0)+7|0)&1|r<<1:0)<<2)|0,G[s+28>>2]=r,G[s+20>>2]=0,t=(G[s+16>>2]=0)|G[5830],n=1<>2];t:do{if((-8&G[e+4>>2]|0)!=(0|i)){for(r=i<<(31==(0|r)?0:25-(r>>>1)|0);;){if(!(t=0|G[(n=e+16+(r>>>31<<2)|0)>>2]))break;if((-8&G[t+4>>2]|0)==(0|i)){e=t;break t}r<<=1,e=t}G[n>>2]=s,G[s+24>>2]=e,G[s+12>>2]=s,G[s+8>>2]=s;break e}}while(0);A=0|G[(a=e+8|0)>>2],G[A+12>>2]=s,G[a>>2]=s,G[s+8>>2]=A,G[s+12>>2]=e,G[s+24>>2]=0}else G[5830]=t|n,G[e>>2]=s,G[s+24>>2]=e,G[s+12>>2]=s,G[s+8>>2]=s}while(0);if(A=(0|G[5837])-1|0,!(0|(G[5837]=A))){for(e=23772;;){if(!(e=0|G[e>>2]))break;e=e+8|0}G[5837]=-1}}}}function Yc(e,t){t|=0;var n=0;return(e|=0)?(n=0|a(t,e),65535<(t|e)>>>0&&(n=((n>>>0)/(e>>>0)|0)==(0|t)?n:-1)):n=0,(e=0|Wc(n))&&3&G[e+-4>>2]&&hd(0|e,0,0|n),0|e}function _c(e,t,n,r){return 0|(y(0|(r=(t|=0)-(r|=0)-((e|=0)>>>0<(n|=0)>>>0|0)>>>0)),e-n>>>0|0)}function $c(e){return 0|((e|=0)?31-(0|ge(e^e-1))|0:32)}function ad(e,t,n,r,i){i|=0;var o=0,a=0,s=0,A=0,l=0,c=0,g=0,u=0,d=0,h=0,c=e|=0,a=n|=0,s=u=r|=0;if(!(l=A=t|=0))return o=0!=(0|i),s?(o&&(G[i>>2]=0|e,G[i+4>>2]=0&t),(i=u=0)|(y(0|u),i)):(o&&(G[i>>2]=(c>>>0)%(a>>>0),G[i+4>>2]=0),i=(c>>>(u=0))/(a>>>0)>>>0,0|(y(0|u),i));o=0==(0|s);do{if(a){if(!o){if((o=(0|ge(0|s))-(0|ge(0|l))|0)>>>0<=31){e=c>>>((a=g=o+1|0)>>>0)&(t=o-31>>31)|l<<(s=31-o|0),t&=l>>>(g>>>0),o=0,s=c<>2]=0|e,G[i+4>>2]=A|0&t,(i=u=0)|(y(0|u),i)):(i=u=0)|(y(0|u),i)}if((o=a-1|0)&a|0){e=(g=32-(s=33+(0|ge(0|a))-(0|ge(0|l))|0)|0)-1>>31&l>>>((d=s-32|0)>>>0)|(l<>>((a=s)>>>0))&(t=d>>31),t&=l>>>(s>>>0),o=c<<(h=64-s|0)&(A=g>>31),s=(l<>>(d>>>0))&A|c<>31;break}return 0|i&&(G[i>>2]=o&c,G[i+4>>2]=0),1==(0|a)?(h=0|e,0|(y(0|(d=A|0&t)),h)):(d=l>>>((h=0|$c(0|a))>>>0)|0,h=l<<32-h|c>>>(h>>>0)|0,0|(y(0|d),h))}if(o)return 0|i&&(G[i>>2]=(l>>>0)%(a>>>0),G[i+4>>2]=0),h=(l>>>(d=0))/(a>>>0)>>>0,0|(y(0|d),h);if(!c)return 0|i&&(G[i>>2]=0,G[i+4>>2]=(l>>>0)%(s>>>0)),h=(l>>>(d=0))/(s>>>0)>>>0,0|(y(0|d),h);if(!((o=s-1|0)&s))return 0|i&&(G[i>>2]=0|e,G[i+4>>2]=o&l|0&t),h=l>>>(((d=0)|$c(0|s))>>>0),0|(y(0|d),h);if((o=(0|ge(0|s))-(0|ge(0|l))|0)>>>0<=30){e=l<<(s=31-o|0)|c>>>((a=t=o+1|0)>>>0),t=l>>>(t>>>0),o=0,s=c<>2]=0|e,G[i+4>>2]=A|0&t),(h=d=0)|(y(0|d),h)}while(0);if(a){for(l=0|function Zc(e,t,n,r){return 0|(y((t|=0)+(r|=0)+((n=(e|=0)+(n|=0)>>>0)>>>0>>0|0)>>>0|0),0|n)}(0|(g=0|n),0|(c=u|0&r),-1,-1),n=0|T(),A=s,s=0;A=o>>>31|(r=A)<<1,o=s|o<<1,_c(0|l,0|n,0|(r=e<<1|r>>>31|0),0|(u=e>>>31|t<<1|0)),s=1&(d=(h=0|T())>>31|((0|h)<0?-1:0)<<1),e=0|_c(0|r,0|u,d&g|0,(((0|h)<0?-1:0)>>31|((0|h)<0?-1:0)<<1)&c|0),t=0|T(),0!=(0|(a=a-1|0)););l=A,A=0}else l=s,s=A=0;return(a=0)|i&&(G[i>>2]=e,G[i+4>>2]=t),h=-2&(o<<1|0)|s,0|(y(0|(d=(0|o)>>>31|(l|a)<<1|0&(a<<1|o>>>31)|A)),h)}function bd(e,t,n,r){var i=U;return U=U+16|0,ad(e|=0,t|=0,n|=0,r|=0,e=0|i),U=i,0|(y(0|G[4+e>>2]),0|G[e>>2])}function cd(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(y(t>>>n|0),e>>>n|(t&(1<>>n-32|0)}function dd(e,t,n){return e|=0,t|=0,(0|(n|=0))<32?(y(t<>>32-n|0),e<>0]=0|m[t>>0],e=e+1|0,t=t+1|0,n=n-1|0}for(r=(n=-4&i|0)-64|0;(0|e)<=(0|r);)G[e>>2]=G[t>>2],G[e+4>>2]=G[t+4>>2],G[e+8>>2]=G[t+8>>2],G[e+12>>2]=G[t+12>>2],G[e+16>>2]=G[t+16>>2],G[e+20>>2]=G[t+20>>2],G[e+24>>2]=G[t+24>>2],G[e+28>>2]=G[t+28>>2],G[e+32>>2]=G[t+32>>2],G[e+36>>2]=G[t+36>>2],G[e+40>>2]=G[t+40>>2],G[e+44>>2]=G[t+44>>2],G[e+48>>2]=G[t+48>>2],G[e+52>>2]=G[t+52>>2],G[e+56>>2]=G[t+56>>2],G[e+60>>2]=G[t+60>>2],e=e+64|0,t=t+64|0;for(;(0|e)<(0|n);)G[e>>2]=G[t>>2],e=e+4|0,t=t+4|0}else for(n=i-4|0;(0|e)<(0|n);)m[e>>0]=0|m[t>>0],m[e+1>>0]=0|m[t+1>>0],m[e+2>>0]=0|m[t+2>>0],m[e+3>>0]=0|m[t+3>>0],e=e+4|0,t=t+4|0;for(;(0|e)<(0|i);)m[e>>0]=0|m[t>>0],e=e+1|0,t=t+1|0;return 0|o}function hd(e,t,n){var r,i,o,a=(e|=0)+(n|=0)|0;if(t=(t|0)&255,67<=(0|n)){for(;3&e;)m[e>>0]=t,e=e+1|0;for(o=t|t<<8|t<<16|t<<24,i=(r=-4&a|0)-64|0;(0|e)<=(0|i);)G[e>>2]=o,G[e+4>>2]=o,G[e+8>>2]=o,G[e+12>>2]=o,G[e+16>>2]=o,G[e+20>>2]=o,G[e+24>>2]=o,G[e+28>>2]=o,G[e+32>>2]=o,G[e+36>>2]=o,G[e+40>>2]=o,G[e+44>>2]=o,G[e+48>>2]=o,G[e+52>>2]=o,G[e+56>>2]=o,G[e+60>>2]=o,e=e+64|0;for(;(0|e)<(0|r);)G[e>>2]=o,e=e+4|0}for(;(0|e)<(0|a);)m[e>>0]=t,e=e+1|0;return a-n|0}function id(e){return 0<=(e=+e)?+re(e+.5):+le(e-.5)}function jd(e){e|=0;var t,n=0|de();return 0<(0|e)&(0|(e=(t=0|G[ne>>2])+e|0))<(0|t)|(0|e)<0?(fe(0|e),ue(12),-1):(0|n)<(0|e)&&!(0|pe(0|e))?(ue(12),-1):(G[ne>>2]=e,0|t)}r.___uremdi3=n.___uremdi3,r._bitshift64Lshr=n._bitshift64Lshr,r._bitshift64Shl=n._bitshift64Shl,r._calloc=n._calloc,r._cellAreaKm2=n._cellAreaKm2,r._cellAreaM2=n._cellAreaM2,r._cellAreaRads2=n._cellAreaRads2,r._compact=n._compact,r._destroyLinkedPolygon=n._destroyLinkedPolygon,r._edgeLengthKm=n._edgeLengthKm,r._edgeLengthM=n._edgeLengthM;var Ie,Ce,o,me,ye=r._emscripten_replace_memory=n._emscripten_replace_memory,Be=(r._exactEdgeLengthKm=n._exactEdgeLengthKm,r._exactEdgeLengthM=n._exactEdgeLengthM,r._exactEdgeLengthRads=n._exactEdgeLengthRads,r._experimentalH3ToLocalIj=n._experimentalH3ToLocalIj,r._experimentalLocalIjToH3=n._experimentalLocalIjToH3,r._free=n._free,r._geoToH3=n._geoToH3,r._getDestinationH3IndexFromUnidirectionalEdge=n._getDestinationH3IndexFromUnidirectionalEdge,r._getH3IndexesFromUnidirectionalEdge=n._getH3IndexesFromUnidirectionalEdge,r._getH3UnidirectionalEdge=n._getH3UnidirectionalEdge,r._getH3UnidirectionalEdgeBoundary=n._getH3UnidirectionalEdgeBoundary,r._getH3UnidirectionalEdgesFromHexagon=n._getH3UnidirectionalEdgesFromHexagon,r._getOriginH3IndexFromUnidirectionalEdge=n._getOriginH3IndexFromUnidirectionalEdge,r._getPentagonIndexes=n._getPentagonIndexes,r._getRes0Indexes=n._getRes0Indexes,r._h3Distance=n._h3Distance,r._h3GetBaseCell=n._h3GetBaseCell,r._h3GetFaces=n._h3GetFaces,r._h3GetResolution=n._h3GetResolution,r._h3IndexesAreNeighbors=n._h3IndexesAreNeighbors,r._h3IsPentagon=n._h3IsPentagon,r._h3IsResClassIII=n._h3IsResClassIII,r._h3IsValid=n._h3IsValid,r._h3Line=n._h3Line,r._h3LineSize=n._h3LineSize,r._h3SetToLinkedGeo=n._h3SetToLinkedGeo,r._h3ToCenterChild=n._h3ToCenterChild,r._h3ToChildren=n._h3ToChildren,r._h3ToGeo=n._h3ToGeo,r._h3ToGeoBoundary=n._h3ToGeoBoundary,r._h3ToParent=n._h3ToParent,r._h3UnidirectionalEdgeIsValid=n._h3UnidirectionalEdgeIsValid,r._hexAreaKm2=n._hexAreaKm2,r._hexAreaM2=n._hexAreaM2,r._hexRing=n._hexRing,r._i64Subtract=n._i64Subtract,r._kRing=n._kRing,r._kRingDistances=n._kRingDistances,r._llvm_minnum_f64=n._llvm_minnum_f64,r._llvm_round_f64=n._llvm_round_f64,r._malloc=n._malloc,r._maxFaceCount=n._maxFaceCount,r._maxH3ToChildrenSize=n._maxH3ToChildrenSize,r._maxKringSize=n._maxKringSize,r._maxPolyfillSize=n._maxPolyfillSize,r._maxUncompactSize=n._maxUncompactSize,r._memcpy=n._memcpy,r._memset=n._memset,r._numHexagons=n._numHexagons,r._pentagonIndexCount=n._pentagonIndexCount,r._pointDistKm=n._pointDistKm,r._pointDistM=n._pointDistM,r._pointDistRads=n._pointDistRads,r._polyfill=n._polyfill,r._res0IndexCount=n._res0IndexCount,r._round=n._round,r._sbrk=n._sbrk,r._sizeOfCoordIJ=n._sizeOfCoordIJ,r._sizeOfGeoBoundary=n._sizeOfGeoBoundary,r._sizeOfGeoCoord=n._sizeOfGeoCoord,r._sizeOfGeoPolygon=n._sizeOfGeoPolygon,r._sizeOfGeofence=n._sizeOfGeofence,r._sizeOfH3Index=n._sizeOfH3Index,r._sizeOfLinkedGeoPolygon=n._sizeOfLinkedGeoPolygon,r._uncompact=n._uncompact,r.establishStackSpace=n.establishStackSpace,r.stackAlloc=n.stackAlloc),be=r.stackRestore=n.stackRestore,ve=r.stackSave=n.stackSave;function run(e){function doRun(){me||(me=!0,C||(function initRuntime(){callRuntimeCallbacks(F)}(),function preMain(){callRuntimeCallbacks(D)}(),r.onRuntimeInitialized&&r.onRuntimeInitialized(),postRun()))}0>0]=t;break;case"i16":Q[e>>1]=t;break;case"i32":w[e>>2]=t;break;case"i64":q=[t>>>0,1<=+L(q=t)?0>>0:~~+P((q-(~~q>>>0))/4294967296)>>>0:0],w[e>>2]=q[0],w[e+4>>2]=q[1];break;case"float":S[e>>2]=t;break;case"double":x[e>>3]=t;break;default:abort("invalid type for setValue: "+n)}},r.getValue=function getValue(e,t,n){switch(t="*"===(t=t||"i8").charAt(t.length-1)?"i32":t){case"i1":case"i8":return v[e>>0];case"i16":return Q[e>>1];case"i32":case"i64":return w[e>>2];case"float":return S[e>>2];case"double":return x[e>>3];default:abort("invalid type for getValue: "+t)}return null},r.getTempRet0=UVa,i&&(isDataURI(i)||(i=function locateFile(e){return r.locateFile?r.locateFile(e,l):l+e}(i)),function addRunDependency(){z++,r.monitorRunDependencies&&r.monitorRunDependencies(z)}(),Ie=function(e){e.byteLength&&(e=new Uint8Array(e)),E.set(e,8),r.memoryInitializerRequest&&delete r.memoryInitializerRequest.response,function removeRunDependency(){var e;z--,r.monitorRunDependencies&&r.monitorRunDependencies(z),0==z&&(null!==J&&(clearInterval(J),J=null),K&&(e=K,K=null,e()))}()},Ce=function(){h(i,Ie,function(){throw"could not load memory initializer "+i})},(t=tryParseAsDataURI(i))?Ie(t.buffer):r.memoryInitializerRequest?(o=function(){var e=r.memoryInitializerRequest,t=e.response;if(200!==e.status&&0!==e.status){var n=tryParseAsDataURI(r.memoryInitializerRequestURL);if(!n)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+e.status+", retrying "+i),void Ce();t=n.buffer}Ie(t)},r.memoryInitializerRequest.response?setTimeout(o,0):r.memoryInitializerRequest.addEventListener("load",o)):Ce()),K=function runCaller(){me||run(),me||(K=runCaller)},r.run=run,r.abort=abort,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);0this.initialize(Object.assign({},t,{pixels:e,data:e}))),this;var n="undefined"!=typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(n&&e.readyStatethis.initialize(t)),this;var{pixels:r=null,format:i=6408,border:o=0,recreate:a=!1,parameters:s={},pixelStore:A={},textureUnit:l=void 0}=t;e=e||r;let{width:c,height:g,dataFormat:u,type:d,compressed:h=!1,mipmaps:p=!0}=t;var{depth:r=0}=t;return{width:c,height:g,compressed:h,dataFormat:u,type:d}=this._deduceParameters({format:i,type:d,dataFormat:u,compressed:h,data:e,width:c,height:g}),this.width=c,this.height=g,this.depth=r,this.format=i,this.type=d,this.dataFormat=u,this.border=o,this.textureUnit=l,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),p&&this._isNPOT()&&(C.k.warn(`texture: ${this} is Non-Power-Of-Two, disabling mipmaping`)(),p=!1,this._updateForNPOT(s)),this.mipmaps=p,this.setImageData({data:e,width:c,height:g,depth:r,format:i,type:d,dataFormat:u,border:o,mipmaps:p,parameters:A,compressed:h}),p&&this.generateMipmap(),this.setParameters(s),a&&(this.data=e),n&&(this._video={video:e,parameters:s,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){var e,t,n;this._video&&({video:e,parameters:t,lastTime:n}=this._video,n===e.currentTime||e.readyState{this.gl.generateMipmap(this.target)}),this.gl.bindTexture(this.target,null)),this}setImageData(e){this._trackDeallocatedMemory("Texture");const{target:n=this.target,pixels:t=null,level:r=0,format:i=this.format,border:o=this.border,offset:a=0,parameters:s={}}=e;let{data:A=null,type:l=this.type,width:c=this.width,height:g=this.height,dataFormat:u=this.dataFormat,compressed:d=!1}=e;A=A||t,{type:l,dataFormat:u,compressed:d,width:c,height:g}=this._deduceParameters({format:i,type:l,dataFormat:u,compressed:d,data:A,width:c,height:g});const h=this["gl"];h.bindTexture(this.target,this.handle);let p=null;({data:A,dataType:p}=this._getDataType({data:A,compressed:d}));let f;var I;return Object(C.o)(this.gl,s,()=>{switch(p){case"null":h.texImage2D(n,r,i,c,g,o,u,l,A);break;case"typed-array":h.texImage2D(n,r,i,c,g,o,u,l,A,a);break;case"buffer":(f=Object(C.a)(h)).bindBuffer(35052,A.handle||A),f.texImage2D(n,r,i,c,g,o,u,l,a),f.bindBuffer(35052,null);break;case"browser-object":Object(C.j)(h)?h.texImage2D(n,r,i,c,g,o,u,l,A):h.texImage2D(n,r,i,u,l,A);break;case"compressed":for(var[e,t]of A.entries())h.compressedTexImage2D(n,e,t.format,t.width,t.height,o,t.data);break;default:Object(y.a)(!1,"Unknown image data type")}}),A&&A.byteLength?this._trackAllocatedMemory(A.byteLength,"Texture"):(e=m.a[this.dataFormat]||4,I=m.c[this.type]||1,this._trackAllocatedMemory(this.width*this.height*e*I,"Texture")),this.loaded=!0,this}setSubImageData({target:n=this.target,pixels:e=null,data:r=null,x:i=0,y:o=0,width:a=this.width,height:s=this.height,level:A=0,format:l=this.format,type:c=this.type,dataFormat:g=this.dataFormat,compressed:u=!1,offset:d=0,border:t=this.border,parameters:h={}}){({type:c,dataFormat:g,compressed:u,width:a,height:s}=this._deduceParameters({format:l,type:c,dataFormat:g,compressed:u,data:r,width:a,height:s})),Object(y.a)(0===this.depth,"texSubImage not supported for 3D textures"),(r=r||e)&&r.data&&(r=(e=r).data,a=e.shape[0],s=e.shape[1]),r instanceof p.a&&(r=r.handle),this.gl.bindTexture(this.target,this.handle),Object(C.o)(this.gl,h,()=>{if(u)this.gl.compressedTexSubImage2D(n,A,i,o,a,s,l,r);else if(null===r)this.gl.texSubImage2D(n,A,i,o,a,s,g,c,null);else if(ArrayBuffer.isView(r))this.gl.texSubImage2D(n,A,i,o,a,s,g,c,r,d);else if(r instanceof f){const e=Object(C.a)(this.gl);e.bindBuffer(35052,r),e.texSubImage2D(n,A,i,o,a,s,g,c,d),e.bindBuffer(35052,null)}else if(Object(C.j)(this.gl)){const t=Object(C.a)(this.gl);t.texSubImage2D(n,A,i,o,a,s,g,c,r)}else this.gl.texSubImage2D(n,A,i,o,g,c,r)}),this.gl.bindTexture(this.target,null)}copyFramebuffer(e=0){return C.k.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(e=this.textureUnit){const t=this["gl"];return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,this.handle),e}unbind(e=this.textureUnit){const t=this["gl"];return void 0!==e&&(this.textureUnit=e,t.activeTexture(33984+e)),t.bindTexture(this.target,null),e}_getDataType({data:e,compressed:t=!1}){return t?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof p.a?{data:e.handle,dataType:"buffer"}:e instanceof f?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(e){var{format:t,data:n}=e,{width:e,height:r,dataFormat:i,type:o,compressed:a}=e,s=m.b[t],i=i||s&&s.dataFormat,o=o||s&&s.types[0],a=a||s&&s.compressed;return{width:e,height:r}=this._deduceImageSize(n,e,r),{dataFormat:i,type:o,compressed:a,width:e,height:r,format:t,data:n}}_deduceImageSize(e,t,n){let r;return r="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||"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:0<=t?t:1,height:0<=n?n:1},Object(y.a)(r,"Could not deduced texture size"),Object(y.a)(void 0===t||r.width===t,"Deduced texture width does not match supplied width"),Object(y.a)(void 0===n||r.height===n,"Deduced texture height does not match supplied height"),r}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(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}}_setParameter(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(y.a)(!1);break;default:this.gl.texParameteri(this.target,e,t)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!Object(C.j)(this.gl)&&(!(!this.width||!this.height)&&(!Object(i.b)(this.width)||!Object(i.b)(this.height)))}_updateForNPOT(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)}_getNPOTParam(e,t){if(this._isNPOT())switch(e){case 10241:-1===o.indexOf(t)&&(t=9729);break;case 10242:case 10243:33071!==t&&(t=33071)}return t}}},function(e,t,n){var d=n(146),h=n(726),p=n(398),f=Math.max,I=Math.min;e.exports=function debounce(r,n,e){var i,o,a,s,A,l,c=0,g=!1,u=!1,t=!0;if("function"!=typeof r)throw new TypeError("Expected a function");function invokeFunc(e){var t=i,n=o;return i=o=void 0,c=e,s=r.apply(n,t)}function shouldInvoke(e){var t=e-l;return void 0===l||n<=t||t<0||u&&a<=e-c}function timerExpired(){var e=h();if(shouldInvoke(e))return trailingEdge(e);A=setTimeout(timerExpired,function remainingWait(e){var t=n-(e-l);return u?I(t,a-(e-c)):t}(e))}function trailingEdge(e){return A=void 0,t&&i?invokeFunc(e):(i=o=void 0,s)}function debounced(){var e=h(),t=shouldInvoke(e);if(i=arguments,o=this,l=e,t){if(void 0===A)return function leadingEdge(e){return c=e,A=setTimeout(timerExpired,n),g?invokeFunc(e):s}(l);if(u)return clearTimeout(A),A=setTimeout(timerExpired,n),invokeFunc(l)}return void 0===A&&(A=setTimeout(timerExpired,n)),s}return n=p(n)||0,d(e)&&(g=!!e.leading,u="maxWait"in e,a=u?f(p(e.maxWait)||0,n):a,t="trailing"in e?!!e.trailing:t),debounced.cancel=function cancel(){void 0!==A&&clearTimeout(A),i=l=o=A=void(c=0)},debounced.flush=function flush(){return void 0===A?s:trailingEdge(h())},debounced}},function(e,t,n){"use strict";function vec2_transformMat4AsVector(e,t,n){var r=t[0],t=t[1],i=n[3]*r+n[7]*t||1;return e[0]=(n[0]*r+n[4]*t)/i,e[1]=(n[1]*r+n[5]*t)/i,e}function vec3_transformMat4AsVector(e,t,n){var r=t[0],i=t[1],t=t[2],o=n[3]*r+n[7]*i+n[11]*t||1;return e[0]=(n[0]*r+n[4]*i+n[8]*t)/o,e[1]=(n[1]*r+n[5]*i+n[9]*t)/o,e[2]=(n[2]*r+n[6]*i+n[10]*t)/o,e}function vec3_transformMat2(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e[2]=t[2],e}function vec4_transformMat2(e,t,n){var r=t[0],i=t[1];return e[0]=n[0]*r+n[2]*i,e[1]=n[1]*r+n[3]*i,e[2]=t[2],e[3]=t[3],e}function vec4_transformMat3(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=n[0]*r+n[3]*i+n[6]*o,e[1]=n[1]*r+n[4]*i+n[7]*o,e[2]=n[2]*r+n[5]*i+n[8]*o,e[3]=t[3],e}n.d(t,"a",function(){return vec2_transformMat4AsVector}),n.d(t,"c",function(){return vec3_transformMat4AsVector}),n.d(t,"b",function(){return vec3_transformMat2}),n.d(t,"d",function(){return vec4_transformMat2}),n.d(t,"e",function(){return vec4_transformMat3})},function(e,t,n){"use strict";var a=n(871),A=n(432),r=n(875),l=n(563),i=n(156),o=n(876),s=n(877),c=n(898),g=n(231),e=((e.exports=Ajv).prototype.validate=function validate(e,t){var n;if("string"==typeof e){if(!(n=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{e=this._addSchema(e);n=e.validate||this._compile(e)}e=n(t);!0!==n.$async&&(this.errors=n.errors);return e},Ajv.prototype.compile=function compile(e,t){e=this._addSchema(e,void 0,t);return e.validate||this._compile(e)},Ajv.prototype.addSchema=function addSchema(e,t,n,r){if(Array.isArray(e)){for(var i=0;in[e]||(n[e]=t(e))}function trimZeroes(i,o){return e=>{const t=i(e),n=t.indexOf(o);if(n<0)return t;let r=function rightmostDigit(e,t){let n=e.lastIndexOf("e"),r;if(0t;)if(48<=(r=e.charCodeAt(n))&&r<=57)return n+1}(t,n);for(e=rn;)if("0"!==t[r]){++r;break}return t.slice(0,r)+e}}function numberLocale(e){const s=memoize(e.format),A=e.formatPrefix;return{format:s,formatPrefix:A,formatFloat(e){const t=Object(c.a)(e||",");if(null!=t.precision)return s(t);switch(t.precision=12,t.type){case"%":t.precision-=2;break;case"e":--t.precision}return trimZeroes(s(t),s(".1f")(1)[1])},formatSpan(e,t,n,r){r=Object(c.a)(null==r?",f":r);var i=Object(l.c)(e,t,n),o=Math.max(Math.abs(e),Math.abs(t));let a;if(null==r.precision)switch(r.type){case"s":return isNaN(a=Object(g.a)(i,o))||(r.precision=a),A(r,o);case"":case"e":case"g":case"p":case"r":isNaN(a=Object(u.a)(i,o))||(r.precision=a-("e"===r.type));break;case"f":case"%":isNaN(a=Object(d.a)(i))||(r.precision=a-2*("%"===r.type))}return s(r)}}}let s;function resetNumberFormatDefaultLocale(){s=numberLocale({format:r.a,formatPrefix:r.b})}function numberFormatLocale(e){return numberLocale(Object(i.a)(e))}function numberFormatDefaultLocale(e){return arguments.length?s=numberFormatLocale(e):s}function timeMultiFormat(e,t,n){n=n||{},Object(B.H)(n)||Object(B.o)("Invalid time multi-format specifier: ".concat(n));const r=t(y.i),i=t(y.f),o=t(y.d),a=t(y.a),s=t(y.k),A=t(y.g),l=t(y.h),c=t(y.l),g=e(n[y.e]||".%L"),u=e(n[y.i]||":%S"),d=e(n[y.f]||"%I:%M"),h=e(n[y.d]||"%I %p"),p=e(n[y.a]||n[y.b]||"%a %d"),f=e(n[y.k]||"%b %d"),I=e(n[y.g]||"%B"),C=e(n[y.h]||"%B"),m=e(n[y.l]||"%Y");return e=>(r(e)Object(B.J)(e)?t(e):timeMultiFormat(t,y.p,e),utcFormat:e=>Object(B.J)(e)?n(e):timeMultiFormat(n,y.v,e),timeParse:memoize(e.parse),utcParse:memoize(e.utcParse)}}resetNumberFormatDefaultLocale();let A;function resetTimeFormatDefaultLocale(){A=timeLocale({format:o.a,parse:o.b,utcFormat:o.c,utcParse:o.d})}function timeFormatLocale(e){return timeLocale(Object(a.a)(e))}function timeFormatDefaultLocale(e){return arguments.length?A=timeFormatLocale(e):A}resetTimeFormatDefaultLocale();const h=(e,t)=>Object(B.p)({},e,t);function locale(e,t){e=e?numberFormatLocale(e):numberFormatDefaultLocale(),t=t?timeFormatLocale(t):timeFormatDefaultLocale();return h(e,t)}function defaultLocale(e,t){var n=arguments.length;return n&&2!==n&&Object(B.o)("defaultLocale expects either zero or two arguments."),n?h(numberFormatDefaultLocale(e),timeFormatDefaultLocale(t)):h(numberFormatDefaultLocale(),timeFormatDefaultLocale())}function resetDefaultLocale(){return resetNumberFormatDefaultLocale(),resetTimeFormatDefaultLocale(),defaultLocale()}},function(e,i,o){"use strict";!function(e,t){o.d(i,"b",function(){return n}),o.d(i,"a",function(){return r});e={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"==typeof t&&t};const n=e.window||e.self||e.global;const r=e.process||{};console}.call(this,o(64),o(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return Controller});var r=n(278),i=n(279);const o={transitionDuration:0},a={transitionDuration:300,transitionEasing:e=>e,transitionInterruption:r.a.BREAK},s=e=>1-(1-e)*(1-e),l={WHEEL:["wheel"],PAN:["panstart","panmove","panend"],PINCH:["pinchstart","pinchmove","pinchend"],TRIPLE_PAN:["tripanstart","tripanmove","tripanend"],DOUBLE_TAP:["doubletap"],KEYBOARD:["keydown"]};class Controller{constructor(e,t={}){this.ControllerState=e,this.controllerState=null,this.controllerStateProps=null,this.eventManager=null,this.transitionManager=new r.b(e,{...t,onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)});e=this.linearTransitionProps;this._transition=e&&{...a,transitionInterpolator:new i.a({transitionProps:e})},this._events=null,this._interactionState={isDragging:!1},this._customEvents=[],this.onViewStateChange=null,this.onStateChange=null,this.handleEvent=this.handleEvent.bind(this),this.setProps(t)}get linearTransitionProps(){return null}set events(e){this.toggleEvents(this._customEvents,!1),this.toggleEvents(e,!0),this._customEvents=e,this.setProps(this.controllerStateProps)}finalize(){for(const e in this._events)this._events[e]&&this.eventManager.off(e,this.handleEvent);this.transitionManager.finalize()}handleEvent(e){const t=this["ControllerState"];this.controllerState=new t({makeViewport:this.makeViewport,...this.controllerStateProps,...this._state});var n=this._eventStartBlocked;switch(e.type){case"panstart":return!n&&this._onPanStart(e);case"panmove":return this._onPan(e);case"panend":return this._onPanEnd(e);case"pinchstart":return!n&&this._onPinchStart(e);case"pinchmove":return this._onPinch(e);case"pinchend":return this._onPinchEnd(e);case"tripanstart":return!n&&this._onTriplePanStart(e);case"tripanmove":return this._onTriplePan(e);case"tripanend":return this._onTriplePanEnd(e);case"doubletap":return this._onDoubleTap(e);case"wheel":return this._onWheel(e);case"keydown":return this._onKeyDown(e);default:return!1}}getCenter(e){var{x:t,y:n}=this.controllerStateProps,e=e["offsetCenter"];return[e.x-t,e.y-n]}isPointInBounds(e,t){var{width:n,height:r}=this.controllerStateProps;if(t&&t.handled)return!1;n=0<=e[0]&&e[0]<=n&&0<=e[1]&&e[1]<=r;return n&&t&&t.stopPropagation(),n}isFunctionKeyPressed(e){e=e.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging}blockEvents(e){const t=setTimeout(()=>{this._eventStartBlocked===t&&(this._eventStartBlocked=null)},e);this._eventStartBlocked=t}setProps(e){"onViewStateChange"in e&&(this.onViewStateChange=e.onViewStateChange),"onStateChange"in e&&(this.onStateChange=e.onStateChange),"makeViewport"in e&&(this.makeViewport=e.makeViewport),"dragMode"in e&&(this.dragMode=e.dragMode),"eventManager"in(this.controllerStateProps=e)&&this.eventManager!==e.eventManager&&(this.eventManager=e.eventManager,this._events={},this.toggleEvents(this._customEvents,!0)),"transitionInterpolator"in e||(e.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(e);let t=e["inertia"];!0===t&&(t=300),this.inertia=t;var{scrollZoom:e=!0,dragPan:n=!0,dragRotate:r=!0,doubleClickZoom:i=!0,touchZoom:o=!0,touchRotate:a=!1,keyboard:s=!0}=e,A=Boolean(this.onViewStateChange);this.toggleEvents(l.WHEEL,A&&e),this.toggleEvents(l.PAN,A&&(n||r)),this.toggleEvents(l.PINCH,A&&(o||a)),this.toggleEvents(l.TRIPLE_PAN,A&&a),this.toggleEvents(l.DOUBLE_TAP,A&&i),this.toggleEvents(l.KEYBOARD,A&&s),this.scrollZoom=e,this.dragPan=n,this.dragRotate=r,this.doubleClickZoom=i,this.touchZoom=o,this.touchRotate=a,this.keyboard=s}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(e,t){this.eventManager&&e.forEach(e=>{this._events[e]!==t&&((this._events[e]=t)?this.eventManager.on(e,this.handleEvent):this.eventManager.off(e,this.handleEvent))})}updateViewport(e,t={},n={}){var t={...e.getViewportProps(),...t},r=this.controllerState!==e;this._state=e.getState(),this._setInteractionState(n),r&&(e=this.controllerState?this.controllerState.getViewportProps():null,this.onViewStateChange&&this.onViewStateChange({viewState:t,interactionState:this._interactionState,oldViewState:e}))}_onTransition(e){this.onViewStateChange&&(e.interactionState=this._interactionState,this.onViewStateChange(e))}_setInteractionState(e){Object.assign(this._interactionState,e),this.onStateChange&&this.onStateChange(this._interactionState)}_onPanStart(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;let n=this.isFunctionKeyPressed(e)||e.rightButton;!this.invertPan&&"pan"!==this.dragMode||(n=!n);e=this.controllerState[n?"panStart":"rotateStart"]({pos:t});return this._panMove=n,this.updateViewport(e,o,{isDragging:!0}),!0}_onPan(e){return!!this.isDragging()&&(this._panMove?this._onPanMove(e):this._onPanRotate(e))}_onPanEnd(e){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(e):this._onPanRotateEnd(e))}_onPanMove(e){if(!this.dragPan)return!1;e=this.getCenter(e),e=this.controllerState.pan({pos:e});return this.updateViewport(e,o,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(e){var t,n=this["inertia"];return this.dragPan&&n&&e.velocity?(t=[(t=this.getCenter(e))[0]+e.velocityX*n/2,t[1]+e.velocityY*n/2],e=this.controllerState.pan({pos:t}).panEnd(),this.updateViewport(e,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:s},{isDragging:!1,isPanning:!0})):(t=this.controllerState.panEnd(),this.updateViewport(t,null,{isDragging:!1,isPanning:!1})),!0}_onPanRotate(e){if(!this.dragRotate)return!1;e=this.getCenter(e),e=this.controllerState.rotate({pos:e});return this.updateViewport(e,o,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(e){var t,n=this["inertia"];return this.dragRotate&&n&&e.velocity?(t=[(t=this.getCenter(e))[0]+e.velocityX*n/2,t[1]+e.velocityY*n/2],e=this.controllerState.rotate({pos:t}).rotateEnd(),this.updateViewport(e,{...this._getTransitionProps(),transitionDuration:n,transitionEasing:s},{isDragging:!1,isRotating:!0})):(t=this.controllerState.rotateEnd(),this.updateViewport(t,null,{isDragging:!1,isRotating:!1})),!0}_onWheel(e){if(!this.scrollZoom)return!1;e.preventDefault();var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;var{speed:n=.01,smooth:r=!1}=this.scrollZoom,e=e["delta"];let i=2/(1+Math.exp(-Math.abs(e*n)));e<0&&0!==i&&(i=1/i);n=this.controllerState.zoom({pos:t,scale:i});return this.updateViewport(n,{...this._getTransitionProps({around:t}),transitionDuration:r?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;e=this.controllerState.rotateStart({pos:t});return this.updateViewport(e,o,{isDragging:!0}),!0}_onTriplePan(e){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const t=this.getCenter(e);t[0]-=e.deltaX;e=this.controllerState.rotate({pos:t});return this.updateViewport(e,o,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(e){if(!this.isDragging())return!1;var t=this["inertia"];if(this.touchRotate&&t&&e.velocityY){const n=this.getCenter(e);e=[n[0],n[1]+=e.velocityY*t/2],e=this.controllerState.rotate({pos:e});this.updateViewport(e,{...this._getTransitionProps(),transitionDuration:t,transitionEasing:s},{isDragging:!1,isRotating:!0}),this.blockEvents(t)}else{e=this.controllerState.rotateEnd();this.updateViewport(e,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(e){var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;t=this.controllerState.zoomStart({pos:t}).rotateStart({pos:t});return this._startPinchRotation=e.rotation,this._lastPinchEvent=e,this.updateViewport(t,o,{isDragging:!0}),!0}_onPinch(e){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let t=this.controllerState;var n,r;return this.touchZoom&&(n=e["scale"],r=this.getCenter(e),t=t.zoom({pos:r,scale:n})),this.touchRotate&&(r=e["rotation"],t=t.rotate({deltaAngleX:this._startPinchRotation-r})),this.updateViewport(t,o,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),this._lastPinchEvent=e,!0}_onPinchEnd(t){if(!this.isDragging())return!1;var{inertia:n,_lastPinchEvent:r}=this;if(this.touchZoom&&n&&r&&t.scale!==r.scale){var i=this.getCenter(t);let e=this.controllerState.rotateEnd();var o=Math.log2(t.scale),t=(o-Math.log2(r.scale))/(t.deltaTime-r.deltaTime),r=Math.pow(2,o+t*n/2);e=e.zoom({pos:i,scale:r}).zoomEnd(),this.updateViewport(e,{...this._getTransitionProps({around:i}),transitionDuration:n,transitionEasing:s},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(n)}else{o=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(o,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return this._startPinchRotation=null,!(this._lastPinchEvent=null)}_onDoubleTap(e){if(!this.doubleClickZoom)return!1;var t=this.getCenter(e);if(!this.isPointInBounds(t,e))return!1;e=this.isFunctionKeyPressed(e),e=this.controllerState.zoom({pos:t,scale:e?.5:2});return this.updateViewport(e,this._getTransitionProps({around:t}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(e){if(!this.keyboard)return!1;var t=this.isFunctionKeyPressed(e),{zoomSpeed:n,moveSpeed:r,rotateSpeedX:i,rotateSpeedY:o}=this.keyboard;const a=this["controllerState"];let s;const A={};switch(e.srcEvent.code){case"Minus":s=(t?a.zoomOut(n):a).zoomOut(n),A.isZooming=!0;break;case"Equal":s=(t?a.zoomIn(n):a).zoomIn(n),A.isZooming=!0;break;case"ArrowLeft":t?(s=a.rotateLeft(i),A.isRotating=!0):(s=a.moveLeft(r),A.isPanning=!0);break;case"ArrowRight":t?(s=a.rotateRight(i),A.isRotating=!0):(s=a.moveRight(r),A.isPanning=!0);break;case"ArrowUp":t?(s=a.rotateUp(o),A.isRotating=!0):(s=a.moveUp(r),A.isPanning=!0);break;case"ArrowDown":t?(s=a.rotateDown(o),A.isRotating=!0):(s=a.moveDown(r),A.isPanning=!0);break;default:return!1}return this.updateViewport(s,this._getTransitionProps(),A),!0}_getTransitionProps(e){var t=this["_transition"];return t?e?{...t,transitionInterpolator:new i.a({...e,transitionProps:this.linearTransitionProps,makeViewport:this.controllerState.makeViewport})}:t:o}}},function(e,t,n){"use strict";n.d(t,"a",function(){return view_View});var d=n(76);const r=/([0-9]+\.?[0-9]*)(%|px)/;function parsePosition(e){switch(typeof e){case"number":return{position:e,relative:!1};case"string":var t,n=e.match(r);if(n&&3<=n.length)return t="%"===n[2],n=parseFloat(n[1]),{position:t?n/100:n,relative:t};default:throw new Error("Could not parse position string ".concat(e))}}function getPosition(e,t){return e.relative?Math.round(e.position*t):e.position}var i=n(139),h=n(69);class view_View{constructor(e={}){var{id:t=null,x:n=0,y:r=0,width:i="100%",height:o="100%",projectionMatrix:a=null,fovy:s=50,near:A=.1,far:l=1e3,modelMatrix:c=null,viewportInstance:g=null,type:u=d.a}=e;Object(h.a)(!g||g instanceof d.a),this.viewportInstance=g,this.id=t||this.constructor.displayName||"view",this.type=u,this.props={...e,id:this.id,projectionMatrix:a,fovy:s,near:A,far:l,modelMatrix:c},this._parseDimensions({x:n,y:r,width:i,height:o}),this.equals=this.equals.bind(this),Object.seal(this)}equals(e){return this===e||(this.viewportInstance?e.viewportInstance&&this.viewportInstance.equals(e.viewportInstance):Object(i.a)(this.props,e.props))}makeViewport({width:e,height:t,viewState:n}){if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);e=this.getDimensions({width:e,height:t});return this._getViewport(n,e)}getViewStateId(){switch(typeof this.props.viewState){case"string":return this.props.viewState;case"object":return this.props.viewState&&this.props.viewState.id;default:return this.id}}filterViewState(e){if(this.props.viewState&&"object"==typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const t={...e};for(const n in this.props.viewState)"id"!==n&&(t[n]=this.props.viewState[n]);return t}return e}getDimensions({width:e,height:t}){return{x:getPosition(this._x,e),y:getPosition(this._y,t),width:getPosition(this._width,e),height:getPosition(this._height,t)}}_getControllerProps(e){let t=this.props.controller;return t?!0===t?e:("function"==typeof t&&(t={type:t}),{...e,...t}):null}_getViewport(e,t){const n=this["type"];return new n({...e,...this.props,...t})}_parseDimensions({x:e,y:t,width:n,height:r}){this._x=parsePosition(e),this._y=parsePosition(t),this._width=parsePosition(n),this._height=parsePosition(r)}}},function(e,t,n){"use strict";function setRef(e,t){"function"==typeof e?e(t):e&&(e.current=t)}n.d(t,"a",function(){return setRef})},function(e,t,n){"use strict";n.d(t,"a",function(){return Geometry});var o=n(86),s=n(14);const a={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class Geometry{static get DRAW_MODE(){return a}constructor(e={}){var{id:e=Object(o.c)("geometry"),drawMode:t=a.TRIANGLES,attributes:n={},indices:r=null,vertexCount:i=null}=e;this.id=e,this.drawMode=0|t,this.attributes={},this.userData={},this._setAttributes(n,r),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute `+e}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const n in t){let e=t[n];e=ArrayBuffer.isView(e)?{value:e}:e,Object(s.a)(ArrayBuffer.isView(e.value),this._print(n)+": must be typed array or object with value as typed array"),"POSITION"!==n&&"positions"!==n||e.size||(e.size=3),"indices"===n?(Object(s.a)(!this.indices),this.indices=e):this.attributes[n]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(e,t){if(t)return t.value.length;let n=1/0;for(const a in e){var{value:r,size:i,constant:o}=e[a];!o&&r&&1<=i&&(n=Math.min(n,r.length/i))}return Object(s.a)(Number.isFinite(n)),n}}},function(e,t,n){"use strict";n.d(t,"a",function(){return _toConsumableArray});var r=n(282);var i=n(354),o=n(248);function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return Object(r.a)(e)}(e)||Object(i.a)(e)||Object(o.a)(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},function(e,t,n){"use strict";function _assertThisInitialized(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 _assertThisInitialized})},function(e,t,n){"use strict";n.d(t,"a",function(){return Accessor});var r=n(95),i=n(14),o=n(284);const a={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},s={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class Accessor{static getBytesPerElement(e){return Object(r.c)(e.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(e){return Object(i.a)(e.size),Object(r.c)(e.type||5126).BYTES_PER_ELEMENT*e.size}static resolve(...e){return new Accessor(a,...e)}constructor(...e){e.forEach(e=>this._assign(e)),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return Accessor.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return Accessor.getBytesPerVertex(this)}_assign(e={}){return void 0!==(e=Object(o.a)("Accessor",e,s)).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 e.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}}},function(e,t,n){var n=n(500),r="object"==typeof self&&self&&self.Object===Object&&self,n=n||r||Function("return this")();e.exports=n},function(e,t,n){"use strict";var r=n(50),i=n(227),o=i(r("String.prototype.indexOf"));e.exports=function callBoundIntrinsic(e,t){t=r(e,!!t);return"function"==typeof t&&-1!0){return Array.isArray(e)?function flattenArray(e,t,n){let r=-1;for(;++rr&&(i=r);const o=this._pool,a=e.BYTES_PER_ELEMENT*i;t=o.findIndex(e=>e.byteLength>=a);if(0<=t){const s=new e(o.splice(t,1)[0],0,i);return n&&s.fill(0),s}return new e(i)}_release(e){if(ArrayBuffer.isView(e)){const n=this._pool;e=e["buffer"];const r=e["byteLength"];var t=n.findIndex(e=>e.byteLength>=r);t<0?n.push(e):(0this.props.poolSize&&n.shift()}}}},function(e,t,n){var a=n(743),s=n(744);e.exports=function v4(e,t,n){var r=t&&n||0,i=("string"==typeof e&&(t="binary"===e?new Array(16):null,e=null),(e=e||{}).random||(e.rng||a)());if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||s(i)}},function(e,t,n){"use strict";n.d(t,"c",function(){return i}),n.d(t,"e",function(){return a}),n.d(t,"a",function(){return s}),n.d(t,"b",function(){return A}),n.d(t,"d",function(){return l});var r=n(55);const i={[3042]:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0};var t=(e,t,n)=>t?e.enable(n):e.disable(n),n=(e,t,n)=>e.hint(n,t),o=(e,t,n)=>e.pixelStorei(n,t);function isArray(e){return Array.isArray(e)||ArrayBuffer.isView(e)}const a={[3042]:t,32773:(e,t)=>e.blendColor(...t),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(e,t)=>e.clearColor(...t),3107:(e,t)=>e.colorMask(...t),2884:t,2885:(e,t)=>e.cullFace(t),2929:t,2931:(e,t)=>e.clearDepth(t),2932:(e,t)=>e.depthFunc(t),2928:(e,t)=>e.depthRange(...t),2930:(e,t)=>e.depthMask(t),3024:t,35723:n,36006:(e,t)=>{var n=Object(r.e)(e)?36009:36160;return e.bindFramebuffer(n,t)},2886:(e,t)=>e.frontFace(t),33170:n,2849:(e,t)=>e.lineWidth(t),32823:t,32824:"polygonOffset",10752:"polygonOffset",35977:t,32938:"sampleCoverage",32939:"sampleCoverage",3089:t,3088:(e,t)=>e.scissor(...t),2960:t,2961:(e,t)=>e.clearStencil(t),2968:(e,t)=>e.stencilMaskSeparate(1028,t),36005:(e,t)=>e.stencilMaskSeparate(1029,t),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(e,t)=>e.viewport(...t),3333:o,3317:o,37440:o,37441:o,37443:o,3330:o,3332:o,3331:o,36010:(e,t)=>e.bindFramebuffer(36008,t),3314:o,32878:o,3316:o,3315:o,32877:o,framebuffer:(e,t)=>{t=t&&"handle"in t?t.handle:t;return e.bindFramebuffer(36160,t)},blend:(e,t)=>t?e.enable(3042):e.disable(3042),blendColor:(e,t)=>e.blendColor(...t),blendEquation:(e,t)=>{t=isArray(t)?t:[t,t],e.blendEquationSeparate(...t)},blendFunc:(e,t)=>{t=isArray(t)&&2===t.length?[...t,...t]:t,e.blendFuncSeparate(...t)},clearColor:(e,t)=>e.clearColor(...t),clearDepth:(e,t)=>e.clearDepth(t),clearStencil:(e,t)=>e.clearStencil(t),colorMask:(e,t)=>e.colorMask(...t),cull:(e,t)=>t?e.enable(2884):e.disable(2884),cullFace:(e,t)=>e.cullFace(t),depthTest:(e,t)=>t?e.enable(2929):e.disable(2929),depthFunc:(e,t)=>e.depthFunc(t),depthMask:(e,t)=>e.depthMask(t),depthRange:(e,t)=>e.depthRange(...t),dither:(e,t)=>t?e.enable(3024):e.disable(3024),derivativeHint:(e,t)=>{e.hint(35723,t)},frontFace:(e,t)=>e.frontFace(t),mipmapHint:(e,t)=>e.hint(33170,t),lineWidth:(e,t)=>e.lineWidth(t),polygonOffsetFill:(e,t)=>t?e.enable(32823):e.disable(32823),polygonOffset:(e,t)=>e.polygonOffset(...t),sampleCoverage:(e,t)=>e.sampleCoverage(...t),scissorTest:(e,t)=>t?e.enable(3089):e.disable(3089),scissor:(e,t)=>e.scissor(...t),stencilTest:(e,t)=>t?e.enable(2960):e.disable(2960),stencilMask:(e,t)=>{var[t,n]=t=isArray(t)?t:[t,t];e.stencilMaskSeparate(1028,t),e.stencilMaskSeparate(1029,n)},stencilFunc:(e,t)=>{var[t,n,r,i,o,a]=t=isArray(t)&&3===t.length?[...t,...t]:t;e.stencilFuncSeparate(1028,t,n,r),e.stencilFuncSeparate(1029,i,o,a)},stencilOp:(e,t)=>{var[t,n,r,i,o,a]=t=isArray(t)&&3===t.length?[...t,...t]:t;e.stencilOpSeparate(1028,t,n,r),e.stencilOpSeparate(1029,i,o,a)},viewport:(e,t)=>e.viewport(...t)};function getValue(e,t,n){return(void 0!==t[e]?t:n)[e]}const s={blendEquation:(e,t,n)=>e.blendEquationSeparate(getValue(32777,t,n),getValue(34877,t,n)),blendFunc:(e,t,n)=>e.blendFuncSeparate(getValue(32969,t,n),getValue(32968,t,n),getValue(32971,t,n),getValue(32970,t,n)),polygonOffset:(e,t,n)=>e.polygonOffset(getValue(32824,t,n),getValue(10752,t,n)),sampleCoverage:(e,t,n)=>e.sampleCoverage(getValue(32938,t,n),getValue(32939,t,n)),stencilFuncFront:(e,t,n)=>e.stencilFuncSeparate(1028,getValue(2962,t,n),getValue(2967,t,n),getValue(2963,t,n)),stencilFuncBack:(e,t,n)=>e.stencilFuncSeparate(1029,getValue(34816,t,n),getValue(36003,t,n),getValue(36004,t,n)),stencilOpFront:(e,t,n)=>e.stencilOpSeparate(1028,getValue(2964,t,n),getValue(2965,t,n),getValue(2966,t,n)),stencilOpBack:(e,t,n)=>e.stencilOpSeparate(1029,getValue(34817,t,n),getValue(34818,t,n),getValue(34819,t,n))},A={enable:(e,t)=>e({[t]:!0}),disable:(e,t)=>e({[t]:!1}),pixelStorei:(e,t,n)=>e({[t]:n}),hint:(e,t,n)=>e({[t]:n}),bindFramebuffer:(e,t,n)=>{switch(t){case 36160:return e({[36006]:n,36010:n});case 36009:return e({[36006]:n});case 36008:return e({[36010]:n});default:return null}},blendColor:(e,t,n,r,i)=>e({[32773]:new Float32Array([t,n,r,i])}),blendEquation:(e,t)=>e({[32777]:t,34877:t}),blendEquationSeparate:(e,t,n)=>e({[32777]:t,34877:n}),blendFunc:(e,t,n)=>e({[32969]:t,32968:n,32971:t,32970:n}),blendFuncSeparate:(e,t,n,r,i)=>e({[32969]:t,32968:n,32971:r,32970:i}),clearColor:(e,t,n,r,i)=>e({[3106]:new Float32Array([t,n,r,i])}),clearDepth:(e,t)=>e({[2931]:t}),clearStencil:(e,t)=>e({[2961]:t}),colorMask:(e,t,n,r,i)=>e({[3107]:[t,n,r,i]}),cullFace:(e,t)=>e({[2885]:t}),depthFunc:(e,t)=>e({[2932]:t}),depthRange:(e,t,n)=>e({[2928]:new Float32Array([t,n])}),depthMask:(e,t)=>e({[2930]:t}),frontFace:(e,t)=>e({[2886]:t}),lineWidth:(e,t)=>e({[2849]:t}),polygonOffset:(e,t,n)=>e({[32824]:t,10752:n}),sampleCoverage:(e,t,n)=>e({[32938]:t,32939:n}),scissor:(e,t,n,r,i)=>e({[3088]:new Int32Array([t,n,r,i])}),stencilMask:(e,t)=>e({[2968]:t,36005:t}),stencilMaskSeparate:(e,t,n)=>e({[1028===t?2968:36005]:n}),stencilFunc:(e,t,n,r)=>e({[2962]:t,2967:n,2963:r,34816:t,36003:n,36004:r}),stencilFuncSeparate:(e,t,n,r,i)=>e({[1028===t?2962:34816]:n,[1028===t?2967:36003]:r,[1028===t?2963:36004]:i}),stencilOp:(e,t,n,r)=>e({[2964]:t,2965:n,2966:r,34817:t,34818:n,34819:r}),stencilOpSeparate:(e,t,n,r,i)=>e({[1028===t?2964:34817]:n,[1028===t?2965:34818]:r,[1028===t?2966:34819]:i}),viewport:(e,t,n,r,i)=>e({[2978]:[t,n,r,i]})};n=(e,t)=>e.isEnabled(t);const l={[3042]:n,2884:n,2929:n,3024:n,32823:n,32926:n,32928:n,3089:n,2960:n,35977:n}},,function(e,t){e.exports=function isObjectLike(e){return null!=e&&"object"==typeof e}},function(e,t,n){"use strict";function deprecatedPropType(e,t){return function(){return null}}n.d(t,"a",function(){return deprecatedPropType})},function(e,t,n){"use strict";function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n{}}={}){this.gl=e,this.program=null,this.stateStack=[],this.enable=!0,this.cache=t?Object(r.a)(e):Object.assign({},s.c),this.log=n,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(e=0){this.stateStack.push({})}pop(){Object(A.a)(0{r[e]=null}),Object.assign(r,e);t=this.gl.bindFramebuffer(36160,this.handle);for(const A in r){Object(u.a)(void 0!==A,"Misspelled framebuffer binding point?");var i,o,a=Number(A),s=r[a];let e=s;e?e instanceof l.a?this._attachRenderbuffer({attachment:a,renderbuffer:e}):Array.isArray(s)?([s,i=0,o=0]=s,e=s,this._attachTexture({attachment:a,texture:s,layer:i,level:o})):this._attachTexture({attachment:a,texture:e,layer:0,level:0}):this._unattach(a),n&&e&&e.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,t||null),Object.assign(this.attachments,e),Object.keys(this.attachments).filter(e=>!this.attachments[e]).forEach(e=>{delete this.attachments[e]})}checkStatus(){var{}=this,e=this.getStatus();if(36053!==e)throw new Error(function _getFrameBufferStatus(e){var t=Framebuffer.STATUS||{};return t[e]||"Framebuffer error "+e}(e));return this}getStatus(){const e=this["gl"];var t=e.bindFramebuffer(36160,this.handle),n=e.checkFramebufferStatus(36160);return e.bindFramebuffer(36160,t||null),n}clear(e={}){const{color:t,depth:n,stencil:r,drawBuffers:i=[]}=e;e=this.gl.bindFramebuffer(36160,this.handle);return(t||n||r)&&Object(o.a)(this.gl,{color:t,depth:n,stencil:r}),i.forEach((e,t)=>{Object(o.b)(this.gl,{drawBuffer:t,value:e})}),this.gl.bindFramebuffer(36160,e||null),this}readPixels(e=0){return s.k.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(e=0){return s.k.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(e=0){return s.k.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(e=0){return s.k.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(e=0){return s.k.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(e=0){return s.k.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate({attachments:e=[],x:t=0,y:n=0,width:r,height:i}){const o=Object(s.a)(this.gl);var a=o.bindFramebuffer(36008,this.handle);return 0===t&&0===n&&void 0===r&&void 0===i?o.invalidateFramebuffer(36008,e):o.invalidateFramebuffer(36008,e,t,n,r,i),o.bindFramebuffer(36008,a),this}getAttachmentParameter(e,t,n){let r=this._getAttachmentParameterFallback(t);return null===r&&(this.gl.bindFramebuffer(36160,this.handle),r=this.gl.getFramebufferAttachmentParameter(36160,e,t),this.gl.bindFramebuffer(36160,null)),r=n&&1e3s.k.level||"undefined"==typeof window)return this;t=t||"Framebuffer "+this.id;var n=Object(r.a)(this,{targetMaxHeight:100});return s.k.image({logLevel:e,message:t,image:n},t)(),this}bind({target:e=36160}={}){return this.gl.bindFramebuffer(e,this.handle),this}unbind({target:e=36160}={}){return this.gl.bindFramebuffer(e,null),this}_createDefaultAttachments(e,t,n,r,i){let o=null;return e&&((o=o||{})[36064]=new a.a(this.gl,{id:this.id+"-color0",pixels:null,format:6408,type:5121,width:r,height:i,mipmaps:!1,parameters:{[10241]:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(o[36064])),t&&n?((o=o||{})[33306]=new l.a(this.gl,{id:this.id+"-depth-stencil",format:35056,width:r,height:111}),this.ownResources.push(o[33306])):t?((o=o||{})[36096]=new l.a(this.gl,{id:this.id+"-depth",format:33189,width:r,height:i}),this.ownResources.push(o[36096])):n&&Object(u.a)(!1),o}_unattach(e){var t=this.attachments[e];t&&(t instanceof l.a?this.gl.framebufferRenderbuffer(36160,e,36161,null):this.gl.framebufferTexture2D(36160,e,3553,null,0),delete this.attachments[e])}_attachRenderbuffer({attachment:e=36064,renderbuffer:t}){const n=this["gl"];n.framebufferRenderbuffer(36160,e,36161,t.handle),this.attachments[e]=t}_attachTexture({attachment:e=36064,texture:t,layer:n,level:r}){const i=this["gl"];switch(i.bindTexture(t.target,t.handle),t.target){case 35866:case 32879:const a=Object(s.a)(i);a.framebufferTextureLayer(36160,e,t.target,r,n);break;case 34067:var o=function mapIndexToCubeMapFace(e){return e<34069?e+34069:e}(n);i.framebufferTexture2D(36160,e,o,t.handle,r);break;case 3553:i.framebufferTexture2D(36160,e,3553,t.handle,r);break;default:Object(u.a)(!1,"Illegal texture type")}i.bindTexture(t.target,null),this.attachments[e]=t}_setReadBuffer(e){const t=Object(s.g)(this.gl);t?t.readBuffer(e):Object(u.a)(36064===e||1029===e,c),this.readBuffer=e}_setDrawBuffers(e){const t=this["gl"],n=Object(s.a)(t);if(n)n.drawBuffers(e);else{const r=t.getExtension("WEBGL_draw_buffers");r?r.drawBuffersWEBGL(e):Object(u.a)(1===e.length&&(36064===e[0]||1029===e[0]),c)}this.drawBuffers=e}_getAttachmentParameterFallback(e){var t=Object(i.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}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(e){return this.gl.bindFramebuffer(36160,e)}}Framebuffer.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},function(e,t,n){"use strict";function noop(){}n.d(t,"a",function(){return Transition});const r={onStart:noop,onUpdate:noop,onInterrupt:noop,onEnd:noop};class Transition{constructor(e){this._inProgress=!1,this._handle=null,this.timeline=e,this.settings={}}get inProgress(){return this._inProgress}start(e){this.cancel(),this.settings={...r,...e},this._inProgress=!0,this.settings.onStart(this)}end(){this._inProgress&&(this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,this.settings.onEnd(this))}cancel(){this._inProgress&&(this.settings.onInterrupt(this),this.timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){if(!this._inProgress)return!1;if(null===this._handle){const{timeline:e,settings:t}=this;this._handle=e.addChannel({delay:e.getTime(),duration:t.duration})}return this.time=this.timeline.getTime(this._handle),this._onUpdate(),this.settings.onUpdate(this),this.timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}},function(e,t,n){"use strict";function deepEqual(e,t){if(e===t)return!0;if(!e||!t)return!1;for(const i in e){var n=e[i],r=t[i];if(!(n===r||Array.isArray(n)&&Array.isArray(r)&&deepEqual(n,r)))return!1}return!0}n.d(t,"a",function(){return deepEqual})},function(e,t,n){"use strict";n.d(t,"a",function(){return BaseSource});class BaseSource{async fetch(e,t=void 0){return Promise.all(e.map(e=>this.fetchSlice(e,t)))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}},function(e,t,n){"use strict";var r=n(158);t.a=function(e){return(e=Object(r.b)(Math.abs(e)))?e[1]:NaN}},function(e,a,s){"use strict";!function(e,t){s.d(a,"a",function(){return n}),s.d(a,"b",function(){return r}),s.d(a,"d",function(){return i}),s.d(a,"c",function(){return o});e={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document};const n=e.global||e.self||e.window||{};const r="object"!=typeof t||"[object process]"!==String(t)||t.browser,i="function"==typeof importScripts,o="undefined"!=typeof window&&void 0!==window.orientation;e=void 0!==t&&t.version&&/v([0-9]*)/.exec(t.version);e&&parseFloat(e[1])}.call(this,s(64),s(89))},function(e,t,n){"use strict";n.d(t,"b",function(){return r}),n.d(t,"a",function(){return i});const r="vs",i="fs"},function(g,e,t){"use strict";t.r(e),t.d(e,"Debug",function(){return B.a}),t.d(e,"Error",function(){return B.b}),t.d(e,"Info",function(){return B.c}),t.d(e,"None",function(){return B.d}),t.d(e,"Warn",function(){return B.e}),t.d(e,"accessor",function(){return B.f}),t.d(e,"accessorFields",function(){return B.g}),t.d(e,"accessorName",function(){return B.h}),t.d(e,"array",function(){return B.i}),t.d(e,"ascending",function(){return B.j}),t.d(e,"clampRange",function(){return B.k}),t.d(e,"compare",function(){return B.l}),t.d(e,"constant",function(){return B.m}),t.d(e,"debounce",function(){return B.n}),t.d(e,"error",function(){return B.o}),t.d(e,"extend",function(){return B.p}),t.d(e,"extent",function(){return B.q}),t.d(e,"extentIndex",function(){return B.r}),t.d(e,"falsy",function(){return B.s}),t.d(e,"fastmap",function(){return B.t}),t.d(e,"field",function(){return B.u}),t.d(e,"flush",function(){return B.v}),t.d(e,"hasOwnProperty",function(){return B.w}),t.d(e,"id",function(){return B.x}),t.d(e,"identity",function(){return B.y}),t.d(e,"inherits",function(){return B.z}),t.d(e,"inrange",function(){return B.A}),t.d(e,"isArray",function(){return B.B}),t.d(e,"isBoolean",function(){return B.C}),t.d(e,"isDate",function(){return B.D}),t.d(e,"isFunction",function(){return B.E}),t.d(e,"isIterable",function(){return B.F}),t.d(e,"isNumber",function(){return B.G}),t.d(e,"isObject",function(){return B.H}),t.d(e,"isRegExp",function(){return B.I}),t.d(e,"isString",function(){return B.J}),t.d(e,"key",function(){return B.K}),t.d(e,"lerp",function(){return B.L}),t.d(e,"logger",function(){return B.M}),t.d(e,"lruCache",function(){return B.N}),t.d(e,"merge",function(){return B.O}),t.d(e,"mergeConfig",function(){return B.P}),t.d(e,"one",function(){return B.Q}),t.d(e,"pad",function(){return B.R}),t.d(e,"panLinear",function(){return B.S}),t.d(e,"panLog",function(){return B.T}),t.d(e,"panPow",function(){return B.U}),t.d(e,"panSymlog",function(){return B.V}),t.d(e,"peek",function(){return B.W}),t.d(e,"quarter",function(){return B.X}),t.d(e,"repeat",function(){return B.Y}),t.d(e,"span",function(){return B.Z}),t.d(e,"splitAccessPath",function(){return B.ab}),t.d(e,"stringValue",function(){return B.bb}),t.d(e,"toBoolean",function(){return B.cb}),t.d(e,"toDate",function(){return B.db}),t.d(e,"toNumber",function(){return B.eb}),t.d(e,"toSet",function(){return B.fb}),t.d(e,"toString",function(){return B.gb}),t.d(e,"truncate",function(){return B.hb}),t.d(e,"truthy",function(){return B.ib}),t.d(e,"utcquarter",function(){return B.jb}),t.d(e,"visitArray",function(){return B.kb}),t.d(e,"writeConfig",function(){return B.lb}),t.d(e,"zero",function(){return B.mb}),t.d(e,"zoomLinear",function(){return B.nb}),t.d(e,"zoomLog",function(){return B.ob}),t.d(e,"zoomPow",function(){return B.pb}),t.d(e,"zoomSymlog",function(){return B.qb}),t.d(e,"Dataflow",function(){return Dataflow}),t.d(e,"EventStream",function(){return EventStream}),t.d(e,"MultiPulse",function(){return MultiPulse}),t.d(e,"Operator",function(){return Operator}),t.d(e,"Parameters",function(){return Parameters}),t.d(e,"Pulse",function(){return Pulse}),t.d(e,"Transform",function(){return Transform}),t.d(e,"changeset",function(){return changeset}),t.d(e,"definition",function(){return definition}),t.d(e,"ingest",function(){return ingest$1}),t.d(e,"isTuple",function(){return isTuple}),t.d(e,"transform",function(){return vega_dataflow_module_transform}),t.d(e,"transforms",function(){return J}),t.d(e,"tupleid",function(){return tupleid}),t.d(e,"bandwidthNRD",function(){return estimateBandwidth}),t.d(e,"bin",function(){return vega_statistics_module_bin}),t.d(e,"bootstrapCI",function(){return bootstrapCI}),t.d(e,"cumulativeLogNormal",function(){return cumulativeLogNormal}),t.d(e,"cumulativeNormal",function(){return cumulativeNormal}),t.d(e,"cumulativeUniform",function(){return cumulativeUniform}),t.d(e,"densityLogNormal",function(){return densityLogNormal}),t.d(e,"densityNormal",function(){return densityNormal}),t.d(e,"densityUniform",function(){return densityUniform}),t.d(e,"dotbin",function(){return dotbin}),t.d(e,"quantileLogNormal",function(){return quantileLogNormal}),t.d(e,"quantileNormal",function(){return quantileNormal}),t.d(e,"quantileUniform",function(){return quantileUniform}),t.d(e,"quantiles",function(){return quantiles}),t.d(e,"quartiles",function(){return quartiles}),t.d(e,"random",function(){return ee}),t.d(e,"randomInteger",function(){return integer}),t.d(e,"randomKDE",function(){return vega_statistics_module_kde}),t.d(e,"randomLCG",function(){return lcg}),t.d(e,"randomLogNormal",function(){return lognormal}),t.d(e,"randomMixture",function(){return mixture}),t.d(e,"randomNormal",function(){return gaussian}),t.d(e,"randomUniform",function(){return uniform}),t.d(e,"regressionExp",function(){return exp}),t.d(e,"regressionLinear",function(){return linear}),t.d(e,"regressionLoess",function(){return loess}),t.d(e,"regressionLog",function(){return log}),t.d(e,"regressionPoly",function(){return poly}),t.d(e,"regressionPow",function(){return pow}),t.d(e,"regressionQuad",function(){return vega_statistics_module_quad}),t.d(e,"sampleCurve",function(){return sampleCurve}),t.d(e,"sampleLogNormal",function(){return sampleLogNormal}),t.d(e,"sampleNormal",function(){return sampleNormal}),t.d(e,"sampleUniform",function(){return sampleUniform}),t.d(e,"setRandom",function(){return setRandom}),t.d(e,"DATE",function(){return h.a}),t.d(e,"DAY",function(){return h.b}),t.d(e,"DAYOFYEAR",function(){return h.c}),t.d(e,"HOURS",function(){return h.d}),t.d(e,"MILLISECONDS",function(){return h.e}),t.d(e,"MINUTES",function(){return h.f}),t.d(e,"MONTH",function(){return h.g}),t.d(e,"QUARTER",function(){return h.h}),t.d(e,"SECONDS",function(){return h.i}),t.d(e,"TIME_UNITS",function(){return h.j}),t.d(e,"WEEK",function(){return h.k}),t.d(e,"YEAR",function(){return h.l}),t.d(e,"dayofyear",function(){return h.m}),t.d(e,"timeBin",function(){return h.n}),t.d(e,"timeFloor",function(){return h.o}),t.d(e,"timeInterval",function(){return h.p}),t.d(e,"timeOffset",function(){return h.q}),t.d(e,"timeSequence",function(){return h.r}),t.d(e,"timeUnitSpecifier",function(){return h.s}),t.d(e,"timeUnits",function(){return h.t}),t.d(e,"utcFloor",function(){return h.u}),t.d(e,"utcInterval",function(){return h.v}),t.d(e,"utcOffset",function(){return h.w}),t.d(e,"utcSequence",function(){return h.x}),t.d(e,"utcdayofyear",function(){return h.y}),t.d(e,"utcweek",function(){return h.z}),t.d(e,"week",function(){return h.A}),t.d(e,"format",function(){return Q.a}),t.d(e,"formats",function(){return Q.b}),t.d(e,"inferType",function(){return Q.c}),t.d(e,"inferTypes",function(){return Q.d}),t.d(e,"loader",function(){return Q.e}),t.d(e,"read",function(){return Q.f}),t.d(e,"responseType",function(){return Q.g}),t.d(e,"typeParsers",function(){return Q.h}),t.d(e,"Bounds",function(){return Bounds}),t.d(e,"CanvasHandler",function(){return CanvasHandler}),t.d(e,"CanvasRenderer",function(){return CanvasRenderer}),t.d(e,"Gradient",function(){return Gradient}),t.d(e,"GroupItem",function(){return GroupItem}),t.d(e,"Handler",function(){return vega_scenegraph_module_Handler}),t.d(e,"Item",function(){return Item}),t.d(e,"Marks",function(){return Ei}),t.d(e,"RenderType",function(){return so}),t.d(e,"Renderer",function(){return vega_scenegraph_module_Renderer}),t.d(e,"ResourceLoader",function(){return ResourceLoader}),t.d(e,"SVGHandler",function(){return SVGHandler}),t.d(e,"SVGRenderer",function(){return SVGRenderer}),t.d(e,"SVGStringRenderer",function(){return SVGStringRenderer}),t.d(e,"Scenegraph",function(){return Scenegraph}),t.d(e,"boundClip",function(){return boundClip}),t.d(e,"boundContext",function(){return boundContext}),t.d(e,"boundItem",function(){return boundItem}),t.d(e,"boundMark",function(){return boundMark}),t.d(e,"boundStroke",function(){return boundStroke}),t.d(e,"domChild",function(){return domChild}),t.d(e,"domClear",function(){return domClear}),t.d(e,"domCreate",function(){return domCreate}),t.d(e,"domFind",function(){return domFind}),t.d(e,"font",function(){return vega_scenegraph_module_font}),t.d(e,"fontFamily",function(){return fontFamily}),t.d(e,"fontSize",function(){return vega_scenegraph_module_fontSize}),t.d(e,"intersect",function(){return vega_scenegraph_module_intersect}),t.d(e,"intersectBoxLine",function(){return intersectBoxLine}),t.d(e,"intersectPath",function(){return intersectPath}),t.d(e,"intersectPoint",function(){return intersectPoint}),t.d(e,"intersectRule",function(){return intersectRule}),t.d(e,"lineHeight",function(){return lineHeight}),t.d(e,"markup",function(){return markup}),t.d(e,"multiLineOffset",function(){return multiLineOffset}),t.d(e,"pathCurves",function(){return curves}),t.d(e,"pathEqual",function(){return pathEqual}),t.d(e,"pathParse",function(){return pathParse}),t.d(e,"pathRectangle",function(){return vg_rect}),t.d(e,"pathRender",function(){return pathRender}),t.d(e,"pathSymbols",function(){return vega_scenegraph_module_symbols}),t.d(e,"pathTrail",function(){return vg_trail}),t.d(e,"point",function(){return vega_scenegraph_module_point}),t.d(e,"renderModule",function(){return renderModule}),t.d(e,"resetSVGClipId",function(){return resetSVGClipId}),t.d(e,"resetSVGDefIds",function(){return resetSVGDefIds}),t.d(e,"sceneEqual",function(){return sceneEqual}),t.d(e,"sceneFromJSON",function(){return sceneFromJSON}),t.d(e,"scenePickVisit",function(){return pickVisit}),t.d(e,"sceneToJSON",function(){return sceneToJSON}),t.d(e,"sceneVisit",function(){return vega_scenegraph_module_visit}),t.d(e,"sceneZOrder",function(){return zorder}),t.d(e,"serializeXML",function(){return qi}),t.d(e,"textMetrics",function(){return Bi}),t.d(e,"interpolate",function(){return vega_scale_module_interpolate}),t.d(e,"interpolateColors",function(){return interpolateColors}),t.d(e,"interpolateRange",function(){return interpolateRange}),t.d(e,"quantizeInterpolator",function(){return quantizeInterpolator}),t.d(e,"scale",function(){return vega_scale_module_scale}),t.d(e,"scheme",function(){return vega_scale_module_scheme}),t.d(e,"projection",function(){return vega_projection_module_projection}),t.d(e,"View",function(){return View}),t.d(e,"defaultLocale",function(){return O.a}),t.d(e,"formatLocale",function(){return O.c}),t.d(e,"locale",function(){return O.b}),t.d(e,"resetDefaultLocale",function(){return O.d}),t.d(e,"timeFormatLocale",function(){return O.e}),t.d(e,"expressionFunction",function(){return expressionFunction}),t.d(e,"parse",function(){return vega_parser_module_parse}),t.d(e,"runtimeContext",function(){return vega_runtime_module_context}),t.d(e,"codegenExpression",function(){return vega_expression_module_codegen}),t.d(e,"parseExpression",function(){return parser}),t.d(e,"parseSelector",function(){return eventSelector}),t.d(e,"version",function(){return yh});var e={},r=(t.r(e),t.d(e,"aggregate",function(){return Aggregate}),t.d(e,"bin",function(){return Bin}),t.d(e,"collect",function(){return Collect}),t.d(e,"compare",function(){return Compare}),t.d(e,"countpattern",function(){return CountPattern}),t.d(e,"cross",function(){return Cross}),t.d(e,"density",function(){return Density}),t.d(e,"dotbin",function(){return DotBin}),t.d(e,"expression",function(){return Expression}),t.d(e,"extent",function(){return Extent}),t.d(e,"facet",function(){return Facet}),t.d(e,"field",function(){return Field}),t.d(e,"filter",function(){return Filter}),t.d(e,"flatten",function(){return Flatten}),t.d(e,"fold",function(){return Fold}),t.d(e,"formula",function(){return Formula}),t.d(e,"generate",function(){return Generate}),t.d(e,"impute",function(){return Impute}),t.d(e,"joinaggregate",function(){return JoinAggregate}),t.d(e,"kde",function(){return KDE}),t.d(e,"key",function(){return Key}),t.d(e,"load",function(){return Load}),t.d(e,"lookup",function(){return Lookup}),t.d(e,"multiextent",function(){return MultiExtent}),t.d(e,"multivalues",function(){return MultiValues}),t.d(e,"params",function(){return Params}),t.d(e,"pivot",function(){return Pivot}),t.d(e,"prefacet",function(){return PreFacet}),t.d(e,"project",function(){return Project}),t.d(e,"proxy",function(){return Proxy}),t.d(e,"quantile",function(){return Quantile}),t.d(e,"relay",function(){return Relay}),t.d(e,"sample",function(){return Sample}),t.d(e,"sequence",function(){return Sequence}),t.d(e,"sieve",function(){return Sieve}),t.d(e,"subflow",function(){return Subflow}),t.d(e,"timeunit",function(){return TimeUnit}),t.d(e,"tupleindex",function(){return TupleIndex}),t.d(e,"values",function(){return Values}),t.d(e,"window",function(){return Window}),{}),u=(t.r(r),t.d(r,"interpolate",function(){return rn}),t.d(r,"interpolateArray",function(){return Jt}),t.d(r,"interpolateBasis",function(){return Vt}),t.d(r,"interpolateBasisClosed",function(){return Zt}),t.d(r,"interpolateDate",function(){return Kt}),t.d(r,"interpolateDiscrete",function(){return on}),t.d(r,"interpolateHue",function(){return an}),t.d(r,"interpolateNumber",function(){return Xt}),t.d(r,"interpolateNumberArray",function(){return zt}),t.d(r,"interpolateObject",function(){return qt}),t.d(r,"interpolateRound",function(){return sn}),t.d(r,"interpolateString",function(){return nn}),t.d(r,"interpolateTransformCss",function(){return cn}),t.d(r,"interpolateTransformSvg",function(){return gn}),t.d(r,"interpolateZoom",function(){return un}),t.d(r,"interpolateRgb",function(){return Ht}),t.d(r,"interpolateRgbBasis",function(){return jt}),t.d(r,"interpolateRgbBasisClosed",function(){return Yt}),t.d(r,"interpolateHsl",function(){return dn}),t.d(r,"interpolateHslLong",function(){return hn}),t.d(r,"interpolateLab",function(){return lab_lab}),t.d(r,"interpolateHcl",function(){return En}),t.d(r,"interpolateHclLong",function(){return Qn}),t.d(r,"interpolateCubehelix",function(){return Dn}),t.d(r,"interpolateCubehelixLong",function(){return Gn}),t.d(r,"piecewise",function(){return src_piecewise_piecewise}),t.d(r,"quantize",function(){return Nn}),{}),d=(t.r(u),t.d(u,"bound",function(){return Bound}),t.d(u,"identifier",function(){return Identifier}),t.d(u,"mark",function(){return Mark}),t.d(u,"overlap",function(){return Overlap}),t.d(u,"render",function(){return Render}),t.d(u,"viewlayout",function(){return ViewLayout}),{}),p=(t.r(d),t.d(d,"axisticks",function(){return AxisTicks}),t.d(d,"datajoin",function(){return DataJoin}),t.d(d,"encode",function(){return Encode}),t.d(d,"legendentries",function(){return LegendEntries}),t.d(d,"linkpath",function(){return LinkPath}),t.d(d,"pie",function(){return Pie}),t.d(d,"scale",function(){return Scale}),t.d(d,"sortitems",function(){return SortItems}),t.d(d,"stack",function(){return Stack}),{}),f=(t.r(p),t.d(p,"contour",function(){return Contour}),t.d(p,"geojson",function(){return GeoJSON}),t.d(p,"geopath",function(){return GeoPath}),t.d(p,"geopoint",function(){return GeoPoint}),t.d(p,"geoshape",function(){return GeoShape}),t.d(p,"graticule",function(){return Graticule}),t.d(p,"heatmap",function(){return Heatmap}),t.d(p,"isocontour",function(){return Isocontour}),t.d(p,"kde2d",function(){return KDE2D}),t.d(p,"projection",function(){return Projection}),{}),I=(t.r(f),t.d(f,"force",function(){return Force}),{}),C=(t.r(I),t.d(I,"nest",function(){return Nest}),t.d(I,"pack",function(){return Pack}),t.d(I,"partition",function(){return Partition}),t.d(I,"stratify",function(){return Stratify}),t.d(I,"tree",function(){return Tree}),t.d(I,"treelinks",function(){return TreeLinks}),t.d(I,"treemap",function(){return Treemap}),{}),m=(t.r(C),t.d(C,"label",function(){return Label}),{}),y=(t.r(m),t.d(m,"loess",function(){return Loess}),t.d(m,"regression",function(){return Regression}),{}),b=(t.r(y),t.d(y,"voronoi",function(){return vega_voronoi_module_Voronoi}),{}),v=(t.r(b),t.d(b,"wordcloud",function(){return Wordcloud}),{}),B=(t.r(v),t.d(v,"crossfilter",function(){return CrossFilter}),t.d(v,"resolvefilter",function(){return ResolveFilter}),t(1)),Q=t(157),O=t(111);function UniqueList(e){const n=e||B.y,r=[],i={};return r.add=e=>{var t=n(e);return i[t]||(i[t]=1,r.push(e)),r},r.remove=e=>{var t=n(e);return i[t]&&(i[t]=0)<=(t=r.indexOf(e))&&r.splice(t,1),r},r}async function asyncCallback(t,e){try{await e(t)}catch(e){t.error(e)}}const L=Symbol("vega_id");let P=1;function isTuple(e){return!(!e||!tupleid(e))}function tupleid(e){return e[L]}function setid(e,t){return e[L]=t,e}function ingest$1(e){e=e===Object(e)?e:{data:e};return tupleid(e)?e:setid(e,P++)}function vega_dataflow_module_derive(e){return rederive(e,ingest$1({}))}function rederive(e,t){for(const n in e)t[n]=e[n];return t}function replace(e,t){return setid(t,tupleid(e))}function stableCompare(n,r){return n?r?(e,t)=>n(e,t)||tupleid(r(e))-tupleid(r(t)):(e,t)=>n(e,t)||tupleid(e)-tupleid(t):null}function isChangeSet(e){return e&&e.constructor===changeset}function changeset(){const c=[],g=[],u=[],d=[],h=[];let p=null,f=!1;return{constructor:changeset,insert(e){var t=Object(B.i)(e),n=t.length;for(let e=0;e{s(e)&&(t[tupleid(e)]=-1)});for(n=0,o=c.length;n{s(e)&&00{n instanceof Operator?(n!==this&&(r&&n.targets().add(this),a.push(n)),o.push({op:n,name:e,index:t})):i.set(e,t,n)};for(n in e)if(s=e[n],"pulse"===n)Object(B.i)(s).forEach(e=>{e instanceof Operator?e!==this&&(e.targets().add(this),a.push(e)):Object(B.o)("Pulse parameters must be operator instances.")}),this.source=s;else if(Object(B.B)(s))for(i.set(n,-1,Array(A=s.length)),l=0;l{var e=Date.now();return e-n>t?(n=e,1):0})},debounce(e){const n=vega_dataflow_module_stream();return this.targets().add(vega_dataflow_module_stream(null,null,Object(B.n)(e,e=>{const t=e.dataflow;n.receive(e),t&&t.run&&t.run()}))),n},between(e,t){let n=!1;return e.targets().add(new EventStream(null,null,()=>n=!0)),t.targets().add(new EventStream(null,null,()=>n=!1)),this.filter(()=>n)},detach(){this._filter=B.ib,this._targets=null}};const j={skip:!0};function onStream(n,e,r,t,i,o){const a=Object(B.p)({},o,j);let s,A;Object(B.E)(r)||(r=Object(B.m)(r)),s=void 0===t?e=>n.touch(r(e)):Object(B.E)(t)?(A=new Operator(null,t,i,!1),e=>{A.evaluate(e);var e=r(e),t=A.value;isChangeSet(t)?n.pulse(e,t,o):n.update(e,t,a)}):e=>n.update(r(e),t,a),e.apply(s)}function onOperator(e,t,n,r,i,o){if(void 0===r)t.targets().add(n);else{const a=o||{},s=new Operator(null,function updater(n,r){return r=Object(B.E)(r)?r:Object(B.m)(r),n?function(e,t){e=r(e,t);return n.skip()||(n.skip(e!==this.value).value=e),e}:r}(n,r),i,!1);s.modified(a.force),s.rank=t.rank,t.targets().add(s),n&&(s.skip(!0),s.value=n.value,s.targets().add(n),e.connect(n,[s]))}}const Y={};function Pulse(e,t,n){this.dataflow=e,this.stamp=null==t?-1:t,this.add=[],this.rem=[],this.mod=[],this.fields=null,this.encode=n||null}function materialize(e,t){const n=[];return Object(B.kb)(e,t,e=>n.push(e)),n}function vega_dataflow_module_filter(e,t){const n={};return e.visit(t,e=>{n[tupleid(e)]=1}),e=>n[tupleid(e)]?null:e}function addFilter(n,r){return n?(e,t)=>n(e,t)&&r(e,t):r}function MultiPulse(e,t,n,r){var i=n.length;let o=0;this.dataflow=e,this.stamp=t,this.fields=null,this.encode=r||null,this.pulses=n;for(let e=0;et[e]=!0):t[e]=!0,this},modified(e,t){const n=this.fields;return!(!t&&!this.mod.length||!n)&&(arguments.length?Object(B.B)(e)?e.some(e=>n[e]):n[e]:!!n)},filter(e,t){return 1&e&&(this.addF=addFilter(this.addF,t)),2&e&&(this.remF=addFilter(this.remF,t)),4&e&&(this.modF=addFilter(this.modF,t)),16&e&&(this.srcF=addFilter(this.srcF,t)),this},materialize(e){var t=this;return 1&(e=e||7)&&t.addF&&(t.add=materialize(t.add,t.addF),t.addF=null),2&e&&t.remF&&(t.rem=materialize(t.rem,t.remF),t.remF=null),4&e&&t.modF&&(t.mod=materialize(t.mod,t.modF),t.modF=null),16&e&&t.srcF&&(t.source=t.source.filter(t.srcF),t.srcF=null),t},visit(e,t){var n=this;if(16&e)return Object(B.kb)(n.source,n.srcF,t),n;1&e&&Object(B.kb)(n.add,n.addF,t),2&e&&Object(B.kb)(n.rem,n.remF,t),4&e&&Object(B.kb)(n.mod,n.modF,t);var r=n.source;return 8&e&&r&&((e=n.add.length+n.mod.length)!==r.length&&(e?Object(B.kb)(r,vega_dataflow_module_filter(n,5),t):Object(B.kb)(r,n.srcF,t))),n}},Object(B.z)(MultiPulse,Pulse,{fork(e){const t=new Pulse(this.dataflow).init(this,e&this.NO_FIELDS);return void 0!==e&&(e&t.ADD&&this.visit(t.ADD,e=>t.add.push(e)),e&t.REM&&this.visit(t.REM,e=>t.rem.push(e)),e&t.MOD&&this.visit(t.MOD,e=>t.mod.push(e))),t},changed(e){return this.changes&e},modified(e){const t=this.fields;return t&&this.changes&this.MOD?Object(B.B)(e)?e.some(e=>t[e]):t[e]:0},filter(){Object(B.o)("MultiPulse does not support filtering.")},materialize(){Object(B.o)("MultiPulse does not support materialization.")},visit(e,t){const n=this.pulses,r=n.length;let i=0;if(e&this.SOURCE)for(;ir=[],size:()=>r.length,peek:()=>r[0],push:e=>(r.push(e),siftdown(r,0,r.length-1,n)),pop:()=>{var e=r.pop();let t;return r.length?(t=r[0],r[0]=e,function siftup(e,t,n){var r=t,i=e.length,o=e[t];let a=1+(t<<1),s;for(;a>1])<0;)e[n]=i,n=o;return e[n]=a}function Dataflow(){this.logger(Object(B.M)()),this.logLevel(B.b),this._clock=0,this._rank=0,this._locale=Object(O.a)();try{this._loader=Object(Q.e)()}catch(e){}this._touched=UniqueList(B.x),this._input={},this._pulse=null,this._heap=Heap((e,t)=>e.qrank-t.qrank),this._postrun=[]}function logMethod(e){return function(){return this._log[e].apply(this,arguments)}}function Transform(e,t){Operator.call(this,e,null,t)}Dataflow.prototype={stamp(){return this._clock},loader(e){return arguments.length?(this._loader=e,this):this._loader},locale(e){return arguments.length?(this._locale=e,this):this._locale},logger(e){return arguments.length?(this._log=e,this):this._log},error:logMethod("error"),warn:logMethod("warn"),info:logMethod("info"),debug:logMethod("debug"),logLevel:logMethod("level"),cleanThreshold:1e4,add:function vega_dataflow_module_add(e,t,n,r){let i=1,o;return o=e instanceof Operator?e:e&&e.prototype instanceof Operator?new e:Object(B.E)(e)?new Operator(null,e):(i=0,new Operator(e,t)),this.rank(o),i&&(r=n,n=t),n&&this.connect(o,o.parameters(n,r)),this.touch(o),o},connect:function connect(t,n){var r=t.rank,i=n.length;for(let e=0;et=e);return n.requests=0,n.done=()=>{0==--n.requests&&(e._pending=null,t(e))},e._pending=n}(this);return r.requests+=1,t=await this.request(t,n),this.pulse(e,this.changeset().remove(B.ib).insert(t.data||[])),r.done(),t},request:async function request(t,e){let n=0,r;try{r=await this.loader().load(t,{context:"dataflow",response:Object(Q.g)(e&&e.type)});try{r=this.parse(r,e)}catch(e){n=-2,this.warn("Data ingestion failed",t,e)}}catch(e){n=-1,this.warn("Loading failed",t,e)}return{data:r,status:n}},events:function vega_dataflow_module_events(e,t,n,r){function emb(e){e.dataflow=i;try{o.receive(e)}catch(e){i.error(e)}finally{i.run()}}const i=this,o=vega_dataflow_module_stream(n,r);let a;var s=(a="string"==typeof e&&"undefined"!=typeof document?document.querySelectorAll(e):Object(B.i)(e)).length;for(let e=0;er._enqueue(e,!0)),r._touched=UniqueList(B.x);let o=0,a,s,A;try{for(;0r._enqueue(e)),++o)}catch(e){r._heap.clear(),A=e}if(r._input={},r._pulse=null,r.debug(`Pulse ${t}: ${o} operators`),A&&(r._postrun=[],r.error(A)),r._postrun.length){var l=r._postrun.sort((e,t)=>t.priority-e.priority);r._postrun=[];for(let e=0;er.runAsync(null,()=>{e.forEach(e=>{try{e(r)}catch(e){r.error(e)}})})),r},run:function vega_dataflow_module_run(e,t,n){return this._pulse?reentrant(this):(this.evaluate(e,t,n),this)},runAsync:async function runAsync(e,t,n){for(;this._running;)await this._running;var r=()=>this._running=null;return(this._running=this.evaluate(e,t,n)).then(r,r),this._running},runAfter:function runAfter(e,t,n){if(this._pulse||t)this._postrun.push({priority:n||0,callback:e});else try{e(this)}catch(e){this.error(e)}},_enqueue:function enqueue(e,t){var n=e.stampe.pulse),t):this._input[e.id]||function singlePulse(e,t){if(t&&t.stamp===e.stamp)return t;e=e.fork(),t&&t!==Y&&(e.source=t.source);return e}(this._pulse,n&&n.pulse)}},Object(B.z)(Transform,Operator,{run(e){if(e.stampthis.pulse=e):t!==e.StopPropagation&&(this.pulse=t),t},evaluate(e){const t=this.marshall(e.stamp),n=this.transform(t,e);return t.clear(),n},transform(){}});const J={};function definition(e){e=vega_dataflow_module_transform(e);return e&&e.Definition||null}function vega_dataflow_module_transform(e){return e=e&&e.toLowerCase(),Object(B.w)(J,e)?J[e]:null}var K=t(260),X=t(468);function min_min(t,n){let r;if(void 0===n)for(const e of t)null!=e&&(r>e||void 0===r&&e>=e)&&(r=e);else{let e=-1;for(var i of t)null!=(i=n(i,++e,t))&&(r>i||void 0===r&&i>=i)&&(r=i)}return r}function swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}var q=function(e){return null===e?NaN:+e};function quantile(e,t,n){if(n=(e=Float64Array.from(function*number_numbers(t,n){if(void 0===n)for(var e of t)null!=e&&(e=+e)>=e&&(yield e);else{let e=-1;for(var r of t)null!=(r=n(r,++e,t))&&(r=+r)>=r&&(yield r)}}(e,n))).length){if((t=+t)<=0||n<2)return min_min(e);if(1<=t)return Object(X.a)(e);var n=(n-1)*t,t=Math.floor(n),r=Object(X.a)(function quickselect(n,r,i=0,o=n.length-1,a=K.a){for(;i=e&&(i=e-o,o+=i/++r,a+=i*(e-o));else{let e=-1;for(var s of t)null!=(s=n(s,++e,t))&&(s=+s)>=s&&(i=s-o,o+=i/++r,a+=i*(s-o))}if(1=e&&(yield e);else{let e=-1;for(var r of t)null!=(r=n(r,++e,t))&&""!==r&&(r=+r)>=r&&(yield r)}}function quantiles(e,t,n){const r=Float64Array.from(vega_statistics_module_numbers(e,n));return r.sort(K.a),t.map(e=>quantileSorted(r,e))}function quartiles(e,t){return quantiles(e,[.25,.5,.75],t)}function estimateBandwidth(e,t){var n=e.length,r=deviation(e,t),e=quartiles(e,t),t=(e[2]-e[0])/1.34;return 1.06*(Math.min(r,t)||r||Math.abs(e[0])||1)*Math.pow(n,-.2)}function vega_statistics_module_bin(e){var t=e.maxbins||20,n=e.base||10,r=Math.log(n),i=e.divide||[5,2];let o=e.extent[0],a=e.extent[1],s,A,l,c,g,u;var d=e.span||a-o||Math.abs(o)||1;if(e.step)s=e.step;else if(e.steps){for(c=d/t,g=0,u=e.steps.length;gt;)s*=n;for(g=0,u=i.length;g=l&&d/c<=t&&(s=c)}r=0<=(c=Math.log(s))?0:1+~~(-c/r),r=Math.pow(n,-r-1);return!e.nice&&void 0!==e.nice||(c=Math.floor(o/s+r)*s,o=oe);const i=e.length,o=new Float64Array(i);let a=0,s=1,A=r(e[0]),l=A,c=A+t,g;for(;s=c){for(l=(A+l)/2;a>1);ai;)e[a--]=e[r]}r=i,i=o}return e}(o,t+t/4):o}function lcg(e){return function(){return(e=(1103515245*e+12345)%2147483647)/2147483647}}function integer(e,t){null==t&&(t=e,e=0);let n,r,i;const o={min(e){return arguments.length?(n=e||0,i=r-n,o):n},max(e){return arguments.length?(r=e||0,i=r-n,o):r},sample(){return n+Math.floor(i*ee())},pdf(e){return e===Math.floor(e)&&e>=n&&e=r?1:(e-n+1)/i},icdf(e){return 0<=e&&e<=1?n-1+Math.floor(e*i):NaN}};return o.min(e).max(t)}const te=Math.sqrt(2*Math.PI),ne=Math.SQRT2;let re=NaN;function sampleNormal(e,t){e=e||0,t=null==t?1:t;let n=0,r=0,i,o;if(re==re)n=re,re=NaN;else{for(;n=2*ee()-1,r=2*ee()-1,0===(i=n*n+r*r)||1sampleNormal(n,r),pdf:e=>densityNormal(e,n,r),cdf:e=>cumulativeNormal(e,n,r),icdf:e=>quantileNormal(e,n,r)};return i.mean(e).stdev(t)}function vega_statistics_module_kde(r,i){const o=gaussian();let a=0;const t={data(e){return arguments.length?(r=e,a=e?e.length:0,t.bandwidth(i)):r},bandwidth(e){return arguments.length?(!(i=e)&&r&&(i=estimateBandwidth(r)),t):i},sample(){return r[~~(ee()*a)]+i*o.sample()},pdf(e){let t=0,n=0;for(;nsampleLogNormal(n,r),pdf:e=>densityLogNormal(e,n,r),cdf:e=>cumulativeLogNormal(e,n,r),icdf:e=>quantileLogNormal(e,n,r)};return i.mean(e).stdev(t)}function mixture(i,t){let o=0,a;const n={weights(e){return arguments.length?(a=function normalize(e){const t=[];let n=0,r;for(r=0;rsampleUniform(n,r),pdf:e=>densityUniform(e,n,r),cdf:e=>cumulativeUniform(e,n,r),icdf:e=>quantileUniform(e,n,r)};return null==t&&(t=null==e?1:e,e=0),i.min(e).max(t)}function ols(e,t,n,r){r-=e*e,n=Math.abs(r)<1e-24?0:(n-e*t)/r;return[t-n*e,n]}function vega_statistics_module_points(e,r,i,t){e=e.filter(e=>{let t=r(e),n=i(e);return null!=t&&(t=+t)>=t&&null!=n&&(n=+n)>=n}),t&&e.sort((e,t)=>r(e)-r(t));const n=e.length,o=new Float64Array(n),a=new Float64Array(n);let s=0,A=0,l=0,c,g,u;for(u of e)o[s]=c=+r(u),a[s]=g=+i(u),++s,A+=(c-A)/s,l+=(g-l)/s;for(s=0;s=o&&null!=a&&(a=+a)>=a&&r(o,a,++i)}function rSquared(e,t,n,r,i){let o=0,a=0;return visitPoints(e,t,n,(e,t)=>{e=t-i(e),t-=r;o+=e*e,a+=t*t}),1-o/a}function linear(e,t,n){let r=0,i=0,o=0,a=0,s=0;visitPoints(e,t,n,(e,t)=>{++s,r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s});const A=ols(r,i,o,a),l=e=>A[0]+A[1]*e;return{coef:A,predict:l,rSquared:rSquared(e,t,n,i,l)}}function log(e,t,n){let r=0,i=0,o=0,a=0,s=0;visitPoints(e,t,n,(e,t)=>{++s,e=Math.log(e),r+=(e-r)/s,i+=(t-i)/s,o+=(e*t-o)/s,a+=(e*e-a)/s});const A=ols(r,i,o,a),l=e=>A[0]+A[1]*Math.log(e);return{coef:A,predict:l,rSquared:rSquared(e,t,n,i,l)}}function exp(e,t,n){const[r,,i,o]=vega_statistics_module_points(e,t,n);let a=0,s=0,A=0,l=0,c=0,g,u,d;visitPoints(e,t,n,(e,t)=>{g=r[c++],u=Math.log(t),d=g*t,a+=(t*u-a)/c,s+=(d-s)/c,A+=(d*u-A)/c,l+=(g*d-l)/c});const[h,p]=ols(s/o,a/o,A/o,l/o),f=e=>Math.exp(h+p*(e-i));return{coef:[Math.exp(h-p*i),p],predict:f,rSquared:rSquared(e,t,n,o,f)}}function pow(e,t,n){let r=0,i=0,o=0,a=0,s=0,A=0;visitPoints(e,t,n,(e,t)=>{var e=Math.log(e),n=Math.log(t);++A,r+=(e-r)/A,i+=(n-i)/A,o+=(e*n-o)/A,a+=(e*e-a)/A,s+=(t-s)/A});const l=ols(r,i,o,a),c=e=>l[0]*Math.pow(e,l[1]);return l[0]=Math.exp(l[0]),{coef:l,predict:c,rSquared:rSquared(e,t,n,s,c)}}function vega_statistics_module_quad(e,t,n){const[r,i,o,a]=vega_statistics_module_points(e,t,n),s=r.length;let A=0,l=0,c=0,g=0,u=0,d,h,p,f;for(d=0;d(e-=o,m*e*e+y*e+B+a);return{coef:[B-y*o+m*o*o+a,y-2*m*o,m],predict:b,rSquared:rSquared(e,t,n,a,b)}}function poly(e,t,n,r){if(1===r)return linear(e,t,n);if(2===r)return vega_statistics_module_quad(e,t,n);const[i,o,a,s]=vega_statistics_module_points(e,t,n),A=i.length,l=[],c=[],g=r+1;let u,d,h,p,f;for(u=0;uMath.abs(e[r][a])&&(a=i);for(o=r;o<1+t;++o)s=e[o][r],e[o][r]=e[o][a],e[o][a]=s;for(i=r+1;i=r;o--)e[o][i]-=e[o][r]*e[r][i]/e[r][r]}for(i=t-1;0<=i;--i){for(s=0,o=i+1;o{e-=a;let t=s+I[0]+I[1]*e+I[2]*e*e;for(u=3;ua[f]-h?p:f;let t=0,n=0,r=0,i=0,o=0;var C=1/Math.abs(a[I]-h||1);for(let e=p;e<=f;++e){var m=a[e],y=s[e],B=function tricube(e){return(e=1-e*e*e)*e*e}(Math.abs(h-m)*C)*u[e],b=m*B;t+=B,n+=b,r+=y*B,i+=y*b,o+=m*b}var[I,p]=ols(n/t,r/t,i/t,o/t);c[e]=I+p*h,g[e]=Math.abs(s[e]-c[e]),!function updateInterval(e,t,n){var r=e[t];let i=n[0],o=n[1]+1;if(!(o>=e.length))for(;t>i&&e[o]-r<=r-e[i];)n[0]=++i,n[1]=o,++o}(a,e+1,d)}if(e===ie)break;var v=$(g);if(Math.abs(v)[e,t(e)],o=e[0],a=e[1],s=a-o,A=s/r,l=[i(o)],c=[];if(n===r){for(let e=1;er&&(r=o)}return 1/(r-n)}(g[1],c);u;){var p=i((g[0]+u[0])/2);p[0]-g[0]>=A&&function angleDelta(e,t,n,r,i){n=Math.atan2(i*(n[1]-e[1]),r*(n[0]-e[0])),i=Math.atan2(i*(t[1]-e[1]),r*(t[0]-e[0]));return Math.abs(n-i)}(g,p,u,d,h)>ae?c.push(p):(g=u,l.push(u),c.pop()),u=c[c.length-1]}return l}var se=function(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(i);++r{var t=i.length;let n=1,r=String(i[0](e));for(;n{};const ce={init:le,add:le,rem:le,idx:0},ge={values:{init:e=>e.cell.store=!0,value:e=>e.cell.data.values(),idx:-1},count:{value:e=>e.cell.num},__count__:{value:e=>e.missing+e.valid},missing:{value:e=>e.missing},valid:{value:e=>e.valid},sum:{init:e=>e.sum=0,value:e=>e.sum,add:(e,t)=>e.sum+=+t,rem:(e,t)=>e.sum-=t},product:{init:e=>e.product=1,value:e=>e.valid?e.product:void 0,add:(e,t)=>e.product*=t,rem:(e,t)=>e.product/=t},mean:{init:e=>e.mean=0,value:e=>e.valid?e.mean:void 0,add:(e,t)=>(e.mean_d=t-e.mean,e.mean+=e.mean_d/e.valid),rem:(e,t)=>(e.mean_d=t-e.mean,e.mean-=e.valid?e.mean_d/e.valid:e.mean)},average:{value:e=>e.valid?e.mean:void 0,req:["mean"],idx:1},variance:{init:e=>e.dev=0,value:e=>1e.dev+=e.mean_d*(t-e.mean),rem:(e,t)=>e.dev-=e.mean_d*(t-e.mean),req:["mean"],idx:1},variancep:{value:e=>1111e.cell.data.distinct(e.get),req:["values"],idx:3},ci0:{value:e=>e.cell.data.ci0(e.get),req:["values"],idx:3},ci1:{value:e=>e.cell.data.ci1(e.get),req:["values"],idx:3},median:{value:e=>e.cell.data.q2(e.get),req:["values"],idx:3},q1:{value:e=>e.cell.data.q1(e.get),req:["values"],idx:3},q3:{value:e=>e.cell.data.q3(e.get),req:["values"],idx:3},min:{init:e=>e.min=void 0,value:e=>e.min=Number.isNaN(e.min)?e.cell.data.min(e.get):e.min,add:(e,t)=>{(t{t<=e.min&&(e.min=NaN)},req:["values"],idx:4},max:{init:e=>e.max=void 0,value:e=>e.max=Number.isNaN(e.max)?e.cell.data.max(e.get):e.max,add:(e,t)=>{(t>e.max||void 0===e.max)&&(e.max=t)},rem:(e,t)=>{t>=e.max&&(e.max=NaN)},req:["values"],idx:4},argmin:{init:e=>e.argmin=void 0,value:e=>e.argmin||e.cell.data.argmin(e.get),add:(e,t,n)=>{t{t<=e.min&&(e.argmin=void 0)},req:["min","values"],idx:3},argmax:{init:e=>e.argmax=void 0,value:e=>e.argmax||e.cell.data.argmax(e.get),add:(e,t,n)=>{t>e.max&&(e.argmax=n)},rem:(e,t)=>{t>=e.max&&(e.argmax=void 0)},req:["max","values"],idx:3}},ue=Object.keys(ge);function createMeasure(e,t){return ge[e](t)}function compareIndex(e,t){return e.idx-t.idx}function vega_transforms_module_init(){this.valid=0,this.missing=0,this._ops.forEach(e=>e.init(this))}function vega_transforms_module_add(t,n){null==t||""===t?++this.missing:t==t&&(++this.valid,this._ops.forEach(e=>e.add(this,t,n)))}function vega_transforms_module_rem(t,n){null==t||""===t?--this.missing:t==t&&(--this.valid,this._ops.forEach(e=>e.rem(this,t,n)))}function vega_transforms_module_set(t){return this._out.forEach(e=>t[e.out]=e.value(this)),t}function compileMeasures(e,t){const n=t||B.y,r=function resolve(e){const t={},n=(e.forEach(e=>t[e.name]=e),e=>{e.req&&e.req.forEach(e=>{t[e]||n(t[e]=ge[e]())})});return e.forEach(n),Object.values(t).sort(compareIndex)}(e),i=e.slice().sort(compareIndex);function ctr(e){this._ops=r,this._out=i,this.cell=e,this.init()}return ctr.prototype.init=vega_transforms_module_init,ctr.prototype.add=vega_transforms_module_add,ctr.prototype.rem=vega_transforms_module_rem,ctr.prototype.set=vega_transforms_module_set,ctr.prototype.get=n,ctr.fields=e.map(e=>e.out),ctr}function TupleStore(e){this._key=e?Object(B.u)(e):tupleid,this.reset()}ue.forEach(e=>{ge[e]=function measure(t,n){return e=>Object(B.p)({name:t,out:e||t},ce,n)}(e,ge[e])});const de=TupleStore.prototype;function Aggregate(e){Transform.call(this,null,e),this._adds=[],this._mods=[],this._alen=0,this._mlen=0,this._drop=!0,this._cross=!1,this._dims=[],this._dnames=[],this._measures=[],this._countOnly=!1,this._counts=null,this._prev=null,this._inputs=null,this._outputs=null}de.reset=function(){this._add=[],this._rem=[],this._ext=null,this._get=null,this._q=null},de.add=function(e){this._add.push(e)},de.rem=function(e){this._rem.push(e)},de.values=function(){if(this._get=null,0===this._rem.length)return this._add;const e=this._add,t=this._rem,n=this._key,r=e.length,i=t.length,o=Array(r-i),a={};let s,A,l;for(s=0;sn.add(e))):(n.value=n.value||n.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),r.modifies(n._outputs),n._drop=!1!==e.drop,e.cross&&1this.clean()),n.changes(r)},cross(){const s=this,A=s.value,l=s._dnames,c=l.map(()=>({})),g=l.length;function collect(e){let t,n,r,i;for(t in e)for(r=e[t].tuple,n=0;n{var t=Object(B.h)(e);return inputVisit(e),n.push(t),t}),this.cellkey=e.key||groupkey(this._dims),this._countOnly=!0,this._counts=[],this._measures=[];const t=e.fields||[null],r=e.ops||["count"],i=e.as||[],s=t.length,A={};let l,c,g,u,d,h;for(s!==r.length&&Object(B.o)("Unmatched number of fields and aggregate ops."),h=0;hcompileMeasures(e,e.field)),{}},cellkey:groupkey(),cell(e,t){let n=this.value[e];return n?0===n.num&&this._drop&&n.stampo.push(e),remove:e=>a[r(e)]=++s,size:()=>i.length,data:(e,t)=>(s&&(i=i.filter(e=>!a[r(e)]),a={},s=0),t&&e&&i.sort(e),o.length&&(i=e?Object(B.O)(e,i,o.sort(e)):i.concat(o),o=[]),i)}}function Collect(e){Transform.call(this,[],e)}function Compare(e){Operator.call(this,null,update$5,e)}function update$5(e){return this.value&&!e.modified()?this.value:Object(B.l)(e.fields,e.orders)}function CountPattern(e){Transform.call(this,null,e)}function Cross(e){Transform.call(this,null,e)}Bin.Definition={type:"Bin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"anchor",type:"number"},{name:"maxbins",type:"number",default:20},{name:"base",type:"number",default:10},{name:"divide",type:"number",array:!0,default:[5,2]},{name:"extent",type:"number",array:!0,length:2,required:!0},{name:"span",type:"number"},{name:"step",type:"number"},{name:"steps",type:"number",array:!0},{name:"minstep",type:"number",default:0},{name:"nice",type:"boolean",default:!0},{name:"name",type:"string"},{name:"as",type:"string",array:!0,length:2,default:["bin0","bin1"]}]},Object(B.z)(Bin,Transform,{transform(e,t){const n=!1!==e.interval,r=this._bins(e),i=r.start,o=r.step,a=e.as||["bin0","bin1"],s=a[0],A=a[1];let l;return l=e.modified()?(t=t.reflow(!0)).SOURCE:t.modified(Object(B.g)(e.field))?t.ADD_MOD:t.ADD,t.visit(l,n?e=>{var t=r(e);e[s]=t,e[A]=null==t?null:i+o*(1+(t-i)/o)}:e=>e[s]=r(e)),t.modifies(n?a:s)},_bins(e){if(this.value&&!e.modified())return this.value;const n=e.field,t=vega_statistics_module_bin(e),r=t.step;let i=t.start,o=i+Math.ceil((t.stop-i)/r)*r,a,s;null!=(a=e.anchor)&&(s=a-(i+r*Math.floor((a-i)/r)),i+=s,o+=s);function $Eb(e){let t=Object(B.eb)(n(e));return null==t?null:to?1/0:(t=Math.max(i,Math.min(t,o-r)),i+r*Math.floor(1e-14+(t-i)/r))}return $Eb.start=i,$Eb.stop=t.stop,$Eb.step=r,this.value=Object(B.f)($Eb,Object(B.g)(n),e.name||"bin_"+Object(B.h)(n))}}),Collect.Definition={type:"Collect",metadata:{source:!0},params:[{name:"sort",type:"compare"}]},Object(B.z)(Collect,Transform,{transform(e,t){const n=t.fork(t.ALL),r=SortedList(tupleid,this.value,n.materialize(n.ADD).add),i=e.sort,o=t.changed()||i&&(e.modified("sort")||t.modified(i.fields));return n.visit(n.REM,r.remove),this.modified(o),this.value=n.source=r.data(stableCompare(i),o),t.source&&t.source.root&&(this.value.root=t.source.root),n}}),Object(B.z)(Compare,Operator),CountPattern.Definition={type:"CountPattern",metadata:{generates:!0,changes:!0},params:[{name:"field",type:"field",required:!0},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:!0,length:2,default:["text","count"]}]},Object(B.z)(CountPattern,Transform,{transform(a,e){var t=o=>e=>{for(var t,n=function tokenize(e,t,n){switch(t){case"upper":e=e.toUpperCase();break;case"lower":e=e.toLowerCase()}return e.match(n)}(l(e),a.case,s)||[],r=0,i=n.length;rr[e]=1+(r[e]||0)),c=t(e=>--r[e]);return n?e.visit(e.SOURCE,o):(e.visit(e.ADD,o),e.visit(e.REM,c)),this._finish(e,i)},_parameterCheck(e,t){let n=!1;return!e.modified("stopwords")&&this._stop||(this._stop=new RegExp("^"+(e.stopwords||"")+"$","i"),n=!0),!e.modified("pattern")&&this._match||(this._match=new RegExp(e.pattern||"[\\w']+","g"),n=!0),(n=e.modified("field")||t.modified(e.field.fields)?!0:n)&&(this._counts={}),n},_finish(e,t){const n=this._counts,r=this._tuples||(this._tuples={}),i=t[0],o=t[1],a=e.fork(e.NO_SOURCE|e.NO_FIELDS);let s,A,l;for(s in n)A=r[s],l=n[s]||0,!A&&l?(r[s]=A=ingest$1({}),A[i]=s,A[o]=l,a.add.push(A)):0===l?(A&&a.rem.push(A),n[s]=null,r[s]=null):A[o]!==l&&(A[o]=l,a.mod.push(A));return a.modifies(t)}}),Cross.Definition={type:"Cross",metadata:{generates:!0},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:!0,length:2,default:["a","b"]}]},Object(B.z)(Cross,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.as||["a","b"],i=r[0],o=r[1],a=!this.value||t.changed(t.ADD_REM)||e.modified("as")||e.modified("filter");let s=this.value;return a?(s&&(n.rem=s),s=t.materialize(t.SOURCE).source,n.add=this.value=function cross(e,t,n,r){for(var i,o,a=[],s={},A=e.length,l=0;ln[t]||Object(B.h)(e)):null}function partition$1(e,t,n){const r=[],i=e=>e(A);let o,a,s,A,l,c;if(null==t)r.push(e.map(n));else for(o={},a=0,s=e.length;avega_transforms_module_parse(e,t))):"function"==typeof r[i]&&r[i](e[i]);return r}(t.distribution,function vega_transforms_module_source(e){return()=>e.materialize(e.SOURCE).source}(n)),o=t.steps||t.minsteps||25,a=t.steps||t.maxsteps||200;let e=t.method||"pdf";"pdf"!==e&&"cdf"!==e&&Object(B.o)("Invalid density method: "+e),t.extent||i.data||Object(B.o)("Missing density extent parameter."),e=i[e];const s=t.as||["value","density"],A=t.extent||Object(B.q)(i.data()),l=sampleCurve(e,A,o,a).map(e=>{const t={};return t[s[0]]=e[0],t[s[1]]=e[1],ingest$1(t)});this.value&&(r.rem=this.value),this.value=r.add=r.source=l}return r}});function DotBin(e){Transform.call(this,null,e)}DotBin.Definition={type:"DotBin",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"step",type:"number"},{name:"smooth",type:"boolean",default:!1},{name:"as",type:"string",default:"bin"}]};function Expression(e){Operator.call(this,null,update$4,e),this.modified(!0)}function update$4(t){const n=t.expr;return this.value&&!t.modified("expr")?this.value:Object(B.f)(e=>n(e,t),Object(B.g)(n),Object(B.h)(n))}function Extent(e){Transform.call(this,[void 0,void 0],e)}function Subflow(e,t){Operator.call(this,e),this.parent=t,this.count=0}function Facet(e){Transform.call(this,{},e),this._keys=Object(B.t)();const r=this._targets=[];r.active=0,r.forEach=n=>{for(let e=0,t=r.active;eObject(B.u)(e)):Object(B.u)(e.name,e.as)}function Filter(e){Transform.call(this,Object(B.t)(),e)}function Flatten(e){Transform.call(this,[],e)}function Fold(e){Transform.call(this,[],e)}function Formula(e){Transform.call(this,null,e)}function Generate(e){Transform.call(this,[],e)}Object(B.z)(DotBin,Transform,{transform(e,t){if(this.value&&!e.modified()&&!t.changed())return t;const n=t.materialize(t.SOURCE).source,r=partition$1(t.source,e.groupby,B.y),i=e.smooth||!1,o=e.field,a=e.step||(c=n,g=o,Object(B.Z)(Object(B.q)(c,g))/30),s=stableCompare((e,t)=>o(e)-o(t)),A=e.as||"bin",l=r.length;var c,g;let u=1/0,d=-1/0,h=0,p;for(;hd&&(d=I),f[++p][A]=I}return this.value={start:u,stop:d,step:a},t.reflow(!0).modifies(A)}}),Object(B.z)(Expression,Operator),Extent.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:!0}]},Object(B.z)(Extent,Transform,{transform(e,t){const n=this.value,r=e.field,i=t.changed()||t.modified(r.fields)||e.modified("field");let o=n[0],a=n[1];if(!i&&null!=o||(o=1/0,a=-1/0),t.visit(i?t.SOURCE:t.ADD,e=>{e=Object(B.eb)(r(e));null!=e&&(ea&&(a=e))}),!Number.isFinite(o)||!Number.isFinite(a)){let e=Object(B.h)(r);e=e&&` for field "${e}"`,t.dataflow.warn(`Infinite extent${e}: [${o}, ${a}]`),o=a=void 0}this.value=[o,a]}}),Object(B.z)(Subflow,Operator,{connect(e){return this.detachSubflow=e.detachSubflow,this.targets().add(e),e.source=this},add(e){this.count+=1,this.value.add.push(e)},rem(e){--this.count,this.value.rem.push(e)},mod(e){this.value.mod.push(e)},init(e){this.value.init(e,e.NO_SOURCE)},evaluate(){return this.value}}),Object(B.z)(Facet,Transform,{activate(e){this._targets[this._targets.active++]=e},subflow(e,t,n,r){const i=this.value;let o=Object(B.w)(i,e)&&i[e],a,s;return o?o.value.stampe&&0this.subflow(e,r,t);return this._group=e.group||{},this.initTargets(),t.visit(t.REM,e=>{var t=tupleid(e),n=o.get(t);void 0!==n&&(o.delete(t),s(n).rem(e))}),t.visit(t.ADD,e=>{var t=i(e);o.set(tupleid(e),t),s(t).add(e)}),a||t.modified(i.fields)?t.visit(t.MOD,e=>{var t=tupleid(e),n=o.get(t),r=i(e);n===r?s(r).mod(e):(o.set(t,r),s(n).rem(e),s(r).add(e))}):t.changed(t.MOD)&&t.visit(t.MOD,e=>{s(o.get(tupleid(e))).mod(e)}),a&&t.visit(t.REFLOW,e=>{var t=tupleid(e),n=o.get(t),r=i(e);n!==r&&(o.set(t,r),s(n).rem(e),s(r).add(e))}),t.clean()?n.runAfter(()=>{this.clean(),o.clean()}):o.empty>n.cleanThreshold&&n.runAfter(o.clean),t}}),Object(B.z)(Field,Operator),Filter.Definition={type:"Filter",metadata:{changes:!0},params:[{name:"expr",type:"expr",required:!0}]},Object(B.z)(Filter,Transform,{transform(i,e){const t=e.dataflow,o=this.value,n=e.fork(),a=n.add,s=n.rem,A=n.mod,l=i.expr;let c=!0;function revisit(e){var t=tupleid(e),n=l(e,i),r=o.get(t);n&&r?(o.delete(t),a.push(e)):n||r?c&&n&&!r&&A.push(e):(o.set(t,1),s.push(e))}return e.visit(e.REM,e=>{var t=tupleid(e);o.has(t)?o.delete(t):s.push(e)}),e.visit(e.ADD,e=>{l(e,i)?a.push(e):o.set(tupleid(e),1)}),e.visit(e.MOD,revisit),i.modified()&&(c=!1,e.visit(e.REFLOW,revisit)),o.empty>t.cleanThreshold&&t.runAfter(o.clean),n}}),Flatten.Definition={type:"Flatten",metadata:{generates:!0},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"index",type:"string"},{name:"as",type:"string",array:!0}]},Object(B.z)(Flatten,Transform,{transform(e,t){const s=t.fork(t.NO_SOURCE),A=e.fields,l=fieldNames(A,e.as||[]),c=e.index||null,g=l.length;return s.rem=this.value,t.visit(t.SOURCE,t=>{const e=A.map(e=>e(t)),n=e.reduce((e,t)=>Math.max(e,t.length),0);let r=0,i,o,a;for(;r{for(let e=0,t;ee[r]=n(e,t))}}),Object(B.z)(Generate,Transform,{transform(e,t){const n=t.fork(t.ALL),r=e.generator;let i=this.value,o=e.size-i.length,a,s,A;if(0=e&&(++r,i+=e);else{let e=-1;for(var o of t)null!=(o=n(o,++e,t))&&(o=+o)>=o&&(++r,i+=o)}if(r)return i/r},min:min_min,max:X.a},Ie=[];function Impute(e){Transform.call(this,[],e)}function JoinAggregate(e){Aggregate.call(this,e)}function KDE(e){Transform.call(this,null,e)}function Key(e){Operator.call(this,null,update$2,e)}function update$2(e){return this.value&&!e.modified()?this.value:Object(B.K)(e.fields,e.flat)}function Load(e){Transform.call(this,[],e),this._pending=null}function vega_transforms_module_output(e,t,n){n.forEach(ingest$1);const r=t.fork(t.NO_FIELDS&t.NO_SOURCE);return r.rem=e.value,e.value=r.source=r.add=n,e._pending=null,r.rem.length&&r.clean(!0),r}function Lookup(e){Transform.call(this,{},e)}function MultiExtent(e){Operator.call(this,null,update$1,e)}function update$1(e){if(this.value&&!e.modified())return this.value;var t=e.extents,n=t.length;let r=1/0,i=-1/0,o,a;for(o=0;oi&&(i=a[1]);return[r,i]}function MultiValues(e){Operator.call(this,null,vega_transforms_module_update,e)}function vega_transforms_module_update(e){return this.value&&!e.modified()?this.value:e.values.reduce((e,t)=>e.concat(t),[])}function Params(e){Transform.call(this,null,e)}function Pivot(e){Aggregate.call(this,e)}function PreFacet(e){Facet.call(this,e)}function Project(e){Transform.call(this,null,e)}function Proxy(e){Transform.call(this,null,e)}function Quantile(e){Transform.call(this,null,e)}Impute.Definition={type:"Impute",metadata:{changes:!0},params:[{name:"field",type:"field",required:!0},{name:"key",type:"field",required:!0},{name:"keyvals",array:!0},{name:"groupby",type:"field",array:!0},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]},Object(B.z)(Impute,Transform,{transform(e,t){for(var n,r,i,o,a,s,A,l,c=t.fork(t.ALL),g=function getValue(e){var t,n=e.method||fe.value;if(null!=fe[n])return n===fe.value?(t=void 0!==e.value?e.value:0,()=>t):fe[n];Object(B.o)("Unrecognized imputation method: "+n)}(e),u=function getField(e){const t=e.field;return e=>e?t(e):NaN}(e),d=Object(B.h)(e.field),h=Object(B.h)(e.key),p=(e.groupby||[]).map(B.h),f=function vega_transforms_module_partition(e,t,n,r){var i,o,a,s,A,l,c,g=e=>e(c),u=[],d=r?r.slice():[],h={},p={};for(d.forEach((e,t)=>h[e]=t+1),s=0,l=e.length;sn.add(e))):(i=n.value=n.value||this.init(e),t.visit(t.REM,e=>n.rem(e)),t.visit(t.ADD,e=>n.add(e))),n.changes(),t.visit(t.SOURCE,e=>{Object(B.p)(e,i[n.cellkey(e)].tuple)}),t.reflow(r).modifies(this._outputs)},changes(){const e=this._adds,t=this._mods;let n,r;for(n=0,r=this._alen;n{const e=vega_statistics_module_kde(n,l)[c],r=s.counts?n.length:1,t=i||Object(B.q)(n);sampleCurve(e,t,o,a).forEach(e=>{const t={};for(let e=0;e(this._pending=Object(B.i)(e.data),e=>e.touch(this)))}:n.request(e.url,e.format).then(e=>vega_transforms_module_output(this,t,Object(B.i)(e.data)))}}),Lookup.Definition={type:"Lookup",metadata:{modifies:!0},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:!0},{name:"key",type:"field",required:!0}]},{name:"values",type:"field",array:!0},{name:"fields",type:"field",array:!0,required:!0},{name:"as",type:"string",array:!0},{name:"default",default:null}]},Object(B.z)(Lookup,Transform,{transform(e,t){const o=e.fields,a=e.index,s=e.values,A=null==e.default?null:e.default,n=e.modified(),l=o.length;let r=n?t.SOURCE:t.ADD,i=t,c=e.as,g,u,d;return g=s?(u=s.length,1t.modified(e.fields)),r|=d?t.MOD:0),t.visit(r,g),i.modifies(c)}}),Object(B.z)(MultiExtent,Operator),Object(B.z)(MultiValues,Operator),Object(B.z)(Params,Transform,{transform(e,t){return this.modified(e.modified()),this.value=e,t.fork(t.NO_SOURCE|t.NO_FIELDS)}}),Pivot.Definition={type:"Pivot",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"value",type:"field",required:!0},{name:"op",type:"enum",values:ue,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]},Object(B.z)(Pivot,Aggregate,{_transform:Aggregate.prototype.transform,transform(e,t){return this._transform(function aggregateParams(e,t){const n=e.field,r=e.value,i=("count"===e.op?"__count__":e.op)||"sum",o=Object(B.g)(n).concat(Object(B.g)(r)),a=function pivotKeys(t,e,n){const r={},i=[];return n.visit(n.SOURCE,e=>{e=t(e);r[e]||(r[e]=1,i.push(e))}),i.sort(B.j),e?i.slice(0,e):i}(n,e.limit||0,t);t.changed()&&e.set("__pivot__",null,null,!0);return{key:e.key,groupby:e.groupby,ops:a.map(()=>i),fields:a.map(e=>function vega_transforms_module_get(t,n,r,e){return Object(B.f)(e=>n(e)===t?r(e):NaN,e,t+"")}(e,n,r,o)),as:a.map(e=>e+""),modified:e.modified.bind(e)}}(e,t),t)}}),Object(B.z)(PreFacet,Facet,{transform(e,t){const n=e.subflow,r=e.field,i=e=>this.subflow(tupleid(e),n,t,e);return(e.modified("field")||r&&t.modified(Object(B.g)(r)))&&Object(B.o)("PreFacet does not support field modification."),this.initTargets(),r?(t.visit(t.MOD,e=>{const t=i(e);r(e).forEach(e=>t.mod(e))}),t.visit(t.ADD,e=>{const t=i(e);r(e).forEach(e=>t.add(ingest$1(e)))}),t.visit(t.REM,e=>{const t=i(e);r(e).forEach(e=>t.rem(e))})):(t.visit(t.MOD,e=>i(e).mod(e)),t.visit(t.ADD,e=>i(e).add(e)),t.visit(t.REM,e=>i(e).rem(e))),t.clean()&&t.runAfter(()=>this.clean()),t}}),Project.Definition={type:"Project",metadata:{generates:!0,changes:!0},params:[{name:"fields",type:"field",array:!0},{name:"as",type:"string",null:!0,array:!0}]},Object(B.z)(Project,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE),r=e.fields,i=fieldNames(e.fields,e.as||[]),o=r?(e,t)=>function vega_transforms_module_project(n,r,i,o){for(let e=0,t=i.length;e{e=tupleid(e);n.rem.push(a[e]),a[e]=null}),t.visit(t.ADD,e=>{var t=o(e,ingest$1({}));a[tupleid(e)]=t,n.add.push(t)}),t.visit(t.MOD,e=>{n.mod.push(o(e,a[tupleid(e)]))}),n}}),Object(B.z)(Proxy,Transform,{transform(e,t){return this.value=e.value,e.modified("value")?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}}),Quantile.Definition={type:"Quantile",metadata:{generates:!0,changes:!0},params:[{name:"groupby",type:"field",array:!0},{name:"field",type:"field",required:!0},{name:"probs",type:"number",array:!0},{name:"step",type:"number",default:.01},{name:"as",type:"string",array:!0,default:["prob","value"]}]};function Relay(e){Transform.call(this,null,e)}function Sample(e){Transform.call(this,[],e),this.count=0}function Sequence(e){Transform.call(this,null,e)}function Sieve(e){Transform.call(this,null,e),this.modified(!0)}function TimeUnit(e){Transform.call(this,null,e)}Object(B.z)(Quantile,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.as||["prob","value"];if(this.value&&!e.modified()&&!t.changed())return n.source=this.value,n;const r=t.materialize(t.SOURCE).source,o=partition$1(r,e.groupby,e.field),a=(e.groupby||[]).map(B.h),s=[],A=e.step||.01,l=e.probs||se(A/2,1-1e-14,A),c=l.length;return o.forEach(t=>{var n=quantiles(t,l);for(let e=0;e{e=tupleid(e);r.rem.push(i[e]),i[e]=null}),t.visit(t.ADD,e=>{var t=vega_dataflow_module_derive(e);i[tupleid(e)]=t,r.add.push(t)}),t.visit(t.MOD,e=>{const t=i[tupleid(e)];for(const n in e)t[n]=e[n],r.modifies(n);r.mod.push(t)})),r}}),Sample.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]},Object(B.z)(Sample,Transform,{transform(e,t){const r=t.fork(t.NO_SOURCE),n=e.modified("size"),i=e.size,o=this.value.reduce((e,t)=>(e[tupleid(t)]=1,e),{});let a=this.value,s=this.count,A=0;function update(e){var t,n;a.length=A&&(t=a[n],o[tupleid(t)]&&r.rem.push(t),a[n]=e),++s}if(t.rem.length&&(t.visit(t.REM,e=>{var t=tupleid(e);o[t]&&(o[t]=-1,r.rem.push(e)),--s}),a=a.filter(e=>-1!==o[tupleid(e)])),(t.rem.length||n)&&a.length{o[tupleid(e)]||update(e)}),A=-1),n&&a.length>i){var l=a.length-i;for(let e=0;e{o[tupleid(e)]&&r.mod.push(e)}),t.add.length&&t.visit(t.ADD,update),(t.add.length||A<0)&&(r.add=a.filter(e=>!o[tupleid(e)])),this.count=s,this.value=r.source=a,r}}),Sequence.Definition={type:"Sequence",metadata:{generates:!0,changes:!0},params:[{name:"start",type:"number",required:!0},{name:"stop",type:"number",required:!0},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]},Object(B.z)(Sequence,Transform,{transform(e,t){if(!this.value||e.modified()){const n=t.materialize().fork(t.MOD),r=e.as||"data";return n.rem=this.value?t.rem.concat(this.value):t.rem,this.value=se(e.start,e.stop,e.step||1).map(e=>{const t={};return t[r]=e,ingest$1(t)}),n.add=t.add.concat(this.value),n}}}),Object(B.z)(Sieve,Transform,{transform(e,t){return this.value=t.source,t.changed()?t.fork(t.NO_SOURCE|t.NO_FIELDS):t.StopPropagation}});const Ce=["unit0","unit1"];function TupleIndex(e){Transform.call(this,Object(B.t)(),e)}function Values(e){Transform.call(this,null,e)}TimeUnit.Definition={type:"TimeUnit",metadata:{modifies:!0},params:[{name:"field",type:"field",required:!0},{name:"interval",type:"boolean",default:!0},{name:"units",type:"enum",values:h.j,array:!0},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:!0},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:!0,length:2,default:Ce}]},Object(B.z)(TimeUnit,Transform,{transform(e,t){const i=e.field,o=!1!==e.interval,n="utc"===e.timezone,a=this._floor(e,t),s=(n?h.v:h.p)(a.unit).offset,r=e.as||Ce,A=r[0],l=r[1],c=a.step;let g=a.start||1/0,u=a.stop||-1/0,d=t.ADD;return(e.modified()||t.modified(Object(B.g)(i)))&&(t=t.reflow(!0),d=t.SOURCE,g=1/0,u=-1/0),t.visit(d,e=>{var t=i(e);let n,r;null==t?(e[A]=null,o&&(e[l]=null)):(e[A]=n=r=a(t),o&&(e[l]=r=s(n,c)),nu&&(u=r))}),a.start=g,a.stop=u,t.modifies(o?r:A)},_floor(e,t){var n="utc"===e.timezone,{units:t,step:e}=e.units?{units:e.units,step:e.step||1}:Object(h.n)({extent:e.extent||Object(B.q)(t.materialize(t.SOURCE).source,e.field),maxbins:e.maxbins});const r=Object(h.t)(t),i=this.value||{},o=(n?h.u:h.o)(r,e);return o.unit=Object(B.W)(r),o.units=r,o.step=e,o.start=i.start,o.stop=i.stop,this.value=o}}),Object(B.z)(TupleIndex,Transform,{transform(e,t){const n=t.dataflow,r=e.field,i=this.value,o=e=>i.set(r(e),e);let a=!0;return e.modified("field")||t.modified(r.fields)?(i.clear(),t.visit(t.SOURCE,o)):t.changed()?(t.visit(t.REM,e=>i.delete(r(e))),t.visit(t.ADD,o)):a=!1,this.modified(a),i.empty>n.cleanThreshold&&n.runAfter(i.clean),t.fork()}}),Object(B.z)(Values,Transform,{transform(e,t){(!this.value||e.modified("field")||e.modified("sort")||t.changed()||e.sort&&t.modified(e.sort.fields))&&(this.value=(e.sort?t.source.slice().sort(stableCompare(e.sort)):t.source).map(e.field))}});const me={row_number:function(){return{next:e=>e.index+1}},rank:function(){let r;return{init:()=>r=1,next:e=>{var t=e.index,n=e.data;return t&&e.compare(n[t-1],n[t])?r=t+1:r}}},dense_rank:function(){let r;return{init:()=>r=1,next:e=>{var t=e.index,n=e.data;return t&&e.compare(n[t-1],n[t])?++r:r}}},percent_rank:function(){const e=me.rank(),t=e.next;return{init:e.init,next:e=>(t(e)-1)/(e.data.length-1)}},cume_dist:function(){let i;return{init:()=>i=0,next:e=>{const t=e.data,n=e.compare;let r=e.index;if(iMath.ceil(t*r(e))}},lag:function(n,r){return r=+r||1,{next:e=>{var t=e.index-r;return 0<=t?n(e.data[t]):null}}},lead:function(n,r){return r=+r||1,{next:e=>{var t=e.index+r,e=e.data;return tt(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(n,r){return 0<(r=+r)||Object(B.o)("nth_value nth must be greater than zero."),{next:e=>{var t=e.i0+(r-1);return tn=null,next:e=>{e=t(e.data[e.index]);return null!=e?n=e:n}}},next_value:function(n){let r,i;return{init:()=>(r=null,i=-1),next:e=>{var t=e.data;return e.index<=i?r:r=(i=function find(e,t,n){for(var r=t.length;nn[e]=1)}visitInputs(e.sort),t.forEach((t,e)=>{var n=o[e],r=Object(B.h)(n),i=measureName(t,r,s[e]);if(visitInputs(n),A.push(i),Object(B.w)(me,t))l.push(function WindowOp(e,t,n,r){const i=me[e](t,n);return{init:i.init||B.mb,update:function(e,t){t[r]=i.next(e)}}}(t,o[e],a[e],i));else if(null==n&&"count"!==t&&Object(B.o)("Null aggregate field specified."),"count"===t)g.push(i);else{d=!1;let e=c[r];e||((e=c[r]=[]).field=n,u.push(e)),e.push(createMeasure(t,i))}}),(g.length||u.length)&&(this.cell=function cell(e,r,i){e=e.map(e=>compileMeasures(e,e.field));const o={num:0,agg:null,store:!1,count:r};if(!i)for(var n=e.length,a=o.agg=Array(n),t=0;te.init()),this.cell&&this.cell.init()},Be.update=function(e,t){const n=this.cell,r=this.windows,i=e.data,o=r&&r.length;let a;if(n){for(a=e.p0;athis.group(i(e));let a=this.state;a&&!t||(a=this.state=new WindowState(n)),t||e.modified(a.inputs)?(this.value={},e.visit(e.SOURCE,e=>o(e).add(e))):(e.visit(e.REM,e=>o(e).remove(e)),e.visit(e.ADD,e=>o(e).add(e)));for(let e=0,t=this._mlen;eDe&&(r=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,i=3*e._l01_a*(e._l01_a+e._l12_a),o=(o*r-e._x0*e._l12_2a+e._x2*e._l01_2a)/i,a=(a*r-e._y0*e._l12_2a+e._y2*e._l01_2a)/i),e._l23_a>De&&(r=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,i=3*e._l23_a*(e._l23_a+e._l12_a),s=(s*r+e._x1*e._l23_2a-t*e._l12_2a)/i,A=(A*r+e._y1*e._l23_2a-n*e._l12_2a)/i),e._context.bezierCurveTo(o,a,s,A,e._x2,e._y2)}function CatmullRom(e,t){this._context=e,this._alpha=t}CatmullRom.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n,r;switch(e=+e,t=+t,this._point&&(n=this._x2-e,r=this._y2-t,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var n=function custom(t){function catmullRom(e){return t?new CatmullRom(e,t):new Cardinal(e,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function CatmullRomClosed(e,t){this._context=e,this._alpha=t}CatmullRomClosed.prototype={areaStart:LY0,areaEnd:LY0,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x3,this._y3),this._context.closePath();break;case 2:this._context.lineTo(this._x3,this._y3),this._context.closePath();break;case 3:this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5)}},point:function(e,t){var n,r;switch(e=+e,t=+t,this._point&&(n=this._x2-e,r=this._y2-t,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Te=function custom(t){function catmullRom(e){return t?new CatmullRomClosed(e,t):new CardinalClosed(e,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function CatmullRomOpen(e,t){this._context=e,this._alpha=t}CatmullRomOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n,r;switch(e=+e,t=+t,this._point&&(n=this._x2-e,r=this._y2-t,this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))),this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3,this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:catmullRom_point(this,e,t)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};var Me=function custom(t){function catmullRom(e){return t?new CatmullRomOpen(e,t):new CardinalOpen(e,0)}return catmullRom.alpha=function(e){return custom(+e)},catmullRom}(.5);function Linear(e){this._context=e}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}};var Ue=function(e){return new Linear(e)};function LinearClosed(e){this._context=e}LinearClosed.prototype={areaStart:LY0,areaEnd:LY0,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function slope3(e,t,n){var r=e._x1-e._x0,t=t-e._x1,i=(e._y1-e._y0)/(r||t<0&&-0),n=(n-e._y1)/(t||r<0&&-0),e=(i*t+n*r)/(r+t);return((i<0?-1:1)+(n<0?-1:1))*Math.min(Math.abs(i),Math.abs(n),.5*Math.abs(e))||0}function slope2(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function monotone_point(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function MonotoneX(e){this._context=e}function MonotoneY(e){this._context=new ReflectContext(e)}function ReflectContext(e){this._context=e}function Natural(e){this._context=e}function controlPoints(e){var t,n,r=e.length-1,i=new Array(r),o=new Array(r),a=new Array(r);for(o[i[0]=0]=2,a[0]=e[0]+2*e[1],t=1;tPe?this._+="A"+n+","+n+",0,1,"+c+","+(e-a)+","+(t-s)+"A"+n+","+n+",0,1,"+c+","+(this._x1=A)+","+(this._y1=l):1e-6=Oe)+","+c+","+(this._x1=e+n*Math.cos(i))+","+(this._y1=t+n*Math.sin(i))))},rect:function(e,t,n,r){this._+="M"+(this._x0=this._x1=+e)+","+(this._y0=this._y1=+t)+"h"+ +n+"v"+ +r+"h"+-n+"Z"},toString:function(){return this._}};var Ve=path_path,i=function(e){return function constant(){return e}};function arcInnerRadius(e){return e.innerRadius}function arcOuterRadius(e){return e.outerRadius}function arcStartAngle(e){return e.startAngle}function arcEndAngle(e){return e.endAngle}function arcPadAngle(e){return e&&e.padAngle}function cornerTangents(e,t,n,r,i,o,a){var s=e-n,A=t-r,a=(a?o:-o)/Fe(s*s+A*A),A=a*A,a=-a*s,s=e+A,e=t+a,t=n+A,n=r+a,r=(s+t)/2,l=(e+n)/2,c=t-s,g=n-e,u=c*c+g*g,o=i-o,s=s*n-t*e,n=(g<0?-1:1)*Fe(_e(0,o*o*u-s*s)),t=(s*g-c*n)/u,e=(-s*c-g*n)/u,d=(s*g+c*n)/u,s=(-s*c+g*n)/u,c=t-r,g=e-l,n=d-r,u=s-l;return n*n+u*u>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?rgba(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?rgba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=rt.exec(e))?new Rgb(t[1],t[2],t[3],1):(t=it.exec(e))?new Rgb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=ot.exec(e))?rgba(t[1],t[2],t[3],t[4]):(t=at.exec(e))?rgba(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=st.exec(e))?hsla(t[1],t[2]/100,t[3]/100,1):(t=At.exec(e))?hsla(t[1],t[2]/100,t[3]/100,t[4]):lt.hasOwnProperty(e)?rgbn(lt[e]):"transparent"===e?new Rgb(NaN,NaN,NaN,0):null}function rgbn(e){return new Rgb(e>>16&255,e>>8&255,255&e,1)}function rgba(e,t,n,r){return new Rgb(e=r<=0?t=n=NaN:e,t,n,r)}function rgbConvert(e){return(e=e instanceof Color?e:color_color(e))?new Rgb((e=e.rgb()).r,e.g,e.b,e.opacity):new Rgb}function color_rgb(e,t,n,r){return 1===arguments.length?rgbConvert(e):new Rgb(e,t,n,null==r?1:r)}function Rgb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function rgb_formatHex(){return"#"+hex(this.r)+hex(this.g)+hex(this.b)}function rgb_formatRgb(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function hex(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function hsla(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||1<=n?e=t=NaN:t<=0&&(e=NaN),new Hsl(e,t,n,r)}function hslConvert(e){if(e instanceof Hsl)return new Hsl(e.h,e.s,e.l,e.opacity);if(!(e=e instanceof Color?e:color_color(e)))return new Hsl;if(e instanceof Hsl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,A=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(no&&(i=r.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(t=t[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,A.push({i:a,x:ht(t,n)})),o=It.lastIndex;return oe).right(A,r);if(i===A.length)return s.every(Object(Ke.c)(e/bt.g,t/bt.g,n));if(0===i)return vt.a.every(Math.max(Object(Ke.c)(e,t,n),1));const[o,a]=A[r/A[i-1][2]()=>e;function src_color_linear(t,n){return function(e){return t+e*n}}function src_color_hue(e,t){var n=t-e;return n?src_color_linear(e,180o&&(i=r.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(t=t[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,A.push({i:a,x:Xt(t,n)})),o=en.lastIndex;return oi+a*e);return c(t?o.reverse():o)}return delete t.unknown,t.domain=function(e){return arguments.length?(l(e),rescale()):l()},t.range=function(e){return arguments.length?(g=[+e[0],+e[1]],rescale()):g.slice()},t.rangeRound=function(e){return g=[+e[0],+e[1]],s=!0,rescale()},t.bandwidth=function(){return u},t.step=function(){return a},t.round=function(e){return arguments.length?(s=!!e,rescale()):s},t.padding=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),A=d,rescale()):A},t.paddingInner=function(e){return arguments.length?(A=Math.max(0,Math.min(1,e)),rescale()):A},t.paddingOuter=function(e){return arguments.length?(d=Math.max(0,Math.min(1,e)),rescale()):d},t.align=function(e){return arguments.length?(h=Math.max(0,Math.min(1,e)),rescale()):h},t.invertRange=function(o){if(null!=o[0]&&null!=o[1]){var a=g[1]g[1-a])))return n=Math.max(0,je(s,e)-1),r=e===t?n:je(s,t)-1,e-s[n]>u+1e-10&&++n,a&&(i=n,n=A-r,r=A-i),n>r?void 0:l().slice(n,r+1)}},t.invert=function(e){e=t.invertRange([e,e]);return e&&e[0]},t.copy=function(){return vega_scale_module_band().domain(l()).range(g).round(s).paddingInner(A).paddingOuter(d).align(h)},rescale()}var nr=Array.prototype.map;const rr=Array.prototype.slice;const ir={};function vega_scale_module_create(t,n,e){var r=function scale(){const e=n();return e.invertRange||(e.invertRange=e.invert?function invertRange(i){return function(e){let t=e[0],n=e[1],r;return n=n&&t[s]<=r&&(i<0&&(i=s),o=s);if(!(i<0))return n=l.invertExtent(t[i]),r=l.invertExtent(t[o]),[void 0===n[0]?n[1]:n[0],void 0===r[1]?r[0]:r[1]]}}(e):void 0),e.type=t,e};return r.metadata=Object(B.fb)(Object(B.i)(e)),r}function vega_scale_module_scale(e,t,n){return 1t[e]?a[e](t[e]()):0),a):Object(B.m)(.5)}function vega_scale_module_interpolate(e,t){const n=r[function vega_scale_module_method(e){return"interpolate"+e.toLowerCase().split("-").map(e=>e[0].toUpperCase()+e.slice(1)).join("")}(e)];return null!=t&&n&&n.gamma?n.gamma(t):n}function vega_scale_module_colors(t){const n=t.length/6|0,r=new Array(n);for(let e=0;einterpolateColors(vega_scale_module_colors(e)));const sr="symbol",Ar=e=>Object(B.B)(e)?e.map(e=>String(e)):String(e),lr=(e,t)=>e[1]-t[1],cr=(e,t)=>t[1]-e[1];function tickCount(e,t,n){let r;return Object(B.G)(t)&&(e.bins&&(t=Math.max(t,e.bins.length)),null!=n&&(t=Math.min(t,Math.floor(Object(B.Z)(e.domain())/n||1)))),Object(B.H)(t)&&(r=t.step,t=t.interval),Object(B.J)(t)&&(t=e.type===Ln?Object(h.p)(t):e.type==Pn?Object(h.v)(t):Object(B.o)("Only time and utc scales accept interval strings."),r&&(t=t.every(r))),t}function validTicks(t,e,n){let r=t.range(),i=r[0],o=Object(B.W)(r),a=lr;if(i>o&&(r=o,o=i,i=r,a=cr),i=Math.floor(i),o=Math.ceil(o),e=e.map(e=>[e,t(e)]).filter(e=>i<=e[1]&&e[1]<=o).sort(a).map(e=>e[0]),0n&&3<=e.length;)e=e.filter((e,t)=>!(t%2));e.length<3&&(e=s)}return e}function tickValues(e,t){return e.bins?validTicks(e,e.bins):e.ticks?e.ticks(t):e.domain()}function vega_scale_module_tickFormat(e,t,n,r,i,o){var a=t.type;let s=Ar;if(a===Ln||i===Ln)s=e.timeFormat(r);else if(a===Pn||i===Pn)s=e.utcFormat(r);else if(isLogarithmic(a)){const A=e.formatFloat(r);if(o||t.bins)s=A;else{const l=tickLog(t,n,!1);s=e=>l(e)?A(e):""}}else t.tickFormat?(i=t.domain(),s=e.formatSpan(i[0],i[i.length-1],n,r)):r&&(s=e.format(r));return s}function tickLog(e,t,n){const r=tickValues(e,t),i=e.base(),o=Math.log(i),a=Math.max(1,i*t/r.length);e=e=>{let t=e/Math.pow(i,Math.round(Math.log(e)/o));return t*i{t=dr(n[t+1],dr(n.max,1/0)),n=hr(e,l),e=hr(t,l);return n&&e?n+" – "+e:e?"< "+e:"≥ "+n}):"discrete"===r?(A=e,(e,t)=>t?A(e):null):(s=e,e=>s(e))}const dr=(e,t)=>null!=e?e:t,hr=(e,t)=>Number.isFinite(e)?t(e):null;function vega_scale_module_format(e,t,n,r){var i=r||t.type;return(n=Object(B.J)(n)&&function isTemporal(e){return hasType(e,tr)}(i)?n.replace(/%a/g,"%A").replace(/%b/g,"%B"):n)||i!==Ln?n||i!==Pn?labelFormat(e,t,5,null,n,r,!0):e.utcFormat("%A, %d %B %Y, %X UTC"):e.timeFormat("%A, %d %B %Y, %X")}function domainCaption(e,t,n){n=n||{};const r=Math.max(3,n.maxlen||7),i=vega_scale_module_format(e,t,n.format,n.formatType);if(isDiscretizing(t.type)){const o=labelValues(t).slice(1).map(i),a=o.length;return"".concat(a," boundar").concat(1===a?"y":"ies",": ").concat(o.join(", "))}if(isDiscrete(t.type)){const s=t.domain(),A=s.length,l=rs){const g=i.length;for(l=1,t.push([a].concat(i.slice(l,l+=s))),a="M"===a?"L":"m"===a?"l":a;l+e}function vega_scenegraph_module_clamp(e,t,n){return Math.max(t,Math.min(e,n))}function vg_rect(){var c=rectangleX,g=rectangleY,u=rectangleWidth,d=rectangleHeight,h=vega_scenegraph_module_number(0),p=h,f=h,I=h,C=null;function rectangle(e,t,n){var r,t=null!=t?t:+c.call(this,e),n=null!=n?n:+g.call(this,e),i=+u.call(this,e),o=+d.call(this,e),a=Math.min(i,o)/2,s=vega_scenegraph_module_clamp(+h.call(this,e),0,a),A=vega_scenegraph_module_clamp(+p.call(this,e),0,a),l=vega_scenegraph_module_clamp(+f.call(this,e),0,a),e=vega_scenegraph_module_clamp(+I.call(this,e),0,a);if(C=C||(r=Ve()),s<=0&&A<=0&&l<=0&&e<=0?C.rect(t,n,i,o):(a=t+i,i=n+o,C.moveTo(t+s,n),C.lineTo(a-A,n),C.bezierCurveTo(a-Rr*A,n,a,n+Rr*A,a,n+A),C.lineTo(a,i-e),C.bezierCurveTo(a,i-Rr*e,a-Rr*e,i,a-e,i),C.lineTo(t+l,i),C.bezierCurveTo(t+Rr*l,i,t,i-Rr*l,t,i-l),C.lineTo(t,n+s),C.bezierCurveTo(t,n+Rr*s,t+Rr*s,n,t+s,n),C.closePath()),r)return C=null,r+""||null}return rectangle.x=function(e){return arguments.length?(c=vega_scenegraph_module_number(e),rectangle):c},rectangle.y=function(e){return arguments.length?(g=vega_scenegraph_module_number(e),rectangle):g},rectangle.width=function(e){return arguments.length?(u=vega_scenegraph_module_number(e),rectangle):u},rectangle.height=function(e){return arguments.length?(d=vega_scenegraph_module_number(e),rectangle):d},rectangle.cornerRadius=function(e,t,n,r){return arguments.length?(h=vega_scenegraph_module_number(e),p=null!=t?vega_scenegraph_module_number(t):h,I=null!=n?vega_scenegraph_module_number(n):h,f=null!=r?vega_scenegraph_module_number(r):p,rectangle):h},rectangle.context=function(e){return arguments.length?(C=null==e?null:e,rectangle):C},rectangle}function vg_trail(){var a,s,A,l,c,g,u,d,h=null;function trail(e){var t,n,r,i=e.length,o=!1;for(null==h&&(h=r=Ve()),t=0;t<=i;++t)!(te.x||0,o=e=>e.y||0,q=e=>!(!1===e.defined);Nr=arcInnerRadius,kr=arcOuterRadius,Tr=i(0),Ur=arcStartAngle,Or=arcEndAngle,Lr=arcPadAngle,_=Mr=null,arc.centroid=function(){var e=(+Nr.apply(this,arguments)+ +kr.apply(this,arguments))/2,t=(+Ur.apply(this,arguments)+ +Or.apply(this,arguments))/2-Ge/2;return[Se(t)*e,Re(t)*e]},arc.innerRadius=function(e){return arguments.length?(Nr="function"==typeof e?e:i(+e),arc):Nr},arc.outerRadius=function(e){return arguments.length?(kr="function"==typeof e?e:i(+e),arc):kr},arc.cornerRadius=function(e){return arguments.length?(Tr="function"==typeof e?e:i(+e),arc):Tr},arc.padRadius=function(e){return arguments.length?(Mr=null==e?null:"function"==typeof e?e:i(+e),arc):Mr},arc.startAngle=function(e){return arguments.length?(Ur="function"==typeof e?e:i(+e),arc):Ur},arc.endAngle=function(e){return arguments.length?(Or="function"==typeof e?e:i(+e),arc):Or},arc.padAngle=function(e){return arguments.length?(Lr="function"==typeof e?e:i(+e),arc):Lr},arc.context=function(e){return arguments.length?(_=null==e?null:e,arc):_};const Pr=arc.startAngle(e=>e.startAngle||0).endAngle(e=>e.endAngle||0).padAngle(e=>e.padAngle||0).innerRadius(e=>e.innerRadius||0).outerRadius(e=>e.outerRadius||0).cornerRadius(e=>e.cornerRadius||0),Vr=sZ0().x(He).y1(o).y0(e=>(e.y||0)+(e.height||0)).defined(q),Zr=sZ0().y(o).x1(He).x0(e=>(e.x||0)+(e.width||0)).defined(q),Wr=rZ0().x(He).y(o).defined(q),Hr=vg_rect().x(He).y(o).width(e=>e.width||0).height(e=>e.height||0).cornerRadius(e=>value$1(e.cornerRadiusTopLeft,e.cornerRadius)||0,e=>value$1(e.cornerRadiusTopRight,e.cornerRadius)||0,e=>value$1(e.cornerRadiusBottomRight,e.cornerRadius)||0,e=>value$1(e.cornerRadiusBottomLeft,e.cornerRadius)||0),jr=(Gr=null,Fr="function"==typeof Fr?Fr:i(Fr||We),Dr="function"==typeof Dr?Dr:i(void 0===Dr?64:+Dr),symbol.type=function(e){return arguments.length?(Fr="function"==typeof e?e:i(e),symbol):Fr},symbol.size=function(e){return arguments.length?(Dr="function"==typeof e?e:i(+e),symbol):Dr},symbol.context=function(e){return arguments.length?(Gr=null==e?null:e,symbol):Gr},symbol.type(e=>vega_scenegraph_module_symbols(e.shape||"circle")).size(e=>value$1(e.size,64))),Yr=vg_trail().x(He).y(o).defined(q).size(e=>e.size||1);function symbol(){var e;if(Gr=Gr||(e=Ve()),Fr.apply(this,arguments).draw(Gr,+Dr.apply(this,arguments)),e)return Gr=null,e+""||null}function arc(){var e,t,n,r,i,o,a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b=+Nr.apply(this,arguments),v=+kr.apply(this,arguments),E=Ur.apply(this,arguments)-Ne,Q=Or.apply(this,arguments)-Ne,w=Qe(Q-E),S=EDe?(r+=g*=S?1:-1,i-=g):(o=0,r=i=(E+Q)/2),(a-=2*u)>De?(t+=u*=S?1:-1,n-=u):(a=0,t=n=(E+Q)/2)),c=v*Se(t),g=v*Re(t),u=b*Se(i),E=b*Re(i),Dethis.x2&&(this.x2=e),t>this.y2&&(this.y2=t),this},expand(e){return this.x1-=e,this.y1-=e,this.x2+=e,this.y2+=e,this},round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this},scale(e){return this.x1*=e,this.y1*=e,this.x2*=e,this.y2*=e,this},translate(e,t){return this.x1+=e,this.x2+=e,this.y1+=t,this.y2+=t,this},rotate(e,t,n){e=this.rotatedPoints(e,t,n);return this.clear().add(e[0],e[1]).add(e[2],e[3]).add(e[4],e[5]).add(e[6],e[7])},rotatedPoints(e,t,n){var{x1:r,y1:i,x2:o,y2:a}=this,s=Math.cos(e),e=Math.sin(e),A=t-t*s+n*e,t=n-t*e-n*s;return[s*r-e*i+A,e*r+s*i+t,s*r-e*a+A,e*r+s*a+t,s*o-e*i+A,e*o+s*i+t,s*o-e*a+A,e*o+s*a+t]},union(e){return e.x1this.x2&&(this.x2=e.x2),e.y2>this.y2&&(this.y2=e.y2),this},intersect(e){return e.x1>this.x1&&(this.x1=e.x1),e.y1>this.y1&&(this.y1=e.y1),e.x2=e.x2&&this.y1<=e.y1&&this.y2>=e.y2},alignsWith(e){return e&&(this.x1==e.x1||this.x2==e.x2||this.y1==e.y1||this.y2==e.y2)},intersects(e){return e&&!(this.x2e.x2||this.y2e.y2)},contains(e,t){return!(ethis.x2||tthis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}},Object(B.z)(GroupItem,Item),ResourceLoader.prototype={pending(){return this._pending},sanitizeURL(e){const t=this;return increment(t),t._loader.sanitize(e,{context:"href"}).then(e=>(decrement(t),e)).catch(()=>(decrement(t),null))},loadImage(e){const r=this,i="undefined"!=typeof Image?Image:null;return increment(r),r._loader.sanitize(e,{context:"image"}).then(e=>{var t=e.href;if(!t||!i)throw{url:t};const n=new i;e=Object(B.w)(e,"crossOrigin")?e.crossOrigin:"anonymous";return null!=e&&(n.crossOrigin=e),n.onload=()=>decrement(r),n.onerror=()=>decrement(r),n.src=t,n}).catch(e=>(decrement(r),{complete:!1,width:0,height:0,src:e&&e.url||""}))},ready(){const n=this;return new Promise(t=>{!function poll(e){n.pending()?setTimeout(()=>{poll(!0)},10):t(e)}(!1)})}};const Jr=Br-1e-8;let Kr,Xr,qr,$r,ei,ti,ni,ri;const ii=(e,t)=>Kr.add(e,t),oi=(e,t)=>ii(Xr=e,qr=t),ai=e=>ii(e,Kr.y1),si=e=>ii(Kr.x1,e),Ai=(e,t)=>ei*e+ni*t,li=(e,t)=>ti*e+ri*t,ci=(e,t)=>ii(Ai(e,t),li(e,t)),gi=(e,t)=>oi(Ai(e,t),li(e,t));function boundContext(e,t){return Kr=e,t?($r=t*mr,ei=ri=Math.cos($r),ti=Math.sin($r),ni=-ti):(ei=ri=1,$r=ti=ni=0),ui}const ui={beginPath(){},closePath(){},moveTo:gi,lineTo:gi,rect(e,t,n,r){$r?(ci(e+n,t),ci(e+n,t+r),ci(e,t+r),gi(e,t)):(ii(e+n,t+r),oi(e,t))},quadraticCurveTo(e,t,n,r){var i=Ai(e,t),e=li(e,t),t=Ai(n,r),n=li(n,r);quadExtrema(Xr,i,t,ai),quadExtrema(qr,e,n,si),oi(t,n)},bezierCurveTo(e,t,n,r,i,o){var a=Ai(e,t),e=li(e,t),t=Ai(n,r),n=li(n,r),r=Ai(i,o),i=li(i,o);cubicExtrema(Xr,a,t,r,ai),cubicExtrema(qr,e,n,i,si),oi(r,i)},arc(n,r,i,o,a,s){if(o+=$r,a+=$r,Xr=i*Math.cos(a)+n,qr=i*Math.sin(a)+r,Math.abs(a-o)>Jr)ii(n-i,r-i),ii(n+i,r+i);else{var A=e=>ii(i*Math.cos(e)+n,i*Math.sin(e)+r);let e,t;if(A(o),A(a),a!==o)if((o%=Br)<0&&(o+=Br),(a%=Br)<0&&(a+=Br),aa;++t,e-=yr)A(e);else for(e=o-o%yr+yr,t=0;t<4&&eu)return!1;p>g&&(g=p)}else if(0{n&&!n.intersects(e.bounds)||drawPath(r,t,e,e)})}}function drawPath(e,t,n,r){var i=null==n.opacity?1:n.opacity;0===i||e(t,r)||(blend(t,n),n.fill&&fill(t,n,i)&&t.fill(),n.stroke&&stroke(t,n,i)&&t.stroke())}function pick$1(s){return s=s||B.ib,function(n,e,r,i,o,a){return r*=n.pixelRatio,i*=n.pixelRatio,pickVisit(e,e=>{const t=e.bounds;if((!t||t.contains(o,a))&&t)return s(n,e,r,i,o,a)?e:void 0})}}function hitPath(A,l){return function(e,t,n,r){var i,o=Array.isArray(t)?t[0]:t,a=null==l?o.fill:l,s=o.stroke&&e.isPointInStroke;return s&&(i=o.strokeWidth,o=o.strokeCap,e.lineWidth=null!=i?i:1,e.lineCap=null!=o?o:"butt"),!A(e,t)&&(a&&e.isPointInPath(n,r)||s&&e.isPointInStroke(n,r))}}function pickPath(e){return pick$1(hitPath(e))}function translateItem(e){return"translate("+(e.x||0)+","+(e.y||0)+")"}function transformItem(e){return"translate("+(e.x||0)+","+(e.y||0)+")"+(e.angle?" rotate("+e.angle+")":"")+(e.scaleX||e.scaleY?" "+function vega_scenegraph_module_scale(e,t){return"scale("+e+","+t+")"}(e.scaleX||1,e.scaleY||1):"")}function markItemPath(e,o,t){function draw(e,t){var n=t.x||0,r=t.y||0,i=t.angle||0;e.translate(n,r),i&&e.rotate(i*=mr),e.beginPath(),o(e,t),i&&e.rotate(-i),e.translate(-n,-r)}return{type:e,tag:"path",nested:!1,attr:function attr(e,t){e("transform",function rotateItem(e){return"translate("+(e.x||0)+","+(e.y||0)+")"+(e.angle?" rotate("+e.angle+")":"")}(t)),e("d",o(null,t))},bound:function bound(e,t){return o(boundContext(e,t.angle),t),boundStroke(e,t).translate(t.x||0,t.y||0)},draw:drawAll(draw),pick:pickPath(draw),isect:t||intersectPath(draw)}}le=markItemPath("arc",function arc$1(e,t){return Pr.context(e)(t)});function markMultiItemPath(e,n,t){function draw(e,t){e.beginPath(),n(e,t)}const s=hitPath(draw);return{type:e,tag:"path",nested:!0,attr:function attr(e,t){(t=t.mark.items).length&&e("d",n(null,t))},bound:function bound(e,t){return 0===(t=t.items).length?e:(n(boundContext(e),t),boundStroke(e,t[0]))},draw:function drawOne(r){return function(e,t,n){!t.items.length||n&&!n.intersects(t.bounds)||drawPath(r,e,t.items[0],t.items)}}(draw),pick:function pick(e,t,n,r,i,o){var a=t.items,t=t.bounds;return!a||!a.length||t&&!t.contains(i,o)?null:(n*=e.pixelRatio,r*=e.pixelRatio,s(e,a,n,r)?a[0]:null)},isect:intersectPoint,tip:t}}be=markMultiItemPath("area",function area$1(e,t){var n=t[0],r=n.interpolate||"linear";return("horizontal"===n.orient?Zr:Vr).curve(curves(r,n.orient,n.tension)).context(e)(t)},function pickArea(e,t){for(var n,r,i="horizontal"===e[0].orient?t[1]:t[0],o="horizontal"===e[0].orient?"y":"x",a=e.length,s=1/0;0<=--a;)!1!==e[a].defined&&(r=Math.abs(e[a][o]-i)){var t=e.x||0,n=e.y||0,r=e.strokeForeground,i=null==e.opacity?1:e.opacity;(e.stroke||e.fill)&&i&&(rectanglePath(o,e,t,n),blend(o,e),e.fill&&fill(o,e,i)&&o.fill(),e.stroke&&!r&&stroke(o,e,i)&&o.stroke()),o.save(),o.translate(t,n),e.clip&&clipGroup(o,e),a&&a.translate(-t,-n),vega_scenegraph_module_visit(e,e=>{this.draw(o,e,a)}),a&&a.translate(t,n),o.restore(),r&&e.stroke&&i&&(rectanglePath(o,e,t,n),blend(o,e),stroke(o,e,i)&&o.stroke())})},pick:function pick(A,l,c,g,u,d){if(l.bounds&&!l.bounds.contains(u,d)||!l.items)return null;const h=c*A.pixelRatio,p=g*A.pixelRatio;return pickVisit(l,e=>{let t,n,r;const i=e.bounds;if(!i||i.contains(u,d)){n=e.x||0,r=e.y||0;var o=n+(e.width||0),a=r+(e.height||0),s=e.clip;if(!s||!(ufunction pickMark(e,t,n){return(!1!==e.interactive||"group"===e.marktype)&&e.bounds&&e.bounds.contains(t,n)}(e,n,r)?this.pick(e,c,g,n,r):null))&&a&&(e.fill||!o&&e.stroke)&&fi(A,e,h,p)&&(t=e),A.restore(),t||null)}}})},isect:intersectRect,content:function content(e,t,n){e("clip-path",t.clip?clip$1(n,t,t):null)},background:function background(e,t){e("class","background"),e("aria-hidden",!0),emitRectangle(e,t)},foreground:function foreground(e,t){e("class","foreground"),e("aria-hidden",!0),t.strokeForeground?emitRectangle(e,t):e("d","")}},mi={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function getImage(t,e){var n=t.image;return(!n||t.url&&t.url!==n.url)&&(n={complete:!1,width:0,height:0},e.loadImage(t.url).then(e=>{t.image=e,t.image.url=t.url})),n}function imageWidth(e,t){return null!=e.width?e.width:t&&t.width?!1!==e.aspect&&e.height?e.height*t.width/t.height:t.width:0}function imageHeight(e,t){return null!=e.height?e.height:t&&t.height?!1!==e.aspect&&e.width?e.width*t.height/t.width:t.height:0}function imageXOffset(e,t){return"center"===e?t/2:"right"===e?t:0}function imageYOffset(e,t){return"middle"===e?t/2:"bottom"===e?t:0}Ee={type:"image",tag:"image",nested:!1,attr:function attr$4(e,t,n){const r=getImage(t,n),i=imageWidth(t,r),o=imageHeight(t,r),a=(t.x||0)-imageXOffset(t.align,i),s=(t.y||0)-imageYOffset(t.baseline,o),A=!r.src&&r.toDataURL?r.toDataURL():r.src||"";e("href",A,mi["xmlns:xlink"],"xlink:href"),e("transform","translate("+a+","+s+")"),e("width",i),e("height",o),e("preserveAspectRatio",!1===t.aspect?"none":"xMidYMid")},bound:function bound$4(e,t){var n=t.image,r=imageWidth(t,n),n=imageHeight(t,n),i=(t.x||0)-imageXOffset(t.align,r),t=(t.y||0)-imageYOffset(t.baseline,n);return e.set(i,t,i+r,t+n)},draw:function draw$3(c,e,t){vega_scenegraph_module_visit(e,A=>{if(!t||t.intersects(A.bounds)){var l=getImage(A,this);let a=imageWidth(A,l),s=imageHeight(A,l);if(0!==a&&0!==s){let e=(A.x||0)-imageXOffset(A.align,a),t=(A.y||0)-imageYOffset(A.baseline,s),n,r,i,o;!1!==A.aspect&&(r=l.width/l.height,i=A.width/A.height,r==r&&i==i&&r!=i&&(i{var t;r&&!r.intersects(e.bounds)||(t=null==e.opacity?1:e.opacity)&&vega_scenegraph_module_path(n,e,t)&&(blend(n,e),n.stroke())})},pick:pick$1(function hit$1(e,t,n,r){return!!e.isPointInStroke&&(vega_scenegraph_module_path(e,t,1)&&e.isPointInStroke(n,r))}),isect:intersectRule},He=markItemPath("shape",function shape$1(e,t){return(t.mark.shape||t.shape).context(e)(t)}),o=markItemPath("symbol",function symbol$1(e,t){return jr.context(e)(t)},intersectPoint);const yi=Object(B.N)();var Bi={height:vega_scenegraph_module_fontSize,measureWidth:measureWidth,estimateWidth:estimateWidth,width:estimateWidth,canvas:useCanvas};function useCanvas(e){Bi.width=e&&di?measureWidth:estimateWidth}function estimateWidth(e,t){return _estimateWidth(textValue(e,t),vega_scenegraph_module_fontSize(e))}function _estimateWidth(e,t){return~~(.8*e.length*t)}function measureWidth(e,t){return vega_scenegraph_module_fontSize(e)<=0||!(t=textValue(e,t))?0:_measureWidth(t,vega_scenegraph_module_font(e))}function _measureWidth(e,t){var n=`(${t}) `+e;let r=yi.get(n);return void 0===r&&(di.font=t,r=di.measureText(e).width,yi.set(n,r)),r}function vega_scenegraph_module_fontSize(e){return null!=e.fontSize?+e.fontSize||0:11}function lineHeight(e){return null!=e.lineHeight?e.lineHeight:vega_scenegraph_module_fontSize(e)+2}function textLines(e){return function lineArray(e){return!Object(B.B)(e)||1_measureWidth(e,t)}{const n=vega_scenegraph_module_fontSize(e);return e=>_estimateWidth(e,n)}}}(e);if(r(t)>>1,r(t.slice(i))>n?a=i+1:s=i;return o+t.slice(a)}for(;a>>1),r(t.slice(0,i))Math.max(e,Bi.width(n,t)),0)):Bi.width(n,l);if("center"===i?s-=l/2:"right"===i&&(s-=l),e.set(s+=a,A+=o,s+l,A+r),n.angle&&!t)e.rotate(n.angle*mr,a,o);else if(2===t)return e.rotatedPoints(n.angle*mr,a,o);return e}var Ei={arc:le,area:be,group:ve,image:Ee,line:n,path:Te,rect:Me,rule:We,shape:He,symbol:o,text:{type:"text",tag:"text",nested:!1,attr:function attr(e,t){var n,r=t.dx||0,i=(t.dy||0)+vega_scenegraph_module_offset(t),o=(a=anchorPoint(t)).x1,a=a.y1,s=t.angle||0;e("text-anchor",bi[t.align]||"start"),s?(n="translate("+o+","+a+") rotate("+s+")",(r||i)&&(n+=" translate("+r+","+i+")")):n="translate("+(o+r)+","+(a+i)+")",e("transform",n)},bound:vega_scenegraph_module_bound,draw:function draw(l,e,c){vega_scenegraph_module_visit(e,e=>{var t,n,r,i,o,a,s,A=null==e.opacity?1:e.opacity;if(!(c&&!c.intersects(e.bounds)||0===A||e.fontSize<=0||null==e.text||0===e.text.length)){if(l.font=vega_scenegraph_module_font(e),l.textAlign=e.align||"left",n=(t=anchorPoint(e)).x1,r=t.y1,e.angle&&(l.save(),l.translate(n,r),l.rotate(e.angle*mr),n=r=0),n+=e.dx||0,r+=(e.dy||0)+vega_scenegraph_module_offset(e),a=textLines(e),blend(l,e),Object(B.B)(a))for(o=lineHeight(e),i=0;i{const t=new MouseEvent(i.type,i),n=domCreate(null,"a");for(const r in e)n.setAttribute(r,e[r]);n.dispatchEvent(t)}).catch(()=>{})},handleTooltip(e,t,n){t&&null!=t.tooltip&&(t=function resolveItem(e,t,n,r){var i,o,a=e&&e.mark;if(a&&(i=Ei[a.marktype]).tip){for((o=vega_scenegraph_module_point(t,n))[0]-=r[0],o[1]-=r[1];e=e.mark.group;)o[0]-=e.x||0,o[1]-=e.y||0;e=i.tip(a.items,o)}return e}(t,e,this.canvas(),this._origin),n=n&&t&&t.tooltip||null,this._tooltip.call(this._obj,this,e,t,n))},getItemBoundingClientRect(n){const r=this.canvas();if(r){const i=r.getBoundingClientRect(),o=this._origin,a=n.bounds,s=a.width(),A=a.height();let e=a.x1+o[0]+i.left,t=a.y1+o[1]+i.top;for(;n.mark&&(n=n.mark.group);)e+=n.x||0,t+=n.y||0;return{x:e,y:t,width:s,height:A,left:e,top:t,right:e+s,bottom:t+A}}}},vega_scenegraph_module_Renderer.prototype={initialize(e,t,n,r,i){return this._el=e,this.resize(t,n,r,i)},element(){return this._el},canvas(){return this._el&&this._el.firstChild},background(e){return 0===arguments.length?this._bgcolor:(this._bgcolor=e,this)},resize(e,t,n,r){return this._width=e,this._height=t,this._origin=n||[0,0],this._scale=r||1,this},dirty(){},render(e){const t=this;return t._call=function(){t._render(e)},t._call(),t._call=null,t},_render(){},renderAsync(e){const t=this.render(e);return this._ready?this._ready.then(()=>t):Promise.resolve(t)},_load(e,t){var n=this,e=n._loader[e](t);if(!n._ready){const r=n._call;n._ready=n._loader.ready().then(e=>{e&&r(),n._ready=null})}return e},sanitizeURL(e){return this._load("sanitizeURL",e)},loadImage(e){return this._load("loadImage",e)}};const Si="dragleave";const _i="mousedown";const xi="mousemove",Ri="mouseout";const Fi="click";const Di="mousewheel",Gi="touchstart",Ni="touchmove",ki="touchend";q=["keydown","keypress","keyup","dragenter",Si,"dragover",_i,"mouseup",xi,Ri,"mouseover",Fi,"dblclick","wheel",Di,Gi,Ni,ki];const Ti=xi,Mi=Ri;Fi;function CanvasHandler(e,t){vega_scenegraph_module_Handler.call(this,e,t),this._down=null,this._touch=null,this._first=!0,this._events={}}function eventListenerCheck(t,e){((e=e)===Gi||e===Ni||e===ki?[Gi,Ni,ki]:[e]).forEach(e=>function addEventListener(t,n){const e=t.canvas();e&&!t._events[n]&&(t._events[n]=1,e.addEventListener(n,t[n]?e=>t[n](e):e=>t.fire(n,e)))}(t,e))}function move(r,i,o){return function(e){var t=this._active,n=this.pickEvent(e);n!==t&&(t&&t.exit||this.fire(o,e),this._active=n,this.fire(i,e)),this.fire(r,e)}}function inactive(t){return function(e){this.fire(t,e),this._active=null}}Object(B.z)(CanvasHandler,vega_scenegraph_module_Handler,{initialize(e,t,n){return this._canvas=e&&domFind(e,"canvas"),[Fi,_i,xi,Ri,Si].forEach(e=>eventListenerCheck(this,e)),vega_scenegraph_module_Handler.prototype.initialize.call(this,e,t,n)},canvas(){return this._canvas},context(){return this._canvas.getContext("2d")},events:q,DOMMouseScroll(e){this.fire(Di,e)},mousemove:move(xi,"mouseover",Ri),dragover:move("dragover","dragenter",Si),mouseout:inactive(Ri),dragleave:inactive(Si),mousedown(e){this._down=this._active,this.fire(_i,e)},click(e){this._down===this._active&&(this.fire(Fi,e),this._down=null)},touchstart(e){this._touch=this.pickEvent(e.changedTouches[0]),this._first&&(this._active=this._touch,this._first=!1),this.fire(Gi,e,!0)},touchmove(e){this.fire(Ni,e,!0)},touchend(e){this.fire(ki,e,!0),this._touch=null},fire(e,n,t){const r=t?this._touch:this._active,i=this._handlers[e];if("click"===(n.vegaType=e)&&r&&r.href?this.handleHref(n,r,r.href):e!==Ti&&e!==Mi||this.handleTooltip(n,r,e!==Mi),i)for(let e=0,t=i.length;e{t&&t.href&&n.handleHref(e,t,t.href)}),n._tooltipHandler=Li(n,(e,t)=>{n.handleTooltip(e,t,e.type!==Mi)})}Object(B.z)(CanvasRenderer,vega_scenegraph_module_Renderer,{initialize(e,t,n,r,i,o){return this._options=o||{},this._canvas=this._options.externalContext?null:domCanvas(1,1,this._options.type),e&&this._canvas&&(domClear(e,0).appendChild(this._canvas),this._canvas.setAttribute("class","marks")),Oi.initialize.call(this,e,t,n,r,i)},resize(e,t,n,r){if(Oi.resize.call(this,e,t,n,r),this._canvas)!function resize(e,t,n,r,i,o){const a="undefined"!=typeof HTMLElement&&e instanceof HTMLElement&&null!=e.parentNode,s=e.getContext("2d"),A=a?Ui:i;e.width=t*A,e.height=n*A;for(const l in o)s[l]=o[l];a&&1!==A&&(e.style.width=t+"px",e.style.height=n+"px"),s.pixelRatio=A,s.setTransform(A,0,0,A,A*r[0],A*r[1])}(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context);else{const i=this._options.externalContext;i||Object(B.o)("CanvasRenderer is missing a valid canvas or context"),i.scale(this._scale,this._scale),i.translate(this._origin[0],this._origin[1])}return this._redraw=!0,this},canvas(){return this._canvas},context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)},dirty(e){const t=this._tempb.clear().union(e.bounds);let n=e.mark.group;for(;n;)t.translate(n.x||0,n.y||0),n=n.mark.group;this._dirty.union(t)},_render(e){const t=this.context(),n=this._origin,r=this._width,i=this._height,o=this._dirty,a=(s=n,l=r,A=i,(new Bounds).set(0,0,l,A).translate(-s[0],-s[1]));t.save();var s,A,l=this._redraw||o.empty()?(this._redraw=!1,a.expand(1)):function clipToBounds(e,t,n){return t.expand(1).round(),e.pixelRatio%1&&t.scale(e.pixelRatio).round().scale(1/e.pixelRatio),t.translate(-n[0]%1,-n[1]%1),e.beginPath(),e.rect(t.x1,t.y1,t.width(),t.height()),e.clip(),t}(t,a.intersect(o),n);return this.clear(-n[0],-n[1],r,i),this.draw(t,e,l),t.restore(),o.clear(),this},draw(e,t,n){const r=Ei[t.marktype];t.clip&&!function vega_scenegraph_module_clip(e,t){var n=t.clip;e.save(),Object(B.E)(n)?(e.beginPath(),n(e),e.clip()):clipGroup(e,t.group)}(e,t),r.draw.call(this,e,t,n),t.clip&&e.restore()},clear(e,t,n,r){const i=this._options,o=this.context();"pdf"===i.type||i.externalContext||o.clearRect(e,t,n,r),null!=this._bgcolor&&(o.fillStyle=this._bgcolor,o.fillRect(e,t,n,r))}});const Li=(n,r)=>e=>{let t=e.target.__data__;t=Array.isArray(t)?t[0]:t,e.vegaType=e.type,r.call(n._obj,e,t)},Pi=(Object(B.z)(SVGHandler,vega_scenegraph_module_Handler,{initialize(e,t,n){let r=this._svg;return r&&(r.removeEventListener("click",this._hrefHandler),r.removeEventListener(Ti,this._tooltipHandler),r.removeEventListener(Mi,this._tooltipHandler)),this._svg=r=e&&domFind(e,"svg"),r&&(r.addEventListener("click",this._hrefHandler),r.addEventListener(Ti,this._tooltipHandler),r.addEventListener(Mi,this._tooltipHandler)),vega_scenegraph_module_Handler.prototype.initialize.call(this,e,t,n)},canvas(){return this._svg},on(e,t){const n=this.eventName(e),r=this._handlers,i=this._handlerIndex(r[n],e,t);return i<0&&(e={type:e,handler:t,listener:Li(this,t)},(r[n]||(r[n]=[])).push(e),this._svg&&this._svg.addEventListener(n,e.listener)),this},off(e,t){const n=this.eventName(e),r=this._handlers[n],i=this._handlerIndex(r,e,t);return 0<=i&&(this._svg&&this._svg.removeEventListener(n,r[i].listener),r.splice(i,1)),this}}),"aria-hidden"),Vi="aria-label",Zi="aria-roledescription",Wi="graphics-object",Hi="graphics-symbol",ji=(e,t,n)=>({role:e,"aria-roledescription":t,"aria-label":n||void 0}),Yi=Object(B.fb)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]),zi={axis:{desc:"axis",caption:function axisCaption(e){const t=e.datum,n=e.orient,r=t.title?extractTitle(e):null,i=e.context,o=i.scales[t.scale].value,a=i.dataflow.locale(),s=o.type,A="left"===n||"right"===n?"Y":"X";return A+"-axis"+(r?` titled '${r}'`:"")+` for a ${isDiscrete(s)?"discrete":s} scale`+" with "+domainCaption(a,o,e)}},legend:{desc:"legend",caption:function legendCaption(e){const t=e.datum,n=t.title?extractTitle(e):null,r=`${t.type||""} legend`.trim(),i=t.scales,o=Object.keys(i),a=e.context,s=a.scales[i[o[0]]].value,A=a.dataflow.locale();return function capitalize(e){return e.length?e[0].toUpperCase()+e.slice(1):e}(r)+(n?` titled '${n}'`:"")+" for "+function channelCaption(e){return(e=e.map(e=>e+("fill"===e||"stroke"===e?" color":""))).length<2?e[0]:e.slice(0,-1).join(", ")+" and "+Object(B.W)(e)}(o)+" with "+domainCaption(A,s,e)}},"title-text":{desc:"title",caption:e=>`Title text '${titleCaption(e)}'`},"title-subtitle":{desc:"subtitle",caption:e=>`Subtitle text '${titleCaption(e)}'`}},Ji={ariaRole:"role",ariaRoleDescription:Zi,description:Vi};function ariaItemAttributes(e,t){var n=!1===t.aria;if(e(Pi,n||void 0),n||null==t.description)for(const r in Ji)e(Ji[r],void 0);else{n=t.mark.marktype;e(Vi,t.description),e("role",t.ariaRole||("group"===n?Wi:Hi)),e(Zi,t.ariaRoleDescription||n+" mark")}}function ariaMarkAttributes(e){return!1===e.aria?{"aria-hidden":!0}:Yi[e.role]?null:zi[e.role]?function ariaGuide(e,t){try{const n=e.items[0],r=t.caption||(()=>"");return ji(t.role||Hi,t.desc,n.description||r(n))}catch(e){return null}}(e,zi[e.role]):function ariaMark(e){var t=e.marktype,n="group"===t||"text"===t||e.items.some(e=>null!=e.description&&!1!==e.aria);return ji(n?Wi:Hi,t+" mark container",e.description)}(e)}function titleCaption(e){return Object(B.i)(e.text).join(" ")}function extractTitle(e){try{return Object(B.i)(Object(B.W)(e.items).items[0].text).join(" ")}catch(e){return null}}const Ki=e=>(e+"").replace(/&/g,"&").replace(//g,">"),Xi=e=>Ki(e).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function markup(){let o="",a="",s="";const A=[],l=()=>a=s="",c=(e,t)=>(null!=t&&(a+=` ${e}="${Xi(t)}"`),g),g={open(e,...t){var n;n=e,a&&(o+=a+">"+s,l()),A.push(n),a="<"+e;for(const r of t)for(const i in r)c(i,r[i]);return g},close(){var e=A.pop();return a?o+=a+(s?`>${s}`:"/>"):o+=``,l(),g},attr:c,text:e=>(s+=Ki(e),g),toString:()=>o};return g}const qi=e=>function _serialize(t,e){t.open(e.tagName);if(e.hasAttributes()){const n=e.attributes,r=n.length;for(let e=0;e{e.dirty=t})),r.zdirty||(n.exit?(o.nested&&r.items.length?(A=r.items[0])._svg&&this._update(o,A._svg,A):n._svg&&(A=n._svg.parentNode)&&A.removeChild(n._svg),n._svg=null):(n=o.nested?r.items[0]:n)._update!==t&&(n._svg&&n._svg.ownerSVGElement?this._update(o,n._svg,n):(this._dirtyAll=!1,dirtyParents(n,t)),n._update=t));return!this._dirtyAll},mark(e,t,n){if(!this.isDirty(t))return t._svg;const r=this._svg,i=Ei[t.marktype],o=!1===t.interactive?"none":null,a="g"===i.tag;let s=null,A=0;const l=vega_scenegraph_module_bind(t,e,n,"g",r);l.setAttribute("class",cssClass(t));var c=ariaMarkAttributes(t);for(const g in c)setAttribute(l,g,c[g]);a||setAttribute(l,"pointer-events",o),setAttribute(l,"clip-path",t.clip?clip$1(this,t,t.group):null);e=e=>{var t=this.isDirty(e),n=vega_scenegraph_module_bind(e,l,s,i.tag,r);t&&(this._update(i,n,e),a&&function recurse(t,n,e){n=n.lastChild.previousSibling;let r,i=0;vega_scenegraph_module_visit(e,e=>{r=t.mark(n,e,r),++i}),domClear(n,1+i)}(this,n,e)),s=n,++A};return i.nested?t.items.length&&e(t.items[0]):vega_scenegraph_module_visit(t,e),domClear(l,A),l},_update(e,t,n){io=t,oo=t.__values__,ariaItemAttributes(emit,n),e.attr(emit,n,this);const r=ao[e.type];r&&r.call(this,e,t,n),io&&this.style(io,n)},style(t,n){if(null!=n)for(const i in $i){let e="font"===i?fontFamily(n):n[i];var r;e!==oo[i]&&(r=$i[i],null==e?t.removeAttribute(r):(isGradient(e)&&(e=gradientRef(e,this._defs.gradient,vega_scenegraph_module_href())),t.setAttribute(r,e+"")),oo[i]=e)}},defs(){const e=this._svg,t=this._defs;let n=t.el,r=0;for(const i in t.gradient)n||(t.el=n=domChild(e,1,"defs",no)),r=function updateGradient(e,t,n){let r,i,o;{var a;"radial"===t.gradient?(setAttributes(a=domChild(e,n++,"pattern",no),{id:"p_"+t.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),setAttributes(a=domChild(a,0,"rect",no),{width:1,height:1,fill:`url(${vega_scenegraph_module_href()}#${t.id})`}),setAttributes(e=domChild(e,n++,"radialGradient",no),{id:t.id,fx:t.x1,fy:t.y1,fr:t.r1,cx:t.x2,cy:t.y2,r:t.r2})):setAttributes(e=domChild(e,n++,"linearGradient",no),{id:t.id,x1:t.x1,x2:t.x2,y1:t.y1,y2:t.y2})}for(r=0,i=t.stops.length;rtextValue(i,e))).join("\n"))!==oo.text&&(domClear(r,0),a=r.ownerDocument,s=lineHeight(i),o.forEach((e,t)=>{const n=domCreate(a,"tspan",no);n.__data__=i,n.textContent=e,t&&(n.setAttribute("x",0),n.setAttribute("dy",s)),r.appendChild(n)}),oo.text=n):(o=textValue(i,t))!==oo.text&&(r.textContent=o,oo.text=o),setAttribute(r,"font-family",fontFamily(i)),setAttribute(r,"font-size",vega_scenegraph_module_fontSize(i)+"px"),setAttribute(r,"font-style",i.fontStyle),setAttribute(r,"font-variant",i.fontVariant),setAttribute(r,"font-weight",i.fontWeight)}};function emit(e,t,n){t!==oo[e]&&(n?function setAttributeNS(e,t,n,r){null!=n?e.setAttributeNS(r,t,n):e.removeAttributeNS(r,t)}(io,e,t,n):setAttribute(io,e,t),oo[e]=t)}function setStyle(e,t,n){n!==oo[t]&&(null==n?e.style.removeProperty(t):e.style.setProperty(t,n+""),oo[t]=n)}function setAttributes(e,t){for(const n in t)setAttribute(e,n,t[n])}function setAttribute(e,t,n){null!=n?e.setAttribute(t,n):e.removeAttribute(t)}function vega_scenegraph_module_href(){let e;return"undefined"==typeof window?"":(e=window.location).hash?e.href.slice(0,-e.hash.length):e.href}function SVGStringRenderer(e){vega_scenegraph_module_Renderer.call(this,e),this._text=null,this._defs={gradient:{},clipping:{}}}Object(B.z)(SVGStringRenderer,vega_scenegraph_module_Renderer,{svg(){return this._text},_render(e){const t=markup();t.open("svg",Object(B.p)({},mi,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} `+this._height}));var n=this._bgcolor;return n&&"transparent"!==n&&"none"!==n&&t.open("rect",{width:this._width,height:this._height,fill:n}).close(),t.open("g",eo,{transform:"translate("+this._origin+")"}),this.mark(t,e),t.close(),this.defs(t),this._text=t.close()+"",this},mark(s,A){const l=Ei[A.marktype],c=l.tag,g=[ariaItemAttributes,l.attr];s.open("g",{class:cssClass(A),"clip-path":A.clip?clip$1(this,A,A.group):null},ariaMarkAttributes(A),{"pointer-events":"g"!==c&&!1===A.interactive?"none":null});var e=t=>{var e,n,r,i=this.href(t);if(i&&s.open("a",i),s.open(c,this.attr(A,t,g,"g"!==c?c:null)),"text"===c){var o=textLines(t);if(Object(B.B)(o)){var a={x:0,dy:lineHeight(t)};for(let e=0;ethis.mark(s,e)),s.close(),e&&r?(n&&(t.fill=null),t.stroke=r,s.open("path",this.attr(A,t,l.foreground,"bgrect")).close(),n&&(t.fill=n)):s.open("path",this.attr(A,t,l.foreground,"bgfore")).close());s.close(),i&&s.close()};return l.nested?A.items&&A.items.length&&e(A.items[0]):vega_scenegraph_module_visit(A,e),s.close()},href(e){const t=e.href;if(t){if(e=this._hrefs&&this._hrefs[t])return e;this.sanitizeURL(t).then(e=>{e["xlink:href"]=e.href,e.href=null,(this._hrefs||(this._hrefs={}))[t]=e})}return null},attr(e,t,n,r){const i={},o=(e,t,n,r)=>{i[r||e]=t};return Array.isArray(n)?n.forEach(e=>e(o,t,this)):n(o,t,this),r&&function vega_scenegraph_module_style(t,n,e,r,i){if(null==n)return;"bgrect"===r&&!1===e.interactive&&(t["pointer-events"]="none");if("bgfore"===r&&(!1===e.interactive&&(t["pointer-events"]="none"),t.display="none",null!==n.fill))return;"image"===r&&!1===n.smooth&&(t.style="image-rendering: optimizeSpeed; image-rendering: pixelated;");"text"===r&&(t["font-family"]=fontFamily(n),t["font-size"]=vega_scenegraph_module_fontSize(n)+"px",t["font-style"]=n.fontStyle,t["font-variant"]=n.fontVariant,t["font-weight"]=n.fontWeight);for(const a in $i){let e=n[a];var o=$i[a];("transparent"!==e||"fill"!==o&&"stroke"!==o)&&null!=e&&(isGradient(e)&&(e=gradientRef(e,i.gradient,"")),t[o]=e)}}(i,t,e,r,this._defs),i},defs(t){var e=this._defs.gradient,n=this._defs.clipping,r=Object.keys(e).length+Object.keys(n).length;if(0!==r){t.open("defs");for(const s in e){var i=e[s],o=i.stops;"radial"===i.gradient?(t.open("pattern",{id:"p_"+s,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"}),t.open("rect",{width:"1",height:"1",fill:"url(#"+s+")"}).close(),t.close(),t.open("radialGradient",{id:s,fx:i.x1,fy:i.y1,fr:i.r1,cx:i.x2,cy:i.y2,r:i.r2})):t.open("linearGradient",{id:s,x1:i.x1,x2:i.x2,y1:i.y1,y2:i.y2});for(let e=0;e{e.bounds.clear().union(s)});else if(i===Qo||e.modified())switch(t.visit(t.MOD,e=>n.dirty(e)),s.clear(),r.items.forEach(e=>s.union(vega_view_transforms_module_boundItem(e,a))),r.role){case wo:case _o:case So:t.reflow()}else A=t.changed(t.REM),t.visit(t.ADD,e=>{s.union(vega_view_transforms_module_boundItem(e,a))}),t.visit(t.MOD,e=>{A=A||s.alignsWith(e.bounds),n.dirty(e),s.union(vega_view_transforms_module_boundItem(e,a))}),A&&(s.clear(),r.items.forEach(e=>s.union(e.bounds)));return boundClip(r),t.modifies("bounds")}});const Yo=":vega_identifier:";function Identifier(e){Transform.call(this,0,e)}function Mark(e){Transform.call(this,null,e)}function Overlap(e){Transform.call(this,null,e)}Identifier.Definition={type:"Identifier",metadata:{modifies:!0},params:[{name:"as",type:"string",required:!0}]},Object(B.z)(Identifier,Transform,{transform(e,t){const n=function getCounter(e){return e._signals[Yo]||(e._signals[Yo]=e.add(0))}(t.dataflow),r=e.as;let i=n.value;return t.visit(t.ADD,e=>e[r]=e[r]||++i),n.set(this.value=i),t}}),Object(B.z)(Mark,Transform,{transform(e,t){let n=this.value;n||((n=t.dataflow.scenegraph().mark(e.markdef,function vega_view_transforms_module_lookup(e){const t=e.groups,n=e.parent;return t&&1===t.size?t.get(Object.keys(t.object)[0]):t&&n?t.lookup(n):null}(e),e.index)).group.context=e.context,e.context.group||(e.context.group=n.group),n.source=this.source,n.clip=e.clip,n.interactive=e.interactive,this.value=n);const r=n.marktype===Qo?GroupItem:Item;return t.visit(t.ADD,e=>r.call(e,n)),(e.modified("clip")||e.modified("interactive"))&&(n.clip=e.clip,n.interactive=!!e.interactive,n.zdirty=!0,t.reflow()),n.items=t.source,t}});const zo={parity:e=>e.filter((e,t)=>t%2?e.opacity=0:1),greedy:(e,n)=>{let r;return e.filter((e,t)=>t&&Jo(r.bounds,e.bounds,n)?e.opacity=0:(r=e,1))}},Jo=(e,t,n)=>n>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2),Ko=(e,t)=>{for(var n,r=1,i=e.length,o=e[0].bounds;r{const t=e.bounds;return 1(e.forEach(e=>e.opacity=1),e),$o=(e,t)=>e.reflow(t.modified()).modifies("opacity");function Render(e){Transform.call(this,null,e)}Object(B.z)(Overlap,Transform,{transform(e,t){const n=zo[e.method]||zo.parity,r=e.separation||0;let i=t.materialize(t.SOURCE).source,o,a;if(i&&i.length){if(!e.method)return e.modified("method")&&(qo(i),t=$o(t,e)),t;if((i=i.filter(Xo)).length){if(e.sort&&(i=i.slice().sort(e.sort)),o=qo(i),t=$o(t,e),3<=o.length&&Ko(o,r)){for(;3<=(o=n(o,r)).length&&Ko(o,r););o.length<3&&!Object(B.W)(i).opacity&&(1l.encloses(e.bounds)),i.forEach(e=>{a(e)||(e.opacity=0)}));const c=o[0].mark.bounds.clear();return i.forEach(e=>{e.opacity&&c.union(e.bounds)}),t}}}}),Object(B.z)(Render,Transform,{transform(e,t){const n=t.dataflow;if(t.visit(t.ALL,e=>n.dirty(e)),t.fields&&t.fields.zindex){const r=t.source&&t.source[0];r&&(r.mark.zdirty=!0)}}});const ea=new Bounds;function vega_view_transforms_module_set(e,t,n){return e[t]===n?0:(e[t]=n,1)}function axisLayout(e,t,n,r){var i,o=t.items[0],t=o.datum,a=null!=o.translate?o.translate:.5,s=o.orient,A=function axisIndices(e){let t=+e.grid;return[e.ticks?t++:-1,e.labels?t++:-1,t+ +e.domain]}(t),l=o.range,c=o.offset,g=o.position,u=o.minExtent,d=o.maxExtent,h=t.title&&o.items[A[2]].items[0],p=o.titlePadding,f=o.bounds,I=h&&multiLineOffset(h),C=0,m=0;switch(ea.clear().union(f),f.clear(),-1<(t=A[0])&&f.union(o.items[t].bounds),-1<(t=A[1])&&f.union(o.items[t].bounds),s){case go:C=g||0,m=-c,i=Math.max(u,Math.min(d,-f.y1)),f.add(0,-i).add(l,0),h&&axisTitleLayout(e,h,i,p,I,0,-1,f);break;case uo:C=-c,m=g||0,i=Math.max(u,Math.min(d,-f.x1)),f.add(-i,0).add(0,l),h&&axisTitleLayout(e,h,i,p,I,1,-1,f);break;case ho:C=n+c,m=g||0,i=Math.max(u,Math.min(d,f.x2)),f.add(0,0).add(i,l),h&&axisTitleLayout(e,h,i,p,I,1,1,f);break;case po:C=g||0,m=r+c,i=Math.max(u,Math.min(d,f.y2)),f.add(0,0).add(l,i),h&&axisTitleLayout(e,h,i,p,0,0,1,f);break;default:C=o.x,m=o.y}return boundStroke(f.translate(C,m),o),vega_view_transforms_module_set(o,"x",C+a)|vega_view_transforms_module_set(o,"y",m+a)&&(o.bounds=ea,e.dirty(o),o.bounds=f,e.dirty(o)),o.mark.bounds.clear().union(f)}function axisTitleLayout(n,r,i,o,a,s,A,e){const l=r.bounds;if(r.auto){A=A*(i+a+o);let e=0,t=0;n.dirty(r),s?e=(r.x||0)-(r.x=A):t=(r.y||0)-(r.y=A),r.mark.bounds.clear().union(l.translate(-e,-t)),n.dirty(r)}e.union(l)}const ta=(e,t)=>Math.floor(Math.min(e,t)),na=(e,t)=>Math.ceil(Math.max(e,t));function bboxFlush(e){return(new Bounds).set(0,0,e.width||0,e.height||0)}function bboxFull(e){const t=e.bounds.clone();return t.empty()?t.set(0,0,0,0):t.translate(-(e.x||0),-(e.y||0))}function vega_view_transforms_module_get(e,t,n){t=Object(B.H)(e)?e[t]:e;return null!=t?t:void 0!==n?n:0}function offsetValue(e){return e<0?Math.ceil(-e):0}function gridLayout(e,t,n){for(var r,i,o,a,s,A,l,c,g,u,d=!n.nodirty,h=n.bounds===Wo?bboxFlush:bboxFull,p=ea.set(0,0,0,0),f=vega_view_transforms_module_get(n.align,Ho),I=vega_view_transforms_module_get(n.align,jo),C=vega_view_transforms_module_get(n.padding,Ho),m=vega_view_transforms_module_get(n.padding,jo),y=n.columns||t.length,B=y<=0?1:Math.ceil(t.length/y),b=t.length,v=Array(b),E=Array(y),Q=0,w=Array(b),S=Array(B),_=0,x=Array(b),R=Array(b),F=Array(b),D=0;Di&&(e.warn("Grid headers exceed limit: "+i),t=t.slice(0,i)),E+=o,p=0,I=t.length;pnull!=r[e]?r[e]:null!=n[e]?n[e]:t}(n,t),A=function vega_view_transforms_module_offsets(e,t){let n=-1/0;return e.forEach(e=>{null!=e.offset&&(n=Math.max(n,e.offset))}),n>-1/0?n:t}(e,s("offset",0)),l=s("anchor",yo),c=l===bo?1:l===Bo?.5:0,g={align:Zo,bounds:s("bounds",Wo),columns:"vertical"===s("direction")?1:e.length,padding:s("margin",8),center:s("center"),nodirty:!0};switch(t){case uo:g.anchor={x:Math.floor(r.x1)-A,column:bo,y:c*(a||r.height()+2*r.y1),row:l};break;case ho:g.anchor={x:Math.ceil(r.x2)+A,y:c*(a||r.height()+2*r.y1),row:l};break;case go:g.anchor={y:Math.floor(i.y1)-A,row:bo,x:c*(o||i.width()+2*i.x1),column:l};break;case po:g.anchor={y:Math.ceil(i.y2)+A,x:c*(o||i.width()+2*i.x1),column:l};break;case fo:g.anchor={x:A,y:A};break;case Io:g.anchor={x:o-A,y:A,column:bo};break;case Co:g.anchor={x:A,y:a-A,row:bo};break;case mo:g.anchor={x:o-A,y:a-A,column:bo,row:bo}}return g}function legendLayout(e,t){var n,t=t.items[0],r=t.datum,i=t.orient,o=t.bounds,a=t.x,s=t.y;return t._bounds?t._bounds.clear().union(o):t._bounds=o.clone(),o.clear(),function legendGroupLayout(e,t,n){var r=t.padding,i=r-n.x,o=r-n.y;if(t.datum.title){var a=t.items[1].items[0],s=a.anchor,A=t.titlePadding||0,l=r-a.x,c=r-a.y;switch(a.orient){case uo:i+=Math.ceil(a.bounds.width())+A;break;case ho:case po:break;default:o+=a.bounds.height()+A}switch((i||o)&&vega_view_transforms_module_translate(e,n,i,o),a.orient){case uo:c+=legendTitleOffset(t,n,a,s,1,1);break;case ho:l+=legendTitleOffset(t,n,a,bo,0,0)+A,c+=legendTitleOffset(t,n,a,s,1,1);break;case po:l+=legendTitleOffset(t,n,a,s,0,0),c+=legendTitleOffset(t,n,a,bo,-1,0,1)+A;break;default:l+=legendTitleOffset(t,n,a,s,0,0)}(l||c)&&vega_view_transforms_module_translate(e,a,l,c),(l=Math.round(a.bounds.x1-r))<0&&(vega_view_transforms_module_translate(e,n,-l,0),vega_view_transforms_module_translate(e,a,-l,0))}else(i||o)&&vega_view_transforms_module_translate(e,n,i,o)}(e,t,t.items[0].items[0]),o=function legendBounds(e,t){return e.items.forEach(e=>t.union(e.bounds)),t.x1=e.padding,t.y1=e.padding,t}(t,o),e=2*t.padding,n=2*t.padding,o.empty()||(e=Math.ceil(o.width()+e),n=Math.ceil(o.height()+n)),r.type===To&&function legendEntryLayout(e){const t=e.reduce((e,t)=>(e[t.column]=Math.max(t.bounds.x2-t.x,e[t.column]||0),e),{});e.forEach(e=>{e.width=t[e.column],e.height=e.bounds.y2-e.y})}(t.items[0].items[0].items[0].items),i!==Po&&(t.x=a=0,t.y=s=0),t.width=e,t.height=n,boundStroke(o.set(a,s,a+e,s+n),t),t.mark.bounds.clear().union(o),t}function legendTitleOffset(e,t,n,r,i,o,a){var s="symbol"!==e.datum.type,A=n.datum.vgrad,s=(!s||!o&&A||a?t:t.items[0]).bounds[i?"y2":"x2"]-e.padding,a=A&&o?s:0,t=A&&o?0:s,e=i<=0?0:multiLineOffset(n);return Math.round(r===yo?a:r===bo?t-e:.5*(s-e))}function vega_view_transforms_module_translate(e,t,n,r){t.x+=n,t.y+=r,t.bounds.translate(n,r),t.mark.bounds.translate(n,r),e.dirty(t)}function ViewLayout(e){Transform.call(this,null,e)}Object(B.z)(ViewLayout,Transform,{transform(t,e){const n=e.dataflow;return t.mark.items.forEach(e=>{t.layout&&trellisLayout(n,e,t.layout),function layoutGroup(n,e,r){var t,i,o,a,s,A=e.items,l=Math.max(0,e.width||0),c=Math.max(0,e.height||0),g=(new Bounds).set(0,0,l,c),u=g.clone(),d=g.clone(),h=[];for(a=0,s=A.length;a{(o=e.orient||ho)!==Po&&(f[o]||(f[o]=[])).push(e)});for(const o in f){var p=f[o];gridLayout(n,p,legendParams(p,o,r.legends,u,d,l,c))}h.forEach(e=>{const t=e.bounds;if(t.equals(e._bounds)||(e.bounds=e._bounds,n.dirty(e),e.bounds=t,n.dirty(e)),r.autosize&&r.autosize.type===Mo)switch(e.orient){case uo:case ho:g.add(t.x1,0).add(t.x2,0);break;case go:case po:g.add(0,t.y1).add(0,t.y2)}else g.union(t)})}g.union(u).union(d),t&&g.union(function titleLayout(e,t,n,r,i){var o,a=t.items[0],s=a.frame,A=a.orient,l=a.anchor,c=a.offset,g=a.padding,u=a.items[0].items[0],d=a.items[1]&&a.items[1].items[0],n=A===uo||A===ho?r:n,h=0,p=0,f=0,I=0,C=0;if(s!==Qo?n=A===uo?(h=i.y2,i.y1):A===ho?(h=i.y1,i.y2):(h=i.x1,i.x2):A===uo&&(h=r,n=0),o=l===yo?h:l===bo?n:(h+n)/2,d&&d.text){switch(A){case go:case po:C=u.bounds.height()+g;break;case uo:I=u.bounds.width()+g;break;case ho:I=-u.bounds.width()-g}ea.clear().union(d.bounds),ea.translate(I-(d.x||0),C-(d.y||0)),vega_view_transforms_module_set(d,"x",I)|vega_view_transforms_module_set(d,"y",C)&&(e.dirty(d),d.bounds.clear().union(ea),d.mark.bounds.clear().union(ea),e.dirty(d)),ea.clear().union(d.bounds)}else ea.clear();switch(ea.union(u.bounds),A){case go:p=o,f=i.y1-ea.height()-c;break;case uo:p=i.x1-ea.width()-c,f=o;break;case ho:p=i.x2+ea.width()+c,f=o;break;case po:p=o,f=i.y2+c;break;default:p=a.x,f=a.y}return vega_view_transforms_module_set(a,"x",p)|vega_view_transforms_module_set(a,"y",f)&&(ea.translate(p,f),e.dirty(a),a.bounds.clear().union(ea),t.bounds.clear().union(ea),e.dirty(a)),a.bounds}(n,t,l,c,g));e.clip&&g.set(0,0,e.width||0,e.height||0);!function viewSizeLayout(a,s,A,l){var l=l.autosize||{},c=l.type;if(!(a._autosize<1)&&c){let e=a._width,t=a._height,n=Math.max(0,s.width||0),r=Math.max(0,Math.ceil(-A.x1)),i=Math.max(0,s.height||0),o=Math.max(0,Math.ceil(-A.y1));var g,s=Math.max(0,Math.ceil(A.x2-n)),A=Math.max(0,Math.ceil(A.y2-i));l.contains===ko&&(g=a.padding(),e-=g.left+g.right,t-=g.top+g.bottom),c===Po?(r=0,o=0,n=e,i=t):c===Mo?(n=Math.max(0,e-r-s),i=Math.max(0,t-o-A)):c===Uo?(n=Math.max(0,e-r-s),t=i+o+A):c===Oo?(e=n+r+s,i=Math.max(0,t-o-A)):c===Lo&&(e=n+r+s,t=i+o+A),a._resizeView(e,t,n,i,[r,o],l.resize)}}(n,e,g,r)}(n,e,t)}),function shouldReflow(e){return e&&"legend-entry"!==e.mark.role}(t.mark.group)?e.reflow():e}});function scb(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}var ra=t(1219);function d3_interpolate_src_basis_basis(e,t,n,r,i){var o=e*e,a=o*e;return((1-3*e+3*o-a)*t+(4-6*o+3*a)*n+(1+3*e+3*o-3*a)*r+a*i)/6}var ia=e=>()=>e;function d3_interpolate_src_color_linear(t,n){return function(e){return t+e*n}}function d3_interpolate_src_color_gamma(n){return 1==(n=+n)?src_color_nogamma:function(e,t){return t-e?function src_color_exponential(t,n,r){return t=Math.pow(t,r),n=Math.pow(n,r)-t,r=1/r,function(e){return Math.pow(t+e*n,r)}}(e,t,n):ia(isNaN(e)?t:e)}}function src_color_nogamma(e,t){var n=t-e;return n?d3_interpolate_src_color_linear(e,n):ia(isNaN(e)?t:e)}var oa=function rgbGamma(e){var a=d3_interpolate_src_color_gamma(e);function rgb(t,e){var n=a((t=color_rgb(t)).r,(e=color_rgb(e)).r),r=a(t.g,e.g),i=a(t.b,e.b),o=src_color_nogamma(t.opacity,e.opacity);return function(e){return t.r=n(e),t.g=r(e),t.b=i(e),t.opacity=o(e),t+""}}return rgb.gamma=rgbGamma,rgb}(1);function src_rgb_rgbSpline(s){return function(e){for(var t,n=e.length,r=new Array(n),i=new Array(n),o=new Array(n),a=0;ao&&(i=r.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(t=t[0])===(n=n[0])?s[a]?s[a]+=n:s[++a]=n:(s[++a]=null,A.push({i:a,x:Aa(t,n)})),o=ga.lastIndex;return oingest$1({index:t/(s.length-1||1),value:e,label:a(e)})),e.extra&&r.length&&r.push(ingest$1({index:-1,extra:{value:r[0].value},label:""})),t.source=r,t.add=r,this.value=r,t}}),Object(B.z)(DataJoin,Transform,{transform(e,t){var n=t.dataflow,r=t.fork(t.NO_SOURCE|t.NO_FIELDS),i=e.item||defaultItemCreate,o=e.key||tupleid,a=this.value;return Object(B.B)(r.encode)&&(r.encode=null),a&&(e.modified("key")||t.modified(o))&&Object(B.o)("DataJoin does not support modified key function or fields."),a||(t=t.addAll(),this.value=a=function newMap(t){const n=Object(B.t)().test(e=>e.exit);return n.lookup=e=>n.get(t(e)),n}(o)),t.visit(t.ADD,e=>{var t=o(e);let n=a.get(t);n?n.exit?(a.empty--,r.add.push(n)):r.mod.push(n):(n=i(e),a.set(t,n),r.add.push(n)),n.datum=e,n.exit=!1}),t.visit(t.MOD,e=>{const t=o(e),n=a.get(t);n&&(n.datum=e,r.mod.push(n))}),t.visit(t.REM,e=>{const t=o(e),n=a.get(t);e!==n.datum||n.exit||(r.rem.push(n),n.exit=!0,++a.empty)}),t.changed(t.ADD_MOD)&&r.modifies("datum"),(t.clean()||e.clean&&a.empty>n.cleanThreshold)&&n.runAfter(a.clean),r}}),Object(B.z)(Encode,Transform,{transform(n,e){var r=e.fork(e.ADD_REM),i=n.mod||!1,t=n.encoders,o=e.encode;if(Object(B.B)(o)){if(!r.changed()&&!o.every(e=>t[e]))return e.StopPropagation;o=o[0],r.encode=null}var a="enter"===o,s=t.update||B.s,A=t.enter||B.s,l=t.exit||B.s,c=(o&&!a?t[o]:s)||B.s;return e.changed(e.ADD)&&(e.visit(e.ADD,e=>{A(e,n),s(e,n)}),r.modifies(A.output),r.modifies(s.output),c!==B.s&&c!==s&&(e.visit(e.ADD,e=>{c(e,n)}),r.modifies(c.output))),e.changed(e.REM)&&l!==B.s&&(e.visit(e.REM,e=>{l(e,n)}),r.modifies(l.output)),!a&&c===B.s||(o=e.MOD|(n.modified()?e.REFLOW:0),a?(e.visit(o,e=>{var t=A(e,n)||i;(c(e,n)||t)&&r.mod.push(e)}),r.mod.length&&r.modifies(A.output)):e.visit(o,e=>{(c(e,n)||i)&&r.mod.push(e)}),r.mod.length&&r.modifies(c.output)),r.changed()?r:e.StopPropagation}}),Object(B.z)(LegendEntries,Transform,{transform(n,e){if(null!=this.value&&!n.modified())return e.StopPropagation;var r,i,o,t,a=e.dataflow.locale(),s=e.fork(e.NO_SOURCE|e.NO_FIELDS),A=this.value,l=n.type||sr,c=n.scale,g=+n.limit,u=tickCount(c,null==n.count?5:n.count,n.minstep),d=!!n.values||l===sr,h=n.format||labelFormat(a,c,u,l,n.formatSpecifier,n.formatType,d),p=n.values||labelValues(c,u);return A&&(s.rem=A),l===sr?(g&&p.length>g?(e.dataflow.warn("Symbol legend count exceeds limit, filtering items."),A=p.slice(0,g-1),t=!0):A=p,Object(B.E)(i=n.size)?(n.values||0!==c(A[0])||(A=A.slice(1)),o=A.reduce((e,t)=>Math.max(e,i(t,n)),0)):i=Object(B.m)(o=i||8),A=A.map((e,t)=>ingest$1({index:t,label:h(e,t,A),value:e,offset:o,size:i(e,n)})),t&&(t=p[A.length],A.push(ingest$1({index:A.length,label:"…".concat(p.length-A.length," entries"),value:t,offset:o,size:i(t,n)})))):A="gradient"===l?(a=c.domain(),r=scaleFraction(c,a[0],Object(B.W)(a)),(p=p.length<3&&!n.values&&a[0]!==Object(B.W)(a)?[a[0],Object(B.W)(a)]:p).map((e,t)=>ingest$1({index:t,label:h(e,t,p),value:e,perc:r(e)}))):(i=p.length-1,r=function labelFraction(e){var t=e.domain(),n=t.length-1;let r=+t[0],i=+Object(B.W)(t),o=i-r;return e.type===jn&&(t=n?o/n:.1,r-=t,i+=t,o=i-r),e=>(e-r)/o}(c),p.map((e,t)=>ingest$1({index:t,label:h(e,t,p),value:e,perc:t?r(e):0,perc2:t===i?1:r(p[t+1])}))),s.source=A,s.add=A,this.value=A,s}});const da=e=>e.source.x,ha=e=>e.source.y,pa=e=>e.target.x,fa=e=>e.target.y;function LinkPath(e){Transform.call(this,{},e)}LinkPath.Definition={type:"LinkPath",metadata:{modifies:!0},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]},Object(B.z)(LinkPath,Transform,{transform(e,t){var n=e.sourceX||da,r=e.sourceY||ha,i=e.targetX||pa,o=e.targetY||fa,a=e.as||"path",s=e.orient||"vertical",A=e.shape||"line",l=ya.get(A+"-"+s)||ya.get(A);return l||Object(B.o)("LinkPath unsupported type: "+e.shape+(e.orient?"-"+e.orient:"")),t.visit(t.SOURCE,e=>{e[a]=l(n(e),r(e),i(e),o(e))}),t.reflow(e.modified()).modifies(a)}});const Ia=(e,t,n,r)=>"M"+e+","+t+"L"+n+","+r;const Ca=(e,t,n,r)=>{var i=n-e,o=r-t,a=Math.sqrt(i*i+o*o)/2;return"M"+e+","+t+"A"+a+","+a+" "+180*Math.atan2(o,i)/Math.PI+" 0 1 "+n+","+r};const ma=(e,t,n,r)=>{var i=n-e,o=r-t,a=.2*(i+o),o=.2*(o-i);return"M"+e+","+t+"C"+(e+a)+","+(t+o)+" "+(n+o)+","+(r-a)+" "+n+","+r};const ya=Object(B.t)({line:Ia,"line-radial":(e,t,n,r)=>Ia(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),arc:Ca,"arc-radial":(e,t,n,r)=>Ca(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),curve:ma,"curve-radial":(e,t,n,r)=>ma(t*Math.cos(e),t*Math.sin(e),r*Math.cos(n),r*Math.sin(n)),"orthogonal-horizontal":(e,t,n,r)=>"M"+e+","+t+"V"+r+"H"+n,"orthogonal-vertical":(e,t,n,r)=>"M"+e+","+t+"H"+n+"V"+r,"orthogonal-radial":(e,t,n,r)=>{var i=Math.cos(e),o=Math.sin(e),a=Math.cos(n),s=Math.sin(n);return"M"+t*i+","+t*o+"A"+t+","+t+" 0 0,"+((Math.abs(n-e)>Math.PI?n<=e:e{var i=(e+n)/2;return"M"+e+","+t+"C"+i+","+t+" "+i+","+r+" "+n+","+r},"diagonal-vertical":(e,t,n,r)=>{var i=(t+r)/2;return"M"+e+","+t+"C"+e+","+i+" "+n+","+i+" "+n+","+r},"diagonal-radial":(e,t,n,r)=>{var i=Math.cos(e),e=Math.sin(e),o=Math.cos(n),n=Math.sin(n),a=(t+r)/2;return"M"+t*i+","+t*e+"C"+a*i+","+a*e+" "+a*o+","+a*n+" "+r*o+","+r*n}});function Pie(e){Transform.call(this,null,e)}Pie.Definition={type:"Pie",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:!1},{name:"as",type:"string",array:!0,length:2,default:["startAngle","endAngle"]}]},Object(B.z)(Pie,Transform,{transform(e,t){var n,r,i,o=e.as||["startAngle","endAngle"],a=o[0],s=o[1],A=e.field||B.Q,l=e.startAngle||0,c=null!=e.endAngle?e.endAngle:2*Math.PI,g=t.source,u=g.map(A),d=u.length,h=l,p=(c-l)/Object(ra.a)(u),f=se(d);for(e.sort&&f.sort((e,t)=>u[e]-u[t]),n=0;ne+(t<0?-1:0i&&(t=a*Math.floor(i/a)),r=se(e,t+a/2,a)}r?n.bins=r:n.bins&&delete n.bins;n.type===Kn&&(r?e.domain||e.domainRaw||(n.domain(r),t=r.length):n.bins=n.domain());return t}(r,e,function configureDomain(e,t,n){var r=function rawDomain(e,t,n){return t?(e.domain(domainCheck(e.type,t,n)),t.length):-1}(e,t.domainRaw,n);if(-1r[i]?i+1:ae(A);if(null==t)d.push(e.slice());else for(i={},o=0,a=e.length;oe;function streamGeometry(e,t){e&&wa.hasOwnProperty(e.type)&&wa[e.type](e,t)}var Qa={Feature:function(e,t){streamGeometry(e.geometry,t)},FeatureCollection:function(e,t){for(var n=e.features,r=-1,i=n.length;++rx?Fa((N(t)*(i=G(r))*N(n)-N(r)*(n=G(t))*N(e))/(n*i*o)):(t+r)/2}(a,s,e,t),i.point(A,s),i.lineEnd(),i.lineStart(),i.point(n,s),o=0),i.point(a=e,s=t),A=n},lineEnd:function(){i.lineEnd(),a=s=NaN},clean:function(){return 2-o}}},function clipAntimeridianInterpolate(e,t,n,r){var i;null==e?(i=n*R,r.point(-S,i),r.point(0,i),r.point(S,i),r.point(S,0),r.point(S,-i),r.point(0,-i),r.point(-S,-i),r.point(-S,0),r.point(-S,i)):D(e[0]-t[0])>x?(e=e[0]S?e+Math.round(-e/xa)*xa:e,t]}function rotateRadians(e,t,n){return(e%=xa)?t||n?udb(rotationLambda(e),rotationPhiGamma(t,n)):rotationLambda(e):t||n?rotationPhiGamma(t,n):rotationIdentity}function forwardRotationLambda(n){return function(e,t){return[S<(e+=n)?e-xa:e<-S?e+xa:e,t]}}function rotationLambda(e){var t=forwardRotationLambda(e);return t.invert=forwardRotationLambda(-e),t}function rotationPhiGamma(e,t){var i=G(e),o=N(e),a=G(t),s=N(t);function rotation(e,t){var n=G(t),r=G(e)*n,e=N(e)*n,n=N(t),t=n*i+r*o;return[Da(e*a-t*s,r*i-n*o),math_asin(t*a+e*s)]}return rotation.invert=function(e,t){var n=G(t),r=G(e)*n,e=N(e)*n,n=N(t),t=n*a-e*s;return[Da(e*a+n*s,r*i+t*o),math_asin(t*i-r*o)]},rotation}rotationIdentity.invert=rotationIdentity;var Ss=function(t){function forward(e){return(e=t(e[0]*F,e[1]*F))[0]*=Ra,e[1]*=Ra,e}return t=rotateRadians(t[0]*F,t[1]*F,2x;function visible(e,t){return G(e)*G(t)>d}function intersect(e,t,n){var r=[1,0,0],i=cartesianCross(cartesian_cartesian(e),cartesian_cartesian(t)),o=cartesianDot(i,i),a=i[0],s=o-a*a;if(!s)return!n&&e;var A=cartesianCross(r,i),r=cartesianScale(r,d*o/s),o=(cartesianAddInPlace(r,cartesianScale(i,-d*a/s)),A),i=cartesianDot(r,o),a=cartesianDot(o,o),s=i*i-a*(cartesianDot(r,r)-1);if(!(s<0)){A=Ma(s),s=cartesianScale(o,(-i-A)/a);if(cartesianAddInPlace(s,r),s=cartesian_spherical(s),!n)return s;var l,n=e[0],c=t[0],e=e[1],t=t[1],g=(cx&&0<--r);return[e/(.8707+(i=n*n)*(i*(i*i*i*(.003971-.001529*i)-.013791)-.131979)),n]};function orthographicRaw(e,t){return[G(t)*N(e),N(t)]}orthographicRaw.invert=azimuthalInvert(math_asin);function stereographicRaw(e,t){var n=G(t),r=1+G(e)*n;return[n*N(e)/r,N(t)/r]}stereographicRaw.invert=azimuthalInvert(function(e){return 2*Fa(e)});function transverseMercatorRaw(e,t){return[Na(Ua((R+t)/2)),-e]}transverseMercatorRaw.invert=function(e,t){return[-t,2*Fa(Ga(e))-R]};function src_noop_noop(){}function c3b(){var r,t=[];return{point:function(e,t,n){r.push([e,t,n])},lineStart:function(){t.push(r=[])},lineEnd:src_noop_noop,rejoin:function(){1k?js((U(t)*(i=M(r))*U(n)-U(r)*(n=M(t))*U(e))/(n*i*o)):(t+r)/2}(a,s,e,t),i.point(A,s),i.lineEnd(),i.lineStart(),i.point(n,s),o=0),i.point(a=e,s=t),A=n},lineEnd:function(){i.lineEnd(),a=s=NaN},clean:function(){return 2-o}}},function antimeridian_clipAntimeridianInterpolate(e,t,n,r){var i;null==e?(i=n*Ps,r.point(-w,i),r.point(0,i),r.point(w,i),r.point(w,0),r.point(w,-i),r.point(0,-i),r.point(-w,-i),r.point(-w,0),r.point(-w,i)):T(e[0]-t[0])>k?(e=e[0]w?e+Math.round(-e/Zs)*Zs:e,t]}function rotation_rotateRadians(e,t,n){return(e%=Zs)?t||n?seb(rotation_rotationLambda(e),rotation_rotationPhiGamma(t,n)):rotation_rotationLambda(e):t||n?rotation_rotationPhiGamma(t,n):rotation_rotationIdentity}function rotation_forwardRotationLambda(n){return function(e,t){return[w<(e+=n)?e-Zs:e<-w?e+Zs:e,t]}}function rotation_rotationLambda(e){var t=rotation_forwardRotationLambda(e);return t.invert=rotation_forwardRotationLambda(-e),t}function rotation_rotationPhiGamma(e,t){var i=M(e),o=U(e),a=M(t),s=U(t);function rotation(e,t){var n=M(t),r=M(e)*n,e=U(e)*n,n=U(t),t=n*i+r*o;return[Ys(e*a-t*s,r*i-n*o),src_math_asin(t*a+e*s)]}return rotation.invert=function(e,t){var n=M(t),r=M(e)*n,e=U(e)*n,n=U(t),t=n*a-e*s;return[Ys(e*a+n*s,r*i+t*o),src_math_asin(t*i-r*o)]},rotation}rotation_rotationIdentity.invert=rotation_rotationIdentity;function circle_circleStream(e,t,n,r,i,o){if(n){var a=M(t),s=U(t),A=r*n;null==i?(i=t+r*Zs,o=t-A/2):(i=circle_circleRadius(a,i),o=circle_circleRadius(a,o),(0k;function visible(e,t){return M(e)*M(t)>d}function intersect(e,t,n){var r=[1,0,0],i=cartesian_cartesianCross(src_cartesian_cartesian(e),src_cartesian_cartesian(t)),o=cartesian_cartesianDot(i,i),a=i[0],s=o-a*a;if(!s)return!n&&e;var A=cartesian_cartesianCross(r,i),r=cartesian_cartesianScale(r,d*o/s),o=(cartesian_cartesianAddInPlace(r,cartesian_cartesianScale(i,-d*a/s)),A),i=cartesian_cartesianDot(r,o),a=cartesian_cartesianDot(o,o),s=i*i-a*(cartesian_cartesianDot(r,r)-1);if(!(s<0)){A=Js(s),s=cartesian_cartesianScale(o,(-i-A)/a);if(cartesian_cartesianAddInPlace(s,r),s=src_cartesian_spherical(s),!n)return s;var l,n=e[0],c=t[0],e=e[1],t=t[1],g=(cpA&&0<--i;);return t/2}(i,t)),r*hA(t)]}return forward.invert=function(e,t){return t=d3_geo_projection_src_math_asin(t/r),[e/(n*dA(t)),d3_geo_projection_src_math_asin((2*t+hA(2*t))/i)]},forward}(Ee/fA,Ee,ve);const CA=Bs(),mA=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function vega_projection_module_projection(e,t){if(e&&"string"==typeof e)return e=e.toLowerCase(),1{n[e]&&t[e](n[e]())}),t.path.pointRadius(n.path.pointRadius()),t},n}}(e,t),this):yA[e]||null;throw new Error("Projection type must be a name string.")}function getProjectionPath(e){return e&&e.path||CA}const yA={albers:Hdb,albersusa:function(){var t,n,i,o,a,r,s=Hdb(),A=Gdb().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=Gdb().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(e,t){r=[e,t]}};function albersUsa(e){var t=e[0],e=e[1];return r=null,i.point(t,e),r||(o.point(t,e),r)||(a.point(t,e),r)}function reset(){return t=n=null,albersUsa}return albersUsa.invert=function(e){var t=s.scale(),n=s.translate(),r=(e[0]-n[0])/t,n=(e[1]-n[1])/t;return(.12<=n&&n<.234&&-.425<=r&&r<-.214?A:.166<=n&&n<.234&&-.214<=r&&r<-.115?l:s).invert(e)},albersUsa.stream=function(e){return t&&n===e?t:t=function multiplex(r){var i=r.length;return{point:function(e,t){for(var n=-1;++nBA}).map(l)).concat(se(vA(a/h)*h,o,h).filter(function(e){return bA(e%f)>BA}).map(c))}return graticule.lines=function(){return lines().map(function(e){return{type:"LineString",coordinates:e}})},graticule.outline=function(){return{type:"Polygon",coordinates:[g(i).concat(u(s).slice(1),g(r).reverse().slice(1),u(A).reverse().slice(1))]}},graticule.extent=function(e){return arguments.length?graticule.extentMajor(e).extentMinor(e):graticule.extentMinor()},graticule.extentMajor=function(e){return arguments.length?(i=+e[0][0],r=+e[1][0],A=+e[0][1],s=+e[1][1],r>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?color_rgba(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?color_rgba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=QA.exec(e))?new color_Rgb(t[1],t[2],t[3],1):(t=wA.exec(e))?new color_Rgb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=SA.exec(e))?color_rgba(t[1],t[2],t[3],t[4]):(t=_A.exec(e))?color_rgba(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=xA.exec(e))?color_hsla(t[1],t[2]/100,t[3]/100,1):(t=RA.exec(e))?color_hsla(t[1],t[2]/100,t[3]/100,t[4]):FA.hasOwnProperty(e)?color_rgbn(FA[e]):"transparent"===e?new color_Rgb(NaN,NaN,NaN,0):null}function color_rgbn(e){return new color_Rgb(e>>16&255,e>>8&255,255&e,1)}function color_rgba(e,t,n,r){return new color_Rgb(e=r<=0?t=n=NaN:e,t,n,r)}function src_color_rgb(e,t,n,r){return 1===arguments.length?function color_rgbConvert(e){return(e=e instanceof color_Color?e:src_color_color(e))?new color_Rgb((e=e.rgb()).r,e.g,e.b,e.opacity):new color_Rgb}(e):new color_Rgb(e,t,n,null==r?1:r)}function color_Rgb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function color_rgb_formatHex(){return"#"+color_hex(this.r)+color_hex(this.g)+color_hex(this.b)}function color_rgb_formatRgb(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function color_hex(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function color_hsla(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||1<=n?e=t=NaN:t<=0&&(e=NaN),new color_Hsl(e,t,n,r)}function color_hslConvert(e){if(e instanceof color_Hsl)return new color_Hsl(e.h,e.s,e.l,e.opacity);if(!(e=e instanceof color_Color?e:src_color_color(e)))return new color_Hsl;if(e instanceof color_Hsl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,A=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(ncontour(t,e))}function contour(t,n){var i=[],r=[];return function isorings(e,t,a){var s,A,n,r,i,o,l=new Array,c=new Array;s=A=-1,r=e[0]>=t,DA[r<<1].forEach(stitch);for(;++s=t,DA[n|r<<1].forEach(stitch);DA[r<<0].forEach(stitch);for(;++A=t,i=e[A*g]>=t,DA[r<<1|i<<2].forEach(stitch);++s=t,o=i,i=e[A*g+s+1]>=t,DA[n|r<<1|i<<2|o<<3].forEach(stitch);DA[r|i<<3].forEach(stitch)}s=-1,i=e[A*g]>=t,DA[i<<2].forEach(stitch);for(;++s=t,DA[i<<2|o<<3].forEach(stitch);function stitch(e){var t,n,r=[e[0][0]+s,e[0][1]+A],e=[e[1][0]+s,e[1][1]+A],i=index(r),o=index(e);(t=c[i])?(n=l[o])?(delete c[t.end],delete l[n.start],t===n?(t.ring.push(e),a(t.ring)):l[t.start]=c[n.end]={start:t.start,end:n.end,ring:t.ring.concat(n.ring)}):(delete c[t.end],t.ring.push(e),c[t.end=o]=t):(t=l[o])?(n=c[i])?(delete l[t.start],delete c[n.end],t===n?(t.ring.push(e),a(t.ring)):l[n.start]=c[t.end]={start:n.start,end:t.end,ring:n.ring.concat(t.ring)}):(delete l[t.start],t.ring.unshift(r),l[t.start=i]=t):l[i]=c[o]={start:i,end:o,ring:[r,e]}}DA[i<<3].forEach(stitch)}(t,n,e=>{o(e,t,n),0{for(var t,n=0,r=i.length;n{var t,n=e[0],r=e[1],i=0|n,o=0|r,a=s[o*g+i];0e[0],d=e=>e[1],h=B.Q,p=[-1,-1],f=960,I=500,C=2;function density(e,t){const n=vega_geo_module_radius(p[0],e,u)>>C,r=vega_geo_module_radius(p[1],e,d)>>C,i=n?2+n:0,o=r?2+r:0,a=2*i+(f>>C),s=2*o+(I>>C),A=new Float32Array(a*s),l=new Float32Array(a*s);let c=A;e.forEach(e=>{var t=i+(+u(e)>>C),n=o+(+d(e)>>C);0<=t&&t>C),y2:o+(I>>C)}}return density.x=function(e){return arguments.length?(u=vega_geo_module_number(e),density):u},density.y=function(e){return arguments.length?(d=vega_geo_module_number(e),density):d},density.weight=function(e){return arguments.length?(h=vega_geo_module_number(e),density):h},density.size=function(e){if(!arguments.length)return[f,I];var t=+e[0],e=+e[1];return 0<=t&&0<=e||Object(B.o)("invalid size"),f=t,I=e,density},density.cellSize=function(e){return arguments.length?(1<=(e=+e)||Object(B.o)("invalid cell size"),C=Math.floor(Math.log(e)/Math.LN2),density):1<=a&&(e>=s&&(t-=i[e-s+n*r]),o[e-a+n*r]=t/Math.min(e+1,r-1+s-e,s))}function blurY(r,i,o,a,s){var A=1+(s<<1);for(let n=0;n=s&&(e>=A&&(t-=o[n+(e-A)*r]),a[n+(e-s)*r]=t/Math.min(e+1,i-1+A-e,A))}function KDE2D(e){Transform.call(this,null,e)}Isocontour.Definition={type:"Isocontour",metadata:{generates:!0},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:!0},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:!1},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:!0},{name:"smooth",type:"boolean",default:!0},{name:"scale",type:"number",expr:!0},{name:"translate",type:"number",array:!0,expr:!0},{name:"as",type:"string",null:!0,default:"contour"}]},Object(B.z)(Isocontour,Transform,{transform(r,e){if(this.value&&!e.changed()&&!r.modified())return e.StopPropagation;var t=e.fork(e.NO_SOURCE|e.NO_FIELDS),e=e.materialize(e.SOURCE).source,i=r.field||B.y,o=vega_geo_module_contours().smooth(!1!==r.smooth),a=r.thresholds||function levels(e,t,n){const r=vega_geo_module_quantize(n.levels||10,n.nice,!1!==n.zero);return"shared"!==n.resolve?r:r(e.map(e=>Object(X.a)(t(e).values)))}(e,i,r),s=null===r.as?null:r.as||"contour",A=[];return e.forEach(t=>{var e=i(t);const n=o.size([e.width,e.height])(e.values,Object(B.B)(a)?a:a(e.values));!function transformPaths(e,t,n,r){let i=r.scale||t.scale,o=r.translate||t.translate;Object(B.E)(i)&&(i=i(n,r));Object(B.E)(o)&&(o=o(n,r));var a,s;(1!==i&&null!=i||o)&&(n=(Object(B.G)(i)?i:i[0])||1,r=(Object(B.G)(i)?i:i[1])||1,a=o&&o[0]||0,s=o&&o[1]||0,e.forEach(vega_geo_module_transform(t,n,r,a,s)))}(n,e,t,r),n.forEach(e=>{A.push(rederive(t,ingest$1(null!=s?{[s]:e}:e)))})}),this.value&&(t.rem=this.value),this.value=t.source=t.add=A,t}}),KDE2D.Definition={type:"KDE2D",metadata:{generates:!0},params:[{name:"size",type:"number",array:!0,length:2,required:!0},{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"weight",type:"field"},{name:"groupby",type:"field",array:!0},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:!0,length:2},{name:"counts",type:"boolean",default:!1},{name:"as",type:"string",default:"grid"}]};const GA=["x","y","weight","size","cellSize","bandwidth"];function vega_geo_module_params(t,n){return GA.forEach(e=>null!=n[e]?t[e](n[e]):0),t}function Contour(e){Transform.call(this,null,e)}Object(B.z)(KDE2D,Transform,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),e=function vega_geo_module_partition(e,t){var n,r,i,o,a,s,A=[],l=e=>e(o);if(null==t)A.push(e);else for(n={},r=0,i=e.length;ringest$1(function set(t,n){for(let e=0;en.push(s(e))),o&&a&&(t.visit(i,e=>{var t=o(e),e=a(e);null!=t&&null!=e&&(t=+t)===t&&(e=+e)===e&&r.push([t,e])}),n=n.concat({type:NA,geometry:{type:"MultiPoint",coordinates:r}})),this.value={type:kA,features:n}}}),GeoPath.Definition={type:"GeoPath",metadata:{modifies:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"path"}]},Object(B.z)(GeoPath,Transform,{transform(e,t){var n=t.fork(t.ALL),r=this.value,i=e.field||B.y,o=e.as||"path",a=n.SOURCE,t=(!r||e.modified()?(this.value=r=getProjectionPath(e.projection),n.materialize().reflow()):a=i===B.y||t.modified(i.fields)?n.ADD_MOD:n.ADD,function initPath(e,t){var n=e.pointRadius();e.context(null),null!=t&&e.pointRadius(t);return n}(r,e.pointRadius));return n.visit(a,e=>e[o]=r(i(e))),r.pointRadius(t),n.modifies(o)}}),GeoPoint.Definition={type:"GeoPoint",metadata:{modifies:!0},params:[{name:"projection",type:"projection",required:!0},{name:"fields",type:"field",array:!0,required:!0,length:2},{name:"as",type:"string",array:!0,length:2,default:["x","y"]}]},Object(B.z)(GeoPoint,Transform,{transform(e,t){var n=e.projection,r=e.fields[0],i=e.fields[1],o=e.as||["x","y"],a=o[0],s=o[1];function set(e){var t=n([r(e),i(e)]);t?(e[a]=t[0],e[s]=t[1]):(e[a]=void 0,e[s]=void 0)}return e.modified()?t=t.materialize().reflow(!0).visit(t.SOURCE,set):(e=t.modified(r.fields)||t.modified(i.fields),t.visit(e?t.ADD_MOD:t.ADD,set)),t.modifies(o)}}),GeoShape.Definition={type:"GeoShape",metadata:{modifies:!0,nomod:!0},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:!0},{name:"as",type:"string",default:"shape"}]},Object(B.z)(GeoShape,Transform,{transform(e,t){var t=t.fork(t.ALL),n=this.value,r=e.as||"shape",i=t.ADD;return n&&!e.modified()||(this.value=n=function shapeGenerator(n,r,i){const t=null==i?e=>n(r(e)):e=>{var t=n.pointRadius(),e=n.pointRadius(i)(r(e));return n.pointRadius(t),e};return t.context=e=>(n.context(e),t),t}(getProjectionPath(e.projection),e.field||Object(B.u)("datum"),e.pointRadius),t.materialize().reflow(),i=t.SOURCE),t.visit(i,e=>e[r]=n),t.modifies(r)}}),Graticule.Definition={type:"Graticule",metadata:{changes:!0,generates:!0},params:[{name:"extent",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMajor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"extentMinor",type:"array",array:!0,length:2,content:{type:"number",array:!0,length:2}},{name:"step",type:"number",array:!0,length:2},{name:"stepMajor",type:"number",array:!0,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:!0,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]},Object(B.z)(Graticule,Transform,{transform(e,t){var n,r=this.value,i=this.generator;if(!r.length||e.modified())for(const o in e)Object(B.E)(i[o])&&i[o](e[o]);return n=i(),r.length?t.mod.push(replace(r[0],n)):t.add.push(ingest$1(n)),r[0]=n,t}}),Heatmap.Definition={type:"heatmap",metadata:{modifies:!0},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:!0},{name:"opacity",type:"number",expr:!0},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]},Object(B.z)(Heatmap,Transform,{transform(e,t){if(!t.changed()&&!e.modified())return t.StopPropagation;var n=t.materialize(t.SOURCE).source,r="shared"===e.resolve,i=e.field||B.y,o=function opacity_(t,n){let e;Object(B.E)(t)?(e=e=>t(e,n)).dep=dependency(t):t?e=Object(B.m)(t):(e=e=>e.$value/e.$max||0).dep=!0;return e}(e.opacity,e),a=function color_(t,n){let e;Object(B.E)(t)?(e=e=>src_color_rgb(t(e,n))).dep=dependency(t):e=Object(B.m)(src_color_rgb(t||"#888"));return e}(e.color,e),s=e.as||"image",A={$x:0,$y:0,$value:0,$max:r?Object(X.a)(n.map(e=>Object(X.a)(i(e).values))):0};return n.forEach(e=>{var t=i(e);const n=Object(B.p)({},e,A);r||(n.$max=Object(X.a)(t.values||[])),e[s]=function toCanvas(e,i,o,a){const s=e.width,t=e.height,A=e.x1||0,l=e.y1||0,c=e.x2||s,g=e.y2||t,n=e.values,u=n?e=>n[e]:B.mb,r=domCanvas(c-A,g-l),d=r.getContext("2d"),h=d.getImageData(0,0,c-A,g-l),p=h.data;for(let n=l,r=0;n{null!=t[e]&&vega_geo_module_set(n,e,t[e])})):mA.forEach(e=>{t.modified(e)&&vega_geo_module_set(n,e,t[e])}),null!=t.pointRadius&&n.path.pointRadius(t.pointRadius),t.fit&&function vega_geo_module_fit(e,t){var n=function collectGeoJSON(e){return 1===(e=Object(B.i)(e)).length?e[0]:{type:kA,features:e.reduce((e,t)=>e.concat(function featurize(e){return e.type===kA?e.features:Object(B.i)(e).filter(e=>null!=e).map(e=>e.type===NA?e:{type:NA,geometry:e})}(t)),[])}}(t.fit);t.extent?e.fitExtent(t.extent,n):t.size&&e.fitSize(t.size,n)}(n,t),e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function gfb(e){return function(){return e}}function hfb(e){return 1e-6*(e()-.5)}var TA=t(1221);function collide_x(e){return e.x+e.vx}function collide_y(e){return e.y+e.vy}var MA=t(484);function link_index(e){return e.index}function link_find(e,t){e=e.get(t);if(e)return e;throw new Error("node not found: "+t)}const UA={center:function(o,a){var s,A=1;function force(){for(var e,t=s.length,n=0,r=0,i=0;is.index&&((n=(t=A-o.x-o.vx)*t+(r=l-o.y-o.vy)*r)e.r&&(e.r=e[t].r)}function initialize(){if(i){var e,t,n=i.length;for(o=new Array(n),e=0;e[s(e,t,o),e])),i=0;for(a=new Array(t);it(e,n):t)}(t[n],e[n],e);return t}(a[s]):r&&function modified(e,t){var n,r;for(n in e)if(Object(B.E)(r=e[n])&&t.modified(Object(B.g)(r)))return 1;return}(a[s],r)?e.force(o):null)&&e.force(o,i);for(A=e.numForces||0;so,n.restart=()=>(o=!1,i()),n.stop=()=>(o=!0,r()),setup(n,t,!0).on("end",()=>o=!0)}(t.source,e),n.on("tick",function rerun(e,t){return()=>e.touch(t).run()}(t.dataflow,this)),e.static||(r=!0,n.tick()),t.modifies("index")),i||r||e.modified(PA)||t.changed()&&e.restart)if(n.alpha(Math.max(n.alpha(),e.alpha||1)).alphaDecay(1-Math.pow(n.alphaMin(),1/o)),e.static)for(n.stop();0<=--o;)n.tick();else if(n.stopped()&&n.restart(),!r)return t.StopPropagation;return this.finish(e,t)},finish(e,t){const i=t.dataflow;for(let e=this._argops,t=0,n=e.length,r;t{var t=e.data;r(t)&&(i[n(t)]=e)}),e.lookup=i,e}function Nest(e){Transform.call(this,null,e)}Nest.Definition={type:"Nest",metadata:{treesource:!0,changes:!0},params:[{name:"keys",type:"field",array:!0},{name:"generate",type:"boolean"}]};const zA=e=>e.values;function HierarchyLayout(e){Transform.call(this,null,e)}Object(B.z)(Nest,Transform,{transform(e,t){t.source||Object(B.o)("Nest transform requires an upstream data source.");var n=e.generate,r=e.modified(),i=t.clone(),o=this.value;return o&&!r&&!t.changed()||(o&&o.each(e=>{e.children&&isTuple(e.data)&&i.rem.push(e.data)}),this.value=o=hierarchy({values:Object(B.i)(e.keys).reduce((e,t)=>(e.key(t),e),function nest(){const c=[],t={entries:e=>function entries(e,t){if(++t>c.length)return e;const n=[];for(const r in e)n.push({key:r,values:entries(e[r],t)});return n}(function apply(e,t){if(t>=c.length)return e;const n=e.length,r=c[t++],i={},o={};let a=-1,s,A,l;for(;++a(c.push(e),t)};return t}()).entries(i.source)},zA),n&&o.each(e=>{e.children&&(e=ingest$1(e.data),i.add.push(e),i.source.push(e))}),vega_hierarchy_module_lookup(o,tupleid,tupleid)),i.source.root=o,i}});const JA=(e,t)=>e.parent===t.parent?1:2;Object(B.z)(HierarchyLayout,Transform,{transform(e,t){t.source&&t.source.root||Object(B.o)(this.constructor.name+" transform requires a backing tree data source.");const n=this.layout(e.method),r=this.fields,i=t.source.root,o=e.as||r;e.field?i.sum(e.field):i.count(),e.sort&&i.sort(stableCompare(e.sort,e=>e.data)),function setParams(r,i,o){for(let e,t=0,n=i.length;tfunction setFields(t,n,r){const i=t.data,o=n.length-1;for(let e=0;en.x&&(n=e),e.depth>r.depth&&(r=e)}),s=t===n?1:u(t,n)/2,i=s-t.x,o=A/(n.x+s+i),a=l/(r.depth||1),e.eachBefore(function(e){e.x=(e.x+i)*o,e.y=e.depth*a})),e}function firstWalk(e){var t=e.children,n=e.parent.children,r=e.i?n[e.i-1]:null;t?(function executeShifts(e){for(var t,n=0,r=0,i=e.children,o=i.length;0<=--o;)(t=i[o]).z+=n,t.m+=n,n+=t.s+(r+=t.c)}(e),t=(t[0].z+t[t.length-1].z)/2,r?(e.z=r.z+u(e._,r._),e.m=e.z-t):e.z=t):r&&(e.z=r.z+u(e._,r._)),e.parent.A=function apportion(e,t,n){if(t){for(var r,i=e,o=e,a=t,s=i.parent.children[0],A=i.m,l=o.m,c=a.m,g=s.m;a=nextRight(a),i=nextLeft(i),a&&i;)s=nextLeft(s),(o=nextRight(o)).a=e,0<(r=a.z+c-i.z-A+u(a._,i._))&&(function moveSubtree(e,t,n){var r=n/(t.i-e.i);t.c-=r,t.s+=n,e.c+=r,t.z+=n,t.m+=n}(function nextAncestor(e,t,n){return e.a.parent===t.parent?e.a:n}(a,e,n),e,r),A+=r,l+=r),c+=a.m,A+=i.m,g+=s.m,l+=o.m;a&&!nextRight(o)&&(o.t=a,o.m+=c-l),i&&!nextLeft(s)&&(s.t=i,s.m+=A-g,n=e)}return n}(e,r,e.parent.A||n[0])}function secondWalk(e){e._.x=e.z+e.parent.m,e.m+=e.parent.m}function sizeNode(e){e.x*=A,e.y=e.depth*l}return tree.separation=function(e){return arguments.length?(u=e,tree):u},tree.size=function(e){return arguments.length?(c=!1,A=+e[0],l=+e[1],tree):c?null:[A,l]},tree.nodeSize=function(e){return arguments.length?(c=!0,A=+e[0],l=+e[1],tree):c?[A,l]:null},tree},cluster:function(){var s=cluster_defaultSeparation,A=1,l=1,c=!1;function cluster(t){var n,r=0,e=(t.eachAfter(function(e){var t=e.children;t?(e.x=function meanX(e){return e.reduce(meanXReduce,0)/e.length}(t),e.y=function maxY(e){return 1+e.reduce(maxYReduce,0)}(t)):(e.x=n?r+=s(e,n):0,e.y=0,n=e)}),function leafLeft(e){for(var t;t=e.children;)e=t[0];return e}(t)),i=function leafRight(e){for(var t;t=e.children;)e=t[t.length-1];return e}(t),o=e.x-s(e,i)/2,a=i.x+s(i,e)/2;return t.eachAfter(c?function(e){e.x=(e.x-t.x)*A,e.y=(t.y-e.y)*l}:function(e){e.x=(e.x-o)/(a-o)*A,e.y=(1-(t.y?e.y/t.y:1))*l})}return cluster.separation=function(e){return arguments.length?(s=e,cluster):s},cluster.size=function(e){return arguments.length?(c=!1,A=+e[0],l=+e[1],cluster):c?null:[A,l]},cluster.nodeSize=function(e){return arguments.length?(c=!0,A=+e[0],l=+e[1],cluster):c?[A,l]:null},cluster}};le=["x","y","depth","children"];function Tree(e){HierarchyLayout.call(this,e)}function TreeLinks(e){Transform.call(this,[],e)}Tree.Definition={type:"Tree",metadata:{tree:!0,modifies:!0},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"tidy",values:["tidy","cluster"]},{name:"size",type:"number",array:!0,length:2},{name:"nodeSize",type:"number",array:!0,length:2},{name:"separation",type:"boolean",default:!0},{name:"as",type:"string",array:!0,length:le.length,default:le}]},Object(B.z)(Tree,HierarchyLayout,{layout(e){e=e||"tidy";if(Object(B.w)(KA,e))return KA[e]();Object(B.o)("Unrecognized Tree layout method: "+e)},params:["size","nodeSize"],fields:le}),TreeLinks.Definition={type:"TreeLinks",metadata:{tree:!0,generates:!0,changes:!0},params:[]},Object(B.z)(TreeLinks,Transform,{transform(e,t){const n=this.value,r=t.source&&t.source.root,i=t.fork(t.NO_SOURCE),o={};return r||Object(B.o)("TreeLinks transform requires a tree data source."),t.changed(t.ADD_REM)?(i.rem=n,t.visit(t.SOURCE,e=>o[tupleid(e)]=1),r.each(e=>{var t=e.data,e=e.parent&&e.parent.data;e&&o[tupleid(t)]&&o[tupleid(e)]&&i.add.push(ingest$1({source:e,target:t}))}),this.value=i.add):t.changed(t.MOD)&&(t.visit(t.MOD,e=>o[tupleid(e)]=1),n.forEach(e=>{(o[tupleid(e.source)]||o[tupleid(e.target)])&&i.mod.push(e)})),i}});const XA={binary:function(e,t,n,r,i){var o,a,h=e.children,s=h.length,p=new Array(s+1);for(p[0]=a=o=0;o>>1;p[g]{const t=n.tile();t.ratio&&n.tile(t.ratio(e))},n.method=e=>{Object(B.w)(XA,e)?n.tile(XA[e]):Object(B.o)("Unrecognized Treemap layout method: "+e)},n},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:be});const qA=4278190080,$A=268435456,el=.0625;function markBitmaps(e,t,n,r){const i=e.width,o=e.height,a=n||r,s=domCanvas(i,o).getContext("2d"),A=(t.forEach(e=>function vega_label_module_draw(t,e,n){if(!e.length)return;const r=e[0].mark.marktype;"group"===r?e.forEach(e=>{e.items.forEach(e=>vega_label_module_draw(t,e.items,n))}):Ei[r].draw(t,{items:n?e.map(vega_label_module_prepare):e})}(s,e,a)),new Uint32Array(s.getImageData(0,0,i,o).data.buffer)),l=e.bitmap(),c=a&&e.bitmap();let g,u,d,h,p;for(u=0;u~~((e+n)/r);return a.invert=e=>e*r-n,a.bitmap=()=>function Bitmap(l,i){const c=new Uint32Array(~~((l*i+rl)/rl));function _set(e,t){c[e]|=t}function _clear(e,t){c[e]&=t}return{array:c,get:(e,t)=>{t=t*l+e;return c[t>>>tl]&1<<(t&nl)},set:(e,t)=>{t=t*l+e;_set(t>>>tl,1<<(t&nl))},clear:(e,t)=>{t=t*l+e;_clear(t>>>tl,~(1<<(t&nl)))},getRange:(e,t,n,r)=>{let i=r,o,a,s,A;for(;i>=t;--i)if(o=i*l+e,a=i*l+n,(s=o>>>tl)==(A=a>>>tl)){if(c[s]&il[o&nl]&ol[1+(a&nl)])return!0}else{if(c[s]&il[o&nl])return!0;if(c[A]&ol[1+(a&nl)])return!0;for(let e=1+s;e{let i,o,a,s,A;for(;t<=r;++t)if(o=t*l+n,(a=(i=t*l+e)>>>tl)==(s=o>>>tl))_set(a,il[i&nl]&ol[1+(o&nl)]);else for(_set(a,il[i&nl]),_set(s,ol[1+(o&nl)]),A=1+a;A{let i,o,a,s,A;for(;t<=r;++t)if(o=t*l+n,(a=(i=t*l+e)>>>tl)==(s=o>>>tl))_clear(a,ol[i&nl]|il[1+(o&nl)]);else for(_clear(a,ol[i&nl]),_clear(s,il[1+(o&nl)]),A=1+a;Ae<0||t<0||i<=r||l<=n}}(i,o),a.ratio=r,a.padding=n,a.width=e,a.height=t,a}function vega_label_module_outOfBounds(e,t,n,r,i,o){let a=n/2;return e-a<0||e+a>i||t-(a=r/2)<0||t+a>o}function _outOfBounds(){return!1}function vega_label_module_collision(e,t,n,r,i,o,a,s){i=i*o/(2*r),r=e(t-i),t=e(t+i),i=e(n-(o/=2)),e=e(n+o);return a.outOfBounds(r,i,t,e)||a.getRange(r,i,t,e)||s&&s.getRange(r,i,t,e)}function _collision(e,t,n,r,i,o,a,s){i=i*o/(2*r);let A=e(t-i),l=e(t+i),c=e(n-(o/=2)),g=e(n+o);return A=0=o&&(o=u,t.x=c,t.y=g);return c=i/2,g=e/2,a=t.x-c,s=t.x+c,A=t.y-g,l=t.y+g,t.align="center",a<0&&s<=h?t.align="left":0<=a&&hn)return[o,a,s,!0]}}return function(t){var n=t.datum.datum.items[x].items,r=n.length,i=t.datum.fontSize,o=Bi.width(t.datum,t.datum.text);let a=_?i:0,s=!1,A=!1,l=0,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q,w;for(let e=0;eg&&(w=c,c=g,g=w),u>d&&(w=u,u=d,d=w),m=~~(((C=S(c))+(y=S(g)))/2),b=~~(((B=S(u))+(v=S(d)))/2),f=m;f>=C;--f)for(I=b;I>=B;--I)(Q=tryLabel(f,I,a,o,i))&&([t.x,t.y,a,s]=Q);for(f=m;f<=y;++f)for(I=b;I<=v;++I)(Q=tryLabel(f,I,a,o,i))&&([t.x,t.y,a,s]=Q);s||_||(E=Math.abs(g-c+d-u),h=(c+g)/2,p=(u+d)/2,E>=l&&!G(h,p,o,i,R,F)&&!D(S,h,p,i,o,i,N,null)&&(l=E,t.x=h,t.y=p,A=!0))}return!(!s&&!A)&&(h=o/2,p=i/2,N.setRange(S(t.x-h),S(t.y-p),S(t.x+h),S(t.y+p)),t.align="center",t.baseline="middle",!0)}},floodfill:function placeAreaLabelFloodFill(v,e,E,Q,t){const w=v.width,S=v.height,[_,x]=getTests(t),R=e[0],F=e[1],D=v.bitmap();return function(t){const n=t.datum.datum.items[Q].items,r=n.length,i=t.datum.fontSize,o=Bi.width(t.datum,t.datum.text),a=[];let s=E?i:0,A=!1,l=!1,c=0,g,u,d,h,p,f,I,C,m,y,B,b;for(let e=0;es&&(t.x=p,t.y=f,s=m,A=!0)}}A||E||(b=Math.abs(u-g+h-d),p=(g+u)/2,f=(d+h)/2,b>=c&&!x(p,f,o,i,w,S)&&!_(v,p,f,i,o,i,R,null)&&(c=b,t.x=p,t.y=f,l=!0))}return!(!A&&!l)&&(p=o/2,f=i/2,R.setRange(v(t.x-p),v(t.y-f),v(t.x+p),v(t.y+f)),t.align="center",t.baseline="middle",!0)}}};function labelLayout(e,t,n,r,i,o,a,s,A,l,c){if(!e.length)return e;const g=Math.max(r.length,i.length),u=function getOffsets(t,n){const r=new Float64Array(n),i=t.length;for(let e=0;e[e.x,e.x,e.x,e.y,e.y,e.y];return e?"line"===e||"area"===e?e=>i(e.datum):"line"===t?e=>{e=e.datum.items[r].items;return i(e.length?e["start"===n?0:e.length-1]:{x:NaN,y:NaN})}:e=>{e=e.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}:i}(h,p,s,A),C=null===l||l===1/0,m=scaler(t[0],t[1],C?0:l),y=f&&"naive"===c,B=e.map(e=>({datum:e,opacity:0,x:void 0,y:void 0,align:void 0,baseline:void 0,boundary:I(e)}));let b;if(!y){n&&B.sort((e,t)=>n(e.datum,t.datum));let t=!1;for(let e=0;ee.datum)].concat(o)),b=o.length?markBitmaps(m,o,t,f):function baseBitmaps(t,e){const n=t.bitmap();return(e||[]).forEach(e=>n.set(t(e.boundary[0]),t(e.boundary[3]))),[n,void 0]}(m,a&&B)}const v=f?gl[c](m,b,a,A,C):function placeMarkLabel(y,e,B,b,v){const E=y.width,Q=y.height,w=e[0],S=e[1],_=b.length;return function(t){var n=t.boundary,r=t.datum.fontSize;if(!v&&(n[2]<0||n[5]<0||n[0]>E||n[3]>Q))return!1;let i=0,o,a,s,A,l,c,g,u,d,h,p,f,I,C,m;for(let e=0;e<_;++e){if(o=(3&B[e])-1,a=(B[e]>>>2&3)-1,s=0==o&&0==a||b[e]<0,A=o&&a?Math.SQRT1_2:1,l=b[e]<0?-1:1,c=n[1+o]+b[e]*o*A,u=(p=n[4+a]+l*r*a/2+b[e]*a*A)-r/2,d=p+r/2,f=y(c),C=y(u),m=y(d),v&&(f=f<0?0:f,C=C<0?0:C,m=m>=y.height?y.height-1:m),!i){if(!vega_label_module_test(f,f,C,m,w,S,c,c,u,d,n,s))continue;i=Bi.width(t.datum,t.datum.text)}if(h=c+l*i*o/2,c=h-i/2,g=h+i/2,f=y(c),I=y(g),v&&(f=f<0?0:f,I=I>=y.width?y.width-1:I),vega_label_module_test(f,I,C,m,w,S,c,g,u,d,n,s))return t.x=o?o*l<0?g:c:h,t.y=a?a*l<0?d:u:p,t.align=Al[o*l+1],t.baseline=ll[a*l+1],w.setRange(f,C,I,m),!0}return!1}}(m,b,d,u,C);return B.forEach(e=>e.opacity=+v(e)),B}const ul=["x","y","opacity","align","baseline"],dl=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function Label(e){Transform.call(this,null,e)}function vega_regression_module_partition(e,t){function jSc(e){return e(o)}var n,r,i,o,a,s,A=[];if(null==t)A.push(e);else for(n={},r=0,i=e.length;r{const t=e.datum;t[r[0]]=e.x,t[r[1]]=e.y,t[r[2]]=e.opacity,t[r[3]]=e.align,t[r[4]]=e.baseline}),n.reflow(e).modifies(r)}}}),Loess.Definition={type:"Loess",metadata:{generates:!0},params:[{name:"x",type:"field",required:!0},{name:"y",type:"field",required:!0},{name:"groupby",type:"field",array:!0},{name:"bandwidth",type:"number",default:.3},{name:"as",type:"string",array:!0}]},Object(B.z)(Loess,Transform,{transform(e,t){const n=t.fork(t.NO_SOURCE|t.NO_FIELDS);if(!this.value||t.changed()||e.modified()){const r=t.materialize(t.SOURCE).source,i=vega_regression_module_partition(r,e.groupby),o=(e.groupby||[]).map(B.h),a=o.length,s=e.as||[Object(B.h)(e.x),Object(B.h)(e.y)],A=[];i.forEach(n=>{loess(n,e.x,e.y,e.bandwidth||.3).forEach(e=>{const t={};for(let e=0;e{if(n.length<=g)a.dataflow.warn("Skipping regression with more parameters than data points.");else{const t=d(n,o.x,o.y,c);if(o.params)h.push(ingest$1({keys:n.dims,coef:t.coef,rSquared:t.rSquared}));else{const e=i||Object(B.q)(n,o.x),r=e=>{const t={};for(let e=0;er([e,t.predict(e)])):sampleCurve(t.predict,e,25,200).forEach(r)}}}),this.value&&(e.rem=this.value),this.value=e.add=e.source=h}var t,n;return e}});const pl=Math.pow(2,-52),fl=new Uint32Array(512);class Delaunator{static from(t,n=function defaultGetX(e){return e[0]},r=function defaultGetY(e){return e[1]}){var i=t.length;const o=new Float64Array(2*i);for(let e=0;e>1;if(0>1;let t=1/0,n=1/0,i=-1/0,c=-1/0;for(let e=0;ei&&(i=g),u>c&&(c=u),this._ids[e]=e}var T=(t+i)/2,M=(n+c)/2;let d=1/0,h,p,f;for(let e=0;et&&(k[n++]=x,t=this._dists[x])}return this.hull=k.subarray(0,n),this.triangles=new Uint32Array(0),void(this.halfedges=new Uint32Array(0))}delaunator_orient(b,v,E,Q,S,_)&&(e=p,y=E,B=Q,p=f,E=S,Q=_,f=e,S=y,_=B);var R=function circumcenter(e,t,n,r,i,o){var n=n-e,r=r-t,i=i-e,o=o-t,a=n*n+r*r,s=i*i+o*o,A=.5/(n*o-r*i),e=e+(o*a-r*s)*A,o=t+(n*s-i*a)*A;return{x:e,y:o}}(b,v,E,Q,S,_);this._cx=R.x,this._cy=R.y;for(let e=0;e=33306690738754716e-32*Math.abs(r+i)?r-i:0}function delaunator_orient(e,t,n,r,i,o){return(orientIfSure(i,o,e,t,n,r)||orientIfSure(e,t,n,r,i,o)||orientIfSure(n,r,i,o,e,t))<0}function quicksort(n,r,i,o){if(o-i<=20)for(let t=i+1;t<=o;t++){var a=n[t],s=r[a];let e=t-1;for(;e>=i&&r[n[e]]>s;)n[e+1]=n[e--];n[e+1]=a}else{let e=i+1,t=o;delaunator_swap(n,i+o>>1,e),r[n[i]]>r[n[o]]&&delaunator_swap(n,i,o),r[n[e]]>r[n[o]]&&delaunator_swap(n,e,o),r[n[i]]>r[n[e]]&&delaunator_swap(n,i,e);for(var A=n[e],l=r[A];;){for(;r[n[++e]]l;);if(t=t-i?(quicksort(n,r,e,o),quicksort(n,r,i,t-1)):(quicksort(n,r,i,t-1),quicksort(n,r,e,o))}}function delaunator_swap(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}class path_Path{constructor(){this._x0=this._y0=this._x1=this._y1=null,this._=""}moveTo(e,t){this._+=`M${this._x0=this._x1=+e},`+(this._y0=this._y1=+t)}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")}lineTo(e,t){this._+=`L${this._x1=+e},`+(this._y1=+t)}arc(e,t,n){var r=(e=+e)+(n=+n),i=t=+t;if(n<0)throw new Error("negative radius");null===this._x1?this._+=`M${r},`+i:(1e-6=(t=+t)&&(i=+i)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=e,this._circumcenters=new Float64Array(2*e.points.length),this.vectors=new Float64Array(2*e.points.length),this.xmax=r,this.xmin=t,this.ymax=i,this.ymin=n,this._init()}update(){return this.delaunay.update(),this._init(),this}_init(){const{delaunay:{points:o,hull:t,triangles:a},vectors:n}=this,s=this.circumcenters=this._circumcenters.subarray(0,a.length/3*2);for(let e=0,t=0,n=a.length,r,i;e=this.ymax)return null;(o=(this.ymax-t)/r)=this.xmax)return null;(o=(this.xmax-e)/n)this.xmax?2:0)|(tthis.ymax?8:0)}}const Il=2*Math.PI,Cl=Math.pow;class delaunay_Delaunay{static from(e,t=function pointX(e){return e[0]},n=function pointY(e){return e[1]},r){return new delaunay_Delaunay("length"in e?function flatArray(t,n,r,i){const o=t.length,a=new Float64Array(2*o);for(let e=0;et).sort((e,t)=>n[2*e]-n[2*t]||n[2*e+1]-n[2*t+1]);var t=this.collinear[0],r=this.collinear[this.collinear.length-1],t=[n[2*t],n[2*t+1],n[2*r],n[2*r+1]],i=1e-8*Math.hypot(t[3]-t[1],t[2]-t[0]);for(let e=0,t=n.length/2;e>1);let l=e,c=Cl(t-A[2*e],2)+Cl(n-A[2*e+1],2);var g=r[e];let u=g;do{var d=s[u],h=Cl(t-A[2*d],2)+Cl(n-A[2*d+1],2);if(h>2),e=(e.width=(Bl<<5)/t,e.height=bl/t,e.getContext("2d"));return e.fillStyle=e.strokeStyle="red",e.textAlign="center",{context:e,ratio:t}}(domCanvas()),t=function zeroArray(e){var t=[],n=-1;for(;++n>5)*b[1]),n=null,r=p.length,i=-1,o=[],a=p.map(e=>({text:A(e),font:l(e),style:g(e),weight:u(e),rotate:d(e),size:~~(c(e)+1e-14),padding:h(e),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:e})).sort((e,t)=>t.size-e.size);++i>1,s.y=b[1]*(E()+.5)>>1,!function cloudSprite(e,t,n,r){if(!t.sprite){var i,o,a,s,A,l,c,g,u,d=e.context,h=e.ratio,p=(d.clearRect(0,0,(Bl<<5)/h,bl/h),0),f=0,I=0,C=n.length;for(--r;++r>5<<5,a=~~Math.max(Math.abs(c+g),Math.abs(c-g))):i=i+31>>5<<5,I>1))/h,(f+(a>>1))/h),t.rotate&&d.rotate(t.rotate*yl),d.fillText(t.text,0,0),t.padding&&(d.lineWidth=2*t.padding,d.strokeText(t.text,0,0)),d.restore(),t.width=i,t.height=a,t.xoff=p,t.yoff=f,t.x1=i>>1,t.y1=a>>1,t.x0=-t.x1,t.y0=-t.y1,t.hasText=!0,p+=i}for(var m=d.getImageData(0,0,(Bl<<5)/h,bl/h).data,y=[];0<=--r;)if((t=n[r]).hasText){for(i=t.width,o=i>>5,a=t.y1-t.y0,s=0;s>5),E=m[(f+A)*(Bl<<5)+(p+s)<<2]?1<<31-s%32:0;y[v]|=E,B|=E}B?b=A:(t.y0++,a--,A--,f++)}t.y1=t.y0+b,t.sprite=y.slice(0,(t.y1-t.y0)*o)}}}(e,s,a,i),s.hasText&&function place(e,t,n){var r,i,o=t.x,a=t.y,s=Math.sqrt(b[0]*b[0]+b[1]*b[1]),A=v(b),l=E()<.5?1:-1,c=-l;for(;(p=A(c+=l))&&(r=~~p[0],i=~~p[1],!(Math.min(Math.abs(r),Math.abs(i))>=s));)if(t.x=o+r,t.y=a+i,!(t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>b[0]||t.y+t.y1>b[1])&&(!n||!function cloudCollide(e,t,n){n>>=5;for(var r,i=e.sprite,o=e.width>>5,a=e.x-(o<<4),s=127&a,A=32-s,l=e.y1-e.y0,c=(e.y+e.y0)*n+(a>>5),g=0;g>>s:0))&t[c+u])return 1;c+=n}return}(t,e,b[0]))&&(!n||function collideRects(e,t){return e.x+e.x1>t[0].x&&e.x+e.x0t[0].y&&e.y+e.y0>5,h=b[0]>>5,p=t.x-(d<<4),f=127&p,I=32-f,C=t.y1-t.y0,m=(t.y+t.y0)*h+(p>>5),y=0;y>>f:0);m+=h}return t.sprite=null,1}return}(t,s,n)&&(o.push(s),n?function cloudBounds(e,t){var n=e[0],e=e[1];t.x+t.x0e.x&&(e.x=t.x+t.x1);t.y+t.y1>e.y&&(e.y=t.y+t.y1)}(n,s):n=[{x:s.x+s.x0,y:s.y+s.y0},{x:s.x+s.x1,y:s.y+s.y1}],s.x-=b[0]>>1,s.y-=b[1]>>1)}return o},t.words=function(e){return arguments.length?(p=e,t):p},t.size=function(e){return arguments.length?(b=[+e[0],+e[1]],t):b},t.font=function(e){return arguments.length?(l=functor(e),t):l},t.fontStyle=function(e){return arguments.length?(g=functor(e),t):g},t.fontWeight=function(e){return arguments.length?(u=functor(e),t):u},t.rotate=function(e){return arguments.length?(d=functor(e),t):d},t.text=function(e){return arguments.length?(A=functor(e),t):A},t.spiral=function(e){return arguments.length?(v=vl[e]||e,t):v},t.fontSize=function(e){return arguments.length?(c=functor(e),t):c},t.padding=function(e){return arguments.length?(h=functor(e),t):h},t.random=function(e){return arguments.length?(E=e,t):E},t}function archimedeanSpiral(e){var t=e[0]/e[1];return function(e){return[t*(e*=.1)*Math.cos(e),e*Math.sin(e)]}}function functor(e){return"function"==typeof e?e:function(){return e}}var vl={archimedean:archimedeanSpiral,rectangular:function rectangularSpiral(e){var n=4*e[0]/e[1],r=0,i=0;return function(e){var t=e<0?-1:1;switch(Math.sqrt(1+4*t*e)-t&3){case 0:r+=n;break;case 1:i+=4;break;case 2:r-=n;break;default:i-=4}return[r,i]}}};const El=["x","y","font","fontSize","fontStyle","fontWeight","angle"],Ql=["text","font","rotate","fontSize","fontStyle","fontWeight"];function Wordcloud(e){Transform.call(this,vega_wordcloud_module_cloud(),e)}Wordcloud.Definition={type:"Wordcloud",metadata:{modifies:!0},params:[{name:"size",type:"number",array:!0,length:2},{name:"font",type:"string",expr:!0,default:"sans-serif"},{name:"fontStyle",type:"string",expr:!0,default:"normal"},{name:"fontWeight",type:"string",expr:!0,default:"normal"},{name:"fontSize",type:"number",expr:!0,default:14},{name:"fontSizeRange",type:"number",array:"nullable",default:[10,50]},{name:"rotate",type:"number",expr:!0,default:0},{name:"text",type:"field"},{name:"spiral",type:"string",values:["archimedean","rectangular"]},{name:"padding",type:"number",expr:!0},{name:"as",type:"string",array:!0,length:7,default:El}]},Object(B.z)(Wordcloud,Transform,{transform(n,r){!n.size||n.size[0]&&n.size[1]||Object(B.o)("Wordcloud size dimensions must be non-zero.");var i=n.modified();if(i||r.changed(r.ADD_REM)||Ql.some(function modp(e){return e=n[e],Object(B.E)(e)&&r.modified(e.fields)})){const c=r.materialize(r.SOURCE).source,g=this.value,u=n.as||El;let e=n.fontSize||14,t;if(Object(B.E)(e)?t=n.fontSizeRange:e=Object(B.m)(e),t){const d=e,h=vega_scale_module_scale("sqrt")().domain(Object(B.q)(c,d)).range(t);e=e=>h(d(e))}c.forEach(e=>{e[u[0]]=NaN,e[u[1]]=NaN,e[u[3]]=0});var o=g.words(c).text(n.text).size(n.size||[500,500]).padding(n.padding||1).spiral(n.spiral||"archimedean").rotate(n.rotate||0).font(n.font||"sans-serif").fontStyle(n.fontStyle||"normal").fontWeight(n.fontWeight||"normal").fontSize(e).random(ee).layout(),a=g.size(),s=a[0]>>1,A=a[1]>>1,l=o.length;for(let e=0,t,n;et[e])};const _l=e=>new Uint8Array(e),xl=e=>new Uint16Array(e),Rl=e=>new Uint32Array(e);function Bitmaps(){let n=8,A=[],e=Rl(0),l=vega_crossfilter_module_array(0,n),c=vega_crossfilter_module_array(0,n);return{data:()=>A,seen:()=>e=function lengthen(e,t,n){return e.length>=t?e:((n=n||new e.constructor(t)).set(e),n)}(e,A.length),add(i){for(let e=0,t=A.length,n=i.length,r;eA.length,curr:()=>l,prev:()=>c,reset:e=>c[e]=l[e],all:()=>n<257?255:n<65537?65535:4294967295,set(e,t){l[e]|=t},clear(e,t){l[e]&=~t},resize(e,t){(l.lengthn)&&(n=Math.max(t,n),l=vega_crossfilter_module_array(e,n,l),c=vega_crossfilter_module_array(e,n))}}}function vega_crossfilter_module_array(e,t,n){const r=(t<257?_l:t<65537?xl:Rl)(e);return n&&r.set(n),r}function Dimension(e,t,n){const s=1<{e=n[e],t=n[t];return ec,size:()=>u}}function CrossFilter(e){Transform.call(this,Bitmaps(),e),this._indices=null,this._dims=null}function ResolveFilter(e){Transform.call(this,null,e)}CrossFilter.Definition={type:"CrossFilter",metadata:{},params:[{name:"fields",type:"field",array:!0,required:!0},{name:"query",type:"array",array:!0,required:!0,content:{type:"number",array:!0,length:2}}]},Object(B.z)(CrossFilter,Transform,{transform(e,t){return this._dims?e.modified("fields")||e.fields.some(e=>t.modified(e.fields))?this.reinit(e,t):this.eval(e,t):this.init(e,t)},init(e,t){const n=e.fields,r=e.query,i=this._indices={},o=this._dims=[],a=r.length;let s=0,A,l;for(;s{var e=o.remove(n,r);for(const t in i)i[t].reindex(e)})},update(e,t,n){var r=this._dims,i=e.query,o=t.stamp,a=r.length;let s=0,A,l;for(n.filters=0,l=0;ls[e]&n?null:a[e];return o.filter(o.MOD,l),i&i-1?(o.filter(o.ADD,e=>{var t=s[e]&n;return!t&&t^A[e]&n?a[e]:null}),o.filter(o.REM,e=>{var t=s[e]&n;return t&&!(t^(t^A[e]&n))?a[e]:null})):(o.filter(o.ADD,l),o.filter(o.REM,e=>(s[e]&n)===i?a[e]:null)),o.filter(o.SOURCE,e=>l(e._index))}});const Fl="Literal",Dl="CallExpression";function ASTNode(e){this.type=e}ASTNode.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function vega_expression_module_children(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case Dl:return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];case"Identifier":case Fl:default:return[]}}(this),n=0,r=t.length;n",Ee[3]="Identifier",Ee[4]="Keyword",Ee[5]="Null",Ee[6]="Numeric",Ee[Nl]="Punctuator",Ee[8]="String",Ee[9]="RegularExpression","ConditionalExpression"),Tl="Identifier",Ml="Unexpected token %0",Ul="Invalid regular expression",Ol="Invalid regular expression: missing /",Ll="Octal literals are not allowed in strict mode.",Pl="ILLEGAL",Vl="Disabled.",Zl=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Wl=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function assert(e,t){if(!e)throw new Error("ASSERT: "+t)}function isDecimalDigit(e){return 48<=e&&e<=57}function isHexDigit(e){return 0<="0123456789abcdefABCDEF".indexOf(e)}function isOctalDigit(e){return 0<="01234567".indexOf(e)}function isLineTerminator(e){return 10===e||13===e||8232===e||8233===e}function isIdentifierStart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||92===e||128<=e&&Zl.test(String.fromCharCode(e))}function isIdentifierPart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||48<=e&&e<=57||92===e||128<=e&&Wl.test(String.fromCharCode(e))}const Hl={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function skipComment(){for(;s>>="===(t=a.substr(s,4))?{type:Nl,value:t,start:n,end:s+=4}:">>>"===(t=t.substr(0,3))||"<<="===t||">>="===t?{type:Nl,value:t,start:n,end:s+=3}:i===(t=t.substr(0,2))[1]&&0<="+-<>&|".indexOf(i)||"=>"===t?{type:Nl,value:t,start:n,end:s+=2}:("//"===t&&throwError({},Ml,Pl),0<="<>=!+-*%&|^/".indexOf(i)?{type:Nl,value:i,start:n,end:++s}:void throwError({},Ml,Pl))}function scanNumericLiteral(){var e,t,n=a[s];if(assert(isDecimalDigit(n.charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=s,e="","."!==n){if(e=a[s++],n=a[s],"0"===e){if("x"===n||"X"===n)return++s,function scanHexLiteral(e){let t="";for(;s>10),56320+(t-65536&1023))}()):r+=scanHexEscape(t);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:isOctalDigit(t)?(0!==(n="01234567".indexOf(t))&&(i=!0),s{if(parseInt(t,16)<=1114111)return"x";throwError({},Ul)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){throwError({},Ul)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:s}}function advance(){if(skipComment(),wl<=s)return{type:Gl,start:s,end:s};var e=a.charCodeAt(s);return(isIdentifierStart(e)?scanIdentifier:40===e||41===e||59===e?scanPunctuator:39===e||34===e?scanStringLiteral:46===e?isDecimalDigit(a.charCodeAt(s+1))?scanNumericLiteral:scanPunctuator:isDecimalDigit(e)?scanNumericLiteral:scanPunctuator)()}function lex(){var e=c;return s=e.end,c=advance(),s=e.end,e}function peek(){var e=s;c=advance(),s=e}function finishBinaryExpression(e,t,n){const r=new ASTNode("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return r.operator=e,r.left=t,r.right=n,r}function finishIdentifier(e){const t=new ASTNode(Tl);return t.name=e,t}function finishLiteral(e){const t=new ASTNode("Literal");return t.value=e.value,t.raw=a.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function finishMemberExpression(e,t,n){const r=new ASTNode("MemberExpression");return r.computed="["===e,r.object=t,r.property=n,r.computed||(n.member=!0),r}function finishProperty(e,t,n){const r=new ASTNode("Property");return r.key=t,r.value=n,r.kind=e,r}function throwError(e,t){var n=Array.prototype.slice.call(arguments,2),t=t.replace(/%(\d)/g,(e,t)=>(assert(t":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function parseConditionalExpression(){var e,t=function parseBinaryExpression(){var e,t,n,r,i,o,a=c,s=parseUnaryExpression(),A=c,l=binaryPrecedence(A);if(0===l)return s;for(A.prec=l,lex(),e=[a,c],n=[s,A,parseUnaryExpression()];0<(l=binaryPrecedence(c));){for(;2function fncall(e,t,n,r){let i=o(t[0]);return n&&(i=n+"("+i+")",0===n.lastIndexOf("new ",0)&&(i="("+i+")")),i+"."+e+(r<0?"":0===r?"()":"("+t.slice(1).map(o).join(",")+")")}(t,e,n,r)}var e="new Date",t="String";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){e.length<3&&Object(B.o)("Missing arguments to clamp function."),3o+`["${e}"]`;let A={},l={},c=0;function visit(e){if(Object(B.J)(e))return e;const t=g[e.type];return null==t&&Object(B.o)("Unsupported type: "+e.type),t(e)}const g={Literal:e=>e.raw,Identifier:e=>{e=e.name;return 0{var t=!e.computed,n=visit(e.object),e=(t&&(c+=1),visit(e.property));return n===a&&(l[function stripQuotes(e){var t=e&&e.length-1;return t&&('"'===e[0]&&'"'===e[t]||"'"===e[0]&&"'"===e[t])?e.slice(1,-1):e}(e)]=1),t&&--c,n+(t?"."+e:"["+e+"]")},CallExpression:e=>{"Identifier"!==e.callee.type&&Object(B.o)("Illegal callee type: "+e.callee.type);const t=e.callee.name,n=e.arguments,r=Object(B.w)(i,t)&&i[t];return r||Object(B.o)("Unrecognized function: "+t),Object(B.E)(r)?r(n):r+"("+n.map(visit).join(",")+")"},ArrayExpression:e=>"["+e.elements.map(visit).join(",")+"]",BinaryExpression:e=>"("+visit(e.left)+" "+e.operator+" "+visit(e.right)+")",UnaryExpression:e=>"("+e.operator+visit(e.argument)+")",ConditionalExpression:e=>"("+visit(e.test)+"?"+visit(e.consequent)+":"+visit(e.alternate)+")",LogicalExpression:e=>"("+visit(e.left)+e.operator+visit(e.right)+")",ObjectExpression:e=>"{"+e.properties.map(visit).join(",")+"}",Property:e=>{c+=1;var t=visit(e.key);return--c,t+":"+visit(e.value)}};function codegen(e){e={code:visit(e),globals:Object.keys(A),fields:Object.keys(l)};return A={},l={},e}return codegen.functions=i,codegen.constants=r,codegen}var ve=Math.PI,zl=ve/2,Jl=ve/4,Kl=2*ve,Xl=180/ve,ql=ve/180,$l=Math.abs,ec=(Math.atan,Math.atan2),tc=Math.cos,nc=(Math.ceil,Math.exp,Math.floor,Math.hypot),rc=(Math.log,Math.pow,Math.sin),ic=(Math.sign,Math.sqrt);Math.tan;function node_modules_d3_geo_src_math_asin(e){return 1bounds_angle(A,l)&&(l=e):bounds_angle(e,l)>bounds_angle(A,l)&&(A=e):A<=l?(ebounds_angle(A,l)&&(l=e):bounds_angle(e,l)>bounds_angle(A,l)&&(A=e)):bc.push(vc=[A=e,l=e]),t>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?src_color_rgba(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?src_color_rgba(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Zc.exec(e))?new src_color_Rgb(t[1],t[2],t[3],1):(t=Wc.exec(e))?new src_color_Rgb(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Hc.exec(e))?src_color_rgba(t[1],t[2],t[3],t[4]):(t=jc.exec(e))?src_color_rgba(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Yc.exec(e))?src_color_hsla(t[1],t[2]/100,t[3]/100,1):(t=zc.exec(e))?src_color_hsla(t[1],t[2]/100,t[3]/100,t[4]):Jc.hasOwnProperty(e)?src_color_rgbn(Jc[e]):"transparent"===e?new src_color_Rgb(NaN,NaN,NaN,0):null}function src_color_rgbn(e){return new src_color_Rgb(e>>16&255,e>>8&255,255&e,1)}function src_color_rgba(e,t,n,r){return new src_color_Rgb(e=r<=0?t=n=NaN:e,t,n,r)}function src_color_rgbConvert(e){return(e=e instanceof src_color_Color?e:d3_color_src_color_color(e))?new src_color_Rgb((e=e.rgb()).r,e.g,e.b,e.opacity):new src_color_Rgb}function d3_color_src_color_rgb(e,t,n,r){return 1===arguments.length?src_color_rgbConvert(e):new src_color_Rgb(e,t,n,null==r?1:r)}function src_color_Rgb(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function src_color_rgb_formatHex(){return"#"+src_color_hex(this.r)+src_color_hex(this.g)+src_color_hex(this.b)}function src_color_rgb_formatRgb(){var e=this.opacity;return(1===(e=isNaN(e)?1:Math.max(0,Math.min(1,e)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===e?")":", "+e+")")}function src_color_hex(e){return((e=Math.max(0,Math.min(255,Math.round(e)||0)))<16?"0":"")+e.toString(16)}function src_color_hsla(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||1<=n?e=t=NaN:t<=0&&(e=NaN),new src_color_Hsl(e,t,n,r)}function src_color_hslConvert(e){if(e instanceof src_color_Hsl)return new src_color_Hsl(e.h,e.s,e.l,e.opacity);if(!(e=e instanceof src_color_Color?e:d3_color_src_color_color(e)))return new src_color_Hsl;if(e instanceof src_color_Hsl)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,A=(o+i)/2;return s?(a=t===o?(n-r)/s+6*(nrg?Math.pow(e,1/3):e/ng+tg}function lab_lab2xyz(e){return 6/29>>1;o(e[i],t)<0?n=1+i:r=i}return n}return 1===n.length&&(i=(e,t)=>n(e)-t,o=function vega_selection_module_ascendingComparator(n){return(e,t)=>function vega_selection_module_ascending(e,t){return e-i(e[r],t)?r-1:r},right:function right(e,t,n,r){for(null==n&&(n=0),null==r&&(r=e.length);n>>1;00<=t.indexOf(e)):t},R_union:function(e,t){var n=Object(B.eb)(t[0]),r=Object(B.eb)(t[1]);return rn&&(e[0]=n),e[1]r&&(e[1]=r),e):[n,r]}};function selectionVisitor(e,t,n,r){t[0].type!==Fl&&Object(B.o)("First argument to selection functions must be a string literal.");var i=t[0].value,o=":"+i;(2<=t.length&&Object(B.W)(t).value)!==ig||Object(B.w)(r,"@unit")||(r["@unit"]=n.getData(i).indataRef(n,"unit")),Object(B.w)(r,o)||(r[o]=n.getData(i).tuplesRef())}function vega_functions_module_data(e){e=this.context.data[e];return e?e.values.value:[]}We=r=>function(e,t){const n=this.context.dataflow.locale();return n[r](t)(e)},o=We("format");const fg=We("timeFormat");q=We("utcFormat"),le=We("timeParse"),He=We("utcParse");const Ig=new Date(2e3,0,1);function vega_functions_module_time(e,t,n){return Number.isInteger(e)&&Number.isInteger(t)?(Ig.setYear(2e3),Ig.setMonth(e),Ig.setDate(t),fg.call(this,Ig,n)):""}const Cg="%",mg="$";function dataVisitor(e,t,n,r){t[0].type!==Fl&&Object(B.o)("First argument to data functions must be a string literal.");var t=t[0].value,i=":"+t;if(!Object(B.w)(i,r))try{r[i]=n.getData(t).tuplesRef()}catch(e){}}function scaleVisitor(e,t,n,r){if(t[0].type===Fl)addScaleDependency(n,r,t[0].value);else for(e in n.scales)addScaleDependency(n,r,e)}function addScaleDependency(e,t,n){var r=Cg+n;if(!Object(B.w)(t,r))try{t[r]=e.scaleRef(n)}catch(e){}}function getScale(e,t){return Object(B.E)(e)?e:Object(B.J)(e)?(t=t.scales[e])&&t.value:void 0}function geoMethod(i,o){return function(e,t,n){if(e){const r=getScale(e,(n||this).context);return r&&r.path[i](t)}return o(t)}}be=geoMethod("area",function(e){return dc=new Adder,s6b(e,hc),2*dc}),Ee=geoMethod("bounds",function(e){var t,n,r,i,o,a,s;if(fc=l=-(A=pc=1/0),bc=[],s6b(e,Ec),n=bc.length){for(bc.sort(rangeCompare),t=1,o=[r=bc[0]];tbounds_angle(r[0],r[1])&&(r[1]=i[1]),bounds_angle(i[0],r[1])>bounds_angle(r[0],r[1])&&(r[0]=i[0])):o.push(r=i);for(a=-1/0,t=0,r=o[n=o.length-1];t<=n;r=i,++t)i=o[t],(s=bounds_angle(r[1],i[0]))>a&&(a=s,A=i[0],l=r[1])}return bc=vc=null,A===1/0||pc===1/0?[[NaN,NaN],[NaN,NaN]]:[[A,pc],[l,fc]]}),ve=geoMethod("centroid",function(e){Qc=wc=Sc=_c=xc=Rc=Fc=Dc=0,Gc=new Adder,Nc=new Adder,kc=new Adder,s6b(e,Pc);var e=+Gc,t=+Nc,n=+kc,r=nc(e,t,n);return r<1e-12&&(e=Rc,t=Fc,n=Dc,wc<1e-6&&(e=Sc,t=_c,n=xc),(r=nc(e,t,n))<1e-12)?[NaN,NaN]:[ec(t,e)*Xl,node_modules_d3_geo_src_math_asin(n/r)*Xl]});function vega_functions_module_log(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(e){t.warn(e)}return n[n.length-1]}function channel_luminance_value(e){e/=255;return e<=.03928?e/12.92:Math.pow((.055+e)/1.055,2.4)}function luminance(e){e=d3_color_src_color_rgb(e);return.2126*channel_luminance_value(e.r)+.7152*channel_luminance_value(e.g)+.0722*channel_luminance_value(e.b)}function equal(e,t){return e===t||e!=e&&t!=t||(Object(B.B)(e)?Object(B.B)(t)&&e.length===t.length&&function equalArray(n,r){for(let e=0,t=n.length;eequalObject(t,e)}const yg={};function vega_functions_module_array(e){return Object(B.B)(e)||ArrayBuffer.isView(e)?e:null}function sequence(e){return vega_functions_module_array(e)||(Object(B.J)(e)?e:null)}const Bg=e=>e.data;function treeNodes(e,t){t=vega_functions_module_data.call(t,e);return t.root&&t.root.lookup||{}}const bg=()=>"undefined"!=typeof window&&window||null;const vg={random(){return ee()},cumulativeNormal:cumulativeNormal,cumulativeLogNormal:cumulativeLogNormal,cumulativeUniform:cumulativeUniform,densityNormal:densityNormal,densityLogNormal:densityLogNormal,densityUniform:densityUniform,quantileNormal:quantileNormal,quantileLogNormal:quantileLogNormal,quantileUniform:quantileUniform,sampleNormal:sampleNormal,sampleLogNormal:sampleLogNormal,sampleUniform:sampleUniform,isArray:B.B,isBoolean:B.C,isDate:B.D,isDefined(e){return void 0!==e},isNumber:B.G,isObject:B.H,isRegExp:B.I,isString:B.J,isTuple:isTuple,isValid(e){return null!=e&&e==e},toBoolean:B.cb,toDate:B.db,toNumber:B.eb,toString:B.gb,indexof:function indexof(e,...t){return sequence(e).indexOf(...t)},join:function vega_functions_module_join(e,...t){return vega_functions_module_array(e).join(...t)},lastindexof:function lastindexof(e,...t){return sequence(e).lastIndexOf(...t)},replace:function vega_functions_module_replace(e,t,n){return Object(B.E)(n)&&Object(B.o)("Function argument passed to replace."),String(e).replace(t,n)},reverse:function vega_functions_module_reverse(e){return vega_functions_module_array(e).slice().reverse()},slice:function vega_functions_module_slice(e,...t){return sequence(e).slice(...t)},flush:B.v,lerp:B.L,merge:function vega_functions_module_merge(){const e=[].slice.call(arguments);return e.unshift({}),Object(B.p)(...e)},pad:B.R,peek:B.W,pluck:function pluck(e,t){const n=yg[t]||(yg[t]=Object(B.u)(t));return Object(B.B)(e)?e.map(n):n(e)},span:B.Z,inrange:B.A,truncate:B.hb,rgb:d3_color_src_color_rgb,lab:src_lab_lab,hcl:lab_hcl,hsl:src_color_hsl,luminance:luminance,contrast:function contrast(e,t){return e=luminance(e),t=luminance(t),(Math.max(e,t)+.05)/(Math.min(e,t)+.05)},sequence:se,format:o,utcFormat:q,utcParse:He,utcOffset:h.w,utcSequence:h.x,timeFormat:fg,timeParse:le,timeOffset:h.q,timeSequence:h.r,timeUnitSpecifier:h.s,monthFormat:function monthFormat(e){return vega_functions_module_time.call(this,e,1,"%B")},monthAbbrevFormat:function monthAbbrevFormat(e){return vega_functions_module_time.call(this,e,1,"%b")},dayFormat:function dayFormat(e){return vega_functions_module_time.call(this,0,2+e,"%A")},dayAbbrevFormat:function dayAbbrevFormat(e){return vega_functions_module_time.call(this,0,2+e,"%a")},quarter:B.X,utcquarter:B.jb,week:h.A,utcweek:h.z,dayofyear:h.m,utcdayofyear:h.y,warn:function warn(){return vega_functions_module_log(this.context.dataflow,"warn",arguments)},info:function info(){return vega_functions_module_log(this.context.dataflow,"info",arguments)},debug:function debug(){return vega_functions_module_log(this.context.dataflow,"debug",arguments)},extent:B.q,inScope:function inScope(e){var t=this.context.group;let n=!1;if(t)for(;e;){if(e===t){n=!0;break}e=e.mark.group}return n},intersect:function vega_functions_module_intersect(e,t,n){if(!e)return[];var[e,r]=e,e=(new Bounds).set(e[0],e[1],r[0],r[1]);return vega_scenegraph_module_intersect(n||this.context.dataflow.scenegraph().root,e,function vega_functions_module_filter(e){let t=null;if(e){const n=Object(B.i)(e.marktype),r=Object(B.i)(e.markname);t=t=>(!n.length||n.some(e=>t.marktype===e))&&(!r.length||r.some(e=>t.name===e))}return t}(t))},clampRange:B.k,pinchDistance:function pinchDistance(e){var t=(e=e.touches)[0].clientX-e[1].clientX,e=e[0].clientY-e[1].clientY;return Math.sqrt(t*t+e*e)},pinchAngle:function pinchAngle(e){return e=e.touches,Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)},screen:function screen(){var e=bg();return e?e.screen:{}},containerSize:function containerSize(){const e=this.context.dataflow,t=e.container&&e.container();return t?[t.clientWidth,t.clientHeight]:[void 0,void 0]},windowSize:function windowSize(){var e=bg();return e?[e.innerWidth,e.innerHeight]:[void 0,void 0]},bandspace:function bandspace(e,t,n){return bandSpace(e||0,t||0,n||0)},setdata:function setdata(e,t){const n=this.context.dataflow,r=this.context.data[e],i=r.input;return n.pulse(i,n.changeset().remove(B.ib).insert(t)),1},pathShape:function pathShape(t){let n=null;return function(e){return e?pathRender(e,n=n||pathParse(t)):t}},panLinear:B.S,panLog:B.T,panPow:B.U,panSymlog:B.V,zoomLinear:B.nb,zoomLog:B.ob,zoomPow:B.pb,zoomSymlog:B.qb,encode:function vega_functions_module_encode(e,t,n){if(e){const r=this.context.dataflow,i=e.mark.source;r.pulse(i,r.changeset().encode(e,t))}return void 0!==n?n:e},modify:function vega_functions_module_modify(e,t,n,r,i,o){const a=this.context.dataflow,s=this.context.data[e],A=s.input,l=a.stamp();let c=s.changes,g,u;if(!1===a._trigger||!(A.value.length||t||r))return 0;if((!c||c.stamp{s.modified=!0,a.pulse(A,c).run()},!0,1)),n&&(g=!0===n?B.ib:Object(B.B)(n)||isTuple(n)?n:removePredicate(n),c.remove(g)),t&&c.insert(t),r&&(g=removePredicate(r),A.value.some(g)?c.remove(g):c.insert(r)),i)for(u in o)c.modify(i,u,o[u]);return 1}},Eg=["view","item","group","xy","x","y"],Qg="this.",wg={},Sg={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:e=>`_[${Object(B.bb)(mg+e)}]`,functions:function buildFunctions(e){const t=Functions(e);Eg.forEach(e=>t[e]="event.vega."+e);for(const n in vg)t[n]=Qg+n;return Object(B.p)(t,function internalScaleFunctions(t,e,n){e.__bandwidth=e=>e&&e.bandwidth?e.bandwidth():0,n._bandwidth=scaleVisitor,n._range=scaleVisitor,n._scale=scaleVisitor;const r=e=>"_["+(e.type===Fl?Object(B.bb)(Cg+e.value):Object(B.bb)(Cg)+"+"+t(e))+"]";return{_bandwidth:e=>`this.__bandwidth(${r(e[0])})`,_range:e=>r(e[0])+".range()",_scale:e=>`${r(e[0])}(${t(e[1])})`}}(e,vg,wg)),t},constants:Yl,visitors:wg},_g=vega_expression_module_codegen(Sg);function expressionFunction(e,t,n){return 1===arguments.length?vg[e]:(vg[e]=t,n&&(wg[e]=n),_g&&(_g.functions[e]=Qg+e),this)}function vega_functions_module_parser(t,r){const i={};let e;try{t=Object(B.J)(t)?t:Object(B.bb)(t)+"",e=parser(t)}catch(e){Object(B.o)("Expression parse error: "+t)}e.visit(e=>{if(e.type===Dl){const t=e.callee.name,n=Sg.visitors[t];n&&n(t,e.arguments,r,i)}});const n=_g(e);return n.globals.forEach(e=>{var t=mg+e;!Object(B.w)(i,t)&&r.getSignal(e)&&(i[t]=r.signalRef(e))}),{$expr:Object(B.p)({code:n.code},r.options.ast?{ast:e}:null),$fields:n.fields,$params:i}}expressionFunction("bandwidth",function vega_functions_module_bandwidth(e,t){const n=getScale(e,(t||this).context);return n&&n.bandwidth?n.bandwidth():0},scaleVisitor),expressionFunction("copy",function vega_functions_module_copy(e,t){const n=getScale(e,(t||this).context);return n?n.copy():void 0},scaleVisitor),expressionFunction("domain",function vega_functions_module_domain(e,t){const n=getScale(e,(t||this).context);return n?n.domain():[]},scaleVisitor),expressionFunction("range",function vega_functions_module_range(e,t){const n=getScale(e,(t||this).context);return n&&n.range?n.range():[]},scaleVisitor),expressionFunction("invert",function vega_functions_module_invert(e,t,n){const r=getScale(e,(n||this).context);return r?(Object(B.B)(t)?r.invertRange||r.invert:r.invert||r.invertExtent)(t):void 0},scaleVisitor),expressionFunction("scale",function vega_functions_module_scale(e,t,n){const r=getScale(e,(n||this).context);return r?r(t):void 0},scaleVisitor),expressionFunction("gradient",function scaleGradient(t,e,n,r,i){t=getScale(t,(i||this).context);const o=Gradient(e,n);let a=t.domain(),s=a[0],A=Object(B.W)(a),l=B.y;return A-s?l=scaleFraction(t,s,A):t=(t.interpolator?vega_scale_module_scale("sequential")().interpolator(t.interpolator()):vega_scale_module_scale("linear")().interpolate(t.interpolate()).range(t.range())).domain([s=0,A=1]),t.ticks&&(a=t.ticks(+r||15),s!==a[0]&&a.unshift(s),A!==Object(B.W)(a)&&a.push(A)),a.forEach(e=>o.stop(l(e),t(e))),o},scaleVisitor),expressionFunction("geoArea",be,scaleVisitor),expressionFunction("geoBounds",Ee,scaleVisitor),expressionFunction("geoCentroid",ve,scaleVisitor),expressionFunction("geoShape",function geoShape(e,t,n){const r=getScale(e,(n||this).context);return function(e){return r?r.path.context(e)(t):""}},scaleVisitor),expressionFunction("indata",function indata(e,t,n){const r=this.context.data[e]["index:"+t],i=r?r.value.get(n):void 0;return i&&i.count},function indataVisitor(e,t,n,r){t[0].type!==Fl&&Object(B.o)("First argument to indata must be a string literal."),t[1].type!==Fl&&Object(B.o)("Second argument to indata must be a string literal.");var i=t[0].value,o="@"+(t=t[1].value);Object(B.w)(o,r)||(r[o]=n.getData(i).indataRef(n,t))}),expressionFunction("data",vega_functions_module_data,dataVisitor),expressionFunction("treePath",function treePath(e,t,n){const r=treeNodes(e,this),i=r[t],o=r[n];return i&&o?i.path(o).map(Bg):void 0},dataVisitor),expressionFunction("treeAncestors",function treeAncestors(e,t){const n=treeNodes(e,this)[t];return n?n.ancestors().map(Bg):void 0},dataVisitor),expressionFunction("vlSelectionTest",function selectionTest(e,t,n){for(var r,i,o,a,s,A=(e=this.context.data[e])?e.values.value:[],l=e?e[cg]&&e[cg].value:void 0,c=n===ig,g=A.length,u=0;u(e[o[n].field]=t,e),{}))}return r=r||"union",Object.keys(h).forEach(n=>{h[n]=Object.keys(h[n]).map(e=>h[n][e]).reduce((e,t)=>void 0===e?t:pg[f[n]+"_"+r](e,t))}),d=Object.keys(p),t&&d.length&&(h[n?"vlPoint":"vlMulti"]="union"===r?{or:d.reduce((e,t)=>(e.push(...p[t]),e),[])}:{and:d.map(e=>({or:p[e]}))}),h},selectionVisitor),expressionFunction("vlSelectionTuples",function selectionTuples(e,n){return e.map(t=>Object(B.p)({values:n.fields.map(e=>(e.getter||(e.getter=Object(B.u)(e.field)))(t.datum))},n))});const xg=Object(B.fb)(["rule"]),Rg=Object(B.fb)(["group","image","rect"]);function canonicalType(e){return(e+"").toLowerCase()}function expression(e,t,n){";"!==n[n.length-1]&&(n="return("+n+");");const r=Function(...t.concat(n));return e&&e.functions?r.bind(e.functions):r}var Fg={operator:(e,t)=>expression(e,["_"],t.code),parameter:(e,t)=>expression(e,["datum","_"],t.code),event:(e,t)=>expression(e,["event"],t.code),handler:(e,t)=>{return expression(e,["_","event"],"var datum=event.item&&event.item.datum;return ".concat(t.code,";"))},encode:(e,t)=>{var{marktype:t,channels:n}=t;let r="var o=item,datum=o.datum,m=0,$;";for(const o in n){var i="o["+Object(B.bb)(o)+"]";r+="$=".concat(n[o].code,";if(").concat(i,"!==$)").concat(i,"=$,m=1;")}return expression(e,["item","_"],r=r+function adjustSpatial(e,t){let n="";return xg[t]||(e.x2&&(e.x?(Rg[t]&&(n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"),n+="o.width=o.x2-o.x;"):n+="o.x=o.x2-(o.width||0);"),e.xc&&(n+="o.x=o.xc-(o.width||0)/2;"),e.y2&&(e.y?(Rg[t]&&(n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"),n+="o.height=o.y2-o.y;"):n+="o.y=o.y2-(o.height||0);"),e.yc&&(n+="o.y=o.yc-(o.height||0)/2;")),n}(n,t)+"return m;")},codegen:{get(e){e="[".concat(e.map(B.bb).join("]["),"]");const t=Function("_","return _".concat(e,";"));return t.path=e,t},comparator(e,o){let a;const t=Function("a","b","var u, v; return "+e.map((e,t)=>{var n=o[t];let r,i;return i=e.path?(r="a".concat(e.path),"b".concat(e.path)):((a=a||{})["f"+t]=e,r="this.f".concat(t,"(a)"),"this.f".concat(t,"(b)")),function _compare(e,t,n,r){return"((u = ".concat(e,") < (v = ").concat(t,") || u == null) && v != null ? ").concat(n,"\n : (u > v || v == null) && u != null ? ").concat(r,"\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ").concat(n,"\n : v !== v && u === u ? ").concat(r," : ")}(r,i,-n,n)}).join("")+"0;");return a?t.bind(a):t}}};function parseParameter(r,i,o){if(!r||!Object(B.H)(r))return r;for(let e=0,t=Dg.length,n;ee&&e.$tupleid?tupleid:e);return t.fn[n]||(t.fn[n]=Object(B.l)(r,e.$order,t.expr.codegen))}},{key:"$context",parse:function vega_runtime_module_getContext(e,t){return t}},{key:"$subflow",parse:function getSubflow(e,a){const s=e.$subflow;return function(e,t,n){const r=a.fork().parse(s),i=r.get(s.operators[0].id),o=r.signals.parent;return o&&o.set(n),i.detachSubflow=()=>a.detach(r),i}}},{key:"$tupleid",parse:function getTupleId(){return tupleid}}];const Gg={skip:!0};function vega_runtime_module_context(e,t,n,r){return new Context(e,t,n,r)}function Context(e,t,n,r){this.dataflow=e,this.transforms=t,this.events=e.events.bind(e),this.expr=r||Fg,this.signals={},this.scales={},this.nodes={},this.data={},this.fn={},n&&(this.functions=Object.create(n),this.functions.context=this)}function Subcontext(e){this.dataflow=e.dataflow,this.transforms=e.transforms,this.events=e.events,this.expr=e.expr,this.signals=Object.create(e.signals),this.scales=Object.create(e.scales),this.nodes=Object.create(e.nodes),this.data=Object.create(e.data),this.fn=Object.create(e.fn),e.functions&&(this.functions=Object.create(e.functions),this.functions.context=this)}Context.prototype=Subcontext.prototype={fork(){var e=new Subcontext(this);return(this.subcontext||(this.subcontext=[])).push(e),e},detach(t){this.subcontext=this.subcontext.filter(e=>e!==t);var e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const r of e)t.nodes[r].detach();t.nodes=null},get(e){return this.nodes[e]},set(e,t){return this.nodes[e]=t},add(t,n){const r=this,i=r.dataflow,o=t.value;if(r.set(t.id,n),function isCollect(e){return"collect"===canonicalType(e)}(t.type)&&o&&(o.$ingest?i.ingest(n,o.$ingest,o.$format):o.$request?i.preload(n,o.$request,o.$format):i.pulse(n,i.changeset().insert(o))),t.root&&(r.root=n),t.parent){let e=r.get(t.parent.$ref);e?(i.connect(e,[n]),n.targets().add(e)):(r.unresolved=r.unresolved||[]).push(()=>{e=r.get(t.parent.$ref),i.connect(e,[n]),n.targets().add(e)})}if(t.signal&&(r.signals[t.signal]=n),t.scale&&(r.scales[t.scale]=n),t.data)for(const e in t.data){const o=r.data[e]||(r.data[e]={});t.data[e].forEach(e=>o[e]=n)}},resolve(){return(this.unresolved||[]).forEach(e=>e()),delete this.unresolved,this},operator(e,t){this.add(e,this.dataflow.add(e.value,t))},transform(e,t){this.add(e,this.dataflow.add(this.transforms[canonicalType(t)]))},stream(e,t){this.set(e.id,t)},update(e,t,n,r,i){this.dataflow.on(t,n,r,i,e.options)},operatorExpression(e){return this.expr.operator(this,e)},parameterExpression(e){return this.expr.parameter(this,e)},eventExpression(e){return this.expr.event(this,e)},handlerExpression(e){return this.expr.handler(this,e)},encodeExpression(e){return this.expr.encode(this,e)},parse:function vega_runtime_module_parse(e){const t=this,n=e.operators||[];return e.background&&(t.background=e.background),e.eventConfig&&(t.eventConfig=e.eventConfig),e.locale&&(t.locale=e.locale),n.forEach(e=>t.parseOperator(e)),n.forEach(e=>t.parseOperatorParameters(e)),(e.streams||[]).forEach(e=>t.parseStream(e)),(e.updates||[]).forEach(e=>t.parseUpdate(e)),t.resolve()},parseOperator:function parseOperator(e){!function isOperator(e){return"operator"===canonicalType(e)}(e.type)&&e.type?this.transform(e,e.type):this.operator(e,e.update?this.operatorExpression(e.update):null)},parseOperatorParameters:function parseOperatorParameters(e){if(e.params){const t=this.get(e.id);t||Object(B.o)("Invalid operator id: "+e.id),this.dataflow.connect(t,t.parameters(this.parseParameters(e.params),e.react,e.initonly))}},parseParameters:function parseParameters(e,t){t=t||{};const n=this;for(const r in e){const i=e[r];t[r]=Object(B.B)(i)?i.map(e=>parseParameter(e,n,t)):parseParameter(i,n,t)}return t},parseStream:function parseStream(e){var t,n=this,r=null!=e.filter?n.eventExpression(e.filter):void 0,i=null!=e.stream?n.get(e.stream):void 0;e.source?i=n.events(e.source,e.type,r):e.merge&&(i=(t=e.merge.map(e=>n.get(e)))[0].merge.apply(t[0],t.slice(1))),e.between&&(t=e.between.map(e=>n.get(e)),i=i.between(t[0],t[1])),e.filter&&(i=i.filter(r)),null!=e.throttle&&(i=i.throttle(+e.throttle)),null==(i=null!=e.debounce?i.debounce(+e.debounce):i)&&Object(B.o)("Invalid stream definition: "+JSON.stringify(e)),e.consume&&i.consume(!0),n.stream(e,i)},parseUpdate:function parseUpdate(e){var t,n=Object(B.H)(n=e.source)?n.$ref:n,n=this.get(n),r=e.update,i=void 0;n||Object(B.o)("Source not defined: "+e.source),t=e.target&&e.target.$expr?this.eventExpression(e.target.$expr):this.get(e.target),r&&r.$expr&&(r.$params&&(i=this.parseParameters(r.$params)),r=this.handlerExpression(r.$expr)),this.update(e,n,t,r,i)},getState:function getState(n){var r,i,o=this,e={};return n.signals&&(r=e.signals={},Object.keys(o.signals).forEach(e=>{var t=o.signals[e];n.signals(e,t)&&(r[e]=t.value)})),n.data&&(i=e.data={},Object.keys(o.data).forEach(e=>{var t=o.data[e];n.data(e,t)&&(i[e]=t.input.value)})),o.subcontext&&!1!==n.recurse&&(e.subcontext=o.subcontext.map(e=>e.getState(n))),e},setState:function setState(e){var r=this,t=r.dataflow,n=e.data,i=e.signals;Object.keys(i||{}).forEach(e=>{t.update(r.signals[e],i[e],Gg)}),Object.keys(n||{}).forEach(e=>{t.pulse(r.data[e].input,t.changeset().remove(B.ib).insert(n[e]))}),(e.subcontext||[]).forEach((e,t)=>{const n=r.subcontext[t];n&&n.setState(e)})}};var Ng=t(472);function ariaLabel(e,t){e&&(null==t?e.removeAttribute("aria-label"):e.setAttribute("aria-label",t))}const kg="default";function setCursor(e,t){const n=e.globalCursor()?"undefined"!=typeof document&&document.body:e.container();if(n)return null==t?n.style.removeProperty("cursor"):n.style.cursor=t}function dataref(e,t){e=e._runtime.data;return Object(B.w)(e,t)||Object(B.o)("Unrecognized data set: "+t),e[t]}function change(e,t){isChangeSet(t)||Object(B.o)("Second argument to changes must be a changeset.");const n=dataref(this,e);return n.modified=!0,this.pulse(n.input,t)}function vega_view_module_width(e){var t=e.padding();return Math.max(0,e._viewWidth+t.left+t.right)}function vega_view_module_height(e){var t=e.padding();return Math.max(0,e._viewHeight+t.top+t.bottom)}function vega_view_module_offset(e){var t=e.padding(),e=e._origin;return[t.left+e[0],t.top+e[1]]}function eventExtend(e,t,n){var r,i,o=e._renderer,o=o&&o.canvas();return o&&(i=vega_view_module_offset(e),(r=vega_scenegraph_module_point(t.changedTouches?t.changedTouches[0]:t,o))[0]-=i[0],r[1]-=i[1]),t.dataflow=e,t.item=n,t.vega=function extension(e,r,n){const i=r?"group"===r.mark.marktype?r:r.mark.group:null;function group(e){var t,n=i;if(e)for(t=r;t;t=t.mark.group)if(t.mark.name===e){n=t;break}return n&&n.mark&&n.mark.interactive?n:{}}function xy(e){if(!e)return n;Object(B.J)(e)&&(e=group(e));const t=n.slice();for(;e;)t[0]-=e.x||0,t[1]-=e.y||0,e=e.mark&&e.mark.group;return t}return{view:Object(B.m)(e),item:Object(B.m)(r||{}),group:group,xy:xy,x:e=>xy(e)[0],y:e=>xy(e)[1]}}(e,n,r),t}const Tg={trap:!1};function trackEventListener(e,t,n,r){e._eventListeners.push({type:n,sources:Object(B.i)(t),handler:r})}function permit(e,t,n){var r=e._eventConfig&&e._eventConfig[t];if(!1!==r&&(!Object(B.H)(r)||r[n]))return 1;e.warn(`Blocked ${t} ${n} event listener.`)}function itemFilter(e){return e.item}function markTarget(e){return e.item.mark.source}function invoke(n){return function(e,t){return t.vega.view().changeset().encode(t.item,n)}}function vega_view_module_element(e,t,n){const r=document.createElement(e);for(const i in t)r.setAttribute(i,t[i]);return null!=n&&(r.textContent=n),r}const Mg="vega-bind",Ug="vega-bind-name",Og="vega-bind-radio";function vega_view_module_target(e,t,n,r){const i=n.event||"input";var o=()=>e.update(t.value);r.signal(n.signal,t.value),t.addEventListener(i,o),trackEventListener(r,t,i,o),e.set=e=>{t.value=e,t.dispatchEvent(function vega_view_module_event(e){return"undefined"!=typeof Event?new Event(e):{type:e}}(i))}}function vega_view_module_generate(e,t,n,r){r=r.signal(n.signal);const i=vega_view_module_element("div",{class:Mg}),o="radio"===n.input?i:i.appendChild(vega_view_module_element("label"));o.appendChild(vega_view_module_element("span",{class:Ug},n.name||n.signal)),t.appendChild(i);let a=vega_view_module_form;switch(n.input){case"checkbox":a=vega_view_module_checkbox;break;case"select":a=vega_view_module_select;break;case"radio":a=vega_view_module_radio;break;case"range":a=vega_view_module_range}a(e,o,n,r)}function vega_view_module_form(e,t,n,r){const i=vega_view_module_element("input");for(const o in n)"signal"!==o&&"element"!==o&&i.setAttribute("input"===o?"type":o,n[o]);i.setAttribute("name",n.signal),i.value=r,t.appendChild(i),i.addEventListener("input",()=>e.update(i.value)),e.elements=[i],e.set=e=>i.value=e}function vega_view_module_checkbox(e,t,n,r){const i={type:"checkbox",name:n.signal},o=(r&&(i.checked=!0),vega_view_module_element("input",i));t.appendChild(o),o.addEventListener("change",()=>e.update(o.checked)),e.elements=[o],e.set=e=>o.checked=!!e||null}function vega_view_module_select(e,t,r,i){const o=vega_view_module_element("select",{name:r.signal}),a=r.labels||[];r.options.forEach((e,t)=>{const n={value:e};valuesEqual(e,i)&&(n.selected=!0),o.appendChild(vega_view_module_element("option",n,(a[t]||e)+""))}),t.appendChild(o),o.addEventListener("change",()=>{e.update(r.options[o.selectedIndex])}),e.elements=[o],e.set=n=>{for(let e=0,t=r.options.length;e{const n={type:"radio",name:a.signal,value:e},r=(valuesEqual(e,s)&&(n.checked=!0),vega_view_module_element("input",n)),i=(r.addEventListener("change",()=>o.update(e)),vega_view_module_element("label",{},(l[t]||e)+""));return i.prepend(r),A.appendChild(i),r}),o.set=t=>{const n=o.elements,r=n.length;for(let e=0;e{A.textContent=s.value,e.update(+s.value)};s.addEventListener("input",n),s.addEventListener("change",n),e.elements=[s],e.set=e=>{s.value=e,A.textContent=e}}function valuesEqual(e,t){return e===t||e+""==t+""}function initializeRenderer(e,t,n,r,i,o){return(t=t||new r(e.loader())).initialize(n,vega_view_module_width(e),vega_view_module_height(e),vega_view_module_offset(e),i,o).background(e.background())}function trap(t,e){return e?function(){try{e.apply(this,arguments)}catch(e){t.error(e)}}:null}function vega_view_module_lookup(t,n,e){if("string"==typeof n){if("undefined"==typeof document)return t.error("DOM document instance not found."),null;if(!(n=document.querySelector(n)))return t.error("Signal bind element not found: "+n),null}if(n&&e)try{n.innerHTML=""}catch(e){n=null,t.error(e)}return n}const Lg=e=>+e||0;function vega_view_module_padding(e){return Object(B.H)(e)?{top:Lg(e.top),bottom:Lg(e.bottom),left:Lg(e.left),right:Lg(e.right)}:{top:e=+e||0,bottom:e,left:e,right:e}}async function renderHeadless(e,t,n,r){var i=renderModule(t),i=i&&i.headless;return i||Object(B.o)("Unrecognized renderer type: "+t),await e.runAsync(),initializeRenderer(e,null,null,i,n,r).renderAsync(e._scenegraph.root)}var Pg="width",Vg="height",Zg="padding",Wg={skip:!0};function viewWidth(e,t){var n=e.autosize(),e=e.padding();return t-(n&&n.contains===Zg?e.left+e.right:0)}function viewHeight(e,t){var n=e.autosize(),e=e.padding();return t-(n&&n.contains===Zg?e.top+e.bottom:0)}function dataTest(e,t){return t.modified&&Object(B.B)(t.input.value)&&e.indexOf("_:vega:_")}function signalTest(e,t){return!("parent"===e||t instanceof J.proxy)}function vega_view_module_defaultTooltip(e,t,n,r){const i=e.element();i&&i.setAttribute("title",function formatTooltip(e){return null==e?"":Object(B.B)(e)?formatArray(e):Object(B.H)(e)&&!Object(B.D)(e)?function formatObject(n){return Object.keys(n).map(e=>{var t=n[e];return e+": "+(Object(B.B)(t)?formatArray:vega_view_module_formatValue)(t)}).join("\n")}(e):e+""}(r))}function formatArray(e){return"["+e.map(vega_view_module_formatValue).join(", ")+"]"}function vega_view_module_formatValue(e){return Object(B.B)(e)?"[…]":Object(B.H)(e)&&!Object(B.D)(e)?"{…}":e}function View(e,t){var n,r=this;t=t||{},Dataflow.call(r),t.loader&&r.loader(t.loader),t.logger&&r.logger(t.logger),null!=t.logLevel&&r.logLevel(t.logLevel),(t.locale||e.locale)&&(n=Object(B.p)({},e.locale,t.locale),r.locale(Object(O.b)(n.number,n.time))),r._el=null,r._elBind=null,r._renderType=t.renderer||so.Canvas,r._scenegraph=new Scenegraph;const i=r._scenegraph.root,o=(r._renderer=null,r._tooltip=t.tooltip||vega_view_module_defaultTooltip,r._redraw=!0,r._handler=(new CanvasHandler).scene(i),r._globalCursor=!1,r._preventDefault=!1,r._timers=[],r._eventListeners=[],r._resizeListeners=[],r._eventConfig=function initializeEventConfig(e){var e=Object(B.p)({defaults:{}},e),t=(t,e)=>{e.forEach(e=>{Object(B.B)(t[e])&&(t[e]=Object(B.fb)(t[e]))})};return t(e.defaults,["prevent","allow"]),t(e,["view","window","selector"]),e}(e.eventConfig),r.globalCursor(r._eventConfig.globalCursor),function runtime(e,t,n){return vega_runtime_module_context(e,J,vg,n).parse(t)}(r,e,t.expr));r._runtime=o,r._signals=o.signals,r._bind=(e.bindings||[]).map(e=>({state:null,param:Object(B.p)({},e)})),o.root&&o.root.set(i),i.source=o.data.root.input,r.pulse(o.data.root.input,r.changeset().insert(i.items)),r._width=r.width(),r._height=r.height(),r._viewWidth=viewWidth(r,r._width),r._viewHeight=viewHeight(r,r._height),r._origin=[0,0],r._resize=0,r._autosize=1,function initializeResize(t){var e=(r=t._signals)[Pg],n=r[Vg],r=r[Zg];function resetSize(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,e=>{t._width=e.size,t._viewWidth=viewWidth(t,e.size),resetSize()},{size:e}),t._resizeHeight=t.add(null,e=>{t._height=e.size,t._viewHeight=viewHeight(t,e.size),resetSize()},{size:n});const i=t.add(null,resetSize,{pad:r});t._resizeWidth.rank=e.rank+1,t._resizeHeight.rank=n.rank+1,i.rank=r.rank+1}(r),function vega_view_module_background(t){t.add(null,e=>(t._background=e.bg,t._resize=1,e.bg),{bg:t._signals.background})}(r),function vega_view_module_cursor(r){const i=r._signals.cursor||(r._signals.cursor=r.add({user:kg,item:null}));r.on(r.events("view","mousemove"),i,(e,t)=>{var n=i.value,r=n?Object(B.J)(n)?n:n.user:kg,t=t.item&&t.item.cursor||null;return n&&r===n.user&&t==n.item?n:{user:r,item:t}}),r.add(null,function(e){let t=e.cursor,n=this.value;return Object(B.J)(t)||(n=t.item,t=t.user),setCursor(r,(!t||t===kg)&&n||t),n},{cursor:i})}(r),r.description(e.description),t.hover&&r.hover(),t.container&&r.initialize(t.container,t.bind)}function lookupSignal(e,t){return Object(B.w)(e._signals,t)?e._signals[t]:Object(B.o)("Unrecognized signal name: "+Object(B.bb)(t))}function findOperatorHandler(e,t){e=(e._targets||[]).filter(e=>e._update&&e._update.handler===t);return e.length?e[0]:null}function addOperatorListener(e,t,n,r){let i=findOperatorHandler(n,r);return i||((i=trap(e,()=>r(t,n.value))).handler=r,e.on(n,null,i)),e}function removeOperatorListener(e,t,n){n=findOperatorHandler(t,n);return n&&t._targets.remove(n),e}Object(B.z)(View,Dataflow,{async evaluate(e,t,n){if(await Dataflow.prototype.evaluate.call(this,e,t),this._redraw||this._resize)try{this._renderer&&(this._resize&&(this._resize=0,function resizeRenderer(t){var e=vega_view_module_offset(t),n=vega_view_module_width(t),r=vega_view_module_height(t);t._renderer.background(t.background()),t._renderer.resize(n,r,e),t._handler.origin(e),t._resizeListeners.forEach(e=>{try{e(n,r)}catch(e){t.error(e)}})}(this)),await this._renderer.renderAsync(this._scenegraph.root)),this._redraw=!1}catch(e){this.error(e)}return n&&asyncCallback(this,n),this},dirty(e){this._redraw=!0,this._renderer&&this._renderer.dirty(e)},description(e){return arguments.length?((e=null!=e?e+"":null)!==this._desc&&ariaLabel(this._el,this._desc=e),this):this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(e,t,n){e=lookupSignal(this,e);return 1===arguments.length?e.value:this.update(e,t,n)},width(e){return arguments.length?this.signal("width",e):this.signal("width")},height(e){return arguments.length?this.signal("height",e):this.signal("height")},padding(e){return arguments.length?this.signal("padding",vega_view_module_padding(e)):vega_view_module_padding(this.signal("padding"))},autosize(e){return arguments.length?this.signal("autosize",e):this.signal("autosize")},background(e){return arguments.length?this.signal("background",e):this.signal("background")},renderer(e){return arguments.length?(renderModule(e)||Object(B.o)("Unrecognized renderer type: "+e),e!==this._renderType&&(this._renderType=e,this._resetRenderer()),this):this._renderType},tooltip(e){return arguments.length?(e!==this._tooltip&&(this._tooltip=e,this._resetRenderer()),this):this._tooltip},loader(e){return arguments.length?(e!==this._loader&&(Dataflow.prototype.loader.call(this,e),this._resetRenderer()),this):this._loader},resize(){return this._autosize=1,this.touch(lookupSignal(this,"autosize"))},_resetRenderer(){this._renderer&&(this._renderer=null,this.initialize(this._el,this._elBind))},_resizeView:function resizeView(n,r,i,o,a,s){this.runAfter(e=>{let t=0;e._autosize=0,e.width()!==i&&(t=1,e.signal(Pg,i,Wg),e._resizeWidth.skip(!0)),e.height()!==o&&(t=1,e.signal(Vg,o,Wg),e._resizeHeight.skip(!0)),e._viewWidth!==n&&(e._resize=1,e._viewWidth=n),e._viewHeight!==r&&(e._resize=1,e._viewHeight=r),e._origin[0]===a[0]&&e._origin[1]===a[1]||(e._resize=1,e._origin=a),t&&e.run("enter"),s&&e.runAfter(e=>e.resize())},!1,1)},addEventListener(e,t,n){let r=t;return n&&!1===n.trap||((r=trap(this,t)).raw=t),this._handler.on(e,r),this},removeEventListener(e,t){for(var n,r,i=this._handler.handlers(e),o=i.length;0<=--o;)if(r=i[o].type,n=i[o].handler,e===r&&(t===n||t===n.raw)){this._handler.off(r,n);break}return this},addResizeListener(e){const t=this._resizeListeners;return t.indexOf(e)<0&&t.push(e),this},removeResizeListener(e){var t=this._resizeListeners,e=t.indexOf(e);return 0<=e&&t.splice(e,1),this},addSignalListener(e,t){return addOperatorListener(this,e,lookupSignal(this,e),t)},removeSignalListener(e,t){return removeOperatorListener(this,lookupSignal(this,e),t)},addDataListener(e,t){return addOperatorListener(this,e,dataref(this,e).values,t)},removeDataListener(e,t){return removeOperatorListener(this,dataref(this,e).values,t)},globalCursor(e){var t;return arguments.length?(this._globalCursor!==!!e&&(t=setCursor(this,null),this._globalCursor=!!e,t&&setCursor(this,t)),this):this._globalCursor},preventDefault(e){return arguments.length?(this._preventDefault=e,this):this._preventDefault},timer:function vega_view_module_timer(t,e){var n,r,i,o;this._timers.push((n=function tick(e){t({timestamp:Date.now(),elapsed:e})},e=e,i=new Ng.a,null!=(o=e)&&(i._restart=i.restart,i.restart=function(t,n,r){n=+n,r=null==r?Object(Ng.b)():+r,i._restart(function tick(e){e+=o,i._restart(tick,o+=n,r),t(e)},n,r)}),i.restart(n,e,r),i))},events:function vega_view_module_events(n,r,e){function is2(e,t){i.runAsync(null,()=>{"view"===n&&function prevent(e,t){var n=(r=e._eventConfig.defaults).prevent,r=r.allow;return!1!==n&&!0!==r&&(!0===n||!1===r||(n?n[t]:r?!r[t]:e.preventDefault()))}(i,r)&&e.preventDefault(),o.receive(eventExtend(i,e,t))})}var t,i=this,o=new EventStream(e);if("timer"===n)permit(i,"timer",r)&&i.timer(is2,r);else if("view"===n)permit(i,"view",r)&&i.addEventListener(r,is2,Tg);else if("window"===n?permit(i,"window",r)&&"undefined"!=typeof window&&(t=[window]):"undefined"!=typeof document&&permit(i,"selector",r)&&(t=document.querySelectorAll(n)),t){for(var a=0,s=t.length;a{i.on(e.type,e.handler)}),i}(n,n._handler,e,a),n._redraw=!0,e&&"none"!==i&&(t=t?n._elBind=vega_view_module_lookup(n,t,!0):e.appendChild(vega_view_module_element("form",{class:"vega-bindings"})),n._bind.forEach(e=>{e.param.element&&"container"!==i&&(e.element=vega_view_module_lookup(n,e.param.element,!!e.param.input))}),n._bind.forEach(e=>{!function vega_view_module_bind(n,e,r){if(e){const i=r.param;let t=r.state;t||(t=r.state={elements:null,active:!1,set:null,update:e=>{e!=n.signal(i.signal)&&n.runAsync(null,()=>{t.source=!0,n.signal(i.signal,e)})}},i.debounce&&(t.update=Object(B.n)(i.debounce,t.update)));const o=null==i.input&&i.element?vega_view_module_target:vega_view_module_generate;o(t,e,i,n),t.active||(n.on(n._signals[i.signal],null,()=>{t.source?t.source=!1:t.set(n.signal(i.signal))}),t.active=!0),t}}(n,e.element||t,e)})),n},toImageURL:async function renderToImageURL(e,t){e!==so.Canvas&&e!==so.SVG&&e!==so.PNG&&Object(B.o)("Unrecognized image type: "+e);const n=await renderHeadless(this,e,t);return e===so.SVG?function toBlobURL(e,t){e=new Blob([e],{type:t});return window.URL.createObjectURL(e)}(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")},toCanvas:async function renderToCanvas(e,t){const n=await renderHeadless(this,so.Canvas,e,t);return n.canvas()},toSVG:async function renderToSVG(e){const t=await renderHeadless(this,so.SVG,e);return t.svg()},getState:function vega_view_module_getState(e){return this._runtime.getState(e||{data:dataTest,signals:signalTest,recurse:!0})},setState:function vega_view_module_setState(t){return this.runAsync(null,e=>{e._trigger=!1,e._runtime.setState(t)},e=>{e._trigger=!0}),this}});const Hg="view",jg="[",Yg="]",zg="{",Jg="}",Kg=":",Xg=",",qg="@",$g=">",eu=/[[\]{}]/,tu={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let nu,ru;function eventSelector(e,t,n){return nu=t||Hg,ru=n||tu,parseMerge(e.trim()).map(parseSelector)}function vega_event_selector_module_find(e,t,n,r,i){var o=e.length;let a=0,s;for(;t' after between selector: "+e;r=r.map(parseSelector);const i=parseSelector(e.slice(1).trim());{if(i.between)return{between:r,stream:i};i.between=r}return i}:function vega_event_selector_module_parseStream(t){const e={source:nu},n=[];let r=[0,0],i=0,o=0,a=t.length,s=0,A,l;if(t[a-1]===Jg){if(!(0<=(s=t.lastIndexOf(zg))))throw"Unmatched right brace: "+t;try{r=function parseThrottle(t){const e=t.split(Xg);if(!t.length||2{e=+e;if(e!=e)throw t;return e})}(t.substring(s+1,a-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,s).trim(),a=t.length,s=0}if(!a)throw t;t[0]===qg&&(i=++s);(A=vega_event_selector_module_find(t,s,Kg))+e||0;const ou=e=>Object(B.H)(e)&&!Object(B.B)(e)?Object(B.p)({},e):{value:e};function addEncode(e,t,n,r){null!=n&&(Object(B.H)(n)&&!Object(B.B)(n)||Object(B.B)(n)&&n.length&&Object(B.H)(n[0])?e.update[t]=n:e[r||"enter"][t]={value:n})}function addEncoders(e,t,n){for(const r in t)addEncode(e,r,t[r]);for(const i in n)addEncode(e,i,n[i],"update")}function extendEncode(e,t,n){for(const r in t)n&&Object(B.w)(n,r)||(e[r]=Object(B.p)(e[r]||{},t[r]));return e}function has(e,t){return t&&(t.enter&&t.enter[e]||t.update&&t.update[e])}const au="mark",su="frame",Au="scope",lu="axis",cu="axis-domain",gu="axis-grid",uu="axis-label",du="axis-tick",hu="axis-title",pu="legend",fu="legend-band",Iu="legend-entry",Cu="legend-gradient",mu="legend-label",yu="legend-symbol",Bu="legend-title",bu="title",vu="title-text",Eu="title-subtitle";function applyDefault(e,t,n){e[t]=n&&n.signal?{signal:n.signal}:{value:n}}const Qu=e=>Object(B.J)(e)?Object(B.bb)(e):e.signal?`(${e.signal})`:vega_parser_module_field(e);function entry$1(e){if(null!=e.gradient)return function vega_parser_module_gradient(e){const t=[e.start,e.stop,e.count].map(e=>null==e?null:Object(B.bb)(e));for(;t.length&&null==Object(B.W)(t);)t.pop();return t.unshift(Qu(e.gradient)),`gradient(${t.join(",")})`}(e);let t=e.signal?`(${e.signal})`:e.color?function vega_parser_module_color(e){return e.c?wu("hcl",e.h,e.c,e.l):e.h||e.s?wu("hsl",e.h,e.s,e.l):e.l||e.a?wu("lab",e.l,e.a,e.b):e.r||e.g||e.b?wu("rgb",e.r,e.g,e.b):null}(e.color):null!=e.field?vega_parser_module_field(e.field):void 0!==e.value?Object(B.bb)(e.value):void 0;return void 0===(t=null!=e.scale?function vega_parser_module_scale(e,t){var n=Qu(e.scale);null!=e.range?t=`lerp(_range(${n}), ${+e.range})`:(void 0!==t&&(t=`_scale(${n}, ${t})`),e.band&&(t=(t?t+"+":"")+`_bandwidth(${n})`+(1==+e.band?"":"*"+vega_parser_module_property(e.band)),e.extra&&(t=`(datum.extra ? _scale(${n}, datum.extra.value) : ${t})`)),null==t&&(t="0"));return t}(e,t):t)&&(t=null),null!=e.exponent&&(t=`pow(${t},${vega_parser_module_property(e.exponent)})`),null!=e.mult&&(t+="*"+vega_parser_module_property(e.mult)),null!=e.offset&&(t+="+"+vega_parser_module_property(e.offset)),t=e.round?`round(${t})`:t}const wu=(e,t,n,r)=>`(${e}(${[t,n,r].map(entry$1).join(",")})+'')`;function vega_parser_module_property(e){return Object(B.H)(e)?"("+entry$1(e)+")":e}function vega_parser_module_field(e){return function resolveField(e){let t,n,r;if(e.signal)t="datum",r=e.signal;else if(e.group||e.parent){for(n=Math.max(1,e.level||1),t="item";0{var t=i.style&&i.style[e];for(const n in t)has(n,r)||applyDefault(o,n,t[n])}),r=Object(B.p)({},r),o)(l=o[A]).signal?(s=s||{})[A]=l:a[A]=l;return r.enter=Object(B.p)(a,r.enter),s&&(r.update=Object(B.p)(s,r.update)),r}(e,t,n,r,i.config))a[s]=function parseBlock(e,t,n,r){const i={},o={};for(const a in e)null!=e[a]&&(i[a]=function parse$1(e,t,n,r){const i=vega_functions_module_parser(e,t);return i.$fields.forEach(e=>r[e]=1),Object(B.p)(n,i.$params),i.$expr}(function vega_parser_module_expr(e){return(Object(B.B)(e)?function vega_parser_module_rule(e){let n="";return e.forEach(e=>{var t=entry$1(e);n+=e.test?`(${e.test})?${t}:`:t}),":"===Object(B.W)(n)&&(n+="null"),n}:entry$1)(e)}(e[a]),r,n,o));return{$expr:{marktype:t,channels:i},$fields:Object.keys(o),$output:Object.keys(e)}}(e[s],t,o,i);return o}const Su="outer",_u=["value","update","init","react","bind"];function outerError(e,t){Object(B.o)(e+' for "outer" push: '+Object(B.bb)(t))}function parseSignal(t,e){var n=t.name;if(t.push===Su)e.signals[n]||outerError("No prior signal definition",n),_u.forEach(e=>{void 0!==t[e]&&outerError("Invalid property ",e)});else{const r=e.addSignal(n,t.value);!1===t.react&&(r.react=!1),t.bind&&e.addBinding(n,t.bind)}}function Entry(e,t,n,r){this.id=-1,this.type=e,this.value=t,this.params=n,r&&(this.parent=r)}function vega_parser_module_entry(e,t,n,r){return new Entry(e,t,n,r)}function operator(e,t){return vega_parser_module_entry("operator",e,t)}function vega_parser_module_ref(e){var t={$ref:e.id};return e.id<0&&(e.refs=e.refs||[]).push(t),t}function fieldRef$1(e,t){return t?{$field:e,$name:t}:{$field:e}}const xu=fieldRef$1("key");function compareRef(e,t){return{$compare:e,$order:t}}const Ru="descending";function aggrField(e,t){return(e&&e.signal?"$"+e.signal:e||"")+(e&&t?"_":"")+(t&&t.signal?"$"+t.signal:t||"")}const Fu="scope",Du="view";function isSignal(e){return e&&e.signal}function hasSignal(e){if(isSignal(e))return 1;if(Object(B.H)(e))for(const t in e)if(hasSignal(e[t]))return 1}function vega_parser_module_value(e,t){return null!=e?e:t}function deref(e){return e&&e.signal||e}const Gu="timer";function vega_parser_module_parseStream(e,t){const n=e.merge?mergeStream:e.stream?nestedStream:e.type?eventStream:Object(B.o)("Invalid stream specification: "+Object(B.bb)(e));return n(e,t)}function mergeStream(e,t){e=streamParameters({merge:e.merge.map(e=>vega_parser_module_parseStream(e,t))},e,t);return t.addStream(e).id}function nestedStream(e,t){e=streamParameters({stream:vega_parser_module_parseStream(e.stream,t)},e,t);return t.addStream(e).id}function eventStream(e,t){let n;e.type===Gu?(n=t.event(Gu,e.throttle),e={between:e.between,filter:e.filter}):n=t.event(function eventSource(e){return e!==Fu&&e||Du}(e.source),e.type);e=streamParameters({stream:n},e,t);return 1===Object.keys(e).length?n:t.addStream(e).id}function streamParameters(e,t,n){let r=t.between;return r&&(2!==r.length&&Object(B.o)('Stream "between" parameter must have 2 entries: '+Object(B.bb)(t)),e.between=[vega_parser_module_parseStream(r[0],n),vega_parser_module_parseStream(r[1],n)]),r=t.filter?[].concat(t.filter):[],(t.marktype||t.markname||t.markrole)&&r.push(function filterMark(e,t,n){var r="event.item";return r+(e&&"*"!==e?"&&"+r+".mark.marktype==='"+e+"'":"")+(n?"&&"+r+".mark.role==='"+n+"'":"")+(t?"&&"+r+".mark.name==='"+t+"'":"")}(t.marktype,t.markname,t.markrole)),t.source===Fu&&r.push("inScope(event.item)"),r.length&&(e.filter=vega_functions_module_parser("("+r.join(")&&(")+")",n).$expr),null!=(r=t.throttle)&&(e.throttle=+r),null!=(r=t.debounce)&&(e.debounce=+r),t.consume&&(e.consume=!0),e}const Nu={code:"_.$value",ast:{type:"Identifier",value:"value"}};function vega_parser_module_parseUpdate(e,t,n){const r=e.encode,i={target:n};let o=e.events,a=e.update,s=[];o||Object(B.o)("Signal update missing events specification."),Object(B.J)(o)&&(o=eventSelector(o,t.isSubscope()?Fu:Du)),o=Object(B.i)(o).filter(e=>e.signal||e.scale?(s.push(e),0):1),1e.scale?'scale("'+e.scale+'")':e.signal)+"]"}}(s)]),o.length&&s.push(1t.addUpdate(Object(B.p)(function streamSource(e,t){return{source:e.signal?t.signalRef(e.signal):e.scale?t.scaleRef(e.scale):vega_parser_module_parseStream(e,t)}}(e,t),i)))}n=r=>(e,t,n)=>vega_parser_module_entry(r,t,e||void 0,n);const ku=n("aggregate"),Tu=n("axisticks"),Mu=n("bound"),Uu=n("collect"),Ou=n("compare"),Lu=n("datajoin"),Pu=n("encode"),Vu=n("expression"),Zu=n("facet"),Wu=n("field"),Hu=n("key"),ju=n("legendentries"),Yu=n("load"),zu=n("mark"),Ju=n("multiextent"),Ku=n("multivalues"),Xu=n("overlap"),qu=n("params"),$u=n("prefacet"),ed=n("projection"),td=n("proxy"),nd=n("relay"),rd=n("render"),id=n("scale"),od=n("sieve"),ad=n("sortitems"),sd=n("viewlayout"),Ad=n("values");let ld=0;const cd={min:"min",max:"max",count:"sum"};function parseScale(e,t){const n=t.getScale(e.name).params;let r;for(r in n.domain=parseScaleDomain(e.domain,e,t),null!=e.range&&(n.range=function parseScaleRange(e,t,n){const r=t.config.range;let i=e.range;{if(i.signal)return t.signalRef(i.signal);if(Object(B.J)(i)){if(r&&Object(B.w)(r,i))return e=Object(B.p)({},e,{range:r[i]}),parseScaleRange(e,t,n);"width"===i?i=[0,{signal:"width"}]:"height"===i?i=isDiscrete(e.type)?[0,{signal:"height"}]:[{signal:"height"},0]:Object(B.o)("Unrecognized scale range value: "+Object(B.bb)(i))}else{if(i.scheme)return n.scheme=(Object(B.B)(i.scheme)?parseArray:parseLiteral)(i.scheme,t),i.extent&&(n.schemeExtent=parseArray(i.extent,t)),void(i.count&&(n.schemeCount=parseLiteral(i.count,t)));if(i.step)return void(n.rangeStep=parseLiteral(i.step,t));if(isDiscrete(e.type)&&!Object(B.B)(i))return parseScaleDomain(i,e,t);Object(B.B)(i)||Object(B.o)("Unsupported range type: "+Object(B.bb)(i))}}return i.map(e=>(Object(B.B)(e)?parseArray:parseLiteral)(e,t))}(e,t,n)),null!=e.interpolate&&!function parseScaleInterpolate(e,t){t.interpolate=parseLiteral(e.type||e),null!=e.gamma&&(t.interpolateGamma=parseLiteral(e.gamma))}(e.interpolate,n),null!=e.nice&&(n.nice=function parseScaleNice(e){return Object(B.H)(e)?{interval:parseLiteral(e.interval),step:parseLiteral(e.step)}:parseLiteral(e)}(e.nice)),null!=e.bins&&(n.bins=function parseScaleBins(e,t){return e.signal||Object(B.B)(e)?parseArray(e,t):t.objectProperty(e)}(e.bins,t)),e)Object(B.w)(n,r)||"name"===r||(n[r]=parseLiteral(e[r],t))}function parseLiteral(e,t){return Object(B.H)(e)?e.signal?t.signalRef(e.signal):Object(B.o)("Unsupported object: "+Object(B.bb)(e)):e}function parseArray(e,t){return e.signal?t.signalRef(e.signal):e.map(e=>parseLiteral(e,t))}function dataLookupError(e){Object(B.o)("Can not find data set: "+Object(B.bb)(e))}function parseScaleDomain(e,t,n){if(e)return e.signal?n.signalRef(e.signal):(Object(B.B)(e)?explicitDomain:e.fields?multipleDomain:singularDomain)(e,t,n);null==t.domainMin&&null==t.domainMax||Object(B.o)("No scale domain defined for domainMin/domainMax to override.")}function explicitDomain(e,t,n){return e.map(e=>parseLiteral(e,n))}function singularDomain(e,t,n){const r=n.getData(e.data);return r||dataLookupError(e.data),isDiscrete(t.type)?r.valuesRef(n,e.field,parseSort(e.sort,!1)):isQuantile(t.type)?r.domainRef(n,e.field):r.extentRef(n,e.field)}function multipleDomain(e,t,n){const r=e.data,i=e.fields.reduce((e,t)=>(t=Object(B.J)(t)?{data:r,field:t}:Object(B.B)(t)||t.signal?function fieldRef(e,t){const n="_:vega:_"+ld++,r=Uu({});Object(B.B)(e)?r.value={$ingest:e}:e.signal&&(e="setdata("+Object(B.bb)(n)+","+e.signal+")",r.params.input=t.signalRef(e));return t.addDataPipeline(n,[r,od({})]),{data:n,field:"data"}}(t,n):t,e.push(t),e),[]);return(isDiscrete(t.type)?function ordinalMultipleDomain(e,n,t){const r=parseSort(e.sort,!0);let i,o;const a=t.map(e=>{const t=n.getData(e.data);return t||dataLookupError(e.data),t.countsRef(n,e.field,r)}),s={groupby:xu,pulse:a};r&&(i=r.op||"count",o=r.field?aggrField(i,r.field):"count",s.ops=[cd[i]],s.fields=[n.fieldRef(o)],s.as=[o]);i=n.add(ku(s));e=n.add(Uu({pulse:vega_parser_module_ref(i)}));return o=n.add(Ad({field:xu,sort:n.sortRef(r),pulse:vega_parser_module_ref(e)})),vega_parser_module_ref(o)}:isQuantile(t.type)?function quantileMultipleDomain(e,n,t){t=t.map(e=>{const t=n.getData(e.data);return t||dataLookupError(e.data),t.domainRef(n,e.field)});return vega_parser_module_ref(n.add(Ku({values:t})))}:function numericMultipleDomain(e,n,t){t=t.map(e=>{const t=n.getData(e.data);return t||dataLookupError(e.data),t.extentRef(n,e.field)});return vega_parser_module_ref(n.add(Ju({extents:t})))})(e,n,i)}function parseSort(e,t){return e&&(e.field||e.op?e.field||"count"===e.op?t&&e.field&&e.op&&!cd[e.op]&&Object(B.o)("Multiple domain scales can not be sorted using "+e.op):Object(B.o)("No field provided for sort aggregate op: "+e.op):Object(B.H)(e)?e.field="key":e={field:"key"}),e}function parseParameter$1(e,t,n){return Object(B.B)(e)?e.map(e=>parseParameter$1(e,t,n)):Object(B.H)(e)?e.signal?n.signalRef(e.signal):"fit"===t?e:Object(B.o)("Unsupported parameter object: "+Object(B.bb)(e)):e}const gd="top",ud="left",dd="right",hd="bottom";const pd="vertical";const fd="index",Id="label",Cd="offset",md="perc",yd="perc2",Bd="value",bd="guide-label",vd="guide-title",Ed="group-title",Qd="group-subtitle",wd="symbol",Sd="gradient",_d="discrete",xd="size";const Rd=[xd,"shape","fill","stroke","strokeWidth","strokeDash","opacity"],Fd={name:1,style:1,interactive:1},E={value:0},Dd={value:1},Gd="group",Nd="rect",kd="rule",Td="symbol",Md="text";function guideGroup(e){return e.type=Gd,e.interactive=e.interactive||!1,e}function vega_parser_module_lookup(n,r){const e=(e,t)=>vega_parser_module_value(n[e],vega_parser_module_value(r[e],t));return e.isVertical=e=>pd===vega_parser_module_value(n.direction,r.direction||(e?r.symbolDirection:r.gradientDirection)),e.gradientLength=()=>vega_parser_module_value(n.gradientLength,r.gradientLength||r.gradientWidth),e.gradientThickness=()=>vega_parser_module_value(n.gradientThickness,r.gradientThickness||r.gradientHeight),e.entryColumns=()=>vega_parser_module_value(n.columns,vega_parser_module_value(r.columns,+e.isVertical(!0))),e}function getEncoding(e,t){t=t&&(t.update&&t.update[e]||t.enter&&t.enter[e]);return t&&t.signal?t:t?t.value:null}function anchorExpr(e,t,n){return`item.anchor === 'start' ? ${e} : item.anchor === 'end' ? ${t} : `+n}const Ud=anchorExpr(Object(B.bb)(ud),Object(B.bb)(dd),Object(B.bb)("center"));function guideMark(e,t){return t?(e.name=t.name,e.style=t.style||e.style,e.interactive=!!t.interactive,e.encode=extendEncode(e.encode,t,Fd)):e.interactive=!1,e}const Od=`datum.${md}<=0?"${ud}":datum.${md}>=1?"${dd}":"center"`,Ld=`datum.${md}<=0?"${hd}":datum.${md}>=1?"${gd}":"middle"`;function legendGradientLabels(e,t,n,r){const i=vega_parser_module_lookup(e,t),o=i.isVertical(),a=ou(i.gradientThickness()),s=i.gradientLength();let A=i("labelOverlap"),l,c,g,u,d="";var h={enter:l={opacity:E},update:c={opacity:Dd,text:{field:Id}},exit:{opacity:E}};return addEncoders(h,{fill:i("labelColor"),fillOpacity:i("labelOpacity"),font:i("labelFont"),fontSize:i("labelFontSize"),fontStyle:i("labelFontStyle"),fontWeight:i("labelFontWeight"),limit:vega_parser_module_value(e.labelLimit,t.gradientLabelLimit)}),o?(l.align={value:"left"},l.baseline=c.baseline={signal:Ld},g="y",u="x",d="1-"):(l.align=c.align={signal:Od},l.baseline={value:"top"},g="x",u="y"),l[g]=c[g]={signal:d+"datum."+md,mult:s},(l[u]=c[u]=a).offset=vega_parser_module_value(e.labelOffset,t.gradientLabelOffset)||0,A=A?{separation:i("labelSeparation"),method:A,order:"datum."+fd}:void 0,guideMark({type:Md,role:mu,style:bd,key:Bd,from:r,encode:h,overlap:A},n)}const Pd='item.orient === "left"',Vd='item.orient === "right"',Zd=`(${Pd} || ${Vd})`,Wd=`datum.vgrad && ${Vd} ? (item.anchor === 'start' ? "right" : item.anchor === 'end' ? "left" : "center") : (${Zd} && !(datum.vgrad && ${Pd})) ? "left" : `+Ud,Hd=`item._anchor || (${Zd} ? "middle" : "start")`,jd=`datum.vgrad && (item.orient === "left" || item.orient === "right") ? (${Pd} ? -90 : 90) : 0`,Yd=Zd+` ? (datum.vgrad ? (${Vd} ? "bottom" : "top") : item.anchor === 'start' ? "top" : item.anchor === 'end' ? "bottom" : "middle") : "top"`;function vega_parser_module_param(e){return Object(B.H)(e)&&e.signal?e.signal:Object(B.bb)(e)}function getRole(e){const t=e.role||"";return t.indexOf("axis")&&t.indexOf("legend")&&t.indexOf("title")?e.type===Gd?Au:t||au:t}function parseTransform(e,t){const n=definition(e.type),r=(n||Object(B.o)("Unrecognized transform type: "+Object(B.bb)(e.type)),vega_parser_module_entry(n.type.toLowerCase(),null,vega_parser_module_parseParameters(n,e,t)));return e.signal&&t.addSignal(e.signal,t.proxy(r)),r.metadata=n.metadata||{},r}function vega_parser_module_parseParameters(t,n,r){const i={},o=t.params.length;for(let e=0;eparseSubParameter(t,e,n))):parseSubParameter(t,r,n)}(t,e,n);if("projection"===r)return n.projectionRef(e[t.name])}return t.array&&!isSignal(i)?i.map(e=>parameterValue(t,e,n)):parameterValue(t,i,n)}(a,n,r)}return i}function parameterValue(e,t,n){var r=e.type;return isSignal(t)?Xd(r)?Object(B.o)("Expression references can not be signals."):qd(r)?n.fieldRef(t):$d(r)?n.compareRef(t):n.signalRef(t.signal):(e=e.expr||qd(r))&&zd(t)?n.exprRef(t.expr,t.as):e&&Jd(t)?fieldRef$1(t.field,t.as):Xd(r)?vega_functions_module_parser(t,n):Kd(r)?vega_parser_module_ref(n.getData(t).values):qd(r)?fieldRef$1(t):$d(r)?n.compareRef(t):t}function parseSubParameter(t,n,e){var r=t.params.length;let i;for(let e=0;ee&&e.expr,Jd=e=>e&&e.field,Kd=e=>"data"===e,Xd=e=>"expr"===e,qd=e=>"field"===e,$d=e=>"compare"===e;function getDataRef(e,t){return e.$ref?e:e.data&&e.data.$ref?e.data:vega_parser_module_ref(t.getData(e.data).output)}function DataScope(e,t,n,r,i){this.scope=e,this.input=t,this.output=n,this.values=r,this.aggregate=i,this.index={}}function fieldKey(e){return Object(B.J)(e)?e:null}function addSortField(e,n,t){var r,i=aggrField(t.op,t.field);if(n.ops){for(let e=0,t=n.as.length;enull==e?"null":e).join(",")+"),0)",t);A.update=e.$expr,A.params=e.$params}function parseMark(e,r){var t=getRole(e),n=e.type===Gd,i=e.from&&e.from.facet,o=e.overlap;let a=e.layout||t===Au||t===su,s,A,l,c,g,u,d;var h=t===au||a||i,p=function parseData$1(e,t,n){let r,i,o,a,s;return e?(r=e.facet)&&(t||Object(B.o)("Only group marks can be faceted."),null!=r.field?a=s=getDataRef(r,n):(e.data?s=vega_parser_module_ref(n.getData(e.data).aggregate):((o=parseTransform(Object(B.p)({type:"aggregate",groupby:Object(B.i)(r.groupby)},r.aggregate),n)).params.key=n.keyRef(r.groupby),o.params.pulse=getDataRef(r,n),a=s=vega_parser_module_ref(n.add(o))),i=n.keyRef(r.groupby,!0))):a=vega_parser_module_ref(n.add(Uu(null,[{}]))),a=a||getDataRef(e,n),{key:i,pulse:a,parent:s}}(e.from,n,r),f=vega_parser_module_ref(A=r.add(Lu({key:p.key||(e.key?fieldRef$1(e.key):void 0),pulse:p.pulse,clean:!n}))),I=(A=l=r.add(Uu({pulse:f})),A=r.add(zu({markdef:function vega_parser_module_definition(e){return{marktype:e.type,name:e.name||void 0,role:e.role||getRole(e),zindex:+e.zindex||void 0,aria:e.aria,description:e.description}}(e),interactive:function vega_parser_module_interactive(e,t){return e&&e.signal?t.signalRef(e.signal):!1!==e}(e.interactive,r),clip:function vega_parser_module_clip(e,t){let n;return Object(B.H)(e)&&(e.signal?n=e.signal:e.path?n="pathShape("+vega_parser_module_param(e.path)+")":e.sphere&&(n="geoShape("+vega_parser_module_param(e.sphere)+', {type: "Sphere"})')),n?t.signalRef(n):!!e}(e.clip,r),context:{$context:!0},groups:r.lookup(),parent:r.signals.parent?r.signalRef("parent"):null,index:r.markpath(),pulse:vega_parser_module_ref(A)})),vega_parser_module_ref(A)),t=((A=c=r.add(Pu(parseEncode(e.encode,e.type,t,e.style,r,{mod:!1,pulse:I})))).params.parent=r.encode(),e.transform&&e.transform.forEach(e=>{const t=parseTransform(e,r),n=t.metadata;(n.generates||n.changes)&&Object(B.o)("Mark transforms should not generate new data."),n.nomod||(c.params.mod=!0),t.params.pulse=vega_parser_module_ref(A),r.add(A=t)}),e.sort&&(A=r.add(ad({sort:r.compareRef(e.sort),pulse:vega_parser_module_ref(A)}))),vega_parser_module_ref(A)),I=((i||a)&&(a=r.add(sd({layout:r.objectProperty(e.layout),legends:r.legends,mark:I,pulse:t})),u=vega_parser_module_ref(a)),r.add(Mu({mark:I,pulse:u||t}))),n=(d=vega_parser_module_ref(I),n&&(h&&((s=r.operators).pop(),a&&s.pop()),r.pushState(t,u||d,f),i?function parseFacet(e,t,n){var r=e.from.facet,i=r.name,o=getDataRef(r,t);let a;r.name||Object(B.o)("Facet must have a name: "+Object(B.bb)(r)),r.data||Object(B.o)("Facet must reference a data set: "+Object(B.bb)(r)),r.field?a=t.add($u({field:t.fieldRef(r.field),pulse:o})):r.groupby?a=t.add(Zu({key:t.keyRef(r.groupby),group:vega_parser_module_ref(t.proxy(n.parent)),pulse:o})):Object(B.o)("Facet must specify groupby or field: "+Object(B.bb)(r));const s=t.fork(),A=s.add(Uu()),l=s.add(od({pulse:vega_parser_module_ref(A)}));s.addData(i,new DataScope(s,A,A,l)),s.addSignal("parent",null),a.params.subflow={$subflow:s.parse(e).toRuntime()}}(e,r,p):h?function parseSubflow(e,t,n){const r=t.add($u({pulse:n.pulse})),i=t.fork();i.add(od()),i.addSignal("parent",null),r.params.subflow={$subflow:i.parse(e).toRuntime()}}(e,r,p):r.parse(e),r.popState(),h&&(a&&s.push(a),s.push(I))),o&&(d=function parseOverlap(e,t,n){const r=e.method,i=e.bound,o=e.separation,a={separation:isSignal(o)?n.signalRef(o.signal):o,method:isSignal(r)?n.signalRef(r.signal):r,pulse:t};e.order&&(a.sort=n.compareRef({field:e.order}));i&&(t=i.tolerance,a.boundTolerance=isSignal(t)?n.signalRef(t.signal):+t,a.boundScale=n.scaleRef(i.scale),a.boundOrient=i.orient);return vega_parser_module_ref(n.add(Xu(a)))}(o,d,r)),r.add(rd({pulse:d}))),t=r.add(od({pulse:vega_parser_module_ref(n)},void 0,r.parent()));null!=e.name&&(g=e.name,r.addData(g,new DataScope(r,l,n,t)),e.on&&e.on.forEach(e=>{(e.insert||e.remove||e.toggle)&&Object(B.o)("Marks only support modify triggers."),parseTrigger(e,r,g)}))}function parseLegend(t,e){const n=e.config.legend,r=t.encode||{},i=vega_parser_module_lookup(t,n),o=r.legend||{},a=o.name||void 0,s=o.interactive,A=o.style,l={};let c=0,g,u,d;Rd.forEach(e=>t[e]?(l[e]=t[e],c=c||t[e]):0),c||Object(B.o)("Missing valid scale for legend.");var h=function legendType(e,t){let n=e.type||wd;e.type||1!==function scaleCount(n){return Rd.reduce((e,t)=>e+(n[t]?1:0),0)}(e)||!e.fill&&!e.stroke||(n=isContinuous(t)?Sd:isDiscretizing(t)?_d:wd);return n!==Sd?n:isDiscretizing(t)?_d:Sd}(t,e.scaleType(c)),p={title:null!=t.title,scales:l,type:h,vgrad:"symbol"!==h&&i.isVertical()},f=vega_parser_module_ref(e.add(Uu(null,[p]))),I=vega_parser_module_ref(e.add(ju(u={type:h,scale:e.scaleRef(c),count:e.objectProperty(i("tickCount")),limit:e.property(i("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));return h===Sd?(d=[function legendGradient(e,t,n,r){const i=vega_parser_module_lookup(e,n),o=i.isVertical(),a=i.gradientThickness(),s=i.gradientLength();let A,l,c,g,u;return u=o?(l=[0,1],c=[0,0],g=a,s):(l=[0,0],c=[1,0],g=s,a),addEncoders(e={enter:A={opacity:E,x:E,y:E,width:ou(g),height:ou(u)},update:Object(B.p)({},A,{opacity:Dd,fill:{gradient:t,start:l,stop:c}}),exit:{opacity:E}},{stroke:i("gradientStrokeColor"),strokeWidth:i("gradientStrokeWidth")},{opacity:i("gradientOpacity")}),guideMark({type:Nd,role:Cu,encode:e},r)}(t,c,n,r.gradient),legendGradientLabels(t,n,r.labels,I)],u.count=u.count||e.signalRef(`max(2,2*floor((${deref(i.gradientLength())})/100))`)):h===_d?d=[function legendGradientDiscrete(e,t,n,r,i){const o=vega_parser_module_lookup(e,n),a=o.isVertical(),s=o.gradientThickness(),A=o.gradientLength();let l,c,g,u,d="";a?(l="y",g="y2",c="x",u="width",d="1-"):(l="x",g="x2",c="y",u="height");const h={opacity:E,fill:{scale:t,field:Bd}};return h[l]={signal:d+"datum."+md,mult:A},h[c]=E,h[g]={signal:d+"datum."+yd,mult:A},h[u]=ou(s),addEncoders(e={enter:h,update:Object(B.p)({},h,{opacity:Dd}),exit:{opacity:E}},{stroke:o("gradientStrokeColor"),strokeWidth:o("gradientStrokeWidth")},{opacity:o("gradientOpacity")}),guideMark({type:Nd,role:fu,key:Bd,from:i,encode:e},r)}(t,c,n,r.gradient,I),legendGradientLabels(t,n,r.labels,I)]:(g=function legendSymbolLayout(e,t){const n=vega_parser_module_lookup(e,t);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:!0,column:!1},padding:{row:n("rowPadding"),column:n("columnPadding")}}}(t,n),d=[function legendSymbolGroups(t,e,n,r,i){const o=vega_parser_module_lookup(t,e),a=n.entries,s=!(!a||!a.interactive),A=a?a.name:void 0,l=o("clipHeight"),c=o("symbolOffset"),g={data:"value"},u=`(${i}) ? datum.${Cd} : datum.`+xd,d=l?ou(l):{field:xd},h="datum."+fd,p=`max(1, ${i})`;let f,I,C,m,y,B=(d.mult=.5,f={enter:I={opacity:E,x:{signal:u,mult:.5,offset:c},y:d},update:C={opacity:Dd,x:I.x,y:I.y},exit:{opacity:E}},null),b=null;t.fill||(B=e.symbolBaseFillColor,b=e.symbolBaseStrokeColor),addEncoders(f,{fill:o("symbolFillColor",B),shape:o("symbolType"),size:o("symbolSize"),stroke:o("symbolStrokeColor",b),strokeDash:o("symbolDash"),strokeDashOffset:o("symbolDashOffset"),strokeWidth:o("symbolStrokeWidth")},{opacity:o("symbolOpacity")}),Rd.forEach(e=>{t[e]&&(C[e]=I[e]={scale:t[e],field:Bd})}),e=guideMark({type:Td,role:yu,key:Bd,from:g,clip:!!l||void 0,encode:f},n.symbols);const v=ou(c);return v.offset=o("labelOffset"),addEncoders(f={enter:I={opacity:E,x:{signal:u,offset:v},y:d},update:C={opacity:Dd,text:{field:Id},x:I.x,y:I.y},exit:{opacity:E}},{align:o("labelAlign"),baseline:o("labelBaseline"),fill:o("labelColor"),fillOpacity:o("labelOpacity"),font:o("labelFont"),fontSize:o("labelFontSize"),fontStyle:o("labelFontStyle"),fontWeight:o("labelFontWeight"),limit:o("labelLimit")}),n=guideMark({type:Md,role:mu,style:bd,key:Bd,from:g,encode:f},n.labels),f={enter:{noBound:{value:!l},width:E,height:l?ou(l):E,opacity:E},exit:{opacity:E},update:C={opacity:Dd,row:{signal:null},column:{signal:null}}},y=o.isVertical(!0)?(m=`ceil(item.mark.items.length / ${p})`,C.row.signal=h+"%"+m,C.column.signal=`floor(${h} / ${m})`,{field:["row",h]}):(C.row.signal=`floor(${h} / ${p})`,C.column.signal=h+" % "+p,{field:h}),C.column.signal=`(${i})?${C.column.signal}:`+h,r={facet:{data:r,name:"value",groupby:fd}},guideGroup({role:Au,from:r,encode:extendEncode(f,a,Fd),marks:[e,n],name:A,interactive:s,sort:y})}(t,n,r,I,deref(g.columns))],u.size=function sizeExpression(e,t,n){var r=deref(getChannel("size",e,n)),e=deref(getChannel("strokeWidth",e,n)),n=deref(function getFontSize(e,t,n){return getEncoding("fontSize",e)||function getStyle(e,t,n){return(t=t.config.style[n])&&t[e]}("fontSize",t,n)}(n[1].encode,t,bd));return vega_functions_module_parser(`max(ceil(sqrt(${r})+${e}),${n})`,t)}(t,e,d[0].marks)),d=[guideGroup({role:Iu,from:f,encode:{enter:{x:{value:0},y:{value:0}}},marks:d,layout:g,interactive:s})],p.title&&d.push(function legendTitle(e,t,n,r){const i=vega_parser_module_lookup(e,t);return addEncoders(t={enter:{opacity:E},update:{opacity:Dd,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:E}},{orient:i("titleOrient"),_anchor:i("titleAnchor"),anchor:{signal:Hd},angle:{signal:jd},align:{signal:Wd},baseline:{signal:Yd},text:e.title,fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),baseline:i("titleBaseline")}),guideMark({type:Md,role:Bu,style:vd,from:r,encode:t},n)}(t,n,r.title,f)),parseMark(guideGroup({role:pu,from:f,encode:extendEncode(function buildLegendEncode(e,t,n){var r={enter:{},update:{}};return addEncoders(r,{orient:e("orient"),offset:e("offset"),padding:e("padding"),titlePadding:e("titlePadding"),cornerRadius:e("cornerRadius"),fill:e("fillColor"),stroke:e("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:e("legendX"),y:e("legendY"),format:t.format,formatType:t.formatType}),r}(i,t,n),o,Fd),marks:d,aria:i("aria"),description:i("description"),zindex:i("zindex"),name:a,interactive:s,style:A}),e)}function getChannel(e,t,n){return t[e]?`scale("${t[e]}",datum)`:getEncoding(e,n[0].encode)}DataScope.fromEntries=function(e,t){var n=t.length,r=t[n-1],i=t[n-2];let o=t[0],a=null,s=1;for(o&&"load"===o.type&&(o=t[1]),e.add(t[0]);s{r.push(parseTransform(e,n))}),t.on&&t.on.forEach(e=>{parseTrigger(e,n,t.name)}),n.addDataPipeline(t.name,function analyze(e,t,n){const r=[];let i=null,o=!1,a=!1,s,A,l,c,g;e.values?isSignal(e.values)||hasSignal(e.format)?(r.push(load(t,e)),r.push(i=collect())):r.push(i=collect({$ingest:e.values,$format:e.format})):e.url?hasSignal(e.url)||hasSignal(e.format)?(r.push(load(t,e)),r.push(i=collect())):r.push(i=collect({$request:e.url,$format:e.format})):e.source&&(i=s=Object(B.i)(e.source).map(e=>vega_parser_module_ref(t.getData(e).output)),r.push(null));for(A=0,l=n.length;Ae===hd||e===gd,nh=(e,t,n)=>isSignal(e)?lh(e.signal,t,n):e===ud||e===gd?t:n,rh=(e,t,n)=>isSignal(e)?sh(e.signal,t,n):th(e)?t:n,ih=(e,t,n)=>isSignal(e)?Ah(e.signal,t,n):th(e)?n:t,oh=(e,t,n)=>isSignal(e)?ch(e.signal,t,n):e===gd?{value:t}:{value:n},ah=(e,t,n)=>isSignal(e)?gh(e.signal,t,n):e===dd?{value:t}:{value:n},sh=(e,t,n)=>uh(`${e} === '${gd}' || ${e} === '${hd}'`,t,n),Ah=(e,t,n)=>uh(`${e} !== '${gd}' && ${e} !== '${hd}'`,t,n),lh=(e,t,n)=>hh(`${e} === '${ud}' || ${e} === '${gd}'`,t,n),ch=(e,t,n)=>hh(`${e} === '${gd}'`,t,n),gh=(e,t,n)=>hh(`${e} === '${dd}'`,t,n),uh=(e,t,n)=>(t=null!=t?ou(t):t,n=null!=n?ou(n):n,dh(t)&&dh(n)?{signal:e+` ? (${t=t?t.signal||Object(B.bb)(t.value):null}) : (${n=n?n.signal||Object(B.bb)(n.value):null})`}:[Object(B.p)({test:e},t)].concat(n||[])),dh=e=>null==e||1===Object.keys(e).length,hh=(e,t,n)=>({signal:`${e} ? (${fh(t)}) : (${fh(n)})`}),ph=(e,t,n,r,i)=>({signal:(null!=r?`${e} === '${ud}' ? (${fh(r)}) : `:"")+(null!=n?`${e} === '${hd}' ? (${fh(n)}) : `:"")+(null!=i?`${e} === '${dd}' ? (${fh(i)}) : `:"")+(null!=t?`${e} === '${gd}' ? (${fh(t)}) : `:"")+"(null)"}),fh=e=>isSignal(e)?e.signal:null==e?null:Object(B.bb)(e),Ih=(e,t)=>0===t?0:isSignal(e)?{signal:`(${e.signal}) * `+t}:{value:e*t},Ch=(e,t)=>{const n=e.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+t.signal}:e};function fallback(e,t,n,r){let i;if(t&&Object(B.w)(t,e))return t[e];if(Object(B.w)(n,e))return n[e];if(e.startsWith("title")){switch(e){case"titleColor":i="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":i=e[5].toLowerCase()+e.slice(6)}return r[vd][i]}if(e.startsWith("label")){switch(e){case"labelColor":i="fill";break;case"labelFont":case"labelFontSize":i=e[5].toLowerCase()+e.slice(6)}return r[bd][i]}return null}function vega_parser_module_keys(e){const t={};for(const n of e)if(n)for(const r in n)t[r]=1;return Object.keys(t)}function vega_parser_module_position(e,t){return{scale:e.scale,range:t}}function axisGrid(e,t,n,r,i){const o=vega_parser_module_lookup(e,t),a=e.orient,s=e.gridScale,A=nh(a,1,-1),l=function vega_parser_module_offsetValue(t,n){if(1!==n)if(Object(B.H)(t)){let e=t=Object(B.p)({},t);for(;null!=e.mult;){if(!Object(B.H)(e.mult))return e.mult=isSignal(n)?{signal:`(${e.mult}) * (${n.signal})`}:e.mult*n,t;e=e.mult=Object(B.p)({},e.mult)}e.mult=n}else t=isSignal(n)?{signal:`(${n.signal}) * (${t||0})`}:n*(t||0);return t}(e.offset,A);let c,g,u;var t={enter:c={opacity:E},update:u={opacity:Dd},exit:g={opacity:E}},e=(addEncoders(t,{stroke:o("gridColor"),strokeCap:o("gridCap"),strokeDash:o("gridDash"),strokeDashOffset:o("gridDashOffset"),strokeOpacity:o("gridOpacity"),strokeWidth:o("gridWidth")}),{scale:e.scale,field:Bd,band:i.band,extra:i.extra,offset:i.offset,round:o("tickRound")}),i=rh(a,{signal:"height"},{signal:"width"}),d=s?{scale:s,range:0,mult:A,offset:l}:{value:0,offset:l},i=s?{scale:s,range:1,mult:A,offset:l}:Object(B.p)(i,{mult:A,offset:l});return c.x=u.x=rh(a,e,d),c.y=u.y=ih(a,e,d),c.x2=u.x2=ih(a,i),c.y2=u.y2=rh(a,i),g.x=rh(a,e),g.y=ih(a,e),guideMark({type:kd,role:gu,key:Bd,from:r,encode:t},n)}function flushExpr(e,t,n,r,i){return{signal:'flush(range("'+e+'"), scale("'+e+'", datum.value), '+t+","+n+","+r+","+i+")"}}function axisLabels(e,t,n,r,i,o){const a=vega_parser_module_lookup(e,t),s=e.orient,A=e.scale,l=nh(s,-1,1),c=deref(a("labelFlush")),g=deref(a("labelFlushOffset")),u=a("labelAlign"),d=a("labelBaseline");let h=0===c||!!c,p;const f=ou(i);f.mult=l,f.offset=ou(a("labelPadding")||0),f.offset.mult=l;t={scale:A,field:Bd,band:.5,offset:function extendOffset(e,t){return t?e?Object(B.H)(e)?Object.assign({},e,{offset:extendOffset(e.offset,t)}):{value:e,offset:t}:t:e}(o.offset,a("labelOffset"))},e=rh(s,h?flushExpr(A,c,'"left"','"right"','"center"'):{value:"center"},ah(s,"left","right")),i=rh(s,oh(s,"bottom","top"),h?flushExpr(A,c,'"top"','"bottom"','"middle"'):{value:"middle"}),o=flushExpr(A,c,`-(${g})`,g,0),h=h&&g,t={opacity:E,x:rh(s,t,f),y:ih(s,t,f)},t={enter:t,update:p={opacity:Dd,text:{field:Id},x:t.x,y:t.y,align:e,baseline:i},exit:{opacity:E,x:t.x,y:t.y}},addEncoders(t,{dx:!u&&h?rh(s,o):null,dy:!d&&h?ih(s,o):null}),addEncoders(t,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:u,baseline:d}),o=a("labelBound");let I=a("labelOverlap");return I=I||o?{separation:a("labelSeparation"),method:I,order:"datum.index",bound:o?{scale:A,orient:s,tolerance:o}:null}:void 0,p.align!==e&&(p.align=Ch(p.align,e)),p.baseline!==i&&(p.baseline=Ch(p.baseline,i)),guideMark({type:Md,role:uu,style:bd,key:Bd,from:r,encode:t,overlap:I},n)}function axisTitle(e,t,n,r){const i=vega_parser_module_lookup(e,t),o=e.orient,a=nh(o,-1,1);let s,A;const l={enter:s={opacity:E,anchor:ou(i("titleAnchor",null)),align:{signal:Ud}},update:A=Object(B.p)({},s,{opacity:Dd,text:ou(e.title)}),exit:{opacity:E}};t={signal:`lerp(range("${e.scale}"), ${anchorExpr(0,1,.5)})`};return A.x=rh(o,t),A.y=ih(o,t),s.angle=rh(o,E,Ih(a,90)),s.baseline=rh(o,oh(o,hd,gd),{value:hd}),A.angle=s.angle,A.baseline=s.baseline,addEncoders(l,{fill:i("titleColor"),fillOpacity:i("titleOpacity"),font:i("titleFont"),fontSize:i("titleFontSize"),fontStyle:i("titleFontStyle"),fontWeight:i("titleFontWeight"),limit:i("titleLimit"),lineHeight:i("titleLineHeight")},{align:i("titleAlign"),angle:i("titleAngle"),baseline:i("titleBaseline")}),function autoLayout(e,t,n,r){var i=(e,t)=>null!=e?(n.update[t]=Ch(ou(e),n.update[t]),!1):!has(t,r),o=i(e("titleX"),"x"),i=i(e("titleY"),"y");n.enter.auto=i===o?ou(i):rh(t,ou(i),ou(o))}(i,o,l,n),l.update.align=Ch(l.update.align,s.align),l.update.angle=Ch(l.update.angle,s.angle),l.update.baseline=Ch(l.update.baseline,s.baseline),guideMark({type:Md,role:hu,style:vd,from:r,encode:l},n)}function parseAxis(e,t){const n=function vega_parser_module_axisConfig(e,t){var n,r,i=t.config,o=i.style,a=i.axis,t="band"===t.scaleType(e.scale)&&i.axisBand,s=e.orient;if(isSignal(s)){var e=vega_parser_module_keys([i.axisX,i.axisY]),A=vega_parser_module_keys([i.axisTop,i.axisBottom,i.axisLeft,i.axisRight]),l={};for(r of e)l[r]=rh(s,fallback(r,i.axisX,a,o),fallback(r,i.axisY,a,o));n={};for(r of A)n[r]=ph(s.signal,fallback(r,i.axisTop,a,o),fallback(r,i.axisBottom,a,o),fallback(r,i.axisLeft,a,o),fallback(r,i.axisRight,a,o))}else l=s===gd||s===hd?i.axisX:i.axisY,n=i["axis"+s[0].toUpperCase()+s.slice(1)];return l||n||t?Object(B.p)({},a,l,n,t):a}(e,t),r=e.encode||{},i=r.axis||{},o=i.name||void 0,a=i.interactive,s=i.style,A=vega_parser_module_lookup(e,n),l=function tickBand(e){var t=e("tickBand");let n=e("tickOffset"),r,i;return t?t.signal?(r={signal:`(${t.signal}) === 'extent' ? 1 : 0.5`},i={signal:`(${t.signal}) === 'extent'`},Object(B.H)(n)||(n={signal:`(${t.signal}) === 'extent' ? 0 : `+n})):"extent"===t?(r=1,i=!0,n=0):(r=.5,i=!1):(r=e("bandPosition"),i=e("tickExtra")),{extra:i,band:r,offset:n}}(A);var c={scale:e.scale,ticks:!!A("ticks"),labels:!!A("labels"),grid:!!A("grid"),domain:!!A("domain"),title:null!=e.title},g=vega_parser_module_ref(t.add(Uu({},[c]))),u=vega_parser_module_ref(t.add(Tu({scale:t.scaleRef(e.scale),extra:t.property(l.extra),count:t.objectProperty(e.tickCount),values:t.objectProperty(e.values),minstep:t.property(e.tickMinStep),formatType:t.property(e.formatType),formatSpecifier:t.property(e.format)})));const d=[];let h;return c.grid&&d.push(axisGrid(e,n,r.grid,u,l)),c.ticks&&(h=A("tickSize"),d.push(function axisTicks(e,t,n,r,i,o){const a=vega_parser_module_lookup(e,t),s=e.orient,A=nh(s,-1,1);let l,c,g;addEncoders(t={enter:l={opacity:E},update:g={opacity:Dd},exit:c={opacity:E}},{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const u=ou(i);return u.mult=A,i={scale:e.scale,field:Bd,band:o.band,extra:o.extra,offset:o.offset,round:a("tickRound")},g.y=l.y=rh(s,E,i),g.y2=l.y2=rh(s,u),c.x=rh(s,i),g.x=l.x=ih(s,E,i),g.x2=l.x2=ih(s,u),c.y=ih(s,i),guideMark({type:kd,role:du,key:Bd,from:r,encode:t},n)}(e,n,r.ticks,u,h,l))),c.labels&&(h=c.ticks?h:0,d.push(axisLabels(e,n,r.labels,u,h,l))),c.domain&&d.push(function axisDomain(e,t,n,r){const i=vega_parser_module_lookup(e,t),o=e.orient;let a,s;addEncoders(t={enter:a={opacity:E},update:s={opacity:Dd},exit:{opacity:E}},{stroke:i("domainColor"),strokeCap:i("domainCap"),strokeDash:i("domainDash"),strokeDashOffset:i("domainDashOffset"),strokeWidth:i("domainWidth"),strokeOpacity:i("domainOpacity")});var A=vega_parser_module_position(e,0),e=vega_parser_module_position(e,1);return a.x=s.x=rh(o,A,E),a.x2=s.x2=rh(o,e),a.y=s.y=ih(o,A,E),a.y2=s.y2=ih(o,e),guideMark({type:kd,role:cu,from:r,encode:t},n)}(e,n,r.domain,g)),c.title&&d.push(axisTitle(e,n,r.title,g)),parseMark(guideGroup({role:lu,from:g,encode:extendEncode(function buildAxisEncode(e,t){var n={enter:{},update:{}};return addEncoders(n,{orient:e("orient"),offset:e("offset")||0,position:vega_parser_module_value(t.position,0),titlePadding:e("titlePadding"),minExtent:e("minExtent"),maxExtent:e("maxExtent"),range:{signal:`abs(span(range("${t.scale}")))`},translate:e("translate"),format:t.format,formatType:t.formatType}),n}(A,e),i,Fd),marks:d,aria:A("aria"),description:A("description"),zindex:A("zindex"),name:o,interactive:a,style:s}),t)}function parseScope(e,t,n){const r=Object(B.i)(e.signals),i=Object(B.i)(e.scales);return n||r.forEach(e=>parseSignal(e,t)),Object(B.i)(e.projections).forEach(e=>function parseProjection(e,t){const n=t.config.projection||{},r={};for(const i in e)"name"!==i&&(r[i]=parseParameter$1(e[i],i,t));for(const o in n)null==r[o]&&(r[o]=parseParameter$1(n[o],o,t));t.addProjection(e.name,r)}(e,t)),i.forEach(e=>function initScale(e,t){var n=e.type||"linear";isValidScaleType(n)||Object(B.o)("Unrecognized scale type: "+Object(B.bb)(n)),t.addScale(e.name,{type:n,domain:void 0})}(e,t)),Object(B.i)(e.data).forEach(e=>parseData(e,t)),i.forEach(e=>parseScale(e,t)),(n||r).forEach(e=>function parseSignalUpdates(e,t){const n=t.getSignal(e.name);let r=e.update;e.init&&(r?Object(B.o)("Signals can not include both init and update expressions."):(r=e.init,n.initonly=!0)),r&&(r=vega_functions_module_parser(r,t),n.update=r.$expr,n.params=r.$params),e.on&&e.on.forEach(e=>vega_parser_module_parseUpdate(e,t,n.id))}(e,t)),Object(B.i)(e.axes).forEach(e=>parseAxis(e,t)),Object(B.i)(e.marks).forEach(e=>parseMark(e,t)),Object(B.i)(e.legends).forEach(e=>parseLegend(e,t)),e.title&&parseTitle(e.title,t),t.parseLambdas(),t}const mh=e=>extendEncode({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},e);function parseView(e,t){var n=t.config,r=vega_parser_module_ref(t.root=t.add(operator()));const i=function collectSignals(t,n){const e=e=>vega_parser_module_value(t[e],n[e]),r=[signalObject("background",e("background")),signalObject("autosize",function parseAutosize(e){return Object(B.H)(e)?e:{type:e||"pad"}}(e("autosize"))),signalObject("padding",function parsePadding(e){return Object(B.H)(e)?e.signal?e:{top:iu(e.top),bottom:iu(e.bottom),left:iu(e.left),right:iu(e.right)}:{top:e=+e||0,bottom:e,left:e,right:e}}(e("padding"))),signalObject("width",e("width")||0),signalObject("height",e("height")||0)],i=r.reduce((e,t)=>(e[t.name]=t,e),{}),o={};return Object(B.i)(t.signals).forEach(e=>{Object(B.w)(i,e.name)?e=Object(B.p)(i[e.name],e):r.push(e),o[e.name]=e}),Object(B.i)(n.signals).forEach(e=>{Object(B.w)(o,e.name)||Object(B.w)(i,e.name)||r.push(e)}),r}(e,n);i.forEach(e=>parseSignal(e,t)),t.description=e.description||n.description,t.eventConfig=n.events,t.legends=t.objectProperty(n.legend&&n.legend.layout),t.locale=n.locale;var n=t.add(Uu()),o=t.add(Pu(parseEncode(mh(e.encode),Gd,su,e.style,t,{pulse:vega_parser_module_ref(n)}))),a=t.add(sd({layout:t.objectProperty(e.layout),legends:t.legends,autosize:t.signalRef("autosize"),mark:r,pulse:vega_parser_module_ref(o)})),o=(t.operators.pop(),t.pushState(vega_parser_module_ref(o),vega_parser_module_ref(a),null),parseScope(e,t,i),t.operators.push(a),t.add(Mu({mark:r,pulse:vega_parser_module_ref(a)}))),o=t.add(rd({pulse:vega_parser_module_ref(o)}));return o=t.add(od({pulse:vega_parser_module_ref(o)})),t.addData("root",new DataScope(t,n,n,o)),t}function signalObject(e,t){return t&&t.signal?{name:e,update:t.signal}:{name:e,value:t}}function Scope(e,t){this.config=e||{},this.options=t||{},this.bindings=[],this.field={},this.signals={},this.lambdas={},this.scales={},this.events={},this.data={},this.streams=[],this.updates=[],this.operators=[],this.eventConfig=null,this.locale=null,this._id=0,this._subid=0,this._nextsub=[0],this._parent=[],this._encode=[],this._lookup=[],this._markpath=[]}function Subscope(e){this.config=e.config,this.options=e.options,this.legends=e.legends,this.field=Object.create(e.field),this.signals=Object.create(e.signals),this.lambdas=Object.create(e.lambdas),this.scales=Object.create(e.scales),this.events=Object.create(e.events),this.data=Object.create(e.data),this.streams=[],this.updates=[],this.operators=[],this._id=0,this._subid=++e._nextsub[0],this._nextsub=e._nextsub,this._parent=e._parent.slice(),this._encode=e._encode.slice(),this._lookup=e._lookup.slice(),this._markpath=e._markpath}function propertyLambda(e){return(Object(B.B)(e)?arrayLambda:objectLambda)(e)}function arrayLambda(t){var n=t.length;let r="[";for(let e=0;e{e.$ref=t.id}),t.refs=null),t},proxy(e){e=e instanceof Entry?vega_parser_module_ref(e):e;return this.add(td({value:e}))},addStream(e){return this.streams.push(e),e.id=this.id(),e},addUpdate(e){return this.updates.push(e),e},finish(){let e,t;for(e in this.root&&(this.root.root=!0),this.signals)this.signals[e].signal=e;for(e in this.scales)this.scales[e].scale=e;function annotate(e,t,n){let r,i;e&&(r=e.data||(e.data={}),(i=r[t]||(r[t]=[])).push(n))}for(e in this.data){annotate((t=this.data[e]).input,e,"input"),annotate(t.output,e,"output"),annotate(t.values,e,"values");for(const n in t.index)annotate(t.index[n],e,"index:"+n)}return this},pushState(e,t,n){this._encode.push(vega_parser_module_ref(this.add(od({pulse:e})))),this._parent.push(t),this._lookup.push(n?vega_parser_module_ref(this.proxy(n)):null),this._markpath.push(-1)},popState(){this._encode.pop(),this._parent.pop(),this._lookup.pop(),this._markpath.pop()},parent(){return Object(B.W)(this._parent)},encode(){return Object(B.W)(this._encode)},lookup(){return Object(B.W)(this._lookup)},markpath(){const e=this._markpath;return++e[e.length-1]},fieldRef(e,t){if(Object(B.J)(e))return fieldRef$1(e,t);e.signal||Object(B.o)("Unsupported field reference: "+Object(B.bb)(e));e=e.signal;let n=this.field[e];if(!n){const r={name:this.signalRef(e)};t&&(r.as=t),this.field[e]=n=vega_parser_module_ref(this.add(Wu(r)))}return n},compareRef(e){let t=!1;var n=e=>isSignal(e)?(t=!0,this.signalRef(e.signal)):function isExpr$1(e){return e&&e.expr}(e)?(t=!0,this.exprRef(e.expr)):e,r=Object(B.i)(e.field).map(n),e=Object(B.i)(e.order).map(n);return t?vega_parser_module_ref(this.add(Ou({fields:r,orders:e}))):compareRef(r,e)},keyRef(e,t){let n=!1;const r=this.signals;return e=Object(B.i)(e).map(e=>isSignal(e)?(n=!0,vega_parser_module_ref(r[e.signal])):e),n?vega_parser_module_ref(this.add(Hu({fields:e,flat:t}))):function keyRef(e,t){const n={$key:e};return t&&(n.$flat=!0),n}(e,t)},sortRef(e){if(!e)return e;var t=aggrField(e.op,e.field),e=e.order||"ascending";return e.signal?vega_parser_module_ref(this.add(Ou({fields:t,orders:this.signalRef(e.signal)}))):compareRef(t,e)},event(e,t){var n,r=e+":"+t;return this.events[r]||(n=this.id(),this.streams.push({id:n,source:e,type:t}),this.events[r]=n),this.events[r]},hasOwnSignal(e){return Object(B.w)(this.signals,e)},addSignal(e,t){this.hasOwnSignal(e)&&Object(B.o)("Duplicate signal name: "+Object(B.bb)(e));t=t instanceof Entry?t:this.add(operator(t));return this.signals[e]=t},getSignal(e){return this.signals[e]||Object(B.o)("Unrecognized signal name: "+Object(B.bb)(e)),this.signals[e]},signalRef(e){return this.signals[e]?vega_parser_module_ref(this.signals[e]):(Object(B.w)(this.lambdas,e)||(this.lambdas[e]=this.add(operator(null))),vega_parser_module_ref(this.lambdas[e]))},parseLambdas(){var n=Object.keys(this.lambdas);for(let e=0,t=n.length;e{for(const t in e)if(!function isEqual(t,n){if(t===n)return 1;if(Array.isArray(t)){var r=t.length;if(!n||n.length!==r)return;for(let e=0;eMath.PI/2&&(o=0null!=e&&e==e;const t=e=>!(Number.isNaN(+e)||e instanceof Date);const p={boolean:A.cb,integer:A.eb,number:A.eb,date:A.db,string:A.gb,unknown:A.y},f=[e=>"true"===e||"false"===e||!0===e||!1===e,e=>t(e)&&Number.isInteger(+e),t,e=>!Number.isNaN(Date.parse(e))],e=["boolean","integer","number","date"];function inferType(i,o){if(!i||!i.length)return"unknown";const a=i.length,s=f.length,A=f.map((e,t)=>t+1);for(let e=0,t=0,n,r;e0===e?t:e,0)-1]}function inferTypes(n,e){return e.reduce((e,t)=>(e[t]=inferType(n,t),e),{})}function delimitedFormat(r){function VU2(e,t){var n={delimiter:r};return dsv(e,t?Object(A.p)(t,n):n)}return VU2.responseType="text",VU2}function dsv(e,t){return t.header&&(e=t.header.map(A.bb).join(t.delimiter)+"\n"+e),Object(n.a)(t.delimiter).parse(e+"")}function json(e,t){const n=t&&t.property?Object(A.u)(t.property):A.y;return Object(A.H)(e)&&!function isBuffer(e){return"function"==typeof r&&Object(A.E)(r.isBuffer)&&r.isBuffer(e)}(e)?function parseJSON(e,t){!Object(A.B)(e)&&Object(A.F)(e)&&(e=[...e]);return t&&t.copy?JSON.parse(JSON.stringify(e)):e}(n(e),t):n(JSON.parse(e))}dsv.responseType="text";const s={interior:(e,t)=>e!==t,exterior:(e,t)=>e===t};function topojson(e,t){let n,r,i,o;return e=json(e,t),t&&t.feature?(n=a.a,i=t.feature):t&&t.mesh?(n=a.b,i=t.mesh,o=s[t.filter]):Object(A.o)("Missing TopoJSON feature or mesh parameter."),(r=(r=e.objects[i])?n(e,r,o):Object(A.o)("Invalid TopoJSON object: "+i))&&r.features||[r]}topojson.responseType=json.responseType="json";const i={dsv:dsv,csv:delimitedFormat(","),tsv:delimitedFormat("\t"),json:json,topojson:topojson};function formats(e,t){return 1{const t=A[e];let n,r;if(t&&(t.startsWith("date:")||t.startsWith("utc:"))){n=t.split(/:(.+)?/,2),("'"===(r=n[1])[0]&&"'"===r[r.length-1]||'"'===r[0]&&'"'===r[r.length-1])&&(r=r.slice(1,-1));const i="utc"===n[0]?c:l;return i(r)}if(p[t])return p[t];throw Error("Illegal format pattern: "+e+":"+t)});for(r=0,o=s.length,a=e.length;r({options:e||{},sanitize:async function sanitize(e,t){t=Object(A.p)({},this.options,t);const n=this.fileAccess,r={href:null};let i,o,a;var s=c.test(e.replace(g,""));null!=e&&"string"==typeof e&&s||Object(A.o)("Sanitize failure, invalid URI: "+Object(A.bb)(e));s=l.test(e);(a=t.baseURL)&&!s&&(e.startsWith("/")||a.endsWith("/")||(e="/"+e),e=a+e);o=(i=e.startsWith(u))||"file"===t.mode||"http"!==t.mode&&!s&&n,i?e=e.slice(u.length):e.startsWith("//")&&("file"===t.defaultProtocol?(e=e.slice(2),o=!0):e=(t.defaultProtocol||"http")+":"+e);Object.defineProperty(r,"localFile",{value:!!o}),r.href=e,t.target&&(r.target=t.target+"");t.rel&&(r.rel=t.rel+"");"image"===t.context&&t.crossOrigin&&(r.crossOrigin=t.crossOrigin+"");return r},load:async function load(e,t){var e=await this.sanitize(e,t),n=e.href;return e.localFile?this.file(n):this.http(n,t)},fileAccess:!!n,file:function fileLoader(t){return t?e=>new Promise((n,r)=>{t.readFile(e,(e,t)=>{e?r(e):n(t)})}):fileReject}(n),http:function httpLoader(o){return o?async function(e,t){const n=Object(A.p)({},this.options.http,t),r=t&&t.response,i=await o(e,n);return i.ok?Object(A.E)(i[r])?i[r]():i.text():Object(A.o)(i.status+""+i.statusText)}:httpReject}(t)})}("undefined"!=typeof fetch&&fetch,null)}.call(this,C(307).Buffer)},function(e,t,n){"use strict";function formatDecimalParts(e,t){if((t=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n=e.slice(0,t);return[1{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}const s={fetch:null,mimeType:void 0,nothrow:!1,log:new class loggers_ConsoleLog{constructor(){Object(a.a)(this,"console",void 0),this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},A={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function getGlobalLoaderState(){r.a.loaders=r.a.loaders||{};const e=r.a["loaders"];return e._state=e._state||{},e._state}const l=()=>{const e=getGlobalLoaderState();return e.globalOptions=e.globalOptions||{...s},e.globalOptions};function normalizeOptions(e,t,n,r){return n=n||[],function validateOptions(e,t){validateOptionsObject(e,null,s,A,t);for(const o of t){var n=e&&e[o.id]||{},r=o.options&&o.options[o.id]||{},i=o.deprecatedOptions&&o.deprecatedOptions[o.id]||{};validateOptionsObject(n,o.id,r,i,t)}}(e,n=Array.isArray(n)?n:[n]),normalizeOptionsInternal(t,e,r)}function getFetchFunction(e,t){var n=l();const r=e||n;return"function"==typeof r.fetch?r.fetch:Object(g.f)(r.fetch)?e=>fetchFile(e,r):null!=t&&t.fetch?null==t?void 0:t.fetch:fetchFile}function validateOptionsObject(e,t,n,r,i){var o=t||"Top level",a=t?"".concat(t,"."):"";for(const c in e){var s=!t&&Object(g.f)(e[c]),A="baseUri"===c&&!t,l="workerUrl"===c&&t;c in n||A||l||(c in r?u.warn("".concat(o," loader option '").concat(a).concat(c,"' no longer supported, use '").concat(r[c],"'"))():s||(A=function findSimilarOption(e,t){const n=e.toLowerCase();let r="";for(const i of t)for(const o in i.options){if(e===o)return"Did you mean '".concat(i.id,".").concat(o,"'?");const a=o.toLowerCase();(n.startsWith(a)||a.startsWith(n))&&(r=r||"Did you mean '".concat(i.id,".").concat(o,"'?"))}return r}(c,i),u.warn("".concat(o," loader option '").concat(a).concat(c,"' not recognized. ").concat(A))()))}}function normalizeOptionsInternal(e,t,n){const r={...e.options||{}};return function addUrlOptions(e,t){!t||"baseUri"in e||(e.baseUri=t)}(r,n),null===r.log&&(r.log=new NullLog),mergeNestedFields(r,l()),mergeNestedFields(r,t),r}function mergeNestedFields(e,t){for(const r in t){var n;r in t&&(n=t[r],Object(g.g)(n)&&Object(g.g)(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r])}}},function(e,t,n){"use strict";n.d(t,"b",function(){return BaseResponse}),n.d(t,"a",function(){return BaseClient});class BaseResponse{get ok(){return 200<=this.status&&this.status<=299}get status(){throw new Error("not implemented")}getHeader(e){throw new Error("not implemented")}async getData(){throw new Error("not implemented")}}class BaseClient{constructor(e){this.url=e}async request({}={}){throw new Error("request is not implemented")}}},function(g,e,u){!function(e){for(var r,i,o,a=u(989),t="undefined"==typeof window?e:window,n=["moz","webkit"],s="AnimationFrame",A=t["request"+s],l=t["cancel"+s]||t["cancelRequest"+s],c=0;!A&&ce instanceof ArrayBuffer?new Uint8Array(e):e);e=t.reduce((e,t)=>e+t.byteLength,0);const n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.byteLength;return n.buffer}function sliceArrayBuffer(e,t,n){n=void 0!==n?new Uint8Array(e).subarray(t,t+n):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}},function(e,t,n){"use strict";n.d(t,"c",function(){return setParameters}),n.d(t,"a",function(){return getParameters}),n.d(t,"b",function(){return resetParameters}),n.d(t,"d",function(){return withParameters});var l=n(127),o=n(135),c=n(66),g=n(55),u=n(283);function setParameters(e,t){if(Object(c.a)(Object(g.d)(e),"setParameters requires a WebGL context"),!Object(u.b)(t)){const i={};for(const o in t){var n=Number(o);const a=l.e[o];a&&("string"==typeof a?i[a]=!0:a(e,t[o],n))}var r=e.state&&e.state.cache;if(r)for(const s in i){const A=l.a[s];A(e,t,r)}}}function getParameters(e,t){if("number"==typeof(t=t||l.c)){var n=t;const i=l.d[n];return i?i(e,n):e.getParameter(n)}const r={};for(const o of Array.isArray(t)?t:Object.keys(t)){const a=l.d[o];r[o]=a?a(e,Number(o)):e.getParameter(Number(o))}return r}function resetParameters(e){setParameters(e,l.c)}function withParameters(e,t,n){if(Object(u.b)(t))return n(e);var{nocatch:r=!0}=t;Object(o.b)(e),setParameters(e,t);let i;if(r)i=n(e),Object(o.a)(e);else try{i=n(e)}finally{Object(o.a)(e)}return i}},function(e,t,n){"use strict";n.d(t,"a",function(){return useIsFocusVisible});var r=n(0),i=n(25),o=!0,a=!1,s=null,A={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function handleKeyDown(e){e.metaKey||e.altKey||e.ctrlKey||(o=!0)}function handlePointerDown(){o=!1}function handleVisibilityChange(){"hidden"===this.visibilityState&&a&&(o=!0)}function isFocusVisible(e){e=e.target;try{return e.matches(":focus-visible")}catch(e){}return o||function focusTriggersKeyboardModality(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!A[t]||e.readOnly)||("TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable)}(e)}function handleBlurVisible(){a=!0,window.clearTimeout(s),s=window.setTimeout(function(){a=!1},100)}function useIsFocusVisible(){return{isFocusVisible:isFocusVisible,onBlurVisible:handleBlurVisible,ref:r.useCallback(function(e){e=i.findDOMNode(e);null!=e&&!function prepare(e){e.addEventListener("keydown",handleKeyDown,!0),e.addEventListener("mousedown",handlePointerDown,!0),e.addEventListener("pointerdown",handlePointerDown,!0),e.addEventListener("touchstart",handlePointerDown,!0),e.addEventListener("visibilitychange",handleVisibilityChange,!0)}(e.ownerDocument)},[])}}},function(e,t,n){"use strict";n.d(t,"a",function(){return ownerWindow});var r=n(54);function ownerWindow(e){return Object(r.a)(e).defaultView||window}},function(e,t,n){"use strict";n.d(t,"a",function(){return Euler});var t=n(181),g=n(18),r=n(19),a=n(281);const h="Unknown Euler angle order",u=.99999;class Euler extends t.a{static get ZYX(){return 0}static get YXZ(){return 1}static get XZY(){return 2}static get ZXY(){return 3}static get YZX(){return 4}static get XYZ(){return 5}static get RollPitchYaw(){return 0}static get DefaultOrder(){return Euler.ZYX}static get RotationOrders(){return["ZYX","YXZ","XZY","ZXY","YZX","XYZ"]}static rotationOrder(e){return Euler.RotationOrders[e]}get ELEMENTS(){return 4}constructor(e=0,t=0,n=0,r=Euler.DefaultOrder){super(-0,-0,-0,-0),0{const n=e.props._offset,r=e.id,i=e.parent&&e.parent.id;let o;if(!i||i in A||c(e.parent,!1),i in l){const a=l[i]=l[i]||layerIndexResolver(A[i],A);o=a(e,t),l[r]=a}else Number.isFinite(n)?(o=n+(A[i]||0),l[r]=null):o=s;return t&&o>=s&&(s=o+1),A[r]=o};return c}();var A={viewport:e,isPicking:n.startsWith("picking"),renderPass:n};for(let e=0;eObject(p.a)(e,A))}const s={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};Object(h.n)(e,{viewport:a});for(let e=0;e>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(tinycolor(r));return o}function monochromatic(e,t){t=t||6;for(var e=tinycolor(e).toHsv(),n=e.h,r=e.s,i=e.v,o=[],a=1/t;t--;)o.push(tinycolor({h:n,s:r,v:i})),i=(i+a)%1;return o}function boundAlpha(e){return e=parseFloat(e),e=isNaN(e)||e<0||1e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*i.c)/i.a,e=>e.getDate()-1);(t.a=n).range},function(e,t,n){"use strict";var r=n(44),i=n(24),n=Object(r.a)(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/i.a},function(e){return e.getUTCDate()-1});(t.a=n).range},function(e,t,n){"use strict";var r=n(44),n=Object(r.a)(function(e){e.setMonth(0,1),e.setHours(0,0,0,0)},function(e,t){e.setFullYear(e.getFullYear()+t)},function(e,t){return t.getFullYear()-e.getFullYear()},function(e){return e.getFullYear()});n.every=function(n){return isFinite(n=Math.floor(n))&&0e.isSelected?1:-1);if(A)if(this._isCancelled)A.done();else{let e,t;try{e=await n({x:r,y:i,z:o,bbox:a,signal:s})}catch(e){t=e||!0}finally{A.done(),this._isCancelled&&!e?this._isLoaded=!1:(this._isLoaded=!0,this._isCancelled=!1)}this._isLoaded&&(t?this.onTileError(t,this):(this.content=e,this.onTileLoad(this)))}else this._isCancelled=!0}loadData(e,t){e&&(this._isCancelled=!1,this._loader=this._loadData(e,t),this._loader.finally(()=>{this._loader=void 0}))}abort(){this.isLoaded||(this._isCancelled=!0,this._abortController.abort())}}var l=n(96),a=n(511),s=n(12);const A="best-available";class tileset_2d_Tileset2D{constructor(t){this.opts=t,this._getTileData=t.getTileData,this.onTileError=t.onTileError,this.onTileLoad=e=>{t.onTileLoad(e),this.opts.maxCacheByteSize&&(this._cacheByteSize+=e.byteLength,this._resizeCache())},this.onTileUnload=t.onTileUnload,this._requestScheduler=new a.a({maxRequests:t.maxRequests,throttleRequests:0e.isLoaded)}setOptions(e){Object.assign(this.opts,e),Number.isFinite(e.maxZoom)&&(this._maxZoom=Math.floor(e.maxZoom)),Number.isFinite(e.minZoom)&&(this._minZoom=Math.ceil(e.minZoom))}finalize(){for(const e of this._cache.values())e.isLoading&&e.abort()}update(e,{zRange:t,modelMatrix:n}={}){const r=new s.Matrix4(n);var i=!r.equals(this._modelMatrix);if(!e.equals(this._viewport)||i){i&&(this._modelMatrixInverse=n&&r.clone().invert(),this._modelMatrix=n&&r),this._viewport=e;const o=this.getTileIndices({viewport:e,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:t,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=o.map(e=>this._getTile(e,!0)),this._dirty&&this._rebuildTree()}i=this.updateTileStates();return this._dirty&&this._resizeCache(),i&&this._frameNumber++,this._frameNumber}getTileIndices({viewport:e,maxZoom:t,minZoom:n,zRange:r,modelMatrix:i,modelMatrixInverse:o}){var{tileSize:a,extent:s,zoomOffset:A}=this.opts;return Object(l.a)({viewport:e,maxZoom:t,minZoom:n,zRange:r,tileSize:a,extent:s,modelMatrix:i,modelMatrixInverse:o,zoomOffset:A})}getTileMetadata({x:e,y:t,z:n}){var r=this.opts["tileSize"];return{bbox:Object(l.e)(this._viewport,e,t,n,r)}}getParentIndex(e){return e.x=Math.floor(e.x/2),e.y=Math.floor(e.y/2),--e.z,e}updateTileStates(){this._updateTileStates(this.selectedTiles);var e=this.opts["maxRequests"];const t=[];let n=0,r=!1;for(const o of this._cache.values()){var i=Boolean(1&o.state);o.isVisible!==i&&(r=!0,o.isVisible=i),o.isSelected=5===o.state,o.isLoading&&(n++,o.isSelected||t.push(o))}if(0e&&0n||this._cacheByteSize>r){for(var[i,o]of e)if(o.isVisible||(this._cacheByteSize-=t.maxCacheByteSize?o.byteLength:0,e.delete(i),this.onTileUnload(o)),e.size<=n&&this._cacheByteSize<=r)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort((e,t)=>e.z-t.z),this._dirty=!1)}_getTile({x:e,y:t,z:n},r){var i="".concat(e,",").concat(t,",").concat(n);let o=this._cache.get(i);return!o&&r?(o=new tile_2d_header_Tile2DHeader({x:e,y:t,z:n,onTileLoad:this.onTileLoad,onTileError:this.onTileError}),Object.assign(o,this.getTileMetadata(o)),o.loadData(this._getTileData,this._requestScheduler),this._cache.set(i,o),this._dirty=!0):o&&o.isCancelled&&!o.isLoading&&o.loadData(this._getTileData,this._requestScheduler),o}_getNearestAncestor(e,t,n){var{_minZoom:r=0}=this;let i={x:e,y:t,z:n};for(;i.z>r;){i=this.getParentIndex(i);var o=this._getTile(i);if(o)return o}return null}}n={data:[],dataComparator:l.f.equals,renderSubLayers:{type:"function",value:e=>new i.a(e),compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:e=>console.error(e),compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:A,zRange:null,maxRequests:6,zoomOffset:0};class tile_layer_TileLayer extends t.a{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var e;null!=(e=this.state.tileset)&&e.finalize()}get isLoaded(){const e=this.state["tileset"];return e.selectedTiles.every(e=>e.layers&&e.layers.every(e=>e.isLoaded))}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,changeFlags:t}){let n=this.state["tileset"];!n||t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getTileData)?(n&&n.finalize(),n=new tileset_2d_Tileset2D({...this._getTilesetOptions(e),getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}),this.setState({tileset:n})):(t.propsChanged||t.updateTriggersChanged)&&(n.setOptions(this._getTilesetOptions(e)),this.state.tileset.tiles.forEach(e=>{e.layers=null})),this._updateTileset()}_getTilesetOptions(e){var{tileSize:e,maxCacheSize:t,maxCacheByteSize:n,refinementStrategy:r,extent:i,maxZoom:o,minZoom:a,maxRequests:s,zoomOffset:A}=e;return{maxCacheSize:t,maxCacheByteSize:n,maxZoom:o,minZoom:a,tileSize:e,refinementStrategy:r,extent:i,maxRequests:s,zoomOffset:A}}_updateTileset(){const e=this.state["tileset"];var{zRange:t,modelMatrix:n}=this.props,t=e.update(this.context.viewport,{zRange:t,modelMatrix:n}),n=e["isLoaded"],r=this.state.isLoaded!==n,i=this.state.frameNumber!==t;n&&(r||i)&&this._onViewportLoad(),i&&this.setState({frameNumber:t}),this.state.isLoaded=n}_onViewportLoad(){var e=this.state["tileset"];const t=this.props["onViewportLoad"];t&&t(e.selectedTiles)}_onTileLoad(e){const t=this.getCurrentLayer();t.props.onTileLoad(e),e.isVisible&&this.setNeedsUpdate()}_onTileError(e,t){const n=this.getCurrentLayer();n.props.onTileError(e),n._updateTileset(),t.isVisible&&this.setNeedsUpdate()}_onTileUnload(e){const t=this.getCurrentLayer();t.props.onTileUnload(e)}getTileData(e){var t=this.getCurrentLayer();const{data:n,getTileData:r,fetch:i}=t.props;var o=e["signal"];return e.url=Object(l.b)(n,e),r?r(e):e.url?i(e.url,{propName:"data",layer:t,signal:o}):null}renderSubLayers(e){return this.props.renderSubLayers(e)}getHighlightedObjectIndex(){return-1}getPickingInfo({info:e,sourceLayer:t}){return e.tile=t.props.tile,e}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}renderLayers(){return this.state.tileset.tiles.map(t=>{const n=this.getHighlightedObjectIndex(t);var e;return t.isLoaded&&(t.layers?t.layers[0]&&t.layers[0].props.highlightedObjectIndex!==n&&(t.layers=t.layers.map(e=>e.clone({highlightedObjectIndex:n}))):(e=this.renderSubLayers({...this.props,id:"".concat(this.id,"-").concat(t.x,"-").concat(t.y,"-").concat(t.z),data:t.data,_offset:0,tile:t}),t.layers=Object(r.b)(e,Boolean).map(e=>e.clone({tile:t,highlightedObjectIndex:n})))),t.layers})}filterSubLayer({layer:e}){return this.props.visible&&e.props.tile.isVisible}}tile_layer_TileLayer.layerName="TileLayer",tile_layer_TileLayer.defaultProps=n},function(e,t,n){"use strict";var r=n(1215),i=n(22),o=Object.keys(i.a).map(e=>"const int COORDINATE_SYSTEM_".concat(e," = ").concat(i.a[e],";")).join(""),a=Object.keys(i.c).map(e=>"const int PROJECTION_MODE_".concat(e," = ").concat(i.c[e],";")).join(""),o="".concat(o,"\n").concat(a,"\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0;\nconst float GLOBE_RADIUS = 256.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 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 + 180., 360.0) - 180.;\n }\n float y = clamp(lnglat.y, -89.9, 89.9);\n return vec2(\n radians(x) + PI,\n PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n float lambda = radians(lnglatz.x);\n float phi = radians(lnglatz.y);\n float cosPhi = cos(phi);\n float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n return vec3(\n sin(lambda) * cosPhi,\n -cos(lambda) * cosPhi,\n sin(phi)\n ) * D;\n}\nvec4 project_position(vec4 position, vec3 position64Low) {\n vec4 position_world = project_uModelMatrix * position;\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_mercator_(position_world.xy),\n project_size(position_world.z),\n position_world.w\n );\n }\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n position_world.xyz += project_uCoordinateOrigin;\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n return vec4(\n project_globe_(position_world.xyz),\n position_world.w\n );\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n return vec4(\n project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n project_size(position_world.z),\n position_world.w\n );\n }\n }\n }\n if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n position_world.xyz -= project_uCoordinateOrigin;\n }\n return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n return viewProjectionMatrix * position + center;\n}\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) * project_uScale;\n}\nfloat project_pixel_size(float pixels) {\n return pixels / project_uScale;\n}\nvec2 project_pixel_size(vec2 pixels) {\n return pixels / project_uScale;\n}\nmat3 project_get_orientation_matrix(vec3 up) {\n vec3 uz = normalize(up);\n vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n vec3 uy = cross(uz, ux);\n return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n transform = project_get_orientation_matrix(commonPosition);\n return true;\n }\n return false;\n}\n"),s=n(251);const A={};t.a={name:"project",dependencies:[r.a],vs:o,getUniforms:function getUniforms(e=A){return e.viewport?Object(s.b)(e):{}}}},function(e,t,n){"use strict";function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),(e.prototype.constructor=e).__proto__=t}n.d(t,"a",function(){return _inheritsLoose})},function(e,t,n){"use strict";n.d(t,"b",function(){return A});var a=n(9),s={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},A={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(e){return"".concat(Math.round(e),"ms")}t.a={easing:s,duration:A,create:function create(){var e=0n-1&&(void 0===o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}l.absoluteValue=l.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),finalise(e)},l.ceil=function(){return finalise(new this.constructor(this),this.e+1,2)},l.clampedTo=l.clamp=function(e,t){var n=this.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(d+t);return this.cmp(e)<0?e:0e.e^o<0?1:-1;for(t=0,n=(a=r.length)<(e=i.length)?a:e;ti[t]^o<0?1:-1;return a===e?0:ethis.d.length-2},l.isNaN=function(){return!this.s},l.isNegative=l.isNeg=function(){return this.s<0},l.isPositive=l.isPos=function(){return 0t&&(t=this.e+1)):t=NaN,t},l.round=function(){var e=this.constructor;return finalise(new e(this),this.e+1,e.rounding)},l.sine=l.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+F,r.rounding=1,n=function sine(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:taylorSeries(e,2,t,t);n=16<(n=1.4*Math.sqrt(r))?16:0|n,t=t.times(1/tinyPow(5,n)),t=taylorSeries(e,2,t,t);for(var i,o=new e(5),a=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(o.plus(i.times(a.times(i).minus(s))));return t}(r,toLessThanHalfPi(r,n)),r.precision=e,r.rounding=t,finalise(2=e.d.length-1&&(n=l<0?-l:l)<=9007199254740991)return i=intPow(A,s,n,r),e.s<0?new A(1).div(i):finalise(i,r,o);if((a=s.s)<0){if(tA.maxE+1||t=r.toExpPos):(checkInt32(e,1,h),void 0===t?t=r.rounding:checkInt32(t,0,8),finiteToString(n=finalise(new r(n),e,t),e<=n.e||n.e<=r.toExpNeg,e));return n.isNeg()&&!n.isZero()?"-"+t:t},l.toSignificantDigits=l.toSD=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(checkInt32(e,1,h),void 0===t?t=n.rounding:checkInt32(t,0,8)),finalise(new n(this),e,t)},l.toString=function(){var e=this.constructor,e=finiteToString(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()&&!this.isZero()?"-"+e:e},l.truncated=l.trunc=function(){return finalise(new this.constructor(this),this.e+1,1)},l.valueOf=l.toJSON=function(){var e=this.constructor,e=finiteToString(this,this.e<=e.toExpNeg||this.e>=e.toExpPos);return this.isNeg()?"-"+e:e};var y=function(e,t,n,r,i,o){var a,s,A,l,c,g,u,d,h,p,f,I,C,m,y,B,b,v,E,Q=e.constructor,w=e.s==t.s?1:-1,S=e.d,_=t.d;if(!(S&&S[0]&&_&&_[0]))return new Q(e.s&&t.s&&(S?!_||S[0]!=_[0]:_)?S&&0==S[0]||!_?0*w:w/0:NaN);for(s=o?(c=1,e.e-t.e):(o=R,x(e.e/(c=F))-x(t.e/c)),v=_.length,B=S.length,h=(w=new Q(w)).d=[],A=0;_[A]==(S[A]||0);A++);if(_[A]>(S[A]||0)&&s--,null==n?(C=n=Q.precision,r=Q.rounding):C=i?n+(e.e-t.e)+1:n,C<0)h.push(1),g=!0;else{if(C=C/c+2|0,A=0,1==v){for(_=_[l=0],C++;(A=o/2&&++b;l=0,(a=compare(_,p,v,f))<0?(I=p[0],1<(l=(I=v!=f?I*o+(p[1]||0):I)/b|0)?1==(a=compare(u=multiplyInteger(_,l=o<=l?o-1:l,o),p,d=u.length,f=p.length))&&(l--,subtract(u,vt[i]?1:-1;break}return o}function subtract(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]u.maxE?(e.d=null,e.e=NaN):e.ee.constructor.maxE?(e.d=null,e.e=NaN):e.ei-1;)c[n]=0,n||(++o,c.unshift(1));for(s=c.length;!c[s-1];--s);for(a=0,l="";as)for(o-=s;o--;)l+="0";else ot&&(e.length=t,1)}function abs(e){return new this(e).abs()}function acos(e){return new this(e).acos()}function acosh(e){return new this(e).acosh()}function add(e,t){return new this(e).plus(t)}function asin(e){return new this(e).asin()}function asinh(e){return new this(e).asinh()}function atan(e){return new this(e).atan()}function atanh(e){return new this(e).atanh()}function atan2(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,o=r+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(n=t.s<0?getPi(this,r,i):new this(0)).s=e.s:!e.d||t.isZero()?(n=getPi(this,o,1).times(.5)).s=e.s:n=t.s<0?(this.precision=o,this.rounding=1,n=this.atan(y(e,t,o,1)),t=getPi(this,o,1),this.precision=r,this.rounding=i,e.s<0?n.minus(t):n.plus(t)):this.atan(y(e,t,o,1)):(n=getPi(this,o,1).times(0Decimal.maxE?(i.e=NaN,i.d=null):e.e{try{const n=new Image;n.onload=()=>e(n),n.onerror=()=>t(new Error(`Could not load image ${r}.`)),n.crossOrigin=i&&i.crossOrigin||"anonymous",n.src=r}catch(e){t(e)}})}(t.data)})),super(e,Object.assign({},t,{target:3553})),this.initialize(t),Object.seal(this)}}},function(e,t,n){"use strict";var r="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="object"===("undefined"==typeof window?"undefined":r(window))&&"object"===("undefined"==typeof document?"undefined":r(document))&&9===document.nodeType;t.a=r},function(e,t,n){"use strict";n.d(t,"b",function(){return makeResponse}),n.d(t,"a",function(){return checkResponse});var i=n(39),o=n(184);async function makeResponse(e){if(Object(i.i)(e))return e;const t={};var n=Object(o.a)(e),{url:n,type:r}=(0<=n&&(t["content-length"]=String(n)),Object(o.b)(e)),r=(r&&(t["content-type"]=r),await async function getInitialDataUrl(e){if("string"==typeof e)return"data:,".concat(e.slice(0,5));if(e instanceof Blob){const n=e.slice(0,5);return new Promise(t=>{const e=new FileReader;e.onload=e=>{return t(null==e||null==(e=e.target)?void 0:e.result)},e.readAsDataURL(n)})}if(e instanceof ArrayBuffer)return e=function arrayBufferToBase64(e){let t="";var n=new Uint8Array(e);for(let e=0;e>=1)1&t&&(r=r*e%n);return r}(10,n,t),o=0;o<300;o++){if(r===i)return o;r=10*r%t,i=10*i%t}return 0}function gcd(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function Fraction(e,t){if(!(this instanceof Fraction))return new Fraction(e,t);s(e,t),e=gcd(p.d,p.n),this.s=p.s,this.n=p.n/e,this.d=p.d/e}Fraction.prototype={s:1,n:0,d:1,abs:function(){return new Fraction(this.n,this.d)},neg:function(){return new Fraction(-this.s*this.n,this.d)},add:function(e,t){return s(e,t),new Fraction(this.s*this.n*p.d+p.s*this.d*p.n,this.d*p.d)},sub:function(e,t){return s(e,t),new Fraction(this.s*this.n*p.d-p.s*this.d*p.n,this.d*p.d)},mul:function(e,t){return s(e,t),new Fraction(this.s*p.s*this.n*p.n,this.d*p.d)},div:function(e,t){return s(e,t),new Fraction(this.s*p.s*this.n*p.d,this.d*p.n)},clone:function(){return new Fraction(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):void 0===e?new Fraction(this.s*this.n%this.d,1):(s(e,t),0===p.n&&0===this.d&&Fraction(0,0),new Fraction(this.s*(p.d*this.n)%(p.n*this.d),p.d*this.d))},gcd:function(e,t){return s(e,t),new Fraction(gcd(p.n,this.n)*gcd(p.d,this.d),p.d*this.d)},lcm:function(e,t){return s(e,t),0===p.n&&0===this.n?new Fraction:new Fraction(p.n*this.n,gcd(p.n,this.n)*gcd(p.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):new Fraction(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):new Fraction(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):new Fraction(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new Fraction(this.s*this.d,this.n)},pow:function(e,t){if(s(e,t),1===p.d)return p.s<0?new Fraction(Math.pow(this.s*this.d,p.n),Math.pow(this.n,p.n)):new Fraction(Math.pow(this.s*this.n,p.n),Math.pow(this.d,p.n));if(this.s<0)return null;var n,r=factorize(this.n),i=factorize(this.d),o=1,a=1;for(n in r)if("1"!==n){if("0"===n){o=0;break}if(r[n]*=p.n,r[n]%p.d!=0)return null;r[n]/=p.d,o*=Math.pow(n,r[n])}for(n in i)if("1"!==n){if(i[n]*=p.n,i[n]%p.d!=0)return null;i[n]/=p.d,a*=Math.pow(n,i[n])}return p.s<0?new Fraction(a,o):new Fraction(o,a)},equals:function(e,t){return s(e,t),this.s*this.n*p.d==p.s*p.n*this.d},compare:function(e,t){s(e,t);e=this.s*this.n*p.d-p.s*p.n*this.d;return(0=t.x+t.w)&&(!(e.y+e.h<=t.y)&&!(e.y>=t.y+t.h))))}function compact(e,t,n){for(var r=getStatics(e),i=sortLayoutItems(e,t),o=Array(e.length),a=0,s=i.length;at.y+t.h)break;collides(t,a)&&resolveCompactionCollision(e,a,n+t[i],r)}}t[r]=n}function compactItem(e,t,n,r,i){var o,a="horizontal"===n;if("vertical"===n)for(t.y=Math.min(bottom(e),t.y);0r&&(t.x=r-t.w,t.y++);return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function correctBounds(e,t){for(var n=getStatics(e),r=0,i=e.length;rt.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),o.static)for(;getFirstCollision(n,o);)o.y++;else n.push(o)}return e}function getLayoutItem(e,t){for(var n=0,r=e.length;nt.y||e.y===t.y&&e.x>t.x?1:e.y===t.y&&e.x===t.x?0:-1})}function sortLayoutItemsByColRow(e){return e.slice(0).sort(function(e,t){return e.x>t.x||e.x===t.x&&e.y>t.y?1:-1})}function validateLayout(e){var t=1{var t=n[e];Object(i.a)(Number.isFinite(t)||Array.isArray(t),"".concat(e," is required for transition"))})}}},function(e,t,n){"use strict";n.d(t,"a",function(){return OrbitState}),n.d(t,"b",function(){return OrbitController});var s=n(12),t=n(111),r=n(246),A=n(64);const I={rotationX:0,rotationOrbit:0,zoom:0,target:[0,0,0],minRotationX:-90,maxRotationX:90,minZoom:-1/0,maxZoom:1/0};class OrbitState extends r.a{constructor({makeViewport:e,width:t,height:n,rotationX:r=I.rotationX,rotationOrbit:i=I.rotationOrbit,target:o=I.target,zoom:a=I.zoom,minRotationX:s=I.minRotationX,maxRotationX:A=I.maxRotationX,minZoom:l=I.minZoom,maxZoom:c=I.maxZoom,startPanPosition:g,startRotatePos:u,startRotationX:d,startRotationOrbit:h,startZoomPosition:p,startZoom:f}){super({width:t,height:n,rotationX:r,rotationOrbit:i,target:o,zoom:a,minRotationX:s,maxRotationX:A,minZoom:l,maxZoom:c}),this._state={startPanPosition:g,startRotatePos:u,startRotationX:d,startRotationOrbit:h,startZoomPosition:p,startZoom:f},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){t=this._state.startPanPosition||t;if(!t)return this;const n=this.makeViewport(this._viewportProps);t=n.panByPosition(t,e);return this._getUpdatedState(t)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){var{startRotatePos:r,startRotationX:i,startRotationOrbit:o}=this._state,{width:a,height:s}=this._viewportProps;if(!r||!Number.isFinite(i)||!Number.isFinite(o))return this;let A;if(t){let e=(t[0]-r[0])/a;a=(t[1]-r[1])/s;(i<-90||90 line1 must only contain 2 coordinates");if(2!==t.length)throw new Error(" line2 must only contain 2 coordinates");var n=e[0][0],r=e[0][1],i=e[1][0],e=e[1][1],o=t[0][0],a=t[0][1],s=t[1][0],t=t[1][1],A=(t-a)*(i-n)-(s-o)*(e-r),s=(s-o)*(r-a)-(t-a)*(n-o),t=(i-n)*(r-a)-(e-r)*(n-o);if(0==A)return null;a=s/A,o=t/A;return 0<=a&&a<=1&&0<=o&&o<=1?(s=n+a*(i-n),t=r+a*(e-r),Object(l.point)([s,t])):null}t.default=function lineIntersect(e,t){var n,r={},i=[];if("LineString"===e.type&&(e=Object(l.feature)(e)),"LineString"===t.type&&(t=Object(l.feature)(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length)return(n=intersects(e,t))&&i.push(n),Object(l.featureCollection)(i);var o=A()();return o.load(Object(a.a)(t)),Object(s.featureEach)(Object(a.a)(e),function(n){Object(s.featureEach)(o.search(n),function(e){var t,e=intersects(n,e);e&&(t=Object(c.getCoords)(e).join(","),r[t]||(r[t]=!0,i.push(e)))})}),Object(l.featureCollection)(i)}},function(e,t,n){"use strict";n.r(t);var r=n(73),i=n(6);t.default=function center(e,t){void 0===t&&(t={});var n=((e=Object(r.default)(e))[0]+e[2])/2,e=(e[1]+e[3])/2;return Object(i.point)([n,e],t.properties,t)}},function(e,t,n){"use strict";n.d(t,"a",function(){return solid_polygon_layer_SolidPolygonLayer});var t=n(335),r=n(498),i=n(1163),o=n(499),a=n(22),s=n(660),A=n(372),l=n(370),c=n(114),g=n(281),u=n(500),d=n(71);class polygon_tesselator_PolygonTesselator extends u.a{constructor(e){var{fp64:t,IndexType:n=Uint32Array}=e;super({...e,attributes:{positions:{size:3,type:t?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:n,size:1}}})}get(e){const t=this["attributes"];return"indices"===e?t.indices&&t.indices.subarray(0,this.vertexCount):t[e]}updateGeometry(e){super.updateGeometry(e);e=this.buffers.indices;e&&(this.vertexCount=(e.value||e).length)}normalizeGeometry(e){if(this.normalize){if(e=g.b(e,this.positionSize),this.opts.resolution)return Object(d.b)(e.positions||e,e.holeIndices,{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0});if(this.opts.wrapLongitude)return Object(d.c)(e.positions||e,e.holeIndices,{size:this.positionSize,maxLatitude:86,edgeTypes:!0})}return e}getGeometrySize(t){if(!Array.isArray(t)||Number.isFinite(t[0]))return(t.positions||t).length/this.positionSize;{let e=0;for(const n of t)e+=this.getGeometrySize(n);return e}}getGeometryFromBuffer(e){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(e):()=>null}updateGeometryAttributes(e,t){if(Array.isArray(e)&&!Number.isFinite(e[0]))for(const r of e){var n=this.getGeometrySize(r);t.geometrySize=n,this.updateGeometryAttributes(r,t),t.vertexStart+=n,t.indexStart=this.indexStarts[t.geometryIndex+1]}else this._updateIndices(e,t),this._updatePositions(e,t),this._updateVertexValid(e,t)}_updateIndices(e,{geometryIndex:n,vertexStart:r,indexStart:i}){const{attributes:o,indexStarts:a,typedArrayManager:s}=this;let A=o.indices;if(A){let t=i;var l=g.a(e,this.positionSize,this.opts.preproject);A=s.allocate(A,i+l.length,{copy:!0});for(let e=0;ee.polygon},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:f},getLineColor:{type:"accessor",value:f},material:!0};const I={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class solid_polygon_layer_SolidPolygonLayer extends t.a{getShaders(e){return super.getShaders({vs:"top"===e?h:p,fs:"#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",defines:{RING_WINDING_ORDER_CW:this.props._normalize||"CCW"!==this.props._windingOrder?1:0},modules:[r.a,i.a,o.a]})}get wrapLongitude(){return!1}initializeState(){var{gl:e,viewport:t}=this.context;let n=this.props["coordinateSystem"];t.isGeospatial&&n===a.a.DEFAULT&&(n=a.a.LNGLAT),this.setState({numInstances:0,polygonTesselator:new polygon_tesselator_PolygonTesselator({preproject:n===a.a.LNGLAT&&t.projectFlat,fp64:this.use64bitPositions(),IndexType:!e||Object(s.c)(e,A.a.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});const r=this.getAttributeManager();r.remove(["instancePickingColors"]),r.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:I,accessor:"getPolygon",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:!0},elevations:{size:1,transition:I,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:I,accessor:"getFillColor",defaultValue:f,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:I,accessor:"getLineColor",defaultValue:f,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n),shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}getPickingInfo(e){const t=super.getPickingInfo(e),n=t["index"],r=this.props["data"];return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(t){var n=this.props["data"];if(n[0]&&n[0].__source)for(let e=0;ee.delete()),this.setState(this._getModels(this.context.gl)),r.invalidateAll())}updateGeometry({props:e,changeFlags:t}){if(t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getPolygon)){const r=this.state["polygonTesselator"];var n=e.data.attributes||{};r.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:n.getPolygon,buffers:n,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:t.dataChanged}),this.setState({numInstances:r.instanceCount,startIndices:r.vertexStarts}),t.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(e){var{id:t,filled:n,extruded:r}=this.props;let i,o;if(n){const a=this.getShaders("top");a.defines.NON_INSTANCED_MODEL=1,i=new l.a(e,{...a,id:"".concat(t,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0})}return r&&((o=new l.a(e,{...this.getShaders("side"),id:"".concat(t,"-side"),geometry:new c.a({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1})).userData.excludeAttributes={indices:!0}),{models:[o,i].filter(Boolean),topModel:i,sideModel:o}}calculateIndices(e){const t=this.state["polygonTesselator"];e.startIndices=t.indexStarts,e.value=t.get("indices")}calculatePositions(e){const t=this.state["polygonTesselator"];e.startIndices=t.vertexStarts,e.value=t.get("positions")}calculateVertexValid(e){e.value=this.state.polygonTesselator.get("vertexValid")}}solid_polygon_layer_SolidPolygonLayer.layerName="SolidPolygonLayer",solid_polygon_layer_SolidPolygonLayer.defaultProps=u},function(e,t,n){"use strict";n.d(t,"a",function(){return path_layer_PathLayer});var t=n(335),r=n(498),i=n(499),o=n(28),a=n(370),s=n(114),A=n(500),l=n(71);class path_tesselator_PathTesselator extends A.a{constructor(e){super({...e,attributes:{positions:{size:3,padding:18,initialize:!0,type:e.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}getGeometryFromBuffer(e){return this.normalize?super.getGeometryFromBuffer(e):()=>null}normalizeGeometry(e){return this.normalize?function normalizePath(n,r,e,t){let i=n;if(Array.isArray(n[0])){var o=n.length*r;i=new Array(o);for(let t=0;t=e.length&&(t+=1-e.length/r),t*r);return n[0]=e[t],n[1]=e[1+t],n[2]=3===r&&e[2+t]||0,n}isClosed(e){if(!this.normalize)return this.opts.loop;var t=this["positionSize"],n=e.length-t;return e[0]===e[n]&&e[1]===e[1+n]&&(2===t||e[2]===e[2+n])}}const c=[0,0,0,255];n={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:e=>e.path},getColor:{type:"accessor",value:c},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}};const g={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class path_layer_PathLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n vec2 width\n) {\n bool isEnd = positions.x > 0.0;\n float sideOfPath = positions.y;\n float isJoint = float(sideOfPath == 0.0);\n\n vec3 deltaA3 = (currPoint - prevPoint);\n vec3 deltaB3 = (nextPoint - currPoint);\n\n mat3 rotationMatrix;\n bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n if (needsRotation) {\n deltaA3 = deltaA3 * rotationMatrix;\n deltaB3 = deltaB3 * rotationMatrix;\n }\n vec2 deltaA = deltaA3.xy / width;\n vec2 deltaB = deltaB3.xy / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = dirA + dirB;\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 dir = isEnd ? dirA : dirB;\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 float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n float cornerPosition = sideOfPath * turnDirection;\n\n float miterSize = 1.0 / max(sinHalfA, EPSILON);\n miterSize = mix(\n min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n miterSize,\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n * (sideOfPath + isJoint * turnDirection);\n 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 if (isCap) {\n offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\n vJointType = capType;\n } else {\n vJointType = jointType;\n }\n vPathLength = L;\n vCornerOffset = offsetVec;\n vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n vMiterLength = isCap ? isJoint : vMiterLength;\n\n vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n vPathPosition = vec2(\n dot(offsetFromStartOfPath, perp),\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n if (needsRotation) {\n offset = rotationMatrix * offset;\n }\n return currPoint + offset;\n}\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 geometry.pickingColor = instancePickingColors;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n vec3 width;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n width = vec3(widthPixels, 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w,\n project_pixel_size_to_clipspace(width.xy)\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64Low);\n currPosition = project_position(currPosition, currPosition64Low);\n nextPosition = project_position(nextPosition, nextPosition64Low);\n\n width = vec3(project_pixel_size(widthPixels), 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n\n if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\n discard;\n }\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const e=this.getAttributeManager();e.addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:g,accessor:"getPath",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:g,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:g,defaultValue:c},instancePickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n)}}),this.setState({pathTesselator:new path_tesselator_PathTesselator({fp64:this.use64bitPositions()})}),this.props.getDashArray&&!this.props.extensions.length&&o.a.removed("getDashArray","PathStyleExtension")()}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager();if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPath)){const i=this.state["pathTesselator"];var e=t.data.attributes||{};i.updateGeometry({data:t.data,geometryBuffer:e.getPath,buffers:e,normalize:!t._pathType,loop:"loop"===t._pathType,getGeometry:t.getPath,positionFormat:t.positionFormat,wrapLongitude:t.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:n.dataChanged}),this.setState({numInstances:i.instanceCount,startIndices:i.vertexStarts}),n.dataChanged||r.invalidateAll()}n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),r.invalidateAll())}getPickingInfo(e){const t=super.getPickingInfo(e),n=t["index"],r=this.props["data"];return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(t){var n=this.props["data"];if(n[0]&&n[0].__source)for(let e=0;e{},p={[10241]:9987,10240:9729,10242:33071,10243:33071};function getIconId(e){return e&&(e.id||e.url)}function buildRowMapping(t,n,r){for(let e=0;e{var t=getIconId(a),{x:t,y:n,width:r,height:i}=this._mapping[t],e=function resizeImage(e,t,n,r){return n===t.width&&r===t.height?t:(e.canvas.height=r,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.canvas)}(o,e,r,i);this._texture.setSubImageData({data:e,x:t,y:n,width:r,height:i}),this._texture.generateMipmap(),this.onUpdate()}).catch(e=>{this.onError({url:a.url,source:a.source,sourceIndex:a.sourceIndex,loadOptions:this._loadOptions,error:e})}).finally(()=>{this._pendingCount--})}}const f=[0,0,0,255];n={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:e=>e.position},getIcon:{type:"accessor",value:e=>e.icon},getColor:{type:"accessor",value:f},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};class icon_layer_IconLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n 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 pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}initializeState(){this.state={iconManager:new icon_manager_IconManager(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};const e=this.getAttributeManager();e.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:f},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager();var{iconAtlas:i,iconMapping:o,data:a,getIcon:s}=t;const A=this.state["iconManager"];A.setProps({loadOptions:t.loadOptions});let l=!1;i||this.internalState.isAsyncPropLoading("iconAtlas")?(e.iconAtlas!==t.iconAtlas&&A.setProps({iconAtlas:i,autoPacking:!1}),e.iconMapping!==t.iconMapping&&(A.setProps({iconMapping:o}),l=!0)):A.setProps({autoPacking:!0}),(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&A.setProps({data:a,getIcon:s}),l&&(r.invalidate("instanceOffsets"),r.invalidate("instanceIconFrames"),r.invalidate("instanceColorModes")),n.extensionsChanged&&(i=this.context["gl"],null!=(e=this.state.model)&&e.delete(),this.state.model=this._getModel(i),r.invalidateAll())}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:e}){var{sizeScale:t,sizeMinPixels:n,sizeMaxPixels:r,sizeUnits:i,billboard:o,alphaCutoff:a}=this.props;const s=this.state["iconManager"];var A=this.context["viewport"],l=s.getTexture();l&&this.state.model.setUniforms(e).setUniforms({iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:t*("pixels"===i?A.metersPerPixel:1),sizeMinPixels:n,sizeMaxPixels:r,billboard:o,alphaCutoff:a}).draw()}_getModel(e){return new a.a(e,{...this.getShaders(),id:this.props.id,geometry:new s.a({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(e){const t=this.getCurrentLayer().props["onIconError"];t?t(e):o.a.error(e.error)()}getInstanceOffset(e){e=this.state.iconManager.getIconMapping(e);return[e.width/2-e.anchorX||0,e.height/2-e.anchorY||0]}getInstanceColorMode(e){return this.state.iconManager.getIconMapping(e).mask?1:0}getInstanceIconFrame(e){e=this.state.iconManager.getIconMapping(e);return[e.x||0,e.y||0,e.width||0,e.height||0]}}icon_layer_IconLayer.layerName="IconLayer",icon_layer_IconLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return _unsupportedIterableToArray});var r=n(276);function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return Vector});var t=n(176),i=n(19),r=n(77);class Vector extends t.a{get ELEMENTS(){return Object(r.a)(!1),0}copy(e){return Object(r.a)(!1),this}get x(){return this[0]}set x(e){this[0]=Object(i.a)(e)}get y(){return this[1]}set y(e){this[1]=Object(i.a)(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e2*Math.PI)throw Error("radians");n*=Math.tan(e/2),e=n*t;return(new Matrix4).ortho({left:-e,right:e,bottom:-n,top:n,near:r,far:i})}perspective({fovy:e=void 0,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:i=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return a.j(this,e,n,r,i),this.check()}determinant(){return a.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){var t=this.getScale(t||[-0,-0,-0]),n=1/t[0],r=1/t[1],t=1/t[2];return e[0]=this[0]*n,e[1]=this[1]*r,e[2]=this[2]*t,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*r,e[6]=this[6]*t,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*r,e[10]=this[10]*t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){var t=this.getScale(t||[-0,-0,-0]),n=1/t[0],r=1/t[1],t=1/t[2];return e[0]=this[0]*n,e[1]=this[1]*r,e[2]=this[2]*t,e[3]=this[4]*n,e[4]=this[5]*r,e[5]=this[6]*t,e[6]=this[8]*n,e[7]=this[9]*r,e[8]=this[10]*t,e}transpose(){return a.q(this,this),this.check()}invert(){return a.f(this,this),this.check()}multiplyLeft(e){return a.h(this,e,this),this.check()}multiplyRight(e){return a.h(this,this,e),this.check()}rotateX(e){return a.l(this,this,e),this.check()}rotateY(e){return a.m(this,this,e),this.check()}rotateZ(e){return a.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return a.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?a.o(this,this,e):a.o(this,this,[e,e,e]),this.check()}translate(e){return a.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(t=A.n(t||[-0,-0,-0,-0],e,this),Object(r.b)(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){var n=e["length"];switch(n){case 2:t=o.j(t||[-0,-0],e,this);break;case 3:t=s.s(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=Object(i.a)(t||[-0,-0],e,this);break;case 3:t=Object(i.c)(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return Object(r.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return Object(r.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return Object(r.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return getOffsetOrigin}),n.d(t,"b",function(){return getUniformsFromViewport});var p=n(27),f=n(51),I=n(22),t=n(147);const C=[0,0,0,0],m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=[0,0,0],a=[0,0,0],A=Object(t.a)(function calculateViewportUniforms({viewport:e,devicePixelRatio:t,coordinateSystem:n,coordinateOrigin:r}){const{projectionCenter:i,viewProjectionMatrix:o,originCommon:a,cameraPosCommon:s,shaderCoordinateOrigin:A,geospatialOrigin:l}=function calculateMatrixAndOffset(e,t,n){var{viewMatrixUncentered:r,projectionMatrix:i}=e;let{viewMatrix:o,viewProjectionMatrix:a}=e,s=C,A=C,l=e.cameraPosition;var{geospatialOrigin:t,shaderCoordinateOrigin:n,offsetMode:c}=getOffsetOrigin(e,t,n);c&&(A=e.projectPosition(t||n),l=[l[0]-A[0],l[1]-A[1],l[2]-A[2]],A[3]=1,s=f.n([],A,a),o=r||o,a=p.h([],i,o),a=p.h([],a,m));return{viewMatrix:o,viewProjectionMatrix:a,projectionCenter:s,originCommon:A,cameraPosCommon:l,shaderCoordinateOrigin:n,geospatialOrigin:t}}(e,n,r),c=e.getDistanceScales(),g=[e.width*t,e.height*t],u=e.projectionMatrix.transform([0,0,-e.focalDistance,1])[3]||1,d={project_uCoordinateSystem:n,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:A,project_uCommonOrigin:a.slice(0,3),project_uCenter:i,project_uViewportSize:g,project_uDevicePixelRatio:t,project_uFocalDistance:u,project_uCommonUnitsPerMeter:c.unitsPerMeter,project_uCommonUnitsPerWorldUnit:c.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:y,project_uScale:e.scale,project_uViewProjectionMatrix:o,project_uCameraPosition:s};if(l){var h=e.getDistanceScales(l);switch(n){case I.a.METER_OFFSETS:d.project_uCommonUnitsPerWorldUnit=h.unitsPerMeter,d.project_uCommonUnitsPerWorldUnit2=h.unitsPerMeter2;break;case I.a.LNGLAT:case I.a.LNGLAT_OFFSETS:d.project_uCommonUnitsPerWorldUnit=h.unitsPerDegree,d.project_uCommonUnitsPerWorldUnit2=h.unitsPerDegree2;break;case I.a.CARTESIAN:d.project_uCommonUnitsPerWorldUnit=[1,1,h.unitsPerMeter[2]],d.project_uCommonUnitsPerWorldUnit2=[0,0,h.unitsPerMeter2[2]]}}return d});function getOffsetOrigin(e,t,n=a){let r=n,i,o=!0;switch(i=t===I.a.LNGLAT_OFFSETS||t===I.a.METER_OFFSETS?n:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case I.c.WEB_MERCATOR:t!==I.a.LNGLAT&&t!==I.a.CARTESIAN||(o=!1);break;case I.c.WEB_MERCATOR_AUTO_OFFSET:t===I.a.LNGLAT?r=i:t===I.a.CARTESIAN&&(r=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],i=e.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case I.c.IDENTITY:r=e.position.map(Math.fround);break;case I.c.GLOBE:o=!1,i=null;break;default:o=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:o}}function getUniformsFromViewport({viewport:e,devicePixelRatio:t=1,modelMatrix:n=null,coordinateSystem:r=I.a.DEFAULT,coordinateOrigin:i,autoWrapLongitude:o=!1}={}){r===I.a.DEFAULT&&(r=e.isGeospatial?I.a.LNGLAT:I.a.CARTESIAN);const a=A({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:i});return a.project_uWrapLongitude=o,a.project_uModelMatrix=n||s,a}},function(e,t,n){"use strict";n.d(t,"a",function(){return ViewState});class ViewState{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}},function(e,t,n){"use strict";var l=n(22),r=n(196),c=n(12),i=n(147),g=n(36);const u=Object(i.a)(function getViewportCenterPosition({viewport:e,center:t}){return new c.Matrix4(e.viewProjectionMatrix).invert().transform(t)}),d=Object(i.a)(function getViewProjectionMatrices({viewport:e,shadowMatrices:t}){const n=[],r=e.pixelUnprojectionMatrix,i=e.isGeospatial?void 0:1,o=[[0,0,i],[e.width,0,i],[0,e.height,i],[e.width,e.height,i],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map(e=>function screenToCommonSpace(e,t){var[e,n,r]=e,e=Object(g.p)([e,n,r],t);if(Number.isFinite(r))return e;return[e[0],e[1],0]}(e,r));for(const a of t){const s=a.clone().translate(new c.Vector3(e.center).negate()),A=o.map(e=>s.transform(e)),l=(new c.Matrix4).ortho({left:Math.min(...A.map(e=>e[0])),right:Math.max(...A.map(e=>e[0])),bottom:Math.min(...A.map(e=>e[1])),top:Math.max(...A.map(e=>e[1])),near:Math.min(...A.map(e=>-e[2])),far:Math.max(...A.map(e=>-e[2]))});n.push(l.multiplyRight(a))}return n}),h=[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:[r.a],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(e={},t={})=>{var n;return e.drawToShadowMap||e.shadowMaps&&0>=1)1&t&&(r=r*e%n);return r}(10,n,t),o=0;o<300;o++){if(r===i)return o;r=10*r%t,i=10*i%t}return 0}function gcd(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function Fraction(e,t){if(!(this instanceof Fraction))return new Fraction(e,t);s(e,t),e=gcd(p.d,p.n),this.s=p.s,this.n=p.n/e,this.d=p.d/e}Fraction.prototype={s:1,n:0,d:1,abs:function(){return new Fraction(this.n,this.d)},neg:function(){return new Fraction(-this.s*this.n,this.d)},add:function(e,t){return s(e,t),new Fraction(this.s*this.n*p.d+p.s*this.d*p.n,this.d*p.d)},sub:function(e,t){return s(e,t),new Fraction(this.s*this.n*p.d-p.s*this.d*p.n,this.d*p.d)},mul:function(e,t){return s(e,t),new Fraction(this.s*p.s*this.n*p.n,this.d*p.d)},div:function(e,t){return s(e,t),new Fraction(this.s*p.s*this.n*p.d,this.d*p.n)},clone:function(){return new Fraction(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):void 0===e?new Fraction(this.s*this.n%this.d,1):(s(e,t),0===p.n&&0===this.d&&Fraction(0,0),new Fraction(this.s*(p.d*this.n)%(p.n*this.d),p.d*this.d))},gcd:function(e,t){return s(e,t),new Fraction(gcd(p.n,this.n)*gcd(p.d,this.d),p.d*this.d)},lcm:function(e,t){return s(e,t),0===p.n&&0===this.n?new Fraction:new Fraction(p.n*this.n,gcd(p.n,this.n)*gcd(p.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):new Fraction(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):new Fraction(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Fraction(NaN):new Fraction(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new Fraction(this.s*this.d,this.n)},pow:function(e,t){if(s(e,t),1===p.d)return p.s<0?new Fraction(Math.pow(this.s*this.d,p.n),Math.pow(this.n,p.n)):new Fraction(Math.pow(this.s*this.n,p.n),Math.pow(this.d,p.n));if(this.s<0)return null;var n,r=factorize(this.n),i=factorize(this.d),o=1,a=1;for(n in r)if("1"!==n){if("0"===n){o=0;break}if(r[n]*=p.n,r[n]%p.d!=0)return null;r[n]/=p.d,o*=Math.pow(n,r[n])}for(n in i)if("1"!==n){if(i[n]*=p.n,i[n]%p.d!=0)return null;i[n]/=p.d,a*=Math.pow(n,i[n])}return p.s<0?new Fraction(a,o):new Fraction(o,a)},equals:function(e,t){return s(e,t),this.s*this.n*p.d==p.s*p.n*this.d},compare:function(e,t){s(e,t);e=this.s*this.n*p.d-p.s*p.n*this.d;return(0=t.x+t.w)&&(!(e.y+e.h<=t.y)&&!(e.y>=t.y+t.h))))}function compact(e,t,n){for(var r=getStatics(e),i=sortLayoutItems(e,t),o=Array(e.length),a=0,s=i.length;at.y+t.h)break;collides(t,a)&&resolveCompactionCollision(e,a,n+t[i],r)}}t[r]=n}function compactItem(e,t,n,r,i){var o,a="horizontal"===n;if("vertical"===n)for(t.y=Math.min(bottom(e),t.y);0r&&(t.x=r-t.w,t.y++);return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function correctBounds(e,t){for(var n=getStatics(e),r=0,i=e.length;rt.cols&&(o.x=t.cols-o.w),o.x<0&&(o.x=0,o.w=t.cols),o.static)for(;getFirstCollision(n,o);)o.y++;else n.push(o)}return e}function getLayoutItem(e,t){for(var n=0,r=e.length;nt.y||e.y===t.y&&e.x>t.x?1:e.y===t.y&&e.x===t.x?0:-1})}function sortLayoutItemsByColRow(e){return e.slice(0).sort(function(e,t){return e.x>t.x||e.x===t.x&&e.y>t.y?1:-1})}function validateLayout(e){var t=1{var t=n[e];Object(i.a)(Number.isFinite(t)||Array.isArray(t),"".concat(e," is required for transition"))})}}},function(e,t,n){"use strict";n.d(t,"a",function(){return OrbitState}),n.d(t,"b",function(){return OrbitController});var s=n(12),t=n(113),r=n(252),A=n(65);const I={rotationX:0,rotationOrbit:0,zoom:0,target:[0,0,0],minRotationX:-90,maxRotationX:90,minZoom:-1/0,maxZoom:1/0};class OrbitState extends r.a{constructor({makeViewport:e,width:t,height:n,rotationX:r=I.rotationX,rotationOrbit:i=I.rotationOrbit,target:o=I.target,zoom:a=I.zoom,minRotationX:s=I.minRotationX,maxRotationX:A=I.maxRotationX,minZoom:l=I.minZoom,maxZoom:c=I.maxZoom,startPanPosition:g,startRotatePos:u,startRotationX:d,startRotationOrbit:h,startZoomPosition:p,startZoom:f}){super({width:t,height:n,rotationX:r,rotationOrbit:i,target:o,zoom:a,minRotationX:s,maxRotationX:A,minZoom:l,maxZoom:c}),this._state={startPanPosition:g,startRotatePos:u,startRotationX:d,startRotationOrbit:h,startZoomPosition:p,startZoom:f},this.makeViewport=e}panStart({pos:e}){return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan({pos:e,startPosition:t}){t=this._state.startPanPosition||t;if(!t)return this;const n=this.makeViewport(this._viewportProps);t=n.panByPosition(t,e);return this._getUpdatedState(t)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart({pos:e}){return this._getUpdatedState({startRotatePos:e,startRotationX:this._viewportProps.rotationX,startRotationOrbit:this._viewportProps.rotationOrbit})}rotate({pos:t,deltaAngleX:e=0,deltaAngleY:n=0}){var{startRotatePos:r,startRotationX:i,startRotationOrbit:o}=this._state,{width:a,height:s}=this._viewportProps;if(!r||!Number.isFinite(i)||!Number.isFinite(o))return this;let A;if(t){let e=(t[0]-r[0])/a;a=(t[1]-r[1])/s;(i<-90||90 line1 must only contain 2 coordinates");if(2!==t.length)throw new Error(" line2 must only contain 2 coordinates");var n=e[0][0],r=e[0][1],i=e[1][0],e=e[1][1],o=t[0][0],a=t[0][1],s=t[1][0],t=t[1][1],A=(t-a)*(i-n)-(s-o)*(e-r),s=(s-o)*(r-a)-(t-a)*(n-o),t=(i-n)*(r-a)-(e-r)*(n-o);if(0==A)return null;a=s/A,o=t/A;return 0<=a&&a<=1&&0<=o&&o<=1?(s=n+a*(i-n),t=r+a*(e-r),Object(l.point)([s,t])):null}t.default=function lineIntersect(e,t){var n,r={},i=[];if("LineString"===e.type&&(e=Object(l.feature)(e)),"LineString"===t.type&&(t=Object(l.feature)(t)),"Feature"===e.type&&"Feature"===t.type&&null!==e.geometry&&null!==t.geometry&&"LineString"===e.geometry.type&&"LineString"===t.geometry.type&&2===e.geometry.coordinates.length&&2===t.geometry.coordinates.length)return(n=intersects(e,t))&&i.push(n),Object(l.featureCollection)(i);var o=A()();return o.load(Object(a.a)(t)),Object(s.featureEach)(Object(a.a)(e),function(n){Object(s.featureEach)(o.search(n),function(e){var t,e=intersects(n,e);e&&(t=Object(c.getCoords)(e).join(","),r[t]||(r[t]=!0,i.push(e)))})}),Object(l.featureCollection)(i)}},function(e,t,n){"use strict";n.r(t);var r=n(73),i=n(6);t.default=function center(e,t){void 0===t&&(t={});var n=((e=Object(r.default)(e))[0]+e[2])/2,e=(e[1]+e[3])/2;return Object(i.point)([n,e],t.properties,t)}},function(e,t,n){"use strict";n.d(t,"a",function(){return solid_polygon_layer_SolidPolygonLayer});var t=n(342),r=n(508),i=n(1231),o=n(509),a=n(22),s=n(692),A=n(379),l=n(377),c=n(116),g=n(287),u=n(510),d=n(71);class polygon_tesselator_PolygonTesselator extends u.a{constructor(e){var{fp64:t,IndexType:n=Uint32Array}=e;super({...e,attributes:{positions:{size:3,type:t?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:n,size:1}}})}get(e){const t=this["attributes"];return"indices"===e?t.indices&&t.indices.subarray(0,this.vertexCount):t[e]}updateGeometry(e){super.updateGeometry(e);e=this.buffers.indices;e&&(this.vertexCount=(e.value||e).length)}normalizeGeometry(e){if(this.normalize){if(e=g.b(e,this.positionSize),this.opts.resolution)return Object(d.b)(e.positions||e,e.holeIndices,{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0});if(this.opts.wrapLongitude)return Object(d.c)(e.positions||e,e.holeIndices,{size:this.positionSize,maxLatitude:86,edgeTypes:!0})}return e}getGeometrySize(t){if(!Array.isArray(t)||Number.isFinite(t[0]))return(t.positions||t).length/this.positionSize;{let e=0;for(const n of t)e+=this.getGeometrySize(n);return e}}getGeometryFromBuffer(e){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(e):()=>null}updateGeometryAttributes(e,t){if(Array.isArray(e)&&!Number.isFinite(e[0]))for(const r of e){var n=this.getGeometrySize(r);t.geometrySize=n,this.updateGeometryAttributes(r,t),t.vertexStart+=n,t.indexStart=this.indexStarts[t.geometryIndex+1]}else this._updateIndices(e,t),this._updatePositions(e,t),this._updateVertexValid(e,t)}_updateIndices(e,{geometryIndex:n,vertexStart:r,indexStart:i}){const{attributes:o,indexStarts:a,typedArrayManager:s}=this;let A=o.indices;if(A){let t=i;var l=g.a(e,this.positionSize,this.opts.preproject);A=s.allocate(A,i+l.length,{copy:!0});for(let e=0;ee.polygon},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:f},getLineColor:{type:"accessor",value:f},material:!0};const I={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class solid_polygon_layer_SolidPolygonLayer extends t.a{getShaders(e){return super.getShaders({vs:"top"===e?h:p,fs:"#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",defines:{RING_WINDING_ORDER_CW:this.props._normalize||"CCW"!==this.props._windingOrder?1:0},modules:[r.a,i.a,o.a]})}get wrapLongitude(){return!1}initializeState(){var{gl:e,viewport:t}=this.context;let n=this.props["coordinateSystem"];t.isGeospatial&&n===a.a.DEFAULT&&(n=a.a.LNGLAT),this.setState({numInstances:0,polygonTesselator:new polygon_tesselator_PolygonTesselator({preproject:n===a.a.LNGLAT&&t.projectFlat,fp64:this.use64bitPositions(),IndexType:!e||Object(s.c)(e,A.a.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});const r=this.getAttributeManager();r.remove(["instancePickingColors"]),r.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:I,accessor:"getPolygon",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:!0},elevations:{size:1,transition:I,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:I,accessor:"getFillColor",defaultValue:f,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{alias:"colors",size:this.props.colorFormat.length,type:5121,normalized:!0,transition:I,accessor:"getLineColor",defaultValue:f,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n),shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}getPickingInfo(e){const t=super.getPickingInfo(e),n=t["index"],r=this.props["data"];return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(t){var n=this.props["data"];if(n[0]&&n[0].__source)for(let e=0;ee.delete()),this.setState(this._getModels(this.context.gl)),r.invalidateAll())}updateGeometry({props:e,changeFlags:t}){if(t.dataChanged||t.updateTriggersChanged&&(t.updateTriggersChanged.all||t.updateTriggersChanged.getPolygon)){const r=this.state["polygonTesselator"];var n=e.data.attributes||{};r.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:n.getPolygon,buffers:n,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:t.dataChanged}),this.setState({numInstances:r.instanceCount,startIndices:r.vertexStarts}),t.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(e){var{id:t,filled:n,extruded:r}=this.props;let i,o;if(n){const a=this.getShaders("top");a.defines.NON_INSTANCED_MODEL=1,i=new l.a(e,{...a,id:"".concat(t,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0})}return r&&((o=new l.a(e,{...this.getShaders("side"),id:"".concat(t,"-side"),geometry:new c.a({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1})).userData.excludeAttributes={indices:!0}),{models:[o,i].filter(Boolean),topModel:i,sideModel:o}}calculateIndices(e){const t=this.state["polygonTesselator"];e.startIndices=t.indexStarts,e.value=t.get("indices")}calculatePositions(e){const t=this.state["polygonTesselator"];e.startIndices=t.vertexStarts,e.value=t.get("positions")}calculateVertexValid(e){e.value=this.state.polygonTesselator.get("vertexValid")}}solid_polygon_layer_SolidPolygonLayer.layerName="SolidPolygonLayer",solid_polygon_layer_SolidPolygonLayer.defaultProps=u},function(e,t,n){"use strict";n.d(t,"a",function(){return path_layer_PathLayer});var t=n(342),r=n(508),i=n(509),o=n(28),a=n(377),s=n(116),A=n(510),l=n(71);class path_tesselator_PathTesselator extends A.a{constructor(e){super({...e,attributes:{positions:{size:3,padding:18,initialize:!0,type:e.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}getGeometryFromBuffer(e){return this.normalize?super.getGeometryFromBuffer(e):()=>null}normalizeGeometry(e){return this.normalize?function normalizePath(n,r,e,t){let i=n;if(Array.isArray(n[0])){var o=n.length*r;i=new Array(o);for(let t=0;t=e.length&&(t+=1-e.length/r),t*r);return n[0]=e[t],n[1]=e[1+t],n[2]=3===r&&e[2+t]||0,n}isClosed(e){if(!this.normalize)return this.opts.loop;var t=this["positionSize"],n=e.length-t;return e[0]===e[n]&&e[1]===e[1+n]&&(2===t||e[2]===e[2+n])}}const c=[0,0,0,255];n={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:e=>e.path},getColor:{type:"accessor",value:c},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}};const g={enter:(e,t)=>t.length?t.subarray(t.length-e.length):e};class path_layer_PathLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n return -(float(flag) * 2. - 1.);\n}\nvec3 lineJoin(\n vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n vec2 width\n) {\n bool isEnd = positions.x > 0.0;\n float sideOfPath = positions.y;\n float isJoint = float(sideOfPath == 0.0);\n\n vec3 deltaA3 = (currPoint - prevPoint);\n vec3 deltaB3 = (nextPoint - currPoint);\n\n mat3 rotationMatrix;\n bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n if (needsRotation) {\n deltaA3 = deltaA3 * rotationMatrix;\n deltaB3 = deltaB3 * rotationMatrix;\n }\n vec2 deltaA = deltaA3.xy / width;\n vec2 deltaB = deltaB3.xy / width;\n\n float lenA = length(deltaA);\n float lenB = length(deltaB);\n\n vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n vec2 perpA = vec2(-dirA.y, dirA.x);\n vec2 perpB = vec2(-dirB.y, dirB.x);\n vec2 tangent = dirA + dirB;\n tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n vec2 miterVec = vec2(-tangent.y, tangent.x);\n vec2 dir = isEnd ? dirA : dirB;\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 float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n float cornerPosition = sideOfPath * turnDirection;\n\n float miterSize = 1.0 / max(sinHalfA, EPSILON);\n miterSize = mix(\n min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n miterSize,\n step(0.0, cornerPosition)\n );\n\n vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n * (sideOfPath + isJoint * turnDirection);\n 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 if (isCap) {\n offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\n vJointType = capType;\n } else {\n vJointType = jointType;\n }\n vPathLength = L;\n vCornerOffset = offsetVec;\n vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n vMiterLength = isCap ? isJoint : vMiterLength;\n\n vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n vPathPosition = vec2(\n dot(offsetFromStartOfPath, perp),\n dot(offsetFromStartOfPath, dir)\n );\n geometry.uv = vPathPosition;\n\n float isValid = step(instanceTypes, 3.5);\n vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n if (needsRotation) {\n offset = rotationMatrix * offset;\n }\n return currPoint + offset;\n}\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 geometry.pickingColor = instancePickingColors;\n\n vec2 widthPixels = vec2(clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0);\n vec3 width;\n\n vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n float isEnd = positions.x;\n\n vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n if (billboard) {\n vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n clipLine(prevPositionScreen, currPositionScreen);\n clipLine(nextPositionScreen, currPositionScreen);\n clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n width = vec3(widthPixels, 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec3 pos = lineJoin(\n prevPositionScreen.xyz / prevPositionScreen.w,\n currPositionScreen.xyz / currPositionScreen.w,\n nextPositionScreen.xyz / nextPositionScreen.w,\n project_pixel_size_to_clipspace(width.xy)\n );\n\n gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n } else {\n prevPosition = project_position(prevPosition, prevPosition64Low);\n currPosition = project_position(currPosition, currPosition64Low);\n nextPosition = project_position(nextPosition, nextPosition64Low);\n\n width = vec3(project_pixel_size(widthPixels), 0.0);\n DECKGL_FILTER_SIZE(width, geometry);\n\n vec4 pos = vec4(\n lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n 1.0);\n geometry.position = pos;\n gl_Position = project_common_position_to_clipspace(pos);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nvoid main(void) {\n geometry.uv = vPathPosition;\n\n if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n discard;\n }\n if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\n discard;\n }\n }\n gl_FragColor = vColor;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const e=this.getAttributeManager();e.addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:g,accessor:"getPath",update:this.calculatePositions,noAlloc:!0,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:!0},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:g,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:g,defaultValue:c},instancePickingColors:{size:3,type:5121,accessor:(e,{index:t,target:n})=>this.encodePickingColor(e&&e.__source?e.__source.index:t,n)}}),this.setState({pathTesselator:new path_tesselator_PathTesselator({fp64:this.use64bitPositions()})}),this.props.getDashArray&&!this.props.extensions.length&&o.a.removed("getDashArray","PathStyleExtension")()}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager();if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPath)){const i=this.state["pathTesselator"];var e=t.data.attributes||{};i.updateGeometry({data:t.data,geometryBuffer:e.getPath,buffers:e,normalize:!t._pathType,loop:"loop"===t._pathType,getGeometry:t.getPath,positionFormat:t.positionFormat,wrapLongitude:t.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:n.dataChanged}),this.setState({numInstances:i.instanceCount,startIndices:i.vertexStarts}),n.dataChanged||r.invalidateAll()}n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),r.invalidateAll())}getPickingInfo(e){const t=super.getPickingInfo(e),n=t["index"],r=this.props["data"];return r[0]&&r[0].__source&&(t.object=r.find(e=>e.__source.index===n)),t}disablePickingIndex(t){var n=this.props["data"];if(n[0]&&n[0].__source)for(let e=0;e{},p={[10241]:9987,10240:9729,10242:33071,10243:33071};function getIconId(e){return e&&(e.id||e.url)}function buildRowMapping(t,n,r){for(let e=0;e{var t=getIconId(a),{x:t,y:n,width:r,height:i}=this._mapping[t],e=function resizeImage(e,t,n,r){return n===t.width&&r===t.height?t:(e.canvas.height=r,e.canvas.width=n,e.clearRect(0,0,e.canvas.width,e.canvas.height),e.drawImage(t,0,0,t.width,t.height,0,0,n,r),e.canvas)}(o,e,r,i);this._texture.setSubImageData({data:e,x:t,y:n,width:r,height:i}),this._texture.generateMipmap(),this.onUpdate()}).catch(e=>{this.onError({url:a.url,source:a.source,sourceIndex:a.sourceIndex,loadOptions:this._loadOptions,error:e})}).finally(()=>{this._pendingCount--})}}const f=[0,0,0,255];n={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:e=>e.position},getIcon:{type:"accessor",value:e=>e.icon},getColor:{type:"accessor",value:f},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};class icon_layer_IconLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = angle * PI / 180.0;\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n\n vec2 iconSize = instanceIconFrames.zw;\n 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 pixelOffset += instancePixelOffset;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTextureCoords = mix(\n instanceIconFrames.xy,\n instanceIconFrames.xy + iconSize,\n (positions.xy + 1.0) / 2.0\n ) / iconsTextureDim;\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n\n vColorMode = instanceColorModes;\n}\n",fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n float a = texColor.a * opacity * vColor.a;\n\n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color, a);\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}initializeState(){this.state={iconManager:new icon_manager_IconManager(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};const e=this.getAttributeManager();e.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:f},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState({oldProps:e,props:t,changeFlags:n}){super.updateState({props:t,oldProps:e,changeFlags:n});const r=this.getAttributeManager();var{iconAtlas:i,iconMapping:o,data:a,getIcon:s}=t;const A=this.state["iconManager"];A.setProps({loadOptions:t.loadOptions});let l=!1;i||this.internalState.isAsyncPropLoading("iconAtlas")?(e.iconAtlas!==t.iconAtlas&&A.setProps({iconAtlas:i,autoPacking:!1}),e.iconMapping!==t.iconMapping&&(A.setProps({iconMapping:o}),l=!0)):A.setProps({autoPacking:!0}),(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&A.setProps({data:a,getIcon:s}),l&&(r.invalidate("instanceOffsets"),r.invalidate("instanceIconFrames"),r.invalidate("instanceColorModes")),n.extensionsChanged&&(i=this.context["gl"],null!=(e=this.state.model)&&e.delete(),this.state.model=this._getModel(i),r.invalidateAll())}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(){super.finalizeState(),this.state.iconManager.finalize()}draw({uniforms:e}){var{sizeScale:t,sizeMinPixels:n,sizeMaxPixels:r,sizeUnits:i,billboard:o,alphaCutoff:a}=this.props;const s=this.state["iconManager"];var A=this.context["viewport"],l=s.getTexture();l&&this.state.model.setUniforms(e).setUniforms({iconsTexture:l,iconsTextureDim:[l.width,l.height],sizeScale:t*("pixels"===i?A.metersPerPixel:1),sizeMinPixels:n,sizeMaxPixels:r,billboard:o,alphaCutoff:a}).draw()}_getModel(e){return new a.a(e,{...this.getShaders(),id:this.props.id,geometry:new s.a({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(e){const t=this.getCurrentLayer().props["onIconError"];t?t(e):o.a.error(e.error)()}getInstanceOffset(e){e=this.state.iconManager.getIconMapping(e);return[e.width/2-e.anchorX||0,e.height/2-e.anchorY||0]}getInstanceColorMode(e){return this.state.iconManager.getIconMapping(e).mask?1:0}getInstanceIconFrame(e){e=this.state.iconManager.getIconMapping(e);return[e.x||0,e.y||0,e.width||0,e.height||0]}}icon_layer_IconLayer.layerName="IconLayer",icon_layer_IconLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return _unsupportedIterableToArray});var r=n(282);function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return Object(r.a)(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Object(r.a)(e,t):void 0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return Vector});var t=n(181),i=n(19),r=n(77);class Vector extends t.a{get ELEMENTS(){return Object(r.a)(!1),0}copy(e){return Object(r.a)(!1),this}get x(){return this[0]}set x(e){this[0]=Object(i.a)(e)}get y(){return this[1]}set y(e){this[1]=Object(i.a)(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e2*Math.PI)throw Error("radians");n*=Math.tan(e/2),e=n*t;return(new Matrix4).ortho({left:-e,right:e,bottom:-n,top:n,near:r,far:i})}perspective({fovy:e=void 0,fov:t=45*Math.PI/180,aspect:n=1,near:r=.1,far:i=500}={}){if((e=e||t)>2*Math.PI)throw Error("radians");return a.j(this,e,n,r,i),this.check()}determinant(){return a.a(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){var t=this.getScale(t||[-0,-0,-0]),n=1/t[0],r=1/t[1],t=1/t[2];return e[0]=this[0]*n,e[1]=this[1]*r,e[2]=this[2]*t,e[3]=0,e[4]=this[4]*n,e[5]=this[5]*r,e[6]=this[6]*t,e[7]=0,e[8]=this[8]*n,e[9]=this[9]*r,e[10]=this[10]*t,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e=[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=null){var t=this.getScale(t||[-0,-0,-0]),n=1/t[0],r=1/t[1],t=1/t[2];return e[0]=this[0]*n,e[1]=this[1]*r,e[2]=this[2]*t,e[3]=this[4]*n,e[4]=this[5]*r,e[5]=this[6]*t,e[6]=this[8]*n,e[7]=this[9]*r,e[8]=this[10]*t,e}transpose(){return a.q(this,this),this.check()}invert(){return a.f(this,this),this.check()}multiplyLeft(e){return a.h(this,e,this),this.check()}multiplyRight(e){return a.h(this,this,e),this.check()}rotateX(e){return a.l(this,this,e),this.check()}rotateY(e){return a.m(this,this,e),this.check()}rotateZ(e){return a.n(this,this,e),this.check()}rotateXYZ([e,t,n]){return this.rotateX(e).rotateY(t).rotateZ(n)}rotateAxis(e,t){return a.k(this,this,e,t),this.check()}scale(e){return Array.isArray(e)?a.o(this,this,e):a.o(this,this,[e,e,e]),this.check()}translate(e){return a.p(this,this,e),this.check()}transform(e,t){return 4===e.length?(t=A.n(t||[-0,-0,-0,-0],e,this),Object(r.b)(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){var n=e["length"];switch(n){case 2:t=o.j(t||[-0,-0],e,this);break;case 3:t=s.s(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}transformAsVector(e,t){switch(e.length){case 2:t=Object(i.a)(t||[-0,-0],e,this);break;case 3:t=Object(i.c)(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Object(r.b)(t,e.length),t}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}transformPoint(e,t){return Object(r.c)("Matrix4.transformPoint","3.0"),this.transformAsPoint(e,t)}transformVector(e,t){return Object(r.c)("Matrix4.transformVector","3.0"),this.transformAsPoint(e,t)}transformDirection(e,t){return Object(r.c)("Matrix4.transformDirection","3.0"),this.transformAsVector(e,t)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return getOffsetOrigin}),n.d(t,"b",function(){return getUniformsFromViewport});var p=n(27),f=n(52),I=n(22),t=n(151);const C=[0,0,0,0],m=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],s=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],y=[0,0,0],a=[0,0,0],A=Object(t.a)(function calculateViewportUniforms({viewport:e,devicePixelRatio:t,coordinateSystem:n,coordinateOrigin:r}){const{projectionCenter:i,viewProjectionMatrix:o,originCommon:a,cameraPosCommon:s,shaderCoordinateOrigin:A,geospatialOrigin:l}=function calculateMatrixAndOffset(e,t,n){var{viewMatrixUncentered:r,projectionMatrix:i}=e;let{viewMatrix:o,viewProjectionMatrix:a}=e,s=C,A=C,l=e.cameraPosition;var{geospatialOrigin:t,shaderCoordinateOrigin:n,offsetMode:c}=getOffsetOrigin(e,t,n);c&&(A=e.projectPosition(t||n),l=[l[0]-A[0],l[1]-A[1],l[2]-A[2]],A[3]=1,s=f.n([],A,a),o=r||o,a=p.h([],i,o),a=p.h([],a,m));return{viewMatrix:o,viewProjectionMatrix:a,projectionCenter:s,originCommon:A,cameraPosCommon:l,shaderCoordinateOrigin:n,geospatialOrigin:t}}(e,n,r),c=e.getDistanceScales(),g=[e.width*t,e.height*t],u=e.projectionMatrix.transform([0,0,-e.focalDistance,1])[3]||1,d={project_uCoordinateSystem:n,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:A,project_uCommonOrigin:a.slice(0,3),project_uCenter:i,project_uViewportSize:g,project_uDevicePixelRatio:t,project_uFocalDistance:u,project_uCommonUnitsPerMeter:c.unitsPerMeter,project_uCommonUnitsPerWorldUnit:c.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:y,project_uScale:e.scale,project_uViewProjectionMatrix:o,project_uCameraPosition:s};if(l){var h=e.getDistanceScales(l);switch(n){case I.a.METER_OFFSETS:d.project_uCommonUnitsPerWorldUnit=h.unitsPerMeter,d.project_uCommonUnitsPerWorldUnit2=h.unitsPerMeter2;break;case I.a.LNGLAT:case I.a.LNGLAT_OFFSETS:d.project_uCommonUnitsPerWorldUnit=h.unitsPerDegree,d.project_uCommonUnitsPerWorldUnit2=h.unitsPerDegree2;break;case I.a.CARTESIAN:d.project_uCommonUnitsPerWorldUnit=[1,1,h.unitsPerMeter[2]],d.project_uCommonUnitsPerWorldUnit2=[0,0,h.unitsPerMeter2[2]]}}return d});function getOffsetOrigin(e,t,n=a){let r=n,i,o=!0;switch(i=t===I.a.LNGLAT_OFFSETS||t===I.a.METER_OFFSETS?n:e.isGeospatial?[Math.fround(e.longitude),Math.fround(e.latitude),0]:null,e.projectionMode){case I.c.WEB_MERCATOR:t!==I.a.LNGLAT&&t!==I.a.CARTESIAN||(o=!1);break;case I.c.WEB_MERCATOR_AUTO_OFFSET:t===I.a.LNGLAT?r=i:t===I.a.CARTESIAN&&(r=[Math.fround(e.center[0]),Math.fround(e.center[1]),0],i=e.unprojectPosition(r),r[0]-=n[0],r[1]-=n[1],r[2]-=n[2]);break;case I.c.IDENTITY:r=e.position.map(Math.fround);break;case I.c.GLOBE:o=!1,i=null;break;default:o=!1}return r[2]=r[2]||0,{geospatialOrigin:i,shaderCoordinateOrigin:r,offsetMode:o}}function getUniformsFromViewport({viewport:e,devicePixelRatio:t=1,modelMatrix:n=null,coordinateSystem:r=I.a.DEFAULT,coordinateOrigin:i,autoWrapLongitude:o=!1}={}){r===I.a.DEFAULT&&(r=e.isGeospatial?I.a.LNGLAT:I.a.CARTESIAN);const a=A({viewport:e,devicePixelRatio:t,coordinateSystem:r,coordinateOrigin:i});return a.project_uWrapLongitude=o,a.project_uModelMatrix=n||s,a}},function(e,t,n){"use strict";n.d(t,"a",function(){return ViewState});class ViewState{constructor(e){this._viewportProps=this._applyConstraints(e)}getViewportProps(){return this._viewportProps}getState(){return this._state}shortestPathFrom(e){return this._viewportProps}_applyConstraints(e){return e}}},function(e,t,n){"use strict";var l=n(22),r=n(201),c=n(12),i=n(151),g=n(36);const u=Object(i.a)(function getViewportCenterPosition({viewport:e,center:t}){return new c.Matrix4(e.viewProjectionMatrix).invert().transform(t)}),d=Object(i.a)(function getViewProjectionMatrices({viewport:e,shadowMatrices:t}){const n=[],r=e.pixelUnprojectionMatrix,i=e.isGeospatial?void 0:1,o=[[0,0,i],[e.width,0,i],[0,e.height,i],[e.width,e.height,i],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map(e=>function screenToCommonSpace(e,t){var[e,n,r]=e,e=Object(g.p)([e,n,r],t);if(Number.isFinite(r))return e;return[e[0],e[1],0]}(e,r));for(const a of t){const s=a.clone().translate(new c.Vector3(e.center).negate()),A=o.map(e=>s.transform(e)),l=(new c.Matrix4).ortho({left:Math.min(...A.map(e=>e[0])),right:Math.max(...A.map(e=>e[0])),bottom:Math.min(...A.map(e=>e[1])),top:Math.max(...A.map(e=>e[1])),near:Math.min(...A.map(e=>-e[2])),far:Math.max(...A.map(e=>-e[2]))});n.push(l.multiplyRight(a))}return n}),h=[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:[r.a],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n if (shadow_uDrawShadowMap) {\n return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n }\n if (shadow_uUseShadowMap) {\n for (int i = 0; i < max_lights; i++) {\n if(i < int(shadow_uLightCount)) {\n vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n }\n }\n }\n return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n float z = dot(rgbaDepth, bitUnpackShift);\n return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n if (shadow_uDrawShadowMap) {\n vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n rgbaDepth -= rgbaDepth.gbaa * bitMask;\n return rgbaDepth;\n }\n if (shadow_uUseShadowMap) {\n float shadowAlpha = 0.0;\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n if(shadow_uLightCount > 1.0) {\n shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n }\n shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n return vec4(\n mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n blendedAlpha\n );\n }\n return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n position = shadow_setVertexPosition(geometry.position);\n ","fs:DECKGL_FILTER_COLOR":"\n color = shadow_filterShadowColor(color);\n "},getUniforms:(e={},t={})=>{var n;return e.drawToShadowMap||e.shadowMaps&&0 * @license MIT * @preserve - */var l=function(){function Node(e,t){this.next=null;this.key=e;this.data=t;this.left=null;this.right=null}return Node}();function DEFAULT_COMPARE(e,t){return e>t?1:e0){if(t.right===null)break;if(n(e,t.right.key)>0){var s=t.right;t.right=s.left;s.left=t;t=s;if(t.right===null)break}i.right=t;i=t;t=t.right}else break}i.right=t.left;o.left=t.right;t.left=r.right;t.right=r.left;return t}function insert(e,t,n,r){var i=new l(e,t);if(n===null){i.left=i.right=null;return i}n=splay(e,n,r);var o=r(e,n.key);if(o<0){i.left=n.left;i.right=n;n.left=null}else if(o>=0){i.right=n.right;i.left=n;n.right=null}return i}function split(e,t,n){var r=null;var i=null;if(t){t=splay(e,t,n);var o=n(t.key,e);if(o===0){r=t.left;i=t.right}else if(o<0){i=t.right;t.right=null;r=t}else{r=t.left;t.left=null;i=t}}return{left:r,right:i}}function merge(e,t,n){if(t===null)return e;if(e===null)return t;t=splay(e.key,t,n);t.left=e;return t}function printRow(e,t,n,r,i){if(e){r(""+t+(n?"└── ":"├── ")+i(e)+"\n");var o=t+(n?" ":"│ ");if(e.left)printRow(e.left,o,false,r,i);if(e.right)printRow(e.right,o,true,r,i)}}var R=function(){function Tree(e){if(e===void 0)e=DEFAULT_COMPARE;this._root=null;this._size=0;this._comparator=e}Tree.prototype.insert=function(e,t){this._size++;return this._root=insert(e,t,this._root,this._comparator)};Tree.prototype.add=function(e,t){var n=new l(e,t);if(this._root===null){n.left=n.right=null;this._size++;this._root=n}var r=this._comparator;var i=splay(e,this._root,r);var o=r(e,i.key);if(o===0)this._root=i;else{if(o<0){n.left=i.left;n.right=i;i.left=null}else if(o>0){n.right=i.right;n.left=i;i.right=null}this._size++;this._root=n}return this._root};Tree.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)};Tree.prototype._remove=function(e,t,n){var r;if(t===null)return null;t=splay(e,t,n);var i=n(e,t.key);if(i===0){if(t.left===null)r=t.right;else{r=splay(e,t.left,n);r.right=t.right}this._size--;return r}return t};Tree.prototype.pop=function(){var e=this._root;if(e){while(e.left)e=e.left;this._root=splay(e.key,this._root,this._comparator);this._root=this._remove(e.key,this._root,this._comparator);return{key:e.key,data:e.data}}return null};Tree.prototype.findStatic=function(e){var t=this._root;var n=this._comparator;while(t){var r=n(e,t.key);if(r===0)return t;else if(r<0)t=t.left;else t=t.right}return null};Tree.prototype.find=function(e){if(this._root){this._root=splay(e,this._root,this._comparator);if(this._comparator(e,this._root.key)!==0)return null}return this._root};Tree.prototype.contains=function(e){var t=this._root;var n=this._comparator;while(t){var r=n(e,t.key);if(r===0)return true;else if(r<0)t=t.left;else t=t.right}return false};Tree.prototype.forEach=function(e,t){var n=this._root;var r=[];var i=false;while(!i)if(n!==null){r.push(n);n=n.left}else if(r.length!==0){n=r.pop();e.call(t,n);n=n.right}else i=true;return this};Tree.prototype.range=function(e,t,n,r){var i=[];var o=this._comparator;var a=this._root;var s;while(i.length!==0||a)if(a){i.push(a);a=a.left}else{a=i.pop();s=o(a.key,t);if(s>0)break;else if(o(a.key,e)>=0)if(n.call(r,a))return this;a=a.right}return this};Tree.prototype.keys=function(){var n=[];this.forEach(function(e){var t=e.key;return n.push(t)});return n};Tree.prototype.values=function(){var n=[];this.forEach(function(e){var t=e.data;return n.push(t)});return n};Tree.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};Tree.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};Tree.prototype.minNode=function(e){if(e===void 0)e=this._root;if(e)while(e.left)e=e.left;return e};Tree.prototype.maxNode=function(e){if(e===void 0)e=this._root;if(e)while(e.right)e=e.right;return e};Tree.prototype.at=function(e){var t=this._root;var n=false;var r=0;var i=[];while(!n)if(t){i.push(t);t=t.left}else if(i.length>0){t=i.pop();if(r===e)return t;r++;t=t.right}else n=true;return null};Tree.prototype.next=function(e){var t=this._root;var n=null;if(e.right){n=e.right;while(n.left)n=n.left;return n}var r=this._comparator;while(t){var i=r(e.key,t.key);if(i===0)break;else if(i<0){n=t;t=t.left}else t=t.right}return n};Tree.prototype.prev=function(e){var t=this._root;var n=null;if(e.left!==null){n=e.left;while(n.right)n=n.right;return n}var r=this._comparator;while(t){var i=r(e.key,t.key);if(i===0)break;else if(i<0)t=t.left;else{n=t;t=t.right}}return n};Tree.prototype.clear=function(){this._root=null;this._size=0;return this};Tree.prototype.toList=function(){return toList(this._root)};Tree.prototype.load=function(e,t,n){if(t===void 0)t=[];if(n===void 0)n=false;var r=e.length;var i=this._comparator;if(n)sort(e,t,0,r-1,i);if(this._root===null){this._root=loadRecursive(e,t,0,r);this._size=r}else{var o=mergeLists(this.toList(),createList(e,t),i);r=this._size+r;this._root=sortedListToBST({head:o},0,r)}return this};Tree.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(Tree.prototype,"size",{get:function get(){return this._size},enumerable:true,configurable:true});Object.defineProperty(Tree.prototype,"root",{get:function get(){return this._root},enumerable:true,configurable:true});Tree.prototype.toString=function(e){if(e===void 0)e=function printNode(e){return String(e.key)};var t=[];printRow(this._root,"",true,function(e){return t.push(e)},e);return t.join("")};Tree.prototype.update=function(e,t,n){var r=this._comparator;var i=split(e,this._root,r),o=i.left,a=i.right;if(r(e,t)<0)a=insert(t,n,a,r);else o=insert(t,n,o,r);this._root=merge(o,a,r)};Tree.prototype.split=function(e){return split(e,this._root,this._comparator)};return Tree}();function loadRecursive(e,t,n,r){var i=r-n;if(i>0){var o=n+Math.floor(i/2);var a=e[o];var s=t[o];var A=new l(a,s);A.left=loadRecursive(e,t,n,o);A.right=loadRecursive(e,t,o+1,r);return A}return null}function createList(e,t){var n=new l(null,null);var r=n;for(var i=0;i0){t=o=o.next=n.pop();t=t.right}else r=true;o.next=null;return i.next}function sortedListToBST(e,t,n){var r=n-t;if(r>0){var i=t+Math.floor(r/2);var o=sortedListToBST(e,t,i);var a=e.head;a.left=o;e.head=e.head.next;a.right=sortedListToBST(e,i+1,n);return a}return null}function mergeLists(e,t,n){var r=new l(null,null);var i=r;var o=e;var a=t;while(o!==null&&a!==null){if(n(o.key,a.key)<0){i.next=o;o=o.next}else{i.next=a;a=a.next}i=i.next}if(o!==null)i.next=o;else if(a!==null)i.next=a;return r.next}function sort(e,t,n,r,i){if(n>=r)return;var o=e[n+r>>1];var a=n-1;var s=r+1;while(true){do{a++}while(i(e[a],o)<0);do{s--}while(i(e[s],o)>0);if(a>=s)break;var A=e[a];e[a]=e[s];e[s]=A;A=t[a];t[a]=t[s];t[s]=A}sort(e,t,n,s,i);sort(e,t,s+1,r,i)}var d=function isInBbox(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},F=function getBboxOverlap(e,t){if(t.ur.xt.x)return 1;if(e.yt.y)return 1;return 0}}]);function SweepEvent(e,t){_classCallCheck(this,SweepEvent);if(e.events===undefined)e.events=[this];else e.events.push(this);this.point=e;this.isLeft=t}_createClass(SweepEvent,[{key:"link",value:function link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");var t=e.point.events;for(var n=0,r=t.length;n=0&&a>=0){if(is)return-1;return 0}if(r<0&&a<0){if(is)return 1;return 0}if(ar)return 1;return 0}}}]);return SweepEvent}(),y=0,A=function(){_createClass(Segment,null,[{key:"compare",value:function compare(e,t){var n=e.leftSE.point.x;var r=t.leftSE.point.x;var i=e.rightSE.point.x;var o=t.rightSE.point.x;if(oa&&s>A)return-1;var c=e.comparePoint(t.leftSE.point);if(c<0)return 1;if(c>0)return-1;var g=t.comparePoint(e.rightSE.point);if(g!==0)return g;return-1}if(n>r){if(as&&a>l)return 1;var u=t.comparePoint(e.leftSE.point);if(u!==0)return u;var d=e.comparePoint(t.rightSE.point);if(d<0)return 1;if(d>0)return-1;return 1}if(as)return 1;if(io){var p=e.comparePoint(t.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(i!==o){var f=A-a;var I=i-n;var C=l-s;var m=o-r;if(f>I&&Cm)return-1}if(i>o)return 1;if(il)return 1;if(e.idt.id)return 1;return 0}}]);function Segment(e,t,n,r){_classCallCheck(this,Segment);this.id=++y;this.leftSE=e;e.segment=this;e.otherSE=t;this.rightSE=t;t.segment=this;t.otherSE=e;this.rings=n;this.windings=r}_createClass(Segment,[{key:"replaceRightSE",value:function replaceRightSE(e){this.rightSE=e;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function bbox(){var e=this.leftSE.point.y;var t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}},{key:"vector",value:function vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function comparePoint(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point;var n=this.rightSE.point;var r=this.vector();if(t.x===n.x){if(e.x===t.x)return 0;return e.x0)a.swapEvents();if(G.comparePoints(this.leftSE.point,this.rightSE.point)>0)this.swapEvents();if(n){r.checkForConsuming();i.checkForConsuming()}return t}},{key:"swapEvents",value:function swapEvents(){var e=this.rightSE;this.rightSE=this.leftSE;this.leftSE=e;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var t=0,n=this.windings.length;t0){var i=t;t=n;n=i}if(t.prev===n){var o=t;t=n;n=o}for(var a=0,s=n.rings.length;a0){r=t;i=e;o=-1}else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var s=new G(r,true);var A=new G(i,false);return new Segment(s,A,[n],[o])}}]);return Segment}(),c=function(){function RingIn(e,t,n){_classCallCheck(this,RingIn);if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=t;this.isExterior=n;this.segments=[];if(typeof e[0][0]!=="number"||typeof e[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=D.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};var i=r;for(var o=1,a=e.length;othis.bbox.ur.x)this.bbox.ur.x=s.x;if(s.y>this.bbox.ur.y)this.bbox.ur.y=s.y;i=s}if(r.x!==i.x||r.y!==i.y)this.segments.push(A.fromRing(i,r,this))}_createClass(RingIn,[{key:"getSweepEvents",value:function getSweepEvents(){var e=[];for(var t=0,n=this.segments.length;tthis.bbox.ur.x)this.bbox.ur.x=i.bbox.ur.x;if(i.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=i.bbox.ur.y;this.interiorRings.push(i)}this.multiPoly=t}_createClass(PolyIn,[{key:"getSweepEvents",value:function getSweepEvents(){var e=this.exteriorRing.getSweepEvents();for(var t=0,n=this.interiorRings.length;tthis.bbox.ur.x)this.bbox.ur.x=i.bbox.ur.x;if(i.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=i.bbox.ur.y;this.polys.push(i)}this.isSubject=t}_createClass(MultiPolyIn,[{key:"getSweepEvents",value:function getSweepEvents(){var e=[];for(var t=0,n=this.polys.length;t0)e=r}var i=e.segment.prevInResult();var o=i?i.prevInResult():null;while(true){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)if(o.ringOut.enclosingRing()!==i.ringOut)return i.ringOut;else return i.ringOut.enclosingRing();i=o.prevInResult();o=i?i.prevInResult():null}}}]);return RingOut}(),g=function(){function PolyOut(e){_classCallCheck(this,PolyOut);this.exteriorRing=e;e.poly=this;this.interiorRings=[]}_createClass(PolyOut,[{key:"addInterior",value:function addInterior(e){this.interiorRings.push(e);e.poly=this}},{key:"getGeom",value:function getGeom(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var t=0,n=this.interiorRings.length;t1&&arguments[1]!==undefined?arguments[1]:A.compare;_classCallCheck(this,SweepLine);this.queue=e;this.tree=new R(t);this.segments=[]}_createClass(SweepLine,[{key:"process",value:function process(e){var t=e.segment;var n=[];if(e.consumedBy){if(e.isLeft)this.queue.remove(e.otherSE);else this.tree.remove(t);return n}var r=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!r)throw new Error("Unable to find segment #".concat(t.id," ")+"[".concat(t.leftSE.point.x,", ").concat(t.leftSE.point.y,"] -> ")+"[".concat(t.rightSE.point.x,", ").concat(t.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");var i=r;var o=r;var a=undefined;var s=undefined;while(a===undefined){i=this.tree.prev(i);if(i===null)a=null;else if(i.key.consumedBy===undefined)a=i.key}while(s===undefined){o=this.tree.next(o);if(o===null)s=null;else if(o.key.consumedBy===undefined)s=o.key}if(e.isLeft){var A=null;if(a){var l=a.getIntersection(t);if(l!==null){if(!t.isAnEndpoint(l))A=l;if(!a.isAnEndpoint(l)){var c=this._splitSafely(a,l);for(var g=0,u=c.length;g0){this.tree.remove(t);n.push(e)}else{this.segments.push(t);t.prev=a}}else{if(a&&s){var v=a.getIntersection(s);if(v!==null){if(!a.isAnEndpoint(v)){var E=this._splitSafely(a,v);for(var Q=0,w=E.length;Qk)throw new Error("Infinite loop when putting segment endpoints in a priority queue "+"(queue size too big). Please file a bug report.")}}var m=new O(d);var y=d.size;var B=d.pop();while(B){var b=B.key;if(d.size===y){var v=b.segment;throw new Error("Unable to pop() ".concat(b.isLeft?"left":"right"," SweepEvent ")+"[".concat(b.point.x,", ").concat(b.point.y,"] from segment #").concat(v.id," ")+"[".concat(v.leftSE.point.x,", ").concat(v.leftSE.point.y,"] -> ")+"[".concat(v.rightSE.point.x,", ").concat(v.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>k)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(m.segments.length>L)throw new Error("Infinite loop when passing sweep line over endpoints "+"(too many sweep line segments). Please file a bug report.");var E=m.process(b);for(var Q=0,w=E.length;Q1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rMath.PI&&(t-=2*Math.PI);e=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),i=1e-11>>=0;if(i=0<=e&&e<256){r=a[e];if(r)return r}n=fromBits(e,(e|0)<0?-1:0,true);if(i)a[e]=n;return n}else{e|=0;if(i=-128<=e&&e<128){r=o[e];if(r)return r}n=fromBits(e,e<0?-1:0,false);if(i)o[e]=n;return n}}function fromNumber(e,t){if(isNaN(e)||!isFinite(e))return t?l:h;if(t){if(e<0)return l;if(e>=r)return A}else{if(e<=-i)return f;if(e+1>=i)return s}if(e<0)return fromNumber(-e,t).neg();return fromBits(e%n|0,e/n|0,t)}function fromBits(e,t,n){return new Long(e,t,n)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var c=Math.pow;function fromString(e,t,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return h;if(typeof t==="number")n=t,t=false;else t=!!t;n=n||10;if(n<2||360)throw Error("interior hyphen");else if(r===0)return fromString(e.substring(1),t,n).neg();var i=fromNumber(c(n,8));var o=h;for(var a=0;a>>0:this.low},I.toNumber=function toNumber(){if(this.unsigned)return(this.high>>>0)*n+(this.low>>>0);return this.high*n+(this.low>>>0)},I.toString=function toString(e){e=e||10;if(e<2||36>>0,l=A.toString(e);o=s;if(o.isZero())return l+a;else{while(l.length<6)l="0"+l;a=""+l+a}}},I.getHighBits=function getHighBits(){return this.high},I.getHighBitsUnsigned=function getHighBitsUnsigned(){return this.high>>>0},I.getLowBits=function getLowBits(){return this.low},I.getLowBitsUnsigned=function getLowBitsUnsigned(){return this.low>>>0},I.getNumBitsAbs=function getNumBitsAbs(){if(this.isNegative())return this.eq(f)?64:this.neg().getNumBitsAbs();var e=this.high!=0?this.high:this.low;for(var t=31;t>0;t--)if((e&1<=0},I.isOdd=function isOdd(){return(this.low&1)===1},I.isEven=function isEven(){return(this.low&1)===0},I.equals=function equals(e){if(!isLong(e))e=fromValue(e);if(this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1)return false;return this.high===e.high&&this.low===e.low},I.eq=I.equals,I.notEquals=function notEquals(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function lessThan(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function lessThanOrEqual(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function greaterThan(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function greaterThanOrEqual(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.compare=function compare(e){if(!isLong(e))e=fromValue(e);if(this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();if(t&&!n)return-1;if(!t&&n)return 1;if(!this.unsigned)return this.sub(e).isNegative()?-1:1;return e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1},I.comp=I.compare,I.negate=function negate(){if(!this.unsigned&&this.eq(f))return f;return this.not().add(g)},I.neg=I.negate,I.add=function add(e){if(!isLong(e))e=fromValue(e);var t=this.high>>>16;var n=this.high&65535;var r=this.low>>>16;var i=this.low&65535;var o=e.high>>>16;var a=e.high&65535;var s=e.low>>>16;var A=e.low&65535;var l=0,c=0,g=0,u=0;u+=i+A;g+=u>>>16;u&=65535;g+=r+s;c+=g>>>16;g&=65535;c+=n+a;l+=c>>>16;c&=65535;l+=t+o;l&=65535;return fromBits(g<<16|u,l<<16|c,this.unsigned)},I.subtract=function subtract(e){if(!isLong(e))e=fromValue(e);return this.add(e.neg())},I.sub=I.subtract,I.multiply=function multiply(e){if(this.isZero())return h;if(!isLong(e))e=fromValue(e);if(e.isZero())return h;if(this.eq(f))return e.isOdd()?f:h;if(e.eq(f))return this.isOdd()?f:h;if(this.isNegative())if(e.isNegative())return this.neg().mul(e.neg());else return this.neg().mul(e).neg();else if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16;var n=this.high&65535;var r=this.low>>>16;var i=this.low&65535;var o=e.high>>>16;var a=e.high&65535;var s=e.low>>>16;var A=e.low&65535;var l=0,c=0,g=0,u=0;u+=i*A;g+=u>>>16;u&=65535;g+=r*A;c+=g>>>16;g&=65535;g+=i*s;c+=g>>>16;g&=65535;c+=n*A;l+=c>>>16;c&=65535;c+=r*s;l+=c>>>16;c&=65535;c+=i*a;l+=c>>>16;c&=65535;l+=t*A+n*s+r*a+i*o;l&=65535;return fromBits(g<<16|u,l<<16|c,this.unsigned)},I.mul=I.multiply,I.divide=function divide(e){if(!isLong(e))e=fromValue(e);if(e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?l:h;var t,n,r;if(!this.unsigned){if(this.eq(f))if(e.eq(g)||e.eq(p))return f;else if(e.eq(f))return g;else{var i=this.shr(1);t=i.div(e).shl(1);if(t.eq(h))return e.isNegative()?g:p;else{n=this.sub(e.mul(t));r=t.add(n.div(e));return r}}else if(e.eq(f))return this.unsigned?l:h;if(this.isNegative()){if(e.isNegative())return this.neg().div(e.neg());return this.neg().div(e).neg()}else if(e.isNegative())return this.div(e.neg()).neg();r=h}else{if(!e.unsigned)e=e.toUnsigned();if(e.gt(this))return l;if(e.gt(this.shru(1)))return u;r=l}n=this;while(n.gte(e)){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));var o=Math.ceil(Math.log(t)/Math.LN2),a=o<=48?1:c(2,o-48),s=fromNumber(t),A=s.mul(e);while(A.isNegative()||A.gt(n)){t-=a;s=fromNumber(t,this.unsigned);A=s.mul(e)}if(s.isZero())s=g;r=r.add(s);n=n.sub(A)}return r},I.div=I.divide,I.modulo=function modulo(e){if(!isLong(e))e=fromValue(e);return this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function not(){return fromBits(~this.low,~this.high,this.unsigned)},I.and=function and(e){if(!isLong(e))e=fromValue(e);return fromBits(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function or(e){if(!isLong(e))e=fromValue(e);return fromBits(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function xor(e){if(!isLong(e))e=fromValue(e);return fromBits(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function shiftLeft(e){if(isLong(e))e=e.toInt();if((e&=63)===0)return this;else if(e<32)return fromBits(this.low<>>32-e,this.unsigned);else return fromBits(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned);else return fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function shiftRightUnsigned(e){if(isLong(e))e=e.toInt();e&=63;if(e===0)return this;else{var t=this.high;if(e<32){var n=this.low;return fromBits(n>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return fromBits(t,0,this.unsigned);else return fromBits(t>>>e-32,0,this.unsigned)}},I.shru=I.shiftRightUnsigned,I.toSigned=function toSigned(){if(!this.unsigned)return this;return fromBits(this.low,this.high,false)},I.toUnsigned=function toUnsigned(){if(this.unsigned)return this;return fromBits(this.low,this.high,true)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24&255,e&255,e>>>8&255,e>>>16&255,e>>>24&255]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255]},Long})?r.apply(t,[]):r)&&(e.exports=t)},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return shouldComposeModelMatrix});var B=n(92),r=n(22);const c=Math.PI/180,b=new Float32Array(16),v=new Float32Array(12);function calculateTransformMatrix(e,t,n){var r=t[0]*c,i=t[1]*c,t=t[2]*c,o=Math.sin(t),a=Math.sin(r),s=Math.sin(i),t=Math.cos(t),r=Math.cos(r),i=Math.cos(i),A=n[0],l=n[1],n=n[2];e[0]=A*i*r,e[1]=A*s*r,e[2]=A*-a,e[3]=l*(-s*t+i*a*o),e[4]=l*(i*t+s*a*o),e[5]=l*r*o,e[6]=n*(s*o+i*a*t),e[7]=n*(-i*o+s*a*t),e[8]=n*r*t}function getExtendedMat3FromMat4(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)}const i={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:r}){const{data:i,getOrientation:o,getScale:a,getTranslation:s,getTransformMatrix:A}=this.props;var t,l,c,g=Array.isArray(A),u=g&&16===A.length,d=Array.isArray(a),h=Array.isArray(o),p=Array.isArray(s),f=u||!g&&Boolean(A(i[0]));n.constant=f?u:h&&d&&p;const I=n.value;if(n.constant){let e;f?(b.set(A),e=getExtendedMat3FromMat4(b)):(e=v,g=o,t=a,calculateTransformMatrix(e,g,t),e.set(s,9)),n.value=new Float32Array(e)}else{let t=e*n.size;const{iterable:C,objectInfo:m}=Object(B.a)(i,e,r);for(const y of C){m.index++;let e;f?(b.set(u?A:A(y,m)),e=getExtendedMat3FromMat4(b)):(e=v,l=h?o:o(y,m),c=d?a:a(y,m),calculateTransformMatrix(e,l,c),e.set(p?s:s(y,m),9)),I[t++]=e[0],I[t++]=e[1],I[t++]=e[2],I[t++]=e[3],I[t++]=e[4],I[t++]=e[5],I[t++]=e[6],I[t++]=e[7],I[t++]=e[8],I[t++]=e[9],I[t++]=e[10],I[t++]=e[11]}}}};function shouldComposeModelMatrix(e,t){return t===r.a.CARTESIAN||t===r.a.METER_OFFSETS||t===r.a.DEFAULT&&!e.isGeospatial}},function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return g});var r=n(65),s=n(54);const i="OES_element_index",o="WEBGL_draw_buffers",a="WEBGL_debug_renderer_info";t=e=>Object(s.e)(e)?void 0:0;const A={[3074]:e=>Object(s.e)(e)?void 0:36064,35723:e=>Object(s.e)(e)?void 0:4352,35977:t,32937:t,36795:(e,t)=>{e=Object(s.e)(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return e&&e.GPU_DISJOINT_EXT?t(e.GPU_DISJOINT_EXT):0},37445:(e,t)=>{e=e.getExtension(a);return t(e&&e.UNMASKED_VENDOR_WEBGL||7936)},37446:(e,t)=>{e=e.getExtension(a);return t(e&&e.UNMASKED_RENDERER_WEBGL||7937)},34047:(e,t)=>{e=e.luma.extensions.EXT_texture_filter_anisotropic;return e?t(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:t,35071:t,37447:t,36063:(e,t)=>{if(!Object(s.e)(e))return(e=e.getExtension(o))?t(e.MAX_COLOR_ATTACHMENTS_WEBGL):0},35379:t,35374:t,35377:t,34852:e=>{if(!Object(s.e)(e))return(e=e.getExtension(o))?e.MAX_DRAW_BUFFERS_WEBGL:0},36203:e=>e.getExtension(i)?2147483647:65535,33001:e=>e.getExtension(i)?16777216:65535,33e3:e=>16777216,37157:t,35373:t,35657:t,36183:t,37137:t,34045:t,35978:t,35979:t,35968:t,35376:t,35375:t,35659:t,37154:t,35371:t,35658:t,35076:t,35077:t,35380:t};const l="ANGLE_instanced_arrays";const c={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Object(r.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},ANGLE_instanced_arrays:{meta:{suffix:"ANGLE"},vertexAttribDivisor(e,t){Object(r.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Object(r.a)(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Object(r.a)(!1)},deleteQuery:()=>{Object(r.a)(!1)},beginQuery:()=>{Object(r.a)(!1)},endQuery:()=>{},getQuery(e,t){return this.getQueryObject(e,t)},getQueryParameter(e,t){return this.getQueryObject(e,t)},getQueryObject:()=>{}}},g={readBuffer:(e,t,n)=>{Object(s.e)(e)&&t(n)},getVertexAttrib:(e,t,n,r)=>{var{webgl2:i,ext:o}=function getExtensionData(e,t){return{webgl2:Object(s.e)(e),ext:e.getExtension(t)}}(e,l);let a;switch(r){case 35069:a=!!i&&void 0;break;case 35070:a=i||o?void 0:0}return void 0!==a?a:t(n,r)},getProgramParameter:(e,t,n,r)=>{if(!Object(s.e)(e))switch(r){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,r)},getInternalformatParameter:(e,t,n,r,i)=>Object(s.e)(e)||32937!==i?e.getInternalformatParameter(n,r,i):new Int32Array([0]),getTexParameter(e,t,n,r){return 34046===r&&(e=e.luma["extensions"],r=(e=e.EXT_texture_filter_anisotropic)&&e.TEXTURE_MAX_ANISOTROPY_EXT||34046),t(n,r)},getParameter:function getParameterPolyfill(e,t,n){const r=A[n];return void 0!==(e="function"==typeof r?r(e,t,n):r)?e:t(n)},hint(e,t,n,r){return t(n,r)}}},,,,function(e,t,n){var r=n(513),i=n(752),o=n(222);e.exports=function keys(e){return(o(e)?r:i)(e)}},function(e,t,n){"use strict";function G53(e,t){var n=2{},o={BREAK:1,SNAP_TO_END:2,IGNORE:3},a={transitionEasing:e=>e,transitionInterruption:o.BREAK,onTransitionStart:i,onTransitionInterrupt:i,onTransitionEnd:i};class TransitionManager{constructor(e,t={}){this.ControllerState=e,this.props={...a,...t},this.propsInTransition=null,this.transition=new r.a(t.timeline),this.onViewStateChange=t.onViewStateChange||i,this.onStateChange=t.onStateChange||i,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;var n,r,i=this.props;return e={...a,...e},this.props=e,this._shouldIgnoreViewportChange(i,e)||(this._isTransitionEnabled(e)?({interruption:r,endProps:n}=this.transition.settings,r={...i,...r===o.SNAP_TO_END?n:this.propsInTransition||i},this._triggerTransition(r,e),t=!0):this.transition.cancel()),t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){var{transitionDuration:e,transitionInterpolator:t}=e;return(0{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t(e)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:n,startProps:r,endProps:i,duration:o,easing:a}}=e;e=a(t/o),e=n.interpolateProps(r,i,e);this.propsInTransition=new this.ControllerState({...this.props,...e}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}},function(e,t,n){"use strict";n.d(t,"a",function(){return LinearInterpolator});var t=n(234),a=n(12);const r=["longitude","latitude","zoom","bearing","pitch"],i=["longitude","latitude","zoom"];class LinearInterpolator extends t.a{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:r,extract:r,required:i}),this.opts=e}initializeProps(e,t){const n=super.initializeProps(e,t),{makeViewport:r,around:i}=this.opts;if(r&&i){const o=r(e),a=r(t);e=o.unproject(i);n.start.around=i,Object.assign(n.end,{around:a.project(e),aroundPosition:e,width:t.width,height:t.height})}return n}interpolateProps(e,t,n){const r={};for(const i of this._propsToExtract)r[i]=Object(a.lerp)(e[i]||0,t[i]||0,n);if(t.aroundPosition){const o=this.opts.makeViewport({...t,...r});Object.assign(r,o.panByPosition(t.aroundPosition,Object(a.lerp)(e.around,t.around,n)))}return r}}},function(e,t,n){"use strict";n.d(t,"a",function(){return lighting_effect_LightingEffect});var s=n(657),A=n(203),r=n(334),i=n(194),t=n(170),o=n(12),a=n(171),l=n(210),c=n(134),g=n(7);class shadow_pass_ShadowPass extends a.a{constructor(e,t){super(e,t),this.shadowMap=new A.a(e,{width:1,height:1,parameters:{[10241]:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new l.a(e,{format:33189,width:1,height:1}),this.fbo=new c.a(e,{id:"shadowmap",width:1,height:1,attachments:{[36064]:this.shadowMap,36096:this.depthBuffer}})}render(r){const i=this.fbo;Object(g.o)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{var e=r.viewports[0],t=Object(g.e)(this.gl),n=e.width*t,e=e.height*t;n===i.width&&e===i.height||i.resize({width:n,height:e}),super.render({...r,target:i,pass:"shadow"})})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}var u=n(247);const d={color:[255,255,255],intensity:1},h=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],p=[0,0,0,200/255];class lighting_effect_LightingEffect extends t.a{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=p,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const n in e){var t=e[n];switch(t.type){case"ambient":this.ambientLight=t;break;case"directional":this.directionalLights.push(t);break;case"point":this.pointLights.push(t)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(e=>e.shadow)}preRender(e,{layers:t,layerFilter:n,viewports:r,onViewportActive:i,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=s.a.getDefaultProgramManager(e),u.a&&this.programManager.addDefaultModule(u.a)),this.dummyShadowMap||(this.dummyShadowMap=new A.a(e,{width:1,height:1}));for(let e=0;ee.getProjectedLight({layer:t})),pointLights:this.pointLights.map(e=>e.getProjectedLight({layer:t}))},e}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(u.a),this.programManager=null)}_createLightMatrix(){const e=[];for(const n of this.directionalLights){var t=(new o.Matrix4).lookAt({eye:new o.Vector3(n.direction).negate()});e.push(t)}return e}_createShadowPasses(t){for(let e=0;ed.b?(u=Math.acos(u),i=Math.sin(u),o=Math.sin((1-r)*u)/i,Math.sin(r*u)/i):(o=1-r,r),e[0]=o*a+u*l,e[1]=o*s+u*c,e[2]=o*A+u*g,e[3]=o*t+u*n}function fromMat3(e,t){var n,r,i,o=t[0]+t[4]+t[8];return 0t[o=0]&&(o=1),n=((o=t[8]>t[3*o+o]?2:o)+1)%3,r=(o+2)%3,i=Math.sqrt(t[3*o+o]-t[3*n+n]-t[3*r+r]+1),e[o]=.5*i,e[3]=(t[3*n+r]-t[3*r+n])*(i=.5/i),e[n]=(t[3*n+o]+t[3*o+n])*i,e[r]=(t[3*r+o]+t[3*o+r])*i),e}s.b,s.g,s.c,s.l;var A,l,c,g=s.a,u=s.k,h=s.d,p=s.i,f=s.h,I=s.m,C=s.j,m=(s.f,s.e,A=a.c(),l=a.f(1,0,0),c=a.f(0,1,0),function(e,t,n){var r=a.e(t,n);return r<-.999999?(a.d(A,l,t),a.g(A)<1e-6&&a.d(A,c,t),a.l(A,A),setAxisAngle(e,A,Math.PI),e):.999999e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne/t)),e.positions||e);if(n){var o=i.length;i=i.slice();const s=[];for(let e=0;e{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(e=[]){e.forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;var{name:t,type:n}=e;return this.stats[t]||(e instanceof stat_Stat?this.stats[t]=e:this.stats[t]=new stat_Stat(t,n)),this.stats[t]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});n=`#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) + */var l=function(){function Node(e,t){this.next=null;this.key=e;this.data=t;this.left=null;this.right=null}return Node}();function DEFAULT_COMPARE(e,t){return e>t?1:e0){if(t.right===null)break;if(n(e,t.right.key)>0){var s=t.right;t.right=s.left;s.left=t;t=s;if(t.right===null)break}i.right=t;i=t;t=t.right}else break}i.right=t.left;o.left=t.right;t.left=r.right;t.right=r.left;return t}function insert(e,t,n,r){var i=new l(e,t);if(n===null){i.left=i.right=null;return i}n=splay(e,n,r);var o=r(e,n.key);if(o<0){i.left=n.left;i.right=n;n.left=null}else if(o>=0){i.right=n.right;i.left=n;n.right=null}return i}function split(e,t,n){var r=null;var i=null;if(t){t=splay(e,t,n);var o=n(t.key,e);if(o===0){r=t.left;i=t.right}else if(o<0){i=t.right;t.right=null;r=t}else{r=t.left;t.left=null;i=t}}return{left:r,right:i}}function merge(e,t,n){if(t===null)return e;if(e===null)return t;t=splay(e.key,t,n);t.left=e;return t}function printRow(e,t,n,r,i){if(e){r(""+t+(n?"└── ":"├── ")+i(e)+"\n");var o=t+(n?" ":"│ ");if(e.left)printRow(e.left,o,false,r,i);if(e.right)printRow(e.right,o,true,r,i)}}var R=function(){function Tree(e){if(e===void 0)e=DEFAULT_COMPARE;this._root=null;this._size=0;this._comparator=e}Tree.prototype.insert=function(e,t){this._size++;return this._root=insert(e,t,this._root,this._comparator)};Tree.prototype.add=function(e,t){var n=new l(e,t);if(this._root===null){n.left=n.right=null;this._size++;this._root=n}var r=this._comparator;var i=splay(e,this._root,r);var o=r(e,i.key);if(o===0)this._root=i;else{if(o<0){n.left=i.left;n.right=i;i.left=null}else if(o>0){n.right=i.right;n.left=i;i.right=null}this._size++;this._root=n}return this._root};Tree.prototype.remove=function(e){this._root=this._remove(e,this._root,this._comparator)};Tree.prototype._remove=function(e,t,n){var r;if(t===null)return null;t=splay(e,t,n);var i=n(e,t.key);if(i===0){if(t.left===null)r=t.right;else{r=splay(e,t.left,n);r.right=t.right}this._size--;return r}return t};Tree.prototype.pop=function(){var e=this._root;if(e){while(e.left)e=e.left;this._root=splay(e.key,this._root,this._comparator);this._root=this._remove(e.key,this._root,this._comparator);return{key:e.key,data:e.data}}return null};Tree.prototype.findStatic=function(e){var t=this._root;var n=this._comparator;while(t){var r=n(e,t.key);if(r===0)return t;else if(r<0)t=t.left;else t=t.right}return null};Tree.prototype.find=function(e){if(this._root){this._root=splay(e,this._root,this._comparator);if(this._comparator(e,this._root.key)!==0)return null}return this._root};Tree.prototype.contains=function(e){var t=this._root;var n=this._comparator;while(t){var r=n(e,t.key);if(r===0)return true;else if(r<0)t=t.left;else t=t.right}return false};Tree.prototype.forEach=function(e,t){var n=this._root;var r=[];var i=false;while(!i)if(n!==null){r.push(n);n=n.left}else if(r.length!==0){n=r.pop();e.call(t,n);n=n.right}else i=true;return this};Tree.prototype.range=function(e,t,n,r){var i=[];var o=this._comparator;var a=this._root;var s;while(i.length!==0||a)if(a){i.push(a);a=a.left}else{a=i.pop();s=o(a.key,t);if(s>0)break;else if(o(a.key,e)>=0)if(n.call(r,a))return this;a=a.right}return this};Tree.prototype.keys=function(){var n=[];this.forEach(function(e){var t=e.key;return n.push(t)});return n};Tree.prototype.values=function(){var n=[];this.forEach(function(e){var t=e.data;return n.push(t)});return n};Tree.prototype.min=function(){if(this._root)return this.minNode(this._root).key;return null};Tree.prototype.max=function(){if(this._root)return this.maxNode(this._root).key;return null};Tree.prototype.minNode=function(e){if(e===void 0)e=this._root;if(e)while(e.left)e=e.left;return e};Tree.prototype.maxNode=function(e){if(e===void 0)e=this._root;if(e)while(e.right)e=e.right;return e};Tree.prototype.at=function(e){var t=this._root;var n=false;var r=0;var i=[];while(!n)if(t){i.push(t);t=t.left}else if(i.length>0){t=i.pop();if(r===e)return t;r++;t=t.right}else n=true;return null};Tree.prototype.next=function(e){var t=this._root;var n=null;if(e.right){n=e.right;while(n.left)n=n.left;return n}var r=this._comparator;while(t){var i=r(e.key,t.key);if(i===0)break;else if(i<0){n=t;t=t.left}else t=t.right}return n};Tree.prototype.prev=function(e){var t=this._root;var n=null;if(e.left!==null){n=e.left;while(n.right)n=n.right;return n}var r=this._comparator;while(t){var i=r(e.key,t.key);if(i===0)break;else if(i<0)t=t.left;else{n=t;t=t.right}}return n};Tree.prototype.clear=function(){this._root=null;this._size=0;return this};Tree.prototype.toList=function(){return toList(this._root)};Tree.prototype.load=function(e,t,n){if(t===void 0)t=[];if(n===void 0)n=false;var r=e.length;var i=this._comparator;if(n)sort(e,t,0,r-1,i);if(this._root===null){this._root=loadRecursive(e,t,0,r);this._size=r}else{var o=mergeLists(this.toList(),createList(e,t),i);r=this._size+r;this._root=sortedListToBST({head:o},0,r)}return this};Tree.prototype.isEmpty=function(){return this._root===null};Object.defineProperty(Tree.prototype,"size",{get:function get(){return this._size},enumerable:true,configurable:true});Object.defineProperty(Tree.prototype,"root",{get:function get(){return this._root},enumerable:true,configurable:true});Tree.prototype.toString=function(e){if(e===void 0)e=function printNode(e){return String(e.key)};var t=[];printRow(this._root,"",true,function(e){return t.push(e)},e);return t.join("")};Tree.prototype.update=function(e,t,n){var r=this._comparator;var i=split(e,this._root,r),o=i.left,a=i.right;if(r(e,t)<0)a=insert(t,n,a,r);else o=insert(t,n,o,r);this._root=merge(o,a,r)};Tree.prototype.split=function(e){return split(e,this._root,this._comparator)};return Tree}();function loadRecursive(e,t,n,r){var i=r-n;if(i>0){var o=n+Math.floor(i/2);var a=e[o];var s=t[o];var A=new l(a,s);A.left=loadRecursive(e,t,n,o);A.right=loadRecursive(e,t,o+1,r);return A}return null}function createList(e,t){var n=new l(null,null);var r=n;for(var i=0;i0){t=o=o.next=n.pop();t=t.right}else r=true;o.next=null;return i.next}function sortedListToBST(e,t,n){var r=n-t;if(r>0){var i=t+Math.floor(r/2);var o=sortedListToBST(e,t,i);var a=e.head;a.left=o;e.head=e.head.next;a.right=sortedListToBST(e,i+1,n);return a}return null}function mergeLists(e,t,n){var r=new l(null,null);var i=r;var o=e;var a=t;while(o!==null&&a!==null){if(n(o.key,a.key)<0){i.next=o;o=o.next}else{i.next=a;a=a.next}i=i.next}if(o!==null)i.next=o;else if(a!==null)i.next=a;return r.next}function sort(e,t,n,r,i){if(n>=r)return;var o=e[n+r>>1];var a=n-1;var s=r+1;while(true){do{a++}while(i(e[a],o)<0);do{s--}while(i(e[s],o)>0);if(a>=s)break;var A=e[a];e[a]=e[s];e[s]=A;A=t[a];t[a]=t[s];t[s]=A}sort(e,t,n,s,i);sort(e,t,s+1,r,i)}var d=function isInBbox(e,t){return e.ll.x<=t.x&&t.x<=e.ur.x&&e.ll.y<=t.y&&t.y<=e.ur.y},F=function getBboxOverlap(e,t){if(t.ur.xt.x)return 1;if(e.yt.y)return 1;return 0}}]);function SweepEvent(e,t){_classCallCheck(this,SweepEvent);if(e.events===undefined)e.events=[this];else e.events.push(this);this.point=e;this.isLeft=t}_createClass(SweepEvent,[{key:"link",value:function link(e){if(e.point===this.point)throw new Error("Tried to link already linked events");var t=e.point.events;for(var n=0,r=t.length;n=0&&a>=0){if(is)return-1;return 0}if(r<0&&a<0){if(is)return 1;return 0}if(ar)return 1;return 0}}}]);return SweepEvent}(),y=0,A=function(){_createClass(Segment,null,[{key:"compare",value:function compare(e,t){var n=e.leftSE.point.x;var r=t.leftSE.point.x;var i=e.rightSE.point.x;var o=t.rightSE.point.x;if(oa&&s>A)return-1;var c=e.comparePoint(t.leftSE.point);if(c<0)return 1;if(c>0)return-1;var g=t.comparePoint(e.rightSE.point);if(g!==0)return g;return-1}if(n>r){if(as&&a>l)return 1;var u=t.comparePoint(e.leftSE.point);if(u!==0)return u;var d=e.comparePoint(t.rightSE.point);if(d<0)return 1;if(d>0)return-1;return 1}if(as)return 1;if(io){var p=e.comparePoint(t.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(i!==o){var f=A-a;var I=i-n;var C=l-s;var m=o-r;if(f>I&&Cm)return-1}if(i>o)return 1;if(il)return 1;if(e.idt.id)return 1;return 0}}]);function Segment(e,t,n,r){_classCallCheck(this,Segment);this.id=++y;this.leftSE=e;e.segment=this;e.otherSE=t;this.rightSE=t;t.segment=this;t.otherSE=e;this.rings=n;this.windings=r}_createClass(Segment,[{key:"replaceRightSE",value:function replaceRightSE(e){this.rightSE=e;this.rightSE.segment=this;this.rightSE.otherSE=this.leftSE;this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function bbox(){var e=this.leftSE.point.y;var t=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:et?e:t}}}},{key:"vector",value:function vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function isAnEndpoint(e){return e.x===this.leftSE.point.x&&e.y===this.leftSE.point.y||e.x===this.rightSE.point.x&&e.y===this.rightSE.point.y}},{key:"comparePoint",value:function comparePoint(e){if(this.isAnEndpoint(e))return 0;var t=this.leftSE.point;var n=this.rightSE.point;var r=this.vector();if(t.x===n.x){if(e.x===t.x)return 0;return e.x0)a.swapEvents();if(G.comparePoints(this.leftSE.point,this.rightSE.point)>0)this.swapEvents();if(n){r.checkForConsuming();i.checkForConsuming()}return t}},{key:"swapEvents",value:function swapEvents(){var e=this.rightSE;this.rightSE=this.leftSE;this.leftSE=e;this.leftSE.isLeft=true;this.rightSE.isLeft=false;for(var t=0,n=this.windings.length;t0){var i=t;t=n;n=i}if(t.prev===n){var o=t;t=n;n=o}for(var a=0,s=n.rings.length;a0){r=t;i=e;o=-1}else throw new Error("Tried to create degenerate segment at [".concat(e.x,", ").concat(e.y,"]"));var s=new G(r,true);var A=new G(i,false);return new Segment(s,A,[n],[o])}}]);return Segment}(),c=function(){function RingIn(e,t,n){_classCallCheck(this,RingIn);if(!Array.isArray(e)||e.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.poly=t;this.isExterior=n;this.segments=[];if(typeof e[0][0]!=="number"||typeof e[0][1]!=="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var r=D.round(e[0][0],e[0][1]);this.bbox={ll:{x:r.x,y:r.y},ur:{x:r.x,y:r.y}};var i=r;for(var o=1,a=e.length;othis.bbox.ur.x)this.bbox.ur.x=s.x;if(s.y>this.bbox.ur.y)this.bbox.ur.y=s.y;i=s}if(r.x!==i.x||r.y!==i.y)this.segments.push(A.fromRing(i,r,this))}_createClass(RingIn,[{key:"getSweepEvents",value:function getSweepEvents(){var e=[];for(var t=0,n=this.segments.length;tthis.bbox.ur.x)this.bbox.ur.x=i.bbox.ur.x;if(i.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=i.bbox.ur.y;this.interiorRings.push(i)}this.multiPoly=t}_createClass(PolyIn,[{key:"getSweepEvents",value:function getSweepEvents(){var e=this.exteriorRing.getSweepEvents();for(var t=0,n=this.interiorRings.length;tthis.bbox.ur.x)this.bbox.ur.x=i.bbox.ur.x;if(i.bbox.ur.y>this.bbox.ur.y)this.bbox.ur.y=i.bbox.ur.y;this.polys.push(i)}this.isSubject=t}_createClass(MultiPolyIn,[{key:"getSweepEvents",value:function getSweepEvents(){var e=[];for(var t=0,n=this.polys.length;t0)e=r}var i=e.segment.prevInResult();var o=i?i.prevInResult():null;while(true){if(!i)return null;if(!o)return i.ringOut;if(o.ringOut!==i.ringOut)if(o.ringOut.enclosingRing()!==i.ringOut)return i.ringOut;else return i.ringOut.enclosingRing();i=o.prevInResult();o=i?i.prevInResult():null}}}]);return RingOut}(),g=function(){function PolyOut(e){_classCallCheck(this,PolyOut);this.exteriorRing=e;e.poly=this;this.interiorRings=[]}_createClass(PolyOut,[{key:"addInterior",value:function addInterior(e){this.interiorRings.push(e);e.poly=this}},{key:"getGeom",value:function getGeom(){var e=[this.exteriorRing.getGeom()];if(e[0]===null)return null;for(var t=0,n=this.interiorRings.length;t1&&arguments[1]!==undefined?arguments[1]:A.compare;_classCallCheck(this,SweepLine);this.queue=e;this.tree=new R(t);this.segments=[]}_createClass(SweepLine,[{key:"process",value:function process(e){var t=e.segment;var n=[];if(e.consumedBy){if(e.isLeft)this.queue.remove(e.otherSE);else this.tree.remove(t);return n}var r=e.isLeft?this.tree.insert(t):this.tree.find(t);if(!r)throw new Error("Unable to find segment #".concat(t.id," ")+"[".concat(t.leftSE.point.x,", ").concat(t.leftSE.point.y,"] -> ")+"[".concat(t.rightSE.point.x,", ").concat(t.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");var i=r;var o=r;var a=undefined;var s=undefined;while(a===undefined){i=this.tree.prev(i);if(i===null)a=null;else if(i.key.consumedBy===undefined)a=i.key}while(s===undefined){o=this.tree.next(o);if(o===null)s=null;else if(o.key.consumedBy===undefined)s=o.key}if(e.isLeft){var A=null;if(a){var l=a.getIntersection(t);if(l!==null){if(!t.isAnEndpoint(l))A=l;if(!a.isAnEndpoint(l)){var c=this._splitSafely(a,l);for(var g=0,u=c.length;g0){this.tree.remove(t);n.push(e)}else{this.segments.push(t);t.prev=a}}else{if(a&&s){var v=a.getIntersection(s);if(v!==null){if(!a.isAnEndpoint(v)){var E=this._splitSafely(a,v);for(var Q=0,w=E.length;Qk)throw new Error("Infinite loop when putting segment endpoints in a priority queue "+"(queue size too big). Please file a bug report.")}}var m=new O(d);var y=d.size;var B=d.pop();while(B){var b=B.key;if(d.size===y){var v=b.segment;throw new Error("Unable to pop() ".concat(b.isLeft?"left":"right"," SweepEvent ")+"[".concat(b.point.x,", ").concat(b.point.y,"] from segment #").concat(v.id," ")+"[".concat(v.leftSE.point.x,", ").concat(v.leftSE.point.y,"] -> ")+"[".concat(v.rightSE.point.x,", ").concat(v.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(d.size>k)throw new Error("Infinite loop when passing sweep line over endpoints "+"(queue size too big). Please file a bug report.");if(m.segments.length>L)throw new Error("Infinite loop when passing sweep line over endpoints "+"(too many sweep line segments). Please file a bug report.");var E=m.process(b);for(var Q=0,w=E.length;Q1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;r1?t-1:0),r=1;rMath.PI&&(t-=2*Math.PI);e=Math.log(Math.tan(i/2+Math.PI/4)/Math.tan(r/2+Math.PI/4)),i=1e-11>>=0;if(i=0<=e&&e<256){r=a[e];if(r)return r}n=fromBits(e,(e|0)<0?-1:0,true);if(i)a[e]=n;return n}else{e|=0;if(i=-128<=e&&e<128){r=o[e];if(r)return r}n=fromBits(e,e<0?-1:0,false);if(i)o[e]=n;return n}}function fromNumber(e,t){if(isNaN(e)||!isFinite(e))return t?l:h;if(t){if(e<0)return l;if(e>=r)return A}else{if(e<=-i)return f;if(e+1>=i)return s}if(e<0)return fromNumber(-e,t).neg();return fromBits(e%n|0,e/n|0,t)}function fromBits(e,t,n){return new Long(e,t,n)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var c=Math.pow;function fromString(e,t,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return h;if(typeof t==="number")n=t,t=false;else t=!!t;n=n||10;if(n<2||360)throw Error("interior hyphen");else if(r===0)return fromString(e.substring(1),t,n).neg();var i=fromNumber(c(n,8));var o=h;for(var a=0;a>>0:this.low},I.toNumber=function toNumber(){if(this.unsigned)return(this.high>>>0)*n+(this.low>>>0);return this.high*n+(this.low>>>0)},I.toString=function toString(e){e=e||10;if(e<2||36>>0,l=A.toString(e);o=s;if(o.isZero())return l+a;else{while(l.length<6)l="0"+l;a=""+l+a}}},I.getHighBits=function getHighBits(){return this.high},I.getHighBitsUnsigned=function getHighBitsUnsigned(){return this.high>>>0},I.getLowBits=function getLowBits(){return this.low},I.getLowBitsUnsigned=function getLowBitsUnsigned(){return this.low>>>0},I.getNumBitsAbs=function getNumBitsAbs(){if(this.isNegative())return this.eq(f)?64:this.neg().getNumBitsAbs();var e=this.high!=0?this.high:this.low;for(var t=31;t>0;t--)if((e&1<=0},I.isOdd=function isOdd(){return(this.low&1)===1},I.isEven=function isEven(){return(this.low&1)===0},I.equals=function equals(e){if(!isLong(e))e=fromValue(e);if(this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1)return false;return this.high===e.high&&this.low===e.low},I.eq=I.equals,I.notEquals=function notEquals(e){return!this.eq(e)},I.neq=I.notEquals,I.lessThan=function lessThan(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function lessThanOrEqual(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.greaterThan=function greaterThan(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function greaterThanOrEqual(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.compare=function compare(e){if(!isLong(e))e=fromValue(e);if(this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();if(t&&!n)return-1;if(!t&&n)return 1;if(!this.unsigned)return this.sub(e).isNegative()?-1:1;return e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1},I.comp=I.compare,I.negate=function negate(){if(!this.unsigned&&this.eq(f))return f;return this.not().add(g)},I.neg=I.negate,I.add=function add(e){if(!isLong(e))e=fromValue(e);var t=this.high>>>16;var n=this.high&65535;var r=this.low>>>16;var i=this.low&65535;var o=e.high>>>16;var a=e.high&65535;var s=e.low>>>16;var A=e.low&65535;var l=0,c=0,g=0,u=0;u+=i+A;g+=u>>>16;u&=65535;g+=r+s;c+=g>>>16;g&=65535;c+=n+a;l+=c>>>16;c&=65535;l+=t+o;l&=65535;return fromBits(g<<16|u,l<<16|c,this.unsigned)},I.subtract=function subtract(e){if(!isLong(e))e=fromValue(e);return this.add(e.neg())},I.sub=I.subtract,I.multiply=function multiply(e){if(this.isZero())return h;if(!isLong(e))e=fromValue(e);if(e.isZero())return h;if(this.eq(f))return e.isOdd()?f:h;if(e.eq(f))return this.isOdd()?f:h;if(this.isNegative())if(e.isNegative())return this.neg().mul(e.neg());else return this.neg().mul(e).neg();else if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(d)&&e.lt(d))return fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16;var n=this.high&65535;var r=this.low>>>16;var i=this.low&65535;var o=e.high>>>16;var a=e.high&65535;var s=e.low>>>16;var A=e.low&65535;var l=0,c=0,g=0,u=0;u+=i*A;g+=u>>>16;u&=65535;g+=r*A;c+=g>>>16;g&=65535;g+=i*s;c+=g>>>16;g&=65535;c+=n*A;l+=c>>>16;c&=65535;c+=r*s;l+=c>>>16;c&=65535;c+=i*a;l+=c>>>16;c&=65535;l+=t*A+n*s+r*a+i*o;l&=65535;return fromBits(g<<16|u,l<<16|c,this.unsigned)},I.mul=I.multiply,I.divide=function divide(e){if(!isLong(e))e=fromValue(e);if(e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?l:h;var t,n,r;if(!this.unsigned){if(this.eq(f))if(e.eq(g)||e.eq(p))return f;else if(e.eq(f))return g;else{var i=this.shr(1);t=i.div(e).shl(1);if(t.eq(h))return e.isNegative()?g:p;else{n=this.sub(e.mul(t));r=t.add(n.div(e));return r}}else if(e.eq(f))return this.unsigned?l:h;if(this.isNegative()){if(e.isNegative())return this.neg().div(e.neg());return this.neg().div(e).neg()}else if(e.isNegative())return this.div(e.neg()).neg();r=h}else{if(!e.unsigned)e=e.toUnsigned();if(e.gt(this))return l;if(e.gt(this.shru(1)))return u;r=l}n=this;while(n.gte(e)){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));var o=Math.ceil(Math.log(t)/Math.LN2),a=o<=48?1:c(2,o-48),s=fromNumber(t),A=s.mul(e);while(A.isNegative()||A.gt(n)){t-=a;s=fromNumber(t,this.unsigned);A=s.mul(e)}if(s.isZero())s=g;r=r.add(s);n=n.sub(A)}return r},I.div=I.divide,I.modulo=function modulo(e){if(!isLong(e))e=fromValue(e);return this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.not=function not(){return fromBits(~this.low,~this.high,this.unsigned)},I.and=function and(e){if(!isLong(e))e=fromValue(e);return fromBits(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function or(e){if(!isLong(e))e=fromValue(e);return fromBits(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function xor(e){if(!isLong(e))e=fromValue(e);return fromBits(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function shiftLeft(e){if(isLong(e))e=e.toInt();if((e&=63)===0)return this;else if(e<32)return fromBits(this.low<>>32-e,this.unsigned);else return fromBits(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned);else return fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function shiftRightUnsigned(e){if(isLong(e))e=e.toInt();e&=63;if(e===0)return this;else{var t=this.high;if(e<32){var n=this.low;return fromBits(n>>>e|t<<32-e,t>>>e,this.unsigned)}else if(e===32)return fromBits(t,0,this.unsigned);else return fromBits(t>>>e-32,0,this.unsigned)}},I.shru=I.shiftRightUnsigned,I.toSigned=function toSigned(){if(!this.unsigned)return this;return fromBits(this.low,this.high,false)},I.toUnsigned=function toUnsigned(){if(this.unsigned)return this;return fromBits(this.low,this.high,true)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[t&255,t>>>8&255,t>>>16&255,t>>>24&255,e&255,e>>>8&255,e>>>16&255,e>>>24&255]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,e&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255]},Long})?r.apply(t,[]):r)&&(e.exports=t)},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return shouldComposeModelMatrix});var B=n(94),r=n(22);const c=Math.PI/180,b=new Float32Array(16),v=new Float32Array(12);function calculateTransformMatrix(e,t,n){var r=t[0]*c,i=t[1]*c,t=t[2]*c,o=Math.sin(t),a=Math.sin(r),s=Math.sin(i),t=Math.cos(t),r=Math.cos(r),i=Math.cos(i),A=n[0],l=n[1],n=n[2];e[0]=A*i*r,e[1]=A*s*r,e[2]=A*-a,e[3]=l*(-s*t+i*a*o),e[4]=l*(i*t+s*a*o),e[5]=l*r*o,e[6]=n*(s*o+i*a*t),e[7]=n*(-i*o+s*a*t),e[8]=n*r*t}function getExtendedMat3FromMat4(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)}const i={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(n,{startRow:e,endRow:r}){const{data:i,getOrientation:o,getScale:a,getTranslation:s,getTransformMatrix:A}=this.props;var t,l,c,g=Array.isArray(A),u=g&&16===A.length,d=Array.isArray(a),h=Array.isArray(o),p=Array.isArray(s),f=u||!g&&Boolean(A(i[0]));n.constant=f?u:h&&d&&p;const I=n.value;if(n.constant){let e;f?(b.set(A),e=getExtendedMat3FromMat4(b)):(e=v,g=o,t=a,calculateTransformMatrix(e,g,t),e.set(s,9)),n.value=new Float32Array(e)}else{let t=e*n.size;const{iterable:C,objectInfo:m}=Object(B.a)(i,e,r);for(const y of C){m.index++;let e;f?(b.set(u?A:A(y,m)),e=getExtendedMat3FromMat4(b)):(e=v,l=h?o:o(y,m),c=d?a:a(y,m),calculateTransformMatrix(e,l,c),e.set(p?s:s(y,m),9)),I[t++]=e[0],I[t++]=e[1],I[t++]=e[2],I[t++]=e[3],I[t++]=e[4],I[t++]=e[5],I[t++]=e[6],I[t++]=e[7],I[t++]=e[8],I[t++]=e[9],I[t++]=e[10],I[t++]=e[11]}}}};function shouldComposeModelMatrix(e,t){return t===r.a.CARTESIAN||t===r.a.METER_OFFSETS||t===r.a.DEFAULT&&!e.isGeospatial}},function(e,t,n){var r=n(904);e.exports=function cloneDeep(e){return r(e,5)}},function(e,t,n){"use strict";n.d(t,"b",function(){return c}),n.d(t,"a",function(){return g});var r=n(66),s=n(55);const i="OES_element_index",o="WEBGL_draw_buffers",a="WEBGL_debug_renderer_info";t=e=>Object(s.e)(e)?void 0:0;const A={[3074]:e=>Object(s.e)(e)?void 0:36064,35723:e=>Object(s.e)(e)?void 0:4352,35977:t,32937:t,36795:(e,t)=>{e=Object(s.e)(e)?e.getExtension("EXT_disjoint_timer_query_webgl2"):e.getExtension("EXT_disjoint_timer_query");return e&&e.GPU_DISJOINT_EXT?t(e.GPU_DISJOINT_EXT):0},37445:(e,t)=>{e=e.getExtension(a);return t(e&&e.UNMASKED_VENDOR_WEBGL||7936)},37446:(e,t)=>{e=e.getExtension(a);return t(e&&e.UNMASKED_RENDERER_WEBGL||7937)},34047:(e,t)=>{e=e.luma.extensions.EXT_texture_filter_anisotropic;return e?t(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:t,35071:t,37447:t,36063:(e,t)=>{if(!Object(s.e)(e))return(e=e.getExtension(o))?t(e.MAX_COLOR_ATTACHMENTS_WEBGL):0},35379:t,35374:t,35377:t,34852:e=>{if(!Object(s.e)(e))return(e=e.getExtension(o))?e.MAX_DRAW_BUFFERS_WEBGL:0},36203:e=>e.getExtension(i)?2147483647:65535,33001:e=>e.getExtension(i)?16777216:65535,33e3:e=>16777216,37157:t,35373:t,35657:t,36183:t,37137:t,34045:t,35978:t,35979:t,35968:t,35376:t,35375:t,35659:t,37154:t,35371:t,35658:t,35076:t,35077:t,35380:t};const l="ANGLE_instanced_arrays";const c={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{Object(r.a)(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},ANGLE_instanced_arrays:{meta:{suffix:"ANGLE"},vertexAttribDivisor(e,t){Object(r.a)(0===t,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{Object(r.a)(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"},createQuery:()=>{Object(r.a)(!1)},deleteQuery:()=>{Object(r.a)(!1)},beginQuery:()=>{Object(r.a)(!1)},endQuery:()=>{},getQuery(e,t){return this.getQueryObject(e,t)},getQueryParameter(e,t){return this.getQueryObject(e,t)},getQueryObject:()=>{}}},g={readBuffer:(e,t,n)=>{Object(s.e)(e)&&t(n)},getVertexAttrib:(e,t,n,r)=>{var{webgl2:i,ext:o}=function getExtensionData(e,t){return{webgl2:Object(s.e)(e),ext:e.getExtension(t)}}(e,l);let a;switch(r){case 35069:a=!!i&&void 0;break;case 35070:a=i||o?void 0:0}return void 0!==a?a:t(n,r)},getProgramParameter:(e,t,n,r)=>{if(!Object(s.e)(e))switch(r){case 35967:return 35981;case 35971:case 35382:return 0}return t(n,r)},getInternalformatParameter:(e,t,n,r,i)=>Object(s.e)(e)||32937!==i?e.getInternalformatParameter(n,r,i):new Int32Array([0]),getTexParameter(e,t,n,r){return 34046===r&&(e=e.luma["extensions"],r=(e=e.EXT_texture_filter_anisotropic)&&e.TEXTURE_MAX_ANISOTROPY_EXT||34046),t(n,r)},getParameter:function getParameterPolyfill(e,t,n){const r=A[n];return void 0!==(e="function"==typeof r?r(e,t,n):r)?e:t(n)},hint(e,t,n,r){return t(n,r)}}},,,,function(e,t,n){var r=n(522),i=n(783),o=n(226);e.exports=function keys(e){return(o(e)?r:i)(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=_interopRequireDefault(n(540)),o=_interopRequireDefault(n(1139));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function _typeof(e){return typeof e}:function _typeof(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _defineProperties(e,t){for(var n=0;n{},o={BREAK:1,SNAP_TO_END:2,IGNORE:3},a={transitionEasing:e=>e,transitionInterruption:o.BREAK,onTransitionStart:i,onTransitionInterrupt:i,onTransitionEnd:i};class TransitionManager{constructor(e,t={}){this.ControllerState=e,this.props={...a,...t},this.propsInTransition=null,this.transition=new r.a(t.timeline),this.onViewStateChange=t.onViewStateChange||i,this.onStateChange=t.onStateChange||i,this._onTransitionUpdate=this._onTransitionUpdate.bind(this)}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(e){let t=!1;var n,r,i=this.props;return e={...a,...e},this.props=e,this._shouldIgnoreViewportChange(i,e)||(this._isTransitionEnabled(e)?({interruption:r,endProps:n}=this.transition.settings,r={...i,...r===o.SNAP_TO_END?n:this.propsInTransition||i},this._triggerTransition(r,e),t=!0):this.transition.cancel()),t}updateTransition(){this.transition.update()}_isTransitionEnabled(e){var{transitionDuration:e,transitionInterpolator:t}=e;return(0{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),t(e)}}_onTransitionUpdate(e){const{time:t,settings:{interpolator:n,startProps:r,endProps:i,duration:o,easing:a}}=e;e=a(t/o),e=n.interpolateProps(r,i,e);this.propsInTransition=new this.ControllerState({...this.props,...e}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})}}},function(e,t,n){"use strict";n.d(t,"a",function(){return LinearInterpolator});var t=n(240),a=n(12);const r=["longitude","latitude","zoom","bearing","pitch"],i=["longitude","latitude","zoom"];class LinearInterpolator extends t.a{constructor(e={}){super((Array.isArray(e)?e:e.transitionProps)||{compare:r,extract:r,required:i}),this.opts=e}initializeProps(e,t){const n=super.initializeProps(e,t),{makeViewport:r,around:i}=this.opts;if(r&&i){const o=r(e),a=r(t);e=o.unproject(i);n.start.around=i,Object.assign(n.end,{around:a.project(e),aroundPosition:e,width:t.width,height:t.height})}return n}interpolateProps(e,t,n){const r={};for(const i of this._propsToExtract)r[i]=Object(a.lerp)(e[i]||0,t[i]||0,n);if(t.aroundPosition){const o=this.opts.makeViewport({...t,...r});Object.assign(r,o.panByPosition(t.aroundPosition,Object(a.lerp)(e.around,t.around,n)))}return r}}},function(e,t,n){"use strict";n.d(t,"a",function(){return lighting_effect_LightingEffect});var s=n(689),A=n(208),r=n(341),i=n(199),t=n(175),o=n(12),a=n(176),l=n(214),c=n(137),g=n(7);class shadow_pass_ShadowPass extends a.a{constructor(e,t){super(e,t),this.shadowMap=new A.a(e,{width:1,height:1,parameters:{[10241]:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new l.a(e,{format:33189,width:1,height:1}),this.fbo=new c.a(e,{id:"shadowmap",width:1,height:1,attachments:{[36064]:this.shadowMap,36096:this.depthBuffer}})}render(r){const i=this.fbo;Object(g.o)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},()=>{var e=r.viewports[0],t=Object(g.e)(this.gl),n=e.width*t,e=e.height*t;n===i.width&&e===i.height||i.resize({width:n,height:e}),super.render({...r,target:i,pass:"shadow"})})}shouldDrawLayer(e){return!1!==e.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}var u=n(253);const d={color:[255,255,255],intensity:1},h=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],p=[0,0,0,200/255];class lighting_effect_LightingEffect extends t.a{constructor(e){super(e),this.ambientLight=null,this.directionalLights=[],this.pointLights=[],this.shadowColor=p,this.shadowPasses=[],this.shadowMaps=[],this.dummyShadowMap=null,this.shadow=!1,this.programManager=null;for(const n in e){var t=e[n];switch(t.type){case"ambient":this.ambientLight=t;break;case"directional":this.directionalLights.push(t);break;case"point":this.pointLights.push(t)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(e=>e.shadow)}preRender(e,{layers:t,layerFilter:n,viewports:r,onViewportActive:i,views:o}){if(this.shadow){this.shadowMatrices=this._createLightMatrix(),0===this.shadowPasses.length&&this._createShadowPasses(e),this.programManager||(this.programManager=s.a.getDefaultProgramManager(e),u.a&&this.programManager.addDefaultModule(u.a)),this.dummyShadowMap||(this.dummyShadowMap=new A.a(e,{width:1,height:1}));for(let e=0;ee.getProjectedLight({layer:t})),pointLights:this.pointLights.map(e=>e.getProjectedLight({layer:t}))},e}cleanup(){for(const e of this.shadowPasses)e.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(u.a),this.programManager=null)}_createLightMatrix(){const e=[];for(const n of this.directionalLights){var t=(new o.Matrix4).lookAt({eye:new o.Vector3(n.direction).negate()});e.push(t)}return e}_createShadowPasses(t){for(let e=0;ed.b?(u=Math.acos(u),i=Math.sin(u),o=Math.sin((1-r)*u)/i,Math.sin(r*u)/i):(o=1-r,r),e[0]=o*a+u*l,e[1]=o*s+u*c,e[2]=o*A+u*g,e[3]=o*t+u*n}function fromMat3(e,t){var n,r,i,o=t[0]+t[4]+t[8];return 0t[o=0]&&(o=1),n=((o=t[8]>t[3*o+o]?2:o)+1)%3,r=(o+2)%3,i=Math.sqrt(t[3*o+o]-t[3*n+n]-t[3*r+r]+1),e[o]=.5*i,e[3]=(t[3*n+r]-t[3*r+n])*(i=.5/i),e[n]=(t[3*n+o]+t[3*o+n])*i,e[r]=(t[3*r+o]+t[3*o+r])*i),e}s.b,s.g,s.c,s.l;var A,l,c,g=s.a,u=s.k,h=s.d,p=s.i,f=s.h,I=s.m,C=s.j,m=(s.f,s.e,A=a.c(),l=a.f(1,0,0),c=a.f(0,1,0),function(e,t,n){var r=a.e(t,n);return r<-.999999?(a.d(A,l,t),a.g(A)<1e-6&&a.d(A,c,t),a.l(A,A),setAxisAngle(e,A,Math.PI),e):.999999e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne/t)),e.positions||e);if(n){var o=i.length;i=i.slice();const s=[];for(let e=0;e{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}}),t}_initializeStats(e=[]){e.forEach(e=>this._getOrCreate(e))}_getOrCreate(e){if(!e||!e.name)return null;var{name:t,type:n}=e;return this.stats[t]||(e instanceof stat_Stat?this.stats[t]=e:this.stats[t]=new stat_Stat(t,n)),this.stats[t]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return r});n=`#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX)) struct AmbientLight { vec3 color; @@ -841,20 +841,20 @@ float getPointLightAttenuation(PointLight pointLight, float distance) { } #endif -`;const a={lightSources:{}};function convertColor({color:e=[0,0,0],intensity:t=1}={}){return e.map(e=>e*t/255)}const r={name:"lights",vs:n,fs:n,getUniforms:function getUniforms(e=a){var t,n,r;if("lightSources"in e)return{ambientLight:t,pointLights:n,directionalLights:r}=e.lightSources||{},t||n&&0{r[`lighting_uPointLight[${t}].color`]=convertColor(e),r[`lighting_uPointLight[${t}].position`]=e.position,r[`lighting_uPointLight[${t}].attenuation`]=e.attenuation||[1,0,0]}),r.lighting_uPointLightCount=t.length,n.forEach((e,t)=>{r[`lighting_uDirectionalLight[${t}].color`]=convertColor(e),r[`lighting_uDirectionalLight[${t}].direction`]=e.direction}),r.lighting_uDirectionalLightCount=n.length,r}({ambientLight:t,pointLights:n,directionalLights:r}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1};if("lights"in e){const i={pointLights:[],directionalLights:[]};for(const o of e.lights||[])switch(o.type){case"ambient":i.ambientLight=o;break;case"directional":i.directionalLights.push(o);break;case"point":i.pointLights.push(o)}return getUniforms({lightSources:i})}return{}},defines:{MAX_LIGHTS:3}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var t=n(7),r=n(284),n=n(43),i="8.5.10";const o=new class StatsManager{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new r.a({id:e})),this.stats.get(e)}};if(n.global.luma&&n.global.luma.VERSION!==i)throw new Error(`luma.gl - multiple VERSIONs detected: ${n.global.luma.VERSION} vs 8.5.10`);n.global.luma||(Object(n.isBrowser)()&&t.k.log(1,"luma.gl 8.5.10 - set luma.log.level=1 (or higher) to trace rendering")(),n.global.luma=n.global.luma||{VERSION:i,version:i,log:t.k,stats:o,globals:{modules:{},nodeIO:{}}});n.global.luma},function(e,t){},function(j,Y,z){var J; +`;const a={lightSources:{}};function convertColor({color:e=[0,0,0],intensity:t=1}={}){return e.map(e=>e*t/255)}const r={name:"lights",vs:n,fs:n,getUniforms:function getUniforms(e=a){var t,n,r;if("lightSources"in e)return{ambientLight:t,pointLights:n,directionalLights:r}=e.lightSources||{},t||n&&0{r[`lighting_uPointLight[${t}].color`]=convertColor(e),r[`lighting_uPointLight[${t}].position`]=e.position,r[`lighting_uPointLight[${t}].attenuation`]=e.attenuation||[1,0,0]}),r.lighting_uPointLightCount=t.length,n.forEach((e,t)=>{r[`lighting_uDirectionalLight[${t}].color`]=convertColor(e),r[`lighting_uDirectionalLight[${t}].direction`]=e.direction}),r.lighting_uDirectionalLightCount=n.length,r}({ambientLight:t,pointLights:n,directionalLights:r}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1};if("lights"in e){const i={pointLights:[],directionalLights:[]};for(const o of e.lights||[])switch(o.type){case"ambient":i.ambientLight=o;break;case"directional":i.directionalLights.push(o);break;case"point":i.pointLights.push(o)}return getUniforms({lightSources:i})}return{}},defines:{MAX_LIGHTS:3}}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var t=n(7),r=n(290),n=n(43),i="8.5.10";const o=new class StatsManager{constructor(){this.stats=new Map}get(e){return this.stats.has(e)||this.stats.set(e,new r.a({id:e})),this.stats.get(e)}};if(n.global.luma&&n.global.luma.VERSION!==i)throw new Error(`luma.gl - multiple VERSIONs detected: ${n.global.luma.VERSION} vs 8.5.10`);n.global.luma||(Object(n.isBrowser)()&&t.k.log(1,"luma.gl 8.5.10 - set luma.log.level=1 (or higher) to trace rendering")(),n.global.luma=n.global.luma||{VERSION:i,version:i,log:t.k,stats:o,globals:{modules:{},nodeIO:{}}});n.global.luma},function(e,t){},function(j,Y,z){var J; /*! Hammer.JS - v2.0.7 - 2016-04-22 * http://hammerjs.github.io/ * * Copyright (c) 2016 Jorik Tangelder; * Licensed under the MIT license */ -!function(i,E,l){"use strict";var Q=["","webkit","Moz","MS","ms","o"],e=E.createElement("div"),n="function",o=Math.round,c=Math.abs,w=Date.now;function setTimeoutContext(e,t,n){return setTimeout(bindFn(e,n),t)}function invokeArrayArg(e,t,n){return Array.isArray(e)&&(each(e,n[t],n),1)}function each(e,t,n){if(e)if(e.forEach)e.forEach(t,n);else if(e.length!==l)for(r=0;r\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",t=i.console&&(i.console.warn||i.console.log);return t&&t.call(i.console,r,e),n.apply(this,arguments)}}var a="function"!=typeof Object.assign?function assign(e){if(e===l||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;nt[n]}):r.sort():r}function prefixed(e,t){for(var n,r=t[0].toUpperCase()+t.slice(1),i=0;ic(i.y)?i.x:i.y,t.scale=o?function getScale(e,t){return getDistance(t[0],t[1],y)/getDistance(e[0],e[1],y)}(o.pointers,r):1,t.rotation=o?function getRotation(e,t){return getAngle(t[1],t[0],y)+getAngle(e[1],e[0],y)}(o.pointers,r):0,t.maxPointers=!n.prevInput||t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers,function computeIntervalInputData(e,t){var n,r,i,o=e.lastInterval||t,a=t.timeStamp-o.timeStamp;{var s,A;t.eventType!=d&&(Fc(a.y)?a.x:a.y,s=getDirection(s,A),e.lastInterval=t):(n=o.velocity,r=o.velocityX,i=o.velocityY,s=o.direction)}t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=s}(n,t),e.element);hasParent(t.srcEvent.target,a)&&(a=t.srcEvent.target);t.target=a}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function simpleCloneInputData(e){for(var t=[],n=0;n=c(t)?e<0?h:p:t<0?f:I}function getDistance(e,t,n){var r=t[(n=n||G)[0]]-e[n[0]],t=t[n[1]]-e[n[1]];return Math.sqrt(r*r+t*t)}function getAngle(e,t,n){var r=t[(n=n||G)[0]]-e[n[0]],t=t[n[1]]-e[n[1]];return 180*Math.atan2(t,r)/Math.PI}Input.prototype={handler:function(){},init:function(){this.evEl&&addEventListeners(this.element,this.evEl,this.domHandler),this.evTarget&&addEventListeners(this.target,this.evTarget,this.domHandler),this.evWin&&addEventListeners(getWindowForElement(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&removeEventListeners(this.element,this.evEl,this.domHandler),this.evTarget&&removeEventListeners(this.target,this.evTarget,this.domHandler),this.evWin&&removeEventListeners(getWindowForElement(this.element),this.evWin,this.domHandler)}};var N={mousedown:g,mousemove:2,mouseup:u};function MouseInput(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,Input.apply(this,arguments)}inherit(MouseInput,Input,{handler:function MEhandler(e){var t=N[e.type];t&g&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=u),this.pressed&&(t&u&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var k={pointerdown:g,pointermove:2,pointerup:u,pointercancel:d,pointerout:d},T={2:s,3:"pen",4:"mouse",5:"kinect"},M="pointerdown",U="pointermove pointerup pointercancel";function PointerEventInput(){this.evEl=M,this.evWin=U,Input.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(M="MSPointerDown",U="MSPointerMove MSPointerUp MSPointerCancel"),inherit(PointerEventInput,Input,{handler:function PEhandler(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),r=k[r],i=T[e.pointerType]||e.pointerType,o=i==s,a=inArray(t,e.pointerId,"pointerId");r&g&&(0===e.button||o)?a<0&&(t.push(e),a=t.length-1):r&(u|d)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(a,1))}});var O={touchstart:g,touchmove:2,touchend:u,touchcancel:d};function SingleTouchInput(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Input.apply(this,arguments)}inherit(SingleTouchInput,Input,{handler:function TEhandler(e){var t,n=O[e.type];n===g&&(this.started=!0),this.started&&(t=function normalizeSingleTouches(e,t){var n=toArray(e.touches),e=toArray(e.changedTouches);t&(u|d)&&(n=uniqueArray(n.concat(e),"identifier",!0));return[n,e]}.call(this,e,n),n&(u|d)&&t[0].length-t[1].length==0&&(this.started=!1),this.callback(this.manager,n,{pointers:t[0],changedPointers:t[1],pointerType:s,srcEvent:e}))}});var L={touchstart:g,touchmove:2,touchend:u,touchcancel:d};function TouchInput(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},Input.apply(this,arguments)}inherit(TouchInput,Input,{handler:function MTEhandler(e){var t=L[e.type],n=function getTouches(e,t){var n=toArray(e.touches),r=this.targetIds;if(t&(2|g)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=toArray(e.changedTouches),s=[],A=this.target;if(o=n.filter(function(e){return hasParent(e.target,A)}),t===g)for(i=0;it.threshold&&i&t.direction},attrTest:function(e){return AttrRecognizer.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=directionStr(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),inherit(PinchRecognizer,AttrRecognizer,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[B]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){var t;1!==e.scale&&(t=e.scale<1?"in":"out",e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),inherit(PressRecognizer,Recognizer,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||e.eventType&(u|d)&&!i)this.reset();else if(e.eventType&g)this.reset(),this._timer=setTimeoutContext(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&u)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&u?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=w(),this.manager.emit(this.options.event,this._input)))}}),inherit(RotateRecognizer,AttrRecognizer,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[B]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),inherit(SwipeRecognizer,AttrRecognizer,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:C|m,pointers:1},getTouchAction:function(){return PanRecognizer.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(C|m)?t=e.overallVelocity:n&C?t=e.overallVelocityX:n&m&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&e.eventType&u},emit:function(e){var t=directionStr(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),inherit(TapRecognizer,Recognizer,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[W]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(e){if(t=r.exec(e))return new FormatSpecifier({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]});var t;throw new Error("invalid format: "+e)}function FormatSpecifier(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},,,,,,,function(e,t,n){var r=n(188),i=n(126);e.exports=function isSymbol(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return SphericalCoordinates});var r=n(18),i=n(193),o=n(29);class SphericalCoordinates{constructor({phi:e=0,theta:t=0,radius:n=1,bearing:r=void 0,pitch:i=void 0,altitude:o=void 0,radiusScale:a=6371e3}={}){this.phi=e,this.theta=t,this.radius=n||o||1,this.radiusScale=a||1,void 0!==r&&(this.bearing=r),void 0!==i&&(this.pitch=i),this.check()}toString(){return this.formatString(r.f)}formatString({printTypes:e=!1}){const t=r.l;return"".concat(e?"Spherical":"","[rho:").concat(t(this.radius),",theta:").concat(t(this.theta),",phi:").concat(t(this.phi),"]")}equals(e){return Object(r.j)(this.radius,e.radius)&&Object(r.j)(this.theta,e.theta)&&Object(r.j)(this.phi,e.phi)}exactEquals(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}get bearing(){return 180-Object(r.i)(this.phi)}set bearing(e){this.phi=Math.PI-Object(r.o)(e)}get pitch(){return Object(r.i)(this.theta)}set pitch(e){this.theta=Object(r.o)(e)}get longitude(){return Object(r.i)(this.phi)}get latitude(){return Object(r.i)(this.theta)}get lng(){return Object(r.i)(this.phi)}get lat(){return Object(r.i)(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}clone(){return(new SphericalCoordinates).copy(this)}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this.check()}fromLngLatZ([e,t,n]){this.radius=1+n/this.radiusScale,this.phi=Object(r.o)(t),this.theta=Object(r.o)(e)}fromVector3(e){return this.radius=o.h(e),0))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,p.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const I={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",numParseOptions:{hex:!0,leadingZeros:!0},tagValueProcessor:function(e,t){return e},attrValueProcessor:function(e,t){return e},stopNodes:[],alwaysCreateTextNode:!1},C=(t.defaultOptions=I,["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","numParseOptions","stopNodes","alwaysCreateTextNode"]);function processTagValue(e,t,n){return t&&(n.trimValues&&(t=t.trim()),t=parseValue(t=n.tagValueProcessor(t,e),n.parseNodeValue,n.numParseOptions)),t}function parseValue(e,t,n){return t&&"string"==typeof e?"true"===(t=e.trim())||"false"!==t&&i(e,n):p.isExist(e)?e:""}t.props=C;const s=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function buildAttributesMap(e,t){if(!t.ignoreAttributes&&"string"==typeof e){e=e.replace(/\r?\n/g," ");const i=p.getAllMatches(e,s);var n=i.length;const o={};for(let e=0;e",r,"Closing Tag is not closed.");let e=i.substring(r+2,t).trim();!o.ignoreNameSpace||-1!==(n=e.indexOf(":"))&&(e=e.substr(n+1)),a&&(a.val?a.val=p.getValue(a.val)+""+processTagValue(e,s,o):a.val=processTagValue(e,s,o)),o.stopNodes.length&&o.stopNodes.includes(a.tagname)&&(a.child=[],null==a.attrsMap&&(a.attrsMap={}),a.val=i.substr(a.startIndex+1,r-a.startIndex-1)),a=a.parent,s="",r=t}else if("?"===i[r+1])r=findClosingIndex(i,"?>",r,"Pi Tag is not closed.");else if("!--"===i.substr(r+1,3))r=findClosingIndex(i,"--\x3e",r,"Comment is not closed.");else if("!D"===i.substr(r+1,2)){var n=findClosingIndex(i,">",r,"DOCTYPE is not closed.");const c=i.substring(r,n);r=0<=c.indexOf("[")?i.indexOf("]>",r)+1:n}else if("!["===i.substr(r+1,2)){var t=findClosingIndex(i,"]]>",r,"CDATA is not closed.")-2,A=i.substring(r+9,t);if(s&&(a.val=p.getValue(a.val)+""+processTagValue(a.tagname,s,o),s=""),o.cdataTagName){const g=new f(o.cdataTagName,a,A);a.addChild(g),a.val=p.getValue(a.val)+o.cdataPositionChar,A&&(g.val=A)}else a.val=(a.val||"")+(A||"");r=2+t}else{const u=function closingIndexForOpeningTag(n,e){let r,i="";for(let t=e;t"===e)return{data:i,index:t};"\t"===e&&(e=" ")}i+=e}}(i,r+1);let e=u.data;var A=u.index,l=e.indexOf(" ");let t=e,n=!0;if(-1!==l&&(t=e.substr(0,l).replace(/\s\s*$/,""),e=e.substr(l+1)),!o.ignoreNameSpace||-1!==(l=t.indexOf(":"))&&(t=t.substr(l+1),n=t!==u.data.substr(l+1)),a&&s&&"!xml"!==a.tagname&&(a.val=p.getValue(a.val)+""+processTagValue(a.tagname,s,o)),0\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",t=i.console&&(i.console.warn||i.console.log);return t&&t.call(i.console,r,e),n.apply(this,arguments)}}var a="function"!=typeof Object.assign?function assign(e){if(e===l||null===e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),n=1;nt[n]}):r.sort():r}function prefixed(e,t){for(var n,r=t[0].toUpperCase()+t.slice(1),i=0;ic(i.y)?i.x:i.y,t.scale=o?function getScale(e,t){return getDistance(t[0],t[1],y)/getDistance(e[0],e[1],y)}(o.pointers,r):1,t.rotation=o?function getRotation(e,t){return getAngle(t[1],t[0],y)+getAngle(e[1],e[0],y)}(o.pointers,r):0,t.maxPointers=!n.prevInput||t.pointers.length>n.prevInput.maxPointers?t.pointers.length:n.prevInput.maxPointers,function computeIntervalInputData(e,t){var n,r,i,o=e.lastInterval||t,a=t.timeStamp-o.timeStamp;{var s,A;t.eventType!=d&&(Fc(a.y)?a.x:a.y,s=getDirection(s,A),e.lastInterval=t):(n=o.velocity,r=o.velocityX,i=o.velocityY,s=o.direction)}t.velocity=n,t.velocityX=r,t.velocityY=i,t.direction=s}(n,t),e.element);hasParent(t.srcEvent.target,a)&&(a=t.srcEvent.target);t.target=a}(e,n),e.emit("hammer.input",n),e.recognize(n),e.session.prevInput=n}function simpleCloneInputData(e){for(var t=[],n=0;n=c(t)?e<0?h:p:t<0?f:I}function getDistance(e,t,n){var r=t[(n=n||G)[0]]-e[n[0]],t=t[n[1]]-e[n[1]];return Math.sqrt(r*r+t*t)}function getAngle(e,t,n){var r=t[(n=n||G)[0]]-e[n[0]],t=t[n[1]]-e[n[1]];return 180*Math.atan2(t,r)/Math.PI}Input.prototype={handler:function(){},init:function(){this.evEl&&addEventListeners(this.element,this.evEl,this.domHandler),this.evTarget&&addEventListeners(this.target,this.evTarget,this.domHandler),this.evWin&&addEventListeners(getWindowForElement(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&removeEventListeners(this.element,this.evEl,this.domHandler),this.evTarget&&removeEventListeners(this.target,this.evTarget,this.domHandler),this.evWin&&removeEventListeners(getWindowForElement(this.element),this.evWin,this.domHandler)}};var N={mousedown:g,mousemove:2,mouseup:u};function MouseInput(){this.evEl="mousedown",this.evWin="mousemove mouseup",this.pressed=!1,Input.apply(this,arguments)}inherit(MouseInput,Input,{handler:function MEhandler(e){var t=N[e.type];t&g&&0===e.button&&(this.pressed=!0),2&t&&1!==e.which&&(t=u),this.pressed&&(t&u&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}});var k={pointerdown:g,pointermove:2,pointerup:u,pointercancel:d,pointerout:d},T={2:s,3:"pen",4:"mouse",5:"kinect"},M="pointerdown",U="pointermove pointerup pointercancel";function PointerEventInput(){this.evEl=M,this.evWin=U,Input.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}i.MSPointerEvent&&!i.PointerEvent&&(M="MSPointerDown",U="MSPointerMove MSPointerUp MSPointerCancel"),inherit(PointerEventInput,Input,{handler:function PEhandler(e){var t=this.store,n=!1,r=e.type.toLowerCase().replace("ms",""),r=k[r],i=T[e.pointerType]||e.pointerType,o=i==s,a=inArray(t,e.pointerId,"pointerId");r&g&&(0===e.button||o)?a<0&&(t.push(e),a=t.length-1):r&(u|d)&&(n=!0),a<0||(t[a]=e,this.callback(this.manager,r,{pointers:t,changedPointers:[e],pointerType:i,srcEvent:e}),n&&t.splice(a,1))}});var O={touchstart:g,touchmove:2,touchend:u,touchcancel:d};function SingleTouchInput(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,Input.apply(this,arguments)}inherit(SingleTouchInput,Input,{handler:function TEhandler(e){var t,n=O[e.type];n===g&&(this.started=!0),this.started&&(t=function normalizeSingleTouches(e,t){var n=toArray(e.touches),e=toArray(e.changedTouches);t&(u|d)&&(n=uniqueArray(n.concat(e),"identifier",!0));return[n,e]}.call(this,e,n),n&(u|d)&&t[0].length-t[1].length==0&&(this.started=!1),this.callback(this.manager,n,{pointers:t[0],changedPointers:t[1],pointerType:s,srcEvent:e}))}});var L={touchstart:g,touchmove:2,touchend:u,touchcancel:d};function TouchInput(){this.evTarget="touchstart touchmove touchend touchcancel",this.targetIds={},Input.apply(this,arguments)}inherit(TouchInput,Input,{handler:function MTEhandler(e){var t=L[e.type],n=function getTouches(e,t){var n=toArray(e.touches),r=this.targetIds;if(t&(2|g)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=toArray(e.changedTouches),s=[],A=this.target;if(o=n.filter(function(e){return hasParent(e.target,A)}),t===g)for(i=0;it.threshold&&i&t.direction},attrTest:function(e){return AttrRecognizer.prototype.attrTest.call(this,e)&&(2&this.state||!(2&this.state)&&this.directionTest(e))},emit:function(e){this.pX=e.deltaX,this.pY=e.deltaY;var t=directionStr(e.direction);t&&(e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),inherit(PinchRecognizer,AttrRecognizer,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[B]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},emit:function(e){var t;1!==e.scale&&(t=e.scale<1?"in":"out",e.additionalEvent=this.options.event+t),this._super.emit.call(this,e)}}),inherit(PressRecognizer,Recognizer,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return["auto"]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distancet.time;if(this._input=e,!r||!n||e.eventType&(u|d)&&!i)this.reset();else if(e.eventType&g)this.reset(),this._timer=setTimeoutContext(function(){this.state=8,this.tryEmit()},t.time,this);else if(e.eventType&u)return 8;return 32},reset:function(){clearTimeout(this._timer)},emit:function(e){8===this.state&&(e&&e.eventType&u?this.manager.emit(this.options.event+"up",e):(this._input.timeStamp=w(),this.manager.emit(this.options.event,this._input)))}}),inherit(RotateRecognizer,AttrRecognizer,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[B]},attrTest:function(e){return this._super.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)}}),inherit(SwipeRecognizer,AttrRecognizer,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:C|m,pointers:1},getTouchAction:function(){return PanRecognizer.prototype.getTouchAction.call(this)},attrTest:function(e){var t,n=this.options.direction;return n&(C|m)?t=e.overallVelocity:n&C?t=e.overallVelocityX:n&m&&(t=e.overallVelocityY),this._super.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers==this.options.pointers&&c(t)>this.options.velocity&&e.eventType&u},emit:function(e){var t=directionStr(e.offsetDirection);t&&this.manager.emit(this.options.event+t,e),this.manager.emit(this.options.event,e)}}),inherit(TapRecognizer,Recognizer,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[W]},process:function(e){var t=this.options,n=e.pointers.length===t.pointers,r=e.distance=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(e){if(t=r.exec(e))return new FormatSpecifier({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]});var t;throw new Error("invalid format: "+e)}function FormatSpecifier(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}formatSpecifier.prototype=FormatSpecifier.prototype,FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}},,,,,,,function(e,t,n){var r=n(193),i=n(129);e.exports=function isSymbol(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},function(e,t,n){"use strict";n.d(t,"a",function(){return SphericalCoordinates});var r=n(18),i=n(198),o=n(29);class SphericalCoordinates{constructor({phi:e=0,theta:t=0,radius:n=1,bearing:r=void 0,pitch:i=void 0,altitude:o=void 0,radiusScale:a=6371e3}={}){this.phi=e,this.theta=t,this.radius=n||o||1,this.radiusScale=a||1,void 0!==r&&(this.bearing=r),void 0!==i&&(this.pitch=i),this.check()}toString(){return this.formatString(r.f)}formatString({printTypes:e=!1}){const t=r.l;return"".concat(e?"Spherical":"","[rho:").concat(t(this.radius),",theta:").concat(t(this.theta),",phi:").concat(t(this.phi),"]")}equals(e){return Object(r.j)(this.radius,e.radius)&&Object(r.j)(this.theta,e.theta)&&Object(r.j)(this.phi,e.phi)}exactEquals(e){return this.radius===e.radius&&this.theta===e.theta&&this.phi===e.phi}get bearing(){return 180-Object(r.i)(this.phi)}set bearing(e){this.phi=Math.PI-Object(r.o)(e)}get pitch(){return Object(r.i)(this.theta)}set pitch(e){this.theta=Object(r.o)(e)}get longitude(){return Object(r.i)(this.phi)}get latitude(){return Object(r.i)(this.theta)}get lng(){return Object(r.i)(this.phi)}get lat(){return Object(r.i)(this.theta)}get z(){return(this.radius-1)*this.radiusScale}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this.check()}clone(){return(new SphericalCoordinates).copy(this)}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this.check()}fromLngLatZ([e,t,n]){this.radius=1+n/this.radiusScale,this.phi=Object(r.o)(t),this.theta=Object(r.o)(e)}fromVector3(e){return this.radius=o.h(e),0))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g,p.nameRegexp);!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const I={attributeNamePrefix:"@_",attrNodeName:!1,textNodeName:"#text",ignoreAttributes:!0,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,arrayMode:!1,trimValues:!0,cdataTagName:!1,cdataPositionChar:"\\c",numParseOptions:{hex:!0,leadingZeros:!0},tagValueProcessor:function(e,t){return e},attrValueProcessor:function(e,t){return e},stopNodes:[],alwaysCreateTextNode:!1},C=(t.defaultOptions=I,["attributeNamePrefix","attrNodeName","textNodeName","ignoreAttributes","ignoreNameSpace","allowBooleanAttributes","parseNodeValue","parseAttributeValue","arrayMode","trimValues","cdataTagName","cdataPositionChar","tagValueProcessor","attrValueProcessor","parseTrueNumberOnly","numParseOptions","stopNodes","alwaysCreateTextNode"]);function processTagValue(e,t,n){return t&&(n.trimValues&&(t=t.trim()),t=parseValue(t=n.tagValueProcessor(t,e),n.parseNodeValue,n.numParseOptions)),t}function parseValue(e,t,n){return t&&"string"==typeof e?"true"===(t=e.trim())||"false"!==t&&i(e,n):p.isExist(e)?e:""}t.props=C;const s=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])(.*?)\\3)?","g");function buildAttributesMap(e,t){if(!t.ignoreAttributes&&"string"==typeof e){e=e.replace(/\r?\n/g," ");const i=p.getAllMatches(e,s);var n=i.length;const o={};for(let e=0;e",r,"Closing Tag is not closed.");let e=i.substring(r+2,t).trim();!o.ignoreNameSpace||-1!==(n=e.indexOf(":"))&&(e=e.substr(n+1)),a&&(a.val?a.val=p.getValue(a.val)+""+processTagValue(e,s,o):a.val=processTagValue(e,s,o)),o.stopNodes.length&&o.stopNodes.includes(a.tagname)&&(a.child=[],null==a.attrsMap&&(a.attrsMap={}),a.val=i.substr(a.startIndex+1,r-a.startIndex-1)),a=a.parent,s="",r=t}else if("?"===i[r+1])r=findClosingIndex(i,"?>",r,"Pi Tag is not closed.");else if("!--"===i.substr(r+1,3))r=findClosingIndex(i,"--\x3e",r,"Comment is not closed.");else if("!D"===i.substr(r+1,2)){var n=findClosingIndex(i,">",r,"DOCTYPE is not closed.");const c=i.substring(r,n);r=0<=c.indexOf("[")?i.indexOf("]>",r)+1:n}else if("!["===i.substr(r+1,2)){var t=findClosingIndex(i,"]]>",r,"CDATA is not closed.")-2,A=i.substring(r+9,t);if(s&&(a.val=p.getValue(a.val)+""+processTagValue(a.tagname,s,o),s=""),o.cdataTagName){const g=new f(o.cdataTagName,a,A);a.addChild(g),a.val=p.getValue(a.val)+o.cdataPositionChar,A&&(g.val=A)}else a.val=(a.val||"")+(A||"");r=2+t}else{const u=function closingIndexForOpeningTag(n,e){let r,i="";for(let t=e;t"===e)return{data:i,index:t};"\t"===e&&(e=" ")}i+=e}}(i,r+1);let e=u.data;var A=u.index,l=e.indexOf(" ");let t=e,n=!0;if(-1!==l&&(t=e.substr(0,l).replace(/\s\s*$/,""),e=e.substr(l+1)),!o.ignoreNameSpace||-1!==(l=t.indexOf(":"))&&(t=t.substr(l+1),n=t!==u.data.substr(l+1)),a&&s&&"!xml"!==a.tagname&&(a.val=p.getValue(a.val)+""+processTagValue(a.tagname,s,o)),0 * @license MIT */ -var i=r(710),o=r(505),a=r(711);function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var n=(e="string"!=typeof e?""+e:e).length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return base64ToBytes(e).length;default:if(r)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),r=!0}}function slowToString(e,t,n){var r=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function hexSlice(e,t,n){var r=e.length;(!t||t<0)&&(t=0);(!n||n<0||r=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Buffer.from(t,r)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,n,r,i);if("number"==typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,n):arrayIndexOf(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,n,r,i){var o=1,a=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a/=o=2,s/=2,n/=2}function read(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var A=-1,l=n;l>8,r=r%256,i.push(r),i.push(n);return i}(t,e.length-n),e,n,r)}function utf8Slice(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i>>10&1023|55296),c=56320|1023&c),r.push(c),i+=g}return function decodeCodePointsArray(e){var t=e.length;if(t<=u)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rt&&(e+=" ... ")),""},Buffer.prototype.compare=function compare(e,t,n,r,i){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),(t=void 0===t?0:t)<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),A=this.slice(r,i),l=e.slice(t,n),c=0;cthis.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o=!1;;)switch(r){case"hex":return function hexWrite(e,t,n,r){n=Number(n)||0;var i=e.length-n;if((!r||i<(r=Number(r)))&&(r=i),(i=t.length)%2!=0)throw new TypeError("Invalid hex string");i/2e.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function objectWriteUInt32(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function checkIEEE754(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(e,t,n,r,i){return i||checkIEEE754(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function writeDouble(e,t,n,r,i){return i||checkIEEE754(e,0,n,8),o.write(e,t,n,r,52,8),n+8}Buffer.prototype.slice=function slice(e,t){var n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):n>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,n,r){e=+e,t|=0,r||checkInt(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},Buffer.prototype.writeIntBE=function writeIntBE(e,t,n,r){e=+e,t|=0,r||checkInt(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,a=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},Buffer.prototype.writeInt8=function writeInt8(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,n){return writeFloat(this,e,t,!0,n)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,n){return writeFloat(this,e,t,!1,n)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,n){return writeDouble(this,e,t,!0,n)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,n){return writeDouble(this,e,t,!1,n)},Buffer.prototype.copy=function copy(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t>=e.length&&(t=e.length),(r=0=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var i,o=(r=e.length-t>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function base64ToBytes(e){return i.toByteArray(base64clean(e))}function blitBuffer(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}.call(this,r(59))},function(e,t,n){var r=n(715),i=n(716),o=n(717),a=n(718),n=n(719);function ListCache(e){var t=-1,n=null==e?0:e.length;for(this.clear();++te.length)&&(t=e.length);for(var n=0,r=new Array(t);n"project64"===e.name)&&0<=(r=n.modules.findIndex(e=>"project32"===e.name))&&n.modules.splice(r,1)),"inject"in t)if(e.inject){const i={...e.inject};for(const o in t.inject)i[o]=(i[o]||"")+t.inject[o];n.inject=i}else n.inject=t.inject;return n}n.d(t,"a",function(){return mergeShaders})},function(e,t,n){"use strict";n.d(t,"a",function(){return count});const r="count(): argument not an object",i="count(): argument not a container";function count(e){if(!function isObject(e){return null!==e&&"object"==typeof e}(e))throw new Error(r);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 isPlainObject(e){return null!==e&&"object"==typeof e&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(i)}},function(e,t,n){"use strict";n.d(t,"a",function(){return OrthographicController});var t=n(111),r=n(235);class OrthographicController extends t.a{constructor(e){e.dragMode=e.dragMode||"pan",super(r.a,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return MapView});var t=n(112),r=n(233),i=n(236);class MapView extends t.a{constructor(e){super({...e,type:r.a})}get controller(){return this._getControllerProps({type:i.b})}}MapView.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return AmbientLight});const r=[255,255,255];let i=0;class AmbientLight{constructor(e={}){var{color:t=r}=e,{intensity:n=1}=e;this.id=e.id||"ambient-".concat(i++),this.color=t,this.intensity=n,this.type="ambient"}}},function(E,e,t){"use strict";t.d(e,"a",function(){return layer_Layer});var n=t(22),r=t(336),A=t(84),a=t(12),e=t(135);class cpu_interpolation_transition_CPUInterpolationTransition extends e.a{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:t,toValue:n,duration:r,easing:i}}=this;var o=i(e/r);this._value=Object(a.lerp)(t,n,o)}}function updateSpringElement(e,t,n,r,i){e=t-e;return(n-t)*i+-e*r+e+t}function distance(n,r){if(Array.isArray(n)){let t=0;for(let e=0;e=t.min)}},color:{validate(e,t){return t.optional&&!e||isArray(e)&&(3===e.length||4===e.length)},equal(e,t,n){return arrayEqual(e,t)}},accessor:{validate(e,t){e=getTypeOf(e);return"function"===e||e===getTypeOf(t.value)},equal(e,t,n){return"function"==typeof t||arrayEqual(e,t)}},array:{validate(e,t){return t.optional&&!e||isArray(e)},equal(e,t,n){return n.compare?arrayEqual(e,t):e===t}},function:{validate(e,t){return t.optional&&!e||"function"==typeof e},equal(e,t,n){return!n.compare||e===t}},data:{transform:(e,t,n)=>{const r=(n?n.props:{})["dataTransform"];return r&&e?r(e):e}},image:{transform:(e,t,n)=>function createTexture(e,t){var n=e.context&&e.context.gl;if(!n||!t)return null;if(t instanceof h.a)return t;let r=null;return(t=t.constructor&&"Object"!==t.constructor.name?{data:t}:t).compressed&&(r={[10241]:1{!function destroyTexture(e){e&&e instanceof h.a&&p[e.id]&&(e.delete(),delete p[e.id])}(e)}}};function arrayEqual(t,n){if(t===n)return!0;if(!isArray(t)||!isArray(n))return!1;var r=t.length;if(r!==n.length)return!1;for(let e=0;e{},this.oldProps=N,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){e=this.asyncProps[e];return e&&e.resolvedValue}isAsyncPropLoading(e){if(e)return e=this.asyncProps[e],Boolean(e&&0=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}_watchPromise(r,e){const i=this.asyncProps[r],o=(i.pendingLoadCount++,i.pendingLoadCount);e.then(e=>{var t;e=this._postProcessValue(i,e),this._setAsyncPropValue(r,e,o);const n=null==(t=this.layer)?void 0:t.props.onDataLoad;"data"===r&&n&&n(e,{propName:r,layer:this.layer})}).catch(e=>{var t;null!=(t=this.layer)&&t.raiseError(e,"loading ".concat(r," of ").concat(this.layer))})}async _resolveAsyncIterable(e,t){"data"!==e&&this._setPropValue(e,t);const n=this.asyncProps[e];n.pendingLoadCount++;var r=n.pendingLoadCount;let i=[],o=0;for await(const s of t){const A=(this.component?this.component.props:{})["dataTransform"];i=A?A(s,i):i.concat(s),Object.defineProperty(i,"__diff",{enumerable:!1,value:[{startRow:o,endRow:i.length}]}),o=i.length,this._setAsyncPropValue(e,i,r)}const a=null==(t=this.layer)?void 0:t.props.onDataLoad;a&&a(i,{propName:e,layer:this.layer})}_postProcessValue(e,t){const n=e.type;return n&&(n.release&&n.release(e.resolvedValue,n,this.component),n.transform)?n.transform(t,n,this.component):t}_createAsyncPropData(e,t){var n;this.asyncProps[e]||(n=this.component&&this.component.constructor._propTypes,this.asyncProps[e]={type:n&&n[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0})}}const{ASYNC_ORIGINAL:y,ASYNC_RESOLVED:B,ASYNC_DEFAULTS:k}=u.b;let T=0;class component_Component{constructor(){this.props=function createProps(){var e=getPropsPrototype(this.constructor);const t=Object.create(e);t[f]=this,t[I]={},t[C]={};for(let e=0;ee.equals(t));let v=new Uint8ClampedArray(0);e={data:{type:"data",value:t,async:!0},dataComparator:null,_dataDiff:{type:"function",value:e=>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},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(e,{propName:t,layer:n,loaders:r,loadOptions:i,signal:o})=>{const a=n.context["resourceManager"];var s;i=i||n.getLoadOptions(),r=r||n.props.loaders,o&&(i={...i,fetch:{...null==(s=i)?void 0:s.fetch,signal:o}});let A=a.contains(e);return A||i||(a.add({resourceId:e,data:Object(b.a)(e,r),persistent:!1}),A=!0),A?a.subscribe({resourceId:e,onChange:e=>n.internalState.reloadAsyncProp(t,e),consumerId:n.id,requestId:t}):Object(b.a)(e,r,i)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},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:n.a.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:e})=>[0,100*-e],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class layer_Layer extends component_Component{toString(){var e=this.constructor.layerName||this.constructor.name;return"".concat(e,"({id: '").concat(this.props.id,"'})")}raiseError(e,t){var n;t&&(e.message="".concat(t,": ").concat(e.message)),null!=(n=(t=this.props).onError)&&n.call(t,e)||null==(n=this.context)||null!=(t=n.onError)&&t.call(n,e,this)}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(e=!0){this.internalState&&(this.internalState.needsRedraw=e)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(e){var t=this.context["viewport"],n=Object(g.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[n,t,r]=Object(M.s)(n,t.pixelProjectionMatrix);return 2===e.length?[n,t]:[n,t,r]}unproject(e){const t=this.context["viewport"];return t.unproject(e)}projectPosition(e){return Object(g.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){var e=this.props["coordinateSystem"];return e===n.a.DEFAULT||e===n.a.LNGLAT||e===n.a.CARTESIAN}onHover(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}onClick(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}nullPickingColor(){return[0,0,0]}encodePickingColor(e,t=[]){return t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}decodePickingColor(e){Object(c.a)(e instanceof Uint8Array);var[e,t,n]=e;return e+256*t+65536*n-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(e){for(const t of this.props.extensions)e=Object(S.a)(e,t.getShaders.call(this,t));return e}shouldUpdateState({changeFlags:e}){return e.propsOrDataChanged}updateState({oldProps:e,props:t,changeFlags:n}){const r=this.getAttributeManager();if(n.dataChanged&&r){n=n["dataChanged"];if(Array.isArray(n))for(const i of n)r.invalidateAll(i);else r.invalidateAll()}n=0<=e.highlightedObjectIndex||e.pickable,e=0<=t.highlightedObjectIndex||t.pickable;if(n!==e&&r){var{pickingColors:t,instancePickingColors:n}=r.attributes;const o=t||n;o&&(e&&o.constant&&(o.constant=!1,r.invalidate(o.id)),o.value||e||(o.constant=!0,o.value=[0,0,0]))}}finalizeState(){for(const t of this.getModels())t.delete();const e=this.getAttributeManager();e&&e.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(e){for(const t of this.getModels())t.draw(e)}getPickingInfo({info:e}){var t=e["index"];return 0<=t&&Array.isArray(this.props.data)&&(e.object=this.props.data[t]),e}activateViewport(e){var t=this.internalState.viewport;this.internalState.viewport=e,t&&U({oldViewport:t,viewport:e})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all",t){const n=this.getAttributeManager();n&&("all"===e?n.invalidateAll():n.invalidate(e))}updateAttributes(e){for(const t of this.getModels())this._setModelAttributes(t,e)}_updateAttributes(e){const t=this.getAttributeManager();var n,r;t&&(r=this.getNumInstances(e),n=this.getStartIndices(e),t.update({data:e.data,numInstances:r,startIndices:n,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this,ignoreUnknownAttributes:!0}),r=t.getChangedAttributes({clearChangedFlags:!0}),this.updateAttributes(r))}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const e=this.internalState["uniformTransitions"];if(e.active){var t=e.update(),n=Object.create(this.props);for(const r in t)Object.defineProperty(n,r,{value:t[r]});return n}return this.props}calculateInstancePickingColors(e,{numInstances:t}){if(!e.constant){var n=Math.floor(v.length/3);if(this.internalState.usesPickingColorCache=!0,n{var e={moduleParameters:n,uniforms:r,parameters:i,context:this.context};for(const t of this.props.extensions)t.draw.call(this,e,t);this.draw(e)})}finally{this.props=e}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const n=this.internalState["changeFlags"];for(const r in t)if(t[r]){let e=!1;"dataChanged"===r&&Array.isArray(n[r])&&(n[r]=Array.isArray(t[r])?n[r].concat(t[r]):t[r],e=!0),n[r]||(n[r]=t[r],e=!0),e&&Object(i.a)("layer.changeFlag",this,r,t)}var e=n.dataChanged||n.updateTriggersChanged||n.propsChanged||n.extensionsChanged;n.propsOrDataChanged=e,n.somethingChanged=e||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(e,t){var n=Object(o.b)(e,t);if(n.updateTriggersChanged)for(const r in n.updateTriggersChanged)n.updateTriggersChanged[r]&&this.invalidateAttribute(r);if(n.transitionsChanged)for(const i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,t[i],e[i],e.transitions[i]);return this.setChangeFlags(n)}validateProps(){Object(o.c)(this.props)}setModuleParameters(e){for(const t of this.getModels())t.updateModuleSettings(e)}updateAutoHighlight(e){this.props.autoHighlight&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const t={pickingSelectedColor:e.picked?e.color:null},n=this.props["highlightColor"];e.picked&&"function"==typeof n&&(t.pickingHighlightColor=n(e)),this.setModuleParameters(t),this.setNeedsRedraw()}_updateModules({props:e,oldProps:t},n){var{autoHighlight:e,highlightedObjectIndex:r,highlightColor:i}=e;if(n||t.autoHighlight!==e||t.highlightedObjectIndex!==r||t.highlightColor!==i){const o={};e||(o.pickingSelectedColor=null),Array.isArray(i)&&(o.pickingHighlightColor=i),Number.isInteger(r)&&(o.pickingSelectedColor=0<=r?this.encodePickingColor(r):null),this.setModuleParameters(o)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;var t=this.internalState.needsRedraw&&this.id;this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags;const n=this.getAttributeManager();e=n&&n.getNeedsRedraw(e);return t||e}_getAttributeManager(){return new r.a(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){Object(c.a)(!this.internalState&&!this.state),Object(c.a)(isFinite(this.props.coordinateSystem));const e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new layer_state_LayerState({attributeManager:e,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(l.a.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),e)}),(this.internalState.layer=this).internalState.uniformTransitions=new uniform_transition_manager_UniformTransitionManager(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(e){Object(i.a)("layer.matched",this,this===e);var{state:t,internalState:n}=e;this!==e&&(this.internalState=n,(this.internalState.layer=this).state=t,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}layer_Layer.layerName="Layer",layer_Layer.defaultProps=e},function(e,t,n){"use strict";n.d(t,"a",function(){return attribute_manager_AttributeManager});var s=n(660),A=n(372),l=n(62);class ShaderAttribute{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){var e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];var n=this.source["value"],r=t["size"];let i=n;if(n&&n.length!==r){i=new Float32Array(r);var o=t.elementOffset||0;for(let e=0;e(e+128)/255*2-1);case 5122:return new Float32Array(e).map(e=>(e+32768)/65535*2-1);case 5121:return new Float32Array(e).map(e=>e/255);case 5123:return new Float32Array(e).map(e=>e/65535);default:return e}}_normalizeValue(t,n,r){var{defaultValue:i,size:o}=this.settings;if(Number.isFinite(t))return n[r]=t,n;if(!t)return n[r]=i[0],n;switch(o){case 4:n[r+3]=(Number.isFinite(t[3])?t:i)[3];case 3:n[r+2]=(Number.isFinite(t[2])?t:i)[2];case 2:n[r+1]=(Number.isFinite(t[1])?t:i)[1];case 1:n[r+0]=(Number.isFinite(t[0])?t:i)[0];break;default:let e=o;for(;0<=--e;)n[r+e]=(Number.isFinite(t[e])?t:i)[e]}return n}_areValuesEqual(t,n){if(!t||!n)return!1;var r=this["size"];for(let e=0;et[e])]:t[e];return Object(d.e)(r,n)}setNeedsUpdate(e=this.id,t){this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t?({startRow:e=0,endRow:t=1/0}=t,this.state.updateRanges=function add(t,n){if(t===u)return t;if(n[0]<0&&(n[0]=0),n[0]>=n[1])return t;const r=[];var i=t.length;let o=0;for(let e=0;en[1]?r.push(a):n=[Math.min(a[0],n[0]),Math.max(a[1],n[1])]}return r.splice(o,0,n),r}(this.state.updateRanges,[e,t])):this.state.updateRanges=u}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=r}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){var{state:t,settings:n}=this;return!n.noAlloc&&(!!n.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==u}),!0))}updateBuffer({numInstances:e,data:t,props:n,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:i},settings:{update:o,noAlloc:a}}=this;let s=!0;if(o){for(var[A,l]of i)o.call(r,this,{data:t,startRow:A,endRow:l,props:n,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLengthg?c.set(t,n):(r._normalizeValue(t,I.target,0),Object(b.a)({target:c,source:I.target,start:n,count:s}));n+=s*g}else r._normalizeValue(t,c,n),n+=g}}}_validateAttributeUpdaters(){var e=this["settings"];if(!(e.noAlloc||"function"==typeof e.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){var t=this["value"],n=Math.min(4,this.size);if(t&&t.length>=n){let e=!0;switch(n){case 4:e=e&&Number.isFinite(t[3]);case 3:e=e&&Number.isFinite(t[2]);case 2:e=e&&Number.isFinite(t[1]);case 1:e=e&&Number.isFinite(t[0]);break;default:e=!1}if(!e)throw new Error("Illegal attribute generated for ".concat(this.id))}}}var h=n(58),i=n(1157),o=n(135);const p="\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n";var f=n(474),I=n(203),C=n(134);const m={interpolation:class gpu_interpolation_transition_GPUInterpolationTransition{constructor({gl:e,attribute:t,timeline:n}){this.gl=e,this.type="interpolation",this.transition=new o.a(n),this.attribute=t,this.attributeInTransition=new attribute_Attribute(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function getTransform(e,t){t=Object(d.c)(t.size);return new i.a(e,{vs:p,defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);n={byteLength:0,usage:35050};this.buffers=[new l.a(e,n),new l.a(e,n)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)this.transition.cancel();else{var{gl:n,buffers:r,attribute:i}=this,o=(Object(d.a)(r),{numInstances:t,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter});for(const a of r)Object(d.f)({buffer:a,...o});this.currentStartIndices=i.startIndices,this.currentLength=Object(d.b)(i,t),this.attributeInTransition.update({buffer:r[1],value:i.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:r[0],aTo:Object(d.d)(n,i)},feedbackBuffers:{vCurrent:r[1]}})}}update(){var e=this.transition.update();if(e){const{time:n,settings:{duration:r,easing:i}}=this.transition;var t=i(n/r);this.transform.run({uniforms:{time:t}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class gpu_spring_transition_GPUSpringTransition{constructor({gl:e,attribute:t,timeline:n}){this.gl=e,this.type="spring",this.transition=new o.a(n),this.attribute=t,this.attributeInTransition=new attribute_Attribute(e,{...t.settings,normalized:!1}),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function getTexture(e){return new I.a(e,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function getFramebuffer(e,t){return new C.a(e,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{[36064]:t}})}(e,this.texture),this.transform=function gpu_spring_transition_getTransform(e,t,n){t=Object(d.c)(t.size);return new i.a(e,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:t},varyings:["vNext"]})}(e,t,this.framebuffer);n={byteLength:0,usage:35050};this.buffers=[new l.a(e,n),new l.a(e,n),new l.a(e,n)]}get inProgress(){return this.transition.inProgress}start(e,t){var{gl:n,buffers:r,attribute:i}=this,o={numInstances:t,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)Object(d.f)({buffer:a,...o});this.currentStartIndices=i.startIndices,this.currentLength=Object(d.b)(i,t),this.attributeInTransition.update({buffer:r[1],value:i.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aTo:Object(d.d)(n,i)}})}update(){const{buffers:e,transform:t,framebuffer:n,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),Object(d.a)(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),0{t[e]||(t[e]=[]),t[e].push(n)})}this.updateTriggers=t}_invalidateTrigger(e,n){const{attributes:r,updateTriggers:t}=this,i=t[e];return i&&i.forEach(e=>{const t=r[e];t&&t.setNeedsUpdate(t.id,n)}),i}_updateAttribute(e){const{attribute:t,numInstances:n}=e;Object(h.a)("attribute.updateStart",t),t.constant?t.setConstantValue(t.value):(t.allocate(n)&&Object(h.a)("attribute.allocate",t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,Object(h.a)("attribute.updateEnd",t,n)))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return text_layer_TextLayer});var t=n(450),d=n(92),F=n(342),r=n(619),y=n.n(r),B=n(28);const b=32,v=[];function buildMapping({characterSet:e,getFontWidth:t,fontHeight:n,buffer:r,maxCanvasWidth:i,mapping:o={},xOffset:a=0,yOffset:s=0}){let A=0,l=a,c=0;for(const u of e){var g;o[u]||(g=t(u,c++),l+g+2*r>i&&(l=0,A++),o[u]={x:l+r,y:s+A*(n+2*r)+r,width:g,height:n},l+=g+2*r)}a=n+2*r;return{mapping:o,xOffset:l,yOffset:s+A*a,canvasHeight:function nextPowOfTwo(e){return Math.pow(2,Math.ceil(Math.log2(e)))}(s+(A+1)*a)}}function getTextWidth(n,e,r,i){let o=0;for(let t=e;ti&&(sA){let e=getTextWidth(t,A,l,o);c+e>i&&(si&&(e=breakAll(t,A,l,i,o,a),s=a[a.length-1])),A=l,c+=e}c})(e,i,o=void 0===o?e.length:o,n,r,a),a}function transformParagraph(t,n,r,i,o){var a=(t=Array.from(t)).length;const s=new Array(a),A=new Array(a),l=new Array(a);var c=("break-word"===r||"break-all"===r)&&isFinite(i)&&0h){var I=c?autoWrapping(t,r,i,o,h,p):v;for(let e=0;e<=I.length;e++){var C=0===e?h:I[e-1],m=ee===t);0<=e&&this._order.splice(e,1)}_appendOrder(e){this._order.push(e)}}(3),s=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function setTextStyle(e,t,n,r){e.font="".concat(r," ").concat(n,"px ").concat(t),e.fillStyle="#000",e.textBaseline="baseline",e.textAlign="left"}class font_atlas_manager_FontAtlasManager{constructor(){this.props={fontFamily:o,fontWeight:"normal",characterSet:i,fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12},this._key=null,this._atlas=null}get texture(){return this._atlas}get mapping(){return this._atlas&&this._atlas.mapping}get scale(){return 1.2}setProps(t={}){s.forEach(e=>{e in t&&(this.props[e]=t[e])});var e=this._key,n=(this._key=this._getKey(),function getNewChars(e,t){if(!(e=a.get(e)))return t;const n=[];e=e.mapping;let r=Object.keys(e),i=(r=new Set(r),t);return(i=i instanceof Array?new Set(i):i).forEach(e=>{r.has(e)||n.push(e)}),n}(this._key,this.props.characterSet)),r=a.get(this._key);r&&0===n.length?this._key!==e&&(this._atlas=r):(e=this._generateFontAtlas(this._key,n,r),this._atlas=e,a.set(this._key,e))}_generateFontAtlas(e,t,n){var{fontFamily:r,fontWeight:i,fontSize:o,buffer:a,sdf:s,radius:A,cutoff:l}=this.props;let c=n&&n.data;c||((c=document.createElement("canvas")).width=1024);const g=c.getContext("2d");setTextStyle(g,r,o,i);var u,{mapping:d,canvasHeight:n,xOffset:h,yOffset:p}=buildMapping({getFontWidth:e=>g.measureText(e).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024,...n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset}});if(c.height!==n&&(u=g.getImageData(0,0,c.width,c.height),c.height=n,g.putImageData(u,0,0)),setTextStyle(g,r,o,i),s){const I=new y.a(o,a,A,l,r,i);var f=g.getImageData(0,0,I.size,I.size);for(const C of t)!function populateAlphaChannel(t,n){for(let e=0;ee.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:r},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};class text_layer_TextLayer extends t.a{initializeState(){this.state={styleVersion:0,fontAtlasManager:new font_atlas_manager_FontAtlasManager}}updateState({props:e,oldProps:t,changeFlags:n}){var n=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getText),r=this.state.characterSet,n=(n&&this._updateText(),r!==this.state.characterSet||this._fontChanged(t,e)),r=(n&&this._updateFontAtlas(t,e),n||e.lineHeight!==t.lineHeight||e.wordBreak!==t.wordBreak||e.maxWidth!==t.maxWidth);r&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:e}){return e.object=0<=e.index?this.props.data[e.index]:null,e}_updateFontAtlas(e,t){var{fontSettings:t,fontFamily:n,fontWeight:r}=t;const{fontAtlasManager:i,characterSet:o}=this.state;i.setProps({...G,...t,characterSet:o,fontFamily:n,fontWeight:r})}_fontChanged(e,t){if(e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;const n=e.fontSettings||{},r=t.fontSettings||{};return A.some(e=>n[e]!==r[e])}_updateText(){var{data:e,characterSet:t}=this.props,n=e.attributes&&e.attributes.getText;let r=this.props["getText"],i=e["startIndices"],o;var a="auto"===t&&new Set;if(n&&i){const{texts:s,characterCount:A}=function getTextFromBuffer({value:t,length:n,stride:e,offset:r,startIndices:i,characterSet:o}){var a=t.BYTES_PER_ELEMENT,s=e?e/a:1,A=r?r/a:0,l=i[n]||Math.ceil((t.length-A)/s),c=o&&new Set;const g=new Array(n);let u=t;if(1s[t]}else{const{iterable:l,objectInfo:c}=Object(d.a)(e);i=[0],o=0;for(const g of l){c.index++;const u=Array.from(r(g,c)||"");a&&u.forEach(a.add,a),o+=u.length,i.push(o)}}this.setState({getText:r,startIndices:i,numInstances:o,characterSet:a||t})}getBoundingRect(e,t){var n=this.state.fontAtlasManager.mapping;const r=this.state["getText"],{wordBreak:i,maxWidth:o,lineHeight:a,getTextAnchor:s,getAlignmentBaseline:A}=this.props;var[n,l]=transformParagraph(r(e,t)||"",a,i,o,n)["size"];return[(E["function"==typeof s?s(e,t):s]-1)*n/2,(Q["function"==typeof A?A(e,t):A]-1)*l/2,n,l]}getIconOffsets(e,t){var n=this.state.fontAtlasManager.mapping;const r=this.state["getText"],{wordBreak:i,maxWidth:o,lineHeight:a,getTextAnchor:s,getAlignmentBaseline:A}=this.props;var{x:l,y:c,rowWidth:g,size:[u,d]}=transformParagraph(r(e,t)||"",a,i,o,n),h=E["function"==typeof s?s(e,t):s],p=Q["function"==typeof A?A(e,t):A],f=l.length;const I=new Array(2*f);let C=0;for(let e=0;e=r),i=i.flatMap(e=>[e[0],e[1]]),Object(B.h)(i,B.a.COUNTER_CLOCKWISE));const o=0e.position},getFillColor:{type:"accessor",value:l},getLineColor:{type:"accessor",value:l},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class column_layer_ColumnLayer extends t.a{getShaders(){return super.getShaders({vs:"\n#define SHADER_NAME column-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec3 instancePositions;\nattribute float instanceElevations;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute float instanceStrokeWidths;\n\nattribute vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n\n vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n float elevation = 0.0;\n float strokeOffsetRatio = 1.0;\n\n if (extruded) {\n elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n } else if (isStroke) {\n float widthPixels = clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0;\n strokeOffsetRatio -= sign(positions.z) * project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n }\n float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n geometry.pickingColor = instancePickingColors;\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec3 centroidPosition64Low = instancePositions64Low;\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, centroidPosition64Low, 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}\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:[r.a,i.a,o.a]})}initializeState(){const e=this.getAttributeManager();e.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:l},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:l},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n});var r,i,n=n.extensionsChanged;n&&(i=this.context["gl"],null!=(r=this.state.model)&&r.delete(),this.state.model=this._getModel(i),this.getAttributeManager().invalidateAll()),!n&&e.diskResolution===t.diskResolution&&e.vertices===t.vertices&&(e.extruded||e.stroked)===(t.extruded||t.stroked)||this._updateGeometry(e)}getGeometry(t,n,e){e=new column_geometry_ColumnGeometry({radius:1,height:e?2:0,vertices:n,nradial:t});let r=0;if(n)for(let e=0;ee.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:n},getLineColor:{type:"accessor",value:n},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class scatterplot_layer_ScatterplotLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceRadius;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool billboard;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n outerRadiusPixels = clamp(\n project_size_to_pixel(radiusScale * instanceRadius),\n radiusMinPixels, radiusMaxPixels\n );\n float lineWidthPixels = clamp(\n project_size_to_pixel(lineWidthScale * instanceLineWidths),\n lineWidthMinPixels, lineWidthMaxPixels\n );\n outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n geometry.pickingColor = instancePickingColors;\n\n innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\n \n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = positions * outerRadiusPixels;\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset = positions * project_pixel_size(outerRadiusPixels);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n }\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME scatterplot-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition) * outerRadiusPixels;\n float inCircle = antialiasing ? \n smoothedge(distToCenter, outerRadiusPixels) : \n step(distToCenter, outerRadiusPixels);\n\n if (inCircle == 0.0) {\n discard;\n }\n\n if (stroked > 0.5) {\n float isLine = antialiasing ? \n smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\n step(innerUnitRadius * outerRadiusPixels, distToCenter);\n\n if (filled) {\n gl_FragColor = mix(vFillColor, vLineColor, isLine);\n } else {\n if (isLine == 0.0) {\n discard;\n }\n gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n }\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n gl_FragColor.a *= inCircle;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{radiusUnits:n,radiusScale:r,radiusMinPixels:i,radiusMaxPixels:o,stroked:a,filled:s,billboard:A,antialiasing:l,lineWidthUnits:c,lineWidthScale:g,lineWidthMinPixels:u,lineWidthMaxPixels:d}=this.props,n="pixels"===n?t.metersPerPixel:1,c="pixels"===c?t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({stroked:a?1:0,filled:s,billboard:A,antialiasing:l,radiusScale:r*n,radiusMinPixels:i,radiusMaxPixels:o,lineWidthScale:g*c,lineWidthMinPixels:u,lineWidthMaxPixels:d}).draw()}_getModel(e){return new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.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})}}scatterplot_layer_ScatterplotLayer.layerName="ScatterplotLayer",scatterplot_layer_ScatterplotLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return text_background_layer_TextBackgroundLayer});var t=n(335),r=n(498),i=n(499),o=n(370),a=n(114),n={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};class text_background_layer_TextBackgroundLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{billboard:n,sizeScale:r,sizeUnits:i,sizeMinPixels:o,sizeMaxPixels:a,getLineWidth:s}=this.props;let A=this.props["padding"];i="pixels"===i?t.metersPerPixel:1;A.length<4&&(A=[A[0],A[1],A[0],A[1]]),this.state.model.setUniforms(e).setUniforms({billboard:n,stroked:Boolean(s),padding:A,sizeScale:r*i,sizeMinPixels:o,sizeMaxPixels:a}).draw()}_getModel(e){return new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.a({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0})}}text_background_layer_TextBackgroundLayer.layerName="TextBackgroundLayer",text_background_layer_TextBackgroundLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return layer_manager_LayerManager});var o=n(1148),r=n(81),a=n(28),i=n(58),s=n(119),A=n(284),l=n(1155);class resource_Resource{constructor(e,t,n){this.id=e,this.context=n,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return 0this.getData())}setData(t,e){if(t!==this._data||e){this._data=t;const n=++this._loadCount;let e=t;(e="string"==typeof t?Object(l.a)(t):e)instanceof Promise?(this.isLoaded=!1,this._loader=e.then(e=>{this._loadCount===n&&(this.isLoaded=!0,this._error=null,this._content=e)}).catch(e=>{this._loadCount===n&&(this.isLoaded=!0,this._error=e||!0)})):(this.isLoaded=!0,this._error=null,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}}class resource_manager_ResourceManager{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:n=!1,persistent:r=!0}){let i=this._resources[e];i?i.setData(t,n):(i=new resource_Resource(e,t,this._context),this._resources[e]=i),i.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){var t=this._consumers[e];if(t){for(const n in t){const r=t[n];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:n,requestId:r="default"}){var{_resources:i,protocol:o}=this;e.startsWith(o)&&!i[e=e.replace(o,"")]&&this.add({resourceId:e,data:null,persistent:!1});const a=i[e];if(this._track(n,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,n,r){const i=this._consumers,o=i[e]=i[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),n&&((o[t]=a).onChange=r,(a.resource=n).subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];t.persistent||t.inUse()||(t.delete(),delete this._resources[e])}}}var c=n(76),g=n(343);const u=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class layer_manager_LayerManager{constructor(e,{deck:t,stats:n,viewport:r,timeline:i}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new resource_manager_ResourceManager({gl:e,protocol:"deck://"}),this.context={...u,layerManager:this,gl:e,deck:t,programManager:e&&Object(g.a)(e),stats:n||new A.a({id:"deck.gl"}),viewport:r||new c.a({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:i||new o.a,resourceManager:this.resourceManager},this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const r of this.layers){var n=r.getNeedsRedraw(e);t=t||n}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(e=>0===t.id.indexOf(e))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){Object(i.a)("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e;for(const n of e=Object(s.b)(e,Boolean))n.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){var e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return Object(i.a)("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,n){n.raiseError(t,"".concat(e," of ").concat(n))}_updateLayers(e,t){const n={};for(const i of e)n[i.id]?a.a.warn("Multiple old layers with same id ".concat(i.id))():n[i.id]=i;e=[];this._updateSublayersRecursively(t,n,e),this._finalizeOldLayers(n);let r=!1;for(const o of e)if(o.hasUniformTransition()){r=!0;break}this._needsUpdate=r,this.layers=e}_updateSublayersRecursively(e,t,n){for(const i of e){i.context=this.context;var r=t[i.id];null===r&&a.a.warn("Multiple new layers with same id ".concat(i.id))();let e=t[i.id]=null;try{this._debug&&r!==i&&i.validateProps(),r?(this._transferLayerState(r,i),this._updateLayer(i)):this._initializeLayer(i),n.push(i),e=i.isComposite&&i.getSubLayers()}catch(e){this._handleError("matching",e,i)}e&&this._updateSublayersRecursively(e,t,n)}}_finalizeOldLayers(e){for(const n in e){var t=e[n];t&&this._finalizeLayer(t)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=r.a.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle=r.a.MATCHED,t!==e&&(e.lifecycle=r.a.AWAITING_GC)}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=r.a.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=r.a.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return multi_icon_layer_MultiIconLayer});var r=n(28),t=n(241);const i=[];class multi_icon_layer_MultiIconLayer extends t.a{getShaders(){return{...super.getShaders(),fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"}}initializeState(){super.initializeState();const e=this.getAttributeManager();e.addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(e,{index:t,target:n})=>this.encodePickingColor(t,n)}})}updateState(e){super.updateState(e);var{props:e,oldProps:t}=e;let n=e["outlineColor"];n!==t.outlineColor&&((n=n.map(e=>e/255))[3]=Number.isFinite(n[3])?n[3]:1,this.setState({outlineColor:n})),!e.sdf&&e.outlineWidth&&r.a.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(e){var{sdf:t,smoothing:n,outlineWidth:r}=this.props,i=this.state["outlineColor"];e.uniforms={...e.uniforms,buffer:.75,outlineBuffer:r?Math.max(n,.75*(1-r)):-1,gamma:n,sdf:Boolean(t),outlineColor:i},super.draw(e)}getInstanceOffset(e){return e?Array.from(e).map(e=>super.getInstanceOffset(e)):i}getInstanceColorMode(e){return 1}getInstanceIconFrame(e){return e?Array.from(e).map(e=>super.getInstanceIconFrame(e)):i}}multi_icon_layer_MultiIconLayer.layerName="MultiIconLayer",multi_icon_layer_MultiIconLayer.defaultProps={getIconOffsets:{type:"accessor",value:e=>e.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return createProgramManager});var i=n(657);const o=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},n(196).a],a=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function createProgramManager(e){const t=i.a.getDefaultProgramManager(e);for(const n of o)t.addDefaultModule(n);for(const r of a)t.addShaderHook(r);return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return deck_renderer_DeckRenderer});var r=n(58);class draw_layers_pass_DrawLayersPass extends n(171).a{}var i=n(360),o=n(134);class deck_renderer_DeckRenderer{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new draw_layers_pass_DrawLayersPass(e),this.pickLayersPass=new i.a(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"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")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||o.a.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);var n=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,n=t.render({...e,target:n});this._postRender(e.effects,e),this.renderCount++,Object(r.a)("deckRenderer.renderLayers",this,n,e)}needsRedraw(e={clearRedrawFlags:!1}){var t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const e=this["renderBuffers"];for(const t of e)t.delete();e.length=0}_preRender(e,t){let n=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(n=r);n&&this._resizeRenderBuffers(),this.lastPostProcessEffect=n}_resizeRenderBuffers(){const e=this["renderBuffers"];0===e.length&&e.push(new o.a(this.gl),new o.a(this.gl));for(const t of e)t.resize()}_postRender(e,t){var n=this["renderBuffers"];const r={inputBuffer:n[0],swapBuffer:n[1],target:null};for(const o of e)if(o.postRender){if(o===this.lastPostProcessEffect){r.target=t.target,o.postRender(this.gl,r);break}var i=o.postRender(this.gl,r);r.inputBuffer=i,r.swapBuffer=i===n[0]?n[1]:n[0]}}}},function(e,t,n){"use strict";var r=n(129),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},c={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function getStatics(e){return r.isMemo(e)?o:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var g=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function hoistNonReactStatics(e,t,n){if("string"!=typeof t){f&&(r=p(t))&&r!==f&&hoistNonReactStatics(e,r,n);for(var r,i=u(t),o=(d&&(i=i.concat(d(t))),getStatics(e)),a=getStatics(t),s=0;s{o.methodName||(o[e]=()=>{throw a.k.removed(`Calling removed method ${t}.${e}: `,i)(),new Error(e)})})}},function(e,t,n){"use strict";n.d(t,"a",function(){return getBinaryImageMetadata});const s=!1,r=!0;function getBinaryImageMetadata(e){e=toDataView(e);return function getPngMetadata(e){const t=toDataView(e),n=24<=t.byteLength&&2303741511===t.getUint32(0,s);return n?{mimeType:"image/png",width:t.getUint32(16,s),height:t.getUint32(20,s)}:null}(e)||function getJpegMetadata(e){const t=toDataView(e),n=3<=t.byteLength&&65496===t.getUint16(0,s)&&255===t.getUint8(2);if(!n)return null;const{tableMarkers:r,sofMarkers:i}=function getJpegMarkers(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);var e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9e&&i<=l&&(s=e),o<=l){A=e;break}}let c=s;var e=A-s!==r.length,g=e&&t.slice(A);for(let e=0;e{super.render({target:o,layers:e,layerFilter:t,views:n,viewports:r,onViewportActive:i,pass:c,redrawReason:g})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){t=this.pickZ?{blend:!1}:{...p,blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]};return{...e.props.parameters,...t}}}},function(e,t,n){var r=n(517),i=n(6),o=n(32),a=n(73).default,s=o.featureEach,A=(o.coordEach,i.polygon,i.featureCollection);function geojsonRbush(e){e=new r(e);return e.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox||a(e),r.prototype.insert.call(this,e)},e.load=function(e){var t=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox||a(e),t.push(e)}):s(e,function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox||a(e),t.push(e)}),r.prototype.load.call(this,t)},e.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox||a(e),r.prototype.remove.call(this,e,t)},e.clear=function(){return r.prototype.clear.call(this)},e.search=function(e){e=r.prototype.search.call(this,this.toBBox(e));return A(e)},e.collides=function(e){return r.prototype.collides.call(this,this.toBBox(e))},e.all=function(){var e=r.prototype.all.call(this);return A(e)},e.toJSON=function(){return r.prototype.toJSON.call(this)},e.fromJSON=function(e){return r.prototype.fromJSON.call(this,e)},e.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=a(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=a(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},e}e.exports=geojsonRbush,e.exports.default=geojsonRbush},function(e,t,n){"use strict";var i=n(6),r=n(15);function calculateRhumbBearing(e,t){var n=Object(i.degreesToRadians)(e[1]),r=Object(i.degreesToRadians)(t[1]),t=Object(i.degreesToRadians)(t[0]-e[0]),e=(t>Math.PI&&(t-=2*Math.PI),t<-Math.PI&&(t+=2*Math.PI),Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4))),r=Math.atan2(t,e);return(Object(i.radiansToDegrees)(r)+360)%360}t.a=function rhumbBearing(e,t,n){return 180<(n=(n=void 0===n?{}:n).final?calculateRhumbBearing(Object(r.getCoord)(t),Object(r.getCoord)(e)):calculateRhumbBearing(Object(r.getCoord)(e),Object(r.getCoord)(t)))?-(360-n):n}},function(e,t){e.exports=function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";!function(b){function createDetectElementResize(i,e){var t,n,o=void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:b,a=void 0!==o.document&&o.document.attachEvent;if(!a){n=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(e){return o.setTimeout(e,20)};var r=function(e){return n(e)},s=(t=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||o.clearTimeout,function(e){return t(e)}),A=function resetTriggers(e){var e=e.__resizeTriggers__,t=e.firstElementChild,e=e.lastElementChild,n=t.firstElementChild;e.scrollLeft=e.scrollWidth,e.scrollTop=e.scrollHeight,n.style.width=t.offsetWidth+1+"px",n.style.height=t.offsetHeight+1+"px",t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight},l=function checkTriggers(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height},c=function scrollListener(t){var n;t.target.className&&"function"==typeof t.target.className.indexOf&&t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0||(A(n=this),this.__resizeRAF__&&s(this.__resizeRAF__),this.__resizeRAF__=r(function(){l(n)&&(n.__resizeLast__.width=n.offsetWidth,n.__resizeLast__.height=n.offsetHeight,n.__resizeListeners__.forEach(function(e){e.call(n,t)}))}))},g=!1,u="",d="animationstart",h="Webkit Moz O ms".split(" "),p="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f=o.document.createElement("fakeelement");if(!1===(g=void 0!==f.style.animationName?!0:g))for(var I=0;I div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',n=e.head||e.getElementsByTagName("head")[0],(r=e.createElement("style")).id="detectElementResize",r.type="text/css",null!=i&&r.setAttribute("nonce",i),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(e.createTextNode(t)),n.appendChild(r))};return{addResizeListener:function addResizeListener(t,e){var n,r,i;a?t.attachEvent("onresize",e):(t.__resizeTriggers__||(n=t.ownerDocument,(i=o.getComputedStyle(t))&&"static"==i.position&&(t.style.position="relative"),B(n),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=n.createElement("div")).className="resize-triggers",r='

',window.trustedTypes?(i=trustedTypes.createPolicy("react-virtualized-auto-sizer",{createHTML:function createHTML(){return r}}),t.__resizeTriggers__.innerHTML=i.createHTML("")):t.__resizeTriggers__.innerHTML=r,t.appendChild(t.__resizeTriggers__),A(t),t.addEventListener("scroll",c,!0),d&&(t.__resizeTriggers__.__animationListener__=function animationListener(e){e.animationName==C&&A(t)},t.__resizeTriggers__.addEventListener(d,t.__resizeTriggers__.__animationListener__))),t.__resizeListeners__.push(e))},removeResizeListener:function removeResizeListener(e,t){if(a)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",c,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(d,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}n.d(t,"a",function(){return createDetectElementResize})}.call(this,n(59))},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){var n,r={};for(n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},function(e,t,n){"use strict";!function(e){e="object"==typeof e&&e&&e.Object===Object&&e;t.a=e}.call(this,n(59))},function(e,t,n){"use strict";var r=n(75),i=n(104),i=(Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i(n(0))),r=(0,r(n(105)).default)(i.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");t.default=r},function(e,At,lt){"use strict";!function(e){lt.d(At,"a",function(){return embed}),lt.d(At,"b",function(){return k});var T=lt(658),_=lt(377),M=lt.n(_),G=lt(141),U=lt(650),_=lt(655),O=lt(469),L=lt(652),P=lt(653);function asyncGeneratorStep(e,t,n,r,i,o,a){try{var s=e[o](a),A=s.value}catch(e){return void n(e)}s.done?t(A):Promise.resolve(A).then(r,i)}function _asyncToGenerator(o){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=o.apply(e,i);function _next(e){asyncGeneratorStep(r,t,n,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(r,t,n,_next,_throw,"throw",e)}_next(void 0)})}}var s,t=Object.prototype,A=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},x=n.iterator||"@@iterator",r=n.asyncIterator||"@@asyncIterator",R=n.toStringTag||"@@toStringTag";function wrap(e,t,n,r){t=t&&t.prototype instanceof Generator?t:Generator,t=Object.create(t.prototype),r=new Context(r||[]);return t._invoke=function makeInvokeMethod(r,i,o){var a=F;return function invoke(e,t){if(a===V)throw new Error("Generator is already running");if(a===Z){if("throw"===e)throw t;return doneResult()}for(o.method=e,o.arg=t;;){var n=o.delegate;if(n){n=function maybeInvokeDelegate(e,t){var n=e.iterator[t.method];if(n===s){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=s,maybeInvokeDelegate(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}n=tryCatch(n,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;n=n.arg;if(!n)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l;{if(!n.done)return n;t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=s)}t.delegate=null;return l}(n,o);if(n){if(n===l)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(a===F)throw a=Z,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);a=V;n=tryCatch(r,i,o);if("normal"===n.type){if(a=o.done?Z:D,n.arg!==l)return{value:n.arg,done:o.done}}else"throw"===n.type&&(a=Z,o.method="throw",o.arg=n.arg)}}}(e,n,r),t}function tryCatch(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var F="suspendedStart",D="suspendedYield",V="executing",Z="completed",l={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var n={},i=(n[x]=function(){return this},Object.getPrototypeOf),i=i&&i(i(values([]))),o=(i&&i!==t&&A.call(i,x)&&(n=i),GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(n));function defineIteratorMethods(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function isGeneratorFunction(e){e="function"==typeof e&&e.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))}function AsyncIterator(o,a){var e;this._invoke=function enqueue(n,r){function callInvokeWithMethodAndArg(){return new a(function(e,t){!function invoke(e,t,n,r){var i,e=tryCatch(o[e],o,t);if("throw"!==e.type)return(t=(i=e.arg).value)&&"object"==typeof t&&A.call(t,"__await")?a.resolve(t.__await).then(function(e){invoke("next",e,n,r)},function(e){invoke("throw",e,n,r)}):a.resolve(t).then(function(e){i.value=e,n(i)},function(e){return invoke("throw",e,n,r)});r(e.arg)}(n,r,e,t)})}return e=e?e.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function pushTryEntry(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 resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t,n=e[x];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return t=-1,(n=function next(){for(;++tthis.length&&(t=this.length);for(var r=0,i=this.head;null!==i&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;null!==i&&tthis.length?this.length-1:e)<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n1;var z=(e,t,n)=>{t=e[f].get(t);if(t){var r=t.value;if(J(e,r)){if(C(e,t),!e[u])return}else n&&(e[j]&&(t.value.now=Date.now()),e[p].unshiftNode(t));return r.value}},J=(e,t)=>{if(!t||!t.maxAge&&!e[d])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[d]&&n>e[d]},I=e=>{if(e[c]>e[a])for(var t=e[p].tail;e[c]>e[a]&&null!==t;){var n=t.prev;C(e,t),t=n}},C=(e,t)=>{var n;t&&(n=t.value,e[h]&&e[h](n.key,n.value),e[c]-=n.length,e[f].delete(n.key),e[p].removeNode(t))};class Entry{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}var K,X,m,y,q,$=(e,t,n,r)=>{var i=n.value;J(e,i)&&(C(e,n),e[u]||(i=void 0)),i&&t.call(r,i.value,i.key,e)},i=class LRUCache{constructor(e){if((e=(e="number"==typeof e?{max:e}:e)||{}).max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[a]=e.max||1/0;var t=e.length||Y;if(this[g]="function"!=typeof t?Y:t,this[u]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[d]=e.maxAge||0,this[h]=e.dispose,this[H]=e.noDisposeOnSet||!1,this[j]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,I(this)}get max(){return this[a]}set allowStale(e){this[u]=!!e}get allowStale(){return this[u]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[d]=e,I(this)}get maxAge(){return this[d]}set lengthCalculator(e){(e="function"!=typeof e?Y:e)!==this[g]&&(this[g]=e,this[c]=0,this[p].forEach(e=>{e.length=this[g](e.value,e.key),this[c]+=e.length})),I(this)}get lengthCalculator(){return this[g]}get length(){return this[c]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(var n=this[p].tail;null!==n;){var r=n.prev;$(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(var n=this[p].head;null!==n;){var r=n.next;$(this,e,n,t),n=r}}keys(){return this[p].toArray().map(e=>e.key)}values(){return this[p].toArray().map(e=>e.value)}reset(){this[h]&&this[p]&&this[p].length&&this[p].forEach(e=>this[h](e.key,e.value)),this[f]=new Map,this[p]=new W,this[c]=0}dump(){return this[p].map(e=>!J(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[p]}set(e,t,n){if((n=n||this[d])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[g](t,e);if(this[f].has(e)){if(i>this[a])return C(this,this[f].get(e)),!1;var o=this[f].get(e).value;return this[h]&&!this[H]&&this[h](e,o.value),o.now=r,o.maxAge=n,o.value=t,this[c]+=i-o.length,o.length=i,this.get(e),I(this),!0}o=new Entry(e,t,i,r,n);return o.length>this[a]?(this[h]&&this[h](e,t),!1):(this[c]+=o.length,this[p].unshift(o),this[f].set(e,this[p].head),I(this),!0)}has(e){if(!this[f].has(e))return!1;e=this[f].get(e).value;return!J(this,e)}get(e){return z(this,e,!0)}peek(e){return z(this,e,!1)}pop(){var e=this[p].tail;return e?(C(this,e),e.value):null}del(e){C(this,this[f].get(e))}load(e){this.reset();for(var t=Date.now(),n=e.length-1;0<=n;n--){var r=e[n],i=r.e||0;0===i?this.set(r.k,r.v):0<(i=i-t)&&this.set(r.k,r.v,i)}}prune(){this[f].forEach((e,t)=>z(this,t,!1))}},ee=["includePrerelease","loose","rtl"],n=t=>t?"object"!=typeof t?{loose:!0}:ee.filter(e=>t[e]).reduce((e,t)=>(e[t]=!0,e),{}):{},r={exports:{}},t={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},e="object"==typeof e&&e.env&&e.env.NODE_DEBUG&&/\bsemver\b/i.test(e.env.NODE_DEBUG)?function(){for(var e=arguments.length,t=new Array(e),n=0;n{},te=(b=(v=r).exports,B=t.MAX_SAFE_COMPONENT_LENGTH,K=e,X=(b=v.exports={}).re=[],m=b.src=[],y=b.t={},q=0,(v=(e,t,n)=>{var r=q++;K(r,t),y[e]=r,m[r]=t,X[r]=new RegExp(t,n?"g":void 0)})("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","[0-9]+"),v("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),v("MAINVERSION","(".concat(m[y.NUMERICIDENTIFIER],")\\.")+"(".concat(m[y.NUMERICIDENTIFIER],")\\.")+"(".concat(m[y.NUMERICIDENTIFIER],")")),v("MAINVERSIONLOOSE","(".concat(m[y.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(m[y.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(m[y.NUMERICIDENTIFIERLOOSE],")")),v("PRERELEASEIDENTIFIER","(?:".concat(m[y.NUMERICIDENTIFIER],"|").concat(m[y.NONNUMERICIDENTIFIER],")")),v("PRERELEASEIDENTIFIERLOOSE","(?:".concat(m[y.NUMERICIDENTIFIERLOOSE],"|").concat(m[y.NONNUMERICIDENTIFIER],")")),v("PRERELEASE","(?:-(".concat(m[y.PRERELEASEIDENTIFIER],"(?:\\.").concat(m[y.PRERELEASEIDENTIFIER],")*))")),v("PRERELEASELOOSE","(?:-?(".concat(m[y.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(m[y.PRERELEASEIDENTIFIERLOOSE],")*))")),v("BUILDIDENTIFIER","[0-9A-Za-z-]+"),v("BUILD","(?:\\+(".concat(m[y.BUILDIDENTIFIER],"(?:\\.").concat(m[y.BUILDIDENTIFIER],")*))")),v("FULLPLAIN","v?".concat(m[y.MAINVERSION]).concat(m[y.PRERELEASE],"?").concat(m[y.BUILD],"?")),v("FULL","^".concat(m[y.FULLPLAIN],"$")),v("LOOSEPLAIN","[v=\\s]*".concat(m[y.MAINVERSIONLOOSE]).concat(m[y.PRERELEASELOOSE],"?").concat(m[y.BUILD],"?")),v("LOOSE","^".concat(m[y.LOOSEPLAIN],"$")),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE","".concat(m[y.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),v("XRANGEIDENTIFIER","".concat(m[y.NUMERICIDENTIFIER],"|x|X|\\*")),v("XRANGEPLAIN","[v=\\s]*(".concat(m[y.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIER],")")+"(?:".concat(m[y.PRERELEASE],")?").concat(m[y.BUILD],"?")+")?)?"),v("XRANGEPLAINLOOSE","[v=\\s]*(".concat(m[y.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(m[y.PRERELEASELOOSE],")?").concat(m[y.BUILD],"?")+")?)?"),v("XRANGE","^".concat(m[y.GTLT],"\\s*").concat(m[y.XRANGEPLAIN],"$")),v("XRANGELOOSE","^".concat(m[y.GTLT],"\\s*").concat(m[y.XRANGEPLAINLOOSE],"$")),v("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(B,"})")+"(?:\\.(\\d{1,".concat(B,"}))?")+"(?:\\.(\\d{1,".concat(B,"}))?")+"(?:$|[^\\d])"),v("COERCERTL",m[y.COERCE],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM","(\\s*)".concat(m[y.LONETILDE],"\\s+"),!0),b.tildeTrimReplace="$1~",v("TILDE","^".concat(m[y.LONETILDE]).concat(m[y.XRANGEPLAIN],"$")),v("TILDELOOSE","^".concat(m[y.LONETILDE]).concat(m[y.XRANGEPLAINLOOSE],"$")),v("LONECARET","(?:\\^)"),v("CARETTRIM","(\\s*)".concat(m[y.LONECARET],"\\s+"),!0),b.caretTrimReplace="$1^",v("CARET","^".concat(m[y.LONECARET]).concat(m[y.XRANGEPLAIN],"$")),v("CARETLOOSE","^".concat(m[y.LONECARET]).concat(m[y.XRANGEPLAINLOOSE],"$")),v("COMPARATORLOOSE","^".concat(m[y.GTLT],"\\s*(").concat(m[y.LOOSEPLAIN],")$|^$")),v("COMPARATOR","^".concat(m[y.GTLT],"\\s*(").concat(m[y.FULLPLAIN],")$|^$")),v("COMPARATORTRIM","(\\s*)".concat(m[y.GTLT],"\\s*(").concat(m[y.LOOSEPLAIN],"|").concat(m[y.XRANGEPLAIN],")"),!0),b.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE","^\\s*(".concat(m[y.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(m[y.XRANGEPLAIN],")")+"\\s*$"),v("HYPHENRANGELOOSE","^\\s*(".concat(m[y.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(m[y.XRANGEPLAINLOOSE],")")+"\\s*$"),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0.0.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$"),/^[0-9]+$/),B=(e,t)=>{var n=te.test(e),r=te.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r||(!r||n)&&ere)throw new TypeError("version is longer than ".concat(re," characters"));if(ne("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,!(t=e.trim().match(t.loose?oe[ae.LOOSE]:oe[ae.FULL])))throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>ie||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ie||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ie||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){var t=+e;if(0<=t&&tnew le(e,n).compare(new le(t,n)),ce=B,ge=B,ue=B,de=B,he=B,pe=B,fe=(e,t,n)=>0===ce(e,t,n),Ie=(e,t,n)=>0!==ge(e,t,n),Ce=(e,t,n)=>00<=de(e,t,n),ye=(e,t,n)=>he(e,t,n)<0,Be=(e,t,n)=>pe(e,t,n)<=0,t=(e,t,n,r)=>{switch(t){case"===":return(e="object"==typeof e?e.version:e)===(n="object"==typeof n?n.version:n);case"!==":return(e="object"==typeof e?e.version:e)!==(n="object"==typeof n?n.version:n);case"":case"=":case"==":return fe(e,n,r);case"!=":return Ie(e,n,r);case">":return Ce(e,n,r);case">=":return me(e,n,r);case"<":return ye(e,n,r);case"<=":return Be(e,n,r);default:throw new TypeError("Invalid operator: ".concat(t))}},be=Symbol("SemVer ANY");var b=class Comparator$1{static get ANY(){return be}constructor(e,t){if(t=ve(t),e instanceof Comparator$1){if(e.loose===!!t.loose)return e;e=e.value}Se("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===be?this.value="":this.value=this.operator+this.semver.version,Se("comp",this)}parse(e){var t=this.options.loose?Ee[Qe.COMPARATORLOOSE]:Ee[Qe.COMPARATOR];if(!(t=e.match(t)))throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new _e(t[2],this.options.loose):this.semver=be}toString(){return this.value}test(e){if(Se("Comparator.test",e,this.options.loose),this.semver===be||e===be)return!0;if("string"==typeof e)try{e=new _e(e,this.options)}catch(e){return!1}return we(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator$1))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new xe(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new xe(this.value,t).test(e.semver);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=we(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),t=we(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||i&&o||a||t}},ve=n,Ee=r.exports.re,Qe=r.exports.t,we=t,Se=e,_e=v,xe=void 0;function _createForOfIteratorHelper(t,r){var i,o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}(t))||r&&t&&"number"==typeof t.length)return o&&(t=o),i=0,{s:r=function F(){},n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:r};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,A=!0,l=!1;return{s:function s(){o=o.call(t)},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nthis.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(e));if(1!Me(e[0])),0===this.set.length)this.set=[t];else if(1e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();var t=Object.keys(this.options).join(","),t="parseRange:".concat(t,":").concat(e),n=Re.get(t);if(n)return n;var r,i=(n=this.options.loose)?Q[w.HYPHENRANGELOOSE]:Q[w.HYPHENRANGE],o=(e=e.replace(i,Je(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(Q[w.COMPARATORTRIM],Ne),E("comparator trim",e,Q[w.COMPARATORTRIM]),e=(e=(e=e.replace(Q[w.TILDETRIM],ke)).replace(Q[w.CARETTRIM],Te)).split(/\s+/).join(" "),n?Q[w.COMPARATORLOOSE]:Q[w.COMPARATOR]),a=((i=e.split(" ").map(e=>Le(e,this.options)).join(" ").split(/\s+/).map(e=>ze(e,this.options)).filter(this.options.loose?e=>!!e.match(o):()=>!0).map(e=>new De(e,this.options))).length,new Map),s=_createForOfIteratorHelper(i);try{for(s.s();!(r=s.n()).done;){var A=r.value;if(Me(A))return[A];a.set(A.value,A)}}catch(e){s.e(e)}finally{s.f()}return 1Oe(t,n)&&e.set.some(e=>Oe(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))));throw new TypeError("a Range is required")}test(e){if(!e)return!1;if("string"==typeof e)try{e=new Ge(e,this.options)}catch(e){return!1}for(var t=0;t"<0.0.0-0"===e.value,Ue=e=>""===e.value,Oe=(e,t)=>{for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},Le=(e,t)=>(E("comp",e,t),e=Ze(e,t),E("caret",e),e=Pe(e,t),E("tildes",e),e=He(e,t),E("xrange",e),e=Ye(e,t),E("stars",e),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,Pe=(e,t)=>e.trim().split(/\s+/).map(e=>Ve(e,t)).join(" "),Ve=(o,e)=>{e=e.loose?Q[w.TILDELOOSE]:Q[w.TILDE];return o.replace(e,(e,t,n,r,i)=>{return E("tilde",o,e,t,n,r,i),e=S(t)?"":S(n)?">=".concat(t,".0.0 <").concat(+t+1,".0.0-0"):S(r)?">=".concat(t,".").concat(n,".0 <").concat(t,".").concat(+n+1,".0-0"):i?(E("replaceTilde pr",i),">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(t,".").concat(+n+1,".0-0")):">=".concat(t,".").concat(n,".").concat(r," <").concat(t,".").concat(+n+1,".0-0"),E("tilde return",e),e})},Ze=(e,t)=>e.trim().split(/\s+/).map(e=>We(e,t)).join(" "),We=(o,e)=>{E("caret",o,e);var t=e.loose?Q[w.CARETLOOSE]:Q[w.CARET],a=e.includePrerelease?"-0":"";return o.replace(t,(e,t,n,r,i)=>{return E("caret",o,e,t,n,r,i),e=S(t)?"":S(n)?">=".concat(t,".0.0").concat(a," <").concat(+t+1,".0.0-0"):S(r)?"0"===t?">=".concat(t,".").concat(n,".0").concat(a," <").concat(t,".").concat(+n+1,".0-0"):">=".concat(t,".").concat(n,".0").concat(a," <").concat(+t+1,".0.0-0"):i?(E("replaceCaret pr",i),"0"===t?"0"===n?">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(t,".").concat(n,".").concat(+r+1,"-0"):">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(t,".").concat(+n+1,".0-0"):">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(+t+1,".0.0-0")):(E("no pr"),"0"===t?"0"===n?">=".concat(t,".").concat(n,".").concat(r).concat(a," <").concat(t,".").concat(n,".").concat(+r+1,"-0"):">=".concat(t,".").concat(n,".").concat(r).concat(a," <").concat(t,".").concat(+n+1,".0-0"):">=".concat(t,".").concat(n,".").concat(r," <").concat(+t+1,".0.0-0")),E("caret return",e),e})},He=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(e=>je(e,t)).join(" ")),je=(l,c)=>{l=l.trim();var e=c.loose?Q[w.XRANGELOOSE]:Q[w.XRANGE];return l.replace(e,(e,t,n,r,i,o)=>{E("xRange",l,e,t,n,r,i,o);var a=S(n),s=a||S(r),A=s||S(i);return"="===t&&A&&(t=""),o=c.includePrerelease?"-0":"",a?e=">"===t||"<"===t?"<0.0.0-0":"*":t&&A?(s&&(r=0),i=0,">"===t?(t=">=",i=s?(n=+n+1,r=0):(r=+r+1,0)):"<="===t&&(t="<",s?n=+n+1:r=+r+1),"<"===t&&(o="-0"),e="".concat(t+n,".").concat(r,".").concat(i).concat(o)):s?e=">=".concat(n,".0.0").concat(o," <").concat(+n+1,".0.0-0"):A&&(e=">=".concat(n,".").concat(r,".0").concat(o," <").concat(n,".").concat(+r+1,".0-0")),E("xRange return",e),e})},Ye=(e,t)=>(E("replaceStars",e,t),e.trim().replace(Q[w.STAR],"")),ze=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(Q[t.includePrerelease?w.GTE0PRE:w.GTE0],"")),Je=d=>(e,t,n,r,i,o,a,s,A,l,c,g,u)=>(t=S(n)?"":S(r)?">=".concat(n,".0.0").concat(d?"-0":""):S(i)?">=".concat(n,".").concat(r,".0").concat(d?"-0":""):o?">=".concat(t):">=".concat(t).concat(d?"-0":""),s=S(A)?"":S(l)?"<".concat(+A+1,".0.0-0"):S(c)?"<".concat(A,".").concat(+l+1,".0-0"):g?"<=".concat(A,".").concat(l,".").concat(c,"-").concat(g):d?"<".concat(A,".").concat(l,".").concat(+c+1,"-0"):"<=".concat(s),"".concat(t," ").concat(s).trim()),Ke=(e,t,n)=>{for(var r=0;r{try{t=new Xe(t,n)}catch(e){return!1}return t.test(e)};function post(t,e,n){var r=t.open(e),i=new URL(e).origin,o=40;t.addEventListener("message",function listen(e){e.source===r&&(o=0,t.removeEventListener("message",listen,!1))},!1),setTimeout(function send(){o<=0||(r.postMessage(n,i),setTimeout(send,250),--o)},250)}var $e='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function mergeDeep(e){for(var t=arguments.length,n=new Array(1e,"vega-lite":(e,t)=>et.compile(e,{config:t}).spec},at='\n\n \n \n \n',st="chart-wrapper";function viewSource(e,t,n,r){var t="".concat(t,'
'),n="
".concat(n,""),i=window.open("");i.document.write(t+e+n),i.document.title="".concat(rt[r]," JSON Source")}function createLoader(e){return function isLoader(e){return e&&"load"in e}(e)?e:k.loader(e)}function embedOptionsFromUsermeta(e){return null!=(e=e.usermeta&&e.usermeta.embedOptions)?e:{}}function embed(e,t){return _embed2.apply(this,arguments)}function _embed2(){return(_embed2=_asyncToGenerator(N.mark(function _callee(t,n){var r,i,o,a,s,A,l,c=arguments;return N.wrap(function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(r=2{t=t.type;"fit-x"==t?(f.classList.add("fit-x"),f.classList.remove("fit-y")):"fit-y"==t?(f.classList.remove("fit-x"),f.classList.add("fit-y")):"fit"==t?f.classList.add("fit-x","fit-y"):f.classList.remove("fit-x","fit-y")}),!1!==i.tooltip&&(v=function isTooltipHandler(e){return"function"==typeof e}(i.tooltip)?i.tooltip:new P.a(!0===i.tooltip?{}:i.tooltip).call,m.tooltip(v)),(B=void 0===(B=i.hover)?"vega"===d:B)&&(B=(v="boolean"==typeof B?{}:B).hoverSet,v=v.updateSet,m.hover(B,v)),i&&(null!=i.width&&m.width(i.width),null!=i.height&&m.height(i.height),null!=i.padding&&m.padding(i.padding)),e.next=36,m.initialize(f,i.bind).runAsync();case 36:if(!1!==s){if(B=u,!1!==i.defaultStyle&&((b=document.createElement("details")).title=A.CLICK_TO_VIEW_ACTIONS,u.append(b),B=b,(v=document.createElement("summary")).innerHTML=at,b.append(v),y=e=>{b.contains(e.target)||b.removeAttribute("open")},document.addEventListener("click",y)),E=document.createElement("div"),B.append(E),E.classList.add("vega-actions"),!0===s||!1!==s.export)for(Q=function _loop(){var e,t,r=S[w];!0!==s&&!0!==s.export&&!s.export[r]||(e=A["".concat(r.toUpperCase(),"_ACTION")],(t=document.createElement("a")).text=e,t.href="#",t.target="_blank",t.download="".concat(g,".").concat(r),t.addEventListener("mousedown",function(){var t=_asyncToGenerator(N.mark(function _callee3(t){var n;return N.wrap(function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,m.toImageURL(r,i.scaleFactor);case 3:n=e.sent,this.href=n;case 5:case"end":return e.stop()}},_callee3,this)}));return function(e){return t.apply(this,arguments)}}()),E.append(t))},w=0,S=["svg","png"];wt[e.name]);return new schema_Schema(e,this.metadata)}selectAt(...e){e=e.map(e=>this.fields[e]).filter(Boolean);return new schema_Schema(e,this.metadata)}assign(e){let t,n=this.metadata;e instanceof schema_Schema?(i=e,t=i.fields,n=mergeMaps(mergeMaps(new Map,this.metadata),i.metadata)):t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const a of t)r[a.name]=a;var i=Object.values(r);return new schema_Schema(i,n)}}function mergeMaps(e,t){return new Map([...e||new Map,...t||new Map])}let n;(u=n=n||{})[u.NONE=0]="NONE",u[u.Null=1]="Null",u[u.Int=2]="Int",u[u.Float=3]="Float",u[u.Binary=4]="Binary",u[u.Utf8=5]="Utf8",u[u.Bool=6]="Bool",u[u.Decimal=7]="Decimal",u[u.Date=8]="Date",u[u.Time=9]="Time",u[u.Timestamp=10]="Timestamp",u[u.Interval=11]="Interval",u[u.List=12]="List",u[u.Struct=13]="Struct",u[u.Union=14]="Union",u[u.FixedSizeBinary=15]="FixedSizeBinary",u[u.FixedSizeList=16]="FixedSizeList",u[u.Map=17]="Map",u[u.Dictionary=-1]="Dictionary",u[u.Int8=-2]="Int8",u[u.Int16=-3]="Int16",u[u.Int32=-4]="Int32",u[u.Int64=-5]="Int64",u[u.Uint8=-6]="Uint8",u[u.Uint16=-7]="Uint16",u[u.Uint32=-8]="Uint32",u[u.Uint64=-9]="Uint64",u[u.Float16=-10]="Float16",u[u.Float32=-11]="Float32",u[u.Float64=-12]="Float64",u[u.DateDay=-13]="DateDay",u[u.DateMillisecond=-14]="DateMillisecond",u[u.TimestampSecond=-15]="TimestampSecond",u[u.TimestampMillisecond=-16]="TimestampMillisecond",u[u.TimestampMicrosecond=-17]="TimestampMicrosecond",u[u.TimestampNanosecond=-18]="TimestampNanosecond",u[u.TimeSecond=-19]="TimeSecond",u[u.TimeMillisecond=-20]="TimeMillisecond",u[u.TimeMicrosecond=-21]="TimeMicrosecond",u[u.TimeNanosecond=-22]="TimeNanosecond",u[u.DenseUnion=-23]="DenseUnion",u[u.SparseUnion=-24]="SparseUnion",u[u.IntervalDayTime=-25]="IntervalDayTime",u[u.IntervalYearMonth=-26]="IntervalYearMonth";class type_DataType{static isNull(e){return e&&e.typeId===n.Null}static isInt(e){return e&&e.typeId===n.Int}static isFloat(e){return e&&e.typeId===n.Float}static isBinary(e){return e&&e.typeId===n.Binary}static isUtf8(e){return e&&e.typeId===n.Utf8}static isBool(e){return e&&e.typeId===n.Bool}static isDecimal(e){return e&&e.typeId===n.Decimal}static isDate(e){return e&&e.typeId===n.Date}static isTime(e){return e&&e.typeId===n.Time}static isTimestamp(e){return e&&e.typeId===n.Timestamp}static isInterval(e){return e&&e.typeId===n.Interval}static isList(e){return e&&e.typeId===n.List}static isStruct(e){return e&&e.typeId===n.Struct}static isUnion(e){return e&&e.typeId===n.Union}static isFixedSizeBinary(e){return e&&e.typeId===n.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===n.FixedSizeList}static isMap(e){return e&&e.typeId===n.Map}static isDictionary(e){return e&&e.typeId===n.Dictionary}get typeId(){return n.NONE}compareTo(e){return this===e}}Symbol.toStringTag;Symbol.toStringTag;u=Symbol.toStringTag;class type_Int extends type_DataType{constructor(e,t){super(),Object(i.a)(this,"isSigned",void 0),Object(i.a)(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return n.Int}get[u](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class Int8 extends type_Int{constructor(){super(!0,8)}}class Int16 extends type_Int{constructor(){super(!0,16)}}class Int32 extends type_Int{constructor(){super(!0,32)}}class Uint8 extends type_Int{constructor(){super(!1,8)}}class Uint16 extends type_Int{constructor(){super(!1,16)}}class Uint32 extends type_Int{constructor(){super(!1,32)}}const r={HALF:16,SINGLE:32,DOUBLE:64};u=Symbol.toStringTag;class type_Float extends type_DataType{constructor(e){super(),Object(i.a)(this,"precision",void 0),this.precision=e}get typeId(){return n.Float}get[u](){return"Float"}toString(){return"Float".concat(this.precision)}}class Float32 extends type_Float{constructor(){super(r.SINGLE)}}class Float64 extends type_Float{constructor(){super(r.DOUBLE)}}Symbol.toStringTag;Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;class type_FixedSizeList extends type_DataType{constructor(e,t){super(),Object(i.a)(this,"listSize",void 0),Object(i.a)(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return n.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[u](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}class field_Field{constructor(e,t,n=!1,r=new Map){Object(i.a)(this,"name",void 0),Object(i.a)(this,"type",void 0),Object(i.a)(this,"nullable",void 0),Object(i.a)(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=n,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new field_Field(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}function makeSchemaFromAttributes(e,t,n){var r=makeMetadata(t.metadata);const i=[];var o=function transformAttributesLoaderData(e){const t={};for(const r in e){var n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(const s in e){var a=e[s],a=getArrowFieldFromAttribute(s,a,o[s]);i.push(a)}return n&&(t=getArrowFieldFromAttribute("indices",n),i.push(t)),new schema_Schema(i,r)}function getArrowFieldFromAttribute(e,t,n){var n=n?makeMetadata(n.metadata):void 0,r=function getArrowTypeFromTypedArray(e){switch(e.constructor){case Int8Array:return new Int8;case Uint8Array:return new Uint8;case Int16Array:return new Int16;case Uint16Array:return new Uint16;case Int32Array:return new Int32;case Uint32Array:return new Uint32;case Float32Array:return new Float32;case Float64Array:return new Float64;default:throw new Error("array type not supported")}}(t.value);return new field_Field(e,new type_FixedSizeList(t.size,new field_Field("value",r)),!1,n)}function makeMetadata(e){const t=new Map;for(const n in e)t.set("".concat(n,".string"),JSON.stringify(e[n]));return t}const s={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},c={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class draco_parser_DracoParser{constructor(e){Object(i.a)(this,"draco",void 0),Object(i.a)(this,"decoder",void 0),Object(i.a)(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,n={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(n);var i,t=this.decoder.GetEncodedGeometryType(r);const o=new(t===this.draco.TRIANGULAR_MESH?this.draco.Mesh:this.draco.PointCloud);try{let e;switch(t){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(r,o);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(r,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!o.ptr)throw i="DRACO decompression failed: ".concat(e.error_msg()),new Error(i);var a=this._getDracoLoaderData(o,t,n),s=this._getMeshData(o,a,n),A=function getMeshBoundingBox(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;var s=e.POSITION?e.POSITION.value:[],A=s&&s.length;for(let e=0;ei?l:i,o=c>o?c:o,a=g>a?g:a}return[[t,n,r],[i,o,a]]}(s.attributes),l=makeSchemaFromAttributes(s.attributes,a,s.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:A},...s,schema:l}}finally{this.draco.destroy(r),o&&this.draco.destroy(o)}}_getDracoLoaderData(e,t,n){var r=this._getTopLevelMetadata(e),n=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:n}}_getDracoAttributes(t,n){const r={};for(let e=0;ethis.decoder[e]).includes(t)){const r=new this.draco.AttributeQuantizationTransform;try{if(r.InitFromAttribute(e))return{quantization_bits:r.quantization_bits(),range:r.range(),min_values:new Float32Array([1,2,3]).map(e=>r.min_value(e))}}finally{this.draco.destroy(r)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:n=[]}=t;t=e.attribute_type();if(n.map(e=>this.decoder[e]).includes(t)){const r=new this.draco.AttributeQuantizationTransform;try{if(r.InitFromAttribute(e))return{quantization_bits:r.quantization_bits()}}finally{this.draco.destroy(r)}}return null}}var o=t(139),a=t(289),A=t(91);const l="3.0.13",g={};async function loadLibrary(e,t=null,n={}){return t&&(e=function getLibraryUrl(e,t,n){if(e.startsWith("http"))return e;var r=n.modules||{};if(r[e])return r[e];if(!o.b)return"modules/".concat(t,"/dist/libs/").concat(e);if(n.CDN)return Object(A.a)(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(t,"@").concat(l,"/dist/libs/").concat(e);if(o.d)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,n)),g[e]=g[e]||async function loadLibraryFromFile(e){if(e.endsWith("wasm")){const t=await fetch(e);return t.arrayBuffer()}if(!o.b)return a.requireFromFile&&await a.requireFromFile(e);if(o.d)return importScripts(e);const t=await fetch(e),n=await t.text();return function loadLibraryFromString(t,e){if(!o.b)return a.requireFromString&&a.requireFromString(t,e);if(o.d)return eval.call(o.a,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(e){n.text=t}return document.body.appendChild(n),null}(n,e)}(e),g[e]}var u="1.4.1";const d="https://www.gstatic.com/draco/versioned/decoders/".concat(u,"/draco_decoder.js"),I="https://www.gstatic.com/draco/versioned/decoders/".concat(u,"/draco_wasm_wrapper.js"),C="https://www.gstatic.com/draco/versioned/decoders/".concat(u,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat(u,"/javascript/draco_encoder.js");let h;async function loadDracoDecoderModule(e){const t=e.modules||{};return h=t.draco3d?h||t.draco3d.createDecoderModule({}).then(e=>({draco:e})):h||async function loadDracoDecoder(e){let t,n;"js"===(e.draco&&e.draco.decoderType)?t=await loadLibrary(d,"draco",e):[t,n]=await Promise.all([await loadLibrary(I,"draco",e),await loadLibrary(C,"draco",e)]);return function initializeDracoDecoder(e,t){const n={};t&&(n.wasmBinary=t);return new Promise(t=>{e({...n,onModuleLoaded:e=>t({draco:e})})})}(t=t||globalThis.DracoDecoderModule,n)}(e)}const p={...e,parse:async function parse(e,t){const n=(await loadDracoDecoderModule(t))["draco"],r=new draco_parser_DracoParser(n);try{return r.parseSync(e,null==t?void 0:t.draco)}finally{r.destroy()}}};p},function(e,t,n){"use strict";n.d(t,"a",function(){return model_Model});var d=n(7),c=n(657),i=n(85),h=n(14),r=n(373),l=n(1158),s=n(117),p=n(62),t=n(72);let o=null;function getScratchArray(e,t){return new e(function getScratchArrayBuffer(e){return o=!o||o.byteLength{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);const{size:r,type:i,stride:o,offset:a,normalized:s,integer:A,divisor:l}=n,{gl:c,gl2:g}=this;return e=Number(e),this.bind(()=>{c.bindBuffer(34962,t.handle),A?(Object(h.a)(Object(d.j)(c)),g.vertexAttribIPointer(e,r,i,o,a)):c.vertexAttribPointer(e,r,i,s,o,a),c.enableVertexAttribArray(e),g.vertexAttribDivisor(e,l||0)}),this}enable(e,t=!0){return!t&&0===e&&!vertex_array_object_VertexArrayObject.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){var n=this._normalizeConstantArrayValue(t),r=n.byteLength*e,e=n.length*e,i=!this.buffer;return this.buffer=this.buffer||new p.a(this.gl,r),(i||this.buffer.reallocate(r)||!this._compareConstantArrayValues(n,this.bufferValue))&&(function fillArray({target:t,source:n,start:r=0,count:e=1}){var i=n.length,o=e*i;let a=0;for(let e=r;a34373!==e?this.gl.getVertexAttrib(t,e):this.gl.getVertexAttribOffset(t,e))}}var u=n(356);const f=/^(.+)__LOCATION_([0-9]+)$/,I=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class vertex_array_VertexArray{constructor(e,t={}){var n=t.id||t.program&&t.program.id;this.id=n,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new vertex_array_object_VertexArrayObject(e),Object(u.a)(this,"VertexArray","v6.0",I),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){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}setProps(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}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(n){return Object.assign(this.attributes,n),this.vertexArrayObject.bind(()=>{for(const t in n){var e=n[t];this._setAttribute(t,e)}this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,n={}){if(34963===t.target)return this.setElementBuffer(t,n);var{location:e,accessor:n}=this._resolveLocationAndAccessor(e,t,t.accessor,n);return 0<=e&&(this.values[e]=t,this.accessors[e]=n,this.clearDrawParams(),this.vertexArrayObject.setBuffer(e,t,n)),this}setConstant(e,t,n={}){var{location:e,accessor:n}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n));return 0<=e&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[e]=t,this.accessors[e]=n,this.clearDrawParams(),this.vertexArrayObject.enable(e,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new p.a(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=n()}),r}_resolveLocationAndAccessor(e,t,n,r){var i={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,d.k.once(3,()=>`unused value ${e} in `+this.id)(),i;t=this._getAttributeInfo(a||o);if(!t)return i;var a=this.accessors[o]||{},i=s.a.resolve(t.accessor,a,n,r),{size:t,type:a}=i;return Object(h.a)(Number.isFinite(t)&&Number.isFinite(a)),{location:o,accessor:i}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){var t=Number(e);if(Number.isFinite(t))return{location:t};t=f.exec(e),e=t?t[1]:e,t=t?Number(t[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(e)+t,name:e}:{location:-1}}_setAttribute(e,t){if(t instanceof p.a)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof p.a){var n=t[0],r=t[1];this.setBuffer(e,n,r)}else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof p.a))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){e=Math.max(0|e,0|t);let n=this.values[0];ArrayBuffer.isView(n)&&this._setConstantAttributeZero(n,e);for(let e=1;er?"...":"]";return o+e}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return n?"0":"0.";if(n)return e.toFixed(0);if(100{},v={};class model_Model{constructor(e,t={}){var{id:n=Object(i.c)("model")}=t;Object(h.a)(Object(d.i)(e)),this.id=n,this.gl=e,this.id=t.id||Object(i.c)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||c.a.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;var{program:t=null,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:s,bufferMode:A,transpileToGLSL100:l}=e;this.programProps={program:t,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:s,bufferMode:A,transpileToGLSL100:l},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||0e.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:i}))}finally{r.forEach(e=>e.vertexArray.bindBuffers())}return this}render(e={}){return d.k.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){var t,n,r,i,o,a,s,A;if(this._programDirty||this.programManager.stateHash!==this._programManagerState){let e=this.programProps["program"];e?this._managedProgram=!1:({vs:t,fs:n,modules:r,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:A}=this.programProps,e=this.programManager.get({vs:t,fs:n,modules:r,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:A}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0),Object(h.a)(e instanceof l.a,"Model needs a program"),this._programDirty=!1,e!==this.program&&(this.program=e,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new vertex_array_VertexArray(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof p.a&&t.delete()}}_setAnimationProps(e){this.animated&&Object(h.a)(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(Object(i.a)(e))return this;var t=this.program["gl"];return this.transformFeedback=this.transformFeedback||new C.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){var t=3>> DRAWING MODEL "+this.id,{collapsed:d.k.level<=2})(),e}_logDrawCallEnd(e,t,n,r){var i,o,a,s;void 0!==e&&(t=getDebugTableForVertexArray({vertexArray:t,header:this.id+" attributes",attributes:this._attributes}),{table:i,unusedTable:o,unusedCount:a}=getDebugTableForUniforms({header:this.id+" uniforms",program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:n,count:s}=getDebugTableForUniforms({header:this.id+" uniforms",program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),0>> DRAWING MODEL "+this.id)())}}},function(e,t,n){"use strict";t.a={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(134),i=n(203);const o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};t.b={[o.WEBGL2]:[!1,!0],[o.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[o.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[o.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[o.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[o.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[o.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[o.FLOAT_BLEND]:["EXT_float_blend"],[o.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[o.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[o.TEXTURE_FLOAT]:["OES_texture_float",!0],[o.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[o.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[o.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[o.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[o.COLOR_ATTACHMENT_RGBA32F]:[function checkFloat32ColorAttachment(e){const t=new i.a(e,{format:6408,type:5126,dataFormat:6408}),n=new r.a(e,{id:"test-framebuffer",check:!1,attachments:{[36064]:t}});return e=n.getStatus(),t.delete(),n.delete(),36053===e},"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[o.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[o.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[o.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[o.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]}},function(e,t,n){"use strict";n.d(t,"a",function(){return clear}),n.d(t,"b",function(){return clearBuffer});var s=n(7),A=n(14);const l=256,c=1024,g=16384,a=6144,u=6145,d=6146,h=34041,p="clear: bad arguments";function clear(e,{framebuffer:t=null,color:n=null,depth:r=null,stencil:i=null}={}){const o={};t&&(o.framebuffer=t);let a=0;n&&(a|=g,!0!==n&&(o.clearColor=n)),r&&(a|=l,!0!==r&&(o.clearDepth=r)),i&&(a|=c,!0!==r&&(o.clearStencil=r)),Object(A.a)(0!==a,p),Object(s.o)(e,o,()=>{e.clear(a)})}function clearBuffer(n,{framebuffer:e=null,buffer:r=a,drawBuffer:i=0,value:o=[0,0,0,0]}={}){Object(s.a)(n),Object(s.o)(n,{framebuffer:e},()=>{switch(r){case a:switch(o.constructor){case Int32Array:n.clearBufferiv(r,i,o);break;case Uint32Array:n.clearBufferuiv(r,i,o);break;default:Float32Array;n.clearBufferfv(r,i,o)}break;case u:n.clearBufferfv(u,0,[o]);break;case d:n.clearBufferiv(d,0,[o]);break;case h:var[e,t]=o;n.clearBufferfi(h,0,e,t);break;default:Object(A.a)(!1,p)}})}},function(e,t,n){"use strict";function assert(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}n.d(t,"a",function(){return assert})},function(e,t){},function(e,t,n){!function(q){"use strict";function e(){}function n(e){this.message=e||""}function i(e){this.message=e||""}function r(e){this.message=e||""}function o(){}function s(e){return null===e?nt:e.color}function a(e){return null===e?null:e.parent}function u(e,t){null!==e&&(e.color=t)}function l(e){return null===e?null:e.left}function c(e){return null===e?null:e.right}function p(){this.root_=null,this.size_=0}function h(){}function f(){this.array_=[],arguments[0]instanceof We&&this.addAll(arguments[0])}function g(){}function d(e){this.message=e||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var t=Object(this),n=Math.max(Math.min(t.length,9007199254740991),0)||0,r=1 in arguments?parseInt(Number(arguments[1]),10)||0:0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);rt.x?1:this.yt.y?1:0},B.prototype.clone=function(){},B.prototype.copy=function(){return new B(this)},B.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},B.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+n*n+r*r)},B.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},B.prototype.hashCode=function(){var e=17;return e=37*e+B.hashCode(this.x),e=37*e+B.hashCode(this.y)},B.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z},B.prototype.interfaces_=function(){return[te,ne,e]},B.prototype.getClass=function(){return B},B.hashCode=function(){if(1===arguments.length){var e=arguments[0],t=C.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},ie.DimensionalComparator.get=function(){return oe},ie.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},ie.NULL_ORDINATE.get=function(){return C.NaN},ie.X.get=function(){return 0},ie.Y.get=function(){return 1},ie.Z.get=function(){return 2},Object.defineProperties(B,ie),function(e){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new I("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}),ae=(oe.prototype.compare=function(e,t){var n=e,r=t,i=oe.compare(n.x,r.x);if(0!==i)return i;var o=oe.compare(n.y,r.y);if(0!==o)return o;if(this._dimensionsToTest<=2)return 0;return oe.compare(n.z,r.z)},oe.prototype.interfaces_=function(){return[re]},oe.prototype.getClass=function(){return oe},oe.compare=function(e,t){return et?1:C.isNaN(e)?C.isNaN(t)?0:-1:C.isNaN(t)?1:0},function(){}),m=(ae.prototype.create=function(){},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},function(){}),se={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}},b=(m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.toLocationSymbol=function(e){switch(e){case m.EXTERIOR:return"e";case m.BOUNDARY:return"b";case m.INTERIOR:return"i";case m.NONE:return"-"}throw new I("Unknown location value: "+e)},se.INTERIOR.get=function(){return 0},se.BOUNDARY.get=function(){return 1},se.EXTERIOR.get=function(){return 2},se.NONE.get=function(){return-1},Object.defineProperties(m,se),function(e,t){return e.interfaces_&&e.interfaces_().indexOf(t)>-1}),Ae=function(){},le={LOG_10:{configurable:!0}},ce=(Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Ae.log10=function(e){var t=Math.log(e);return C.isInfinite(t)?t:C.isNaN(t)?t:t/Ae.LOG_10},Ae.min=function(e,t,n,r){var i=e;return tn?n:e}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}},Ae.wrap=function(e,t){return e<0?t- -e%t:e%t},Ae.max=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],n=arguments[2],r=e;return t>r&&(r=t),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],A=i;return o>A&&(A=o),a>A&&(A=a),s>A&&(A=s),A}},Ae.average=function(e,t){return(e+t)/2},le.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ae,le),function(e){this.str=e}),ge=(ce.prototype.append=function(e){this.str+=e},ce.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},ce.prototype.toString=function(e){return this.str},function(e){this.value=e}),ue=(ge.prototype.intValue=function(){return this.value},ge.prototype.compareTo=function(e){return this.valuee?1:0},ge.isNaN=function(e){return Number.isNaN(e)},function(){}),v=(ue.isWhitespace=function(e){return e<=32&&e>=0||127===e},ue.toUpperCase=function(e){return e.toUpperCase()},function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}),de={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}},he=(v.prototype.le=function(e){return(this._hi9?(c=!0,g="9"):g="0"+l,a.append(g),n=n.subtract(v.valueOf(l)).multiply(v.TEN),c&&n.selfAdd(v.TEN);var u=!0,d=v.magnitude(n._hi);if(d<0&&Math.abs(d)>=s-A&&(u=!1),!u)break}return t[0]=r,a.toString()},v.prototype.sqr=function(){return this.multiply(this)},v.prototype.doubleValue=function(){return this._hi+this._lo},v.prototype.subtract=function(){if(arguments[0]instanceof v){var e=arguments[0];return this.add(e.negate())}if("number"==typeof arguments[0]){var t=arguments[0];return this.add(-t)}},v.prototype.equals=function(){if(1===arguments.length){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},v.prototype.isZero=function(){return 0===this._hi&&0===this._lo},v.prototype.selfSubtract=function(){if(arguments[0]instanceof v){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},v.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},v.prototype.min=function(e){return this.le(e)?this:e},v.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof v){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,s=null,A=null,l=null,c=null,g=null;return A=this._hi/n,l=v.SPLIT*A,i=l-A,g=v.SPLIT*n,i=l-i,o=A-i,a=g-n,c=A*n,a=g-a,s=n-a,g=i*a-c+i*s+o*a+o*s,l=(this._hi-c-g+this._lo-A*r)/n,g=A+l,this._hi=g,this._lo=A-g+l,this}},v.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},v.prototype.divide=function(){if(arguments[0]instanceof v){var e=arguments[0],t=null,n=null,r=null,i=null,o=null,a=null,s=null,A=null;n=(o=this._hi/e._hi)-(t=(a=v.SPLIT*o)-(t=a-o)),A=t*(r=(A=v.SPLIT*e._hi)-(r=A-e._hi))-(s=o*e._hi)+t*(i=e._hi-r)+n*r+n*i,a=(this._hi-s-A+this._lo-o*e._lo)/e._hi;return new v(A=o+a,o-A+a)}if("number"==typeof arguments[0]){var l=arguments[0];return C.isNaN(l)?v.createNaN():v.copy(this).selfDivide(l,0)}},v.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},v.prototype.pow=function(e){if(0===e)return v.valueOf(1);var t=new v(this),n=v.valueOf(1),r=Math.abs(e);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(t),(r/=2)>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n},v.prototype.ceil=function(){if(this.isNaN())return v.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new v(e,t)},v.prototype.compareTo=function(e){var t=e;return this._hit._hi?1:this._lot._lo?1:0},v.prototype.rint=function(){if(this.isNaN())return this;return this.add(.5).floor()},v.prototype.setValue=function(){if(arguments[0]instanceof v){var e=arguments[0];return this.init(e),this}if("number"==typeof arguments[0]){var t=arguments[0];return this.init(t),this}},v.prototype.max=function(e){return this.ge(e)?this:e},v.prototype.sqrt=function(){if(this.isZero())return v.valueOf(0);if(this.isNegative())return v.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=v.valueOf(t),r=this.subtract(n.sqr())._hi*(.5*e);return n.add(r)},v.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof v){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0],n=null,r=null,i=null,o=null,a=null,s=null;return i=this._hi+t,a=i-this._hi,o=i-a,o=t-a+(this._hi-o),s=o+this._lo,n=i+s,r=s+(i-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var A=arguments[0],l=arguments[1],c=null,g=null,u=null,d=null,h=null,p=null,f=null;d=this._hi+A,g=this._lo+l,h=d-(p=d-this._hi),u=g-(f=g-this._lo);var I=(c=d+(p=(h=A-p+(this._hi-h))+g))+(p=(u=l-f+(this._lo-u))+(p+(d-c))),C=p+(c-I);return this._hi=I,this._lo=C,this}},v.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof v){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,s=null,A=null,l=null;i=(A=v.SPLIT*this._hi)-this._hi,l=v.SPLIT*n,i=A-i,o=this._hi-i,a=l-n;var c=(A=this._hi*n)+(l=i*(a=l-a)-A+i*(s=n-a)+o*a+o*s+(this._hi*r+this._lo*n)),g=l+(i=A-c);return this._hi=c,this._lo=g,this}},v.prototype.selfSqr=function(){return this.selfMultiply(this)},v.prototype.floor=function(){if(this.isNaN())return v.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new v(e,t)},v.prototype.negate=function(){return this.isNaN()?this:new v(-this._hi,-this._lo)},v.prototype.clone=function(){},v.prototype.multiply=function(){if(arguments[0]instanceof v){var e=arguments[0];return e.isNaN()?v.createNaN():v.copy(this).selfMultiply(e)}if("number"==typeof arguments[0]){var t=arguments[0];return C.isNaN(t)?v.createNaN():v.copy(this).selfMultiply(t,0)}},v.prototype.isNaN=function(){return C.isNaN(this._hi)},v.prototype.intValue=function(){return Math.trunc(this._hi)},v.prototype.toString=function(){var e=v.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},v.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),r=t[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+v.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+v.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},v.prototype.reciprocal=function(){var e=null,t=null,n=null,r=null,i=null,o=null,a=null,s=null;t=(i=1/this._hi)-(e=(o=v.SPLIT*i)-(e=o-i)),n=(s=v.SPLIT*this._hi)-this._hi;var A=i+(o=(1-(a=i*this._hi)-(s=e*(n=s-n)-a+e*(r=this._hi-n)+t*n+t*r)-i*this._lo)/this._hi);return new v(A,i-A+o)},v.prototype.toSciNotation=function(){if(this.isZero())return v.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),r=v.SCI_NOT_EXPONENT_CHAR+t[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},v.prototype.abs=function(){return this.isNaN()?v.NaN:this.isNegative()?this.negate():new v(this)},v.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},v.prototype.lt=function(e){return(this._hie._hi||this._hi===e._hi)&&this._lo>e._lo},v.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},v.prototype.trunc=function(){return this.isNaN()?v.NaN:this.isPositive()?this.floor():this.ceil()},v.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},v.prototype.interfaces_=function(){return[e,te,ne]},v.prototype.getClass=function(){return v},v.sqr=function(e){return v.valueOf(e).selfMultiply(e)},v.valueOf=function(){if("string"==typeof arguments[0]){var e=arguments[0];return v.parse(e)}if("number"==typeof arguments[0]){var t=arguments[0];return new v(t)}},v.sqrt=function(e){return v.valueOf(e).sqrt()},v.parse=function(e){for(var t=0,n=e.length;ue.isWhitespace(e.charAt(t));)t++;var r=!1;if(t=n);){var l=e.charAt(t);if(t++,ue.isDigit(l)){var c=l-"0";o.selfMultiply(v.TEN),o.selfAdd(c),a++}else{if("."!==l){if("e"===l||"E"===l){var g=e.substring(t);try{A=ge.parseInt(g)}catch(t){throw t instanceof Error?new Error("Invalid exponent "+g+" in string "+e):t}break}throw new Error("Unexpected character '"+l+"' at position "+t+" in string "+e)}s=a}}var u=o,d=a-s-A;if(0===d)u=o;else if(d>0){var h=v.TEN.pow(d);u=o.divide(h)}else if(d<0){var p=v.TEN.pow(-d);u=o.multiply(p)}return r?u.negate():u},v.createNaN=function(){return new v(C.NaN,C.NaN)},v.copy=function(e){return new v(e)},v.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=t&&(r+=1),r},v.stringOfChar=function(e,t){for(var n=new ce,r=0;r0){if(o<=0)return he.signum(a);r=i+o}else{if(!(i<0))return he.signum(a);if(o>=0)return he.signum(a);r=-i-o}var s=he.DP_SAFE_EPSILON*r;return a>=s||-a>=s?he.signum(a):2},he.signum=function(e){return e>0?1:e<0?-1:0},pe.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(he,pe),function(){}),fe={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}},Ie=(fe.X.get=function(){return 0},fe.Y.get=function(){return 1},fe.Z.get=function(){return 2},fe.M.get=function(){return 3},E.prototype.setOrdinate=function(e,t,n){},E.prototype.size=function(){},E.prototype.getOrdinate=function(e,t){},E.prototype.getCoordinate=function(){},E.prototype.getCoordinateCopy=function(e){},E.prototype.getDimension=function(){},E.prototype.getX=function(e){},E.prototype.clone=function(){},E.prototype.expandEnvelope=function(e){},E.prototype.copy=function(){},E.prototype.getY=function(e){},E.prototype.toCoordinateArray=function(){},E.prototype.interfaces_=function(){return[ne]},E.prototype.getClass=function(){return E},Object.defineProperties(E,fe),function(){}),Ce=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ie),me=function(){},ye=(me.arraycopy=function(e,t,n,r,i){for(var o=0,a=t;ae._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,r=this._maxx=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&(n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy)}},Q.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Q){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e._minx>this._maxx||e._maxxthis._maxy||e._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=t._maxx),t._minythis._maxy&&(this._maxy=t._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},Q.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return et._minx?1:this._minyt._miny?1:this._maxxt._maxx?1:this._maxyt._maxy?1:0},Q.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},Q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Q.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t},Q.prototype.expandBy=function(){if(1===arguments.length){var e=arguments[0];this.expandBy(e,e)}else if(2===arguments.length){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Q.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Q){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof B){var t=arguments[0];return this.covers(t)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Q.prototype.centre=function(){return this.isNull()?null:new B((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Q.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof B){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];ie._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxye._maxy&&(n=this._miny-e._maxy),0===t?n:0===n?t:Math.sqrt(t*t+n*n)},Q.prototype.hashCode=function(){var e=17;return e=37*e+B.hashCode(this._minx),e=37*e+B.hashCode(this._maxx),e=37*e+B.hashCode(this._miny),e=37*e+B.hashCode(this._maxy)},Q.prototype.interfaces_=function(){return[te,e]},Q.prototype.getClass=function(){return Q},Q.intersects=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.xt.x?e.x:t.x)&&n.y>=(e.yt.y?e.y:t.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),A=Math.max(o.x,a.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>A)&&(!(cA)&&!(cthis.getEdgeDistance(e,1)?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},A.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},A.prototype.setPrecisionModel=function(e){this._precisionModel=e},A.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],t=0;ti?r:i;else{var a=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);0!==(o=r>i?a:s)||e.equals(t)||(o=Math.max(a,s))}return w.isTrue(!(0===o&&!e.equals(t)),"Bad distance calculation"),o},A.nonRobustComputeEdgeDistance=function(e,t,n){var r=e.x-t.x,i=e.y-t.y,o=Math.sqrt(r*r+i*i);return w.isTrue(!(0===o&&!e.equals(t)),"Invalid distance calculation"),o},xe.DONT_INTERSECT.get=function(){return 0},xe.DO_INTERSECT.get=function(){return 1},xe.COLLINEAR.get=function(){return 2},xe.NO_INTERSECTION.get=function(){return 0},xe.POINT_INTERSECTION.get=function(){return 1},xe.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(A,xe),function(A){function e(){A.apply(this,arguments)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(e){var t=new Q(this._inputLines[0][0],this._inputLines[0][1]),n=new Q(this._inputLines[1][0],this._inputLines[1][1]);return t.contains(e)&&n.contains(e)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return A.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],t=arguments[1],n=arguments[2];if(this._isProper=!1,Q.intersects(t,n,e)&&0===S.orientationIndex(t,n,e)&&0===S.orientationIndex(n,t,e))return this._isProper=!0,(e.equals(t)||e.equals(n))&&(this._isProper=!1),this._result=A.POINT_INTERSECTION,null;this._result=A.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(e,t,n,r,i){i.x=this.smallestInAbsValue(e.x,t.x,n.x,r.x),i.y=this.smallestInAbsValue(e.y,t.y,n.y,r.y),e.x-=i.x,e.y-=i.y,t.x-=i.x,t.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(n,r,i,o){var a=null;try{a=ye.intersection(n,r,i,o)}catch(t){if(!(t instanceof Ce))throw t;a=e.nearestEndpoint(n,r,i,o)}return a},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new B(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(e,t,n,r){var i=e,o=Math.abs(i);return Math.abs(t)1e-4&&me.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(e,t,n,r){var i=new B(e),o=new B(t),a=new B(n),s=new B(r),A=new B;this.normalizeToEnvCentre(i,o,a,s,A);var l=this.safeHCoordinateIntersection(i,o,a,s);return l.x+=A.x,l.y+=A.y,l},e.prototype.computeCollinearIntersection=function(e,t,n,r){var i=Q.intersects(e,t,n),o=Q.intersects(e,t,r),a=Q.intersects(n,r,e),s=Q.intersects(n,r,t);return i&&o?(this._intPt[0]=n,this._intPt[1]=r,A.COLLINEAR_INTERSECTION):a&&s?(this._intPt[0]=e,this._intPt[1]=t,A.COLLINEAR_INTERSECTION):i&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||s?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):i&&s?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||a?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||i||s?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||i||a?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):A.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(e,t,n,r,i){var o=e.xt.x?e.x:t.x,A=e.y>t.y?e.y:t.y,l=n.xr.x?n.x:r.x,u=n.y>r.y?n.y:r.y,d=((o>l?o:l)+(sc?a:c)+(A0&&o>0||i<0&&o<0)return A.NO_INTERSECTION;var a=S.orientationIndex(n,r,e),s=S.orientationIndex(n,r,t);if(a>0&&s>0||a<0&&s<0)return A.NO_INTERSECTION;return 0===i&&0===o&&0===a&&0===s?this.computeCollinearIntersection(e,t,n,r):(0===i||0===o||0===a||0===s?(this._isProper=!1,e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:t.equals2D(n)||t.equals2D(r)?this._intPt[0]=t:0===i?this._intPt[0]=new B(n):0===o?this._intPt[0]=new B(r):0===a?this._intPt[0]=new B(e):0===s&&(this._intPt[0]=new B(t))):(this._isProper=!0,this._intPt[0]=this.intersection(e,t,n,r)),A.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(e,t,n,r){var i=e,o=S.distancePointLine(e,n,r),a=S.distancePointLine(t,n,r);return a0?n>0?-i:i:n>0?i:-i;if(0===t||0===n)return r>0?e>0?i:-i:e>0?-i:i;if(t>0?r>0?t<=r||(i=-i,o=e,e=n,n=o,o=t,t=r,r=o):t<=-r?(i=-i,n=-n,r=-r):(o=e,e=-n,n=o,o=t,t=-r,r=o):r>0?-t<=r?(i=-i,e=-e,t=-t):(o=-e,e=n,n=o,o=-t,t=r,r=o):t>=r?(e=-e,t=-t,n=-n,r=-r):(i=-i,o=-e,e=-n,n=o,o=-t,t=-r,r=o),e>0){if(!(n>0))return i;if(!(e<=n))return i}else{if(n>0)return-i;if(!(e>=n))return-i;i=-i,e=-e,n=-n}for(;;){if(a=Math.floor(n/e),n-=a*e,(r-=a*t)<0)return-i;if(r>t)return i;if(e>n+n){if(tr+r)return-i;n=e-n,r=t-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if(a=Math.floor(e/n),e-=a*n,(t-=a*r)<0)return i;if(t>r)return-i;if(n>e+e){if(rt+t)return i;e=n-e,t=r-t,i=-i}if(0===t)return 0===e?0:i;if(0===e)return-i}},function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e}),S=(De.prototype.countSegment=function(e,t){if(e.xr&&(n=t.x,r=e.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var i=e.x-this._p.x,o=e.y-this._p.y,a=t.x-this._p.x,s=t.y-this._p.y,A=Fe.signOfDet2x2(i,o,a,s);if(0===A)return this._isPointOnSegment=!0,null;s0&&this._crossingCount++}},De.prototype.isPointInPolygon=function(){return this.getLocation()!==m.EXTERIOR},De.prototype.getLocation=function(){return this._isPointOnSegment?m.BOUNDARY:this._crossingCount%2==1?m.INTERIOR:m.EXTERIOR},De.prototype.isOnSegment=function(){return this._isPointOnSegment},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.locatePointInRing=function(){if(arguments[0]instanceof B&&b(arguments[1],E)){for(var e=arguments[0],t=arguments[1],n=new De(e),r=new B,i=new B,o=1;o1||s<0||s>1)&&(i=!0)}}else i=!0;return i?Ae.min(S.distancePointLine(e,n,r),S.distancePointLine(t,n,r),S.distancePointLine(n,e,t),S.distancePointLine(r,e,t)):0},S.isPointInRing=function(e,t){return S.locatePointInRing(e,t)!==m.EXTERIOR},S.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,r=new B;e.getCoordinate(0,r);for(var i=r.x,o=r.y,a=1;an.y&&(n=o,r=i)}var a=r;do{(a-=1)<0&&(a=t)}while(e[a].equals2D(n)&&a!==r);var s=r;do{s=(s+1)%t}while(e[s].equals2D(n)&&s!==r);var A=e[a],l=e[s];if(A.equals2D(n)||l.equals2D(n)||A.equals2D(l))return!1;var c=S.computeOrientation(A,n,l),g=!1;return g=0===c?A.x>l.x:c>0,g},S.locatePointInRing=function(e,t){return De.locatePointInRing(e,t)},S.distancePointLinePerpendicular=function(e,t,n){var r=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),i=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/r;return Math.abs(i)*Math.sqrt(r)},S.computeOrientation=function(e,t,n){return S.orientationIndex(e,t,n)},S.distancePointLine=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];if(0===t.length)throw new I("Line array must contain at least one vertex");for(var n=e.distance(t[0]),r=0;r=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/A;return Math.abs(c)*Math.sqrt(A)}},S.isOnLine=function(e,t){for(var n=new Re,r=1;r0},Pe.prototype.interfaces_=function(){return[Ue]},Pe.prototype.getClass=function(){return Pe},function(){}),Ze=(Ve.prototype.isInBoundary=function(e){return e>1},Ve.prototype.interfaces_=function(){return[Ue]},Ve.prototype.getClass=function(){return Ve},function(){}),We=(Ze.prototype.isInBoundary=function(e){return 1===e},Ze.prototype.interfaces_=function(){return[Ue]},Ze.prototype.getClass=function(){return Ze},function(){}),He=(We.prototype.add=function(){},We.prototype.addAll=function(){},We.prototype.isEmpty=function(){},We.prototype.iterator=function(){},We.prototype.size=function(){},We.prototype.toArray=function(){},We.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException",function(){}),je=(He.prototype.hasNext=function(){},He.prototype.next=function(){},He.prototype.remove=function(){},function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(We)),x=((i.prototype=new Error).name="NoSuchElementException",function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof We&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,We]},e.prototype.add=function(e){return 1===arguments.length?this.array_.push(e):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},e.prototype.set=function(e,t){var n=this.array_[e];return this.array_[e]=t,n},e.prototype.iterator=function(){return new Ye(this)},e.prototype.get=function(e){if(e<0||e>=this.size())throw new n;return this.array_[e]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var e=[],t=0,n=this.array_.length;t=1)if(this.get(this.size()-1).equals2D(r))return null;m.prototype.add.call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1];return this.add(i,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],s=arguments[1];if(arguments[2])for(var A=0;A=0;l--)this.add(a[l],s);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof B){var c=arguments[0],g=arguments[1];if(!arguments[2]){var u=this.size();if(u>0){if(c>0)if(this.get(c-1).equals2D(g))return null;if(cf&&(I=-1);for(var C=p;C!==f;C+=I)this.add(d[C],h);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new B(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(x),R=function(){},Je={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}},Ke=(Je.ForwardComparator.get=function(){return Ke},Je.BidirectionalComparator.get=function(){return Xe},Je.coordArrayType.get=function(){return new Array(0).fill(null)},R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.isRing=function(e){return!(e.length<4)&&!!e[0].equals2D(e[e.length-1])},R.ptNotInList=function(e,t){for(var n=0;n=e?t:[]},R.indexOf=function(e,t){for(var n=0;n0)&&(t=e[n]);return t},R.extract=function(e,t,n){t=Ae.clamp(t,0,e.length);var r=(n=Ae.clamp(n,-1,e.length))-t+1;n<0&&(r=0),t>=e.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=R.compare(n,r);return R.isEqualReversed(n,r)?0:i},Xe.prototype.OLDcompare=function(e,t){var n=e,r=t;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=R.increasingDirection(n),o=R.increasingDirection(r),a=i>0?0:n.length-1,s=o>0?0:n.length-1,A=0;A0))return t.value;t=t.right}}return null},p.prototype.put=function(e,t){if(null===this.root_)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:nt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=e.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=t,o}i=i.right}}while(null!==i);var a={key:e,left:null,right:null,value:t,parent:n,color:nt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null},p.prototype.fixAfterInsertion=function(e){for(e.color=1;null!=e&&e!==this.root_&&1===e.parent.color;)if(a(e)===l(a(a(e)))){var t=c(a(a(e)));1===s(t)?(u(a(e),nt),u(t,nt),u(a(a(e)),1),e=a(a(e))):(e===c(a(e))&&(e=a(e),this.rotateLeft(e)),u(a(e),nt),u(a(a(e)),1),this.rotateRight(a(a(e))))}else{var n=l(a(a(e)));1===s(n)?(u(a(e),nt),u(n,nt),u(a(a(e)),1),e=a(a(e))):(e===l(a(e))&&(e=a(e),this.rotateRight(e)),u(a(e),nt),u(a(a(e)),1),this.rotateLeft(a(a(e))))}this.root_.color=nt},p.prototype.values=function(){var e=new x,t=this.getFirstEntry();if(null!==t)for(e.add(t.value);null!==(t=p.successor(t));)e.add(t.value);return e},p.prototype.entrySet=function(){var e=new et,t=this.getFirstEntry();if(null!==t)for(e.add(t);null!==(t=p.successor(t));)e.add(t);return e},p.prototype.rotateLeft=function(e){if(null!=e){var t=e.right;e.right=t.left,null!=t.left&&(t.left.parent=e),t.parent=e.parent,null===e.parent?this.root_=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}},p.prototype.rotateRight=function(e){if(null!=e){var t=e.left;e.left=t.right,null!=t.right&&(t.right.parent=e),t.parent=e.parent,null===e.parent?this.root_=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}},p.prototype.getFirstEntry=function(){var e=this.root_;if(null!=e)for(;null!=e.left;)e=e.left;return e},p.successor=function(e){if(null===e)return null;if(null!==e.right){for(var t=e.right;null!==t.left;)t=t.left;return t}for(var n=e.parent,r=e;null!==n&&r===n.right;)r=n,n=n.parent;return n},p.prototype.size=function(){return this.size_},function(){}),it=(rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},h.prototype=new o,(f.prototype=new h).contains=function(e){for(var t=0,n=this.array_.length;t=0;){var a=i.substring(0,o);r.add(a),o=(i=i.substring(o+n)).indexOf(t)}i.length>0&&r.add(i);for(var s=new Array(r.size()).fill(null),A=0;A0)for(var o=i;o0&&r.append(" ");for(var o=0;o0&&r.append(","),r.append(dt.toString(e.getOrdinate(i,o)))}return r.append(")"),r.toString()}},D.ensureValidRing=function(e,t){var n=t.size();if(0===n)return t;if(n<=3)return D.createClosedRing(e,t,4);return t.getOrdinate(0,E.X)===t.getOrdinate(n-1,E.X)&&t.getOrdinate(0,E.Y)===t.getOrdinate(n-1,E.Y)?t:D.createClosedRing(e,t,n+1)},D.createClosedRing=function(e,t,n){var r=e.create(n,t.getDimension()),i=t.size();D.copy(t,0,r,0,i);for(var o=i;o0&&D.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?F.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return S.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var e=this._points.copy();D.reverse(e);return this.getFactory().createLineString(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var e=arguments[0],t=0,n=0;t= 2)");this._points=e},e.prototype.isCoordinate=function(e){for(var t=0;t=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}(G),Bt=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return _.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&n.prototype.equalsExact.call(this,e,t)}return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var e=this._geometries.length,t=new Array(e).fill(null),n=0;n0?t.createPoint(n[0]):t.createPoint():e},Qt.prototype.interfaces_=function(){return[bt.GeometryEditorOperation]},Qt.prototype.getClass=function(){return Qt},function(){}),N=(wt.prototype.edit=function(e,t){return e instanceof yt?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof G?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof ft?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},wt.prototype.interfaces_=function(){return[bt.GeometryEditorOperation]},wt.prototype.getClass=function(){return wt},function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var t=0;t0){var e=new ce(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var t=1;t3&&(r=3),r<2?new N(n):new N(n,r)}},_t.prototype.interfaces_=function(){return[ae,e]},_t.prototype.getClass=function(){return _t},_t.instance=function(){return _t.instanceObject},xt.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},xt.instanceObject.get=function(){return new _t},Object.defineProperties(_t,xt),function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(e){return this.map_.get(e)||null},e.prototype.put=function(e,t){return this.map_.set(e,t),t},e.prototype.values=function(){for(var e=new x,t=this.map_.values(),n=t.next();!n.done;)e.add(n.value),n=t.next();return e},e.prototype.entrySet=function(){var t=new et;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(qe)),k=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof Dt){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},Ft={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}},Dt=(k.prototype.equals=function(e){if(!(e instanceof k))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},k.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new ge(n).compareTo(new ge(r))},k.prototype.getScale=function(){return this._scale},k.prototype.isFloating=function(){return this._modelType===k.FLOATING||this._modelType===k.FLOATING_SINGLE},k.prototype.getType=function(){return this._modelType},k.prototype.toString=function(){var e="UNKNOWN";return this._modelType===k.FLOATING?e="Floating":this._modelType===k.FLOATING_SINGLE?e="Floating-Single":this._modelType===k.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},k.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var e=arguments[0];if(C.isNaN(e))return e;if(this._modelType===k.FLOATING_SINGLE)return e;return this._modelType===k.FIXED?Math.round(e*this._scale)/this._scale:e}if(arguments[0]instanceof B){var t=arguments[0];if(this._modelType===k.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}},k.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===k.FLOATING?e=16:this._modelType===k.FLOATING_SINGLE?e=6:this._modelType===k.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},k.prototype.setScale=function(e){this._scale=Math.abs(e)},k.prototype.interfaces_=function(){return[e,te]},k.prototype.getClass=function(){return k},k.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t},Ft.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},Ft.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(k,Ft),function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)}),Gt={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}},T=(Dt.prototype.readResolve=function(){return Dt.nameToTypeMap.get(this._name)},Dt.prototype.toString=function(){return this._name},Dt.prototype.interfaces_=function(){return[e]},Dt.prototype.getClass=function(){return Dt},Gt.serialVersionUID.get=function(){return-552860263173159e4},Gt.nameToTypeMap.get=function(){return new Rt},Object.defineProperties(Dt,Gt),k.Type=Dt,k.FIXED=new Dt("FIXED"),k.FLOATING=new Dt("FLOATING"),k.FLOATING_SINGLE=new Dt("FLOATING SINGLE"),function t(){this._precisionModel=new k,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?b(arguments[0],ae)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof k&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))}),Nt={serialVersionUID:{configurable:!0}},kt=(T.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new B(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new B(e.getMinX(),e.getMinY()),new B(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new B(e.getMinX(),e.getMinY()),new B(e.getMinX(),e.getMaxY()),new B(e.getMaxX(),e.getMaxY()),new B(e.getMaxX(),e.getMinY()),new B(e.getMinX(),e.getMinY())]),null)},T.prototype.createLineString=function(e){return e?e instanceof Array?new G(this.getCoordinateSequenceFactory().create(e),this):b(e,E)?new G(e,this):void 0:new G(this.getCoordinateSequenceFactory().create([]),this)},T.prototype.createMultiLineString=function(){if(0===arguments.length)return new ct(null,this);if(1===arguments.length){var e=arguments[0];return new ct(e,this)}},T.prototype.buildGeometry=function(e){for(var t=null,n=!1,r=!1,i=e.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===t&&(t=a),a!==t&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===t)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(T.toGeometryArray(e));var s=e.iterator().next();if(e.size()>1){if(s instanceof Ct)return this.createMultiPolygon(T.toPolygonArray(e));if(s instanceof G)return this.createMultiLineString(T.toLineStringArray(e));if(s instanceof ft)return this.createMultiPoint(T.toPointArray(e));w.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},T.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)},T.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof B){var e=arguments[0];return this.createPoint(null!==e?this.getCoordinateSequenceFactory().create([e]):null)}if(b(arguments[0],E)){var t=arguments[0];return new ft(t,this)}}},T.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},T.prototype.createPolygon=function(){if(0===arguments.length)return new Ct(null,null,this);if(1===arguments.length){if(b(arguments[0],E)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof yt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new Ct(r,i,this)}},T.prototype.getSRID=function(){return this._SRID},T.prototype.createGeometryCollection=function(){if(0===arguments.length)return new lt(null,this);if(1===arguments.length){var e=arguments[0];return new lt(e,this)}},T.prototype.createGeometry=function(e){return new bt(this).edit(e,{edit:function(){if(2===arguments.length){var e=arguments[0];return this._coordinateSequenceFactory.create(e)}}})},T.prototype.getPrecisionModel=function(){return this._precisionModel},T.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(b(arguments[0],E)){var t=arguments[0];return new yt(t,this)}}},T.prototype.createMultiPolygon=function(){if(0===arguments.length)return new Bt(null,this);if(1===arguments.length){var e=arguments[0];return new Bt(e,this)}},T.prototype.createMultiPoint=function(){if(0===arguments.length)return new mt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return new mt(e,this)}if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(b(arguments[0],E)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i=this.size())throw new Error;return this.array_[e]},y.prototype.push=function(e){return this.array_.push(e),e},y.prototype.pop=function(e){if(0===this.array_.length)throw new d;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(e){return this.array_.indexOf(e)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var e=[],t=0,n=this.array_.length;t0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===S.CLOCKWISE&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Vt.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge().getCoordinates();if(t<0||t+1>=n.length)return-1;if(n[t].y===n[t+1].y)return-1;var r=M.LEFT;return n[t].ythis._minCoord.x)&&(this._minDe=e,this._minIndex=n,this._minCoord=t[n])},Vt.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode().getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Vt.prototype.findEdge=function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.isForward()&&this.checkForRightmostCoordinate(n)}w.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;this.getRightmostSide(this._minDe,this._minIndex)===M.LEFT&&(this._orientedDe=this._minDe.getSym())},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},function(r){function e(t,n){r.call(this,e.msgWithCoord(t,n)),this.pt=n?new B(n):null,this.name="TopologyException"}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(e,t){return t?e:e+" [ "+t+" ]"},e}(Se)),Wt=function(){this.array_=[]},Ht=(Wt.prototype.addLast=function(e){this.array_.push(e)},Wt.prototype.removeFirst=function(){return this.array_.shift()},Wt.prototype.isEmpty=function(){return 0===this.array_.length},function(){this._finder=null,this._dirEdgeList=new x,this._nodes=new x,this._rightMostCoord=null,this._env=null,this._finder=new Vt}),U=(Ht.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();)e.next().setVisited(!1)},Ht.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ht.prototype.computeNodeDepth=function(e){for(var t=null,n=e.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){t=r;break}}if(null===t)throw new Zt("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(t);for(var i=e.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ht.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(M.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},Ht.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ht.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(M.RIGHT)>=1&&t.getDepth(M.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},Ht.prototype.computeDepths=function(e){var t=new et,n=new Wt,r=e.getNode();for(n.addLast(r),t.add(r),e.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();t.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();t.contains(s)||(n.addLast(s),t.add(s))}}}},Ht.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.xt._rightMostCoord.x?1:0},Ht.prototype.getEnvelope=function(){if(null===this._env){for(var e=new Q,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next().getEdge().getCoordinates(),r=0;rthis.location.length){var t=new Array(3).fill(null);t[M.ON]=this.location[M.ON],t[M.LEFT]=m.NONE,t[M.RIGHT]=m.NONE,this.location=t}for(var n=0;n1&&e.append(m.toLocationSymbol(this.location[M.LEFT])),e.append(m.toLocationSymbol(this.location[M.ON])),this.location.length>1&&e.append(m.toLocationSymbol(this.location[M.RIGHT])),e.toString()},U.prototype.setLocations=function(e,t,n){this.location[M.ON]=e,this.location[M.LEFT]=t,this.location[M.RIGHT]=n},U.prototype.get=function(e){return e1},U.prototype.isAnyNull=function(){for(var e=0;ethis._maxNodeDegree&&(this._maxNodeDegree=t),e=this.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},L.prototype.addPoints=function(e,t,n){var r=e.getCoordinates();if(t){var i=1;n&&(i=0);for(var o=i;o=0;s--)this._pts.add(r[s])}},L.prototype.isHole=function(){return this._isHole},L.prototype.setInResult=function(){var e=this._startDe;do{e.getEdge().setInResult(!0),e=e.getNext()}while(e!==this._startDe)},L.prototype.containsPoint=function(e){var t=this.getLinearRing();if(!t.getEnvelopeInternal().contains(e))return!1;if(!S.isPointInRing(e,t.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(e))return!1;return!0},L.prototype.addHole=function(e){this._holes.add(e)},L.prototype.isShell=function(){return null===this._shell},L.prototype.getLabel=function(){return this._label},L.prototype.getEdges=function(){return this._edges},L.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},L.prototype.getShell=function(){return this._shell},L.prototype.mergeLabel=function(){if(1===arguments.length){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(2===arguments.length){var t=arguments[0],n=arguments[1],r=t.getLocation(n,M.RIGHT);if(r===m.NONE)return null;if(this._label.getLocation(n)===m.NONE)return this._label.setLocation(n,r),null}},L.prototype.setShell=function(e){this._shell=e,null!==e&&e.addHole(this)},L.prototype.toPolygon=function(e){for(var t=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(e)},zt.prototype.isInResult=function(){return this._isInResult},zt.prototype.isVisited=function(){return this._isVisited},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},function(n){function e(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],t=arguments[1];this._coord=e,this._edges=t,this._label=new O(0,m.NONE)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var e=this.getEdges().getEdges().iterator();e.hasNext();)if(e.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(e){e.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(e){},e.prototype.computeMergedLocation=function(e,t){var n=m.NONE;if(n=this._label.getLocation(t),!e.isNull(t)){var r=e.getLocation(t);n!==m.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return n.prototype.setLabel.apply(this,arguments);var e=arguments[0],t=arguments[1];null===this._label?this._label=new O(e,t):this._label.setLocation(e,t)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof O)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===m.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(e){this._edges.insert(e),e.setNode(this)},e.prototype.setLabelBoundary=function(e){if(null===this._label)return null;var t=m.NONE;null!==this._label&&(t=this._label.getLocation(e));var n=null;switch(t){case m.BOUNDARY:n=m.INTERIOR;break;case m.INTERIOR:default:n=m.BOUNDARY}this._label.setLocation(e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zt)),Kt=function(){this.nodeMap=new p,this.nodeFact=null;var e=arguments[0];this.nodeFact=e},P=(Kt.prototype.find=function(e){return this.nodeMap.get(e)},Kt.prototype.addNode=function(){if(arguments[0]instanceof B){var e=arguments[0],t=this.nodeMap.get(e);return null===t&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}if(arguments[0]instanceof Jt){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Kt.prototype.print=function(e){for(var t=this.iterator();t.hasNext();)t.next().print(e)},Kt.prototype.iterator=function(){return this.nodeMap.values().iterator()},Kt.prototype.values=function(){return this.nodeMap.values()},Kt.prototype.getBoundaryNodes=function(e){for(var t=new x,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(e)===m.BOUNDARY&&t.add(r)}return t},Kt.prototype.add=function(e){var t=e.getCoordinate();this.addNode(t).add(e)},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},function(){}),Xt={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}},qt=(P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.isNorthern=function(e){return e===P.NE||e===P.NW},P.isOpposite=function(e,t){if(e===t)return!1;return 2===(e-t+4)%4},P.commonHalfPlane=function(e,t){if(e===t)return e;if(2===(e-t+4)%4)return-1;var n=et?e:t)?3:n},P.isInHalfPlane=function(e,t){return t===P.SE?e===P.SE||e===P.SW:e===t||e===t+1},P.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1];if(0===e&&0===t)throw new I("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?P.NE:P.SE:t>=0?P.NW:P.SW}if(arguments[0]instanceof B&&arguments[1]instanceof B){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new I("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?P.NE:P.SE:r.y>=n.y?P.NW:P.SW}},Xt.NE.get=function(){return 0},Xt.NW.get=function(){return 1},Xt.SW.get=function(){return 2},Xt.SE.get=function(){return 3},Object.defineProperties(P,Xt),function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var e=arguments[0];this._edge=e}else if(3===arguments.length){var t=arguments[0],n=arguments[1],r=arguments[2];this._edge=t,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}}),$t=(qt.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),t.add(s)):n.addAll(a)}else r.add(o)}return r},tn.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();)if(t.next().containsPoint(e))return!0;return!1},tn.prototype.buildMaximalEdgeRings=function(e){for(var t=new x,n=e.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Yt(r,this._geometryFactory);t.add(i),i.setInResult()}}return t},tn.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(e)}},tn.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},tn.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,a=null,s=t.iterator();s.hasNext();){var A=s.next(),l=A.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var g=!1;c.contains(r)&&S.isPointInRing(i,l.getCoordinates())&&(g=!0),g&&(null===o||a.contains(c))&&(o=A)}return o},tn.prototype.findShell=function(e){for(var t=0,n=null,r=e.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,t++)}return w.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n},tn.prototype.add=function(){if(1===arguments.length){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(2===arguments.length){var t=arguments[0],n=arguments[1];V.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(t),i=new x,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn},function(){}),rn=(nn.prototype.getBounds=function(){},nn.prototype.interfaces_=function(){return[]},nn.prototype.getClass=function(){return nn},function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t}),on=(rn.prototype.getItem=function(){return this._item},rn.prototype.getBounds=function(){return this._bounds},rn.prototype.interfaces_=function(){return[nn,e]},rn.prototype.getClass=function(){return rn},function(){this._size=null,this._items=null,this._size=0,this._items=new x,this._items.add(null)}),an=(on.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},on.prototype.size=function(){return this._size},on.prototype.reorder=function(e){for(var t=null,n=this._items.get(e);2*e<=this._size&&((t=2*e)!==this._size&&this._items.get(t+1).compareTo(this._items.get(t))<0&&t++,this._items.get(t).compareTo(n)<0);e=t)this._items.set(e,this._items.get(t));this._items.set(e,n)},on.prototype.clear=function(){this._size=0,this._items.clear()},on.prototype.isEmpty=function(){return 0===this._size},on.prototype.add=function(e){this._items.add(null),this._size+=1;var t=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(t/2)))<0;t/=2)this._items.set(t,this._items.get(Math.trunc(t/2)));this._items.set(t,e)},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},function(){}),sn=(an.prototype.visitItem=function(e){},an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},function(){}),An=(sn.prototype.insert=function(e,t){},sn.prototype.remove=function(e,t){},sn.prototype.query=function(){},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},function(){if(this._childBoundables=new x,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this._level=e}}),ln={serialVersionUID:{configurable:!0}},cn=(An.prototype.getLevel=function(){return this._level},An.prototype.size=function(){return this._childBoundables.size()},An.prototype.getChildBoundables=function(){return this._childBoundables},An.prototype.addChildBoundable=function(e){w.isTrue(null===this._bounds),this._childBoundables.add(e)},An.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},An.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},An.prototype.interfaces_=function(){return[nn,e]},An.prototype.getClass=function(){return An},ln.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(An,ln),function(){}),gn=(cn.reverseOrder=function(){return{compare:function(e,t){return t.compareTo(e)}}},cn.min=function(e){return cn.sort(e),e.get(0)},cn.sort=function(e,t){var n=e.toArray();t?ot.sort(n,t):ot.sort(n);for(var r=e.iterator(),i=0,o=n.length;ign.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(r)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new I("neither boundable is composite")},gn.prototype.isLeaves=function(){return!(gn.isComposite(this._boundable1)||gn.isComposite(this._boundable2))},gn.prototype.compareTo=function(e){var t=e;return this._distancet._distance?1:0},gn.prototype.expand=function(e,t,n,r){for(var i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new gn(o,t,this._itemDistance);a.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}}),dn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}},hn=(un.prototype.getNodeCapacity=function(){return this._nodeCapacity},un.prototype.lastNode=function(e){return e.get(e.size()-1)},un.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var e=0,t=arguments[0].getChildBoundables().iterator();t.hasNext();){var n=t.next();n instanceof An?e+=this.size(n):n instanceof rn&&(e+=1)}return e}},un.prototype.removeItem=function(e,t){for(var n=null,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof rn&&i.getItem()===t&&(n=i)}return null!==n&&(e.getChildBoundables().remove(n),!0)},un.prototype.itemsTree=function(){if(0===arguments.length){this.build();var e=this.itemsTree(this._root);return null===e?new x:e}if(1===arguments.length){for(var t=arguments[0],n=new x,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof An){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof rn?n.add(i.getItem()):w.shouldNeverReachHere()}return n.size()<=0?null:n}},un.prototype.insert=function(e,t){w.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new rn(e,t))},un.prototype.boundablesAtLevel=function(){if(1===arguments.length){var e=arguments[0],t=new x;return this.boundablesAtLevel(e,this._root,t),t}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(w.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof An?this.boundablesAtLevel(n,a,i):(w.isTrue(a instanceof rn),-1===n&&i.add(a))}return null}},un.prototype.query=function(){if(1===arguments.length){var e=arguments[0];this.build();var t=new x;return this.isEmpty()?t:(this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,t),t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(b(arguments[2],an)&&arguments[0]instanceof Object&&arguments[1]instanceof An)for(var i=arguments[0],o=arguments[1],a=arguments[2],s=o.getChildBoundables(),A=0;Ae&&(e=r)}}return e+1}},un.prototype.createParentBoundables=function(e,t){w.isTrue(!e.isEmpty());var n=new x;n.add(this.createNode(t));var r=new x(e);cn.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(t)),this.lastNode(n).addChildBoundable(o)}return n},un.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},un.prototype.interfaces_=function(){return[e]},un.prototype.getClass=function(){return un},un.compareDoubles=function(e,t){return e>t?1:e0);for(var n=new x,r=0;r0;){var g=c.poll(),u=g.getDistance();if(u>=A)break;g.isLeaves()?(A=u,l=g):g.expandToQueue(c,A)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var d=arguments[0],h=arguments[1],p=arguments[2],f=new rn(d,h),I=new gn(this.getRoot(),f,p);return this.nearestNeighbour(I)[0]}},n.prototype.interfaces_=function(){return[sn,e]},n.prototype.getClass=function(){return n},n.centreX=function(e){return n.avg(e.getMinX(),e.getMaxX())},n.avg=function(e,t){return(e+t)/2},n.centreY=function(e){return n.avg(e.getMinY(),e.getMaxY())},t.STRtreeNode.get=function(){return In},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[re]},compare:function(e,t){return l.compareDoubles(n.centreX(e.getBounds()),n.centreX(t.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[re]},compare:function(e,t){return l.compareDoubles(n.centreY(e.getBounds()),n.centreY(t.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[l.IntersectsOp]},intersects:function(e,t){return e.intersects(t)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,t),n}(un)),In=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var e=null,t=this.getChildBoundables().iterator();t.hasNext();){var n=t.next();null===e?e=new Q(n.getBounds()):e.expandToInclude(n.getBounds())}return e},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(An),Cn=function(){},mn=(Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.relativeSign=function(e,t){return et?1:0},Cn.compare=function(e,t,n){if(t.equals2D(n))return 0;var r=Cn.relativeSign(t.x,n.x),i=Cn.relativeSign(t.y,n.y);switch(e){case 0:return Cn.compareValue(r,i);case 1:return Cn.compareValue(i,r);case 2:return Cn.compareValue(i,-r);case 3:return Cn.compareValue(-r,i);case 4:return Cn.compareValue(-r,-i);case 5:return Cn.compareValue(-i,-r);case 6:return Cn.compareValue(-i,r);case 7:return Cn.compareValue(r,-i)}return w.shouldNeverReachHere("invalid octant value"),0},Cn.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0},function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];this._segString=e,this.coord=new B(t),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!t.equals2D(e.getCoordinate(n))}),yn=(mn.prototype.getCoordinate=function(){return this.coord},mn.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},mn.prototype.compareTo=function(e){var t=e;return this.segmentIndext.segmentIndex?1:this.coord.equals2D(t.coord)?0:Cn.compare(this._segmentOctant,this.coord,t.coord)},mn.prototype.isEndPoint=function(e){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===e},mn.prototype.isInterior=function(){return this._isInterior},mn.prototype.interfaces_=function(){return[te]},mn.prototype.getClass=function(){return mn},function(){this._nodeMap=new p,this._edge=null;var e=arguments[0];this._edge=e}),Bn=(yn.prototype.getSplitCoordinates=function(){var e=new ze;this.addEndpoints();for(var t=this.iterator(),n=t.next();t.hasNext();){var r=t.next();this.addEdgeCoordinates(n,r,e),n=r}return e.toCoordinateArray()},yn.prototype.addCollapsedNodes=function(){var e=new x;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var t=e.iterator();t.hasNext();){var n=t.next().intValue();this.add(this._edge.getCoordinate(n),n)}},yn.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)},yn.prototype.findCollapsesFromExistingVertices=function(e){for(var t=0;t=0?t>=0?n>=r?0:1:n>=r?7:6:t>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof B&&arguments[1]instanceof B){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new I("Cannot compute the octant for two identical points "+i);return Bn.octant(a,s)}},function(){}),vn=(bn.prototype.getCoordinates=function(){},bn.prototype.size=function(){},bn.prototype.getCoordinate=function(e){},bn.prototype.isClosed=function(){},bn.prototype.setData=function(e){},bn.prototype.getData=function(){},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn},function(){}),Z=(vn.prototype.addIntersection=function(e,t){},vn.prototype.interfaces_=function(){return[bn]},vn.prototype.getClass=function(){return vn},function(){this._nodeList=new yn(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t}),W=(Z.prototype.getCoordinates=function(){return this._pts},Z.prototype.size=function(){return this._pts.length},Z.prototype.getCoordinate=function(e){return this._pts[e]},Z.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Z.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},Z.prototype.setData=function(e){this._data=e},Z.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:Bn.octant(e,t)},Z.prototype.getData=function(){return this._data},Z.prototype.addIntersection=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new B(n.getIntersection(i));this.addIntersection(o,r)}},Z.prototype.toString=function(){return we.toLineString(new N(this._pts))},Z.prototype.getNodeList=function(){return this._nodeList},Z.prototype.addIntersectionNode=function(e,t){var n=t,r=n+1;if(r=0&&n>=0?Math.max(t,n):t<=0&&n<=0?Math.max(t,n):0}if(arguments[0]instanceof B){var r=arguments[0];return S.orientationIndex(this.p0,this.p1,r)}},W.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},W.prototype.isVertical=function(){return this.p0.x===this.p1.x},W.prototype.equals=function(e){if(!(e instanceof W))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},W.prototype.intersection=function(e){var t=new Re;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},W.prototype.project=function(){if(arguments[0]instanceof B){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new B(e);var t=this.projectionFactor(e),n=new B;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof W){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(r.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(r.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new W(a,s)}},W.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},W.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},W.prototype.getCoordinate=function(e){return 0===e?this.p0:this.p1},W.prototype.distancePerpendicular=function(e){return S.distancePointLinePerpendicular(e,this.p0,this.p1)},W.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},W.prototype.midPoint=function(){return W.midPoint(this.p0,this.p1)},W.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=t*t+n*n;if(r<=0)return C.NaN;return((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/r},W.prototype.closestPoints=function(e){var t=this.intersection(e);if(null!==t)return[t,t];var n=new Array(2).fill(null),r=C.MAX_VALUE,i=null,o=this.closestPoint(e.p0);r=o.distance(e.p0),n[0]=o,n[1]=e.p0;var a=this.closestPoint(e.p1);(i=a.distance(e.p1))0&&t<1)return this.project(e);return this.p0.distance(e)1||C.isNaN(t))&&(t=1),t},W.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},W.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},W.prototype.distance=function(){if(arguments[0]instanceof W){var e=arguments[0];return S.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof B){var t=arguments[0];return S.distancePointLine(t,this.p0,this.p1)}},W.prototype.pointAlong=function(e){var t=new B;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},W.prototype.hashCode=function(){var e=C.doubleToLongBits(this.p0.x);e^=31*C.doubleToLongBits(this.p0.y);var t=Math.trunc(e)^Math.trunc(e>>32),n=C.doubleToLongBits(this.p1.x);n^=31*C.doubleToLongBits(this.p1.y);return t^(Math.trunc(n)^Math.trunc(n>>32))},W.prototype.interfaces_=function(){return[te,e]},W.prototype.getClass=function(){return W},W.midPoint=function(e,t){return new B((e.x+t.x)/2,(e.y+t.y)/2)},En.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(W,En),function(){this.tempEnv1=new Q,this.tempEnv2=new Q,this._overlapSeg1=new W,this._overlapSeg2=new W}),wn=(Qn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=r}),Sn=(wn.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},wn.prototype.computeSelect=function(e,t,n,r){var i=this._pts[t],o=this._pts[n];if(r.tempEnv1.init(i,o),n-t==1)return r.select(this,t),null;if(!e.intersects(r.tempEnv1))return null;var a=Math.trunc((t+n)/2);t=e.length-1)return e.length-1;for(var r=P.quadrant(e[n],e[n+1]),i=t+1;in.getId()&&(n.computeOverlaps(i,e),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return Fn},Object.defineProperties(e,n),e}(xn)),Fn=function(a){function e(){a.call(this),this._si=null;var e=arguments[0];this._si=e}return a&&(e.__proto__=a),e.prototype=Object.create(a&&a.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return a.prototype.overlap.apply(this,arguments);var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3],i=e.getContext(),o=n.getContext();this._si.processIntersections(i,t,o,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qn),H=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},Dn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}},j=(H.prototype.getEndCapStyle=function(){return this._endCapStyle},H.prototype.isSingleSided=function(){return this._isSingleSided},H.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,0===this._quadrantSegments&&(this._joinStyle=H.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=H.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==H.JOIN_ROUND&&(this._quadrantSegments=H.DEFAULT_QUADRANT_SEGMENTS)},H.prototype.getJoinStyle=function(){return this._joinStyle},H.prototype.setJoinStyle=function(e){this._joinStyle=e},H.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},H.prototype.getSimplifyFactor=function(){return this._simplifyFactor},H.prototype.getQuadrantSegments=function(){return this._quadrantSegments},H.prototype.setEndCapStyle=function(e){this._endCapStyle=e},H.prototype.getMitreLimit=function(){return this._mitreLimit},H.prototype.setMitreLimit=function(e){this._mitreLimit=e},H.prototype.setSingleSided=function(e){this._isSingleSided=e},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},Dn.CAP_ROUND.get=function(){return 1},Dn.CAP_FLAT.get=function(){return 2},Dn.CAP_SQUARE.get=function(){return 3},Dn.JOIN_ROUND.get=function(){return 1},Dn.JOIN_MITRE.get=function(){return 2},Dn.JOIN_BEVEL.get=function(){return 3},Dn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Dn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Dn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(H,Dn),function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=S.COUNTERCLOCKWISE,this._inputLine=e||null}),Gn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}},Nn=(j.prototype.isDeletable=function(e,t,n,r){var i=this._inputLine[e],o=this._inputLine[t],a=this._inputLine[n];return!!this.isConcave(i,o,a)&&(!!this.isShallow(i,o,a,r)&&this.isShallowSampled(i,o,e,n,r))},j.prototype.deleteShallowConcavities=function(){for(var e=1,t=this.findNextNonDeletedIndex(e),n=this.findNextNonDeletedIndex(t),r=!1;n=0;r--)this.addPt(e[r])},Nn.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1);return e.distance(t)Math.PI;)e-=Y.PI_TIMES_2;for(;e<=-Math.PI;)e+=Y.PI_TIMES_2;return e},Y.angle=function(){if(1===arguments.length){var e=arguments[0];return Math.atan2(e.y,e.x)}if(2===arguments.length){var t=arguments[0],n=arguments[1],r=n.x-t.x,i=n.y-t.y;return Math.atan2(i,r)}},Y.isAcute=function(e,t,n){var r=e.x-t.x,i=e.y-t.y;return r*(n.x-t.x)+i*(n.y-t.y)>0},Y.isObtuse=function(e,t,n){var r=e.x-t.x,i=e.y-t.y;return r*(n.x-t.x)+i*(n.y-t.y)<0},Y.interiorAngle=function(e,t,n){var r=Y.angle(t,e),i=Y.angle(t,n);return Math.abs(i-r)},Y.normalizePositive=function(e){if(e<0){for(;e<0;)e+=Y.PI_TIMES_2;e>=Y.PI_TIMES_2&&(e=0)}else{for(;e>=Y.PI_TIMES_2;)e-=Y.PI_TIMES_2;e<0&&(e=0)}return e},Y.angleBetween=function(e,t,n){var r=Y.angle(t,e),i=Y.angle(t,n);return Y.diff(r,i)},Y.diff=function(e,t){var n=null;return(n=eMath.PI&&(n=2*Math.PI-n),n},Y.toRadians=function(e){return e*Math.PI/180},Y.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?Y.COUNTERCLOCKWISE:n<0?Y.CLOCKWISE:Y.NONE},Y.angleBetweenOriented=function(e,t,n){var r=Y.angle(t,e),i=Y.angle(t,n)-r;return i<=-Math.PI?i+Y.PI_TIMES_2:i>Math.PI?i-Y.PI_TIMES_2:i},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return S.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return S.CLOCKWISE},Tn.NONE.get=function(){return S.COLLINEAR},Object.defineProperties(Y,Tn),function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new W,this._seg1=new W,this._offset0=new W,this._offset1=new W,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new Re,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===H.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}),Mn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}},Un=(z.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=S.computeOrientation(this._s0,this._s1,this._s2),r=n===S.CLOCKWISE&&this._side===M.LEFT||n===S.COUNTERCLOCKWISE&&this._side===M.RIGHT;0===n?this.addCollinear(t):r?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)},z.prototype.addLineEndCap=function(e,t){var n=new W(e,t),r=new W;this.computeOffsetSegment(n,M.LEFT,this._distance,r);var i=new W;this.computeOffsetSegment(n,M.RIGHT,this._distance,i);var o=t.x-e.x,a=t.y-e.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case H.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(t,s+Math.PI/2,s-Math.PI/2,S.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case H.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case H.CAP_SQUARE:var A=new B;A.x=Math.abs(this._distance)*Math.cos(s),A.y=Math.abs(this._distance)*Math.sin(s);var l=new B(r.p1.x+A.x,r.p1.y+A.y),c=new B(i.p1.x+A.x,i.p1.y+A.y);this._segList.addPt(l),this._segList.addPt(c)}},z.prototype.getCoordinates=function(){return this._segList.getCoordinates()},z.prototype.addMitreJoin=function(e,t,n,r){var i=!0,o=null;try{o=ye.intersection(t.p0,t.p1,n.p0,n.p1);(r<=0?1:o.distance(e)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(e){if(!(e instanceof Ce))throw e;o=new B(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(t,n,r,this._bufParams.getMitreLimit())},z.prototype.addFilletCorner=function(e,t,n,r,i){var o=t.x-e.x,a=t.y-e.y,s=Math.atan2(a,o),A=n.x-e.x,l=n.y-e.y,c=Math.atan2(l,A);r===S.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,s,c,r,i),this._segList.addPt(n)},z.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new B((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new B((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},z.prototype.createCircle=function(e){var t=new B(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},z.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},z.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Nn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*z.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},z.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===H.JOIN_BEVEL||this._bufParams.getJoinStyle()===H.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,S.CLOCKWISE,this._distance))},z.prototype.closeRing=function(){this._segList.closeRing()},z.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},z.prototype.interfaces_=function(){return[]},z.prototype.getClass=function(){return z},Mn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Mn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(z,Mn),function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t}),On=(Un.prototype.getOffsetCurve=function(e,t){if(this._distance=t,0===t)return null;var n=t<0,r=Math.abs(t),i=this.getSegGen(r);e.length<=1?this.computePointCurve(e[0],i):this.computeOffsetCurve(e,n,i);var o=i.getCoordinates();return n&&R.reverse(o),o},Un.prototype.computeSingleSidedBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var i=j.simplify(e,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],M.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{n.addSegments(e,!1);var s=j.simplify(e,r),A=s.length-1;n.initSideSegments(s[0],s[1],M.LEFT),n.addFirstSegment();for(var l=2;l<=A;l++)n.addNextSegment(s[l],!0)}n.addLastSegment(),n.closeRing()},Un.prototype.computeRingBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);t===M.RIGHT&&(r=-r);var i=j.simplify(e,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],t);for(var a=1;a<=o;a++){var s=1!==a;n.addNextSegment(i[a],s)}n.closeRing()},Un.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),r=j.simplify(e,n),i=r.length-1;t.initSideSegments(r[0],r[1],M.LEFT);for(var o=2;o<=i;o++)t.addNextSegment(r[o],!0);t.addLastSegment(),t.addLineEndCap(r[i-1],r[i]);var a=j.simplify(e,-n),s=a.length-1;t.initSideSegments(a[s],a[s-1],M.LEFT);for(var A=s-2;A>=0;A--)t.addNextSegment(a[A],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},Un.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case H.CAP_ROUND:t.createCircle(e);break;case H.CAP_SQUARE:t.createSquare(e)}},Un.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided())return null;if(0===t)return null;var n=Math.abs(t),r=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],r);else if(this._bufParams.isSingleSided()){var i=t<0;this.computeSingleSidedBufferCurve(e,i,r)}else this.computeLineBufferCurve(e,r);return r.getCoordinates()},Un.prototype.getBufferParameters=function(){return this._bufParams},Un.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},Un.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(0===n)return Un.copyCoordinates(e);var r=this.getSegGen(n);return this.computeRingBufferCurve(e,t,r),r.getCoordinates()},Un.prototype.computeOffsetCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){var i=j.simplify(e,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],M.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{var s=j.simplify(e,r),A=s.length-1;n.initSideSegments(s[0],s[1],M.LEFT),n.addFirstSegment();for(var l=2;l<=A;l++)n.addNextSegment(s[l],!0)}n.addLastSegment()},Un.prototype.getSegGen=function(e){return new z(this._precisionModel,this._bufParams,e)},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},Un.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(e,r.getDirectedEdges(),t)}return t}if(3===arguments.length)if(b(arguments[2],je)&&arguments[0]instanceof B&&arguments[1]instanceof $t)for(var o=arguments[0],a=arguments[1],s=arguments[2],A=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse();if(!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||S.computeOrientation(this._seg.p0,this._seg.p1,o)===S.RIGHT)){var c=a.getDepth(M.LEFT);this._seg.p0.equals(A[l])||(c=a.getDepth(M.RIGHT));var g=new Pn(this._seg,c);s.add(g)}}else if(b(arguments[2],je)&&arguments[0]instanceof B&&b(arguments[1],je))for(var u=arguments[0],d=arguments[1],h=arguments[2],p=d.iterator();p.hasNext();){var f=p.next();f.isForward()&&this.findStabbedSegments(u,f,h)}},On.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(0===t.size())return 0;return cn.min(t)._leftDepth},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},Ln.DepthSegment.get=function(){return Pn},Object.defineProperties(On,Ln),function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new W(e),this._leftDepth=t}),J=(Pn.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return 0!==n?n:0!=(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(t._upwardSeg)},Pn.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return 0!==n?n:e.p1.compareTo(t.p1)},Pn.prototype.toString=function(){return this._upwardSeg.toString()},Pn.prototype.interfaces_=function(){return[te]},Pn.prototype.getClass=function(){return Pn},function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null}),Vn=(J.prototype.area=function(){return J.area(this.p0,this.p1,this.p2)},J.prototype.signedArea=function(){return J.signedArea(this.p0,this.p1,this.p2)},J.prototype.interpolateZ=function(e){if(null===e)throw new I("Supplied point is null.");return J.interpolateZ(e,this.p0,this.p1,this.p2)},J.prototype.longestSideLength=function(){return J.longestSideLength(this.p0,this.p1,this.p2)},J.prototype.isAcute=function(){return J.isAcute(this.p0,this.p1,this.p2)},J.prototype.circumcentre=function(){return J.circumcentre(this.p0,this.p1,this.p2)},J.prototype.area3D=function(){return J.area3D(this.p0,this.p1,this.p2)},J.prototype.centroid=function(){return J.centroid(this.p0,this.p1,this.p2)},J.prototype.inCentre=function(){return J.inCentre(this.p0,this.p1,this.p2)},J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)},J.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2},J.det=function(e,t,n,r){return e*r-t*n},J.interpolateZ=function(e,t,n,r){var i=t.x,o=t.y,a=n.x-i,s=r.x-i,A=n.y-o,l=r.y-o,c=a*l-s*A,g=e.x-i,u=e.y-o,d=(l*g-s*u)/c,h=(-A*g+a*u)/c;return t.z+d*(n.z-t.z)+h*(r.z-t.z)},J.longestSideLength=function(e,t,n){var r=e.distance(t),i=t.distance(n),o=n.distance(e),a=r;return i>a&&(a=i),o>a&&(a=o),a},J.isAcute=function(e,t,n){return!!Y.isAcute(e,t,n)&&(!!Y.isAcute(t,n,e)&&!!Y.isAcute(n,e,t))},J.circumcentre=function(e,t,n){var r=n.x,i=n.y,o=e.x-r,a=e.y-i,s=t.x-r,A=t.y-i,l=2*J.det(o,a,s,A),c=J.det(a,o*o+a*a,A,s*s+A*A),g=J.det(o,o*o+a*a,s,s*s+A*A);return new B(r-c/l,i+g/l)},J.perpendicularBisector=function(e,t){var n=t.x-e.x,r=t.y-e.y,i=new ye(e.x+n/2,e.y+r/2,1),o=new ye(e.x-r+n/2,e.y+n+r/2,1);return new ye(i,o)},J.angleBisector=function(e,t,n){var r=t.distance(e),i=r/(r+t.distance(n)),o=n.x-e.x,a=n.y-e.y;return new B(e.x+i*o,e.y+i*a)},J.area3D=function(e,t,n){var r=t.x-e.x,i=t.y-e.y,o=t.z-e.z,a=n.x-e.x,s=n.y-e.y,A=n.z-e.z,l=i*A-o*s,c=o*a-r*A,g=r*s-i*a,u=l*l+c*c+g*g,d=Math.sqrt(u)/2;return d},J.centroid=function(e,t,n){var r=(e.x+t.x+n.x)/3,i=(e.y+t.y+n.y)/3;return new B(r,i)},J.inCentre=function(e,t,n){var r=t.distance(n),i=e.distance(n),o=e.distance(t),a=r+i+o,s=(r*e.x+i*t.x+o*n.x)/a,A=(r*e.y+i*t.y+o*n.y)/a;return new B(s,A)},function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new x;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n}),Zn=(Vn.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,m.EXTERIOR,m.INTERIOR)},Vn.prototype.addPolygon=function(e){var t=this._distance,n=M.LEFT;this._distance<0&&(t=-this._distance,n=M.RIGHT);var r=e.getExteriorRing(),i=R.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,t,n,m.EXTERIOR,m.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,t,M.opposite(n),m.INTERIOR,m.EXTERIOR)}},Vn.prototype.isTriangleErodedCompletely=function(e,t){var n=new J(e[0],e[1],e[2]),r=n.inCentre();return S.distancePointLine(r,n.p0,n.p1)=yt.MINIMUM_VALID_SIZE&&S.isCCW(e)&&(o=i,a=r,n=M.opposite(n));var s=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(s,o,a)},Vn.prototype.add=function(e){if(e.isEmpty())return null;e instanceof Ct?this.addPolygon(e):e instanceof G?this.addLineString(e):e instanceof ft?this.addPoint(e):e instanceof mt?this.addCollection(e):e instanceof ct?this.addCollection(e):e instanceof Bt?this.addCollection(e):e instanceof lt&&this.addCollection(e)},Vn.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(4===n.length)return this.isTriangleErodedCompletely(n,t);var r=e.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>i},Vn.prototype.addCollection=function(e){for(var t=0;t=this._max)throw new i;var e=this._parent.getGeometryN(this._index++);return e instanceof lt?(this._subcollectionIterator=new Wn(e),this._subcollectionIterator.next()):e},Wn.prototype.remove=function(){throw new Error(this.getClass().getName())},Wn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Wn.prototype.interfaces_=function(){return[He]},Wn.prototype.getClass=function(){return Wn},Wn.isAtomic=function(e){return!(e instanceof lt)},function(){this._geom=null;var e=arguments[0];this._geom=e}),jn=(Hn.prototype.locate=function(e){return Hn.locate(e,this._geom)},Hn.prototype.interfaces_=function(){return[Zn]},Hn.prototype.getClass=function(){return Hn},Hn.isPointInRing=function(e,t){return!!t.getEnvelopeInternal().intersects(e)&&S.isPointInRing(e,t.getCoordinates())},Hn.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Hn.isPointInRing(e,n))return!1;for(var r=0;r=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===t&&(t=i),null!==e&&i.setNext(e),e=r}t.setNext(e)},e.prototype.computeDepths=function(){if(1===arguments.length){var e=arguments[0],t=this.findIndex(e),n=e.getDepth(M.LEFT),r=e.getDepth(M.RIGHT),i=this.computeDepths(t+1,this._edgeList.size(),n);if(this.computeDepths(0,t,i)!==r)throw new Zt("depth mismatch at "+e.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],a=arguments[1],s=arguments[2],A=o;A=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===t&&o.getEdgeRing()===e&&(t=o),r){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==e)continue;n=a,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==e)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(w.isTrue(null!==t,"found null for first outgoing dirEdge"),w.isTrue(t.getEdgeRing()===e,"unable to link last incoming dirEdge"),n.setNextMin(t))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var e=0,t=this.iterator();t.hasNext();)t.next().isInResult()&&e++;return e}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var e=m.NONE,t=this.iterator();t.hasNext();){var n=t.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){e=m.INTERIOR;break}if(r.isInResult()){e=m.EXTERIOR;break}}}if(e===m.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===m.INTERIOR):(a.isInResult()&&(i=m.EXTERIOR),s.isInResult()&&(i=m.INTERIOR))}},e.prototype.computeLabelling=function(e){o.prototype.computeLabelling.call(this,e),this._label=new O(m.NONE);for(var t=this.iterator();t.hasNext();)for(var n=t.next().getEdge().getLabel(),r=0;r<2;r++){var i=n.getLocation(r);i!==m.INTERIOR&&i!==m.BOUNDARY||this._label.setLocation(r,m.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jn)),zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(e){return new Jt(e,new Yn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(en),Jn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)},Kn=(Jn.prototype.compareTo=function(e){var t=e;return Jn.compareOriented(this._pts,this._orientation,t._pts,t._orientation)},Jn.prototype.interfaces_=function(){return[te]},Jn.prototype.getClass=function(){return Jn},Jn.orientation=function(e){return 1===R.increasingDirection(e)},Jn.compareOriented=function(e,t,n,r){for(var i=t?1:-1,o=r?1:-1,a=t?e.length:-1,s=r?n.length:-1,A=t?0:e.length-1,l=r?0:n.length-1;;){var c=e[A].compareTo(n[l]);if(0!==c)return c;var g=(A+=i)===a,u=(l+=o)===s;if(g&&!u)return-1;if(!g&&u)return 1;if(g&&u)return 0}},function(){this._edges=new x,this._ocaMap=new p}),Xn=(Kn.prototype.print=function(e){e.print("MULTILINESTRING ( ");for(var t=0;t0&&e.print(","),e.print("(");for(var r=n.getCoordinates(),i=0;i0&&e.print(","),e.print(r[i].x+" "+r[i].y);e.println(")")}e.print(") ")},Kn.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next())},Kn.prototype.findEdgeIndex=function(e){for(var t=0;t0||!t.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new B(e.coord);for(var s=e.segmentIndex+1;s<=t.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=t.coord),new or(o,new O(this.edge._label))},er.prototype.add=function(e,t,n){var r=new $n(e,t,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},er.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(e))return!0;return!1},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er},function(){}),nr=(tr.prototype.getChainStartIndices=function(e){var t=0,n=new x;n.add(new ge(t));do{var r=this.findChainEnd(e,t);n.add(new ge(r)),t=r}while(tn?t:n},nr.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return tt&&(r=1),this._depth[e][n]=r}}},rr.prototype.getDelta=function(e){return this._depth[e][M.RIGHT]-this._depth[e][M.LEFT]},rr.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?m.EXTERIOR:m.INTERIOR},rr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},rr.prototype.add=function(){if(1===arguments.length)for(var e=arguments[0],t=0;t<2;t++)for(var n=1;n<3;n++){var r=e.getLocation(t,n);r!==m.EXTERIOR&&r!==m.INTERIOR||(this.isNull(t,n)?this._depth[t][n]=rr.depthAtLocation(r):this._depth[t][n]+=rr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===m.INTERIOR&&this._depth[i][o]++}},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthAtLocation=function(e){return e===m.EXTERIOR?0:e===m.INTERIOR?1:rr.NULL_VALUE},ir.NULL_VALUE.get=function(){return-1},Object.defineProperties(rr,ir),function(i){function e(){if(i.call(this),this.pts=null,this._env=null,this.eiList=new er(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new rr,this._depthDelta=0,1===arguments.length){var t=arguments[0];e.call(this,t,null)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.pts=n,this._label=r}}return i&&(e.__proto__=i),e.prototype=Object.create(i&&i.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);t[0]=this.pts[0],t[1]=this.pts[1];return new e(t,O.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(e){this._isIsolated=e},e.prototype.setName=function(e){this._name=e},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,a=0;a0?this.pts[0]:null;if(1===arguments.length){var e=arguments[0];return this.pts[e]}},e.prototype.print=function(e){e.print("edge "+this._name+": "),e.print("LINESTRING (");for(var t=0;t0&&e.print(","),e.print(this.pts[t].x+" "+this.pts[t].y);e.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&(3===this.pts.length&&!!this.pts[0].equals(this.pts[2]))},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(e){e.print("edge "+this._name+": ");for(var t=this.pts.length-1;t>=0;t--)e.print(this.pts[t]+" ");e.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new nr(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Q;for(var e=0;e0&&e.append(","),e.append(this.pts[t].x+" "+this.pts[t].y);return e.append(") "+this._label+" "+this._depthDelta),e.toString()},e.prototype.isPointwiseEqual=function(e){if(this.pts.length!==e.pts.length)return!1;for(var t=0;tr||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(e,t);return w.isTrue(!(a&&s),"Found bad envelope test"),s},cr.prototype.initCorners=function(e){this._minx=e.x-.5,this._maxx=e.x+.5,this._miny=e.y-.5,this._maxy=e.y+.5,this._corner[0]=new B(this._maxx,this._maxy),this._corner[1]=new B(this._minx,this._maxy),this._corner[2]=new B(this._minx,this._miny),this._corner[3]=new B(this._maxx,this._miny)},cr.prototype.intersects=function(e,t){return 1===this._scaleFactor?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},cr.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},cr.prototype.getCoordinate=function(){return this._originalPt},cr.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},cr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var e=cr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Q(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},cr.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},cr.prototype.intersectsToleranceSquare=function(e,t){var n=!1,r=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.isProper()||(!(!n||!r)||(!!e.equals(this._pt)||!!t.equals(this._pt))))))},cr.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),r=e.getCoordinate(t+1);return!!this.intersects(n,r)&&(e.addIntersection(this.getCoordinate(),t),!0)},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},gr.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(cr,gr),function(){this.tempEnv1=new Q,this.selectedSegment=new W}),dr=(ur.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur},function(){this._index=null;var e=arguments[0];this._index=e}),hr={HotPixelSnapAction:{configurable:!0}},pr=(dr.prototype.snap=function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var t=arguments[0],n=arguments[1],r=arguments[2],i=t.getSafeEnvelope(),o=new pr(t,n,r);return this._index.query(i,{interfaces_:function(){return[an]},visitItem:function(e){e.select(i,o)}}),o.isNodeAdded()}},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},hr.HotPixelSnapAction.get=function(){return pr},Object.defineProperties(dr,hr),function(r){function e(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=t,this._hotPixelVertexIndex=n}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return r.prototype.select.apply(this,arguments);var e=arguments[0],t=arguments[1],n=e.getContext();if(null!==this._parentEdge&&n===this._parentEdge&&t===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,t)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ur)),fr=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new x},Ir=(fr.prototype.processIntersections=function(e,t,n,r){if(e===n&&t===r)return null;var i=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var A=0;A=0;t--){try{e.bufferReducedPrecision(t)}catch(t){if(!(t instanceof Zt))throw t;e._saveException=t}if(null!==e._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=Cr.precisionScaleFactor(this._argGeom,this._distance,n),i=new k(r);this.bufferFixedPrecision(i)}},Cr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===k.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},Cr.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},Cr.prototype.bufferOriginalPrecision=function(){try{var e=new ar(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(e){if(!(e instanceof Se))throw e;this._saveException=e}},Cr.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},Cr.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Cr.bufferOp=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return new Cr(e).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof _&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Cr(n);o.setQuadrantSegments(i);return o.getResultGeometry(r)}if(arguments[2]instanceof H&&arguments[0]instanceof _&&"number"==typeof arguments[1]){var a=arguments[0],s=arguments[1],A=arguments[2];return new Cr(a,A).getResultGeometry(s)}}else if(4===arguments.length){var l=arguments[0],c=arguments[1],g=arguments[2],u=arguments[3],d=new Cr(l);d.setQuadrantSegments(g),d.setEndCapStyle(u);return d.getResultGeometry(c)}},Cr.precisionScaleFactor=function(e,t,n){var r=e.getEnvelopeInternal(),i=Ae.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(t>0?t:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},mr.CAP_ROUND.get=function(){return H.CAP_ROUND},mr.CAP_BUTT.get=function(){return H.CAP_FLAT},mr.CAP_FLAT.get=function(){return H.CAP_FLAT},mr.CAP_SQUARE.get=function(){return H.CAP_SQUARE},mr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Cr,mr),function(){this._pt=[new B,new B],this._distance=C.NaN,this._isNull=!0}),Br=(yr.prototype.getCoordinates=function(){return this._pt},yr.prototype.getCoordinate=function(e){return this._pt[e]},yr.prototype.setMinimum=function(){if(1===arguments.length){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(2===arguments.length){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var r=t.distance(n);rthis._distance&&this.initialize(t,n,r)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},function(){}),br=(Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.computeDistance=function(){if(arguments[2]instanceof yr&&arguments[0]instanceof G&&arguments[1]instanceof B)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=e.getCoordinates(),i=new W,o=0;o0||this._isIn?m.INTERIOR:m.EXTERIOR)},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}}),Rr={INSIDE_AREA:{configurable:!0}},Fr=(xr.prototype.isInsideArea=function(){return this._segIndex===xr.INSIDE_AREA},xr.prototype.getCoordinate=function(){return this._pt},xr.prototype.getGeometryComponent=function(){return this._component},xr.prototype.getSegmentIndex=function(){return this._segIndex},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},Rr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(xr,Rr),function(e){this._pts=e||null}),Dr=(Fr.prototype.filter=function(e){e instanceof ft&&this._pts.add(e)},Fr.prototype.interfaces_=function(){return[st]},Fr.prototype.getClass=function(){return Fr},Fr.getPoints=function(){if(1===arguments.length){var e=arguments[0];return e instanceof ft?cn.singletonList(e):Fr.getPoints(e,new x)}if(2===arguments.length){var t=arguments[0],n=arguments[1];return t instanceof ft?n.add(t):t instanceof lt&&t.apply(new Fr(n)),n}},function(){this._locations=null;var e=arguments[0];this._locations=e}),Gr=(Dr.prototype.filter=function(e){(e instanceof ft||e instanceof G||e instanceof Ct)&&this._locations.add(new xr(e,0,e.getCoordinate()))},Dr.prototype.interfaces_=function(){return[st]},Dr.prototype.getClass=function(){return Dr},Dr.getLocations=function(e){var t=new x;return e.apply(new Dr(t)),t},function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new _r,this._minDistanceLocation=null,this._minDistance=C.MAX_VALUE,2===arguments.length){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}}),Nr=(Gr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var t=arguments[0],n=arguments[1],r=1-t,i=wr.getPolygons(this._geom[t]);if(i.size()>0){var o=Dr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[t]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&b(arguments[0],je)&&b(arguments[1],je)){for(var a=arguments[0],s=arguments[1],A=arguments[2],l=0;lthis._minDistance)return null;for(var r=e.getCoordinates(),i=t.getCoordinate(),o=0;othis._minDistance)return null;for(var g=A.getCoordinates(),u=l.getCoordinates(),d=0;dthis._distance&&this.initialize(t,n,r)}},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},function(){}),Tr=(kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},kr.computeDistance=function(){if(arguments[2]instanceof Nr&&arguments[0]instanceof G&&arguments[1]instanceof B)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=new W,i=e.getCoordinates(),o=0;o1||e<=0)throw new I("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},Tr.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},Tr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Tr.prototype.computeOrientedDistance=function(e,t,n){var r=new Ur(t);if(e.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Or(t,this._densifyFrac);e.apply(i),n.setMaximum(i.getMaxPointDistance())}},Tr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.distance=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return new Tr(e,t).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Tr(n,r);return o.setDensifyFraction(i),o.distance()}},Mr.MaxPointDistanceFilter.get=function(){return Ur},Mr.MaxDensifiedByFractionDistanceFilter.get=function(){return Or},Object.defineProperties(Tr,Mr),function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._euclideanDist=new kr,this._geom=null;var e=arguments[0];this._geom=e}),Or=(Ur.prototype.filter=function(e){this._minPtDist.initialize(),kr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ur.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ur.prototype.interfaces_=function(){return[Me]},Ur.prototype.getClass=function(){return Ur},function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))}),Lr=(Or.prototype.filter=function(e,t){if(0===t)return null;for(var n=e.getCoordinate(t-1),r=e.getCoordinate(t),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,a=0;an){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=e.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+we.toLineString(i[0],i[1])+")"}},Lr.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=Lr.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Lr.VERBOSE&&me.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Lr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ct||this._input instanceof Bt||this._input instanceof lt))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)},Lr.prototype.getErrorIndicator=function(){return this._errorIndicator},Lr.prototype.checkMinimumDistance=function(e,t,n){var r=new Gr(e,t,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e=2?null:this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Vr.prototype.report=function(e){if(!Vr.VERBOSE)return null;me.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},Vr.prototype.getErrorMessage=function(){return this._errorMsg},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.isValidMsg=function(e,t,n){var r=new Vr(e,t,n);return r.isValid()?null:r.getErrorMessage()},Vr.isValid=function(e,t,n){return!!new Vr(e,t,n).isValid()},Zr.VERBOSE.get=function(){return!1},Zr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Vr,Zr),function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t}),Hr=(Wr.prototype.getCoordinates=function(){return this._pts},Wr.prototype.size=function(){return this._pts.length},Wr.prototype.getCoordinate=function(e){return this._pts[e]},Wr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Wr.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:Bn.octant(this.getCoordinate(e),this.getCoordinate(e+1))},Wr.prototype.setData=function(e){this._data=e},Wr.prototype.getData=function(){return this._data},Wr.prototype.toString=function(){return we.toLineString(new N(this._pts))},Wr.prototype.interfaces_=function(){return[bn]},Wr.prototype.getClass=function(){return Wr},function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new x,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null}),jr=(Hr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Hr.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},Hr.prototype.getIntersectionSegments=function(){return this._intSegments},Hr.prototype.count=function(){return this._intersectionCount},Hr.prototype.getIntersections=function(){return this._intersections},Hr.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},Hr.prototype.setKeepIntersections=function(e){this._keepIntersections=e},Hr.prototype.processIntersections=function(e,t,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(e===n&&t===r)return null;if(this._isCheckEndSegmentsOnly)if(!(this.isEndSegment(e,t)||this.isEndSegment(n,r)))return null;var i=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Hr.prototype.isEndSegment=function(e,t){return 0===t||t>=e.size()-2},Hr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Hr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Hr.prototype.interfaces_=function(){return[Xn]},Hr.prototype.getClass=function(){return Hr},Hr.createAllIntersectionsFinder=function(e){var t=new Hr(e);return t.setFindAllIntersections(!0),t},Hr.createAnyIntersectionFinder=function(e){return new Hr(e)},Hr.createIntersectionCounter=function(e){var t=new Hr(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t},function(){this._li=new Re,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e}),Yr=(jr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jr.prototype.getIntersections=function(){return this._segInt.getIntersections()},jr.prototype.isValid=function(){return this.execute(),this._isValid},jr.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},jr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Hr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Rn;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Zt(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+we.toLineString(e[0],e[1])+" and "+we.toLineString(e[2],e[3])},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.computeIntersections=function(e){var t=new jr(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()},function t(){this._nv=null;var e=arguments[0];this._nv=new jr(t.toSegmentStrings(e))}),zr=(Yr.prototype.checkValid=function(){this._nv.checkValid()},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toSegmentStrings=function(e){for(var t=new x,n=e.iterator();n.hasNext();){var r=n.next();t.add(new Wr(r.getCoordinates(),r))}return t},Yr.checkValid=function(e){new Yr(e).checkValid()},function(e){this._mapOp=e}),Jr=(zr.prototype.map=function(e){for(var t=new x,n=0;n0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new W,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof G&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}}),K=(qr.prototype.snapVertices=function(e,t){for(var n=this._isClosed?e.size()-1:e.size(),r=0;r=0&&e.add(o+1,new B(i),!1)}},qr.prototype.findSegmentIndexToSnap=function(e,t){for(var n=C.MAX_VALUE,r=-1,i=0;it&&(t=r)}return t}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(K.computeOverlaySnapTolerance(i),K.computeOverlaySnapTolerance(o))}},K.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal();return Math.min(t.getHeight(),t.getWidth())*K.SNAP_PRECISION_FACTOR},K.snapToSelf=function(e,t,n){return new K(e).snapToSelf(t,n)},$r.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(K,$r),function(r){function e(e,t,n){r.call(this),this._snapTolerance=e||null,this._snapPts=t||null,this._isSelfSnap=void 0!==n&&n}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(e,t){var n=new qr(e,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(t)},e.prototype.transformCoordinates=function(e,t){var n=e.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xr)),ti=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},ni=(ti.prototype.getCommon=function(){return C.longBitsToDouble(this._commonBits)},ti.prototype.add=function(e){var t=C.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=ti.signExpBits(this._commonBits),this._isFirst=!1,null;if(ti.signExpBits(t)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=ti.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=ti.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},ti.prototype.toString=function(){if(1===arguments.length){var e=arguments[0],t=C.longBitsToDouble(e),n="0000000000000000000000000000000000000000000000000000000000000000"+C.toBinaryString(e),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+t+" ]"}},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.getBit=function(e,t){return 0!=(e&1<>52},ti.zeroLowerBits=function(e,t){return e&~((1<=0;r--){if(ti.getBit(e,r)!==ti.getBit(t,r))return n;n++}return 52},function(){this._commonCoord=null,this._ccFilter=new ii}),ri={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}},ii=(ni.prototype.addCommonBits=function(e){var t=new oi(this._commonCoord);e.apply(t),e.geometryChanged()},ni.prototype.removeCommonBits=function(e){if(0===this._commonCoord.x&&0===this._commonCoord.y)return e;var t=new B(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new oi(t);return e.apply(n),e.geometryChanged(),e},ni.prototype.getCommonCoordinate=function(){return this._commonCoord},ni.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ri.CommonCoordinateFilter.get=function(){return ii},ri.Translater.get=function(){return oi},Object.defineProperties(ni,ri),function(){this._commonBitsX=new ti,this._commonBitsY=new ti}),oi=(ii.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},ii.prototype.getCommonCoordinate=function(){return new B(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ii.prototype.interfaces_=function(){return[Me]},ii.prototype.getClass=function(){return ii},function(){this.trans=null;var e=arguments[0];this.trans=e}),ai=(oi.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,r=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,r)},oi.prototype.isDone=function(){return!1},oi.prototype.isGeometryChanged=function(){return!0},oi.prototype.interfaces_=function(){return[At]},oi.prototype.getClass=function(){return oi},function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()}),si=(ai.prototype.selfSnap=function(e){return new K(e).snapTo(e,this._snapTolerance)},ai.prototype.removeCommonBits=function(e){this._cbr=new ni,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t},ai.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},ai.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=X.overlayOp(t[0],t[1],e);return this.prepareResult(n)},ai.prototype.checkValid=function(e){e.isValid()||me.out.println("Snapped geometry is invalid")},ai.prototype.computeSnapTolerance=function(){this._snapTolerance=K.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ai.prototype.snap=function(e){var t=this.removeCommonBits(e);return K.snap(t[0],t[1],this._snapTolerance)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},ai.overlayOp=function(e,t,n){return new ai(e,t).getResultGeometry(n)},ai.union=function(e,t){return ai.overlayOp(e,t,X.UNION)},ai.intersection=function(e,t){return ai.overlayOp(e,t,X.INTERSECTION)},ai.symDifference=function(e,t){return ai.overlayOp(e,t,X.SYMDIFFERENCE)},ai.difference=function(e,t){return ai.overlayOp(e,t,X.DIFFERENCE)},function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t}),Ai=(si.prototype.getResultGeometry=function(e){var t=null,n=!1,r=null;try{t=X.overlayOp(this._geom[0],this._geom[1],e);n=!0}catch(e){if(!(e instanceof Se))throw e;r=e}if(!n)try{t=ai.overlayOp(this._geom[0],this._geom[1],e)}catch(e){throw e instanceof Se?r:e}return t},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},si.overlayOp=function(e,t,n){return new si(e,t).getResultGeometry(n)},si.union=function(e,t){return si.overlayOp(e,t,X.UNION)},si.intersection=function(e,t){return si.overlayOp(e,t,X.INTERSECTION)},si.symDifference=function(e,t){return si.overlayOp(e,t,X.SYMDIFFERENCE)},si.difference=function(e,t){return si.overlayOp(e,t,X.DIFFERENCE)},function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t}),li=(Ai.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}}),ci={INSERT:{configurable:!0},DELETE:{configurable:!0}},gi=(li.prototype.isDelete=function(){return this._eventType===li.DELETE},li.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},li.prototype.getObject=function(){return this._obj},li.prototype.compareTo=function(e){var t=e;return this._xValuet._xValue?1:this._eventTypet._eventType?1:0},li.prototype.getInsertEvent=function(){return this._insertEvent},li.prototype.isInsert=function(){return this._eventType===li.INSERT},li.prototype.isSameLabel=function(e){return null!==this._label&&this._label===e._label},li.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},li.prototype.interfaces_=function(){return[te]},li.prototype.getClass=function(){return li},ci.INSERT.get=function(){return 1},ci.DELETE.get=function(){return 2},Object.defineProperties(li,ci),function(){}),ui=(gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n}),di=(ui.prototype.isTrivialIntersection=function(e,t,n,r){if(e===n&&1===this._li.getIntersectionNum()){if(ui.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var i=e.getNumPoints()-1;if(0===t&&r===i||0===r&&t===i)return!0}}return!1},ui.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ui.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},ui.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ui.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next().getCoordinate();if(e.isIntersection(r))return!0}return!1},ui.prototype.hasProperIntersection=function(){return this._hasProper},ui.prototype.hasIntersection=function(){return this._hasIntersection},ui.prototype.isDone=function(){return this._isDone},ui.prototype.isBoundaryPoint=function(e,t){return null!==t&&(!!this.isBoundaryPointInternal(e,t[0])||!!this.isBoundaryPointInternal(e,t[1]))},ui.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},ui.prototype.addIntersections=function(e,t,n,r){if(e===n&&t===r)return null;this.numTests++;var i=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(e.addIntersections(this._li,t,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui},ui.isAdjacentSegments=function(e,t){return 1===Math.abs(e-t)},function(t){function e(){t.call(this),this.events=new x,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){cn.sort(this.events);for(var e=0;et||this._maxo?1:0},fi.prototype.interfaces_=function(){return[re]},fi.prototype.getClass=function(){return fi},function(r){function e(){r.call(this),this._item=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._min=e,this._max=t,this._item=n}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.query=function(e,t,n){if(!this.intersects(e,t))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi)),Ci=function(n){function e(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],t=arguments[1];this._node1=e,this._node2=t,this.buildExtent(this._node1,this._node2)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(e,t){this._min=Math.min(e._min,t._min),this._max=Math.max(e._max,t._max)},e.prototype.query=function(e,t,n){if(!this.intersects(e,t))return null;null!==this._node1&&this._node1.query(e,t,n),null!==this._node2&&this._node2.query(e,t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),mi=function(){this._leaves=new x,this._root=null,this._level=0},yi=(mi.prototype.buildTree=function(){cn.sort(this._leaves,new hi.NodeComparator);for(var e=this._leaves,t=null,n=new x;;){if(this.buildLevel(e,n),1===n.size())return n.get(0);t=e,e=n,n=t}},mi.prototype.insert=function(e,t,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Ii(e,t,n))},mi.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(e){me.out.println(we.toLineString(new B(e._min,this._level),new B(e._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,t[0]),this.insertBoundaryPoint(this._argIndex,t[t.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var e=this.getBoundaryNodes(),t=new Array(e.size()).fill(null),n=0,r=e.iterator();r.hasNext();){var i=r.next();t[n++]=i.getCoordinate().copy()}return t},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(e,t,n){if(this.isBoundaryNode(e,t))return null;n===m.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(e,t):this.insertPoint(e,t,n)},e.prototype.addPolygonRing=function(e,t,n){if(e.isEmpty())return null;var r=R.removeRepeatedPoints(e.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=t,o=n;S.isCCW(r)&&(i=n,o=t);var a=new or(r,new O(this._argIndex,m.BOUNDARY,i,o));this._lineEdgeMap.put(e,a),this.insertEdge(a),this.insertPoint(this._argIndex,r[0],m.BOUNDARY)},e.prototype.insertPoint=function(e,t,n){var r=this._nodes.addNode(t),i=r.getLabel();null===i?r._label=new O(e,n):i.setLocation(e,n)},e.prototype.createEdgeSetIntersector=function(){return new di},e.prototype.addSelfIntersectionNodes=function(e){for(var t=this._edges.iterator();t.hasNext();)for(var n=t.next(),r=n.getLabel().getLocation(e),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(e,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return a.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof Bt&&(this._useBoundaryDeterminationRule=!1),e instanceof Ct)this.addPolygon(e);else if(e instanceof G)this.addLineString(e);else if(e instanceof ft)this.addPoint(e);else if(e instanceof mt)this.addCollection(e);else if(e instanceof ct)this.addCollection(e);else if(e instanceof Bt)this.addCollection(e);else{if(!(e instanceof lt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(e){for(var t=0;t50?(null===this._areaPtLocator&&(this._areaPtLocator=new Bi(this._parentGeom)),this._areaPtLocator.locate(e)):this._ptLocator.locate(e,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return a.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(e,t){return e.isInBoundary(t)?m.BOUNDARY:m.INTERIOR},e}(V)),wi=function(){if(this._li=new Re,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Qi(0,e)}else if(2===arguments.length){var t=arguments[0],n=arguments[1],r=Ue.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Qi(0,t,r),this._arg[1]=new Qi(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Qi(0,i,a),this._arg[1]=new Qi(1,o,a)}},Si=(wi.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},wi.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi},function(){}),X=(Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.map=function(){if(arguments[0]instanceof _&&b(arguments[1],Si.MapOp)){for(var e=arguments[0],t=arguments[1],n=new x,r=0;r=e.size()?null:e.get(t)},Ni.union=function(e){return new Ni(e).union()},ki.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ni,ki),function(){});Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return X.createEmptyResult(X.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),si.overlayOp(e,t,X.UNION)},q.GeoJSONReader=Ot,q.GeoJSONWriter=Lt,q.OverlayOp=X,q.UnionOp=Ti,q.BufferOp=Cr,Object.defineProperty(q,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";var I=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function stringify(e,t){var h,p,f;return t=t||{},h=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),p=""===h?1/0:void 0===t.maxLength?80:t.maxLength,f=t.replacer,function _stringify(e,t,n){var r,i,o,a,s,A,l,c,g,u,d;if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===(u=JSON.stringify(e,f)))return u;if(A=p-t.length-n,u.length<=A&&(c=u.replace(I,function(e,t){return t||e+" "})).length<=A)return c;if(null!=f&&(e=JSON.parse(u),f=void 0),"object"==typeof e&&null!==e){if(l=t+h,o=[],i=0,Array.isArray(e))for(g="[",r="]",A=e.length;i>>1;o(e[i],t)<0?n=1+i:r=i}return n}return 1===n.length&&(i=(e,t)=>n(e)-t,o=function ascendingComparator(n){return(e,t)=>Object(r.a)(n(e),t)}(n)),{left:left,center:function center(e,t,n,r){return r=left(e,t,n=null==n?0:n,(r=null==r?e.length:r)-1),n-i(e[r],t)?r-1:r},right:function right(e,t,n,r){for(null==n&&(n=0),null==r&&(r=e.length);n>>1;0=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return 0|e}function byteLength(e,t){if(Buffer.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;var n=(e="string"!=typeof e?""+e:e).length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return base64ToBytes(e).length;default:if(r)return utf8ToBytes(e).length;t=(""+t).toLowerCase(),r=!0}}function slowToString(e,t,n){var r=!1;if((t=void 0===t||t<0?0:t)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function hexSlice(e,t,n){var r=e.length;(!t||t<0)&&(t=0);(!n||n<0||r=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=Buffer.from(t,r)),Buffer.isBuffer(t))return 0===t.length?-1:arrayIndexOf(e,t,n,r,i);if("number"==typeof t)return t&=255,Buffer.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,n):arrayIndexOf(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,n,r,i){var o=1,a=e.length,s=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a/=o=2,s/=2,n/=2}function read(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i)for(var A=-1,l=n;l>8,r=r%256,i.push(r),i.push(n);return i}(t,e.length-n),e,n,r)}function utf8Slice(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i>>10&1023|55296),c=56320|1023&c),r.push(c),i+=g}return function decodeCodePointsArray(e){var t=e.length;if(t<=u)return String.fromCharCode.apply(String,e);var n="",r=0;for(;rt&&(e+=" ... ")),""},Buffer.prototype.compare=function compare(e,t,n,r,i){if(!Buffer.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),(t=void 0===t?0:t)<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),A=this.slice(r,i),l=e.slice(t,n),c=0;cthis.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o=!1;;)switch(r){case"hex":return function hexWrite(e,t,n,r){n=Number(n)||0;var i=e.length-n;if((!r||i<(r=Number(r)))&&(r=i),(i=t.length)%2!=0)throw new TypeError("Invalid hex string");i/2e.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function objectWriteUInt32(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function checkIEEE754(e,t,n,r){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(e,t,n,r,i){return i||checkIEEE754(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function writeDouble(e,t,n,r,i){return i||checkIEEE754(e,0,n,8),o.write(e,t,n,r,52,8),n+8}Buffer.prototype.slice=function slice(e,t){var n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):n>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,2,65535,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,4294967295,0),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,n,r){e=+e,t|=0,r||checkInt(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,a=0;for(this[t]=255&e;++i>0)-a&255;return t+n},Buffer.prototype.writeIntBE=function writeIntBE(e,t,n,r){e=+e,t|=0,r||checkInt(this,e,t,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,a=0;for(this[t+i]=255&e;0<=--i&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+n},Buffer.prototype.writeInt8=function writeInt8(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,1,127,-128),Buffer.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&(e=e<0?255+e+1:e),t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):objectWriteUInt16(this,e,t,!0),t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,2,32767,-32768),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):objectWriteUInt16(this,e,t,!1),t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,2147483647,-2147483648),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):objectWriteUInt32(this,e,t,!0),t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,n){return e=+e,t|=0,n||checkInt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Buffer.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):objectWriteUInt32(this,e,t,!1),t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,n){return writeFloat(this,e,t,!0,n)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,n){return writeFloat(this,e,t,!1,n)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,n){return writeDouble(this,e,t,!0,n)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,n){return writeDouble(this,e,t,!1,n)},Buffer.prototype.copy=function copy(e,t,n,r){if(n=n||0,r||0===r||(r=this.length),t>=e.length&&(t=e.length),(r=0=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var i,o=(r=e.length-t>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(e=e||0))for(s=t;s>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function base64ToBytes(e){return i.toByteArray(base64clean(e))}function blitBuffer(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}.call(this,r(64))},function(e,t,n){var r=n(746),i=n(747),o=n(748),a=n(749),n=n(750);function ListCache(e){var t=-1,n=null==e?0:e.length;for(this.clear();++te.length)&&(t=e.length);for(var n=0,r=new Array(t);n"project64"===e.name)&&0<=(r=n.modules.findIndex(e=>"project32"===e.name))&&n.modules.splice(r,1)),"inject"in t)if(e.inject){const i={...e.inject};for(const o in t.inject)i[o]=(i[o]||"")+t.inject[o];n.inject=i}else n.inject=t.inject;return n}n.d(t,"a",function(){return mergeShaders})},function(e,t,n){"use strict";n.d(t,"a",function(){return count});const r="count(): argument not an object",i="count(): argument not a container";function count(e){if(!function isObject(e){return null!==e&&"object"==typeof e}(e))throw new Error(r);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 isPlainObject(e){return null!==e&&"object"==typeof e&&e.constructor===Object}(e))return Object.keys(e).length;throw new Error(i)}},function(e,t,n){"use strict";n.d(t,"a",function(){return OrthographicController});var t=n(113),r=n(241);class OrthographicController extends t.a{constructor(e){e.dragMode=e.dragMode||"pan",super(r.a,e)}_onPanRotate(e){return!1}get linearTransitionProps(){return["target","zoom"]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return MapView});var t=n(114),r=n(239),i=n(242);class MapView extends t.a{constructor(e){super({...e,type:r.a})}get controller(){return this._getControllerProps({type:i.b})}}MapView.displayName="MapView"},function(e,t,n){"use strict";n.d(t,"a",function(){return AmbientLight});const r=[255,255,255];let i=0;class AmbientLight{constructor(e={}){var{color:t=r}=e,{intensity:n=1}=e;this.id=e.id||"ambient-".concat(i++),this.color=t,this.intensity=n,this.type="ambient"}}},function(E,e,t){"use strict";t.d(e,"a",function(){return layer_Layer});var n=t(22),r=t(343),A=t(85),a=t(12),e=t(138);class cpu_interpolation_transition_CPUInterpolationTransition extends e.a{get value(){return this._value}_onUpdate(){const{time:e,settings:{fromValue:t,toValue:n,duration:r,easing:i}}=this;var o=i(e/r);this._value=Object(a.lerp)(t,n,o)}}function updateSpringElement(e,t,n,r,i){e=t-e;return(n-t)*i+-e*r+e+t}function distance(n,r){if(Array.isArray(n)){let t=0;for(let e=0;e=t.min)}},color:{validate(e,t){return t.optional&&!e||isArray(e)&&(3===e.length||4===e.length)},equal(e,t,n){return arrayEqual(e,t)}},accessor:{validate(e,t){e=getTypeOf(e);return"function"===e||e===getTypeOf(t.value)},equal(e,t,n){return"function"==typeof t||arrayEqual(e,t)}},array:{validate(e,t){return t.optional&&!e||isArray(e)},equal(e,t,n){return n.compare?arrayEqual(e,t):e===t}},function:{validate(e,t){return t.optional&&!e||"function"==typeof e},equal(e,t,n){return!n.compare||e===t}},data:{transform:(e,t,n)=>{const r=(n?n.props:{})["dataTransform"];return r&&e?r(e):e}},image:{transform:(e,t,n)=>function createTexture(e,t){var n=e.context&&e.context.gl;if(!n||!t)return null;if(t instanceof h.a)return t;let r=null;return(t=t.constructor&&"Object"!==t.constructor.name?{data:t}:t).compressed&&(r={[10241]:1{!function destroyTexture(e){e&&e instanceof h.a&&p[e.id]&&(e.delete(),delete p[e.id])}(e)}}};function arrayEqual(t,n){if(t===n)return!0;if(!isArray(t)||!isArray(n))return!1;var r=t.length;if(r!==n.length)return!1;for(let e=0;e{},this.oldProps=N,this.oldAsyncProps=null}finalize(){for(const e in this.asyncProps){const t=this.asyncProps[e];t.type&&t.type.release&&t.type.release(t.resolvedValue,t.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}freezeAsyncOldProps(){if(!this.oldAsyncProps){this.oldProps=this.oldProps||this.component.props,this.oldAsyncProps=Object.create(this.oldProps);for(const e in this.asyncProps)Object.defineProperty(this.oldAsyncProps,e,{enumerable:!0,value:this.oldProps[e]})}}hasAsyncProp(e){return e in this.asyncProps}getAsyncProp(e){e=this.asyncProps[e];return e&&e.resolvedValue}isAsyncPropLoading(e){if(e)return e=this.asyncProps[e],Boolean(e&&0=r.resolvedLoadCount&&void 0!==t&&(this.freezeAsyncOldProps(),r.resolvedValue=t,r.resolvedLoadCount=n,this.onAsyncPropUpdated(e,t))}_watchPromise(r,e){const i=this.asyncProps[r],o=(i.pendingLoadCount++,i.pendingLoadCount);e.then(e=>{var t;e=this._postProcessValue(i,e),this._setAsyncPropValue(r,e,o);const n=null==(t=this.layer)?void 0:t.props.onDataLoad;"data"===r&&n&&n(e,{propName:r,layer:this.layer})}).catch(e=>{var t;null!=(t=this.layer)&&t.raiseError(e,"loading ".concat(r," of ").concat(this.layer))})}async _resolveAsyncIterable(e,t){"data"!==e&&this._setPropValue(e,t);const n=this.asyncProps[e];n.pendingLoadCount++;var r=n.pendingLoadCount;let i=[],o=0;for await(const s of t){const A=(this.component?this.component.props:{})["dataTransform"];i=A?A(s,i):i.concat(s),Object.defineProperty(i,"__diff",{enumerable:!1,value:[{startRow:o,endRow:i.length}]}),o=i.length,this._setAsyncPropValue(e,i,r)}const a=null==(t=this.layer)?void 0:t.props.onDataLoad;a&&a(i,{propName:e,layer:this.layer})}_postProcessValue(e,t){const n=e.type;return n&&(n.release&&n.release(e.resolvedValue,n,this.component),n.transform)?n.transform(t,n,this.component):t}_createAsyncPropData(e,t){var n;this.asyncProps[e]||(n=this.component&&this.component.constructor._propTypes,this.asyncProps[e]={type:n&&n[e],lastValue:null,resolvedValue:t,pendingLoadCount:0,resolvedLoadCount:0})}}const{ASYNC_ORIGINAL:y,ASYNC_RESOLVED:B,ASYNC_DEFAULTS:k}=u.b;let T=0;class component_Component{constructor(){this.props=function createProps(){var e=getPropsPrototype(this.constructor);const t=Object.create(e);t[f]=this,t[I]={},t[C]={};for(let e=0;ee.equals(t));let v=new Uint8ClampedArray(0);e={data:{type:"data",value:t,async:!0},dataComparator:null,_dataDiff:{type:"function",value:e=>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},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(e,{propName:t,layer:n,loaders:r,loadOptions:i,signal:o})=>{const a=n.context["resourceManager"];var s;i=i||n.getLoadOptions(),r=r||n.props.loaders,o&&(i={...i,fetch:{...null==(s=i)?void 0:s.fetch,signal:o}});let A=a.contains(e);return A||i||(a.add({resourceId:e,data:Object(b.a)(e,r),persistent:!1}),A=!0),A?a.subscribe({resourceId:e,onChange:e=>n.internalState.reloadAsyncProp(t,e),consumerId:n.id,requestId:t}):Object(b.a)(e,r,i)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},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:n.a.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:({layerIndex:e})=>[0,100*-e],compare:!1},highlightedObjectIndex:-1,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class layer_Layer extends component_Component{toString(){var e=this.constructor.layerName||this.constructor.name;return"".concat(e,"({id: '").concat(this.props.id,"'})")}raiseError(e,t){var n;t&&(e.message="".concat(t,": ").concat(e.message)),null!=(n=(t=this.props).onError)&&n.call(t,e)||null==(n=this.context)||null!=(t=n.onError)&&t.call(n,e,this)}setState(e){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,e),this.setNeedsRedraw()}setNeedsRedraw(e=!0){this.internalState&&(this.internalState.needsRedraw=e)}setNeedsUpdate(){this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0}getNeedsRedraw(e={clearRedrawFlags:!1}){return this._getNeedsRedraw(e)}needsUpdate(){return this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams())}hasUniformTransition(){return this.internalState.uniformTransitions.active}get isLoaded(){return this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||(this.state.model?[this.state.model]:[]))}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}project(e){var t=this.context["viewport"],n=Object(g.a)(e,{viewport:t,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[n,t,r]=Object(M.s)(n,t.pixelProjectionMatrix);return 2===e.length?[n,t]:[n,t,r]}unproject(e){const t=this.context["viewport"];return t.unproject(e)}projectPosition(e){return Object(g.b)(e,{viewport:this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem})}use64bitPositions(){var e=this.props["coordinateSystem"];return e===n.a.DEFAULT||e===n.a.LNGLAT||e===n.a.CARTESIAN}onHover(e,t){return!!this.props.onHover&&this.props.onHover(e,t)}onClick(e,t){return!!this.props.onClick&&this.props.onClick(e,t)}nullPickingColor(){return[0,0,0]}encodePickingColor(e,t=[]){return t[0]=e+1&255,t[1]=e+1>>8&255,t[2]=e+1>>8>>8&255,t}decodePickingColor(e){Object(c.a)(e instanceof Uint8Array);var[e,t,n]=e;return e+256*t+65536*n-1}initializeState(){throw new Error("Layer ".concat(this," has not defined initializeState"))}getShaders(e){for(const t of this.props.extensions)e=Object(S.a)(e,t.getShaders.call(this,t));return e}shouldUpdateState({changeFlags:e}){return e.propsOrDataChanged}updateState({oldProps:e,props:t,changeFlags:n}){const r=this.getAttributeManager();if(n.dataChanged&&r){n=n["dataChanged"];if(Array.isArray(n))for(const i of n)r.invalidateAll(i);else r.invalidateAll()}n=0<=e.highlightedObjectIndex||e.pickable,e=0<=t.highlightedObjectIndex||t.pickable;if(n!==e&&r){var{pickingColors:t,instancePickingColors:n}=r.attributes;const o=t||n;o&&(e&&o.constant&&(o.constant=!1,r.invalidate(o.id)),o.value||e||(o.constant=!0,o.value=[0,0,0]))}}finalizeState(){for(const t of this.getModels())t.delete();const e=this.getAttributeManager();e&&e.finalize(),this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState.uniformTransitions.clear(),this.internalState.finalize()}draw(e){for(const t of this.getModels())t.draw(e)}getPickingInfo({info:e}){var t=e["index"];return 0<=t&&Array.isArray(this.props.data)&&(e.object=this.props.data[t]),e}activateViewport(e){var t=this.internalState.viewport;this.internalState.viewport=e,t&&U({oldViewport:t,viewport:e})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(e="all",t){const n=this.getAttributeManager();n&&("all"===e?n.invalidateAll():n.invalidate(e))}updateAttributes(e){for(const t of this.getModels())this._setModelAttributes(t,e)}_updateAttributes(e){const t=this.getAttributeManager();var n,r;t&&(r=this.getNumInstances(e),n=this.getStartIndices(e),t.update({data:e.data,numInstances:r,startIndices:n,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this,ignoreUnknownAttributes:!0}),r=t.getChangedAttributes({clearChangedFlags:!0}),this.updateAttributes(r))}_updateAttributeTransition(){const e=this.getAttributeManager();e&&e.updateTransition()}_updateUniformTransition(){const e=this.internalState["uniformTransitions"];if(e.active){var t=e.update(),n=Object.create(this.props);for(const r in t)Object.defineProperty(n,r,{value:t[r]});return n}return this.props}calculateInstancePickingColors(e,{numInstances:t}){if(!e.constant){var n=Math.floor(v.length/3);if(this.internalState.usesPickingColorCache=!0,n{var e={moduleParameters:n,uniforms:r,parameters:i,context:this.context};for(const t of this.props.extensions)t.draw.call(this,e,t);this.draw(e)})}finally{this.props=e}}getChangeFlags(){return this.internalState.changeFlags}setChangeFlags(t){const n=this.internalState["changeFlags"];for(const r in t)if(t[r]){let e=!1;"dataChanged"===r&&Array.isArray(n[r])&&(n[r]=Array.isArray(t[r])?n[r].concat(t[r]):t[r],e=!0),n[r]||(n[r]=t[r],e=!0),e&&Object(i.a)("layer.changeFlag",this,r,t)}var e=n.dataChanged||n.updateTriggersChanged||n.propsChanged||n.extensionsChanged;n.propsOrDataChanged=e,n.somethingChanged=e||t.viewportChanged||t.stateChanged}clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}diffProps(e,t){var n=Object(o.b)(e,t);if(n.updateTriggersChanged)for(const r in n.updateTriggersChanged)n.updateTriggersChanged[r]&&this.invalidateAttribute(r);if(n.transitionsChanged)for(const i in n.transitionsChanged)this.internalState.uniformTransitions.add(i,t[i],e[i],e.transitions[i]);return this.setChangeFlags(n)}validateProps(){Object(o.c)(this.props)}setModuleParameters(e){for(const t of this.getModels())t.updateModuleSettings(e)}updateAutoHighlight(e){this.props.autoHighlight&&this._updateAutoHighlight(e)}_updateAutoHighlight(e){const t={pickingSelectedColor:e.picked?e.color:null},n=this.props["highlightColor"];e.picked&&"function"==typeof n&&(t.pickingHighlightColor=n(e)),this.setModuleParameters(t),this.setNeedsRedraw()}_updateModules({props:e,oldProps:t},n){var{autoHighlight:e,highlightedObjectIndex:r,highlightColor:i}=e;if(n||t.autoHighlight!==e||t.highlightedObjectIndex!==r||t.highlightColor!==i){const o={};e||(o.pickingSelectedColor=null),Array.isArray(i)&&(o.pickingHighlightColor=i),Number.isInteger(r)&&(o.pickingSelectedColor=0<=r?this.encodePickingColor(r):null),this.setModuleParameters(o)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(e){if(!this.internalState)return!1;var t=this.internalState.needsRedraw&&this.id;this.internalState.needsRedraw=this.internalState.needsRedraw&&!e.clearRedrawFlags;const n=this.getAttributeManager();e=n&&n.getNeedsRedraw(e);return t||e}_getAttributeManager(){return new r.a(this.context.gl,{id:this.props.id,stats:this.context.stats,timeline:this.context.timeline})}_initState(){Object(c.a)(!this.internalState&&!this.state),Object(c.a)(isFinite(this.props.coordinateSystem));const e=this._getAttributeManager();e&&e.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new layer_state_LayerState({attributeManager:e,layer:this}),this.clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(l.a.deprecated("layer.state.attributeManager","layer.getAttributeManager()"),e)}),(this.internalState.layer=this).internalState.uniformTransitions=new uniform_transition_manager_UniformTransitionManager(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props)}_transferState(e){Object(i.a)("layer.matched",this,this===e);var{state:t,internalState:n}=e;this!==e&&(this.internalState=n,(this.internalState.layer=this).state=t,this.internalState.setAsyncProps(this.props),this.diffProps(this.props,this.internalState.getOldProps()))}_onAsyncPropUpdated(){this.diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}layer_Layer.layerName="Layer",layer_Layer.defaultProps=e},function(e,t,n){"use strict";n.d(t,"a",function(){return attribute_manager_AttributeManager});var s=n(692),A=n(379),l=n(62);class ShaderAttribute{constructor(e,t){this.opts=t,this.source=e}get value(){return this.source.value}getValue(){var e=this.source.getBuffer(),t=this.getAccessor();if(e)return[e,t];var n=this.source["value"],r=t["size"];let i=n;if(n&&n.length!==r){i=new Float32Array(r);var o=t.elementOffset||0;for(let e=0;e(e+128)/255*2-1);case 5122:return new Float32Array(e).map(e=>(e+32768)/65535*2-1);case 5121:return new Float32Array(e).map(e=>e/255);case 5123:return new Float32Array(e).map(e=>e/65535);default:return e}}_normalizeValue(t,n,r){var{defaultValue:i,size:o}=this.settings;if(Number.isFinite(t))return n[r]=t,n;if(!t)return n[r]=i[0],n;switch(o){case 4:n[r+3]=(Number.isFinite(t[3])?t:i)[3];case 3:n[r+2]=(Number.isFinite(t[2])?t:i)[2];case 2:n[r+1]=(Number.isFinite(t[1])?t:i)[1];case 1:n[r+0]=(Number.isFinite(t[0])?t:i)[0];break;default:let e=o;for(;0<=--e;)n[r+e]=(Number.isFinite(t[e])?t:i)[e]}return n}_areValuesEqual(t,n){if(!t||!n)return!1;var r=this["size"];for(let e=0;et[e])]:t[e];return Object(d.e)(r,n)}setNeedsUpdate(e=this.id,t){this.state.needsUpdate=this.state.needsUpdate||e,this.setNeedsRedraw(e),t?({startRow:e=0,endRow:t=1/0}=t,this.state.updateRanges=function add(t,n){if(t===u)return t;if(n[0]<0&&(n[0]=0),n[0]>=n[1])return t;const r=[];var i=t.length;let o=0;for(let e=0;en[1]?r.push(a):n=[Math.min(a[0],n[0]),Math.max(a[1],n[1])]}return r.splice(o,0,n),r}(this.state.updateRanges,[e,t])):this.state.updateRanges=u}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=r}setNeedsRedraw(e=this.id){this.state.needsRedraw=this.state.needsRedraw||e}update(e){this.setData(e)}allocate(e){var{state:t,settings:n}=this;return!n.noAlloc&&(!!n.update&&(super.allocate({numInstances:e,copy:t.updateRanges!==u}),!0))}updateBuffer({numInstances:e,data:t,props:n,context:r}){if(!this.needsUpdate())return!1;const{state:{updateRanges:i},settings:{update:o,noAlloc:a}}=this;let s=!0;if(o){for(var[A,l]of i)o.call(r,this,{data:t,startRow:A,endRow:l,props:n,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLengthg?c.set(t,n):(r._normalizeValue(t,I.target,0),Object(b.a)({target:c,source:I.target,start:n,count:s}));n+=s*g}else r._normalizeValue(t,c,n),n+=g}}}_validateAttributeUpdaters(){var e=this["settings"];if(!(e.noAlloc||"function"==typeof e.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){var t=this["value"],n=Math.min(4,this.size);if(t&&t.length>=n){let e=!0;switch(n){case 4:e=e&&Number.isFinite(t[3]);case 3:e=e&&Number.isFinite(t[2]);case 2:e=e&&Number.isFinite(t[1]);case 1:e=e&&Number.isFinite(t[0]);break;default:e=!1}if(!e)throw new Error("Illegal attribute generated for ".concat(this.id))}}}var h=n(59),i=n(1226),o=n(138);const p="\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n vCurrent = mix(aFrom, aTo, time);\n gl_Position = vec4(0.0);\n}\n";var f=n(485),I=n(208),C=n(137);const m={interpolation:class gpu_interpolation_transition_GPUInterpolationTransition{constructor({gl:e,attribute:t,timeline:n}){this.gl=e,this.type="interpolation",this.transition=new o.a(n),this.attribute=t,this.attributeInTransition=new attribute_Attribute(e,t.settings),this.currentStartIndices=t.startIndices,this.currentLength=0,this.transform=function getTransform(e,t){t=Object(d.c)(t.size);return new i.a(e,{vs:p,defines:{ATTRIBUTE_TYPE:t},varyings:["vCurrent"]})}(e,t);n={byteLength:0,usage:35050};this.buffers=[new l.a(e,n),new l.a(e,n)]}get inProgress(){return this.transition.inProgress}start(e,t){if(e.duration<=0)this.transition.cancel();else{var{gl:n,buffers:r,attribute:i}=this,o=(Object(d.a)(r),{numInstances:t,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter});for(const a of r)Object(d.f)({buffer:a,...o});this.currentStartIndices=i.startIndices,this.currentLength=Object(d.b)(i,t),this.attributeInTransition.update({buffer:r[1],value:i.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aFrom:r[0],aTo:Object(d.d)(n,i)},feedbackBuffers:{vCurrent:r[1]}})}}update(){var e=this.transition.update();if(e){const{time:n,settings:{duration:r,easing:i}}=this.transition;var t=i(n/r);this.transform.run({uniforms:{time:t}})}return e}cancel(){for(this.transition.cancel(),this.transform.delete();this.buffers.length;)this.buffers.pop().delete()}},spring:class gpu_spring_transition_GPUSpringTransition{constructor({gl:e,attribute:t,timeline:n}){this.gl=e,this.type="spring",this.transition=new o.a(n),this.attribute=t,this.attributeInTransition=new attribute_Attribute(e,{...t.settings,normalized:!1}),this.currentStartIndices=t.startIndices,this.currentLength=0,this.texture=function getTexture(e){return new I.a(e,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function getFramebuffer(e,t){return new C.a(e,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{[36064]:t}})}(e,this.texture),this.transform=function gpu_spring_transition_getTransform(e,t,n){t=Object(d.c)(t.size);return new i.a(e,{framebuffer:n,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n ATTRIBUTE_TYPE velocity = cur - prev;\n ATTRIBUTE_TYPE delta = dest - cur;\n ATTRIBUTE_TYPE spring = delta * stiffness;\n ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n vNext = getNextValue(aCur, aPrev, aTo);\n gl_Position = vec4(0, 0, 0, 1);\n gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n if (vIsTransitioningFlag == 0.0) {\n discard;\n }\n gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:t},varyings:["vNext"]})}(e,t,this.framebuffer);n={byteLength:0,usage:35050};this.buffers=[new l.a(e,n),new l.a(e,n),new l.a(e,n)]}get inProgress(){return this.transition.inProgress}start(e,t){var{gl:n,buffers:r,attribute:i}=this,o={numInstances:t,attribute:i,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:e.enter};for(const a of r)Object(d.f)({buffer:a,...o});this.currentStartIndices=i.startIndices,this.currentLength=Object(d.b)(i,t),this.attributeInTransition.update({buffer:r[1],value:i.value}),this.transition.start(e),this.transform.update({elementCount:Math.floor(this.currentLength/i.size),sourceBuffers:{aTo:Object(d.d)(n,i)}})}update(){const{buffers:e,transform:t,framebuffer:n,transition:r}=this;return!!r.update()&&(t.update({sourceBuffers:{aPrev:e[0],aCur:e[1]},feedbackBuffers:{vNext:e[2]}}),t.run({framebuffer:n,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.settings.stiffness,damping:r.settings.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),Object(d.a)(e),this.attributeInTransition.update({buffer:e[1],value:this.attribute.value}),0{t[e]||(t[e]=[]),t[e].push(n)})}this.updateTriggers=t}_invalidateTrigger(e,n){const{attributes:r,updateTriggers:t}=this,i=t[e];return i&&i.forEach(e=>{const t=r[e];t&&t.setNeedsUpdate(t.id,n)}),i}_updateAttribute(e){const{attribute:t,numInstances:n}=e;Object(h.a)("attribute.updateStart",t),t.constant?t.setConstantValue(t.value):(t.allocate(n)&&Object(h.a)("attribute.allocate",t,n),t.updateBuffer(e)&&(this.needsRedraw=!0,Object(h.a)("attribute.updateEnd",t,n)))}}},function(e,t,n){"use strict";n.d(t,"a",function(){return text_layer_TextLayer});var t=n(461),d=n(94),F=n(349),r=n(650),y=n.n(r),B=n(28);const b=32,v=[];function buildMapping({characterSet:e,getFontWidth:t,fontHeight:n,buffer:r,maxCanvasWidth:i,mapping:o={},xOffset:a=0,yOffset:s=0}){let A=0,l=a,c=0;for(const u of e){var g;o[u]||(g=t(u,c++),l+g+2*r>i&&(l=0,A++),o[u]={x:l+r,y:s+A*(n+2*r)+r,width:g,height:n},l+=g+2*r)}a=n+2*r;return{mapping:o,xOffset:l,yOffset:s+A*a,canvasHeight:function nextPowOfTwo(e){return Math.pow(2,Math.ceil(Math.log2(e)))}(s+(A+1)*a)}}function getTextWidth(n,e,r,i){let o=0;for(let t=e;ti&&(sA){let e=getTextWidth(t,A,l,o);c+e>i&&(si&&(e=breakAll(t,A,l,i,o,a),s=a[a.length-1])),A=l,c+=e}c})(e,i,o=void 0===o?e.length:o,n,r,a),a}function transformParagraph(t,n,r,i,o){var a=(t=Array.from(t)).length;const s=new Array(a),A=new Array(a),l=new Array(a);var c=("break-word"===r||"break-all"===r)&&isFinite(i)&&0h){var I=c?autoWrapping(t,r,i,o,h,p):v;for(let e=0;e<=I.length;e++){var C=0===e?h:I[e-1],m=ee===t);0<=e&&this._order.splice(e,1)}_appendOrder(e){this._order.push(e)}}(3),s=["fontFamily","fontWeight","characterSet","fontSize","sdf","buffer","cutoff","radius"];function setTextStyle(e,t,n,r){e.font="".concat(r," ").concat(n,"px ").concat(t),e.fillStyle="#000",e.textBaseline="baseline",e.textAlign="left"}class font_atlas_manager_FontAtlasManager{constructor(){this.props={fontFamily:o,fontWeight:"normal",characterSet:i,fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12},this._key=null,this._atlas=null}get texture(){return this._atlas}get mapping(){return this._atlas&&this._atlas.mapping}get scale(){return 1.2}setProps(t={}){s.forEach(e=>{e in t&&(this.props[e]=t[e])});var e=this._key,n=(this._key=this._getKey(),function getNewChars(e,t){if(!(e=a.get(e)))return t;const n=[];e=e.mapping;let r=Object.keys(e),i=(r=new Set(r),t);return(i=i instanceof Array?new Set(i):i).forEach(e=>{r.has(e)||n.push(e)}),n}(this._key,this.props.characterSet)),r=a.get(this._key);r&&0===n.length?this._key!==e&&(this._atlas=r):(e=this._generateFontAtlas(this._key,n,r),this._atlas=e,a.set(this._key,e))}_generateFontAtlas(e,t,n){var{fontFamily:r,fontWeight:i,fontSize:o,buffer:a,sdf:s,radius:A,cutoff:l}=this.props;let c=n&&n.data;c||((c=document.createElement("canvas")).width=1024);const g=c.getContext("2d");setTextStyle(g,r,o,i);var u,{mapping:d,canvasHeight:n,xOffset:h,yOffset:p}=buildMapping({getFontWidth:e=>g.measureText(e).width,fontHeight:1.2*o,buffer:a,characterSet:t,maxCanvasWidth:1024,...n&&{mapping:n.mapping,xOffset:n.xOffset,yOffset:n.yOffset}});if(c.height!==n&&(u=g.getImageData(0,0,c.width,c.height),c.height=n,g.putImageData(u,0,0)),setTextStyle(g,r,o,i),s){const I=new y.a(o,a,A,l,r,i);var f=g.getImageData(0,0,I.size,I.size);for(const C of t)!function populateAlphaChannel(t,n){for(let e=0;ee.text},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:r},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};class text_layer_TextLayer extends t.a{initializeState(){this.state={styleVersion:0,fontAtlasManager:new font_atlas_manager_FontAtlasManager}}updateState({props:e,oldProps:t,changeFlags:n}){var n=n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getText),r=this.state.characterSet,n=(n&&this._updateText(),r!==this.state.characterSet||this._fontChanged(t,e)),r=(n&&this._updateFontAtlas(t,e),n||e.lineHeight!==t.lineHeight||e.wordBreak!==t.wordBreak||e.maxWidth!==t.maxWidth);r&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo({info:e}){return e.object=0<=e.index?this.props.data[e.index]:null,e}_updateFontAtlas(e,t){var{fontSettings:t,fontFamily:n,fontWeight:r}=t;const{fontAtlasManager:i,characterSet:o}=this.state;i.setProps({...G,...t,characterSet:o,fontFamily:n,fontWeight:r})}_fontChanged(e,t){if(e.fontFamily!==t.fontFamily||e.fontWeight!==t.fontWeight)return!0;if(e.fontSettings===t.fontSettings)return!1;const n=e.fontSettings||{},r=t.fontSettings||{};return A.some(e=>n[e]!==r[e])}_updateText(){var{data:e,characterSet:t}=this.props,n=e.attributes&&e.attributes.getText;let r=this.props["getText"],i=e["startIndices"],o;var a="auto"===t&&new Set;if(n&&i){const{texts:s,characterCount:A}=function getTextFromBuffer({value:t,length:n,stride:e,offset:r,startIndices:i,characterSet:o}){var a=t.BYTES_PER_ELEMENT,s=e?e/a:1,A=r?r/a:0,l=i[n]||Math.ceil((t.length-A)/s),c=o&&new Set;const g=new Array(n);let u=t;if(1s[t]}else{const{iterable:l,objectInfo:c}=Object(d.a)(e);i=[0],o=0;for(const g of l){c.index++;const u=Array.from(r(g,c)||"");a&&u.forEach(a.add,a),o+=u.length,i.push(o)}}this.setState({getText:r,startIndices:i,numInstances:o,characterSet:a||t})}getBoundingRect(e,t){var n=this.state.fontAtlasManager.mapping;const r=this.state["getText"],{wordBreak:i,maxWidth:o,lineHeight:a,getTextAnchor:s,getAlignmentBaseline:A}=this.props;var[n,l]=transformParagraph(r(e,t)||"",a,i,o,n)["size"];return[(E["function"==typeof s?s(e,t):s]-1)*n/2,(Q["function"==typeof A?A(e,t):A]-1)*l/2,n,l]}getIconOffsets(e,t){var n=this.state.fontAtlasManager.mapping;const r=this.state["getText"],{wordBreak:i,maxWidth:o,lineHeight:a,getTextAnchor:s,getAlignmentBaseline:A}=this.props;var{x:l,y:c,rowWidth:g,size:[u,d]}=transformParagraph(r(e,t)||"",a,i,o,n),h=E["function"==typeof s?s(e,t):s],p=Q["function"==typeof A?A(e,t):A],f=l.length;const I=new Array(2*f);let C=0;for(let e=0;e=r),i=i.flatMap(e=>[e[0],e[1]]),Object(B.h)(i,B.a.COUNTER_CLOCKWISE));const o=0e.position},getFillColor:{type:"accessor",value:l},getLineColor:{type:"accessor",value:l},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class column_layer_ColumnLayer extends t.a{getShaders(){return super.getShaders({vs:"\n#define SHADER_NAME column-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 normals;\n\nattribute vec3 instancePositions;\nattribute float instanceElevations;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute float instanceStrokeWidths;\n\nattribute vec3 instancePickingColors;\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nvarying vec4 vColor;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n\n vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n float elevation = 0.0;\n float strokeOffsetRatio = 1.0;\n\n if (extruded) {\n elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n } else if (isStroke) {\n float widthPixels = clamp(project_size_to_pixel(instanceStrokeWidths * widthScale),\n widthMinPixels, widthMaxPixels) / 2.0;\n strokeOffsetRatio -= sign(positions.z) * project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n }\n float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n float dotRadius = radius * coverage * shouldRender;\n\n geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n geometry.pickingColor = instancePickingColors;\n vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n vec3 centroidPosition64Low = instancePositions64Low;\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, centroidPosition64Low, 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}\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:[r.a,i.a,o.a]})}initializeState(){const e=this.getAttributeManager();e.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:l},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:l},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n});var r,i,n=n.extensionsChanged;n&&(i=this.context["gl"],null!=(r=this.state.model)&&r.delete(),this.state.model=this._getModel(i),this.getAttributeManager().invalidateAll()),!n&&e.diskResolution===t.diskResolution&&e.vertices===t.vertices&&(e.extruded||e.stroked)===(t.extruded||t.stroked)||this._updateGeometry(e)}getGeometry(t,n,e){e=new column_geometry_ColumnGeometry({radius:1,height:e?2:0,vertices:n,nradial:t});let r=0;if(n)for(let e=0;ee.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:n},getLineColor:{type:"accessor",value:n},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class scatterplot_layer_ScatterplotLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceRadius;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool billboard;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n outerRadiusPixels = clamp(\n project_size_to_pixel(radiusScale * instanceRadius),\n radiusMinPixels, radiusMaxPixels\n );\n float lineWidthPixels = clamp(\n project_size_to_pixel(lineWidthScale * instanceLineWidths),\n lineWidthMinPixels, lineWidthMaxPixels\n );\n outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n unitPosition = positions.xy;\n geometry.uv = unitPosition;\n geometry.pickingColor = instancePickingColors;\n\n innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\n \n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = positions * outerRadiusPixels;\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset = positions * project_pixel_size(outerRadiusPixels);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n }\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME scatterplot-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n geometry.uv = unitPosition;\n\n float distToCenter = length(unitPosition) * outerRadiusPixels;\n float inCircle = antialiasing ? \n smoothedge(distToCenter, outerRadiusPixels) : \n step(distToCenter, outerRadiusPixels);\n\n if (inCircle == 0.0) {\n discard;\n }\n\n if (stroked > 0.5) {\n float isLine = antialiasing ? \n smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\n step(innerUnitRadius * outerRadiusPixels, distToCenter);\n\n if (filled) {\n gl_FragColor = mix(vFillColor, vLineColor, isLine);\n } else {\n if (isLine == 0.0) {\n discard;\n }\n gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n }\n } else if (filled) {\n gl_FragColor = vFillColor;\n } else {\n discard;\n }\n\n gl_FragColor.a *= inCircle;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{radiusUnits:n,radiusScale:r,radiusMinPixels:i,radiusMaxPixels:o,stroked:a,filled:s,billboard:A,antialiasing:l,lineWidthUnits:c,lineWidthScale:g,lineWidthMinPixels:u,lineWidthMaxPixels:d}=this.props,n="pixels"===n?t.metersPerPixel:1,c="pixels"===c?t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({stroked:a?1:0,filled:s,billboard:A,antialiasing:l,radiusScale:r*n,radiusMinPixels:i,radiusMaxPixels:o,lineWidthScale:g*c,lineWidthMinPixels:u,lineWidthMaxPixels:d}).draw()}_getModel(e){return new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.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})}}scatterplot_layer_ScatterplotLayer.layerName="ScatterplotLayer",scatterplot_layer_ScatterplotLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return text_background_layer_TextBackgroundLayer});var t=n(342),r=n(508),i=n(509),o=n(377),a=n(116),n={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:e=>e.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};class text_background_layer_TextBackgroundLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n float angle_radian = radians(angle);\n float cos_angle = cos(angle_radian);\n float sin_angle = sin(angle_radian);\n mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n geometry.worldPosition = instancePositions;\n geometry.uv = positions;\n geometry.pickingColor = instancePickingColors;\n uv = positions;\n vLineWidth = instanceLineWidths;\n float sizePixels = clamp(\n project_size_to_pixel(instanceSizes * sizeScale),\n sizeMinPixels, sizeMaxPixels\n );\n\n dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n pixelOffset += instancePixelOffsets;\n pixelOffset.y *= -1.0;\n\n if (billboard) {\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n vec3 offset = vec3(pixelOffset, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n } else {\n vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n DECKGL_FILTER_SIZE(offset_common, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n DECKGL_FILTER_COLOR(vFillColor, geometry);\n vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n geometry.uv = uv;\n\n vec2 pixelPosition = uv * dimensions;\n if (stroked) {\n float distToEdge = min(\n min(pixelPosition.x, dimensions.x - pixelPosition.x),\n min(pixelPosition.y, dimensions.y - pixelPosition.y)\n );\n float isBorder = smoothedge(distToEdge, vLineWidth);\n gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n } else {\n gl_FragColor = vFillColor;\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{billboard:n,sizeScale:r,sizeUnits:i,sizeMinPixels:o,sizeMaxPixels:a,getLineWidth:s}=this.props;let A=this.props["padding"];i="pixels"===i?t.metersPerPixel:1;A.length<4&&(A=[A[0],A[1],A[0],A[1]]),this.state.model.setUniforms(e).setUniforms({billboard:n,stroked:Boolean(s),padding:A,sizeScale:r*i,sizeMinPixels:o,sizeMaxPixels:a}).draw()}_getModel(e){return new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.a({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0})}}text_background_layer_TextBackgroundLayer.layerName="TextBackgroundLayer",text_background_layer_TextBackgroundLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return layer_manager_LayerManager});var o=n(1216),r=n(82),a=n(28),i=n(59),s=n(122),A=n(290),l=n(1223);class resource_Resource{constructor(e,t,n){this.id=e,this.context=n,this._loadCount=0,this._subscribers=new Set,this.setData(t)}subscribe(e){this._subscribers.add(e)}unsubscribe(e){this._subscribers.delete(e)}inUse(){return 0this.getData())}setData(t,e){if(t!==this._data||e){this._data=t;const n=++this._loadCount;let e=t;(e="string"==typeof t?Object(l.a)(t):e)instanceof Promise?(this.isLoaded=!1,this._loader=e.then(e=>{this._loadCount===n&&(this.isLoaded=!0,this._error=null,this._content=e)}).catch(e=>{this._loadCount===n&&(this.isLoaded=!0,this._error=e||!0)})):(this.isLoaded=!0,this._error=null,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}}class resource_manager_ResourceManager{constructor({gl:e,protocol:t}){this.protocol=t||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(e){return!!e.startsWith(this.protocol)||e in this._resources}add({resourceId:e,data:t,forceUpdate:n=!1,persistent:r=!0}){let i=this._resources[e];i?i.setData(t,n):(i=new resource_Resource(e,t,this._context),this._resources[e]=i),i.persistent=r}remove(e){const t=this._resources[e];t&&(t.delete(),delete this._resources[e])}unsubscribe({consumerId:e}){var t=this._consumers[e];if(t){for(const n in t){const r=t[n];r.resource&&r.resource.unsubscribe(r)}delete this._consumers[e],this.prune()}}subscribe({resourceId:e,onChange:t,consumerId:n,requestId:r="default"}){var{_resources:i,protocol:o}=this;e.startsWith(o)&&!i[e=e.replace(o,"")]&&this.add({resourceId:e,data:null,persistent:!1});const a=i[e];if(this._track(n,r,a,t),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout(()=>this._prune(),0))}finalize(){for(const e in this._resources)this._resources[e].delete()}_track(e,t,n,r){const i=this._consumers,o=i[e]=i[e]||{},a=o[t]||{};a.resource&&(a.resource.unsubscribe(a),a.resource=null,this.prune()),n&&((o[t]=a).onChange=r,(a.resource=n).subscribe(a))}_prune(){this._pruneRequest=null;for(const e of Object.keys(this._resources)){const t=this._resources[e];t.persistent||t.inUse()||(t.delete(),delete this._resources[e])}}}var c=n(76),g=n(350);const u=Object.seal({layerManager:null,resourceManager:null,deck:null,gl:null,stats:null,shaderCache:null,pickingFBO:null,mousePosition:null,userData:{}});class layer_manager_LayerManager{constructor(e,{deck:t,stats:n,viewport:r,timeline:i}={}){this.lastRenderedLayers=[],this.layers=[],this.resourceManager=new resource_manager_ResourceManager({gl:e,protocol:"deck://"}),this.context={...u,layerManager:this,gl:e,deck:t,programManager:e&&Object(g.a)(e),stats:n||new A.a({id:"deck.gl"}),viewport:r||new c.a({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:i||new o.a,resourceManager:this.resourceManager},this._nextLayers=null,this._needsRedraw="Initial render",this._needsUpdate=!1,this._debug=!1,this.activateViewport=this.activateViewport.bind(this),Object.seal(this)}finalize(){this.resourceManager.finalize();for(const e of this.layers)this._finalizeLayer(e)}needsRedraw(e={clearRedrawFlags:!1}){let t=this._needsRedraw;e.clearRedrawFlags&&(this._needsRedraw=!1);for(const r of this.layers){var n=r.getNeedsRedraw(e);t=t||n}return t}needsUpdate(){return this._nextLayers&&this._nextLayers!==this.lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(e){this._needsRedraw=this._needsRedraw||e}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e}getLayers({layerIds:e=null}={}){return e?this.layers.filter(t=>e.find(e=>0===t.id.indexOf(e))):this.layers}setProps(e){"debug"in e&&(this._debug=e.debug),"userData"in e&&(this.context.userData=e.userData),"layers"in e&&(this._nextLayers=e.layers),"onError"in e&&(this.context.onError=e.onError)}setLayers(e,t){Object(i.a)("layerManager.setLayers",this,t,e),this.lastRenderedLayers=e;for(const n of e=Object(s.b)(e,Boolean))n.context=this.context;return this._updateLayers(this.layers,e),this}updateLayers(){var e=this.needsUpdate();e&&(this.setNeedsRedraw("updating layers: ".concat(e)),this.setLayers(this._nextLayers||this.lastRenderedLayers,e)),this._nextLayers=null}activateViewport(e){return Object(i.a)("layerManager.activateViewport",this,e),e&&(this.context.viewport=e),this}_handleError(e,t,n){n.raiseError(t,"".concat(e," of ").concat(n))}_updateLayers(e,t){const n={};for(const i of e)n[i.id]?a.a.warn("Multiple old layers with same id ".concat(i.id))():n[i.id]=i;e=[];this._updateSublayersRecursively(t,n,e),this._finalizeOldLayers(n);let r=!1;for(const o of e)if(o.hasUniformTransition()){r=!0;break}this._needsUpdate=r,this.layers=e}_updateSublayersRecursively(e,t,n){for(const i of e){i.context=this.context;var r=t[i.id];null===r&&a.a.warn("Multiple new layers with same id ".concat(i.id))();let e=t[i.id]=null;try{this._debug&&r!==i&&i.validateProps(),r?(this._transferLayerState(r,i),this._updateLayer(i)):this._initializeLayer(i),n.push(i),e=i.isComposite&&i.getSubLayers()}catch(e){this._handleError("matching",e,i)}e&&this._updateSublayersRecursively(e,t,n)}}_finalizeOldLayers(e){for(const n in e){var t=e[n];t&&this._finalizeLayer(t)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=r.a.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(e,t){t._transferState(e),t.lifecycle=r.a.MATCHED,t!==e&&(e.lifecycle=r.a.AWAITING_GC)}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=r.a.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=r.a.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}},function(e,t,n){"use strict";n.d(t,"a",function(){return multi_icon_layer_MultiIconLayer});var r=n(28),t=n(247);const i=[];class multi_icon_layer_MultiIconLayer extends t.a{getShaders(){return{...super.getShaders(),fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n geometry.uv = uv;\n\n if (!picking_uActive) {\n float alpha = texture2D(iconsTexture, vTextureCoords).a;\n vec4 color = vColor;\n if (sdf) {\n float distance = alpha;\n alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n if (outlineBuffer > 0.0) {\n float inFill = alpha;\n float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n color = mix(outlineColor, vColor, inFill);\n alpha = inBorder;\n }\n }\n float a = alpha * color.a;\n \n if (a < alphaCutoff) {\n discard;\n }\n\n gl_FragColor = vec4(color.rgb, a * opacity);\n }\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"}}initializeState(){super.initializeState();const e=this.getAttributeManager();e.addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(e,{index:t,target:n})=>this.encodePickingColor(t,n)}})}updateState(e){super.updateState(e);var{props:e,oldProps:t}=e;let n=e["outlineColor"];n!==t.outlineColor&&((n=n.map(e=>e/255))[3]=Number.isFinite(n[3])?n[3]:1,this.setState({outlineColor:n})),!e.sdf&&e.outlineWidth&&r.a.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(e){var{sdf:t,smoothing:n,outlineWidth:r}=this.props,i=this.state["outlineColor"];e.uniforms={...e.uniforms,buffer:.75,outlineBuffer:r?Math.max(n,.75*(1-r)):-1,gamma:n,sdf:Boolean(t),outlineColor:i},super.draw(e)}getInstanceOffset(e){return e?Array.from(e).map(e=>super.getInstanceOffset(e)):i}getInstanceColorMode(e){return 1}getInstanceIconFrame(e){return e?Array.from(e).map(e=>super.getInstanceIconFrame(e)):i}}multi_icon_layer_MultiIconLayer.layerName="MultiIconLayer",multi_icon_layer_MultiIconLayer.defaultProps={getIconOffsets:{type:"accessor",value:e=>e.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}}},function(e,t,n){"use strict";n.d(t,"a",function(){return createProgramManager});var i=n(689);const o=[{name:"geometry",vs:"\nstruct VertexGeometry {\n vec4 position;\n vec3 worldPosition;\n vec3 worldPositionAlt;\n vec3 normal;\n vec2 uv;\n vec3 pickingColor;\n} geometry;\n",fs:"\n#define SMOOTH_EDGE_RADIUS 0.5\n\nstruct FragmentGeometry {\n vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n"},n(201).a],a=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function createProgramManager(e){const t=i.a.getDefaultProgramManager(e);for(const n of o)t.addDefaultModule(n);for(const r of a)t.addShaderHook(r);return t}},function(e,t,n){"use strict";n.d(t,"a",function(){return deck_renderer_DeckRenderer});var r=n(59);class draw_layers_pass_DrawLayersPass extends n(176).a{}var i=n(367),o=n(137);class deck_renderer_DeckRenderer{constructor(e){this.gl=e,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new draw_layers_pass_DrawLayersPass(e),this.pickLayersPass=new i.a(e),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(e){"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")}renderLayers(e){const t=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;e.layerFilter=this.layerFilter,e.effects=e.effects||[],e.target=e.target||o.a.getDefaultFramebuffer(this.gl),this._preRender(e.effects,e);var n=this.lastPostProcessEffect?this.renderBuffers[0]:e.target,n=t.render({...e,target:n});this._postRender(e.effects,e),this.renderCount++,Object(r.a)("deckRenderer.renderLayers",this,n,e)}needsRedraw(e={clearRedrawFlags:!1}){var t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}finalize(){const e=this["renderBuffers"];for(const t of e)t.delete();e.length=0}_preRender(e,t){let n=null;for(const r of e)r.preRender(this.gl,t),r.postRender&&(n=r);n&&this._resizeRenderBuffers(),this.lastPostProcessEffect=n}_resizeRenderBuffers(){const e=this["renderBuffers"];0===e.length&&e.push(new o.a(this.gl),new o.a(this.gl));for(const t of e)t.resize()}_postRender(e,t){var n=this["renderBuffers"];const r={inputBuffer:n[0],swapBuffer:n[1],target:null};for(const o of e)if(o.postRender){if(o===this.lastPostProcessEffect){r.target=t.target,o.postRender(this.gl,r);break}var i=o.postRender(this.gl,r);r.inputBuffer=i,r.swapBuffer=i===n[0]?n[1]:n[0]}}}},function(e,t,n){"use strict";var r=n(132),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},c={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function getStatics(e){return r.isMemo(e)?o:a[e.$$typeof]||i}a[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[r.Memo]=o;var g=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,f=Object.prototype;e.exports=function hoistNonReactStatics(e,t,n){if("string"!=typeof t){f&&(r=p(t))&&r!==f&&hoistNonReactStatics(e,r,n);for(var r,i=u(t),o=(d&&(i=i.concat(d(t))),getStatics(e)),a=getStatics(t),s=0;s{o.methodName||(o[e]=()=>{throw a.k.removed(`Calling removed method ${t}.${e}: `,i)(),new Error(e)})})}},function(e,t,n){"use strict";n.d(t,"a",function(){return getBinaryImageMetadata});const s=!1,r=!0;function getBinaryImageMetadata(e){e=toDataView(e);return function getPngMetadata(e){const t=toDataView(e),n=24<=t.byteLength&&2303741511===t.getUint32(0,s);return n?{mimeType:"image/png",width:t.getUint32(16,s),height:t.getUint32(20,s)}:null}(e)||function getJpegMetadata(e){const t=toDataView(e),n=3<=t.byteLength&&65496===t.getUint16(0,s)&&255===t.getUint8(2);if(!n)return null;const{tableMarkers:r,sofMarkers:i}=function getJpegMarkers(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);var e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9e&&i<=l&&(s=e),o<=l){A=e;break}}let c=s;var e=A-s!==r.length,g=e&&t.slice(A);for(let e=0;e{super.render({target:o,layers:e,layerFilter:t,views:n,viewports:r,onViewportActive:i,pass:c,redrawReason:g})})}shouldDrawLayer(e){return e.props.pickable}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(e,t){t=this.pickZ?{blend:!1}:{...p,blend:!0,blendColor:[0,0,0,this.useAlpha?(t+1)/255:1]};return{...e.props.parameters,...t}}}},function(e,t,n){var r=n(526),i=n(6),o=n(31),a=n(73).default,s=o.featureEach,A=(o.coordEach,i.polygon,i.featureCollection);function geojsonRbush(e){e=new r(e);return e.insert=function(e){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox||a(e),r.prototype.insert.call(this,e)},e.load=function(e){var t=[];return Array.isArray(e)?e.forEach(function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox||a(e),t.push(e)}):s(e,function(e){if("Feature"!==e.type)throw new Error("invalid features");e.bbox=e.bbox||a(e),t.push(e)}),r.prototype.load.call(this,t)},e.remove=function(e,t){if("Feature"!==e.type)throw new Error("invalid feature");return e.bbox=e.bbox||a(e),r.prototype.remove.call(this,e,t)},e.clear=function(){return r.prototype.clear.call(this)},e.search=function(e){e=r.prototype.search.call(this,this.toBBox(e));return A(e)},e.collides=function(e){return r.prototype.collides.call(this,this.toBBox(e))},e.all=function(){var e=r.prototype.all.call(this);return A(e)},e.toJSON=function(){return r.prototype.toJSON.call(this)},e.fromJSON=function(e){return r.prototype.fromJSON.call(this,e)},e.toBBox=function(e){var t;if(e.bbox)t=e.bbox;else if(Array.isArray(e)&&4===e.length)t=e;else if(Array.isArray(e)&&6===e.length)t=[e[0],e[1],e[3],e[4]];else if("Feature"===e.type)t=a(e);else{if("FeatureCollection"!==e.type)throw new Error("invalid geojson");t=a(e)}return{minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]}},e}e.exports=geojsonRbush,e.exports.default=geojsonRbush},function(e,t,n){"use strict";var i=n(6),r=n(15);function calculateRhumbBearing(e,t){var n=Object(i.degreesToRadians)(e[1]),r=Object(i.degreesToRadians)(t[1]),t=Object(i.degreesToRadians)(t[0]-e[0]),e=(t>Math.PI&&(t-=2*Math.PI),t<-Math.PI&&(t+=2*Math.PI),Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4))),r=Math.atan2(t,e);return(Object(i.radiansToDegrees)(r)+360)%360}t.a=function rhumbBearing(e,t,n){return 180<(n=(n=void 0===n?{}:n).final?calculateRhumbBearing(Object(r.getCoord)(t),Object(r.getCoord)(e)):calculateRhumbBearing(Object(r.getCoord)(e),Object(r.getCoord)(t)))?-(360-n):n}},function(e,t){e.exports=function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,n){"use strict";!function(b){function createDetectElementResize(i,e){var t,n,o=void 0!==e?e:"undefined"!=typeof window?window:"undefined"!=typeof self?self:b,a=void 0!==o.document&&o.document.attachEvent;if(!a){n=o.requestAnimationFrame||o.mozRequestAnimationFrame||o.webkitRequestAnimationFrame||function(e){return o.setTimeout(e,20)};var r=function(e){return n(e)},s=(t=o.cancelAnimationFrame||o.mozCancelAnimationFrame||o.webkitCancelAnimationFrame||o.clearTimeout,function(e){return t(e)}),A=function resetTriggers(e){var e=e.__resizeTriggers__,t=e.firstElementChild,e=e.lastElementChild,n=t.firstElementChild;e.scrollLeft=e.scrollWidth,e.scrollTop=e.scrollHeight,n.style.width=t.offsetWidth+1+"px",n.style.height=t.offsetHeight+1+"px",t.scrollLeft=t.scrollWidth,t.scrollTop=t.scrollHeight},l=function checkTriggers(e){return e.offsetWidth!=e.__resizeLast__.width||e.offsetHeight!=e.__resizeLast__.height},c=function scrollListener(t){var n;t.target.className&&"function"==typeof t.target.className.indexOf&&t.target.className.indexOf("contract-trigger")<0&&t.target.className.indexOf("expand-trigger")<0||(A(n=this),this.__resizeRAF__&&s(this.__resizeRAF__),this.__resizeRAF__=r(function(){l(n)&&(n.__resizeLast__.width=n.offsetWidth,n.__resizeLast__.height=n.offsetHeight,n.__resizeListeners__.forEach(function(e){e.call(n,t)}))}))},g=!1,u="",d="animationstart",h="Webkit Moz O ms".split(" "),p="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),f=o.document.createElement("fakeelement");if(!1===(g=void 0!==f.style.animationName?!0:g))for(var I=0;I div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',n=e.head||e.getElementsByTagName("head")[0],(r=e.createElement("style")).id="detectElementResize",r.type="text/css",null!=i&&r.setAttribute("nonce",i),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(e.createTextNode(t)),n.appendChild(r))};return{addResizeListener:function addResizeListener(t,e){var n,r,i;a?t.attachEvent("onresize",e):(t.__resizeTriggers__||(n=t.ownerDocument,(i=o.getComputedStyle(t))&&"static"==i.position&&(t.style.position="relative"),B(n),t.__resizeLast__={},t.__resizeListeners__=[],(t.__resizeTriggers__=n.createElement("div")).className="resize-triggers",r='
',window.trustedTypes?(i=trustedTypes.createPolicy("react-virtualized-auto-sizer",{createHTML:function createHTML(){return r}}),t.__resizeTriggers__.innerHTML=i.createHTML("")):t.__resizeTriggers__.innerHTML=r,t.appendChild(t.__resizeTriggers__),A(t),t.addEventListener("scroll",c,!0),d&&(t.__resizeTriggers__.__animationListener__=function animationListener(e){e.animationName==C&&A(t)},t.__resizeTriggers__.addEventListener(d,t.__resizeTriggers__.__animationListener__))),t.__resizeListeners__.push(e))},removeResizeListener:function removeResizeListener(e,t){if(a)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",c,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(d,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}n.d(t,"a",function(){return createDetectElementResize})}.call(this,n(64))},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){var n,r={};for(n in e)0<=t.indexOf(n)||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}},function(e,t,n){"use strict";!function(e){e="object"==typeof e&&e&&e.Object===Object&&e;t.a=e}.call(this,n(64))},function(e,t,n){"use strict";var r=n(75),i=n(106),i=(Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i(n(0))),r=(0,r(n(107)).default)(i.createElement("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"}),"Add");t.default=r},function(e,At,lt){"use strict";!function(e){lt.d(At,"a",function(){return embed}),lt.d(At,"b",function(){return k});var T=lt(690),_=lt(384),M=lt.n(_),G=lt(144),U=lt(681),_=lt(687),O=lt(480),L=lt(683),P=lt(684);function asyncGeneratorStep(e,t,n,r,i,o,a){try{var s=e[o](a),A=s.value}catch(e){return void n(e)}s.done?t(A):Promise.resolve(A).then(r,i)}function _asyncToGenerator(o){return function(){var e=this,i=arguments;return new Promise(function(t,n){var r=o.apply(e,i);function _next(e){asyncGeneratorStep(r,t,n,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(r,t,n,_next,_throw,"throw",e)}_next(void 0)})}}var s,t=Object.prototype,A=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},x=n.iterator||"@@iterator",r=n.asyncIterator||"@@asyncIterator",R=n.toStringTag||"@@toStringTag";function wrap(e,t,n,r){t=t&&t.prototype instanceof Generator?t:Generator,t=Object.create(t.prototype),r=new Context(r||[]);return t._invoke=function makeInvokeMethod(r,i,o){var a=F;return function invoke(e,t){if(a===V)throw new Error("Generator is already running");if(a===Z){if("throw"===e)throw t;return doneResult()}for(o.method=e,o.arg=t;;){var n=o.delegate;if(n){n=function maybeInvokeDelegate(e,t){var n=e.iterator[t.method];if(n===s){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=s,maybeInvokeDelegate(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}n=tryCatch(n,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,l;n=n.arg;if(!n)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l;{if(!n.done)return n;t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=s)}t.delegate=null;return l}(n,o);if(n){if(n===l)continue;return n}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(a===F)throw a=Z,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);a=V;n=tryCatch(r,i,o);if("normal"===n.type){if(a=o.done?Z:D,n.arg!==l)return{value:n.arg,done:o.done}}else"throw"===n.type&&(a=Z,o.method="throw",o.arg=n.arg)}}}(e,n,r),t}function tryCatch(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}var F="suspendedStart",D="suspendedYield",V="executing",Z="completed",l={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var n={},i=(n[x]=function(){return this},Object.getPrototypeOf),i=i&&i(i(values([]))),o=(i&&i!==t&&A.call(i,x)&&(n=i),GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(n));function defineIteratorMethods(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function isGeneratorFunction(e){e="function"==typeof e&&e.constructor;return!!e&&(e===GeneratorFunction||"GeneratorFunction"===(e.displayName||e.name))}function AsyncIterator(o,a){var e;this._invoke=function enqueue(n,r){function callInvokeWithMethodAndArg(){return new a(function(e,t){!function invoke(e,t,n,r){var i,e=tryCatch(o[e],o,t);if("throw"!==e.type)return(t=(i=e.arg).value)&&"object"==typeof t&&A.call(t,"__await")?a.resolve(t.__await).then(function(e){invoke("next",e,n,r)},function(e){invoke("throw",e,n,r)}):a.resolve(t).then(function(e){i.value=e,n(i)},function(e){return invoke("throw",e,n,r)});r(e.arg)}(n,r,e,t)})}return e=e?e.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function pushTryEntry(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 resetTryEntry(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(pushTryEntry,this),this.reset(!0)}function values(e){if(e){var t,n=e[x];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return t=-1,(n=function next(){for(;++tthis.length&&(t=this.length);for(var r=0,i=this.head;null!==i&&rthis.length&&(t=this.length);for(var r=this.length,i=this.tail;null!==i&&tthis.length?this.length-1:e)<0&&(e=this.length+e);for(var n=0,r=this.head;null!==r&&n1;var z=(e,t,n)=>{t=e[f].get(t);if(t){var r=t.value;if(J(e,r)){if(C(e,t),!e[u])return}else n&&(e[j]&&(t.value.now=Date.now()),e[p].unshiftNode(t));return r.value}},J=(e,t)=>{if(!t||!t.maxAge&&!e[d])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[d]&&n>e[d]},I=e=>{if(e[c]>e[a])for(var t=e[p].tail;e[c]>e[a]&&null!==t;){var n=t.prev;C(e,t),t=n}},C=(e,t)=>{var n;t&&(n=t.value,e[h]&&e[h](n.key,n.value),e[c]-=n.length,e[f].delete(n.key),e[p].removeNode(t))};class Entry{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}var K,X,m,y,q,$=(e,t,n,r)=>{var i=n.value;J(e,i)&&(C(e,n),e[u]||(i=void 0)),i&&t.call(r,i.value,i.key,e)},i=class LRUCache{constructor(e){if((e=(e="number"==typeof e?{max:e}:e)||{}).max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[a]=e.max||1/0;var t=e.length||Y;if(this[g]="function"!=typeof t?Y:t,this[u]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[d]=e.maxAge||0,this[h]=e.dispose,this[H]=e.noDisposeOnSet||!1,this[j]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,I(this)}get max(){return this[a]}set allowStale(e){this[u]=!!e}get allowStale(){return this[u]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[d]=e,I(this)}get maxAge(){return this[d]}set lengthCalculator(e){(e="function"!=typeof e?Y:e)!==this[g]&&(this[g]=e,this[c]=0,this[p].forEach(e=>{e.length=this[g](e.value,e.key),this[c]+=e.length})),I(this)}get lengthCalculator(){return this[g]}get length(){return this[c]}get itemCount(){return this[p].length}rforEach(e,t){t=t||this;for(var n=this[p].tail;null!==n;){var r=n.prev;$(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(var n=this[p].head;null!==n;){var r=n.next;$(this,e,n,t),n=r}}keys(){return this[p].toArray().map(e=>e.key)}values(){return this[p].toArray().map(e=>e.value)}reset(){this[h]&&this[p]&&this[p].length&&this[p].forEach(e=>this[h](e.key,e.value)),this[f]=new Map,this[p]=new W,this[c]=0}dump(){return this[p].map(e=>!J(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[p]}set(e,t,n){if((n=n||this[d])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[g](t,e);if(this[f].has(e)){if(i>this[a])return C(this,this[f].get(e)),!1;var o=this[f].get(e).value;return this[h]&&!this[H]&&this[h](e,o.value),o.now=r,o.maxAge=n,o.value=t,this[c]+=i-o.length,o.length=i,this.get(e),I(this),!0}o=new Entry(e,t,i,r,n);return o.length>this[a]?(this[h]&&this[h](e,t),!1):(this[c]+=o.length,this[p].unshift(o),this[f].set(e,this[p].head),I(this),!0)}has(e){if(!this[f].has(e))return!1;e=this[f].get(e).value;return!J(this,e)}get(e){return z(this,e,!0)}peek(e){return z(this,e,!1)}pop(){var e=this[p].tail;return e?(C(this,e),e.value):null}del(e){C(this,this[f].get(e))}load(e){this.reset();for(var t=Date.now(),n=e.length-1;0<=n;n--){var r=e[n],i=r.e||0;0===i?this.set(r.k,r.v):0<(i=i-t)&&this.set(r.k,r.v,i)}}prune(){this[f].forEach((e,t)=>z(this,t,!1))}},ee=["includePrerelease","loose","rtl"],n=t=>t?"object"!=typeof t?{loose:!0}:ee.filter(e=>t[e]).reduce((e,t)=>(e[t]=!0,e),{}):{},r={exports:{}},t={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},e="object"==typeof e&&e.env&&e.env.NODE_DEBUG&&/\bsemver\b/i.test(e.env.NODE_DEBUG)?function(){for(var e=arguments.length,t=new Array(e),n=0;n{},te=(b=(v=r).exports,B=t.MAX_SAFE_COMPONENT_LENGTH,K=e,X=(b=v.exports={}).re=[],m=b.src=[],y=b.t={},q=0,(v=(e,t,n)=>{var r=q++;K(r,t),y[e]=r,m[r]=t,X[r]=new RegExp(t,n?"g":void 0)})("NUMERICIDENTIFIER","0|[1-9]\\d*"),v("NUMERICIDENTIFIERLOOSE","[0-9]+"),v("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),v("MAINVERSION","(".concat(m[y.NUMERICIDENTIFIER],")\\.")+"(".concat(m[y.NUMERICIDENTIFIER],")\\.")+"(".concat(m[y.NUMERICIDENTIFIER],")")),v("MAINVERSIONLOOSE","(".concat(m[y.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(m[y.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(m[y.NUMERICIDENTIFIERLOOSE],")")),v("PRERELEASEIDENTIFIER","(?:".concat(m[y.NUMERICIDENTIFIER],"|").concat(m[y.NONNUMERICIDENTIFIER],")")),v("PRERELEASEIDENTIFIERLOOSE","(?:".concat(m[y.NUMERICIDENTIFIERLOOSE],"|").concat(m[y.NONNUMERICIDENTIFIER],")")),v("PRERELEASE","(?:-(".concat(m[y.PRERELEASEIDENTIFIER],"(?:\\.").concat(m[y.PRERELEASEIDENTIFIER],")*))")),v("PRERELEASELOOSE","(?:-?(".concat(m[y.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(m[y.PRERELEASEIDENTIFIERLOOSE],")*))")),v("BUILDIDENTIFIER","[0-9A-Za-z-]+"),v("BUILD","(?:\\+(".concat(m[y.BUILDIDENTIFIER],"(?:\\.").concat(m[y.BUILDIDENTIFIER],")*))")),v("FULLPLAIN","v?".concat(m[y.MAINVERSION]).concat(m[y.PRERELEASE],"?").concat(m[y.BUILD],"?")),v("FULL","^".concat(m[y.FULLPLAIN],"$")),v("LOOSEPLAIN","[v=\\s]*".concat(m[y.MAINVERSIONLOOSE]).concat(m[y.PRERELEASELOOSE],"?").concat(m[y.BUILD],"?")),v("LOOSE","^".concat(m[y.LOOSEPLAIN],"$")),v("GTLT","((?:<|>)?=?)"),v("XRANGEIDENTIFIERLOOSE","".concat(m[y.NUMERICIDENTIFIERLOOSE],"|x|X|\\*")),v("XRANGEIDENTIFIER","".concat(m[y.NUMERICIDENTIFIER],"|x|X|\\*")),v("XRANGEPLAIN","[v=\\s]*(".concat(m[y.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIER],")")+"(?:".concat(m[y.PRERELEASE],")?").concat(m[y.BUILD],"?")+")?)?"),v("XRANGEPLAINLOOSE","[v=\\s]*(".concat(m[y.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(m[y.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(m[y.PRERELEASELOOSE],")?").concat(m[y.BUILD],"?")+")?)?"),v("XRANGE","^".concat(m[y.GTLT],"\\s*").concat(m[y.XRANGEPLAIN],"$")),v("XRANGELOOSE","^".concat(m[y.GTLT],"\\s*").concat(m[y.XRANGEPLAINLOOSE],"$")),v("COERCE","".concat("(^|[^\\d])(\\d{1,").concat(B,"})")+"(?:\\.(\\d{1,".concat(B,"}))?")+"(?:\\.(\\d{1,".concat(B,"}))?")+"(?:$|[^\\d])"),v("COERCERTL",m[y.COERCE],!0),v("LONETILDE","(?:~>?)"),v("TILDETRIM","(\\s*)".concat(m[y.LONETILDE],"\\s+"),!0),b.tildeTrimReplace="$1~",v("TILDE","^".concat(m[y.LONETILDE]).concat(m[y.XRANGEPLAIN],"$")),v("TILDELOOSE","^".concat(m[y.LONETILDE]).concat(m[y.XRANGEPLAINLOOSE],"$")),v("LONECARET","(?:\\^)"),v("CARETTRIM","(\\s*)".concat(m[y.LONECARET],"\\s+"),!0),b.caretTrimReplace="$1^",v("CARET","^".concat(m[y.LONECARET]).concat(m[y.XRANGEPLAIN],"$")),v("CARETLOOSE","^".concat(m[y.LONECARET]).concat(m[y.XRANGEPLAINLOOSE],"$")),v("COMPARATORLOOSE","^".concat(m[y.GTLT],"\\s*(").concat(m[y.LOOSEPLAIN],")$|^$")),v("COMPARATOR","^".concat(m[y.GTLT],"\\s*(").concat(m[y.FULLPLAIN],")$|^$")),v("COMPARATORTRIM","(\\s*)".concat(m[y.GTLT],"\\s*(").concat(m[y.LOOSEPLAIN],"|").concat(m[y.XRANGEPLAIN],")"),!0),b.comparatorTrimReplace="$1$2$3",v("HYPHENRANGE","^\\s*(".concat(m[y.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(m[y.XRANGEPLAIN],")")+"\\s*$"),v("HYPHENRANGELOOSE","^\\s*(".concat(m[y.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(m[y.XRANGEPLAINLOOSE],")")+"\\s*$"),v("STAR","(<|>)?=?\\s*\\*"),v("GTE0","^\\s*>=\\s*0.0.0\\s*$"),v("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$"),/^[0-9]+$/),B=(e,t)=>{var n=te.test(e),r=te.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r||(!r||n)&&ere)throw new TypeError("version is longer than ".concat(re," characters"));if(ne("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,!(t=e.trim().match(t.loose?oe[ae.LOOSE]:oe[ae.FULL])))throw new TypeError("Invalid Version: ".concat(e));if(this.raw=e,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>ie||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ie||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ie||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){var t=+e;if(0<=t&&tnew le(e,n).compare(new le(t,n)),ce=B,ge=B,ue=B,de=B,he=B,pe=B,fe=(e,t,n)=>0===ce(e,t,n),Ie=(e,t,n)=>0!==ge(e,t,n),Ce=(e,t,n)=>00<=de(e,t,n),ye=(e,t,n)=>he(e,t,n)<0,Be=(e,t,n)=>pe(e,t,n)<=0,t=(e,t,n,r)=>{switch(t){case"===":return(e="object"==typeof e?e.version:e)===(n="object"==typeof n?n.version:n);case"!==":return(e="object"==typeof e?e.version:e)!==(n="object"==typeof n?n.version:n);case"":case"=":case"==":return fe(e,n,r);case"!=":return Ie(e,n,r);case">":return Ce(e,n,r);case">=":return me(e,n,r);case"<":return ye(e,n,r);case"<=":return Be(e,n,r);default:throw new TypeError("Invalid operator: ".concat(t))}},be=Symbol("SemVer ANY");var b=class Comparator$1{static get ANY(){return be}constructor(e,t){if(t=ve(t),e instanceof Comparator$1){if(e.loose===!!t.loose)return e;e=e.value}Se("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===be?this.value="":this.value=this.operator+this.semver.version,Se("comp",this)}parse(e){var t=this.options.loose?Ee[Qe.COMPARATORLOOSE]:Ee[Qe.COMPARATOR];if(!(t=e.match(t)))throw new TypeError("Invalid comparator: ".concat(e));this.operator=void 0!==t[1]?t[1]:"","="===this.operator&&(this.operator=""),t[2]?this.semver=new _e(t[2],this.options.loose):this.semver=be}toString(){return this.value}test(e){if(Se("Comparator.test",e,this.options.loose),this.semver===be||e===be)return!0;if("string"==typeof e)try{e=new _e(e,this.options)}catch(e){return!1}return we(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator$1))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new xe(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new xe(this.value,t).test(e.semver);var n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,o=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),a=we(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),t=we(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||i&&o||a||t}},ve=n,Ee=r.exports.re,Qe=r.exports.t,we=t,Se=e,_e=v,xe=void 0;function _createForOfIteratorHelper(t,r){var i,o="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!o){if(Array.isArray(t)||(o=function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}(t))||r&&t&&"number"==typeof t.length)return o&&(t=o),i=0,{s:r=function F(){},n:function n(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function e(t){throw t},f:r};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,A=!0,l=!1;return{s:function s(){o=o.call(t)},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nthis.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw new TypeError("Invalid SemVer Range: ".concat(e));if(1!Me(e[0])),0===this.set.length)this.set=[t];else if(1e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){e=e.trim();var t=Object.keys(this.options).join(","),t="parseRange:".concat(t,":").concat(e),n=Re.get(t);if(n)return n;var r,i=(n=this.options.loose)?Q[w.HYPHENRANGELOOSE]:Q[w.HYPHENRANGE],o=(e=e.replace(i,Je(this.options.includePrerelease)),E("hyphen replace",e),e=e.replace(Q[w.COMPARATORTRIM],Ne),E("comparator trim",e,Q[w.COMPARATORTRIM]),e=(e=(e=e.replace(Q[w.TILDETRIM],ke)).replace(Q[w.CARETTRIM],Te)).split(/\s+/).join(" "),n?Q[w.COMPARATORLOOSE]:Q[w.COMPARATOR]),a=((i=e.split(" ").map(e=>Le(e,this.options)).join(" ").split(/\s+/).map(e=>ze(e,this.options)).filter(this.options.loose?e=>!!e.match(o):()=>!0).map(e=>new De(e,this.options))).length,new Map),s=_createForOfIteratorHelper(i);try{for(s.s();!(r=s.n()).done;){var A=r.value;if(Me(A))return[A];a.set(A.value,A)}}catch(e){s.e(e)}finally{s.f()}return 1Oe(t,n)&&e.set.some(e=>Oe(e,n)&&t.every(t=>e.every(e=>t.intersects(e,n)))));throw new TypeError("a Range is required")}test(e){if(!e)return!1;if("string"==typeof e)try{e=new Ge(e,this.options)}catch(e){return!1}for(var t=0;t"<0.0.0-0"===e.value,Ue=e=>""===e.value,Oe=(e,t)=>{for(var n=!0,r=e.slice(),i=r.pop();n&&r.length;)n=r.every(e=>i.intersects(e,t)),i=r.pop();return n},Le=(e,t)=>(E("comp",e,t),e=Ze(e,t),E("caret",e),e=Pe(e,t),E("tildes",e),e=He(e,t),E("xrange",e),e=Ye(e,t),E("stars",e),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,Pe=(e,t)=>e.trim().split(/\s+/).map(e=>Ve(e,t)).join(" "),Ve=(o,e)=>{e=e.loose?Q[w.TILDELOOSE]:Q[w.TILDE];return o.replace(e,(e,t,n,r,i)=>{return E("tilde",o,e,t,n,r,i),e=S(t)?"":S(n)?">=".concat(t,".0.0 <").concat(+t+1,".0.0-0"):S(r)?">=".concat(t,".").concat(n,".0 <").concat(t,".").concat(+n+1,".0-0"):i?(E("replaceTilde pr",i),">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(t,".").concat(+n+1,".0-0")):">=".concat(t,".").concat(n,".").concat(r," <").concat(t,".").concat(+n+1,".0-0"),E("tilde return",e),e})},Ze=(e,t)=>e.trim().split(/\s+/).map(e=>We(e,t)).join(" "),We=(o,e)=>{E("caret",o,e);var t=e.loose?Q[w.CARETLOOSE]:Q[w.CARET],a=e.includePrerelease?"-0":"";return o.replace(t,(e,t,n,r,i)=>{return E("caret",o,e,t,n,r,i),e=S(t)?"":S(n)?">=".concat(t,".0.0").concat(a," <").concat(+t+1,".0.0-0"):S(r)?"0"===t?">=".concat(t,".").concat(n,".0").concat(a," <").concat(t,".").concat(+n+1,".0-0"):">=".concat(t,".").concat(n,".0").concat(a," <").concat(+t+1,".0.0-0"):i?(E("replaceCaret pr",i),"0"===t?"0"===n?">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(t,".").concat(n,".").concat(+r+1,"-0"):">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(t,".").concat(+n+1,".0-0"):">=".concat(t,".").concat(n,".").concat(r,"-").concat(i," <").concat(+t+1,".0.0-0")):(E("no pr"),"0"===t?"0"===n?">=".concat(t,".").concat(n,".").concat(r).concat(a," <").concat(t,".").concat(n,".").concat(+r+1,"-0"):">=".concat(t,".").concat(n,".").concat(r).concat(a," <").concat(t,".").concat(+n+1,".0-0"):">=".concat(t,".").concat(n,".").concat(r," <").concat(+t+1,".0.0-0")),E("caret return",e),e})},He=(e,t)=>(E("replaceXRanges",e,t),e.split(/\s+/).map(e=>je(e,t)).join(" ")),je=(l,c)=>{l=l.trim();var e=c.loose?Q[w.XRANGELOOSE]:Q[w.XRANGE];return l.replace(e,(e,t,n,r,i,o)=>{E("xRange",l,e,t,n,r,i,o);var a=S(n),s=a||S(r),A=s||S(i);return"="===t&&A&&(t=""),o=c.includePrerelease?"-0":"",a?e=">"===t||"<"===t?"<0.0.0-0":"*":t&&A?(s&&(r=0),i=0,">"===t?(t=">=",i=s?(n=+n+1,r=0):(r=+r+1,0)):"<="===t&&(t="<",s?n=+n+1:r=+r+1),"<"===t&&(o="-0"),e="".concat(t+n,".").concat(r,".").concat(i).concat(o)):s?e=">=".concat(n,".0.0").concat(o," <").concat(+n+1,".0.0-0"):A&&(e=">=".concat(n,".").concat(r,".0").concat(o," <").concat(n,".").concat(+r+1,".0-0")),E("xRange return",e),e})},Ye=(e,t)=>(E("replaceStars",e,t),e.trim().replace(Q[w.STAR],"")),ze=(e,t)=>(E("replaceGTE0",e,t),e.trim().replace(Q[t.includePrerelease?w.GTE0PRE:w.GTE0],"")),Je=d=>(e,t,n,r,i,o,a,s,A,l,c,g,u)=>(t=S(n)?"":S(r)?">=".concat(n,".0.0").concat(d?"-0":""):S(i)?">=".concat(n,".").concat(r,".0").concat(d?"-0":""):o?">=".concat(t):">=".concat(t).concat(d?"-0":""),s=S(A)?"":S(l)?"<".concat(+A+1,".0.0-0"):S(c)?"<".concat(A,".").concat(+l+1,".0-0"):g?"<=".concat(A,".").concat(l,".").concat(c,"-").concat(g):d?"<".concat(A,".").concat(l,".").concat(+c+1,"-0"):"<=".concat(s),"".concat(t," ").concat(s).trim()),Ke=(e,t,n)=>{for(var r=0;r{try{t=new Xe(t,n)}catch(e){return!1}return t.test(e)};function post(t,e,n){var r=t.open(e),i=new URL(e).origin,o=40;t.addEventListener("message",function listen(e){e.source===r&&(o=0,t.removeEventListener("message",listen,!1))},!1),setTimeout(function send(){o<=0||(r.postMessage(n,i),setTimeout(send,250),--o)},250)}var $e='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n outline: none;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid #0000;\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid #0000;\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';function mergeDeep(e){for(var t=arguments.length,n=new Array(1e,"vega-lite":(e,t)=>et.compile(e,{config:t}).spec},at='\n\n \n \n \n',st="chart-wrapper";function viewSource(e,t,n,r){var t="".concat(t,'
'),n="
".concat(n,""),i=window.open("");i.document.write(t+e+n),i.document.title="".concat(rt[r]," JSON Source")}function createLoader(e){return function isLoader(e){return e&&"load"in e}(e)?e:k.loader(e)}function embedOptionsFromUsermeta(e){return null!=(e=e.usermeta&&e.usermeta.embedOptions)?e:{}}function embed(e,t){return _embed2.apply(this,arguments)}function _embed2(){return(_embed2=_asyncToGenerator(N.mark(function _callee(t,n){var r,i,o,a,s,A,l,c=arguments;return N.wrap(function _callee$(e){for(;;)switch(e.prev=e.next){case 0:if(r=2{t=t.type;"fit-x"==t?(f.classList.add("fit-x"),f.classList.remove("fit-y")):"fit-y"==t?(f.classList.remove("fit-x"),f.classList.add("fit-y")):"fit"==t?f.classList.add("fit-x","fit-y"):f.classList.remove("fit-x","fit-y")}),!1!==i.tooltip&&(v=function isTooltipHandler(e){return"function"==typeof e}(i.tooltip)?i.tooltip:new P.a(!0===i.tooltip?{}:i.tooltip).call,m.tooltip(v)),(B=void 0===(B=i.hover)?"vega"===d:B)&&(B=(v="boolean"==typeof B?{}:B).hoverSet,v=v.updateSet,m.hover(B,v)),i&&(null!=i.width&&m.width(i.width),null!=i.height&&m.height(i.height),null!=i.padding&&m.padding(i.padding)),e.next=36,m.initialize(f,i.bind).runAsync();case 36:if(!1!==s){if(B=u,!1!==i.defaultStyle&&((b=document.createElement("details")).title=A.CLICK_TO_VIEW_ACTIONS,u.append(b),B=b,(v=document.createElement("summary")).innerHTML=at,b.append(v),y=e=>{b.contains(e.target)||b.removeAttribute("open")},document.addEventListener("click",y)),E=document.createElement("div"),B.append(E),E.classList.add("vega-actions"),!0===s||!1!==s.export)for(Q=function _loop(){var e,t,r=S[w];!0!==s&&!0!==s.export&&!s.export[r]||(e=A["".concat(r.toUpperCase(),"_ACTION")],(t=document.createElement("a")).text=e,t.href="#",t.target="_blank",t.download="".concat(g,".").concat(r),t.addEventListener("mousedown",function(){var t=_asyncToGenerator(N.mark(function _callee3(t){var n;return N.wrap(function _callee3$(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),e.next=3,m.toImageURL(r,i.scaleFactor);case 3:n=e.sent,this.href=n;case 5:case"end":return e.stop()}},_callee3,this)}));return function(e){return t.apply(this,arguments)}}()),E.append(t))},w=0,S=["svg","png"];wt[e.name]);return new schema_Schema(e,this.metadata)}selectAt(...e){e=e.map(e=>this.fields[e]).filter(Boolean);return new schema_Schema(e,this.metadata)}assign(e){let t,n=this.metadata;e instanceof schema_Schema?(i=e,t=i.fields,n=mergeMaps(mergeMaps(new Map,this.metadata),i.metadata)):t=e;const r=Object.create(null);for(const o of this.fields)r[o.name]=o;for(const a of t)r[a.name]=a;var i=Object.values(r);return new schema_Schema(i,n)}}function mergeMaps(e,t){return new Map([...e||new Map,...t||new Map])}let n;(u=n=n||{})[u.NONE=0]="NONE",u[u.Null=1]="Null",u[u.Int=2]="Int",u[u.Float=3]="Float",u[u.Binary=4]="Binary",u[u.Utf8=5]="Utf8",u[u.Bool=6]="Bool",u[u.Decimal=7]="Decimal",u[u.Date=8]="Date",u[u.Time=9]="Time",u[u.Timestamp=10]="Timestamp",u[u.Interval=11]="Interval",u[u.List=12]="List",u[u.Struct=13]="Struct",u[u.Union=14]="Union",u[u.FixedSizeBinary=15]="FixedSizeBinary",u[u.FixedSizeList=16]="FixedSizeList",u[u.Map=17]="Map",u[u.Dictionary=-1]="Dictionary",u[u.Int8=-2]="Int8",u[u.Int16=-3]="Int16",u[u.Int32=-4]="Int32",u[u.Int64=-5]="Int64",u[u.Uint8=-6]="Uint8",u[u.Uint16=-7]="Uint16",u[u.Uint32=-8]="Uint32",u[u.Uint64=-9]="Uint64",u[u.Float16=-10]="Float16",u[u.Float32=-11]="Float32",u[u.Float64=-12]="Float64",u[u.DateDay=-13]="DateDay",u[u.DateMillisecond=-14]="DateMillisecond",u[u.TimestampSecond=-15]="TimestampSecond",u[u.TimestampMillisecond=-16]="TimestampMillisecond",u[u.TimestampMicrosecond=-17]="TimestampMicrosecond",u[u.TimestampNanosecond=-18]="TimestampNanosecond",u[u.TimeSecond=-19]="TimeSecond",u[u.TimeMillisecond=-20]="TimeMillisecond",u[u.TimeMicrosecond=-21]="TimeMicrosecond",u[u.TimeNanosecond=-22]="TimeNanosecond",u[u.DenseUnion=-23]="DenseUnion",u[u.SparseUnion=-24]="SparseUnion",u[u.IntervalDayTime=-25]="IntervalDayTime",u[u.IntervalYearMonth=-26]="IntervalYearMonth";class type_DataType{static isNull(e){return e&&e.typeId===n.Null}static isInt(e){return e&&e.typeId===n.Int}static isFloat(e){return e&&e.typeId===n.Float}static isBinary(e){return e&&e.typeId===n.Binary}static isUtf8(e){return e&&e.typeId===n.Utf8}static isBool(e){return e&&e.typeId===n.Bool}static isDecimal(e){return e&&e.typeId===n.Decimal}static isDate(e){return e&&e.typeId===n.Date}static isTime(e){return e&&e.typeId===n.Time}static isTimestamp(e){return e&&e.typeId===n.Timestamp}static isInterval(e){return e&&e.typeId===n.Interval}static isList(e){return e&&e.typeId===n.List}static isStruct(e){return e&&e.typeId===n.Struct}static isUnion(e){return e&&e.typeId===n.Union}static isFixedSizeBinary(e){return e&&e.typeId===n.FixedSizeBinary}static isFixedSizeList(e){return e&&e.typeId===n.FixedSizeList}static isMap(e){return e&&e.typeId===n.Map}static isDictionary(e){return e&&e.typeId===n.Dictionary}get typeId(){return n.NONE}compareTo(e){return this===e}}Symbol.toStringTag;Symbol.toStringTag;u=Symbol.toStringTag;class type_Int extends type_DataType{constructor(e,t){super(),Object(i.a)(this,"isSigned",void 0),Object(i.a)(this,"bitWidth",void 0),this.isSigned=e,this.bitWidth=t}get typeId(){return n.Int}get[u](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class Int8 extends type_Int{constructor(){super(!0,8)}}class Int16 extends type_Int{constructor(){super(!0,16)}}class Int32 extends type_Int{constructor(){super(!0,32)}}class Uint8 extends type_Int{constructor(){super(!1,8)}}class Uint16 extends type_Int{constructor(){super(!1,16)}}class Uint32 extends type_Int{constructor(){super(!1,32)}}const r={HALF:16,SINGLE:32,DOUBLE:64};u=Symbol.toStringTag;class type_Float extends type_DataType{constructor(e){super(),Object(i.a)(this,"precision",void 0),this.precision=e}get typeId(){return n.Float}get[u](){return"Float"}toString(){return"Float".concat(this.precision)}}class Float32 extends type_Float{constructor(){super(r.SINGLE)}}class Float64 extends type_Float{constructor(){super(r.DOUBLE)}}Symbol.toStringTag;Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;u=Symbol.toStringTag;class type_FixedSizeList extends type_DataType{constructor(e,t){super(),Object(i.a)(this,"listSize",void 0),Object(i.a)(this,"children",void 0),this.listSize=e,this.children=[t]}get typeId(){return n.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[u](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}class field_Field{constructor(e,t,n=!1,r=new Map){Object(i.a)(this,"name",void 0),Object(i.a)(this,"type",void 0),Object(i.a)(this,"nullable",void 0),Object(i.a)(this,"metadata",void 0),this.name=e,this.type=t,this.nullable=n,this.metadata=r}get typeId(){return this.type&&this.type.typeId}clone(){return new field_Field(this.name,this.type,this.nullable,this.metadata)}compareTo(e){return this.name===e.name&&this.type===e.type&&this.nullable===e.nullable&&this.metadata===e.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}function makeSchemaFromAttributes(e,t,n){var r=makeMetadata(t.metadata);const i=[];var o=function transformAttributesLoaderData(e){const t={};for(const r in e){var n=e[r];t[n.name||"undefined"]=n}return t}(t.attributes);for(const s in e){var a=e[s],a=getArrowFieldFromAttribute(s,a,o[s]);i.push(a)}return n&&(t=getArrowFieldFromAttribute("indices",n),i.push(t)),new schema_Schema(i,r)}function getArrowFieldFromAttribute(e,t,n){var n=n?makeMetadata(n.metadata):void 0,r=function getArrowTypeFromTypedArray(e){switch(e.constructor){case Int8Array:return new Int8;case Uint8Array:return new Uint8;case Int16Array:return new Int16;case Uint16Array:return new Uint16;case Int32Array:return new Int32;case Uint32Array:return new Uint32;case Float32Array:return new Float32;case Float64Array:return new Float64;default:throw new Error("array type not supported")}}(t.value);return new field_Field(e,new type_FixedSizeList(t.size,new field_Field("value",r)),!1,n)}function makeMetadata(e){const t=new Map;for(const n in e)t.set("".concat(n,".string"),JSON.stringify(e[n]));return t}const s={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},c={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class draco_parser_DracoParser{constructor(e){Object(i.a)(this,"draco",void 0),Object(i.a)(this,"decoder",void 0),Object(i.a)(this,"metadataQuerier",void 0),this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,n={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(n);var i,t=this.decoder.GetEncodedGeometryType(r);const o=new(t===this.draco.TRIANGULAR_MESH?this.draco.Mesh:this.draco.PointCloud);try{let e;switch(t){case this.draco.TRIANGULAR_MESH:e=this.decoder.DecodeBufferToMesh(r,o);break;case this.draco.POINT_CLOUD:e=this.decoder.DecodeBufferToPointCloud(r,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!e.ok()||!o.ptr)throw i="DRACO decompression failed: ".concat(e.error_msg()),new Error(i);var a=this._getDracoLoaderData(o,t,n),s=this._getMeshData(o,a,n),A=function getMeshBoundingBox(e){let t=1/0,n=1/0,r=1/0,i=-1/0,o=-1/0,a=-1/0;var s=e.POSITION?e.POSITION.value:[],A=s&&s.length;for(let e=0;ei?l:i,o=c>o?c:o,a=g>a?g:a}return[[t,n,r],[i,o,a]]}(s.attributes),l=makeSchemaFromAttributes(s.attributes,a,s.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:A},...s,schema:l}}finally{this.draco.destroy(r),o&&this.draco.destroy(o)}}_getDracoLoaderData(e,t,n){var r=this._getTopLevelMetadata(e),n=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:r,attributes:n}}_getDracoAttributes(t,n){const r={};for(let e=0;ethis.decoder[e]).includes(t)){const r=new this.draco.AttributeQuantizationTransform;try{if(r.InitFromAttribute(e))return{quantization_bits:r.quantization_bits(),range:r.range(),min_values:new Float32Array([1,2,3]).map(e=>r.min_value(e))}}finally{this.draco.destroy(r)}}return null}_getOctahedronTransform(e,t){const{octahedronAttributes:n=[]}=t;t=e.attribute_type();if(n.map(e=>this.decoder[e]).includes(t)){const r=new this.draco.AttributeQuantizationTransform;try{if(r.InitFromAttribute(e))return{quantization_bits:r.quantization_bits()}}finally{this.draco.destroy(r)}}return null}}var o=t(142),a=t(295),A=t(93);const l="3.0.13",g={};async function loadLibrary(e,t=null,n={}){return t&&(e=function getLibraryUrl(e,t,n){if(e.startsWith("http"))return e;var r=n.modules||{};if(r[e])return r[e];if(!o.b)return"modules/".concat(t,"/dist/libs/").concat(e);if(n.CDN)return Object(A.a)(n.CDN.startsWith("http")),"".concat(n.CDN,"/").concat(t,"@").concat(l,"/dist/libs/").concat(e);if(o.d)return"../src/libs/".concat(e);return"modules/".concat(t,"/src/libs/").concat(e)}(e,t,n)),g[e]=g[e]||async function loadLibraryFromFile(e){if(e.endsWith("wasm")){const t=await fetch(e);return t.arrayBuffer()}if(!o.b)return a.requireFromFile&&await a.requireFromFile(e);if(o.d)return importScripts(e);const t=await fetch(e),n=await t.text();return function loadLibraryFromString(t,e){if(!o.b)return a.requireFromString&&a.requireFromString(t,e);if(o.d)return eval.call(o.a,t),null;const n=document.createElement("script");n.id=e;try{n.appendChild(document.createTextNode(t))}catch(e){n.text=t}return document.body.appendChild(n),null}(n,e)}(e),g[e]}var u="1.4.1";const d="https://www.gstatic.com/draco/versioned/decoders/".concat(u,"/draco_decoder.js"),I="https://www.gstatic.com/draco/versioned/decoders/".concat(u,"/draco_wasm_wrapper.js"),C="https://www.gstatic.com/draco/versioned/decoders/".concat(u,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat(u,"/javascript/draco_encoder.js");let h;async function loadDracoDecoderModule(e){const t=e.modules||{};return h=t.draco3d?h||t.draco3d.createDecoderModule({}).then(e=>({draco:e})):h||async function loadDracoDecoder(e){let t,n;"js"===(e.draco&&e.draco.decoderType)?t=await loadLibrary(d,"draco",e):[t,n]=await Promise.all([await loadLibrary(I,"draco",e),await loadLibrary(C,"draco",e)]);return function initializeDracoDecoder(e,t){const n={};t&&(n.wasmBinary=t);return new Promise(t=>{e({...n,onModuleLoaded:e=>t({draco:e})})})}(t=t||globalThis.DracoDecoderModule,n)}(e)}const p={...e,parse:async function parse(e,t){const n=(await loadDracoDecoderModule(t))["draco"],r=new draco_parser_DracoParser(n);try{return r.parseSync(e,null==t?void 0:t.draco)}finally{r.destroy()}}};p},function(e,t,n){"use strict";n.d(t,"a",function(){return model_Model});var d=n(7),c=n(689),i=n(86),h=n(14),r=n(380),l=n(1225),s=n(119),p=n(62),t=n(72);let o=null;function getScratchArray(e,t){return new e(function getScratchArrayBuffer(e){return o=!o||o.byteLength{this.gl.bindBuffer(34963,e?e.handle:null)}),this}setBuffer(e,t,n){if(34963===t.target)return this.setElementBuffer(t,n);const{size:r,type:i,stride:o,offset:a,normalized:s,integer:A,divisor:l}=n,{gl:c,gl2:g}=this;return e=Number(e),this.bind(()=>{c.bindBuffer(34962,t.handle),A?(Object(h.a)(Object(d.j)(c)),g.vertexAttribIPointer(e,r,i,o,a)):c.vertexAttribPointer(e,r,i,s,o,a),c.enableVertexAttribArray(e),g.vertexAttribDivisor(e,l||0)}),this}enable(e,t=!0){return!t&&0===e&&!vertex_array_object_VertexArrayObject.isSupported(this.gl,{constantAttributeZero:!0})||(e=Number(e),this.bind(()=>t?this.gl.enableVertexAttribArray(e):this.gl.disableVertexAttribArray(e))),this}getConstantBuffer(e,t){var n=this._normalizeConstantArrayValue(t),r=n.byteLength*e,e=n.length*e,i=!this.buffer;return this.buffer=this.buffer||new p.a(this.gl,r),(i||this.buffer.reallocate(r)||!this._compareConstantArrayValues(n,this.bufferValue))&&(function fillArray({target:t,source:n,start:r=0,count:e=1}){var i=n.length,o=e*i;let a=0;for(let e=r;a34373!==e?this.gl.getVertexAttrib(t,e):this.gl.getVertexAttribOffset(t,e))}}var u=n(363);const f=/^(.+)__LOCATION_([0-9]+)$/,I=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class vertex_array_VertexArray{constructor(e,t={}){var n=t.id||t.program&&t.program.id;this.id=n,this.gl=e,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={},this.vertexArrayObject=new vertex_array_object_VertexArrayObject(e),Object(u.a)(this,"VertexArray","v6.0",I),this.initialize(t),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(e={}){return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(e)}reset(){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}setProps(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}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(n){return Object.assign(this.attributes,n),this.vertexArrayObject.bind(()=>{for(const t in n){var e=n[t];this._setAttribute(t,e)}this.gl.bindBuffer(34962,null)}),this}setElementBuffer(e=null,t={}){return this.elements=e,this.elementsAccessor=t,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(e,t),this}setBuffer(e,t,n={}){if(34963===t.target)return this.setElementBuffer(t,n);var{location:e,accessor:n}=this._resolveLocationAndAccessor(e,t,t.accessor,n);return 0<=e&&(this.values[e]=t,this.accessors[e]=n,this.clearDrawParams(),this.vertexArrayObject.setBuffer(e,t,n)),this}setConstant(e,t,n={}){var{location:e,accessor:n}=this._resolveLocationAndAccessor(e,t,Object.assign({size:t.length},n));return 0<=e&&(t=this.vertexArrayObject._normalizeConstantArrayValue(t),this.values[e]=t,this.accessors[e]=n,this.clearDrawParams(),this.vertexArrayObject.enable(e,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind(()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new p.a(this.gl,{accessor:{size:4}});for(let e=0;e{this.elements&&this.setElementBuffer(this.elements);for(let e=0;e{this._setConstantAttributes(e,t),r=n()}),r}_resolveLocationAndAccessor(e,t,n,r){var i={location:-1,accessor:null},{location:o,name:a}=this._getAttributeIndex(e);if(!Number.isFinite(o)||o<0)return this.unused[e]=t,d.k.once(3,()=>`unused value ${e} in `+this.id)(),i;t=this._getAttributeInfo(a||o);if(!t)return i;var a=this.accessors[o]||{},i=s.a.resolve(t.accessor,a,n,r),{size:t,type:a}=i;return Object(h.a)(Number.isFinite(t)&&Number.isFinite(a)),{location:o,accessor:i}}_getAttributeInfo(e){return this.configuration&&this.configuration.getAttributeInfo(e)}_getAttributeIndex(e){var t=Number(e);if(Number.isFinite(t))return{location:t};t=f.exec(e),e=t?t[1]:e,t=t?Number(t[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(e)+t,name:e}:{location:-1}}_setAttribute(e,t){if(t instanceof p.a)this.setBuffer(e,t);else if(Array.isArray(t)&&t.length&&t[0]instanceof p.a){var n=t[0],r=t[1];this.setBuffer(e,n,r)}else if(ArrayBuffer.isView(t)||Array.isArray(t))this.setConstant(e,t);else{if(!(t.buffer instanceof p.a))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");this.setBuffer(e,t.buffer,t)}}_setConstantAttributes(e,t){e=Math.max(0|e,0|t);let n=this.values[0];ArrayBuffer.isView(n)&&this._setConstantAttributeZero(n,e);for(let e=1;er?"...":"]";return o+e}(e,t);if(!Number.isFinite(e))return String(e);if(Math.abs(e)<1e-16)return n?"0":"0.";if(n)return e.toFixed(0);if(100{},v={};class model_Model{constructor(e,t={}){var{id:n=Object(i.c)("model")}=t;Object(h.a)(Object(d.i)(e)),this.id=n,this.gl=e,this.id=t.id||Object(i.c)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(t)}initialize(e){this.props={},this.programManager=e.programManager||c.a.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;var{program:t=null,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:s,bufferMode:A,transpileToGLSL100:l}=e;this.programProps={program:t,vs:n,fs:r,modules:i,defines:o,inject:a,varyings:s,bufferMode:A,transpileToGLSL100:l},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(e.moduleSettings))),this.drawMode=void 0!==e.drawMode?e.drawMode:4,this.vertexCount=e.vertexCount||0,this.geometryBuffers={},this.isInstanced=e.isInstanced||e.instanced||0e.vertexArray.unbindBuffers());try{this.draw(Object.assign({},e,{parameters:i}))}finally{r.forEach(e=>e.vertexArray.bindBuffers())}return this}render(e={}){return d.k.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(e).draw()}_setModelProps(e){Object.assign(this.props,e),"uniforms"in e&&this.setUniforms(e.uniforms),"pickable"in e&&(this.pickable=e.pickable),"instanceCount"in e&&(this.instanceCount=e.instanceCount),"geometry"in e&&this.setGeometry(e.geometry),"attributes"in e&&this.setAttributes(e.attributes),"_feedbackBuffers"in e&&this._setFeedbackBuffers(e._feedbackBuffers)}_checkProgram(){var t,n,r,i,o,a,s,A;if(this._programDirty||this.programManager.stateHash!==this._programManagerState){let e=this.programProps["program"];e?this._managedProgram=!1:({vs:t,fs:n,modules:r,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:A}=this.programProps,e=this.programManager.get({vs:t,fs:n,modules:r,inject:i,defines:o,varyings:a,bufferMode:s,transpileToGLSL100:A}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0),Object(h.a)(e instanceof l.a,"Model needs a program"),this._programDirty=!1,e!==this.program&&(this.program=e,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new vertex_array_VertexArray(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}}_deleteGeometryBuffers(){for(const e in this.geometryBuffers){const t=this.geometryBuffers[e][0]||this.geometryBuffers[e];t instanceof p.a&&t.delete()}}_setAnimationProps(e){this.animated&&Object(h.a)(e,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(e={}){if(Object(i.a)(e))return this;var t=this.program["gl"];return this.transformFeedback=this.transformFeedback||new C.a(t,{program:this.program}),this.transformFeedback.setBuffers(e),this}_logDrawCallStart(e){var t=3>> DRAWING MODEL "+this.id,{collapsed:d.k.level<=2})(),e}_logDrawCallEnd(e,t,n,r){var i,o,a,s;void 0!==e&&(t=getDebugTableForVertexArray({vertexArray:t,header:this.id+" attributes",attributes:this._attributes}),{table:i,unusedTable:o,unusedCount:a}=getDebugTableForUniforms({header:this.id+" uniforms",program:this.program,uniforms:Object.assign({},this.program.uniforms,n)}),{table:n,count:s}=getDebugTableForUniforms({header:this.id+" uniforms",program:this.program,uniforms:Object.assign({},this.program.uniforms,n),undefinedOnly:!0}),0>> DRAWING MODEL "+this.id)())}}},function(e,t,n){"use strict";t.a={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#d5d5d5",A200:"#aaaaaa",A400:"#303030",A700:"#616161"}},function(e,t,n){"use strict";n.d(t,"a",function(){return o});var r=n(137),i=n(208);const o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};t.b={[o.WEBGL2]:[!1,!0],[o.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[o.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[o.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[o.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[o.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[o.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[o.FLOAT_BLEND]:["EXT_float_blend"],[o.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[o.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[o.TEXTURE_FLOAT]:["OES_texture_float",!0],[o.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[o.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[o.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[o.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[o.COLOR_ATTACHMENT_RGBA32F]:[function checkFloat32ColorAttachment(e){const t=new i.a(e,{format:6408,type:5126,dataFormat:6408}),n=new r.a(e,{id:"test-framebuffer",check:!1,attachments:{[36064]:t}});return e=n.getStatus(),t.delete(),n.delete(),36053===e},"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[o.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[o.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[o.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[o.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]}},function(e,t,n){"use strict";n.d(t,"a",function(){return clear}),n.d(t,"b",function(){return clearBuffer});var s=n(7),A=n(14);const l=256,c=1024,g=16384,a=6144,u=6145,d=6146,h=34041,p="clear: bad arguments";function clear(e,{framebuffer:t=null,color:n=null,depth:r=null,stencil:i=null}={}){const o={};t&&(o.framebuffer=t);let a=0;n&&(a|=g,!0!==n&&(o.clearColor=n)),r&&(a|=l,!0!==r&&(o.clearDepth=r)),i&&(a|=c,!0!==r&&(o.clearStencil=r)),Object(A.a)(0!==a,p),Object(s.o)(e,o,()=>{e.clear(a)})}function clearBuffer(n,{framebuffer:e=null,buffer:r=a,drawBuffer:i=0,value:o=[0,0,0,0]}={}){Object(s.a)(n),Object(s.o)(n,{framebuffer:e},()=>{switch(r){case a:switch(o.constructor){case Int32Array:n.clearBufferiv(r,i,o);break;case Uint32Array:n.clearBufferuiv(r,i,o);break;default:Float32Array;n.clearBufferfv(r,i,o)}break;case u:n.clearBufferfv(u,0,[o]);break;case d:n.clearBufferiv(d,0,[o]);break;case h:var[e,t]=o;n.clearBufferfi(h,0,e,t);break;default:Object(A.a)(!1,p)}})}},function(e,t,n){"use strict";function assert(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}n.d(t,"a",function(){return assert})},function(e,t){},function(e,t,n){!function(q){"use strict";function e(){}function n(e){this.message=e||""}function i(e){this.message=e||""}function r(e){this.message=e||""}function o(){}function s(e){return null===e?nt:e.color}function a(e){return null===e?null:e.parent}function u(e,t){null!==e&&(e.color=t)}function l(e){return null===e?null:e.left}function c(e){return null===e?null:e.right}function p(){this.root_=null,this.size_=0}function h(){}function f(){this.array_=[],arguments[0]instanceof We&&this.addAll(arguments[0])}function g(){}function d(e){this.message=e||""}function y(){this.array_=[]}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(e){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var t=Object(this),n=Math.max(Math.min(t.length,9007199254740991),0)||0,r=1 in arguments?parseInt(Number(arguments[1]),10)||0:0;r=r<0?Math.max(n+r,0):Math.min(r,n);var i=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(i=i<0?Math.max(n+arguments[2],0):Math.min(i,n);rt.x?1:this.yt.y?1:0},B.prototype.clone=function(){},B.prototype.copy=function(){return new B(this)},B.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},B.prototype.distance3D=function(e){var t=this.x-e.x,n=this.y-e.y,r=this.z-e.z;return Math.sqrt(t*t+n*n+r*r)},B.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},B.prototype.hashCode=function(){var e=17;return e=37*e+B.hashCode(this.x),e=37*e+B.hashCode(this.y)},B.prototype.setCoordinate=function(e){this.x=e.x,this.y=e.y,this.z=e.z},B.prototype.interfaces_=function(){return[te,ne,e]},B.prototype.getClass=function(){return B},B.hashCode=function(){if(1===arguments.length){var e=arguments[0],t=C.doubleToLongBits(e);return Math.trunc((t^t)>>>32)}},ie.DimensionalComparator.get=function(){return oe},ie.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},ie.NULL_ORDINATE.get=function(){return C.NaN},ie.X.get=function(){return 0},ie.Y.get=function(){return 1},ie.Z.get=function(){return 2},Object.defineProperties(B,ie),function(e){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new I("only 2 or 3 dimensions may be specified");this._dimensionsToTest=t}}),ae=(oe.prototype.compare=function(e,t){var n=e,r=t,i=oe.compare(n.x,r.x);if(0!==i)return i;var o=oe.compare(n.y,r.y);if(0!==o)return o;if(this._dimensionsToTest<=2)return 0;return oe.compare(n.z,r.z)},oe.prototype.interfaces_=function(){return[re]},oe.prototype.getClass=function(){return oe},oe.compare=function(e,t){return et?1:C.isNaN(e)?C.isNaN(t)?0:-1:C.isNaN(t)?1:0},function(){}),m=(ae.prototype.create=function(){},ae.prototype.interfaces_=function(){return[]},ae.prototype.getClass=function(){return ae},function(){}),se={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}},b=(m.prototype.interfaces_=function(){return[]},m.prototype.getClass=function(){return m},m.toLocationSymbol=function(e){switch(e){case m.EXTERIOR:return"e";case m.BOUNDARY:return"b";case m.INTERIOR:return"i";case m.NONE:return"-"}throw new I("Unknown location value: "+e)},se.INTERIOR.get=function(){return 0},se.BOUNDARY.get=function(){return 1},se.EXTERIOR.get=function(){return 2},se.NONE.get=function(){return-1},Object.defineProperties(m,se),function(e,t){return e.interfaces_&&e.interfaces_().indexOf(t)>-1}),Ae=function(){},le={LOG_10:{configurable:!0}},ce=(Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Ae.log10=function(e){var t=Math.log(e);return C.isInfinite(t)?t:C.isNaN(t)?t:t/Ae.LOG_10},Ae.min=function(e,t,n,r){var i=e;return tn?n:e}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var r=arguments[0],i=arguments[1],o=arguments[2];return ro?o:r}},Ae.wrap=function(e,t){return e<0?t- -e%t:e%t},Ae.max=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],n=arguments[2],r=e;return t>r&&(r=t),n>r&&(r=n),r}if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3],A=i;return o>A&&(A=o),a>A&&(A=a),s>A&&(A=s),A}},Ae.average=function(e,t){return(e+t)/2},le.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Ae,le),function(e){this.str=e}),ge=(ce.prototype.append=function(e){this.str+=e},ce.prototype.setCharAt=function(e,t){this.str=this.str.substr(0,e)+t+this.str.substr(e+1)},ce.prototype.toString=function(e){return this.str},function(e){this.value=e}),ue=(ge.prototype.intValue=function(){return this.value},ge.prototype.compareTo=function(e){return this.valuee?1:0},ge.isNaN=function(e){return Number.isNaN(e)},function(){}),v=(ue.isWhitespace=function(e){return e<=32&&e>=0||127===e},ue.toUpperCase=function(e){return e.toUpperCase()},function t(){if(this._hi=0,this._lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var e=arguments[0];this.init(e)}else if(arguments[0]instanceof t){var n=arguments[0];this.init(n)}else if("string"==typeof arguments[0]){var r=arguments[0];t.call(this,t.parse(r))}}else if(2===arguments.length){var i=arguments[0],o=arguments[1];this.init(i,o)}}),de={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}},he=(v.prototype.le=function(e){return(this._hi9?(c=!0,g="9"):g="0"+l,a.append(g),n=n.subtract(v.valueOf(l)).multiply(v.TEN),c&&n.selfAdd(v.TEN);var u=!0,d=v.magnitude(n._hi);if(d<0&&Math.abs(d)>=s-A&&(u=!1),!u)break}return t[0]=r,a.toString()},v.prototype.sqr=function(){return this.multiply(this)},v.prototype.doubleValue=function(){return this._hi+this._lo},v.prototype.subtract=function(){if(arguments[0]instanceof v){var e=arguments[0];return this.add(e.negate())}if("number"==typeof arguments[0]){var t=arguments[0];return this.add(-t)}},v.prototype.equals=function(){if(1===arguments.length){var e=arguments[0];return this._hi===e._hi&&this._lo===e._lo}},v.prototype.isZero=function(){return 0===this._hi&&0===this._lo},v.prototype.selfSubtract=function(){if(arguments[0]instanceof v){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e._hi,-e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t,0)}},v.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},v.prototype.min=function(e){return this.le(e)?this:e},v.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof v){var e=arguments[0];return this.selfDivide(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfDivide(t,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,s=null,A=null,l=null,c=null,g=null;return A=this._hi/n,l=v.SPLIT*A,i=l-A,g=v.SPLIT*n,i=l-i,o=A-i,a=g-n,c=A*n,a=g-a,s=n-a,g=i*a-c+i*s+o*a+o*s,l=(this._hi-c-g+this._lo-A*r)/n,g=A+l,this._hi=g,this._lo=A-g+l,this}},v.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},v.prototype.divide=function(){if(arguments[0]instanceof v){var e=arguments[0],t=null,n=null,r=null,i=null,o=null,a=null,s=null,A=null;n=(o=this._hi/e._hi)-(t=(a=v.SPLIT*o)-(t=a-o)),A=t*(r=(A=v.SPLIT*e._hi)-(r=A-e._hi))-(s=o*e._hi)+t*(i=e._hi-r)+n*r+n*i,a=(this._hi-s-A+this._lo-o*e._lo)/e._hi;return new v(A=o+a,o-A+a)}if("number"==typeof arguments[0]){var l=arguments[0];return C.isNaN(l)?v.createNaN():v.copy(this).selfDivide(l,0)}},v.prototype.ge=function(e){return(this._hi>e._hi||this._hi===e._hi)&&this._lo>=e._lo},v.prototype.pow=function(e){if(0===e)return v.valueOf(1);var t=new v(this),n=v.valueOf(1),r=Math.abs(e);if(r>1)for(;r>0;)r%2==1&&n.selfMultiply(t),(r/=2)>0&&(t=t.sqr());else n=t;return e<0?n.reciprocal():n},v.prototype.ceil=function(){if(this.isNaN())return v.NaN;var e=Math.ceil(this._hi),t=0;return e===this._hi&&(t=Math.ceil(this._lo)),new v(e,t)},v.prototype.compareTo=function(e){var t=e;return this._hit._hi?1:this._lot._lo?1:0},v.prototype.rint=function(){if(this.isNaN())return this;return this.add(.5).floor()},v.prototype.setValue=function(){if(arguments[0]instanceof v){var e=arguments[0];return this.init(e),this}if("number"==typeof arguments[0]){var t=arguments[0];return this.init(t),this}},v.prototype.max=function(e){return this.ge(e)?this:e},v.prototype.sqrt=function(){if(this.isZero())return v.valueOf(0);if(this.isNegative())return v.NaN;var e=1/Math.sqrt(this._hi),t=this._hi*e,n=v.valueOf(t),r=this.subtract(n.sqr())._hi*(.5*e);return n.add(r)},v.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof v){var e=arguments[0];return this.selfAdd(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0],n=null,r=null,i=null,o=null,a=null,s=null;return i=this._hi+t,a=i-this._hi,o=i-a,o=t-a+(this._hi-o),s=o+this._lo,n=i+s,r=s+(i-n),this._hi=n+r,this._lo=r+(n-this._hi),this}}else if(2===arguments.length){var A=arguments[0],l=arguments[1],c=null,g=null,u=null,d=null,h=null,p=null,f=null;d=this._hi+A,g=this._lo+l,h=d-(p=d-this._hi),u=g-(f=g-this._lo);var I=(c=d+(p=(h=A-p+(this._hi-h))+g))+(p=(u=l-f+(this._lo-u))+(p+(d-c))),C=p+(c-I);return this._hi=I,this._lo=C,this}},v.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof v){var e=arguments[0];return this.selfMultiply(e._hi,e._lo)}if("number"==typeof arguments[0]){var t=arguments[0];return this.selfMultiply(t,0)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1],i=null,o=null,a=null,s=null,A=null,l=null;i=(A=v.SPLIT*this._hi)-this._hi,l=v.SPLIT*n,i=A-i,o=this._hi-i,a=l-n;var c=(A=this._hi*n)+(l=i*(a=l-a)-A+i*(s=n-a)+o*a+o*s+(this._hi*r+this._lo*n)),g=l+(i=A-c);return this._hi=c,this._lo=g,this}},v.prototype.selfSqr=function(){return this.selfMultiply(this)},v.prototype.floor=function(){if(this.isNaN())return v.NaN;var e=Math.floor(this._hi),t=0;return e===this._hi&&(t=Math.floor(this._lo)),new v(e,t)},v.prototype.negate=function(){return this.isNaN()?this:new v(-this._hi,-this._lo)},v.prototype.clone=function(){},v.prototype.multiply=function(){if(arguments[0]instanceof v){var e=arguments[0];return e.isNaN()?v.createNaN():v.copy(this).selfMultiply(e)}if("number"==typeof arguments[0]){var t=arguments[0];return C.isNaN(t)?v.createNaN():v.copy(this).selfMultiply(t,0)}},v.prototype.isNaN=function(){return C.isNaN(this._hi)},v.prototype.intValue=function(){return Math.trunc(this._hi)},v.prototype.toString=function(){var e=v.magnitude(this._hi);return e>=-3&&e<=20?this.toStandardNotation():this.toSciNotation()},v.prototype.toStandardNotation=function(){var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!0,t),r=t[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+v.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+v.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},v.prototype.reciprocal=function(){var e=null,t=null,n=null,r=null,i=null,o=null,a=null,s=null;t=(i=1/this._hi)-(e=(o=v.SPLIT*i)-(e=o-i)),n=(s=v.SPLIT*this._hi)-this._hi;var A=i+(o=(1-(a=i*this._hi)-(s=e*(n=s-n)-a+e*(r=this._hi-n)+t*n+t*r)-i*this._lo)/this._hi);return new v(A,i-A+o)},v.prototype.toSciNotation=function(){if(this.isZero())return v.SCI_NOT_ZERO;var e=this.getSpecialNumberString();if(null!==e)return e;var t=new Array(1).fill(null),n=this.extractSignificantDigits(!1,t),r=v.SCI_NOT_EXPONENT_CHAR+t[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";n.length>1&&(i=n.substring(1));var o=n.charAt(0)+"."+i;return this.isNegative()?"-"+o+r:o+r},v.prototype.abs=function(){return this.isNaN()?v.NaN:this.isNegative()?this.negate():new v(this)},v.prototype.isPositive=function(){return(this._hi>0||0===this._hi)&&this._lo>0},v.prototype.lt=function(e){return(this._hie._hi||this._hi===e._hi)&&this._lo>e._lo},v.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},v.prototype.trunc=function(){return this.isNaN()?v.NaN:this.isPositive()?this.floor():this.ceil()},v.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},v.prototype.interfaces_=function(){return[e,te,ne]},v.prototype.getClass=function(){return v},v.sqr=function(e){return v.valueOf(e).selfMultiply(e)},v.valueOf=function(){if("string"==typeof arguments[0]){var e=arguments[0];return v.parse(e)}if("number"==typeof arguments[0]){var t=arguments[0];return new v(t)}},v.sqrt=function(e){return v.valueOf(e).sqrt()},v.parse=function(e){for(var t=0,n=e.length;ue.isWhitespace(e.charAt(t));)t++;var r=!1;if(t=n);){var l=e.charAt(t);if(t++,ue.isDigit(l)){var c=l-"0";o.selfMultiply(v.TEN),o.selfAdd(c),a++}else{if("."!==l){if("e"===l||"E"===l){var g=e.substring(t);try{A=ge.parseInt(g)}catch(t){throw t instanceof Error?new Error("Invalid exponent "+g+" in string "+e):t}break}throw new Error("Unexpected character '"+l+"' at position "+t+" in string "+e)}s=a}}var u=o,d=a-s-A;if(0===d)u=o;else if(d>0){var h=v.TEN.pow(d);u=o.divide(h)}else if(d<0){var p=v.TEN.pow(-d);u=o.multiply(p)}return r?u.negate():u},v.createNaN=function(){return new v(C.NaN,C.NaN)},v.copy=function(e){return new v(e)},v.magnitude=function(e){var t=Math.abs(e),n=Math.log(t)/Math.log(10),r=Math.trunc(Math.floor(n));return 10*Math.pow(10,r)<=t&&(r+=1),r},v.stringOfChar=function(e,t){for(var n=new ce,r=0;r0){if(o<=0)return he.signum(a);r=i+o}else{if(!(i<0))return he.signum(a);if(o>=0)return he.signum(a);r=-i-o}var s=he.DP_SAFE_EPSILON*r;return a>=s||-a>=s?he.signum(a):2},he.signum=function(e){return e>0?1:e<0?-1:0},pe.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(he,pe),function(){}),fe={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}},Ie=(fe.X.get=function(){return 0},fe.Y.get=function(){return 1},fe.Z.get=function(){return 2},fe.M.get=function(){return 3},E.prototype.setOrdinate=function(e,t,n){},E.prototype.size=function(){},E.prototype.getOrdinate=function(e,t){},E.prototype.getCoordinate=function(){},E.prototype.getCoordinateCopy=function(e){},E.prototype.getDimension=function(){},E.prototype.getX=function(e){},E.prototype.clone=function(){},E.prototype.expandEnvelope=function(e){},E.prototype.copy=function(){},E.prototype.getY=function(e){},E.prototype.toCoordinateArray=function(){},E.prototype.interfaces_=function(){return[ne]},E.prototype.getClass=function(){return E},Object.defineProperties(E,fe),function(){}),Ce=function(t){function e(){t.call(this,"Projective point not representable on the Cartesian plane.")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Ie),me=function(){},ye=(me.arraycopy=function(e,t,n,r,i){for(var o=0,a=t;ae._minx?this._minx:e._minx,n=this._miny>e._miny?this._miny:e._miny,r=this._maxx=this._minx&&t.getMaxX()<=this._maxx&&t.getMinY()>=this._miny&&t.getMaxY()<=this._maxy)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&(n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy)}},Q.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Q){var e=arguments[0];return!this.isNull()&&!e.isNull()&&!(e._minx>this._maxx||e._maxxthis._maxy||e._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=t._maxx),t._minythis._maxy&&(this._maxy=t._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},Q.prototype.minExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return et._minx?1:this._minyt._miny?1:this._maxxt._maxx?1:this._maxyt._maxy?1:0},Q.prototype.translate=function(e,t){if(this.isNull())return null;this.init(this.getMinX()+e,this.getMaxX()+e,this.getMinY()+t,this.getMaxY()+t)},Q.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Q.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Q.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Q.prototype.maxExtent=function(){if(this.isNull())return 0;var e=this.getWidth(),t=this.getHeight();return e>t?e:t},Q.prototype.expandBy=function(){if(1===arguments.length){var e=arguments[0];this.expandBy(e,e)}else if(2===arguments.length){var t=arguments[0],n=arguments[1];if(this.isNull())return null;this._minx-=t,this._maxx+=t,this._miny-=n,this._maxy+=n,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Q.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Q){var e=arguments[0];return this.covers(e)}if(arguments[0]instanceof B){var t=arguments[0];return this.covers(t)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Q.prototype.centre=function(){return this.isNull()?null:new B((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Q.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof B){var e=arguments[0];this.init(e.x,e.x,e.y,e.y)}else if(arguments[0]instanceof Q){var t=arguments[0];this._minx=t._minx,this._maxx=t._maxx,this._miny=t._miny,this._maxy=t._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];ie._maxx&&(t=this._minx-e._maxx);var n=0;return this._maxye._maxy&&(n=this._miny-e._maxy),0===t?n:0===n?t:Math.sqrt(t*t+n*n)},Q.prototype.hashCode=function(){var e=17;return e=37*e+B.hashCode(this._minx),e=37*e+B.hashCode(this._maxx),e=37*e+B.hashCode(this._miny),e=37*e+B.hashCode(this._maxy)},Q.prototype.interfaces_=function(){return[te,e]},Q.prototype.getClass=function(){return Q},Q.intersects=function(){if(3===arguments.length){var e=arguments[0],t=arguments[1],n=arguments[2];return n.x>=(e.xt.x?e.x:t.x)&&n.y>=(e.yt.y?e.y:t.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],a=arguments[3],s=Math.min(o.x,a.x),A=Math.max(o.x,a.x),l=Math.min(r.x,i.x),c=Math.max(r.x,i.x);return!(l>A)&&(!(cA)&&!(cthis.getEdgeDistance(e,1)?(this._intLineIndex[e][0]=0,this._intLineIndex[e][1]=1):(this._intLineIndex[e][0]=1,this._intLineIndex[e][1]=0)}},A.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},A.prototype.setPrecisionModel=function(e){this._precisionModel=e},A.prototype.isInteriorIntersection=function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var e=arguments[0],t=0;ti?r:i;else{var a=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);0!==(o=r>i?a:s)||e.equals(t)||(o=Math.max(a,s))}return w.isTrue(!(0===o&&!e.equals(t)),"Bad distance calculation"),o},A.nonRobustComputeEdgeDistance=function(e,t,n){var r=e.x-t.x,i=e.y-t.y,o=Math.sqrt(r*r+i*i);return w.isTrue(!(0===o&&!e.equals(t)),"Invalid distance calculation"),o},xe.DONT_INTERSECT.get=function(){return 0},xe.DO_INTERSECT.get=function(){return 1},xe.COLLINEAR.get=function(){return 2},xe.NO_INTERSECTION.get=function(){return 0},xe.POINT_INTERSECTION.get=function(){return 1},xe.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(A,xe),function(A){function e(){A.apply(this,arguments)}return A&&(e.__proto__=A),e.prototype=Object.create(A&&A.prototype),e.prototype.constructor=e,e.prototype.isInSegmentEnvelopes=function(e){var t=new Q(this._inputLines[0][0],this._inputLines[0][1]),n=new Q(this._inputLines[1][0],this._inputLines[1][1]);return t.contains(e)&&n.contains(e)},e.prototype.computeIntersection=function(){if(3!==arguments.length)return A.prototype.computeIntersection.apply(this,arguments);var e=arguments[0],t=arguments[1],n=arguments[2];if(this._isProper=!1,Q.intersects(t,n,e)&&0===S.orientationIndex(t,n,e)&&0===S.orientationIndex(n,t,e))return this._isProper=!0,(e.equals(t)||e.equals(n))&&(this._isProper=!1),this._result=A.POINT_INTERSECTION,null;this._result=A.NO_INTERSECTION},e.prototype.normalizeToMinimum=function(e,t,n,r,i){i.x=this.smallestInAbsValue(e.x,t.x,n.x,r.x),i.y=this.smallestInAbsValue(e.y,t.y,n.y,r.y),e.x-=i.x,e.y-=i.y,t.x-=i.x,t.y-=i.y,n.x-=i.x,n.y-=i.y,r.x-=i.x,r.y-=i.y},e.prototype.safeHCoordinateIntersection=function(n,r,i,o){var a=null;try{a=ye.intersection(n,r,i,o)}catch(t){if(!(t instanceof Ce))throw t;a=e.nearestEndpoint(n,r,i,o)}return a},e.prototype.intersection=function(t,n,r,i){var o=this.intersectionWithNormalization(t,n,r,i);return this.isInSegmentEnvelopes(o)||(o=new B(e.nearestEndpoint(t,n,r,i))),null!==this._precisionModel&&this._precisionModel.makePrecise(o),o},e.prototype.smallestInAbsValue=function(e,t,n,r){var i=e,o=Math.abs(i);return Math.abs(t)1e-4&&me.out.println("Distance = "+i.distance(o))},e.prototype.intersectionWithNormalization=function(e,t,n,r){var i=new B(e),o=new B(t),a=new B(n),s=new B(r),A=new B;this.normalizeToEnvCentre(i,o,a,s,A);var l=this.safeHCoordinateIntersection(i,o,a,s);return l.x+=A.x,l.y+=A.y,l},e.prototype.computeCollinearIntersection=function(e,t,n,r){var i=Q.intersects(e,t,n),o=Q.intersects(e,t,r),a=Q.intersects(n,r,e),s=Q.intersects(n,r,t);return i&&o?(this._intPt[0]=n,this._intPt[1]=r,A.COLLINEAR_INTERSECTION):a&&s?(this._intPt[0]=e,this._intPt[1]=t,A.COLLINEAR_INTERSECTION):i&&a?(this._intPt[0]=n,this._intPt[1]=e,!n.equals(e)||o||s?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):i&&s?(this._intPt[0]=n,this._intPt[1]=t,!n.equals(t)||o||a?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):o&&a?(this._intPt[0]=r,this._intPt[1]=e,!r.equals(e)||i||s?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):o&&s?(this._intPt[0]=r,this._intPt[1]=t,!r.equals(t)||i||a?A.COLLINEAR_INTERSECTION:A.POINT_INTERSECTION):A.NO_INTERSECTION},e.prototype.normalizeToEnvCentre=function(e,t,n,r,i){var o=e.xt.x?e.x:t.x,A=e.y>t.y?e.y:t.y,l=n.xr.x?n.x:r.x,u=n.y>r.y?n.y:r.y,d=((o>l?o:l)+(sc?a:c)+(A0&&o>0||i<0&&o<0)return A.NO_INTERSECTION;var a=S.orientationIndex(n,r,e),s=S.orientationIndex(n,r,t);if(a>0&&s>0||a<0&&s<0)return A.NO_INTERSECTION;return 0===i&&0===o&&0===a&&0===s?this.computeCollinearIntersection(e,t,n,r):(0===i||0===o||0===a||0===s?(this._isProper=!1,e.equals2D(n)||e.equals2D(r)?this._intPt[0]=e:t.equals2D(n)||t.equals2D(r)?this._intPt[0]=t:0===i?this._intPt[0]=new B(n):0===o?this._intPt[0]=new B(r):0===a?this._intPt[0]=new B(e):0===s&&(this._intPt[0]=new B(t))):(this._isProper=!0,this._intPt[0]=this.intersection(e,t,n,r)),A.POINT_INTERSECTION)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.nearestEndpoint=function(e,t,n,r){var i=e,o=S.distancePointLine(e,n,r),a=S.distancePointLine(t,n,r);return a0?n>0?-i:i:n>0?i:-i;if(0===t||0===n)return r>0?e>0?i:-i:e>0?-i:i;if(t>0?r>0?t<=r||(i=-i,o=e,e=n,n=o,o=t,t=r,r=o):t<=-r?(i=-i,n=-n,r=-r):(o=e,e=-n,n=o,o=t,t=-r,r=o):r>0?-t<=r?(i=-i,e=-e,t=-t):(o=-e,e=n,n=o,o=-t,t=r,r=o):t>=r?(e=-e,t=-t,n=-n,r=-r):(i=-i,o=-e,e=-n,n=o,o=-t,t=-r,r=o),e>0){if(!(n>0))return i;if(!(e<=n))return i}else{if(n>0)return-i;if(!(e>=n))return-i;i=-i,e=-e,n=-n}for(;;){if(a=Math.floor(n/e),n-=a*e,(r-=a*t)<0)return-i;if(r>t)return i;if(e>n+n){if(tr+r)return-i;n=e-n,r=t-r,i=-i}if(0===r)return 0===n?0:-i;if(0===n)return i;if(a=Math.floor(e/n),e-=a*n,(t-=a*r)<0)return i;if(t>r)return-i;if(n>e+e){if(rt+t)return i;e=n-e,t=r-t,i=-i}if(0===t)return 0===e?0:i;if(0===e)return-i}},function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var e=arguments[0];this._p=e}),S=(De.prototype.countSegment=function(e,t){if(e.xr&&(n=t.x,r=e.x),this._p.x>=n&&this._p.x<=r&&(this._isPointOnSegment=!0),null}if(e.y>this._p.y&&t.y<=this._p.y||t.y>this._p.y&&e.y<=this._p.y){var i=e.x-this._p.x,o=e.y-this._p.y,a=t.x-this._p.x,s=t.y-this._p.y,A=Fe.signOfDet2x2(i,o,a,s);if(0===A)return this._isPointOnSegment=!0,null;s0&&this._crossingCount++}},De.prototype.isPointInPolygon=function(){return this.getLocation()!==m.EXTERIOR},De.prototype.getLocation=function(){return this._isPointOnSegment?m.BOUNDARY:this._crossingCount%2==1?m.INTERIOR:m.EXTERIOR},De.prototype.isOnSegment=function(){return this._isPointOnSegment},De.prototype.interfaces_=function(){return[]},De.prototype.getClass=function(){return De},De.locatePointInRing=function(){if(arguments[0]instanceof B&&b(arguments[1],E)){for(var e=arguments[0],t=arguments[1],n=new De(e),r=new B,i=new B,o=1;o1||s<0||s>1)&&(i=!0)}}else i=!0;return i?Ae.min(S.distancePointLine(e,n,r),S.distancePointLine(t,n,r),S.distancePointLine(n,e,t),S.distancePointLine(r,e,t)):0},S.isPointInRing=function(e,t){return S.locatePointInRing(e,t)!==m.EXTERIOR},S.computeLength=function(e){var t=e.size();if(t<=1)return 0;var n=0,r=new B;e.getCoordinate(0,r);for(var i=r.x,o=r.y,a=1;an.y&&(n=o,r=i)}var a=r;do{(a-=1)<0&&(a=t)}while(e[a].equals2D(n)&&a!==r);var s=r;do{s=(s+1)%t}while(e[s].equals2D(n)&&s!==r);var A=e[a],l=e[s];if(A.equals2D(n)||l.equals2D(n)||A.equals2D(l))return!1;var c=S.computeOrientation(A,n,l),g=!1;return g=0===c?A.x>l.x:c>0,g},S.locatePointInRing=function(e,t){return De.locatePointInRing(e,t)},S.distancePointLinePerpendicular=function(e,t,n){var r=(n.x-t.x)*(n.x-t.x)+(n.y-t.y)*(n.y-t.y),i=((t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y))/r;return Math.abs(i)*Math.sqrt(r)},S.computeOrientation=function(e,t,n){return S.orientationIndex(e,t,n)},S.distancePointLine=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];if(0===t.length)throw new I("Line array must contain at least one vertex");for(var n=e.distance(t[0]),r=0;r=1)return o.distance(s);var c=((a.y-o.y)*(s.x-a.x)-(a.x-o.x)*(s.y-a.y))/A;return Math.abs(c)*Math.sqrt(A)}},S.isOnLine=function(e,t){for(var n=new Re,r=1;r0},Pe.prototype.interfaces_=function(){return[Ue]},Pe.prototype.getClass=function(){return Pe},function(){}),Ze=(Ve.prototype.isInBoundary=function(e){return e>1},Ve.prototype.interfaces_=function(){return[Ue]},Ve.prototype.getClass=function(){return Ve},function(){}),We=(Ze.prototype.isInBoundary=function(e){return 1===e},Ze.prototype.interfaces_=function(){return[Ue]},Ze.prototype.getClass=function(){return Ze},function(){}),He=(We.prototype.add=function(){},We.prototype.addAll=function(){},We.prototype.isEmpty=function(){},We.prototype.iterator=function(){},We.prototype.size=function(){},We.prototype.toArray=function(){},We.prototype.remove=function(){},(n.prototype=new Error).name="IndexOutOfBoundsException",function(){}),je=(He.prototype.hasNext=function(){},He.prototype.next=function(){},He.prototype.remove=function(){},function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(){},e.prototype.set=function(){},e.prototype.isEmpty=function(){},e}(We)),x=((i.prototype=new Error).name="NoSuchElementException",function(t){function e(){t.call(this),this.array_=[],arguments[0]instanceof We&&this.addAll(arguments[0])}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.ensureCapacity=function(){},e.prototype.interfaces_=function(){return[t,We]},e.prototype.add=function(e){return 1===arguments.length?this.array_.push(e):this.array_.splice(arguments[0],arguments[1]),!0},e.prototype.clear=function(){this.array_=[]},e.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next());return!0},e.prototype.set=function(e,t){var n=this.array_[e];return this.array_[e]=t,n},e.prototype.iterator=function(){return new Ye(this)},e.prototype.get=function(e){if(e<0||e>=this.size())throw new n;return this.array_[e]},e.prototype.isEmpty=function(){return 0===this.array_.length},e.prototype.size=function(){return this.array_.length},e.prototype.toArray=function(){for(var e=[],t=0,n=this.array_.length;t=1)if(this.get(this.size()-1).equals2D(r))return null;m.prototype.add.call(this,r)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var i=arguments[0],o=arguments[1];return this.add(i,o),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var a=arguments[0],s=arguments[1];if(arguments[2])for(var A=0;A=0;l--)this.add(a[l],s);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof B){var c=arguments[0],g=arguments[1];if(!arguments[2]){var u=this.size();if(u>0){if(c>0)if(this.get(c-1).equals2D(g))return null;if(cf&&(I=-1);for(var C=p;C!==f;C+=I)this.add(d[C],h);return!0}},e.prototype.closeRing=function(){this.size()>0&&this.add(new B(this.get(0)),!1)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},Object.defineProperties(e,t),e}(x),R=function(){},Je={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}},Ke=(Je.ForwardComparator.get=function(){return Ke},Je.BidirectionalComparator.get=function(){return Xe},Je.coordArrayType.get=function(){return new Array(0).fill(null)},R.prototype.interfaces_=function(){return[]},R.prototype.getClass=function(){return R},R.isRing=function(e){return!(e.length<4)&&!!e[0].equals2D(e[e.length-1])},R.ptNotInList=function(e,t){for(var n=0;n=e?t:[]},R.indexOf=function(e,t){for(var n=0;n0)&&(t=e[n]);return t},R.extract=function(e,t,n){t=Ae.clamp(t,0,e.length);var r=(n=Ae.clamp(n,-1,e.length))-t+1;n<0&&(r=0),t>=e.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=R.compare(n,r);return R.isEqualReversed(n,r)?0:i},Xe.prototype.OLDcompare=function(e,t){var n=e,r=t;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=R.increasingDirection(n),o=R.increasingDirection(r),a=i>0?0:n.length-1,s=o>0?0:n.length-1,A=0;A0))return t.value;t=t.right}}return null},p.prototype.put=function(e,t){if(null===this.root_)return this.root_={key:e,value:t,left:null,right:null,parent:null,color:nt,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,r,i=this.root_;do{if(n=i,(r=e.compareTo(i.key))<0)i=i.left;else{if(!(r>0)){var o=i.value;return i.value=t,o}i=i.right}}while(null!==i);var a={key:e,left:null,right:null,value:t,parent:n,color:nt,getValue:function(){return this.value},getKey:function(){return this.key}};return r<0?n.left=a:n.right=a,this.fixAfterInsertion(a),this.size_++,null},p.prototype.fixAfterInsertion=function(e){for(e.color=1;null!=e&&e!==this.root_&&1===e.parent.color;)if(a(e)===l(a(a(e)))){var t=c(a(a(e)));1===s(t)?(u(a(e),nt),u(t,nt),u(a(a(e)),1),e=a(a(e))):(e===c(a(e))&&(e=a(e),this.rotateLeft(e)),u(a(e),nt),u(a(a(e)),1),this.rotateRight(a(a(e))))}else{var n=l(a(a(e)));1===s(n)?(u(a(e),nt),u(n,nt),u(a(a(e)),1),e=a(a(e))):(e===l(a(e))&&(e=a(e),this.rotateRight(e)),u(a(e),nt),u(a(a(e)),1),this.rotateLeft(a(a(e))))}this.root_.color=nt},p.prototype.values=function(){var e=new x,t=this.getFirstEntry();if(null!==t)for(e.add(t.value);null!==(t=p.successor(t));)e.add(t.value);return e},p.prototype.entrySet=function(){var e=new et,t=this.getFirstEntry();if(null!==t)for(e.add(t);null!==(t=p.successor(t));)e.add(t);return e},p.prototype.rotateLeft=function(e){if(null!=e){var t=e.right;e.right=t.left,null!=t.left&&(t.left.parent=e),t.parent=e.parent,null===e.parent?this.root_=t:e.parent.left===e?e.parent.left=t:e.parent.right=t,t.left=e,e.parent=t}},p.prototype.rotateRight=function(e){if(null!=e){var t=e.left;e.left=t.right,null!=t.right&&(t.right.parent=e),t.parent=e.parent,null===e.parent?this.root_=t:e.parent.right===e?e.parent.right=t:e.parent.left=t,t.right=e,e.parent=t}},p.prototype.getFirstEntry=function(){var e=this.root_;if(null!=e)for(;null!=e.left;)e=e.left;return e},p.successor=function(e){if(null===e)return null;if(null!==e.right){for(var t=e.right;null!==t.left;)t=t.left;return t}for(var n=e.parent,r=e;null!==n&&r===n.right;)r=n,n=n.parent;return n},p.prototype.size=function(){return this.size_},function(){}),it=(rt.prototype.interfaces_=function(){return[]},rt.prototype.getClass=function(){return rt},h.prototype=new o,(f.prototype=new h).contains=function(e){for(var t=0,n=this.array_.length;t=0;){var a=i.substring(0,o);r.add(a),o=(i=i.substring(o+n)).indexOf(t)}i.length>0&&r.add(i);for(var s=new Array(r.size()).fill(null),A=0;A0)for(var o=i;o0&&r.append(" ");for(var o=0;o0&&r.append(","),r.append(dt.toString(e.getOrdinate(i,o)))}return r.append(")"),r.toString()}},D.ensureValidRing=function(e,t){var n=t.size();if(0===n)return t;if(n<=3)return D.createClosedRing(e,t,4);return t.getOrdinate(0,E.X)===t.getOrdinate(n-1,E.X)&&t.getOrdinate(0,E.Y)===t.getOrdinate(n-1,E.Y)?t:D.createClosedRing(e,t,n+1)},D.createClosedRing=function(e,t,n){var r=e.create(n,t.getDimension()),i=t.size();D.copy(t,0,r,0,i);for(var o=i;o0&&D.reverse(this._points),null}},e.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},e.prototype.getBoundaryDimension=function(){return this.isClosed()?F.FALSE:0},e.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},e.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},e.prototype.getDimension=function(){return 1},e.prototype.getLength=function(){return S.computeLength(this._points)},e.prototype.getNumPoints=function(){return this._points.size()},e.prototype.reverse=function(){var e=this._points.copy();D.reverse(e);return this.getFactory().createLineString(e)},e.prototype.compareToSameClass=function(){if(1===arguments.length){for(var e=arguments[0],t=0,n=0;t= 2)");this._points=e},e.prototype.isCoordinate=function(e){for(var t=0;t=1&&this.getCoordinateSequence().size()= 4)")},e.prototype.getGeometryType=function(){return"LinearRing"},e.prototype.copy=function(){return new e(this._points.copy(),this._factory)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},t.MINIMUM_VALID_SIZE.get=function(){return 4},t.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(e,t),e}(G),Bt=function(n){function e(){n.apply(this,arguments)}n&&(e.__proto__=n),(e.prototype=Object.create(n&&n.prototype)).constructor=e;var t={serialVersionUID:{configurable:!0}};return e.prototype.getSortIndex=function(){return _.SORTINDEX_MULTIPOLYGON},e.prototype.equalsExact=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return!!this.isEquivalentClass(e)&&n.prototype.equalsExact.call(this,e,t)}return n.prototype.equalsExact.apply(this,arguments)},e.prototype.getBoundaryDimension=function(){return 1},e.prototype.getDimension=function(){return 2},e.prototype.reverse=function(){for(var e=this._geometries.length,t=new Array(e).fill(null),n=0;n0?t.createPoint(n[0]):t.createPoint():e},Qt.prototype.interfaces_=function(){return[bt.GeometryEditorOperation]},Qt.prototype.getClass=function(){return Qt},function(){}),N=(wt.prototype.edit=function(e,t){return e instanceof yt?t.createLinearRing(this.edit(e.getCoordinateSequence(),e)):e instanceof G?t.createLineString(this.edit(e.getCoordinateSequence(),e)):e instanceof ft?t.createPoint(this.edit(e.getCoordinateSequence(),e)):e},wt.prototype.interfaces_=function(){return[bt.GeometryEditorOperation]},wt.prototype.getClass=function(){return wt},function(){if(this._dimension=3,this._coordinates=null,1===arguments.length){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var e=arguments[0];this._coordinates=new Array(e).fill(null);for(var t=0;t0){var e=new ce(17*this._coordinates.length);e.append("("),e.append(this._coordinates[0]);for(var t=1;t3&&(r=3),r<2?new N(n):new N(n,r)}},_t.prototype.interfaces_=function(){return[ae,e]},_t.prototype.getClass=function(){return _t},_t.instance=function(){return _t.instanceObject},xt.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},xt.instanceObject.get=function(){return new _t},Object.defineProperties(_t,xt),function(t){function e(){t.call(this),this.map_=new Map}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(e){return this.map_.get(e)||null},e.prototype.put=function(e,t){return this.map_.set(e,t),t},e.prototype.values=function(){for(var e=new x,t=this.map_.values(),n=t.next();!n.done;)e.add(n.value),n=t.next();return e},e.prototype.entrySet=function(){var t=new et;return this.map_.entries().forEach(function(e){return t.add(e)}),t},e.prototype.size=function(){return this.map_.size()},e}(qe)),k=function t(){if(this._modelType=null,this._scale=null,0===arguments.length)this._modelType=t.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof Dt){var e=arguments[0];this._modelType=e,e===t.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var n=arguments[0];this._modelType=t.FIXED,this.setScale(n)}else if(arguments[0]instanceof t){var r=arguments[0];this._modelType=r._modelType,this._scale=r._scale}},Ft={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}},Dt=(k.prototype.equals=function(e){if(!(e instanceof k))return!1;var t=e;return this._modelType===t._modelType&&this._scale===t._scale},k.prototype.compareTo=function(e){var t=e,n=this.getMaximumSignificantDigits(),r=t.getMaximumSignificantDigits();return new ge(n).compareTo(new ge(r))},k.prototype.getScale=function(){return this._scale},k.prototype.isFloating=function(){return this._modelType===k.FLOATING||this._modelType===k.FLOATING_SINGLE},k.prototype.getType=function(){return this._modelType},k.prototype.toString=function(){var e="UNKNOWN";return this._modelType===k.FLOATING?e="Floating":this._modelType===k.FLOATING_SINGLE?e="Floating-Single":this._modelType===k.FIXED&&(e="Fixed (Scale="+this.getScale()+")"),e},k.prototype.makePrecise=function(){if("number"==typeof arguments[0]){var e=arguments[0];if(C.isNaN(e))return e;if(this._modelType===k.FLOATING_SINGLE)return e;return this._modelType===k.FIXED?Math.round(e*this._scale)/this._scale:e}if(arguments[0]instanceof B){var t=arguments[0];if(this._modelType===k.FLOATING)return null;t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y)}},k.prototype.getMaximumSignificantDigits=function(){var e=16;return this._modelType===k.FLOATING?e=16:this._modelType===k.FLOATING_SINGLE?e=6:this._modelType===k.FIXED&&(e=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),e},k.prototype.setScale=function(e){this._scale=Math.abs(e)},k.prototype.interfaces_=function(){return[e,te]},k.prototype.getClass=function(){return k},k.mostPrecise=function(e,t){return e.compareTo(t)>=0?e:t},Ft.serialVersionUID.get=function(){return 0x6bee6404e9a25c00},Ft.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(k,Ft),function t(e){this._name=e||null,t.nameToTypeMap.put(e,this)}),Gt={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}},T=(Dt.prototype.readResolve=function(){return Dt.nameToTypeMap.get(this._name)},Dt.prototype.toString=function(){return this._name},Dt.prototype.interfaces_=function(){return[e]},Dt.prototype.getClass=function(){return Dt},Gt.serialVersionUID.get=function(){return-552860263173159e4},Gt.nameToTypeMap.get=function(){return new Rt},Object.defineProperties(Dt,Gt),k.Type=Dt,k.FIXED=new Dt("FIXED"),k.FLOATING=new Dt("FLOATING"),k.FLOATING_SINGLE=new Dt("FLOATING SINGLE"),function t(){this._precisionModel=new k,this._SRID=0,this._coordinateSequenceFactory=t.getDefaultCoordinateSequenceFactory(),0===arguments.length||(1===arguments.length?b(arguments[0],ae)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof k&&(this._precisionModel=arguments[0]):2===arguments.length?(this._precisionModel=arguments[0],this._SRID=arguments[1]):3===arguments.length&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))}),Nt={serialVersionUID:{configurable:!0}},kt=(T.prototype.toGeometry=function(e){return e.isNull()?this.createPoint(null):e.getMinX()===e.getMaxX()&&e.getMinY()===e.getMaxY()?this.createPoint(new B(e.getMinX(),e.getMinY())):e.getMinX()===e.getMaxX()||e.getMinY()===e.getMaxY()?this.createLineString([new B(e.getMinX(),e.getMinY()),new B(e.getMaxX(),e.getMaxY())]):this.createPolygon(this.createLinearRing([new B(e.getMinX(),e.getMinY()),new B(e.getMinX(),e.getMaxY()),new B(e.getMaxX(),e.getMaxY()),new B(e.getMaxX(),e.getMinY()),new B(e.getMinX(),e.getMinY())]),null)},T.prototype.createLineString=function(e){return e?e instanceof Array?new G(this.getCoordinateSequenceFactory().create(e),this):b(e,E)?new G(e,this):void 0:new G(this.getCoordinateSequenceFactory().create([]),this)},T.prototype.createMultiLineString=function(){if(0===arguments.length)return new ct(null,this);if(1===arguments.length){var e=arguments[0];return new ct(e,this)}},T.prototype.buildGeometry=function(e){for(var t=null,n=!1,r=!1,i=e.iterator();i.hasNext();){var o=i.next(),a=o.getClass();null===t&&(t=a),a!==t&&(n=!0),o.isGeometryCollectionOrDerived()&&(r=!0)}if(null===t)return this.createGeometryCollection();if(n||r)return this.createGeometryCollection(T.toGeometryArray(e));var s=e.iterator().next();if(e.size()>1){if(s instanceof Ct)return this.createMultiPolygon(T.toPolygonArray(e));if(s instanceof G)return this.createMultiLineString(T.toLineStringArray(e));if(s instanceof ft)return this.createMultiPoint(T.toPointArray(e));w.shouldNeverReachHere("Unhandled class: "+s.getClass().getName())}return s},T.prototype.createMultiPointFromCoords=function(e){return this.createMultiPoint(null!==e?this.getCoordinateSequenceFactory().create(e):null)},T.prototype.createPoint=function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof B){var e=arguments[0];return this.createPoint(null!==e?this.getCoordinateSequenceFactory().create([e]):null)}if(b(arguments[0],E)){var t=arguments[0];return new ft(t,this)}}},T.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},T.prototype.createPolygon=function(){if(0===arguments.length)return new Ct(null,null,this);if(1===arguments.length){if(b(arguments[0],E)){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Array){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof yt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];return new Ct(r,i,this)}},T.prototype.getSRID=function(){return this._SRID},T.prototype.createGeometryCollection=function(){if(0===arguments.length)return new lt(null,this);if(1===arguments.length){var e=arguments[0];return new lt(e,this)}},T.prototype.createGeometry=function(e){return new bt(this).edit(e,{edit:function(){if(2===arguments.length){var e=arguments[0];return this._coordinateSequenceFactory.create(e)}}})},T.prototype.getPrecisionModel=function(){return this._precisionModel},T.prototype.createLinearRing=function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return this.createLinearRing(null!==e?this.getCoordinateSequenceFactory().create(e):null)}if(b(arguments[0],E)){var t=arguments[0];return new yt(t,this)}}},T.prototype.createMultiPolygon=function(){if(0===arguments.length)return new Bt(null,this);if(1===arguments.length){var e=arguments[0];return new Bt(e,this)}},T.prototype.createMultiPoint=function(){if(0===arguments.length)return new mt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){var e=arguments[0];return new mt(e,this)}if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(b(arguments[0],E)){var n=arguments[0];if(null===n)return this.createMultiPoint(new Array(0).fill(null));for(var r=new Array(n.size()).fill(null),i=0;i=this.size())throw new Error;return this.array_[e]},y.prototype.push=function(e){return this.array_.push(e),e},y.prototype.pop=function(e){if(0===this.array_.length)throw new d;return this.array_.pop()},y.prototype.peek=function(){if(0===this.array_.length)throw new d;return this.array_[this.array_.length-1]},y.prototype.empty=function(){return 0===this.array_.length},y.prototype.isEmpty=function(){return this.empty()},y.prototype.search=function(e){return this.array_.indexOf(e)},y.prototype.size=function(){return this.array_.length},y.prototype.toArray=function(){for(var e=[],t=0,n=this.array_.length;t0&&this._minIndexthis._minCoord.y&&n.y>this._minCoord.y&&r===S.CLOCKWISE&&(i=!0),i&&(this._minIndex=this._minIndex-1)},Vt.prototype.getRightmostSideOfSegment=function(e,t){var n=e.getEdge().getCoordinates();if(t<0||t+1>=n.length)return-1;if(n[t].y===n[t+1].y)return-1;var r=M.LEFT;return n[t].ythis._minCoord.x)&&(this._minDe=e,this._minIndex=n,this._minCoord=t[n])},Vt.prototype.findRightmostEdgeAtNode=function(){var e=this._minDe.getNode().getEdges();this._minDe=e.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Vt.prototype.findEdge=function(e){for(var t=e.iterator();t.hasNext();){var n=t.next();n.isForward()&&this.checkForRightmostCoordinate(n)}w.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe;this.getRightmostSide(this._minDe,this._minIndex)===M.LEFT&&(this._orientedDe=this._minDe.getSym())},Vt.prototype.interfaces_=function(){return[]},Vt.prototype.getClass=function(){return Vt},function(r){function e(t,n){r.call(this,e.msgWithCoord(t,n)),this.pt=n?new B(n):null,this.name="TopologyException"}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.getCoordinate=function(){return this.pt},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.msgWithCoord=function(e,t){return t?e:e+" [ "+t+" ]"},e}(Se)),Wt=function(){this.array_=[]},Ht=(Wt.prototype.addLast=function(e){this.array_.push(e)},Wt.prototype.removeFirst=function(){return this.array_.shift()},Wt.prototype.isEmpty=function(){return 0===this.array_.length},function(){this._finder=null,this._dirEdgeList=new x,this._nodes=new x,this._rightMostCoord=null,this._env=null,this._finder=new Vt}),U=(Ht.prototype.clearVisitedEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();)e.next().setVisited(!1)},Ht.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},Ht.prototype.computeNodeDepth=function(e){for(var t=null,n=e.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){t=r;break}}if(null===t)throw new Zt("unable to find edge to compute depths at "+e.getCoordinate());e.getEdges().computeDepths(t);for(var i=e.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},Ht.prototype.computeDepth=function(e){this.clearVisitedEdges();var t=this._finder.getEdge();t.setEdgeDepths(M.RIGHT,e),this.copySymDepths(t),this.computeDepths(t)},Ht.prototype.create=function(e){this.addReachable(e),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},Ht.prototype.findResultEdges=function(){for(var e=this._dirEdgeList.iterator();e.hasNext();){var t=e.next();t.getDepth(M.RIGHT)>=1&&t.getDepth(M.LEFT)<=0&&!t.isInteriorAreaEdge()&&t.setInResult(!0)}},Ht.prototype.computeDepths=function(e){var t=new et,n=new Wt,r=e.getNode();for(n.addLast(r),t.add(r),e.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();t.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var a=o.next().getSym();if(!a.isVisited()){var s=a.getNode();t.contains(s)||(n.addLast(s),t.add(s))}}}},Ht.prototype.compareTo=function(e){var t=e;return this._rightMostCoord.xt._rightMostCoord.x?1:0},Ht.prototype.getEnvelope=function(){if(null===this._env){for(var e=new Q,t=this._dirEdgeList.iterator();t.hasNext();)for(var n=t.next().getEdge().getCoordinates(),r=0;rthis.location.length){var t=new Array(3).fill(null);t[M.ON]=this.location[M.ON],t[M.LEFT]=m.NONE,t[M.RIGHT]=m.NONE,this.location=t}for(var n=0;n1&&e.append(m.toLocationSymbol(this.location[M.LEFT])),e.append(m.toLocationSymbol(this.location[M.ON])),this.location.length>1&&e.append(m.toLocationSymbol(this.location[M.RIGHT])),e.toString()},U.prototype.setLocations=function(e,t,n){this.location[M.ON]=e,this.location[M.LEFT]=t,this.location[M.RIGHT]=n},U.prototype.get=function(e){return e1},U.prototype.isAnyNull=function(){for(var e=0;ethis._maxNodeDegree&&(this._maxNodeDegree=t),e=this.getNext(e)}while(e!==this._startDe);this._maxNodeDegree*=2},L.prototype.addPoints=function(e,t,n){var r=e.getCoordinates();if(t){var i=1;n&&(i=0);for(var o=i;o=0;s--)this._pts.add(r[s])}},L.prototype.isHole=function(){return this._isHole},L.prototype.setInResult=function(){var e=this._startDe;do{e.getEdge().setInResult(!0),e=e.getNext()}while(e!==this._startDe)},L.prototype.containsPoint=function(e){var t=this.getLinearRing();if(!t.getEnvelopeInternal().contains(e))return!1;if(!S.isPointInRing(e,t.getCoordinates()))return!1;for(var n=this._holes.iterator();n.hasNext();)if(n.next().containsPoint(e))return!1;return!0},L.prototype.addHole=function(e){this._holes.add(e)},L.prototype.isShell=function(){return null===this._shell},L.prototype.getLabel=function(){return this._label},L.prototype.getEdges=function(){return this._edges},L.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},L.prototype.getShell=function(){return this._shell},L.prototype.mergeLabel=function(){if(1===arguments.length){var e=arguments[0];this.mergeLabel(e,0),this.mergeLabel(e,1)}else if(2===arguments.length){var t=arguments[0],n=arguments[1],r=t.getLocation(n,M.RIGHT);if(r===m.NONE)return null;if(this._label.getLocation(n)===m.NONE)return this._label.setLocation(n,r),null}},L.prototype.setShell=function(e){this._shell=e,null!==e&&e.addHole(this)},L.prototype.toPolygon=function(e){for(var t=new Array(this._holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(e)},zt.prototype.isInResult=function(){return this._isInResult},zt.prototype.isVisited=function(){return this._isVisited},zt.prototype.interfaces_=function(){return[]},zt.prototype.getClass=function(){return zt},function(n){function e(){n.call(this),this._coord=null,this._edges=null;var e=arguments[0],t=arguments[1];this._coord=e,this._edges=t,this._label=new O(0,m.NONE)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.isIncidentEdgeInResult=function(){for(var e=this.getEdges().getEdges().iterator();e.hasNext();)if(e.next().getEdge().isInResult())return!0;return!1},e.prototype.isIsolated=function(){return 1===this._label.getGeometryCount()},e.prototype.getCoordinate=function(){return this._coord},e.prototype.print=function(e){e.println("node "+this._coord+" lbl: "+this._label)},e.prototype.computeIM=function(e){},e.prototype.computeMergedLocation=function(e,t){var n=m.NONE;if(n=this._label.getLocation(t),!e.isNull(t)){var r=e.getLocation(t);n!==m.BOUNDARY&&(n=r)}return n},e.prototype.setLabel=function(){if(2!==arguments.length)return n.prototype.setLabel.apply(this,arguments);var e=arguments[0],t=arguments[1];null===this._label?this._label=new O(e,t):this._label.setLocation(e,t)},e.prototype.getEdges=function(){return this._edges},e.prototype.mergeLabel=function(){if(arguments[0]instanceof e){var t=arguments[0];this.mergeLabel(t._label)}else if(arguments[0]instanceof O)for(var n=arguments[0],r=0;r<2;r++){var i=this.computeMergedLocation(n,r);this._label.getLocation(r)===m.NONE&&this._label.setLocation(r,i)}},e.prototype.add=function(e){this._edges.insert(e),e.setNode(this)},e.prototype.setLabelBoundary=function(e){if(null===this._label)return null;var t=m.NONE;null!==this._label&&(t=this._label.getLocation(e));var n=null;switch(t){case m.BOUNDARY:n=m.INTERIOR;break;case m.INTERIOR:default:n=m.BOUNDARY}this._label.setLocation(e,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(zt)),Kt=function(){this.nodeMap=new p,this.nodeFact=null;var e=arguments[0];this.nodeFact=e},P=(Kt.prototype.find=function(e){return this.nodeMap.get(e)},Kt.prototype.addNode=function(){if(arguments[0]instanceof B){var e=arguments[0],t=this.nodeMap.get(e);return null===t&&(t=this.nodeFact.createNode(e),this.nodeMap.put(e,t)),t}if(arguments[0]instanceof Jt){var n=arguments[0],r=this.nodeMap.get(n.getCoordinate());return null===r?(this.nodeMap.put(n.getCoordinate(),n),n):(r.mergeLabel(n),r)}},Kt.prototype.print=function(e){for(var t=this.iterator();t.hasNext();)t.next().print(e)},Kt.prototype.iterator=function(){return this.nodeMap.values().iterator()},Kt.prototype.values=function(){return this.nodeMap.values()},Kt.prototype.getBoundaryNodes=function(e){for(var t=new x,n=this.iterator();n.hasNext();){var r=n.next();r.getLabel().getLocation(e)===m.BOUNDARY&&t.add(r)}return t},Kt.prototype.add=function(e){var t=e.getCoordinate();this.addNode(t).add(e)},Kt.prototype.interfaces_=function(){return[]},Kt.prototype.getClass=function(){return Kt},function(){}),Xt={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}},qt=(P.prototype.interfaces_=function(){return[]},P.prototype.getClass=function(){return P},P.isNorthern=function(e){return e===P.NE||e===P.NW},P.isOpposite=function(e,t){if(e===t)return!1;return 2===(e-t+4)%4},P.commonHalfPlane=function(e,t){if(e===t)return e;if(2===(e-t+4)%4)return-1;var n=et?e:t)?3:n},P.isInHalfPlane=function(e,t){return t===P.SE?e===P.SE||e===P.SW:e===t||e===t+1},P.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],t=arguments[1];if(0===e&&0===t)throw new I("Cannot compute the quadrant for point ( "+e+", "+t+" )");return e>=0?t>=0?P.NE:P.SE:t>=0?P.NW:P.SW}if(arguments[0]instanceof B&&arguments[1]instanceof B){var n=arguments[0],r=arguments[1];if(r.x===n.x&&r.y===n.y)throw new I("Cannot compute the quadrant for two identical points "+n);return r.x>=n.x?r.y>=n.y?P.NE:P.SE:r.y>=n.y?P.NW:P.SW}},Xt.NE.get=function(){return 0},Xt.NW.get=function(){return 1},Xt.SW.get=function(){return 2},Xt.SE.get=function(){return 3},Object.defineProperties(P,Xt),function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var e=arguments[0];this._edge=e}else if(3===arguments.length){var t=arguments[0],n=arguments[1],r=arguments[2];this._edge=t,this.init(n,r),this._label=null}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this._edge=i,this.init(o,a),this._label=s}}),$t=(qt.prototype.compareDirection=function(e){return this._dx===e._dx&&this._dy===e._dy?0:this._quadrant>e._quadrant?1:this._quadrant2){o.linkDirectedEdgesForMinimalEdgeRings();var a=o.buildMinimalRings(),s=this.findShell(a);null!==s?(this.placePolygonHoles(s,a),t.add(s)):n.addAll(a)}else r.add(o)}return r},tn.prototype.containsPoint=function(e){for(var t=this._shellList.iterator();t.hasNext();)if(t.next().containsPoint(e))return!0;return!1},tn.prototype.buildMaximalEdgeRings=function(e){for(var t=new x,n=e.iterator();n.hasNext();){var r=n.next();if(r.isInResult()&&r.getLabel().isArea()&&null===r.getEdgeRing()){var i=new Yt(r,this._geometryFactory);t.add(i),i.setInResult()}}return t},tn.prototype.placePolygonHoles=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next();r.isHole()&&r.setShell(e)}},tn.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},tn.prototype.findEdgeRingContaining=function(e,t){for(var n=e.getLinearRing(),r=n.getEnvelopeInternal(),i=n.getCoordinateN(0),o=null,a=null,s=t.iterator();s.hasNext();){var A=s.next(),l=A.getLinearRing(),c=l.getEnvelopeInternal();null!==o&&(a=o.getLinearRing().getEnvelopeInternal());var g=!1;c.contains(r)&&S.isPointInRing(i,l.getCoordinates())&&(g=!0),g&&(null===o||a.contains(c))&&(o=A)}return o},tn.prototype.findShell=function(e){for(var t=0,n=null,r=e.iterator();r.hasNext();){var i=r.next();i.isHole()||(n=i,t++)}return w.isTrue(t<=1,"found two shells in MinimalEdgeRing list"),n},tn.prototype.add=function(){if(1===arguments.length){var e=arguments[0];this.add(e.getEdgeEnds(),e.getNodes())}else if(2===arguments.length){var t=arguments[0],n=arguments[1];V.linkResultDirectedEdges(n);var r=this.buildMaximalEdgeRings(t),i=new x,o=this.buildMinimalEdgeRings(r,this._shellList,i);this.sortShellsAndHoles(o,this._shellList,i),this.placeFreeHoles(this._shellList,i)}},tn.prototype.interfaces_=function(){return[]},tn.prototype.getClass=function(){return tn},function(){}),rn=(nn.prototype.getBounds=function(){},nn.prototype.interfaces_=function(){return[]},nn.prototype.getClass=function(){return nn},function(){this._bounds=null,this._item=null;var e=arguments[0],t=arguments[1];this._bounds=e,this._item=t}),on=(rn.prototype.getItem=function(){return this._item},rn.prototype.getBounds=function(){return this._bounds},rn.prototype.interfaces_=function(){return[nn,e]},rn.prototype.getClass=function(){return rn},function(){this._size=null,this._items=null,this._size=0,this._items=new x,this._items.add(null)}),an=(on.prototype.poll=function(){if(this.isEmpty())return null;var e=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),e},on.prototype.size=function(){return this._size},on.prototype.reorder=function(e){for(var t=null,n=this._items.get(e);2*e<=this._size&&((t=2*e)!==this._size&&this._items.get(t+1).compareTo(this._items.get(t))<0&&t++,this._items.get(t).compareTo(n)<0);e=t)this._items.set(e,this._items.get(t));this._items.set(e,n)},on.prototype.clear=function(){this._size=0,this._items.clear()},on.prototype.isEmpty=function(){return 0===this._size},on.prototype.add=function(e){this._items.add(null),this._size+=1;var t=this._size;for(this._items.set(0,e);e.compareTo(this._items.get(Math.trunc(t/2)))<0;t/=2)this._items.set(t,this._items.get(Math.trunc(t/2)));this._items.set(t,e)},on.prototype.interfaces_=function(){return[]},on.prototype.getClass=function(){return on},function(){}),sn=(an.prototype.visitItem=function(e){},an.prototype.interfaces_=function(){return[]},an.prototype.getClass=function(){return an},function(){}),An=(sn.prototype.insert=function(e,t){},sn.prototype.remove=function(e,t){},sn.prototype.query=function(){},sn.prototype.interfaces_=function(){return[]},sn.prototype.getClass=function(){return sn},function(){if(this._childBoundables=new x,this._bounds=null,this._level=null,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this._level=e}}),ln={serialVersionUID:{configurable:!0}},cn=(An.prototype.getLevel=function(){return this._level},An.prototype.size=function(){return this._childBoundables.size()},An.prototype.getChildBoundables=function(){return this._childBoundables},An.prototype.addChildBoundable=function(e){w.isTrue(null===this._bounds),this._childBoundables.add(e)},An.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},An.prototype.getBounds=function(){return null===this._bounds&&(this._bounds=this.computeBounds()),this._bounds},An.prototype.interfaces_=function(){return[nn,e]},An.prototype.getClass=function(){return An},ln.serialVersionUID.get=function(){return 0x5a1e55ec41369800},Object.defineProperties(An,ln),function(){}),gn=(cn.reverseOrder=function(){return{compare:function(e,t){return t.compareTo(e)}}},cn.min=function(e){return cn.sort(e),e.get(0)},cn.sort=function(e,t){var n=e.toArray();t?ot.sort(n,t):ot.sort(n);for(var r=e.iterator(),i=0,o=n.length;ign.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,e,t),null):(this.expand(this._boundable2,this._boundable1,e,t),null);if(n)return this.expand(this._boundable1,this._boundable2,e,t),null;if(r)return this.expand(this._boundable2,this._boundable1,e,t),null;throw new I("neither boundable is composite")},gn.prototype.isLeaves=function(){return!(gn.isComposite(this._boundable1)||gn.isComposite(this._boundable2))},gn.prototype.compareTo=function(e){var t=e;return this._distancet._distance?1:0},gn.prototype.expand=function(e,t,n,r){for(var i=e.getChildBoundables().iterator();i.hasNext();){var o=i.next(),a=new gn(o,t,this._itemDistance);a.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=n}}),dn={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}},hn=(un.prototype.getNodeCapacity=function(){return this._nodeCapacity},un.prototype.lastNode=function(e){return e.get(e.size()-1)},un.prototype.size=function(){if(0===arguments.length)return this.isEmpty()?0:(this.build(),this.size(this._root));if(1===arguments.length){for(var e=0,t=arguments[0].getChildBoundables().iterator();t.hasNext();){var n=t.next();n instanceof An?e+=this.size(n):n instanceof rn&&(e+=1)}return e}},un.prototype.removeItem=function(e,t){for(var n=null,r=e.getChildBoundables().iterator();r.hasNext();){var i=r.next();i instanceof rn&&i.getItem()===t&&(n=i)}return null!==n&&(e.getChildBoundables().remove(n),!0)},un.prototype.itemsTree=function(){if(0===arguments.length){this.build();var e=this.itemsTree(this._root);return null===e?new x:e}if(1===arguments.length){for(var t=arguments[0],n=new x,r=t.getChildBoundables().iterator();r.hasNext();){var i=r.next();if(i instanceof An){var o=this.itemsTree(i);null!==o&&n.add(o)}else i instanceof rn?n.add(i.getItem()):w.shouldNeverReachHere()}return n.size()<=0?null:n}},un.prototype.insert=function(e,t){w.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new rn(e,t))},un.prototype.boundablesAtLevel=function(){if(1===arguments.length){var e=arguments[0],t=new x;return this.boundablesAtLevel(e,this._root,t),t}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];if(w.isTrue(n>-2),r.getLevel()===n)return i.add(r),null;for(var o=r.getChildBoundables().iterator();o.hasNext();){var a=o.next();a instanceof An?this.boundablesAtLevel(n,a,i):(w.isTrue(a instanceof rn),-1===n&&i.add(a))}return null}},un.prototype.query=function(){if(1===arguments.length){var e=arguments[0];this.build();var t=new x;return this.isEmpty()?t:(this.getIntersectsOp().intersects(this._root.getBounds(),e)&&this.query(e,this._root,t),t)}if(2===arguments.length){var n=arguments[0],r=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),n)&&this.query(n,this._root,r)}else if(3===arguments.length)if(b(arguments[2],an)&&arguments[0]instanceof Object&&arguments[1]instanceof An)for(var i=arguments[0],o=arguments[1],a=arguments[2],s=o.getChildBoundables(),A=0;Ae&&(e=r)}}return e+1}},un.prototype.createParentBoundables=function(e,t){w.isTrue(!e.isEmpty());var n=new x;n.add(this.createNode(t));var r=new x(e);cn.sort(r,this.getComparator());for(var i=r.iterator();i.hasNext();){var o=i.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(t)),this.lastNode(n).addChildBoundable(o)}return n},un.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},un.prototype.interfaces_=function(){return[e]},un.prototype.getClass=function(){return un},un.compareDoubles=function(e,t){return e>t?1:e0);for(var n=new x,r=0;r0;){var g=c.poll(),u=g.getDistance();if(u>=A)break;g.isLeaves()?(A=u,l=g):g.expandToQueue(c,A)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var d=arguments[0],h=arguments[1],p=arguments[2],f=new rn(d,h),I=new gn(this.getRoot(),f,p);return this.nearestNeighbour(I)[0]}},n.prototype.interfaces_=function(){return[sn,e]},n.prototype.getClass=function(){return n},n.centreX=function(e){return n.avg(e.getMinX(),e.getMaxX())},n.avg=function(e,t){return(e+t)/2},n.centreY=function(e){return n.avg(e.getMinY(),e.getMaxY())},t.STRtreeNode.get=function(){return In},t.serialVersionUID.get=function(){return 0x39920f7d5f261e0},t.xComparator.get=function(){return{interfaces_:function(){return[re]},compare:function(e,t){return l.compareDoubles(n.centreX(e.getBounds()),n.centreX(t.getBounds()))}}},t.yComparator.get=function(){return{interfaces_:function(){return[re]},compare:function(e,t){return l.compareDoubles(n.centreY(e.getBounds()),n.centreY(t.getBounds()))}}},t.intersectsOp.get=function(){return{interfaces_:function(){return[l.IntersectsOp]},intersects:function(e,t){return e.intersects(t)}}},t.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(n,t),n}(un)),In=function(t){function e(){var e=arguments[0];t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeBounds=function(){for(var e=null,t=this.getChildBoundables().iterator();t.hasNext();){var n=t.next();null===e?e=new Q(n.getBounds()):e.expandToInclude(n.getBounds())}return e},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(An),Cn=function(){},mn=(Cn.prototype.interfaces_=function(){return[]},Cn.prototype.getClass=function(){return Cn},Cn.relativeSign=function(e,t){return et?1:0},Cn.compare=function(e,t,n){if(t.equals2D(n))return 0;var r=Cn.relativeSign(t.x,n.x),i=Cn.relativeSign(t.y,n.y);switch(e){case 0:return Cn.compareValue(r,i);case 1:return Cn.compareValue(i,r);case 2:return Cn.compareValue(i,-r);case 3:return Cn.compareValue(-r,i);case 4:return Cn.compareValue(-r,-i);case 5:return Cn.compareValue(-i,-r);case 6:return Cn.compareValue(-i,r);case 7:return Cn.compareValue(r,-i)}return w.shouldNeverReachHere("invalid octant value"),0},Cn.compareValue=function(e,t){return e<0?-1:e>0?1:t<0?-1:t>0?1:0},function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];this._segString=e,this.coord=new B(t),this.segmentIndex=n,this._segmentOctant=r,this._isInterior=!t.equals2D(e.getCoordinate(n))}),yn=(mn.prototype.getCoordinate=function(){return this.coord},mn.prototype.print=function(e){e.print(this.coord),e.print(" seg # = "+this.segmentIndex)},mn.prototype.compareTo=function(e){var t=e;return this.segmentIndext.segmentIndex?1:this.coord.equals2D(t.coord)?0:Cn.compare(this._segmentOctant,this.coord,t.coord)},mn.prototype.isEndPoint=function(e){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===e},mn.prototype.isInterior=function(){return this._isInterior},mn.prototype.interfaces_=function(){return[te]},mn.prototype.getClass=function(){return mn},function(){this._nodeMap=new p,this._edge=null;var e=arguments[0];this._edge=e}),Bn=(yn.prototype.getSplitCoordinates=function(){var e=new ze;this.addEndpoints();for(var t=this.iterator(),n=t.next();t.hasNext();){var r=t.next();this.addEdgeCoordinates(n,r,e),n=r}return e.toCoordinateArray()},yn.prototype.addCollapsedNodes=function(){var e=new x;this.findCollapsesFromInsertedNodes(e),this.findCollapsesFromExistingVertices(e);for(var t=e.iterator();t.hasNext();){var n=t.next().intValue();this.add(this._edge.getCoordinate(n),n)}},yn.prototype.print=function(e){e.println("Intersections:");for(var t=this.iterator();t.hasNext();)t.next().print(e)},yn.prototype.findCollapsesFromExistingVertices=function(e){for(var t=0;t=0?t>=0?n>=r?0:1:n>=r?7:6:t>=0?n>=r?3:2:n>=r?4:5}if(arguments[0]instanceof B&&arguments[1]instanceof B){var i=arguments[0],o=arguments[1],a=o.x-i.x,s=o.y-i.y;if(0===a&&0===s)throw new I("Cannot compute the octant for two identical points "+i);return Bn.octant(a,s)}},function(){}),vn=(bn.prototype.getCoordinates=function(){},bn.prototype.size=function(){},bn.prototype.getCoordinate=function(e){},bn.prototype.isClosed=function(){},bn.prototype.setData=function(e){},bn.prototype.getData=function(){},bn.prototype.interfaces_=function(){return[]},bn.prototype.getClass=function(){return bn},function(){}),Z=(vn.prototype.addIntersection=function(e,t){},vn.prototype.interfaces_=function(){return[bn]},vn.prototype.getClass=function(){return vn},function(){this._nodeList=new yn(this),this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t}),W=(Z.prototype.getCoordinates=function(){return this._pts},Z.prototype.size=function(){return this._pts.length},Z.prototype.getCoordinate=function(e){return this._pts[e]},Z.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Z.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(e),this.getCoordinate(e+1))},Z.prototype.setData=function(e){this._data=e},Z.prototype.safeOctant=function(e,t){return e.equals2D(t)?0:Bn.octant(e,t)},Z.prototype.getData=function(){return this._data},Z.prototype.addIntersection=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];this.addIntersectionNode(e,t)}else if(4===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[3],o=new B(n.getIntersection(i));this.addIntersection(o,r)}},Z.prototype.toString=function(){return we.toLineString(new N(this._pts))},Z.prototype.getNodeList=function(){return this._nodeList},Z.prototype.addIntersectionNode=function(e,t){var n=t,r=n+1;if(r=0&&n>=0?Math.max(t,n):t<=0&&n<=0?Math.max(t,n):0}if(arguments[0]instanceof B){var r=arguments[0];return S.orientationIndex(this.p0,this.p1,r)}},W.prototype.toGeometry=function(e){return e.createLineString([this.p0,this.p1])},W.prototype.isVertical=function(){return this.p0.x===this.p1.x},W.prototype.equals=function(e){if(!(e instanceof W))return!1;var t=e;return this.p0.equals(t.p0)&&this.p1.equals(t.p1)},W.prototype.intersection=function(e){var t=new Re;return t.computeIntersection(this.p0,this.p1,e.p0,e.p1),t.hasIntersection()?t.getIntersection(0):null},W.prototype.project=function(){if(arguments[0]instanceof B){var e=arguments[0];if(e.equals(this.p0)||e.equals(this.p1))return new B(e);var t=this.projectionFactor(e),n=new B;return n.x=this.p0.x+t*(this.p1.x-this.p0.x),n.y=this.p0.y+t*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof W){var r=arguments[0],i=this.projectionFactor(r.p0),o=this.projectionFactor(r.p1);if(i>=1&&o>=1)return null;if(i<=0&&o<=0)return null;var a=this.project(r.p0);i<0&&(a=this.p0),i>1&&(a=this.p1);var s=this.project(r.p1);return o<0&&(s=this.p0),o>1&&(s=this.p1),new W(a,s)}},W.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},W.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},W.prototype.getCoordinate=function(e){return 0===e?this.p0:this.p1},W.prototype.distancePerpendicular=function(e){return S.distancePointLinePerpendicular(e,this.p0,this.p1)},W.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},W.prototype.midPoint=function(){return W.midPoint(this.p0,this.p1)},W.prototype.projectionFactor=function(e){if(e.equals(this.p0))return 0;if(e.equals(this.p1))return 1;var t=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=t*t+n*n;if(r<=0)return C.NaN;return((e.x-this.p0.x)*t+(e.y-this.p0.y)*n)/r},W.prototype.closestPoints=function(e){var t=this.intersection(e);if(null!==t)return[t,t];var n=new Array(2).fill(null),r=C.MAX_VALUE,i=null,o=this.closestPoint(e.p0);r=o.distance(e.p0),n[0]=o,n[1]=e.p0;var a=this.closestPoint(e.p1);(i=a.distance(e.p1))0&&t<1)return this.project(e);return this.p0.distance(e)1||C.isNaN(t))&&(t=1),t},W.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},W.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},W.prototype.distance=function(){if(arguments[0]instanceof W){var e=arguments[0];return S.distanceLineLine(this.p0,this.p1,e.p0,e.p1)}if(arguments[0]instanceof B){var t=arguments[0];return S.distancePointLine(t,this.p0,this.p1)}},W.prototype.pointAlong=function(e){var t=new B;return t.x=this.p0.x+e*(this.p1.x-this.p0.x),t.y=this.p0.y+e*(this.p1.y-this.p0.y),t},W.prototype.hashCode=function(){var e=C.doubleToLongBits(this.p0.x);e^=31*C.doubleToLongBits(this.p0.y);var t=Math.trunc(e)^Math.trunc(e>>32),n=C.doubleToLongBits(this.p1.x);n^=31*C.doubleToLongBits(this.p1.y);return t^(Math.trunc(n)^Math.trunc(n>>32))},W.prototype.interfaces_=function(){return[te,e]},W.prototype.getClass=function(){return W},W.midPoint=function(e,t){return new B((e.x+t.x)/2,(e.y+t.y)/2)},En.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(W,En),function(){this.tempEnv1=new Q,this.tempEnv2=new Q,this._overlapSeg1=new W,this._overlapSeg2=new W}),wn=(Qn.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];e.getLineSegment(t,this._overlapSeg1),n.getLineSegment(r,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},Qn.prototype.interfaces_=function(){return[]},Qn.prototype.getClass=function(){return Qn},function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3];this._pts=e,this._start=t,this._end=n,this._context=r}),Sn=(wn.prototype.getLineSegment=function(e,t){t.p0=this._pts[e],t.p1=this._pts[e+1]},wn.prototype.computeSelect=function(e,t,n,r){var i=this._pts[t],o=this._pts[n];if(r.tempEnv1.init(i,o),n-t==1)return r.select(this,t),null;if(!e.intersects(r.tempEnv1))return null;var a=Math.trunc((t+n)/2);t=e.length-1)return e.length-1;for(var r=P.quadrant(e[n],e[n+1]),i=t+1;in.getId()&&(n.computeOverlaps(i,e),this._nOverlaps++),this._segInt.isDone())return null}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},n.SegmentOverlapAction.get=function(){return Fn},Object.defineProperties(e,n),e}(xn)),Fn=function(a){function e(){a.call(this),this._si=null;var e=arguments[0];this._si=e}return a&&(e.__proto__=a),e.prototype=Object.create(a&&a.prototype),e.prototype.constructor=e,e.prototype.overlap=function(){if(4!==arguments.length)return a.prototype.overlap.apply(this,arguments);var e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3],i=e.getContext(),o=n.getContext();this._si.processIntersections(i,t,o,r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Qn),H=function t(){if(this._quadrantSegments=t.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=t.CAP_ROUND,this._joinStyle=t.JOIN_ROUND,this._mitreLimit=t.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=t.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var e=arguments[0];this.setQuadrantSegments(e)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.setQuadrantSegments(n),this.setEndCapStyle(r)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(o),this.setJoinStyle(a),this.setMitreLimit(s)}},Dn={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}},j=(H.prototype.getEndCapStyle=function(){return this._endCapStyle},H.prototype.isSingleSided=function(){return this._isSingleSided},H.prototype.setQuadrantSegments=function(e){this._quadrantSegments=e,0===this._quadrantSegments&&(this._joinStyle=H.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=H.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),e<=0&&(this._quadrantSegments=1),this._joinStyle!==H.JOIN_ROUND&&(this._quadrantSegments=H.DEFAULT_QUADRANT_SEGMENTS)},H.prototype.getJoinStyle=function(){return this._joinStyle},H.prototype.setJoinStyle=function(e){this._joinStyle=e},H.prototype.setSimplifyFactor=function(e){this._simplifyFactor=e<0?0:e},H.prototype.getSimplifyFactor=function(){return this._simplifyFactor},H.prototype.getQuadrantSegments=function(){return this._quadrantSegments},H.prototype.setEndCapStyle=function(e){this._endCapStyle=e},H.prototype.getMitreLimit=function(){return this._mitreLimit},H.prototype.setMitreLimit=function(e){this._mitreLimit=e},H.prototype.setSingleSided=function(e){this._isSingleSided=e},H.prototype.interfaces_=function(){return[]},H.prototype.getClass=function(){return H},H.bufferDistanceError=function(e){var t=Math.PI/2/e;return 1-Math.cos(t/2)},Dn.CAP_ROUND.get=function(){return 1},Dn.CAP_FLAT.get=function(){return 2},Dn.CAP_SQUARE.get=function(){return 3},Dn.JOIN_ROUND.get=function(){return 1},Dn.JOIN_MITRE.get=function(){return 2},Dn.JOIN_BEVEL.get=function(){return 3},Dn.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Dn.DEFAULT_MITRE_LIMIT.get=function(){return 5},Dn.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(H,Dn),function(e){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=S.COUNTERCLOCKWISE,this._inputLine=e||null}),Gn={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}},Nn=(j.prototype.isDeletable=function(e,t,n,r){var i=this._inputLine[e],o=this._inputLine[t],a=this._inputLine[n];return!!this.isConcave(i,o,a)&&(!!this.isShallow(i,o,a,r)&&this.isShallowSampled(i,o,e,n,r))},j.prototype.deleteShallowConcavities=function(){for(var e=1,t=this.findNextNonDeletedIndex(e),n=this.findNextNonDeletedIndex(t),r=!1;n=0;r--)this.addPt(e[r])},Nn.prototype.isRedundant=function(e){if(this._ptList.size()<1)return!1;var t=this._ptList.get(this._ptList.size()-1);return e.distance(t)Math.PI;)e-=Y.PI_TIMES_2;for(;e<=-Math.PI;)e+=Y.PI_TIMES_2;return e},Y.angle=function(){if(1===arguments.length){var e=arguments[0];return Math.atan2(e.y,e.x)}if(2===arguments.length){var t=arguments[0],n=arguments[1],r=n.x-t.x,i=n.y-t.y;return Math.atan2(i,r)}},Y.isAcute=function(e,t,n){var r=e.x-t.x,i=e.y-t.y;return r*(n.x-t.x)+i*(n.y-t.y)>0},Y.isObtuse=function(e,t,n){var r=e.x-t.x,i=e.y-t.y;return r*(n.x-t.x)+i*(n.y-t.y)<0},Y.interiorAngle=function(e,t,n){var r=Y.angle(t,e),i=Y.angle(t,n);return Math.abs(i-r)},Y.normalizePositive=function(e){if(e<0){for(;e<0;)e+=Y.PI_TIMES_2;e>=Y.PI_TIMES_2&&(e=0)}else{for(;e>=Y.PI_TIMES_2;)e-=Y.PI_TIMES_2;e<0&&(e=0)}return e},Y.angleBetween=function(e,t,n){var r=Y.angle(t,e),i=Y.angle(t,n);return Y.diff(r,i)},Y.diff=function(e,t){var n=null;return(n=eMath.PI&&(n=2*Math.PI-n),n},Y.toRadians=function(e){return e*Math.PI/180},Y.getTurn=function(e,t){var n=Math.sin(t-e);return n>0?Y.COUNTERCLOCKWISE:n<0?Y.CLOCKWISE:Y.NONE},Y.angleBetweenOriented=function(e,t,n){var r=Y.angle(t,e),i=Y.angle(t,n)-r;return i<=-Math.PI?i+Y.PI_TIMES_2:i>Math.PI?i-Y.PI_TIMES_2:i},Tn.PI_TIMES_2.get=function(){return 2*Math.PI},Tn.PI_OVER_2.get=function(){return Math.PI/2},Tn.PI_OVER_4.get=function(){return Math.PI/4},Tn.COUNTERCLOCKWISE.get=function(){return S.COUNTERCLOCKWISE},Tn.CLOCKWISE.get=function(){return S.CLOCKWISE},Tn.NONE.get=function(){return S.COLLINEAR},Object.defineProperties(Y,Tn),function t(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new W,this._seg1=new W,this._offset0=new W,this._offset1=new W,this._side=0,this._hasNarrowConcaveAngle=!1;var e=arguments[0],n=arguments[1],r=arguments[2];this._precisionModel=e,this._bufParams=n,this._li=new Re,this._filletAngleQuantum=Math.PI/2/n.getQuadrantSegments(),n.getQuadrantSegments()>=8&&n.getJoinStyle()===H.JOIN_ROUND&&(this._closingSegLengthFactor=t.MAX_CLOSING_SEG_LEN_FACTOR),this.init(r)}),Mn={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}},Un=(z.prototype.addNextSegment=function(e,t){if(this._s0=this._s1,this._s1=this._s2,this._s2=e,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=S.computeOrientation(this._s0,this._s1,this._s2),r=n===S.CLOCKWISE&&this._side===M.LEFT||n===S.COUNTERCLOCKWISE&&this._side===M.RIGHT;0===n?this.addCollinear(t):r?this.addOutsideTurn(n,t):this.addInsideTurn(n,t)},z.prototype.addLineEndCap=function(e,t){var n=new W(e,t),r=new W;this.computeOffsetSegment(n,M.LEFT,this._distance,r);var i=new W;this.computeOffsetSegment(n,M.RIGHT,this._distance,i);var o=t.x-e.x,a=t.y-e.y,s=Math.atan2(a,o);switch(this._bufParams.getEndCapStyle()){case H.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(t,s+Math.PI/2,s-Math.PI/2,S.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case H.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case H.CAP_SQUARE:var A=new B;A.x=Math.abs(this._distance)*Math.cos(s),A.y=Math.abs(this._distance)*Math.sin(s);var l=new B(r.p1.x+A.x,r.p1.y+A.y),c=new B(i.p1.x+A.x,i.p1.y+A.y);this._segList.addPt(l),this._segList.addPt(c)}},z.prototype.getCoordinates=function(){return this._segList.getCoordinates()},z.prototype.addMitreJoin=function(e,t,n,r){var i=!0,o=null;try{o=ye.intersection(t.p0,t.p1,n.p0,n.p1);(r<=0?1:o.distance(e)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(e){if(!(e instanceof Ce))throw e;o=new B(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(t,n,r,this._bufParams.getMitreLimit())},z.prototype.addFilletCorner=function(e,t,n,r,i){var o=t.x-e.x,a=t.y-e.y,s=Math.atan2(a,o),A=n.x-e.x,l=n.y-e.y,c=Math.atan2(l,A);r===S.CLOCKWISE?s<=c&&(s+=2*Math.PI):s>=c&&(s-=2*Math.PI),this._segList.addPt(t),this.addFilletArc(e,s,c,r,i),this._segList.addPt(n)},z.prototype.addOutsideTurn=function(e,t){if(this._offset0.p1.distance(this._offset1.p0)0){var n=new B((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(n);var r=new B((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(r)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},z.prototype.createCircle=function(e){var t=new B(e.x+this._distance,e.y);this._segList.addPt(t),this.addFilletArc(e,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},z.prototype.addBevelJoin=function(e,t){this._segList.addPt(e.p1),this._segList.addPt(t.p0)},z.prototype.init=function(e){this._distance=e,this._maxCurveSegmentError=e*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new Nn,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(e*z.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},z.prototype.addCollinear=function(e){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2);this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===H.JOIN_BEVEL||this._bufParams.getJoinStyle()===H.JOIN_MITRE?(e&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,S.CLOCKWISE,this._distance))},z.prototype.closeRing=function(){this._segList.closeRing()},z.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},z.prototype.interfaces_=function(){return[]},z.prototype.getClass=function(){return z},Mn.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return.001},Mn.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return.001},Mn.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},Mn.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(z,Mn),function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var e=arguments[0],t=arguments[1];this._precisionModel=e,this._bufParams=t}),On=(Un.prototype.getOffsetCurve=function(e,t){if(this._distance=t,0===t)return null;var n=t<0,r=Math.abs(t),i=this.getSegGen(r);e.length<=1?this.computePointCurve(e[0],i):this.computeOffsetCurve(e,n,i);var o=i.getCoordinates();return n&&R.reverse(o),o},Un.prototype.computeSingleSidedBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){n.addSegments(e,!0);var i=j.simplify(e,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],M.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{n.addSegments(e,!1);var s=j.simplify(e,r),A=s.length-1;n.initSideSegments(s[0],s[1],M.LEFT),n.addFirstSegment();for(var l=2;l<=A;l++)n.addNextSegment(s[l],!0)}n.addLastSegment(),n.closeRing()},Un.prototype.computeRingBufferCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);t===M.RIGHT&&(r=-r);var i=j.simplify(e,r),o=i.length-1;n.initSideSegments(i[o-1],i[0],t);for(var a=1;a<=o;a++){var s=1!==a;n.addNextSegment(i[a],s)}n.closeRing()},Un.prototype.computeLineBufferCurve=function(e,t){var n=this.simplifyTolerance(this._distance),r=j.simplify(e,n),i=r.length-1;t.initSideSegments(r[0],r[1],M.LEFT);for(var o=2;o<=i;o++)t.addNextSegment(r[o],!0);t.addLastSegment(),t.addLineEndCap(r[i-1],r[i]);var a=j.simplify(e,-n),s=a.length-1;t.initSideSegments(a[s],a[s-1],M.LEFT);for(var A=s-2;A>=0;A--)t.addNextSegment(a[A],!0);t.addLastSegment(),t.addLineEndCap(a[1],a[0]),t.closeRing()},Un.prototype.computePointCurve=function(e,t){switch(this._bufParams.getEndCapStyle()){case H.CAP_ROUND:t.createCircle(e);break;case H.CAP_SQUARE:t.createSquare(e)}},Un.prototype.getLineCurve=function(e,t){if(this._distance=t,t<0&&!this._bufParams.isSingleSided())return null;if(0===t)return null;var n=Math.abs(t),r=this.getSegGen(n);if(e.length<=1)this.computePointCurve(e[0],r);else if(this._bufParams.isSingleSided()){var i=t<0;this.computeSingleSidedBufferCurve(e,i,r)}else this.computeLineBufferCurve(e,r);return r.getCoordinates()},Un.prototype.getBufferParameters=function(){return this._bufParams},Un.prototype.simplifyTolerance=function(e){return e*this._bufParams.getSimplifyFactor()},Un.prototype.getRingCurve=function(e,t,n){if(this._distance=n,e.length<=2)return this.getLineCurve(e,n);if(0===n)return Un.copyCoordinates(e);var r=this.getSegGen(n);return this.computeRingBufferCurve(e,t,r),r.getCoordinates()},Un.prototype.computeOffsetCurve=function(e,t,n){var r=this.simplifyTolerance(this._distance);if(t){var i=j.simplify(e,-r),o=i.length-1;n.initSideSegments(i[o],i[o-1],M.LEFT),n.addFirstSegment();for(var a=o-2;a>=0;a--)n.addNextSegment(i[a],!0)}else{var s=j.simplify(e,r),A=s.length-1;n.initSideSegments(s[0],s[1],M.LEFT),n.addFirstSegment();for(var l=2;l<=A;l++)n.addNextSegment(s[l],!0)}n.addLastSegment()},Un.prototype.getSegGen=function(e){return new z(this._precisionModel,this._bufParams,e)},Un.prototype.interfaces_=function(){return[]},Un.prototype.getClass=function(){return Un},Un.copyCoordinates=function(e){for(var t=new Array(e.length).fill(null),n=0;ni.getMaxY()||this.findStabbedSegments(e,r.getDirectedEdges(),t)}return t}if(3===arguments.length)if(b(arguments[2],je)&&arguments[0]instanceof B&&arguments[1]instanceof $t)for(var o=arguments[0],a=arguments[1],s=arguments[2],A=a.getEdge().getCoordinates(),l=0;lthis._seg.p1.y&&this._seg.reverse();if(!(Math.max(this._seg.p0.x,this._seg.p1.x)this._seg.p1.y||S.computeOrientation(this._seg.p0,this._seg.p1,o)===S.RIGHT)){var c=a.getDepth(M.LEFT);this._seg.p0.equals(A[l])||(c=a.getDepth(M.RIGHT));var g=new Pn(this._seg,c);s.add(g)}}else if(b(arguments[2],je)&&arguments[0]instanceof B&&b(arguments[1],je))for(var u=arguments[0],d=arguments[1],h=arguments[2],p=d.iterator();p.hasNext();){var f=p.next();f.isForward()&&this.findStabbedSegments(u,f,h)}},On.prototype.getDepth=function(e){var t=this.findStabbedSegments(e);if(0===t.size())return 0;return cn.min(t)._leftDepth},On.prototype.interfaces_=function(){return[]},On.prototype.getClass=function(){return On},Ln.DepthSegment.get=function(){return Pn},Object.defineProperties(On,Ln),function(){this._upwardSeg=null,this._leftDepth=null;var e=arguments[0],t=arguments[1];this._upwardSeg=new W(e),this._leftDepth=t}),J=(Pn.prototype.compareTo=function(e){var t=e;if(this._upwardSeg.minX()>=t._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=t._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(t._upwardSeg);return 0!==n?n:0!=(n=-1*t._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(t._upwardSeg)},Pn.prototype.compareX=function(e,t){var n=e.p0.compareTo(t.p0);return 0!==n?n:e.p1.compareTo(t.p1)},Pn.prototype.toString=function(){return this._upwardSeg.toString()},Pn.prototype.interfaces_=function(){return[te]},Pn.prototype.getClass=function(){return Pn},function(e,t,n){this.p0=e||null,this.p1=t||null,this.p2=n||null}),Vn=(J.prototype.area=function(){return J.area(this.p0,this.p1,this.p2)},J.prototype.signedArea=function(){return J.signedArea(this.p0,this.p1,this.p2)},J.prototype.interpolateZ=function(e){if(null===e)throw new I("Supplied point is null.");return J.interpolateZ(e,this.p0,this.p1,this.p2)},J.prototype.longestSideLength=function(){return J.longestSideLength(this.p0,this.p1,this.p2)},J.prototype.isAcute=function(){return J.isAcute(this.p0,this.p1,this.p2)},J.prototype.circumcentre=function(){return J.circumcentre(this.p0,this.p1,this.p2)},J.prototype.area3D=function(){return J.area3D(this.p0,this.p1,this.p2)},J.prototype.centroid=function(){return J.centroid(this.p0,this.p1,this.p2)},J.prototype.inCentre=function(){return J.inCentre(this.p0,this.p1,this.p2)},J.prototype.interfaces_=function(){return[]},J.prototype.getClass=function(){return J},J.area=function(e,t,n){return Math.abs(((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2)},J.signedArea=function(e,t,n){return((n.x-e.x)*(t.y-e.y)-(t.x-e.x)*(n.y-e.y))/2},J.det=function(e,t,n,r){return e*r-t*n},J.interpolateZ=function(e,t,n,r){var i=t.x,o=t.y,a=n.x-i,s=r.x-i,A=n.y-o,l=r.y-o,c=a*l-s*A,g=e.x-i,u=e.y-o,d=(l*g-s*u)/c,h=(-A*g+a*u)/c;return t.z+d*(n.z-t.z)+h*(r.z-t.z)},J.longestSideLength=function(e,t,n){var r=e.distance(t),i=t.distance(n),o=n.distance(e),a=r;return i>a&&(a=i),o>a&&(a=o),a},J.isAcute=function(e,t,n){return!!Y.isAcute(e,t,n)&&(!!Y.isAcute(t,n,e)&&!!Y.isAcute(n,e,t))},J.circumcentre=function(e,t,n){var r=n.x,i=n.y,o=e.x-r,a=e.y-i,s=t.x-r,A=t.y-i,l=2*J.det(o,a,s,A),c=J.det(a,o*o+a*a,A,s*s+A*A),g=J.det(o,o*o+a*a,s,s*s+A*A);return new B(r-c/l,i+g/l)},J.perpendicularBisector=function(e,t){var n=t.x-e.x,r=t.y-e.y,i=new ye(e.x+n/2,e.y+r/2,1),o=new ye(e.x-r+n/2,e.y+n+r/2,1);return new ye(i,o)},J.angleBisector=function(e,t,n){var r=t.distance(e),i=r/(r+t.distance(n)),o=n.x-e.x,a=n.y-e.y;return new B(e.x+i*o,e.y+i*a)},J.area3D=function(e,t,n){var r=t.x-e.x,i=t.y-e.y,o=t.z-e.z,a=n.x-e.x,s=n.y-e.y,A=n.z-e.z,l=i*A-o*s,c=o*a-r*A,g=r*s-i*a,u=l*l+c*c+g*g,d=Math.sqrt(u)/2;return d},J.centroid=function(e,t,n){var r=(e.x+t.x+n.x)/3,i=(e.y+t.y+n.y)/3;return new B(r,i)},J.inCentre=function(e,t,n){var r=t.distance(n),i=e.distance(n),o=e.distance(t),a=r+i+o,s=(r*e.x+i*t.x+o*n.x)/a,A=(r*e.y+i*t.y+o*n.y)/a;return new B(s,A)},function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new x;var e=arguments[0],t=arguments[1],n=arguments[2];this._inputGeom=e,this._distance=t,this._curveBuilder=n}),Zn=(Vn.prototype.addPoint=function(e){if(this._distance<=0)return null;var t=e.getCoordinates(),n=this._curveBuilder.getLineCurve(t,this._distance);this.addCurve(n,m.EXTERIOR,m.INTERIOR)},Vn.prototype.addPolygon=function(e){var t=this._distance,n=M.LEFT;this._distance<0&&(t=-this._distance,n=M.RIGHT);var r=e.getExteriorRing(),i=R.removeRepeatedPoints(r.getCoordinates());if(this._distance<0&&this.isErodedCompletely(r,this._distance))return null;if(this._distance<=0&&i.length<3)return null;this.addPolygonRing(i,t,n,m.EXTERIOR,m.INTERIOR);for(var o=0;o0&&this.isErodedCompletely(a,-this._distance)||this.addPolygonRing(s,t,M.opposite(n),m.INTERIOR,m.EXTERIOR)}},Vn.prototype.isTriangleErodedCompletely=function(e,t){var n=new J(e[0],e[1],e[2]),r=n.inCentre();return S.distancePointLine(r,n.p0,n.p1)=yt.MINIMUM_VALID_SIZE&&S.isCCW(e)&&(o=i,a=r,n=M.opposite(n));var s=this._curveBuilder.getRingCurve(e,n,t);this.addCurve(s,o,a)},Vn.prototype.add=function(e){if(e.isEmpty())return null;e instanceof Ct?this.addPolygon(e):e instanceof G?this.addLineString(e):e instanceof ft?this.addPoint(e):e instanceof mt?this.addCollection(e):e instanceof ct?this.addCollection(e):e instanceof Bt?this.addCollection(e):e instanceof lt&&this.addCollection(e)},Vn.prototype.isErodedCompletely=function(e,t){var n=e.getCoordinates();if(n.length<4)return t<0;if(4===n.length)return this.isTriangleErodedCompletely(n,t);var r=e.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return t<0&&2*Math.abs(t)>i},Vn.prototype.addCollection=function(e){for(var t=0;t=this._max)throw new i;var e=this._parent.getGeometryN(this._index++);return e instanceof lt?(this._subcollectionIterator=new Wn(e),this._subcollectionIterator.next()):e},Wn.prototype.remove=function(){throw new Error(this.getClass().getName())},Wn.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Wn.prototype.interfaces_=function(){return[He]},Wn.prototype.getClass=function(){return Wn},Wn.isAtomic=function(e){return!(e instanceof lt)},function(){this._geom=null;var e=arguments[0];this._geom=e}),jn=(Hn.prototype.locate=function(e){return Hn.locate(e,this._geom)},Hn.prototype.interfaces_=function(){return[Zn]},Hn.prototype.getClass=function(){return Hn},Hn.isPointInRing=function(e,t){return!!t.getEnvelopeInternal().intersects(e)&&S.isPointInRing(e,t.getCoordinates())},Hn.containsPointInPolygon=function(e,t){if(t.isEmpty())return!1;var n=t.getExteriorRing();if(!Hn.isPointInRing(e,n))return!1;for(var r=0;r=0;n--){var r=this._edgeList.get(n),i=r.getSym();null===t&&(t=i),null!==e&&i.setNext(e),e=r}t.setNext(e)},e.prototype.computeDepths=function(){if(1===arguments.length){var e=arguments[0],t=this.findIndex(e),n=e.getDepth(M.LEFT),r=e.getDepth(M.RIGHT),i=this.computeDepths(t+1,this._edgeList.size(),n);if(this.computeDepths(0,t,i)!==r)throw new Zt("depth mismatch at "+e.getCoordinate())}else if(3===arguments.length){for(var o=arguments[0],a=arguments[1],s=arguments[2],A=o;A=0;i--){var o=this._resultAreaEdgeList.get(i),a=o.getSym();switch(null===t&&o.getEdgeRing()===e&&(t=o),r){case this._SCANNING_FOR_INCOMING:if(a.getEdgeRing()!==e)continue;n=a,r=this._LINKING_TO_OUTGOING;break;case this._LINKING_TO_OUTGOING:if(o.getEdgeRing()!==e)continue;n.setNextMin(o),r=this._SCANNING_FOR_INCOMING}}r===this._LINKING_TO_OUTGOING&&(w.isTrue(null!==t,"found null for first outgoing dirEdge"),w.isTrue(t.getEdgeRing()===e,"unable to link last incoming dirEdge"),n.setNextMin(t))},e.prototype.getOutgoingDegree=function(){if(0===arguments.length){for(var e=0,t=this.iterator();t.hasNext();)t.next().isInResult()&&e++;return e}if(1===arguments.length){for(var n=arguments[0],r=0,i=this.iterator();i.hasNext();)i.next().getEdgeRing()===n&&r++;return r}},e.prototype.getLabel=function(){return this._label},e.prototype.findCoveredLineEdges=function(){for(var e=m.NONE,t=this.iterator();t.hasNext();){var n=t.next(),r=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){e=m.INTERIOR;break}if(r.isInResult()){e=m.EXTERIOR;break}}}if(e===m.NONE)return null;for(var i=e,o=this.iterator();o.hasNext();){var a=o.next(),s=a.getSym();a.isLineEdge()?a.getEdge().setCovered(i===m.INTERIOR):(a.isInResult()&&(i=m.EXTERIOR),s.isInResult()&&(i=m.INTERIOR))}},e.prototype.computeLabelling=function(e){o.prototype.computeLabelling.call(this,e),this._label=new O(m.NONE);for(var t=this.iterator();t.hasNext();)for(var n=t.next().getEdge().getLabel(),r=0;r<2;r++){var i=n.getLocation(r);i!==m.INTERIOR&&i!==m.BOUNDARY||this._label.setLocation(r,m.INTERIOR)}},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(jn)),zn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createNode=function(e){return new Jt(e,new Yn)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(en),Jn=function t(){this._pts=null,this._orientation=null;var e=arguments[0];this._pts=e,this._orientation=t.orientation(e)},Kn=(Jn.prototype.compareTo=function(e){var t=e;return Jn.compareOriented(this._pts,this._orientation,t._pts,t._orientation)},Jn.prototype.interfaces_=function(){return[te]},Jn.prototype.getClass=function(){return Jn},Jn.orientation=function(e){return 1===R.increasingDirection(e)},Jn.compareOriented=function(e,t,n,r){for(var i=t?1:-1,o=r?1:-1,a=t?e.length:-1,s=r?n.length:-1,A=t?0:e.length-1,l=r?0:n.length-1;;){var c=e[A].compareTo(n[l]);if(0!==c)return c;var g=(A+=i)===a,u=(l+=o)===s;if(g&&!u)return-1;if(!g&&u)return 1;if(g&&u)return 0}},function(){this._edges=new x,this._ocaMap=new p}),Xn=(Kn.prototype.print=function(e){e.print("MULTILINESTRING ( ");for(var t=0;t0&&e.print(","),e.print("(");for(var r=n.getCoordinates(),i=0;i0&&e.print(","),e.print(r[i].x+" "+r[i].y);e.println(")")}e.print(") ")},Kn.prototype.addAll=function(e){for(var t=e.iterator();t.hasNext();)this.add(t.next())},Kn.prototype.findEdgeIndex=function(e){for(var t=0;t0||!t.coord.equals2D(r);i||n--;var o=new Array(n).fill(null),a=0;o[a++]=new B(e.coord);for(var s=e.segmentIndex+1;s<=t.segmentIndex;s++)o[a++]=this.edge.pts[s];return i&&(o[a]=t.coord),new or(o,new O(this.edge._label))},er.prototype.add=function(e,t,n){var r=new $n(e,t,n),i=this._nodeMap.get(r);return null!==i?i:(this._nodeMap.put(r,r),r)},er.prototype.isIntersection=function(e){for(var t=this.iterator();t.hasNext();)if(t.next().coord.equals(e))return!0;return!1},er.prototype.interfaces_=function(){return[]},er.prototype.getClass=function(){return er},function(){}),nr=(tr.prototype.getChainStartIndices=function(e){var t=0,n=new x;n.add(new ge(t));do{var r=this.findChainEnd(e,t);n.add(new ge(r)),t=r}while(tn?t:n},nr.prototype.getMinX=function(e){var t=this.pts[this.startIndex[e]].x,n=this.pts[this.startIndex[e+1]].x;return tt&&(r=1),this._depth[e][n]=r}}},rr.prototype.getDelta=function(e){return this._depth[e][M.RIGHT]-this._depth[e][M.LEFT]},rr.prototype.getLocation=function(e,t){return this._depth[e][t]<=0?m.EXTERIOR:m.INTERIOR},rr.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},rr.prototype.add=function(){if(1===arguments.length)for(var e=arguments[0],t=0;t<2;t++)for(var n=1;n<3;n++){var r=e.getLocation(t,n);r!==m.EXTERIOR&&r!==m.INTERIOR||(this.isNull(t,n)?this._depth[t][n]=rr.depthAtLocation(r):this._depth[t][n]+=rr.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===m.INTERIOR&&this._depth[i][o]++}},rr.prototype.interfaces_=function(){return[]},rr.prototype.getClass=function(){return rr},rr.depthAtLocation=function(e){return e===m.EXTERIOR?0:e===m.INTERIOR?1:rr.NULL_VALUE},ir.NULL_VALUE.get=function(){return-1},Object.defineProperties(rr,ir),function(i){function e(){if(i.call(this),this.pts=null,this._env=null,this.eiList=new er(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new rr,this._depthDelta=0,1===arguments.length){var t=arguments[0];e.call(this,t,null)}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.pts=n,this._label=r}}return i&&(e.__proto__=i),e.prototype=Object.create(i&&i.prototype),e.prototype.constructor=e,e.prototype.getDepth=function(){return this._depth},e.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);t[0]=this.pts[0],t[1]=this.pts[1];return new e(t,O.toLineLabel(this._label))},e.prototype.isIsolated=function(){return this._isIsolated},e.prototype.getCoordinates=function(){return this.pts},e.prototype.setIsolated=function(e){this._isIsolated=e},e.prototype.setName=function(e){this._name=e},e.prototype.equals=function(t){if(!(t instanceof e))return!1;var n=t;if(this.pts.length!==n.pts.length)return!1;for(var r=!0,i=!0,o=this.pts.length,a=0;a0?this.pts[0]:null;if(1===arguments.length){var e=arguments[0];return this.pts[e]}},e.prototype.print=function(e){e.print("edge "+this._name+": "),e.print("LINESTRING (");for(var t=0;t0&&e.print(","),e.print(this.pts[t].x+" "+this.pts[t].y);e.print(") "+this._label+" "+this._depthDelta)},e.prototype.computeIM=function(t){e.updateIM(this._label,t)},e.prototype.isCollapsed=function(){return!!this._label.isArea()&&(3===this.pts.length&&!!this.pts[0].equals(this.pts[2]))},e.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},e.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},e.prototype.getDepthDelta=function(){return this._depthDelta},e.prototype.getNumPoints=function(){return this.pts.length},e.prototype.printReverse=function(e){e.print("edge "+this._name+": ");for(var t=this.pts.length-1;t>=0;t--)e.print(this.pts[t]+" ");e.println("")},e.prototype.getMonotoneChainEdge=function(){return null===this._mce&&(this._mce=new nr(this)),this._mce},e.prototype.getEnvelope=function(){if(null===this._env){this._env=new Q;for(var e=0;e0&&e.append(","),e.append(this.pts[t].x+" "+this.pts[t].y);return e.append(") "+this._label+" "+this._depthDelta),e.toString()},e.prototype.isPointwiseEqual=function(e){if(this.pts.length!==e.pts.length)return!1;for(var t=0;tr||this._maxyo;if(a)return!1;var s=this.intersectsToleranceSquare(e,t);return w.isTrue(!(a&&s),"Found bad envelope test"),s},cr.prototype.initCorners=function(e){this._minx=e.x-.5,this._maxx=e.x+.5,this._miny=e.y-.5,this._maxy=e.y+.5,this._corner[0]=new B(this._maxx,this._maxy),this._corner[1]=new B(this._minx,this._maxy),this._corner[2]=new B(this._minx,this._miny),this._corner[3]=new B(this._maxx,this._miny)},cr.prototype.intersects=function(e,t){return 1===this._scaleFactor?this.intersectsScaled(e,t):(this.copyScaled(e,this._p0Scaled),this.copyScaled(t,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},cr.prototype.scale=function(e){return Math.round(e*this._scaleFactor)},cr.prototype.getCoordinate=function(){return this._originalPt},cr.prototype.copyScaled=function(e,t){t.x=this.scale(e.x),t.y=this.scale(e.y)},cr.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var e=cr.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Q(this._originalPt.x-e,this._originalPt.x+e,this._originalPt.y-e,this._originalPt.y+e)}return this._safeEnv},cr.prototype.intersectsPixelClosure=function(e,t){return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},cr.prototype.intersectsToleranceSquare=function(e,t){var n=!1,r=!1;return this._li.computeIntersection(e,t,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(e,t,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(e,t,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(e,t,this._corner[3],this._corner[0]),!!this._li.isProper()||(!(!n||!r)||(!!e.equals(this._pt)||!!t.equals(this._pt))))))},cr.prototype.addSnappedNode=function(e,t){var n=e.getCoordinate(t),r=e.getCoordinate(t+1);return!!this.intersects(n,r)&&(e.addIntersection(this.getCoordinate(),t),!0)},cr.prototype.interfaces_=function(){return[]},cr.prototype.getClass=function(){return cr},gr.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(cr,gr),function(){this.tempEnv1=new Q,this.selectedSegment=new W}),dr=(ur.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var e=arguments[0],t=arguments[1];e.getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ur.prototype.interfaces_=function(){return[]},ur.prototype.getClass=function(){return ur},function(){this._index=null;var e=arguments[0];this._index=e}),hr={HotPixelSnapAction:{configurable:!0}},pr=(dr.prototype.snap=function(){if(1===arguments.length){var e=arguments[0];return this.snap(e,null,-1)}if(3===arguments.length){var t=arguments[0],n=arguments[1],r=arguments[2],i=t.getSafeEnvelope(),o=new pr(t,n,r);return this._index.query(i,{interfaces_:function(){return[an]},visitItem:function(e){e.select(i,o)}}),o.isNodeAdded()}},dr.prototype.interfaces_=function(){return[]},dr.prototype.getClass=function(){return dr},hr.HotPixelSnapAction.get=function(){return pr},Object.defineProperties(dr,hr),function(r){function e(){r.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._hotPixel=e,this._parentEdge=t,this._hotPixelVertexIndex=n}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.isNodeAdded=function(){return this._isNodeAdded},e.prototype.select=function(){if(2!==arguments.length)return r.prototype.select.apply(this,arguments);var e=arguments[0],t=arguments[1],n=e.getContext();if(null!==this._parentEdge&&n===this._parentEdge&&t===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(n,t)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(ur)),fr=function(){this._li=null,this._interiorIntersections=null;var e=arguments[0];this._li=e,this._interiorIntersections=new x},Ir=(fr.prototype.processIntersections=function(e,t,n,r){if(e===n&&t===r)return null;var i=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var A=0;A=0;t--){try{e.bufferReducedPrecision(t)}catch(t){if(!(t instanceof Zt))throw t;e._saveException=t}if(null!==e._resultGeometry)return null}throw this._saveException}if(1===arguments.length){var n=arguments[0],r=Cr.precisionScaleFactor(this._argGeom,this._distance,n),i=new k(r);this.bufferFixedPrecision(i)}},Cr.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),null!==this._resultGeometry)return null;var e=this._argGeom.getFactory().getPrecisionModel();e.getType()===k.FIXED?this.bufferFixedPrecision(e):this.bufferReducedPrecision()},Cr.prototype.setQuadrantSegments=function(e){this._bufParams.setQuadrantSegments(e)},Cr.prototype.bufferOriginalPrecision=function(){try{var e=new ar(this._bufParams);this._resultGeometry=e.buffer(this._argGeom,this._distance)}catch(e){if(!(e instanceof Se))throw e;this._saveException=e}},Cr.prototype.getResultGeometry=function(e){return this._distance=e,this.computeGeometry(),this._resultGeometry},Cr.prototype.setEndCapStyle=function(e){this._bufParams.setEndCapStyle(e)},Cr.prototype.interfaces_=function(){return[]},Cr.prototype.getClass=function(){return Cr},Cr.bufferOp=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return new Cr(e).getResultGeometry(t)}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof _&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Cr(n);o.setQuadrantSegments(i);return o.getResultGeometry(r)}if(arguments[2]instanceof H&&arguments[0]instanceof _&&"number"==typeof arguments[1]){var a=arguments[0],s=arguments[1],A=arguments[2];return new Cr(a,A).getResultGeometry(s)}}else if(4===arguments.length){var l=arguments[0],c=arguments[1],g=arguments[2],u=arguments[3],d=new Cr(l);d.setQuadrantSegments(g),d.setEndCapStyle(u);return d.getResultGeometry(c)}},Cr.precisionScaleFactor=function(e,t,n){var r=e.getEnvelopeInternal(),i=Ae.max(Math.abs(r.getMaxX()),Math.abs(r.getMaxY()),Math.abs(r.getMinX()),Math.abs(r.getMinY()))+2*(t>0?t:0),o=n-Math.trunc(Math.log(i)/Math.log(10)+1);return Math.pow(10,o)},mr.CAP_ROUND.get=function(){return H.CAP_ROUND},mr.CAP_BUTT.get=function(){return H.CAP_FLAT},mr.CAP_FLAT.get=function(){return H.CAP_FLAT},mr.CAP_SQUARE.get=function(){return H.CAP_SQUARE},mr.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(Cr,mr),function(){this._pt=[new B,new B],this._distance=C.NaN,this._isNull=!0}),Br=(yr.prototype.getCoordinates=function(){return this._pt},yr.prototype.getCoordinate=function(e){return this._pt[e]},yr.prototype.setMinimum=function(){if(1===arguments.length){var e=arguments[0];this.setMinimum(e._pt[0],e._pt[1])}else if(2===arguments.length){var t=arguments[0],n=arguments[1];if(this._isNull)return this.initialize(t,n),null;var r=t.distance(n);rthis._distance&&this.initialize(t,n,r)}},yr.prototype.interfaces_=function(){return[]},yr.prototype.getClass=function(){return yr},function(){}),br=(Br.prototype.interfaces_=function(){return[]},Br.prototype.getClass=function(){return Br},Br.computeDistance=function(){if(arguments[2]instanceof yr&&arguments[0]instanceof G&&arguments[1]instanceof B)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=e.getCoordinates(),i=new W,o=0;o0||this._isIn?m.INTERIOR:m.EXTERIOR)},_r.prototype.interfaces_=function(){return[]},_r.prototype.getClass=function(){return _r},function t(){if(this._component=null,this._segIndex=null,this._pt=null,2===arguments.length){var e=arguments[0],n=arguments[1];t.call(this,e,t.INSIDE_AREA,n)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._component=r,this._segIndex=i,this._pt=o}}),Rr={INSIDE_AREA:{configurable:!0}},Fr=(xr.prototype.isInsideArea=function(){return this._segIndex===xr.INSIDE_AREA},xr.prototype.getCoordinate=function(){return this._pt},xr.prototype.getGeometryComponent=function(){return this._component},xr.prototype.getSegmentIndex=function(){return this._segIndex},xr.prototype.interfaces_=function(){return[]},xr.prototype.getClass=function(){return xr},Rr.INSIDE_AREA.get=function(){return-1},Object.defineProperties(xr,Rr),function(e){this._pts=e||null}),Dr=(Fr.prototype.filter=function(e){e instanceof ft&&this._pts.add(e)},Fr.prototype.interfaces_=function(){return[st]},Fr.prototype.getClass=function(){return Fr},Fr.getPoints=function(){if(1===arguments.length){var e=arguments[0];return e instanceof ft?cn.singletonList(e):Fr.getPoints(e,new x)}if(2===arguments.length){var t=arguments[0],n=arguments[1];return t instanceof ft?n.add(t):t instanceof lt&&t.apply(new Fr(n)),n}},function(){this._locations=null;var e=arguments[0];this._locations=e}),Gr=(Dr.prototype.filter=function(e){(e instanceof ft||e instanceof G||e instanceof Ct)&&this._locations.add(new xr(e,0,e.getCoordinate()))},Dr.prototype.interfaces_=function(){return[st]},Dr.prototype.getClass=function(){return Dr},Dr.getLocations=function(e){var t=new x;return e.apply(new Dr(t)),t},function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new _r,this._minDistanceLocation=null,this._minDistance=C.MAX_VALUE,2===arguments.length){var e=arguments[0],t=arguments[1];this._geom=[e,t],this._terminateDistance=0}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=n,this._geom[1]=r,this._terminateDistance=i}}),Nr=(Gr.prototype.computeContainmentDistance=function(){if(0===arguments.length){var e=new Array(2).fill(null);if(this.computeContainmentDistance(0,e),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,e)}else if(2===arguments.length){var t=arguments[0],n=arguments[1],r=1-t,i=wr.getPolygons(this._geom[t]);if(i.size()>0){var o=Dr.getLocations(this._geom[r]);if(this.computeContainmentDistance(o,i,n),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[r]=n[0],this._minDistanceLocation[t]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&b(arguments[0],je)&&b(arguments[1],je)){for(var a=arguments[0],s=arguments[1],A=arguments[2],l=0;lthis._minDistance)return null;for(var r=e.getCoordinates(),i=t.getCoordinate(),o=0;othis._minDistance)return null;for(var g=A.getCoordinates(),u=l.getCoordinates(),d=0;dthis._distance&&this.initialize(t,n,r)}},Nr.prototype.interfaces_=function(){return[]},Nr.prototype.getClass=function(){return Nr},function(){}),Tr=(kr.prototype.interfaces_=function(){return[]},kr.prototype.getClass=function(){return kr},kr.computeDistance=function(){if(arguments[2]instanceof Nr&&arguments[0]instanceof G&&arguments[1]instanceof B)for(var e=arguments[0],t=arguments[1],n=arguments[2],r=new W,i=e.getCoordinates(),o=0;o1||e<=0)throw new I("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=e},Tr.prototype.compute=function(e,t){this.computeOrientedDistance(e,t,this._ptDist),this.computeOrientedDistance(t,e,this._ptDist)},Tr.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},Tr.prototype.computeOrientedDistance=function(e,t,n){var r=new Ur(t);if(e.apply(r),n.setMaximum(r.getMaxPointDistance()),this._densifyFrac>0){var i=new Or(t,this._densifyFrac);e.apply(i),n.setMaximum(i.getMaxPointDistance())}},Tr.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},Tr.prototype.interfaces_=function(){return[]},Tr.prototype.getClass=function(){return Tr},Tr.distance=function(){if(2===arguments.length){var e=arguments[0],t=arguments[1];return new Tr(e,t).distance()}if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2],o=new Tr(n,r);return o.setDensifyFraction(i),o.distance()}},Mr.MaxPointDistanceFilter.get=function(){return Ur},Mr.MaxDensifiedByFractionDistanceFilter.get=function(){return Or},Object.defineProperties(Tr,Mr),function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._euclideanDist=new kr,this._geom=null;var e=arguments[0];this._geom=e}),Or=(Ur.prototype.filter=function(e){this._minPtDist.initialize(),kr.computeDistance(this._geom,e,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},Ur.prototype.getMaxPointDistance=function(){return this._maxPtDist},Ur.prototype.interfaces_=function(){return[Me]},Ur.prototype.getClass=function(){return Ur},function(){this._maxPtDist=new Nr,this._minPtDist=new Nr,this._geom=null,this._numSubSegs=0;var e=arguments[0],t=arguments[1];this._geom=e,this._numSubSegs=Math.trunc(Math.round(1/t))}),Lr=(Or.prototype.filter=function(e,t){if(0===t)return null;for(var n=e.getCoordinate(t-1),r=e.getCoordinate(t),i=(r.x-n.x)/this._numSubSegs,o=(r.y-n.y)/this._numSubSegs,a=0;an){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=e.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+we.toLineString(i[0],i[1])+")"}},Lr.prototype.isValid=function(){var e=Math.abs(this._bufDistance),t=Lr.MAX_DISTANCE_DIFF_FRAC*e;return this._minValidDistance=e-t,this._maxValidDistance=e+t,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),Lr.VERBOSE&&me.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},Lr.prototype.checkNegativeValid=function(){if(!(this._input instanceof Ct||this._input instanceof Bt||this._input instanceof lt))return null;var e=this.getPolygonLines(this._input);if(this.checkMinimumDistance(e,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(e,this._result,this._maxValidDistance)},Lr.prototype.getErrorIndicator=function(){return this._errorIndicator},Lr.prototype.checkMinimumDistance=function(e,t,n){var r=new Gr(e,t,n);if(this._minDistanceFound=r.distance(),this._minDistanceFound0&&e>t&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&e=2?null:this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Vr.prototype.report=function(e){if(!Vr.VERBOSE)return null;me.out.println("Check "+e+": "+(this._isValid?"passed":"FAILED"))},Vr.prototype.getErrorMessage=function(){return this._errorMsg},Vr.prototype.interfaces_=function(){return[]},Vr.prototype.getClass=function(){return Vr},Vr.isValidMsg=function(e,t,n){var r=new Vr(e,t,n);return r.isValid()?null:r.getErrorMessage()},Vr.isValid=function(e,t,n){return!!new Vr(e,t,n).isValid()},Zr.VERBOSE.get=function(){return!1},Zr.MAX_ENV_DIFF_FRAC.get=function(){return.012},Object.defineProperties(Vr,Zr),function(){this._pts=null,this._data=null;var e=arguments[0],t=arguments[1];this._pts=e,this._data=t}),Hr=(Wr.prototype.getCoordinates=function(){return this._pts},Wr.prototype.size=function(){return this._pts.length},Wr.prototype.getCoordinate=function(e){return this._pts[e]},Wr.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Wr.prototype.getSegmentOctant=function(e){return e===this._pts.length-1?-1:Bn.octant(this.getCoordinate(e),this.getCoordinate(e+1))},Wr.prototype.setData=function(e){this._data=e},Wr.prototype.getData=function(){return this._data},Wr.prototype.toString=function(){return we.toLineString(new N(this._pts))},Wr.prototype.interfaces_=function(){return[bn]},Wr.prototype.getClass=function(){return Wr},function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new x,this._intersectionCount=0,this._keepIntersections=!0;var e=arguments[0];this._li=e,this._interiorIntersection=null}),jr=(Hr.prototype.getInteriorIntersection=function(){return this._interiorIntersection},Hr.prototype.setCheckEndSegmentsOnly=function(e){this._isCheckEndSegmentsOnly=e},Hr.prototype.getIntersectionSegments=function(){return this._intSegments},Hr.prototype.count=function(){return this._intersectionCount},Hr.prototype.getIntersections=function(){return this._intersections},Hr.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},Hr.prototype.setKeepIntersections=function(e){this._keepIntersections=e},Hr.prototype.processIntersections=function(e,t,n,r){if(!this._findAllIntersections&&this.hasIntersection())return null;if(e===n&&t===r)return null;if(this._isCheckEndSegmentsOnly)if(!(this.isEndSegment(e,t)||this.isEndSegment(n,r)))return null;var i=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=i,this._intSegments[1]=o,this._intSegments[2]=a,this._intSegments[3]=s,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},Hr.prototype.isEndSegment=function(e,t){return 0===t||t>=e.size()-2},Hr.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Hr.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Hr.prototype.interfaces_=function(){return[Xn]},Hr.prototype.getClass=function(){return Hr},Hr.createAllIntersectionsFinder=function(e){var t=new Hr(e);return t.setFindAllIntersections(!0),t},Hr.createAnyIntersectionFinder=function(e){return new Hr(e)},Hr.createIntersectionCounter=function(e){var t=new Hr(e);return t.setFindAllIntersections(!0),t.setKeepIntersections(!1),t},function(){this._li=new Re,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=arguments[0];this._segStrings=e}),Yr=(jr.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},jr.prototype.getIntersections=function(){return this._segInt.getIntersections()},jr.prototype.isValid=function(){return this.execute(),this._isValid},jr.prototype.setFindAllIntersections=function(e){this._findAllIntersections=e},jr.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Hr(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var e=new Rn;if(e.setSegmentIntersector(this._segInt),e.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},jr.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Zt(this.getErrorMessage(),this._segInt.getInteriorIntersection())},jr.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var e=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+we.toLineString(e[0],e[1])+" and "+we.toLineString(e[2],e[3])},jr.prototype.interfaces_=function(){return[]},jr.prototype.getClass=function(){return jr},jr.computeIntersections=function(e){var t=new jr(e);return t.setFindAllIntersections(!0),t.isValid(),t.getIntersections()},function t(){this._nv=null;var e=arguments[0];this._nv=new jr(t.toSegmentStrings(e))}),zr=(Yr.prototype.checkValid=function(){this._nv.checkValid()},Yr.prototype.interfaces_=function(){return[]},Yr.prototype.getClass=function(){return Yr},Yr.toSegmentStrings=function(e){for(var t=new x,n=e.iterator();n.hasNext();){var r=n.next();t.add(new Wr(r.getCoordinates(),r))}return t},Yr.checkValid=function(e){new Yr(e).checkValid()},function(e){this._mapOp=e}),Jr=(zr.prototype.map=function(e){for(var t=new x,n=0;n0&&r<4&&!this._preserveType?this._factory.createLineString(n):this._factory.createLinearRing(n)},Xr.prototype.interfaces_=function(){return[]},Xr.prototype.getClass=function(){return Xr},function t(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new W,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof G&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];t.call(this,e.getCoordinates(),n)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var r=arguments[0],i=arguments[1];this._srcPts=r,this._isClosed=t.isClosed(r),this._snapTolerance=i}}),K=(qr.prototype.snapVertices=function(e,t){for(var n=this._isClosed?e.size()-1:e.size(),r=0;r=0&&e.add(o+1,new B(i),!1)}},qr.prototype.findSegmentIndexToSnap=function(e,t){for(var n=C.MAX_VALUE,r=-1,i=0;it&&(t=r)}return t}if(2===arguments.length){var i=arguments[0],o=arguments[1];return Math.min(K.computeOverlaySnapTolerance(i),K.computeOverlaySnapTolerance(o))}},K.computeSizeBasedSnapTolerance=function(e){var t=e.getEnvelopeInternal();return Math.min(t.getHeight(),t.getWidth())*K.SNAP_PRECISION_FACTOR},K.snapToSelf=function(e,t,n){return new K(e).snapToSelf(t,n)},$r.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(K,$r),function(r){function e(e,t,n){r.call(this),this._snapTolerance=e||null,this._snapPts=t||null,this._isSelfSnap=void 0!==n&&n}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.snapLine=function(e,t){var n=new qr(e,this._snapTolerance);return n.setAllowSnappingToSourceVertices(this._isSelfSnap),n.snapTo(t)},e.prototype.transformCoordinates=function(e,t){var n=e.toCoordinateArray(),r=this.snapLine(n,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(r)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(Xr)),ti=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null},ni=(ti.prototype.getCommon=function(){return C.longBitsToDouble(this._commonBits)},ti.prototype.add=function(e){var t=C.doubleToLongBits(e);if(this._isFirst)return this._commonBits=t,this._commonSignExp=ti.signExpBits(this._commonBits),this._isFirst=!1,null;if(ti.signExpBits(t)!==this._commonSignExp)return this._commonBits=0,null;this._commonMantissaBitsCount=ti.numCommonMostSigMantissaBits(this._commonBits,t),this._commonBits=ti.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))},ti.prototype.toString=function(){if(1===arguments.length){var e=arguments[0],t=C.longBitsToDouble(e),n="0000000000000000000000000000000000000000000000000000000000000000"+C.toBinaryString(e),r=n.substring(n.length-64);return r.substring(0,1)+" "+r.substring(1,12)+"(exp) "+r.substring(12)+" [ "+t+" ]"}},ti.prototype.interfaces_=function(){return[]},ti.prototype.getClass=function(){return ti},ti.getBit=function(e,t){return 0!=(e&1<>52},ti.zeroLowerBits=function(e,t){return e&~((1<=0;r--){if(ti.getBit(e,r)!==ti.getBit(t,r))return n;n++}return 52},function(){this._commonCoord=null,this._ccFilter=new ii}),ri={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}},ii=(ni.prototype.addCommonBits=function(e){var t=new oi(this._commonCoord);e.apply(t),e.geometryChanged()},ni.prototype.removeCommonBits=function(e){if(0===this._commonCoord.x&&0===this._commonCoord.y)return e;var t=new B(this._commonCoord);t.x=-t.x,t.y=-t.y;var n=new oi(t);return e.apply(n),e.geometryChanged(),e},ni.prototype.getCommonCoordinate=function(){return this._commonCoord},ni.prototype.add=function(e){e.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},ni.prototype.interfaces_=function(){return[]},ni.prototype.getClass=function(){return ni},ri.CommonCoordinateFilter.get=function(){return ii},ri.Translater.get=function(){return oi},Object.defineProperties(ni,ri),function(){this._commonBitsX=new ti,this._commonBitsY=new ti}),oi=(ii.prototype.filter=function(e){this._commonBitsX.add(e.x),this._commonBitsY.add(e.y)},ii.prototype.getCommonCoordinate=function(){return new B(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},ii.prototype.interfaces_=function(){return[Me]},ii.prototype.getClass=function(){return ii},function(){this.trans=null;var e=arguments[0];this.trans=e}),ai=(oi.prototype.filter=function(e,t){var n=e.getOrdinate(t,0)+this.trans.x,r=e.getOrdinate(t,1)+this.trans.y;e.setOrdinate(t,0,n),e.setOrdinate(t,1,r)},oi.prototype.isDone=function(){return!1},oi.prototype.isGeometryChanged=function(){return!0},oi.prototype.interfaces_=function(){return[At]},oi.prototype.getClass=function(){return oi},function(e,t){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=e,this._geom[1]=t,this.computeSnapTolerance()}),si=(ai.prototype.selfSnap=function(e){return new K(e).snapTo(e,this._snapTolerance)},ai.prototype.removeCommonBits=function(e){this._cbr=new ni,this._cbr.add(e[0]),this._cbr.add(e[1]);var t=new Array(2).fill(null);return t[0]=this._cbr.removeCommonBits(e[0].copy()),t[1]=this._cbr.removeCommonBits(e[1].copy()),t},ai.prototype.prepareResult=function(e){return this._cbr.addCommonBits(e),e},ai.prototype.getResultGeometry=function(e){var t=this.snap(this._geom),n=X.overlayOp(t[0],t[1],e);return this.prepareResult(n)},ai.prototype.checkValid=function(e){e.isValid()||me.out.println("Snapped geometry is invalid")},ai.prototype.computeSnapTolerance=function(){this._snapTolerance=K.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},ai.prototype.snap=function(e){var t=this.removeCommonBits(e);return K.snap(t[0],t[1],this._snapTolerance)},ai.prototype.interfaces_=function(){return[]},ai.prototype.getClass=function(){return ai},ai.overlayOp=function(e,t,n){return new ai(e,t).getResultGeometry(n)},ai.union=function(e,t){return ai.overlayOp(e,t,X.UNION)},ai.intersection=function(e,t){return ai.overlayOp(e,t,X.INTERSECTION)},ai.symDifference=function(e,t){return ai.overlayOp(e,t,X.SYMDIFFERENCE)},ai.difference=function(e,t){return ai.overlayOp(e,t,X.DIFFERENCE)},function(e,t){this._geom=new Array(2).fill(null),this._geom[0]=e,this._geom[1]=t}),Ai=(si.prototype.getResultGeometry=function(e){var t=null,n=!1,r=null;try{t=X.overlayOp(this._geom[0],this._geom[1],e);n=!0}catch(e){if(!(e instanceof Se))throw e;r=e}if(!n)try{t=ai.overlayOp(this._geom[0],this._geom[1],e)}catch(e){throw e instanceof Se?r:e}return t},si.prototype.interfaces_=function(){return[]},si.prototype.getClass=function(){return si},si.overlayOp=function(e,t,n){return new si(e,t).getResultGeometry(n)},si.union=function(e,t){return si.overlayOp(e,t,X.UNION)},si.intersection=function(e,t){return si.overlayOp(e,t,X.INTERSECTION)},si.symDifference=function(e,t){return si.overlayOp(e,t,X.SYMDIFFERENCE)},si.difference=function(e,t){return si.overlayOp(e,t,X.DIFFERENCE)},function(){this.mce=null,this.chainIndex=null;var e=arguments[0],t=arguments[1];this.mce=e,this.chainIndex=t}),li=(Ai.prototype.computeIntersections=function(e,t){this.mce.computeIntersectsForChain(this.chainIndex,e.mce,e.chainIndex,t)},Ai.prototype.interfaces_=function(){return[]},Ai.prototype.getClass=function(){return Ai},function t(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,2===arguments.length){var e=arguments[0],n=arguments[1];this._eventType=t.DELETE,this._xValue=e,this._insertEvent=n}else if(3===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2];this._eventType=t.INSERT,this._label=r,this._xValue=i,this._obj=o}}),ci={INSERT:{configurable:!0},DELETE:{configurable:!0}},gi=(li.prototype.isDelete=function(){return this._eventType===li.DELETE},li.prototype.setDeleteEventIndex=function(e){this._deleteEventIndex=e},li.prototype.getObject=function(){return this._obj},li.prototype.compareTo=function(e){var t=e;return this._xValuet._xValue?1:this._eventTypet._eventType?1:0},li.prototype.getInsertEvent=function(){return this._insertEvent},li.prototype.isInsert=function(){return this._eventType===li.INSERT},li.prototype.isSameLabel=function(e){return null!==this._label&&this._label===e._label},li.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},li.prototype.interfaces_=function(){return[te]},li.prototype.getClass=function(){return li},ci.INSERT.get=function(){return 1},ci.DELETE.get=function(){return 2},Object.defineProperties(li,ci),function(){}),ui=(gi.prototype.interfaces_=function(){return[]},gi.prototype.getClass=function(){return gi},function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var e=arguments[0],t=arguments[1],n=arguments[2];this._li=e,this._includeProper=t,this._recordIsolated=n}),di=(ui.prototype.isTrivialIntersection=function(e,t,n,r){if(e===n&&1===this._li.getIntersectionNum()){if(ui.isAdjacentSegments(t,r))return!0;if(e.isClosed()){var i=e.getNumPoints()-1;if(0===t&&r===i||0===r&&t===i)return!0}}return!1},ui.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},ui.prototype.setIsDoneIfProperInt=function(e){this._isDoneWhenProperInt=e},ui.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},ui.prototype.isBoundaryPointInternal=function(e,t){for(var n=t.iterator();n.hasNext();){var r=n.next().getCoordinate();if(e.isIntersection(r))return!0}return!1},ui.prototype.hasProperIntersection=function(){return this._hasProper},ui.prototype.hasIntersection=function(){return this._hasIntersection},ui.prototype.isDone=function(){return this._isDone},ui.prototype.isBoundaryPoint=function(e,t){return null!==t&&(!!this.isBoundaryPointInternal(e,t[0])||!!this.isBoundaryPointInternal(e,t[1]))},ui.prototype.setBoundaryNodes=function(e,t){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=e,this._bdyNodes[1]=t},ui.prototype.addIntersections=function(e,t,n,r){if(e===n&&t===r)return null;this.numTests++;var i=e.getCoordinates()[t],o=e.getCoordinates()[t+1],a=n.getCoordinates()[r],s=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,a,s),this._li.hasIntersection()&&(this._recordIsolated&&(e.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(e,t,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(e.addIntersections(this._li,t,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},ui.prototype.interfaces_=function(){return[]},ui.prototype.getClass=function(){return ui},ui.isAdjacentSegments=function(e,t){return 1===Math.abs(e-t)},function(t){function e(){t.call(this),this.events=new x,this.nOverlaps=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvents=function(){cn.sort(this.events);for(var e=0;et||this._maxo?1:0},fi.prototype.interfaces_=function(){return[re]},fi.prototype.getClass=function(){return fi},function(r){function e(){r.call(this),this._item=null;var e=arguments[0],t=arguments[1],n=arguments[2];this._min=e,this._max=t,this._item=n}return r&&(e.__proto__=r),e.prototype=Object.create(r&&r.prototype),e.prototype.constructor=e,e.prototype.query=function(e,t,n){if(!this.intersects(e,t))return null;n.visitItem(this._item)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi)),Ci=function(n){function e(){n.call(this),this._node1=null,this._node2=null;var e=arguments[0],t=arguments[1];this._node1=e,this._node2=t,this.buildExtent(this._node1,this._node2)}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.buildExtent=function(e,t){this._min=Math.min(e._min,t._min),this._max=Math.max(e._max,t._max)},e.prototype.query=function(e,t,n){if(!this.intersects(e,t))return null;null!==this._node1&&this._node1.query(e,t,n),null!==this._node2&&this._node2.query(e,t,n)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e}(hi),mi=function(){this._leaves=new x,this._root=null,this._level=0},yi=(mi.prototype.buildTree=function(){cn.sort(this._leaves,new hi.NodeComparator);for(var e=this._leaves,t=null,n=new x;;){if(this.buildLevel(e,n),1===n.size())return n.get(0);t=e,e=n,n=t}},mi.prototype.insert=function(e,t,n){if(null!==this._root)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new Ii(e,t,n))},mi.prototype.query=function(e,t,n){this.init(),this._root.query(e,t,n)},mi.prototype.buildRoot=function(){if(null!==this._root)return null;this._root=this.buildTree()},mi.prototype.printNode=function(e){me.out.println(we.toLineString(new B(e._min,this._level),new B(e._max,this._level)))},mi.prototype.init=function(){if(null!==this._root)return null;this.buildRoot()},mi.prototype.buildLevel=function(e,t){this._level++,t.clear();for(var n=0;n=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,t[0]),this.insertBoundaryPoint(this._argIndex,t[t.length-1])},e.prototype.getInvalidPoint=function(){return this._invalidPoint},e.prototype.getBoundaryPoints=function(){for(var e=this.getBoundaryNodes(),t=new Array(e.size()).fill(null),n=0,r=e.iterator();r.hasNext();){var i=r.next();t[n++]=i.getCoordinate().copy()}return t},e.prototype.getBoundaryNodes=function(){return null===this._boundaryNodes&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},e.prototype.addSelfIntersectionNode=function(e,t,n){if(this.isBoundaryNode(e,t))return null;n===m.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(e,t):this.insertPoint(e,t,n)},e.prototype.addPolygonRing=function(e,t,n){if(e.isEmpty())return null;var r=R.removeRepeatedPoints(e.getCoordinates());if(r.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=r[0],null;var i=t,o=n;S.isCCW(r)&&(i=n,o=t);var a=new or(r,new O(this._argIndex,m.BOUNDARY,i,o));this._lineEdgeMap.put(e,a),this.insertEdge(a),this.insertPoint(this._argIndex,r[0],m.BOUNDARY)},e.prototype.insertPoint=function(e,t,n){var r=this._nodes.addNode(t),i=r.getLabel();null===i?r._label=new O(e,n):i.setLocation(e,n)},e.prototype.createEdgeSetIntersector=function(){return new di},e.prototype.addSelfIntersectionNodes=function(e){for(var t=this._edges.iterator();t.hasNext();)for(var n=t.next(),r=n.getLabel().getLocation(e),i=n.eiList.iterator();i.hasNext();){var o=i.next();this.addSelfIntersectionNode(e,o.coord,r)}},e.prototype.add=function(){if(1!==arguments.length)return a.prototype.add.apply(this,arguments);var e=arguments[0];if(e.isEmpty())return null;if(e instanceof Bt&&(this._useBoundaryDeterminationRule=!1),e instanceof Ct)this.addPolygon(e);else if(e instanceof G)this.addLineString(e);else if(e instanceof ft)this.addPoint(e);else if(e instanceof mt)this.addCollection(e);else if(e instanceof ct)this.addCollection(e);else if(e instanceof Bt)this.addCollection(e);else{if(!(e instanceof lt))throw new Error(e.getClass().getName());this.addCollection(e)}},e.prototype.addCollection=function(e){for(var t=0;t50?(null===this._areaPtLocator&&(this._areaPtLocator=new Bi(this._parentGeom)),this._areaPtLocator.locate(e)):this._ptLocator.locate(e,this._parentGeom)},e.prototype.findEdge=function(){if(1===arguments.length){var e=arguments[0];return this._lineEdgeMap.get(e)}return a.prototype.findEdge.apply(this,arguments)},e.prototype.interfaces_=function(){return[]},e.prototype.getClass=function(){return e},e.determineBoundary=function(e,t){return e.isInBoundary(t)?m.BOUNDARY:m.INTERIOR},e}(V)),wi=function(){if(this._li=new Re,this._resultPrecisionModel=null,this._arg=null,1===arguments.length){var e=arguments[0];this.setComputationPrecision(e.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new Qi(0,e)}else if(2===arguments.length){var t=arguments[0],n=arguments[1],r=Ue.OGC_SFS_BOUNDARY_RULE;t.getPrecisionModel().compareTo(n.getPrecisionModel())>=0?this.setComputationPrecision(t.getPrecisionModel()):this.setComputationPrecision(n.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Qi(0,t,r),this._arg[1]=new Qi(1,n,r)}else if(3===arguments.length){var i=arguments[0],o=arguments[1],a=arguments[2];i.getPrecisionModel().compareTo(o.getPrecisionModel())>=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(o.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new Qi(0,i,a),this._arg[1]=new Qi(1,o,a)}},Si=(wi.prototype.getArgGeometry=function(e){return this._arg[e].getGeometry()},wi.prototype.setComputationPrecision=function(e){this._resultPrecisionModel=e,this._li.setPrecisionModel(this._resultPrecisionModel)},wi.prototype.interfaces_=function(){return[]},wi.prototype.getClass=function(){return wi},function(){}),X=(Si.prototype.interfaces_=function(){return[]},Si.prototype.getClass=function(){return Si},Si.map=function(){if(arguments[0]instanceof _&&b(arguments[1],Si.MapOp)){for(var e=arguments[0],t=arguments[1],n=new x,r=0;r=e.size()?null:e.get(t)},Ni.union=function(e){return new Ni(e).union()},ki.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Ni,ki),function(){});Ti.prototype.interfaces_=function(){return[]},Ti.prototype.getClass=function(){return Ti},Ti.union=function(e,t){if(e.isEmpty()||t.isEmpty()){if(e.isEmpty()&&t.isEmpty())return X.createEmptyResult(X.UNION,e,t,e.getFactory());if(e.isEmpty())return t.copy();if(t.isEmpty())return e.copy()}return e.checkNotGeometryCollection(e),e.checkNotGeometryCollection(t),si.overlayOp(e,t,X.UNION)},q.GeoJSONReader=Ot,q.GeoJSONWriter=Lt,q.OverlayOp=X,q.UnionOp=Ti,q.BufferOp=Cr,Object.defineProperty(q,"__esModule",{value:!0})}(t)},function(e,t,n){"use strict";var I=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function stringify(e,t){var h,p,f;return t=t||{},h=JSON.stringify([1],void 0,void 0===t.indent?2:t.indent).slice(2,-3),p=""===h?1/0:void 0===t.maxLength?80:t.maxLength,f=t.replacer,function _stringify(e,t,n){var r,i,o,a,s,A,l,c,g,u,d;if(e&&"function"==typeof e.toJSON&&(e=e.toJSON()),void 0===(u=JSON.stringify(e,f)))return u;if(A=p-t.length-n,u.length<=A&&(c=u.replace(I,function(e,t){return t||e+" "})).length<=A)return c;if(null!=f&&(e=JSON.parse(u),f=void 0),"object"==typeof e&&null!==e){if(l=t+h,o=[],i=0,Array.isArray(e))for(g="[",r="]",A=e.length;i>>1;o(e[i],t)<0?n=1+i:r=i}return n}return 1===n.length&&(i=(e,t)=>n(e)-t,o=function ascendingComparator(n){return(e,t)=>Object(r.a)(n(e),t)}(n)),{left:left,center:function center(e,t,n,r){return r=left(e,t,n=null==n?0:n,(r=null==r?e.length:r)-1),n-i(e[r],t)?r-1:r},right:function right(e,t,n,r){for(null==n&&(n=0),null==r&&(r=e.length);n>>1;0e.order-t.order),d.length=a.length;for(let e=0,t=a.length;ee+s));break;case"vs:#main-end":i&&(e=e.replace(u,e=>s+e));break;case"fs:#decl":i||(e=e.replace(c,s));break;case"fs:#main-start":i||(e=e.replace(g,e=>e+s));break;case"fs:#main-end":i||(e=e.replace(u,e=>s+e));break;default:e=e.replace(o,e=>e+s)}}return e=e.replace(c,""),e=r?e.replace(/\}\s*$/,e=>e+l[t]):e}function combineInjects(e){const n={};return Object(r.a)(Array.isArray(e)&&1{for(const t in e)n[t]=n[t]?n[t]+` -`+e[t]:e[t]}),n}},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return a}),n.d(t,"d",function(){return s});var r,i,o,a,s,A=n(468);!function defaultLocale(e){r=Object(A.a)(e),i=r.format,o=r.parse,a=r.utcFormat,s=r.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})},,,,,,,,function(e,t,n){var r=n(143),i=n(297),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,A=/^0o[0-7]+$/i,l=parseInt;e.exports=function toNumber(e){if("number"==typeof e)return e;if(i(e))return NaN;if(r(e)&&(t="function"==typeof e.valueOf?e.valueOf():e,e=r(t)?t+"":t),"string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var t=s.test(e);return t||A.test(e)?l(e.slice(2),t?2:8):a.test(e)?NaN:+e}},function(e,t,n){"use strict";function requirePropFactory(e){return function(){return null}}n.d(t,"a",function(){return requirePropFactory})},function(e,t,n){"use strict";function unsupportedProp(e,t,n,r,i){return null}n.d(t,"a",function(){return unsupportedProp})},function(e,t,i){"use strict";!function(n){var e=i(75),r=(Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isElectron(e){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==n&&"object"===(0,r.default)(n.versions)&&Boolean(n.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,e=e||t;if(e&&0<=e.indexOf("Electron"))return!0;return!1},e(i(220)))}.call(this,i(97))},function(e,t,n){"use strict";n.d(t,"a",function(){return concatenateArrayBuffersAsync});var r=n(165);async function concatenateArrayBuffersAsync(e){const t=[];for await(const n of e)t.push(n);return Object(r.b)(...t)}},function(e,t,n){var o=n(714),a=n(126);e.exports=function baseIsEqual(e,t,n,r,i){return e===t||(null==e||null==t||!a(e)&&!a(t)?e!=e&&t!=t:o(e,t,n,r,baseIsEqual,i))}},function(e,t,n){var r=n(302),i=n(720),o=n(721),a=n(722),s=n(723),n=n(724);function Stack(e){e=this.__data__=new r(e);this.size=e.size}Stack.prototype.clear=i,Stack.prototype.delete=o,Stack.prototype.get=a,Stack.prototype.has=s,Stack.prototype.set=n,e.exports=Stack},function(e,t,n){n=n(189)(n(118),"Map");e.exports=n},function(e,t,n){var r=n(729),i=n(736),o=n(738),a=n(739),n=n(740);function MapCache(e){var t=-1,n=null==e?0:e.length;for(this.clear();++te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}(n.selectedIndexes);try{for(g.s();!(e=g.n()).done;){var u,d=e.value;de.length)&&(t=e.length);for(var n=0,r=new Array(t);ndocument.F=Object<\/script>"),e.close(),A=e.F;t--;)delete A[s][o[t]];return A()};e.exports=Object.create||function create(e,t){var n;return null!==e?(Buf[s]=r(e),n=new Buf,Buf[s]=null,n[a]=e):n=A(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(190).f,i=n(191),o=n(231)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){t.f=n(231)},function(e,t,n){var r=n(162),i=n(163),o=n(319),a=n(440),s=n(190).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=!o&&r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(581),i=n(970);e.exports=function forOwn(e,t){return e&&r(e,i(t))}},function(e,t,n){var r=n(106),i=n(297),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function isKey(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t){e.exports=function(e){var t;return e.webpackPolyfill||((t=Object.create(e)).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),t}},function(e,t,n){n=n(232)(n(145),"Map");e.exports=n},function(e,t,n){n=n(145).Symbol;e.exports=n},function(e,t){var n=Array.isArray;e.exports=n},function(s,u,e){"use strict";e.r(u);function Vvf(){return new Adder}var d=e(238),A=e(376),l=e(32);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(t,e,this.t),add(this,t.s,this.s),this.s?this.t+=t.t:this.s=t.t},valueOf:function(){return this.s}};var t=new Adder;function add(e,t,n){var r=e.s=t+n,i=r-t;e.t=t-(r-i)+(n-i)}var x=1e-6,w=Math.PI,c=w/2,k=w/4,S=2*w,Q=180/w,_=w/180,R=Math.abs,p=Math.atan,F=Math.atan2,D=Math.cos,G=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),N=(Math.sign,Math.sqrt);Math.tan;function acos(e){return 1x?p((G(t)*(i=D(r))*G(n)-G(r)*(n=D(t))*G(e))/(n*i*o)):(t+r)/2}(a,s,e,t),i.point(A,s),i.lineEnd(),i.lineStart(),i.point(n,s),o=0),i.point(a=e,s=t),A=n},lineEnd:function(){i.lineEnd(),a=s=NaN},clean:function(){return 2-o}}},function clipAntimeridianInterpolate(e,t,n,r){var i;null==e?(i=n*c,r.point(-w,i),r.point(0,i),r.point(w,i),r.point(w,0),r.point(w,-i),r.point(0,-i),r.point(-w,-i),r.point(-w,0),r.point(-w,i)):R(e[0]-t[0])>x?(e=e[0]x;function visible(e,t){return D(e)*D(t)>d}function intersect(e,t,n){var r=[1,0,0],i=cartesianCross(cartesian_cartesian(e),cartesian_cartesian(t)),o=cartesianDot(i,i),a=i[0],s=o-a*a;if(!s)return!n&&e;var A=cartesianCross(r,i),r=cartesianScale(r,d*o/s),o=(cartesianAddInPlace(r,cartesianScale(i,-d*a/s)),A),i=cartesianDot(r,o),a=cartesianDot(o,o),s=i*i-a*(cartesianDot(r,r)-1);if(!(s<0)){A=N(s),s=cartesianScale(o,(-i-A)/a);if(cartesianAddInPlace(s,r),s=cartesian_spherical(s),!n)return s;var l,n=e[0],c=t[0],e=e[1],t=t[1],g=(c{};class worker_thread_WorkerThread{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Object(r.a)(this,"name",void 0),Object(r.a)(this,"source",void 0),Object(r.a)(this,"url",void 0),Object(r.a)(this,"terminated",!1),Object(r.a)(this,"worker",void 0),Object(r.a)(this,"onMessage",void 0),Object(r.a)(this,"onError",void 0),Object(r.a)(this,"_loadableURL","");var{name:e,source:t,url:n}=e;Object(l.a)(t||n),this.name=e,this.source=t,this.url=n,this.onMessage=a,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=a,this.onError=a,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||function getTransferList(e,t=!0,n){const r=n||new Set;if(e)if(isTransferable(e))r.add(e);else if(isTransferable(e.buffer))r.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&"object"==typeof e)for(const i in e)getTransferList(e[i],t,r);return void 0===n?Array.from(r):[]}(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=getLoadableWorkerURL({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}class worker_job_WorkerJob{constructor(e,t){Object(r.a)(this,"name",void 0),Object(r.a)(this,"workerThread",void 0),Object(r.a)(this,"isRunning",void 0),Object(r.a)(this,"result",void 0),Object(r.a)(this,"_resolve",void 0),Object(r.a)(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Object(l.a)(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Object(l.a)(this.isRunning),this.isRunning=!1,this._reject(e)}}class worker_pool_WorkerPool{constructor(e){Object(r.a)(this,"name","unnamed"),Object(r.a)(this,"source",void 0),Object(r.a)(this,"url",void 0),Object(r.a)(this,"maxConcurrency",1),Object(r.a)(this,"maxMobileConcurrency",1),Object(r.a)(this,"onDebug",()=>{}),Object(r.a)(this,"reuseWorkers",!0),Object(r.a)(this,"props",{}),Object(r.a)(this,"jobQueue",[]),Object(r.a)(this,"idleQueue",[]),Object(r.a)(this,"count",0),Object(r.a)(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(t,n=(e,t,n)=>e.done(n),r=(e,t)=>e.error(t)){var e=new Promise(e=>(this.jobQueue.push({name:t,onMessage:n,onError:r,onStart:e}),this));return this._startQueuedJob(),e}async _startQueuedJob(){if(this.jobQueue.length){const e=this._getAvailableWorker();if(e){const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new worker_job_WorkerJob(t.name,e);e.onMessage=e=>t.onMessage(n,e.type,e.payload),e.onError=e=>t.onError(n,e),t.onStart(n);try{await n.result}finally{this.returnWorkerToQueue(e)}}}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){return 0{},reuseWorkers:!0};class worker_farm_WorkerFarm{static isSupported(){return worker_thread_WorkerThread.isSupported()}static getWorkerFarm(e={}){return worker_farm_WorkerFarm._workerFarm=worker_farm_WorkerFarm._workerFarm||new worker_farm_WorkerFarm({}),worker_farm_WorkerFarm._workerFarm.setProps(e),worker_farm_WorkerFarm._workerFarm}constructor(e){Object(r.a)(this,"props",void 0),Object(r.a)(this,"workerPools",new Map),this.props={...s},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){var{name:e,source:t,url:n}=e;let r=this.workerPools.get(e);return r||((r=new worker_pool_WorkerPool({name:e,source:t,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Object(r.a)(worker_farm_WorkerFarm,"_workerFarm",void 0);const c="latest";function canParseWithWorker(e,t){return!!worker_farm_WorkerFarm.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}async function parseWithWorker(e,t,n,r,i){var o=e.id,e=function getWorkerURL(t,e={}){var n=e[t.id]||{},r="".concat(t.id,"-worker.js");let i=n.workerUrl;if(i||"compression"!==t.id||(i=e.workerUrl),!(i="test"===e._workerType?"modules/".concat(t.module,"/dist/").concat(r):i)){let e=t.version;n=(e="latest"===e?c:e)?"@".concat(e):"";i="https://unpkg.com/@loaders.gl/".concat(t.module).concat(n,"/dist/").concat(r)}return Object(l.a)(i),i}(e,n);const a=worker_farm_WorkerFarm.getWorkerFarm(n),s=a.getWorkerPool({name:o,url:e}),A=(n=JSON.parse(JSON.stringify(n)),await s.startJob("process-on-worker",async function onMessage(e,t,n,r){switch(n){case"done":t.done(r);break;case"error":t.error(r.error);break;case"process":var{id:i,input:o,options:a}=r;try{var s=await e(o,a);t.postMessage("done",{id:i,result:s})}catch(e){o=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:i,error:o})}break;default:console.warn("parse-with-worker unknown message ".concat(n))}}.bind(null,i)));return A.postMessage("process",{input:t,options:n}),(await A.result).result}},function(e,t,n){"use strict";n.d(t,"a",function(){return CompositeLayer});var t=n(335),r=n(58),i=n(119);class CompositeLayer extends t.a{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(e=>e.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(e){super.setState(e),this.setNeedsUpdate()}getPickingInfo({info:e}){var t=e["object"];return t&&t.__source&&t.__source.parent&&t.__source.parent.id===this.id&&(e.object=t.__source.object,e.index=t.__source.index),e}renderLayers(){return null}filterSubLayer(e){return!0}shouldRenderSubLayer(e,t){return t&&t.length}getSubLayerClass(e,t){var n=this.props["_subLayerProps"];return n&&n[e]&&n[e].type||t}getSubLayerRow(e,t,n){return e.__source={parent:this,object:t,index:n},e}getSubLayerAccessor(n){if("function"!=typeof n)return n;{const r={data:this.props.data,target:[]};return(e,t)=>e&&e.__source?(r.index=e.__source.index,n(e.__source.object,r)):n(e,t)}}getSubLayerProps(e={}){var{opacity:t,pickable:n,visible:r,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:s,highlightColor:A,coordinateSystem:l,coordinateOrigin:c,wrapLongitude:g,positionFormat:u,modelMatrix:d,extensions:h,fetch:p,_subLayerProps:f}=this.props;const I={opacity:t,pickable:n,visible:r,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:s,highlightColor:A,coordinateSystem:l,coordinateOrigin:c,wrapLongitude:g,positionFormat:u,modelMatrix:d,extensions:h,fetch:p},C=f&&f[e.id];t=C&&C.updateTriggers,n=e.id||"sublayer";if(C){var m=this.constructor._propTypes,y=e.type?e.type._propTypes:{};for(const v in C){var B=y[v]||m[v];B&&"accessor"===B.type&&(C[v]=this.getSubLayerAccessor(C[v]))}}Object.assign(I,e,C),I.id="".concat(this.props.id,"-").concat(n),I.updateTriggers={all:this.props.updateTriggers.all,...e.updateTriggers,...t};for(const E of h){var b=E.getSubLayerProps.call(this,E);b&&Object.assign(I,b,{updateTriggers:Object.assign(I.updateTriggers,b.updateTriggers)})}return I}_updateAutoHighlight(e){for(const t of this.getSubLayers())t.updateAutoHighlight(e)}_getAttributeManager(){return null}_renderLayers(){let e=this.internalState["subLayers"];var t=!e||this.needsUpdate();t&&(e=this.renderLayers(),e=Object(i.b)(e,Boolean),this.internalState.subLayers=e),Object(r.a)("compositeLayer.renderLayers",this,t,e);for(const n of e)n.parent=this}}CompositeLayer.layerName="CompositeLayer"},function(e,t,n){"use strict";n.r(t);var o=n(146),a=n(362),s=n(249),A=n(151),l=n(177),c=n(32),g=n(15),u=n(6);t.default=function transformRotate(e,r,t){if(t=t||{},!Object(u.isObject)(t))throw new Error("options is invalid");var i=t.pivot,t=t.mutate;if(!e)throw new Error("geojson is required");if(null==r||isNaN(r))throw new Error("angle is required");return 0===r||(i=i||Object(o.default)(e),!1!==t&&void 0!==t||(e=Object(l.a)(e)),Object(c.coordEach)(e,function(e){var t=Object(a.a)(i,e)+r,n=Object(s.a)(i,e),n=Object(g.getCoords)(Object(A.a)(i,n,t));e[0]=n[0],e[1]=n[1]})),e}},function(e,t,n){"use strict";var r=n(618),i=n(1156),o=n(43),a=n(28),n=n(58);var s={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function isJSON(e){var t=e[0],e=e[e.length-1];return"{"===t&&"}"===e||"["===t&&"]"===e},parseTextSync:JSON.parse},A="8.5.10",l=o.global.deck&&o.global.deck.VERSION;if(l&&l!==A)throw new Error("deck.gl - multiple versions detected: ".concat(l," vs ").concat(A));l||(a.a.log(1,"deck.gl ".concat(A))(),o.global.deck=Object.assign(o.global.deck||{},{VERSION:A,version:A,log:a.a,_registerLoggers:n.b}),Object(r.b)([s,[i.a,{imagebitmap:{premultiplyAlpha:"none"}}]]));t.a=o.global.deck},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function createContext(){var i=o.createContext(void 0);return{Provider:function Provider(e){var t=e.initialStore,n=e.createStore,e=e.children,r=o.useRef();return r.current||(t&&(console.warn("Provider initialStore is deprecated and will be removed in the next version."),n=n||function createStore(){return t}),r.current=n()),o.createElement(i.Provider,{value:r.current},e)},useStore:function useStore(e,t){void 0===t&&(t=Object.is);var n=o.useContext(i);if(n)return n(e,t);throw new Error("Seems like you have not used zustand provider as an ancestor.")},useStoreApi:function useStoreApi(){var e=o.useContext(i);if(e)return o.useMemo(function(){return{getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}},[e]);throw new Error("Seems like you have not used zustand provider as an ancestor.")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function shallow(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(var r=0;r=e)&&(r=e);else{let e=-1;for(var i of t)null!=(i=n(i,++e,t))&&(r=i)&&(r=i)}return r}n.d(t,"a",function(){return max})},function(e,t,n){"use strict";e.exports=Pbf;var r=n(505);function Pbf(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Pbf.Varint=0,Pbf.Fixed64=1,Pbf.Bytes=2,Pbf.Fixed32=5;var i=4294967296,o=1/i,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function readPackedEnd(e){return e.type===Pbf.Bytes?e.readVarint()+e.pos:e.pos+1}function toNum(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function makeRoomForExtraLength(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;e<=i;i--)n.buf[i+r]=n.buf[i]}function writePackedVarint(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function readInt32(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Pbf.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=readUInt32(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=readInt32(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=readUInt32(this.buf,this.pos)+readUInt32(this.buf,this.pos+4)*i;return this.pos+=8,e},readSFixed64:function(){var e=readUInt32(this.buf,this.pos)+readInt32(this.buf,this.pos+4)*i;return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,n=t[this.pos++],r=127&n;return n<128?r:(r|=(127&(n=t[this.pos++]))<<7,n<128?r:(r|=(127&(n=t[this.pos++]))<<14,n<128?r:(r|=(127&(n=t[this.pos++]))<<21,n<128?r:function readVarintRemainder(e,t,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return toNum(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(r|=(15&t[this.pos])<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return(12<=(this.pos=e)-t&&a?function readUtf8TextDecoder(e,t,n){return a.decode(e.subarray(t,n))}:function readUtf8(e,t,n){var r,i,o,a="",s=t;for(;s>>10&1023|55296),l=56320|1023&l),a+=String.fromCharCode(l),s+=c}return a})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Pbf.Bytes)return e.push(this.readVarint(t));var n=readPackedEnd(this);for(e=e||[];this.pos>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos]=127&e}(n,0,t),function writeBigVarintHigh(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(127>>=7)|(127>>=7)|(127>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos,e=(this.pos=function writeUtf8(e,t,n){for(var r,i,o=0;o>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos),this.pos-t);128<=e&&makeRoomForExtraLength(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n3?e.slice(3):"any";var i=r.split("|").map(trim).filter(notEmpty).filter(notIgnore);var o=filterConversions(n,i);var a=i.map(function(e){var t=findTypeByName(e);return{name:e,typeIndex:findTypeIndex(t),test:t.test,conversion:null,conversionIndex:-1}});var s=o.map(function(e){var t=findTypeByName(e.from);return{name:e.from,typeIndex:findTypeIndex(t),test:t.test,conversion:e,conversionIndex:n.indexOf(e)}});return{types:a.concat(s),restParam:t}}function parseSignature(e,t,i){var n=[];if(e.trim()!=="")n=e.split(",").map(trim).map(function(e,t,n){var r=parseParam(e,i);if(r.restParam&&t!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": '+"only allowed for the last parameter");return r});if(n.some(isInvalidParam))return null;return{params:n,fn:t}}function hasRestParam(e){var t=last(e);return t?t.restParam:false}function hasConversions(e){return e.types.some(function(e){return e.conversion!=null})}function compileTest(e){if(!e||e.types.length===0)return ok;else if(e.types.length===1)return findTypeByName(e.types[0].name).test;else if(e.types.length===2){var t=findTypeByName(e.types[0].name).test;var n=findTypeByName(e.types[1].name).test;return function or(e){return t(e)||n(e)}}else{var r=e.types.map(function(e){return findTypeByName(e.name).test});return function or(e){for(var t=0;t=i+1}}else if(e.length===0)return function testArgs(e){return e.length===0};else if(e.length===1){t=compileTest(e[0]);return function testArgs(e){return t(e[0])&&e.length===1}}else if(e.length===2){t=compileTest(e[0]);r=compileTest(e[1]);return function testArgs(e){return t(e[0])&&r(e[1])&&e.length===2}}else{n=e.map(compileTest);return function testArgs(e){for(var t=0;t0){var l=findTypeName(n[s]);r=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+l+", index: "+s+")");r.data={category:"wrongType",fn:o,index:s,actual:l,expected:i};return r}}else a=A}var c=a.map(function(e){return hasRestParam(e.params)?Infinity:e.params.length});if(n.lengthg){r=new TypeError("Too many arguments in function "+o+" (expected: "+g+", actual: "+n.length+")");r.data={category:"tooManyArgs",fn:o,index:n.length,expectedLength:g};return r}r=new TypeError('Arguments of type "'+n.join(", ")+'" do not match any of the defined signatures of function '+o+".");r.data={category:"mismatch",actual:n.map(findTypeName)};return r}function getLowestTypeIndex(e){var t=999;for(var n=0;n=a:l?a>=s:a===s}function createTypedFunction(t,n){if(Object.keys(n).length===0)throw new SyntaxError("No signatures provided");var r=[];Object.keys(n).map(function(e){return parseSignature(e,n[e],P.conversions)}).filter(notNull).forEach(function(t){var e=findInArray(r,function(e){return hasConflictingParams(e,t)});if(e)throw new TypeError('Conflicting signatures "'+stringifyParams(e.params)+'" and "'+stringifyParams(t.params)+'".');r.push(t)});var i=flatMap(r,function(t){var e=t?splitParams(t.params,false):[];return e.map(function(e){return{params:e,fn:t.fn}})}).filter(notNull);i.sort(compareSignatures);var e=i[0]&&i[0].params.length<=2&&!hasRestParam(i[0].params);var o=i[1]&&i[1].params.length<=2&&!hasRestParam(i[1].params);var a=i[2]&&i[2].params.length<=2&&!hasRestParam(i[2].params);var s=i[3]&&i[3].params.length<=2&&!hasRestParam(i[3].params);var A=i[4]&&i[4].params.length<=2&&!hasRestParam(i[4].params);var l=i[5]&&i[5].params.length<=2&&!hasRestParam(i[5].params);var c=e&&o&&a&&s&&A&&l;var g=i.map(function(e){return compileTests(e.params)});var u=e?compileTest(i[0].params[0]):notOk;var d=o?compileTest(i[1].params[0]):notOk;var h=a?compileTest(i[2].params[0]):notOk;var p=s?compileTest(i[3].params[0]):notOk;var f=A?compileTest(i[4].params[0]):notOk;var I=l?compileTest(i[5].params[0]):notOk;var C=e?compileTest(i[0].params[1]):notOk;var m=o?compileTest(i[1].params[1]):notOk;var y=a?compileTest(i[2].params[1]):notOk;var B=s?compileTest(i[3].params[1]):notOk;var b=A?compileTest(i[4].params[1]):notOk;var v=l?compileTest(i[5].params[1]):notOk;var E=i.map(function(e){return compileArgsPreprocessing(e.params,e.fn)});var Q=e?E[0]:undef;var w=o?E[1]:undef;var S=a?E[2]:undef;var _=s?E[3]:undef;var x=A?E[4]:undef;var R=l?E[5]:undef;var F=e?i[0].params.length:-1;var D=o?i[1].params.length:-1;var G=a?i[2].params.length:-1;var N=s?i[3].params.length:-1;var T=A?i[4].params.length:-1;var M=l?i[5].params.length:-1;var U=c?6:0;var O=i.length;var L=function generic(){"use strict";for(var e=U;en._time&&(r=n._time),(e=n)._next):(t=n._next,n._next=null,e?e._next=t:i=t);o=e,sleep(r)}(),c=0}}function poke(){var e=u.now(),t=e-l;A[e.toLowerCase(),t]))}function parseWeekdayNumberSunday(e,t,n){t=i.exec(t.slice(n,n+1));return t?(e.w=+t[0],n+t[0].length):-1}function parseWeekdayNumberMonday(e,t,n){t=i.exec(t.slice(n,n+1));return t?(e.u=+t[0],n+t[0].length):-1}function parseWeekNumberSunday(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.U=+t[0],n+t[0].length):-1}function parseWeekNumberISO(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.V=+t[0],n+t[0].length):-1}function parseWeekNumberMonday(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.W=+t[0],n+t[0].length):-1}function parseFullYear(e,t,n){t=i.exec(t.slice(n,n+4));return t?(e.y=+t[0],n+t[0].length):-1}function parseYear(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.y=+t[0]+(68<+t[0]?1900:2e3),n+t[0].length):-1}function parseZone(e,t,n){t=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return t?(e.Z=t[1]?0:-(t[2]+(t[3]||"00")),n+t[0].length):-1}function parseQuarter(e,t,n){t=i.exec(t.slice(n,n+1));return t?(e.q=3*t[0]-3,n+t[0].length):-1}function parseMonthNumber(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.m=t[0]-1,n+t[0].length):-1}function parseDayOfMonth(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.d=+t[0],n+t[0].length):-1}function parseDayOfYear(e,t,n){t=i.exec(t.slice(n,n+3));return t?(e.m=0,e.d=+t[0],n+t[0].length):-1}function parseHour24(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.H=+t[0],n+t[0].length):-1}function parseMinutes(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.M=+t[0],n+t[0].length):-1}function parseSeconds(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.S=+t[0],n+t[0].length):-1}function parseMilliseconds(e,t,n){t=i.exec(t.slice(n,n+3));return t?(e.L=+t[0],n+t[0].length):-1}function parseMicroseconds(e,t,n){t=i.exec(t.slice(n,n+6));return t?(e.L=Math.floor(t[0]/1e3),n+t[0].length):-1}function parseLiteralPercent(e,t,n){t=o.exec(t.slice(n,n+1));return t?n+t[0].length:-1}function parseUnixTimestamp(e,t,n){t=i.exec(t.slice(n));return t?(e.Q=+t[0],n+t[0].length):-1}function parseUnixTimestampSeconds(e,t,n){t=i.exec(t.slice(n));return t?(e.s=+t[0],n+t[0].length):-1}function formatDayOfMonth(e,t){return pad(e.getDate(),t,2)}function formatHour24(e,t){return pad(e.getHours(),t,2)}function formatHour12(e,t){return pad(e.getHours()%12||12,t,2)}function formatDayOfYear(e,t){return pad(1+Q.a.count(Object(n.a)(e),e),t,3)}function formatMilliseconds(e,t){return pad(e.getMilliseconds(),t,3)}function formatMicroseconds(e,t){return formatMilliseconds(e,t)+"000"}function formatMonthNumber(e,t){return pad(e.getMonth()+1,t,2)}function formatMinutes(e,t){return pad(e.getMinutes(),t,2)}function formatSeconds(e,t){return pad(e.getSeconds(),t,2)}function formatWeekdayNumberMonday(e){e=e.getDay();return 0===e?7:e}function formatWeekNumberSunday(e,t){return pad(E.b.count(Object(n.a)(e)-1,e),t,2)}function dISO(e){var t=e.getDay();return 4<=t||0===t?Object(E.c)(e):E.c.ceil(e)}function formatWeekNumberISO(e,t){return e=dISO(e),pad(E.c.count(Object(n.a)(e),e)+(4===Object(n.a)(e).getDay()),t,2)}function formatWeekdayNumberSunday(e){return e.getDay()}function formatWeekNumberMonday(e,t){return pad(E.a.count(Object(n.a)(e)-1,e),t,2)}function formatYear(e,t){return pad(e.getFullYear()%100,t,2)}function formatYearISO(e,t){return pad((e=dISO(e)).getFullYear()%100,t,2)}function formatFullYear(e,t){return pad(e.getFullYear()%1e4,t,4)}function formatFullYearISO(e,t){var n=e.getDay();return pad((e=4<=n||0===n?Object(E.c)(e):E.c.ceil(e)).getFullYear()%1e4,t,4)}function formatZone(e){e=e.getTimezoneOffset();return(0>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return a.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n>=1}else{for(i=1,r=0;r>=1}0==--c&&(c=Math.pow(2,u),u++),delete A[l]}else for(i=s[l],r=0;r>=1;0==--c&&(c=Math.pow(2,u),u++),s[a]=g++,l=String(o)}if(""!==l){if(Object.prototype.hasOwnProperty.call(A,l)){if(l.charCodeAt(0)<256){for(r=0;r>=1}else{for(i=1,r=0;r>=1}0==--c&&(c=Math.pow(2,u),u++),delete A[l]}else for(i=s[l],r=0;r>=1;0==--c&&(c=Math.pow(2,u),u++)}for(i=2,r=0;r>=1;for(;;){if(h<<=1,p==t-1){d.push(n(h));break}p++}return d.join("")},decompress:function(t){return null==t?"":""==t?null:a._decompress(t.length,32768,function(e){return t.charCodeAt(e)})},_decompress:function(e,t,n){for(var r,i,o,a,s,A,l=[],c=4,g=4,u=3,d="",h=[],p={val:n(0),position:t,index:1},f=0;f<3;f+=1)l[f]=f;for(i=0,a=Math.pow(2,2),s=1;s!=a;)o=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0e)return"";for(i=0,a=Math.pow(2,u),s=1;s!=a;)o=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0t+1?e.slice(0,t+1)+"."+e.slice(t+1):e+new Array(t-e.length+2).join("0")):e+""}function Jk5(e){return e}var S,o=n(138),a=n(290),s=n(154),_={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:s.a,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Hk5(100*e,t),r:Hk5,s:function(e,t){var n=Object(s.b)(e,t);if(!n)return e+"";var r=n[0],n=n[1],n=n-(S=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,i=r.length;return n===i?r:iMath.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)},l=Array.prototype.map,x=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];t.a=function(e){var t,s,A,b=void 0===e.grouping||void 0===e.thousands?Jk5:(s=l.call(e.grouping,Number),A=e.thousands+"",function(e,t){for(var n=e.length,r=[],i=0,o=s[0],a=0;0t));)o=s[i=(i+1)%s.length];return r.reverse().join(A)}),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",v=void 0===e.decimal?".":e.decimal+"",E=void 0===e.numerals?Jk5:(t=l.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}),i=void 0===e.percent?"%":e.percent+"",Q=void 0===e.minus?"−":e.minus+"",w=void 0===e.nan?"NaN":e.nan+"";function newFormat(e){var l=(e=Object(a.a)(e)).fill,c=e.align,g=e.sign,t=e.symbol,u=e.zero,d=e.width,h=e.comma,p=e.precision,f=e.trim,I=e.type,C=("n"===I?(h=!0,I="g"):_[I]||(void 0===p&&(p=12),f=!0,I="g"),(u||"0"===l&&"="===c)&&(u=!0,l="0",c="="),"$"===t?n:"#"===t&&/[boxX]/.test(I)?"0"+I.toLowerCase():""),m="$"===t?r:/[%p]/.test(I)?i:"",y=_[I],B=/[defgprs%]/.test(I);function format(e){var t,n,r,i=C,o=m;if("c"===I)o=y(e)+o,e="";else{var a=(e=+e)<0||1/e<0;if(e=isNaN(e)?w:y(Math.abs(e),p),f&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r>1)+i+e+o+A.slice(s);break;default:e=A+i+e+o}return E(e)}return p=void 0===p?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),format.toString=function(){return e+""},format}return{format:newFormat,formatPrefix:function formatPrefix(e,t){var n=newFormat(((e=Object(a.a)(e)).type="f",e)),e=3*Math.max(-8,Math.min(8,Math.floor(Object(o.a)(t)/3))),r=Math.pow(10,-e),i=x[8+e/3];return function(e){return n(r*e)+i}}}}},function(e,t,n){"use strict";n.d(t,"b",function(){return x}),n.d(t,"c",function(){return y});var o={value:()=>{}};function dispatch(){for(var e,t=0,n=arguments.length,r={};t(e=(1664525*e+1013904223)%4294967296)/4294967296}();function step(){tick(),n.call("tick",o),a{g.readPixels(t,n,a,s,r,A,o)}),i.unbind({target:35051}),c&&l.delete(),i}function copyToDataUrl(e,{sourceAttachment:t=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let r=readPixelsToArray(e,{sourceAttachment:t}),{width:i,height:o}=e;for(;o>n;)({data:r,width:i,height:o}=Object(p.d)({data:r,width:i,height:o}));Object(p.a)({data:r,width:i,height:o});const a=document.createElement("canvas"),s=(a.width=i,a.height=o,a.getContext("2d")),A=s.createImageData(i,o);return A.data.set(r),s.putImageData(A,0,0),a.toDataURL()}function copyToTexture(e,t,n={}){var{sourceX:r=0,sourceY:i=0,targetMipmaplevel:o=0,targetInternalFormat:a=6408}=n;let{targetX:s,targetY:A,targetZ:l,width:c,height:g}=n;const{framebuffer:u,deleteFramebuffer:d}=getFramebuffer(e),{gl:h,handle:p}=(Object(y.a)(u),u);n=void 0!==s||void 0!==A||void 0!==l,s=s||0,A=A||0,l=l||0,e=h.bindFramebuffer(36160,p);Object(y.a)(t);let f=null;if(t instanceof C.a&&(f=t,c=Number.isFinite(c)?c:f.width,g=Number.isFinite(g)?g:f.height,f.bind(0),t=f.target),n)switch(t){case 3553:case 34067:h.copyTexSubImage2D(t,o,s,A,r,i,c,g);break;case 35866:case 32879:const I=Object(m.a)(h);I.copyTexSubImage3D(t,o,s,A,l,r,i,c,g)}else h.copyTexImage2D(t,o,a,r,i,c,g,0);return f&&f.unbind(),h.bindFramebuffer(36160,e||null),d&&u.delete(),f}function getFramebuffer(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(i.b)(e),deleteFramebuffer:!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return shader_module_ShaderModule}),n.d(t,"b",function(){return normalizeShaderModule});var g=n(374);const i={number:{validate(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},array:{validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function parsePropTypes(e){const t={};for(const r in e){var n=function parsePropType(e){let t=getTypeOf(e);if("object"!==t)return Object.assign({type:t,value:e},i[t]);if(!e)return{type:"object",value:null};if("type"in e)return Object.assign({},e,i[e.type]);return"value"in e?(t=getTypeOf(e.value),Object.assign({type:t},e,i[t])):{type:"object",value:e}}(e[r]);t[r]=n}return t}function getTypeOf(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}class shader_module_ShaderModule{constructor({name:e,vs:t,fs:n,dependencies:r=[],uniforms:i,getUniforms:o,deprecations:a=[],defines:s={},inject:A={},vertexShader:l,fragmentShader:c}){Object(g.a)("string"==typeof e),this.name=e,this.vs=t||l,this.fs=n||c,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=s,this.injections=function normalizeInjections(t){const n={vs:{},fs:{}};for(const i in t){let e=t[i];var r=i.slice(0,2);"string"==typeof e&&(e={order:0,injection:e}),n[r][i]=e}return n}(A),i&&(this.uniforms=parsePropTypes(i))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Object(g.a)(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")} +`+e[t]:e[t]}),n}},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return a}),n.d(t,"d",function(){return s});var r,i,o,a,s,A=n(479);!function defaultLocale(e){r=Object(A.a)(e),i=r.format,o=r.parse,a=r.utcFormat,s=r.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]})},,,,,,,,function(e,t,n){var r=n(146),i=n(303),o=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,A=/^0o[0-7]+$/i,l=parseInt;e.exports=function toNumber(e){if("number"==typeof e)return e;if(i(e))return NaN;if(r(e)&&(t="function"==typeof e.valueOf?e.valueOf():e,e=r(t)?t+"":t),"string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var t=s.test(e);return t||A.test(e)?l(e.slice(2),t?2:8):a.test(e)?NaN:+e}},function(e,t,n){"use strict";function requirePropFactory(e){return function(){return null}}n.d(t,"a",function(){return requirePropFactory})},function(e,t,n){"use strict";function unsupportedProp(e,t,n,r,i){return null}n.d(t,"a",function(){return unsupportedProp})},function(e,t,i){"use strict";!function(n){var e=i(75),r=(Object.defineProperty(t,"__esModule",{value:!0}),t.default=function isElectron(e){if("undefined"!=typeof window&&"object"===(0,r.default)(window.process)&&"renderer"===window.process.type)return!0;if(void 0!==n&&"object"===(0,r.default)(n.versions)&&Boolean(n.versions.electron))return!0;var t="object"===("undefined"==typeof navigator?"undefined":(0,r.default)(navigator))&&"string"==typeof navigator.userAgent&&navigator.userAgent,e=e||t;if(e&&0<=e.indexOf("Electron"))return!0;return!1},e(i(224)))}.call(this,i(89))},function(e,t,n){"use strict";n.d(t,"a",function(){return concatenateArrayBuffersAsync});var r=n(170);async function concatenateArrayBuffersAsync(e){const t=[];for await(const n of e)t.push(n);return Object(r.b)(...t)}},function(e,t,n){var o=n(745),a=n(129);e.exports=function baseIsEqual(e,t,n,r,i){return e===t||(null==e||null==t||!a(e)&&!a(t)?e!=e&&t!=t:o(e,t,n,r,baseIsEqual,i))}},function(e,t,n){var r=n(308),i=n(751),o=n(752),a=n(753),s=n(754),n=n(755);function Stack(e){e=this.__data__=new r(e);this.size=e.size}Stack.prototype.clear=i,Stack.prototype.delete=o,Stack.prototype.get=a,Stack.prototype.has=s,Stack.prototype.set=n,e.exports=Stack},function(e,t,n){n=n(194)(n(120),"Map");e.exports=n},function(e,t,n){var r=n(760),i=n(767),o=n(769),a=n(770),n=n(771);function MapCache(e){var t=-1,n=null==e?0:e.length;for(this.clear();++te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}(n.selectedIndexes);try{for(g.s();!(e=g.n()).done;){var u,d=e.value;de.length)&&(t=e.length);for(var n=0,r=new Array(t);ndocument.F=Object<\/script>"),e.close(),A=e.F;t--;)delete A[s][o[t]];return A()};e.exports=Object.create||function create(e,t){var n;return null!==e?(zwf[s]=r(e),n=new zwf,zwf[s]=null,n[a]=e):n=A(),void 0===t?n:i(n,t)}},function(e,t,n){var r=n(195).f,i=n(196),o=n(236)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){t.f=n(236)},function(e,t,n){var r=n(167),i=n(168),o=n(325),a=n(449),s=n(195).f;e.exports=function(e){var t=i.Symbol||(i.Symbol=!o&&r.Symbol||{});"_"==e.charAt(0)||e in t||s(t,e,{value:a.f(e)})}},function(e,t,n){var r=n(593),i=n(994);e.exports=function forOwn(e,t){return e&&r(e,i(t))}},function(e,t,n){var r=n(108),i=n(303),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function isKey(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!i(e))||(a.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t){e.exports=function(e){var t;return e.webpackPolyfill||((t=Object.create(e)).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),t}},function(e,t,n){n=n(237)(n(149),"Map");e.exports=n},function(e,t,n){n=n(149).Symbol;e.exports=n},function(e,t){var n=Array.isArray;e.exports=n},function(e,t,n){"use strict";e.exports=n(616)},function(e,t,n){"use strict";var r=n(50),o=r("%TypeError%"),a=r("%SyntaxError%"),s=n(166),A={"Property Descriptor":function isPropertyDescriptor(e){var t,n={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(t in e)if(s(e,t)&&!n[t])return!1;var r=s(e,"[[Value]]"),i=s(e,"[[Get]]")||s(e,"[[Set]]");if(r&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},"Match Record":n(1110)};e.exports=function assertRecord(e,t,n,r){var i=A[t];if("function"!=typeof i)throw new a("unknown record type: "+t);if("Object"!==e(r)||!i(r))throw new o(n+" must be a "+t)}},function(s,u,e){"use strict";e.r(u);function nyf(){return new Adder}var d=e(244),A=e(383),l=e(31);function Adder(){this.reset()}Adder.prototype={constructor:Adder,reset:function(){this.s=this.t=0},add:function(e){add(t,e,this.t),add(this,t.s,this.s),this.s?this.t+=t.t:this.s=t.t},valueOf:function(){return this.s}};var t=new Adder;function add(e,t,n){var r=e.s=t+n,i=r-t;e.t=t-(r-i)+(n-i)}var x=1e-6,w=Math.PI,c=w/2,k=w/4,S=2*w,Q=180/w,_=w/180,R=Math.abs,p=Math.atan,F=Math.atan2,D=Math.cos,G=(Math.ceil,Math.exp,Math.floor,Math.log,Math.pow,Math.sin),N=(Math.sign,Math.sqrt);Math.tan;function acos(e){return 1x?p((G(t)*(i=D(r))*G(n)-G(r)*(n=D(t))*G(e))/(n*i*o)):(t+r)/2}(a,s,e,t),i.point(A,s),i.lineEnd(),i.lineStart(),i.point(n,s),o=0),i.point(a=e,s=t),A=n},lineEnd:function(){i.lineEnd(),a=s=NaN},clean:function(){return 2-o}}},function clipAntimeridianInterpolate(e,t,n,r){var i;null==e?(i=n*c,r.point(-w,i),r.point(0,i),r.point(w,i),r.point(w,0),r.point(w,-i),r.point(0,-i),r.point(-w,-i),r.point(-w,0),r.point(-w,i)):R(e[0]-t[0])>x?(e=e[0]x;function visible(e,t){return D(e)*D(t)>d}function intersect(e,t,n){var r=[1,0,0],i=cartesianCross(cartesian_cartesian(e),cartesian_cartesian(t)),o=cartesianDot(i,i),a=i[0],s=o-a*a;if(!s)return!n&&e;var A=cartesianCross(r,i),r=cartesianScale(r,d*o/s),o=(cartesianAddInPlace(r,cartesianScale(i,-d*a/s)),A),i=cartesianDot(r,o),a=cartesianDot(o,o),s=i*i-a*(cartesianDot(r,r)-1);if(!(s<0)){A=N(s),s=cartesianScale(o,(-i-A)/a);if(cartesianAddInPlace(s,r),s=cartesian_spherical(s),!n)return s;var l,n=e[0],c=t[0],e=e[1],t=t[1],g=(c{};class worker_thread_WorkerThread{static isSupported(){return"undefined"!=typeof Worker}constructor(e){Object(r.a)(this,"name",void 0),Object(r.a)(this,"source",void 0),Object(r.a)(this,"url",void 0),Object(r.a)(this,"terminated",!1),Object(r.a)(this,"worker",void 0),Object(r.a)(this,"onMessage",void 0),Object(r.a)(this,"onError",void 0),Object(r.a)(this,"_loadableURL","");var{name:e,source:t,url:n}=e;Object(l.a)(t||n),this.name=e,this.source=t,this.url=n,this.onMessage=a,this.onError=e=>console.log(e),this.worker=this._createBrowserWorker()}destroy(){this.onMessage=a,this.onError=a,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(e,t){t=t||function getTransferList(e,t=!0,n){const r=n||new Set;if(e)if(isTransferable(e))r.add(e);else if(isTransferable(e.buffer))r.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&"object"==typeof e)for(const i in e)getTransferList(e[i],t,r);return void 0===n?Array.from(r):[]}(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+="worker ".concat(this.name,". "),e.message&&(t+="".concat(e.message," in ")),e.lineno&&(t+=":".concat(e.lineno,":").concat(e.colno)),new Error(t)}_createBrowserWorker(){this._loadableURL=getLoadableWorkerURL({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=e=>{e.data?this.onMessage(e.data):this.onError(new Error("No data received"))},e.onerror=e=>{this.onError(this._getErrorFromErrorEvent(e)),this.terminated=!0},e.onmessageerror=e=>console.error(e),e}}class worker_job_WorkerJob{constructor(e,t){Object(r.a)(this,"name",void 0),Object(r.a)(this,"workerThread",void 0),Object(r.a)(this,"isRunning",void 0),Object(r.a)(this,"result",void 0),Object(r.a)(this,"_resolve",void 0),Object(r.a)(this,"_reject",void 0),this.name=e,this.workerThread=t,this.isRunning=!0,this._resolve=()=>{},this._reject=()=>{},this.result=new Promise((e,t)=>{this._resolve=e,this._reject=t})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){Object(l.a)(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){Object(l.a)(this.isRunning),this.isRunning=!1,this._reject(e)}}class worker_pool_WorkerPool{constructor(e){Object(r.a)(this,"name","unnamed"),Object(r.a)(this,"source",void 0),Object(r.a)(this,"url",void 0),Object(r.a)(this,"maxConcurrency",1),Object(r.a)(this,"maxMobileConcurrency",1),Object(r.a)(this,"onDebug",()=>{}),Object(r.a)(this,"reuseWorkers",!0),Object(r.a)(this,"props",{}),Object(r.a)(this,"jobQueue",[]),Object(r.a)(this,"idleQueue",[]),Object(r.a)(this,"count",0),Object(r.a)(this,"isDestroyed",!1),this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},void 0!==e.name&&(this.name=e.name),void 0!==e.maxConcurrency&&(this.maxConcurrency=e.maxConcurrency),void 0!==e.maxMobileConcurrency&&(this.maxMobileConcurrency=e.maxMobileConcurrency),void 0!==e.reuseWorkers&&(this.reuseWorkers=e.reuseWorkers),void 0!==e.onDebug&&(this.onDebug=e.onDebug)}async startJob(t,n=(e,t,n)=>e.done(n),r=(e,t)=>e.error(t)){var e=new Promise(e=>(this.jobQueue.push({name:t,onMessage:n,onError:r,onStart:e}),this));return this._startQueuedJob(),e}async _startQueuedJob(){if(this.jobQueue.length){const e=this._getAvailableWorker();if(e){const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new worker_job_WorkerJob(t.name,e);e.onMessage=e=>t.onMessage(n,e.type,e.payload),e.onError=e=>t.onError(n,e),t.onStart(n);try{await n.result}finally{this.returnWorkerToQueue(e)}}}}}returnWorkerToQueue(e){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){return 0{},reuseWorkers:!0};class worker_farm_WorkerFarm{static isSupported(){return worker_thread_WorkerThread.isSupported()}static getWorkerFarm(e={}){return worker_farm_WorkerFarm._workerFarm=worker_farm_WorkerFarm._workerFarm||new worker_farm_WorkerFarm({}),worker_farm_WorkerFarm._workerFarm.setProps(e),worker_farm_WorkerFarm._workerFarm}constructor(e){Object(r.a)(this,"props",void 0),Object(r.a)(this,"workerPools",new Map),this.props={...s},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy()}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){var{name:e,source:t,url:n}=e;let r=this.workerPools.get(e);return r||((r=new worker_pool_WorkerPool({name:e,source:t,url:n})).setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}Object(r.a)(worker_farm_WorkerFarm,"_workerFarm",void 0);const c="latest";function canParseWithWorker(e,t){return!!worker_farm_WorkerFarm.isSupported()&&(e.worker&&(null==t?void 0:t.worker))}async function parseWithWorker(e,t,n,r,i){var o=e.id,e=function getWorkerURL(t,e={}){var n=e[t.id]||{},r="".concat(t.id,"-worker.js");let i=n.workerUrl;if(i||"compression"!==t.id||(i=e.workerUrl),!(i="test"===e._workerType?"modules/".concat(t.module,"/dist/").concat(r):i)){let e=t.version;n=(e="latest"===e?c:e)?"@".concat(e):"";i="https://unpkg.com/@loaders.gl/".concat(t.module).concat(n,"/dist/").concat(r)}return Object(l.a)(i),i}(e,n);const a=worker_farm_WorkerFarm.getWorkerFarm(n),s=a.getWorkerPool({name:o,url:e}),A=(n=JSON.parse(JSON.stringify(n)),await s.startJob("process-on-worker",async function onMessage(e,t,n,r){switch(n){case"done":t.done(r);break;case"error":t.error(r.error);break;case"process":var{id:i,input:o,options:a}=r;try{var s=await e(o,a);t.postMessage("done",{id:i,result:s})}catch(e){o=e instanceof Error?e.message:"unknown error";t.postMessage("error",{id:i,error:o})}break;default:console.warn("parse-with-worker unknown message ".concat(n))}}.bind(null,i)));return A.postMessage("process",{input:t,options:n}),(await A.result).result}},function(e,t,n){"use strict";n.d(t,"a",function(){return CompositeLayer});var t=n(342),r=n(59),i=n(122);class CompositeLayer extends t.a{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every(e=>e.isLoaded)}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(){}setState(e){super.setState(e),this.setNeedsUpdate()}getPickingInfo({info:e}){var t=e["object"];return t&&t.__source&&t.__source.parent&&t.__source.parent.id===this.id&&(e.object=t.__source.object,e.index=t.__source.index),e}renderLayers(){return null}filterSubLayer(e){return!0}shouldRenderSubLayer(e,t){return t&&t.length}getSubLayerClass(e,t){var n=this.props["_subLayerProps"];return n&&n[e]&&n[e].type||t}getSubLayerRow(e,t,n){return e.__source={parent:this,object:t,index:n},e}getSubLayerAccessor(n){if("function"!=typeof n)return n;{const r={data:this.props.data,target:[]};return(e,t)=>e&&e.__source?(r.index=e.__source.index,n(e.__source.object,r)):n(e,t)}}getSubLayerProps(e={}){var{opacity:t,pickable:n,visible:r,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:s,highlightColor:A,coordinateSystem:l,coordinateOrigin:c,wrapLongitude:g,positionFormat:u,modelMatrix:d,extensions:h,fetch:p,_subLayerProps:f}=this.props;const I={opacity:t,pickable:n,visible:r,parameters:i,getPolygonOffset:o,highlightedObjectIndex:a,autoHighlight:s,highlightColor:A,coordinateSystem:l,coordinateOrigin:c,wrapLongitude:g,positionFormat:u,modelMatrix:d,extensions:h,fetch:p},C=f&&f[e.id];t=C&&C.updateTriggers,n=e.id||"sublayer";if(C){var m=this.constructor._propTypes,y=e.type?e.type._propTypes:{};for(const v in C){var B=y[v]||m[v];B&&"accessor"===B.type&&(C[v]=this.getSubLayerAccessor(C[v]))}}Object.assign(I,e,C),I.id="".concat(this.props.id,"-").concat(n),I.updateTriggers={all:this.props.updateTriggers.all,...e.updateTriggers,...t};for(const E of h){var b=E.getSubLayerProps.call(this,E);b&&Object.assign(I,b,{updateTriggers:Object.assign(I.updateTriggers,b.updateTriggers)})}return I}_updateAutoHighlight(e){for(const t of this.getSubLayers())t.updateAutoHighlight(e)}_getAttributeManager(){return null}_renderLayers(){let e=this.internalState["subLayers"];var t=!e||this.needsUpdate();t&&(e=this.renderLayers(),e=Object(i.b)(e,Boolean),this.internalState.subLayers=e),Object(r.a)("compositeLayer.renderLayers",this,t,e);for(const n of e)n.parent=this}}CompositeLayer.layerName="CompositeLayer"},function(e,t,n){"use strict";n.r(t);var o=n(150),a=n(369),s=n(255),A=n(155),l=n(182),c=n(31),g=n(15),u=n(6);t.default=function transformRotate(e,r,t){if(t=t||{},!Object(u.isObject)(t))throw new Error("options is invalid");var i=t.pivot,t=t.mutate;if(!e)throw new Error("geojson is required");if(null==r||isNaN(r))throw new Error("angle is required");return 0===r||(i=i||Object(o.default)(e),!1!==t&&void 0!==t||(e=Object(l.a)(e)),Object(c.coordEach)(e,function(e){var t=Object(a.a)(i,e)+r,n=Object(s.a)(i,e),n=Object(g.getCoords)(Object(A.a)(i,n,t));e[0]=n[0],e[1]=n[1]})),e}},function(e,t,n){"use strict";var r=n(649),i=n(1224),o=n(43),a=n(28),n=n(59);var s={name:"JSON",extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function isJSON(e){var t=e[0],e=e[e.length-1];return"{"===t&&"}"===e||"["===t&&"]"===e},parseTextSync:JSON.parse},A="8.5.10",l=o.global.deck&&o.global.deck.VERSION;if(l&&l!==A)throw new Error("deck.gl - multiple versions detected: ".concat(l," vs ").concat(A));l||(a.a.log(1,"deck.gl ".concat(A))(),o.global.deck=Object.assign(o.global.deck||{},{VERSION:A,version:A,log:a.a,_registerLoggers:n.b}),Object(r.b)([s,[i.a,{imagebitmap:{premultiplyAlpha:"none"}}]]));t.a=o.global.deck},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.default=function createContext(){var i=o.createContext(void 0);return{Provider:function Provider(e){var t=e.initialStore,n=e.createStore,e=e.children,r=o.useRef();return r.current||(t&&(console.warn("Provider initialStore is deprecated and will be removed in the next version."),n=n||function createStore(){return t}),r.current=n()),o.createElement(i.Provider,{value:r.current},e)},useStore:function useStore(e,t){void 0===t&&(t=Object.is);var n=o.useContext(i);if(n)return n(e,t);throw new Error("Seems like you have not used zustand provider as an ancestor.")},useStoreApi:function useStoreApi(){var e=o.useContext(i);if(e)return o.useMemo(function(){return{getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}},[e]);throw new Error("Seems like you have not used zustand provider as an ancestor.")}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function shallow(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(var r=0;r=e)&&(r=e);else{let e=-1;for(var i of t)null!=(i=n(i,++e,t))&&(r=i)&&(r=i)}return r}n.d(t,"a",function(){return max})},function(e,t,n){"use strict";e.exports=Pbf;var r=n(514);function Pbf(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Pbf.Varint=0,Pbf.Fixed64=1,Pbf.Bytes=2,Pbf.Fixed32=5;var i=4294967296,o=1/i,a="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function readPackedEnd(e){return e.type===Pbf.Bytes?e.readVarint()+e.pos:e.pos+1}function toNum(e,t,n){return n?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function makeRoomForExtraLength(e,t,n){var r=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;e<=i;i--)n.buf[i+r]=n.buf[i]}function writePackedVarint(e,t){for(var n=0;n>>8,e[n+2]=t>>>16,e[n+3]=t>>>24}function readInt32(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}Pbf.prototype={destroy:function(){this.buf=null},readFields:function(e,t,n){for(n=n||this.length;this.pos>3,o=this.pos;this.type=7&r,e(i,t,this),this.pos===o&&this.skip(r)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=readUInt32(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=readInt32(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=readUInt32(this.buf,this.pos)+readUInt32(this.buf,this.pos+4)*i;return this.pos+=8,e},readSFixed64:function(){var e=readUInt32(this.buf,this.pos)+readInt32(this.buf,this.pos+4)*i;return this.pos+=8,e},readFloat:function(){var e=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t=this.buf,n=t[this.pos++],r=127&n;return n<128?r:(r|=(127&(n=t[this.pos++]))<<7,n<128?r:(r|=(127&(n=t[this.pos++]))<<14,n<128?r:(r|=(127&(n=t[this.pos++]))<<21,n<128?r:function readVarintRemainder(e,t,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return toNum(e,r,t);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return toNum(e,r,t);throw new Error("Expected varint not more than 10 bytes")}(r|=(15&t[this.pos])<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return(12<=(this.pos=e)-t&&a?function readUtf8TextDecoder(e,t,n){return a.decode(e.subarray(t,n))}:function readUtf8(e,t,n){var r,i,o,a="",s=t;for(;s>>10&1023|55296),l=56320|1023&l),a+=String.fromCharCode(l),s+=c}return a})(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Pbf.Bytes)return e.push(this.readVarint(t));var n=readPackedEnd(this);for(e=e||[];this.pos>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos++]=127&e|128,e>>>=7,n.buf[n.pos]=127&e}(n,0,t),function writeBigVarintHigh(e,t){var n=(7&e)<<4;t.buf[t.pos++]|=n|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(r,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(127>>=7)|(127>>=7)|(127>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos,e=(this.pos=function writeUtf8(e,t,n){for(var r,i,o=0;o>6|192:(r<65536?e[n++]=r>>12|224:(e[n++]=r>>18|240,e[n++]=r>>12&63|128),e[n++]=r>>6&63|128),e[n++]=63&r|128)}return n}(this.buf,e,this.pos),this.pos-t);128<=e&&makeRoomForExtraLength(t,e,this),this.pos=t-1,this.writeVarint(e),this.pos+=e},writeFloat:function(e){this.realloc(4),r.write(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),r.write(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var n=0;n3?e.slice(3):"any";var i=r.split("|").map(trim).filter(notEmpty).filter(notIgnore);var o=filterConversions(n,i);var a=i.map(function(e){var t=findTypeByName(e);return{name:e,typeIndex:findTypeIndex(t),test:t.test,conversion:null,conversionIndex:-1}});var s=o.map(function(e){var t=findTypeByName(e.from);return{name:e.from,typeIndex:findTypeIndex(t),test:t.test,conversion:e,conversionIndex:n.indexOf(e)}});return{types:a.concat(s),restParam:t}}function parseSignature(e,t,i){var n=[];if(e.trim()!=="")n=e.split(",").map(trim).map(function(e,t,n){var r=parseParam(e,i);if(r.restParam&&t!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+e+'": '+"only allowed for the last parameter");return r});if(n.some(isInvalidParam))return null;return{params:n,fn:t}}function hasRestParam(e){var t=last(e);return t?t.restParam:false}function hasConversions(e){return e.types.some(function(e){return e.conversion!=null})}function compileTest(e){if(!e||e.types.length===0)return ok;else if(e.types.length===1)return findTypeByName(e.types[0].name).test;else if(e.types.length===2){var t=findTypeByName(e.types[0].name).test;var n=findTypeByName(e.types[1].name).test;return function or(e){return t(e)||n(e)}}else{var r=e.types.map(function(e){return findTypeByName(e.name).test});return function or(e){for(var t=0;t=i+1}}else if(e.length===0)return function testArgs(e){return e.length===0};else if(e.length===1){t=compileTest(e[0]);return function testArgs(e){return t(e[0])&&e.length===1}}else if(e.length===2){t=compileTest(e[0]);r=compileTest(e[1]);return function testArgs(e){return t(e[0])&&r(e[1])&&e.length===2}}else{n=e.map(compileTest);return function testArgs(e){for(var t=0;t0){var l=findTypeName(n[s]);r=new TypeError("Unexpected type of argument in function "+o+" (expected: "+i.join(" or ")+", actual: "+l+", index: "+s+")");r.data={category:"wrongType",fn:o,index:s,actual:l,expected:i};return r}}else a=A}var c=a.map(function(e){return hasRestParam(e.params)?Infinity:e.params.length});if(n.lengthg){r=new TypeError("Too many arguments in function "+o+" (expected: "+g+", actual: "+n.length+")");r.data={category:"tooManyArgs",fn:o,index:n.length,expectedLength:g};return r}r=new TypeError('Arguments of type "'+n.join(", ")+'" do not match any of the defined signatures of function '+o+".");r.data={category:"mismatch",actual:n.map(findTypeName)};return r}function getLowestTypeIndex(e){var t=999;for(var n=0;n=a:l?a>=s:a===s}function createTypedFunction(t,n){if(Object.keys(n).length===0)throw new SyntaxError("No signatures provided");var r=[];Object.keys(n).map(function(e){return parseSignature(e,n[e],P.conversions)}).filter(notNull).forEach(function(t){var e=findInArray(r,function(e){return hasConflictingParams(e,t)});if(e)throw new TypeError('Conflicting signatures "'+stringifyParams(e.params)+'" and "'+stringifyParams(t.params)+'".');r.push(t)});var i=flatMap(r,function(t){var e=t?splitParams(t.params,false):[];return e.map(function(e){return{params:e,fn:t.fn}})}).filter(notNull);i.sort(compareSignatures);var e=i[0]&&i[0].params.length<=2&&!hasRestParam(i[0].params);var o=i[1]&&i[1].params.length<=2&&!hasRestParam(i[1].params);var a=i[2]&&i[2].params.length<=2&&!hasRestParam(i[2].params);var s=i[3]&&i[3].params.length<=2&&!hasRestParam(i[3].params);var A=i[4]&&i[4].params.length<=2&&!hasRestParam(i[4].params);var l=i[5]&&i[5].params.length<=2&&!hasRestParam(i[5].params);var c=e&&o&&a&&s&&A&&l;var g=i.map(function(e){return compileTests(e.params)});var u=e?compileTest(i[0].params[0]):notOk;var d=o?compileTest(i[1].params[0]):notOk;var h=a?compileTest(i[2].params[0]):notOk;var p=s?compileTest(i[3].params[0]):notOk;var f=A?compileTest(i[4].params[0]):notOk;var I=l?compileTest(i[5].params[0]):notOk;var C=e?compileTest(i[0].params[1]):notOk;var m=o?compileTest(i[1].params[1]):notOk;var y=a?compileTest(i[2].params[1]):notOk;var B=s?compileTest(i[3].params[1]):notOk;var b=A?compileTest(i[4].params[1]):notOk;var v=l?compileTest(i[5].params[1]):notOk;var E=i.map(function(e){return compileArgsPreprocessing(e.params,e.fn)});var Q=e?E[0]:undef;var w=o?E[1]:undef;var S=a?E[2]:undef;var _=s?E[3]:undef;var x=A?E[4]:undef;var R=l?E[5]:undef;var F=e?i[0].params.length:-1;var D=o?i[1].params.length:-1;var G=a?i[2].params.length:-1;var N=s?i[3].params.length:-1;var T=A?i[4].params.length:-1;var M=l?i[5].params.length:-1;var U=c?6:0;var O=i.length;var L=function generic(){"use strict";for(var e=U;en._time&&(r=n._time),(e=n)._next):(t=n._next,n._next=null,e?e._next=t:i=t);o=e,sleep(r)}(),c=0}}function poke(){var e=u.now(),t=e-l;A[e.toLowerCase(),t]))}function parseWeekdayNumberSunday(e,t,n){t=i.exec(t.slice(n,n+1));return t?(e.w=+t[0],n+t[0].length):-1}function parseWeekdayNumberMonday(e,t,n){t=i.exec(t.slice(n,n+1));return t?(e.u=+t[0],n+t[0].length):-1}function parseWeekNumberSunday(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.U=+t[0],n+t[0].length):-1}function parseWeekNumberISO(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.V=+t[0],n+t[0].length):-1}function parseWeekNumberMonday(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.W=+t[0],n+t[0].length):-1}function parseFullYear(e,t,n){t=i.exec(t.slice(n,n+4));return t?(e.y=+t[0],n+t[0].length):-1}function parseYear(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.y=+t[0]+(68<+t[0]?1900:2e3),n+t[0].length):-1}function parseZone(e,t,n){t=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return t?(e.Z=t[1]?0:-(t[2]+(t[3]||"00")),n+t[0].length):-1}function parseQuarter(e,t,n){t=i.exec(t.slice(n,n+1));return t?(e.q=3*t[0]-3,n+t[0].length):-1}function parseMonthNumber(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.m=t[0]-1,n+t[0].length):-1}function parseDayOfMonth(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.d=+t[0],n+t[0].length):-1}function parseDayOfYear(e,t,n){t=i.exec(t.slice(n,n+3));return t?(e.m=0,e.d=+t[0],n+t[0].length):-1}function parseHour24(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.H=+t[0],n+t[0].length):-1}function parseMinutes(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.M=+t[0],n+t[0].length):-1}function parseSeconds(e,t,n){t=i.exec(t.slice(n,n+2));return t?(e.S=+t[0],n+t[0].length):-1}function parseMilliseconds(e,t,n){t=i.exec(t.slice(n,n+3));return t?(e.L=+t[0],n+t[0].length):-1}function parseMicroseconds(e,t,n){t=i.exec(t.slice(n,n+6));return t?(e.L=Math.floor(t[0]/1e3),n+t[0].length):-1}function parseLiteralPercent(e,t,n){t=o.exec(t.slice(n,n+1));return t?n+t[0].length:-1}function parseUnixTimestamp(e,t,n){t=i.exec(t.slice(n));return t?(e.Q=+t[0],n+t[0].length):-1}function parseUnixTimestampSeconds(e,t,n){t=i.exec(t.slice(n));return t?(e.s=+t[0],n+t[0].length):-1}function formatDayOfMonth(e,t){return pad(e.getDate(),t,2)}function formatHour24(e,t){return pad(e.getHours(),t,2)}function formatHour12(e,t){return pad(e.getHours()%12||12,t,2)}function formatDayOfYear(e,t){return pad(1+Q.a.count(Object(n.a)(e),e),t,3)}function formatMilliseconds(e,t){return pad(e.getMilliseconds(),t,3)}function formatMicroseconds(e,t){return formatMilliseconds(e,t)+"000"}function formatMonthNumber(e,t){return pad(e.getMonth()+1,t,2)}function formatMinutes(e,t){return pad(e.getMinutes(),t,2)}function formatSeconds(e,t){return pad(e.getSeconds(),t,2)}function formatWeekdayNumberMonday(e){e=e.getDay();return 0===e?7:e}function formatWeekNumberSunday(e,t){return pad(E.b.count(Object(n.a)(e)-1,e),t,2)}function dISO(e){var t=e.getDay();return 4<=t||0===t?Object(E.c)(e):E.c.ceil(e)}function formatWeekNumberISO(e,t){return e=dISO(e),pad(E.c.count(Object(n.a)(e),e)+(4===Object(n.a)(e).getDay()),t,2)}function formatWeekdayNumberSunday(e){return e.getDay()}function formatWeekNumberMonday(e,t){return pad(E.a.count(Object(n.a)(e)-1,e),t,2)}function formatYear(e,t){return pad(e.getFullYear()%100,t,2)}function formatYearISO(e,t){return pad((e=dISO(e)).getFullYear()%100,t,2)}function formatFullYear(e,t){return pad(e.getFullYear()%1e4,t,4)}function formatFullYearISO(e,t){var n=e.getDay();return pad((e=4<=n||0===n?Object(E.c)(e):E.c.ceil(e)).getFullYear()%1e4,t,4)}function formatZone(e){e=e.getTimezoneOffset();return(0>>8,n[2*r+1]=o%256}return n},decompressFromUint8Array:function(e){if(null==e)return a.decompress(e);for(var t=new Array(e.length/2),n=0,r=t.length;n>=1}else{for(i=1,r=0;r>=1}0==--c&&(c=Math.pow(2,u),u++),delete A[l]}else for(i=s[l],r=0;r>=1;0==--c&&(c=Math.pow(2,u),u++),s[a]=g++,l=String(o)}if(""!==l){if(Object.prototype.hasOwnProperty.call(A,l)){if(l.charCodeAt(0)<256){for(r=0;r>=1}else{for(i=1,r=0;r>=1}0==--c&&(c=Math.pow(2,u),u++),delete A[l]}else for(i=s[l],r=0;r>=1;0==--c&&(c=Math.pow(2,u),u++)}for(i=2,r=0;r>=1;for(;;){if(h<<=1,p==t-1){d.push(n(h));break}p++}return d.join("")},decompress:function(t){return null==t?"":""==t?null:a._decompress(t.length,32768,function(e){return t.charCodeAt(e)})},_decompress:function(e,t,n){for(var r,i,o,a,s,A,l=[],c=4,g=4,u=3,d="",h=[],p={val:n(0),position:t,index:1},f=0;f<3;f+=1)l[f]=f;for(i=0,a=Math.pow(2,2),s=1;s!=a;)o=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0e)return"";for(i=0,a=Math.pow(2,u),s=1;s!=a;)o=p.val&p.position,p.position>>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0>=1,0==p.position&&(p.position=t,p.val=n(p.index++)),i|=(0t+1?e.slice(0,t+1)+"."+e.slice(t+1):e+new Array(t-e.length+2).join("0")):e+""}function bn5(e){return e}var S,o=n(141),a=n(296),s=n(158),_={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:s.a,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>_m5(100*e,t),r:_m5,s:function(e,t){var n=Object(s.b)(e,t);if(!n)return e+"";var r=n[0],n=n[1],n=n-(S=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,i=r.length;return n===i?r:iMath.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)},l=Array.prototype.map,x=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];t.a=function(e){var t,s,A,b=void 0===e.grouping||void 0===e.thousands?bn5:(s=l.call(e.grouping,Number),A=e.thousands+"",function(e,t){for(var n=e.length,r=[],i=0,o=s[0],a=0;0t));)o=s[i=(i+1)%s.length];return r.reverse().join(A)}),n=void 0===e.currency?"":e.currency[0]+"",r=void 0===e.currency?"":e.currency[1]+"",v=void 0===e.decimal?".":e.decimal+"",E=void 0===e.numerals?bn5:(t=l.call(e.numerals,String),function(e){return e.replace(/[0-9]/g,function(e){return t[+e]})}),i=void 0===e.percent?"%":e.percent+"",Q=void 0===e.minus?"−":e.minus+"",w=void 0===e.nan?"NaN":e.nan+"";function newFormat(e){var l=(e=Object(a.a)(e)).fill,c=e.align,g=e.sign,t=e.symbol,u=e.zero,d=e.width,h=e.comma,p=e.precision,f=e.trim,I=e.type,C=("n"===I?(h=!0,I="g"):_[I]||(void 0===p&&(p=12),f=!0,I="g"),(u||"0"===l&&"="===c)&&(u=!0,l="0",c="="),"$"===t?n:"#"===t&&/[boxX]/.test(I)?"0"+I.toLowerCase():""),m="$"===t?r:/[%p]/.test(I)?i:"",y=_[I],B=/[defgprs%]/.test(I);function format(e){var t,n,r,i=C,o=m;if("c"===I)o=y(e)+o,e="";else{var a=(e=+e)<0||1/e<0;if(e=isNaN(e)?w:y(Math.abs(e),p),f&&(e=function(e){e:for(var t,n=e.length,r=1,i=-1;r>1)+i+e+o+A.slice(s);break;default:e=A+i+e+o}return E(e)}return p=void 0===p?6:/[gprs]/.test(I)?Math.max(1,Math.min(21,p)):Math.max(0,Math.min(20,p)),format.toString=function(){return e+""},format}return{format:newFormat,formatPrefix:function formatPrefix(e,t){var n=newFormat(((e=Object(a.a)(e)).type="f",e)),e=3*Math.max(-8,Math.min(8,Math.floor(Object(o.a)(t)/3))),r=Math.pow(10,-e),i=x[8+e/3];return function(e){return n(r*e)+i}}}}},function(e,t,n){"use strict";n.d(t,"b",function(){return x}),n.d(t,"c",function(){return y});var o={value:()=>{}};function dispatch(){for(var e,t=0,n=arguments.length,r={};t(e=(1664525*e+1013904223)%4294967296)/4294967296}();function step(){tick(),n.call("tick",o),a{g.readPixels(t,n,a,s,r,A,o)}),i.unbind({target:35051}),c&&l.delete(),i}function copyToDataUrl(e,{sourceAttachment:t=36064,targetMaxHeight:n=Number.MAX_SAFE_INTEGER}={}){let r=readPixelsToArray(e,{sourceAttachment:t}),{width:i,height:o}=e;for(;o>n;)({data:r,width:i,height:o}=Object(p.d)({data:r,width:i,height:o}));Object(p.a)({data:r,width:i,height:o});const a=document.createElement("canvas"),s=(a.width=i,a.height=o,a.getContext("2d")),A=s.createImageData(i,o);return A.data.set(r),s.putImageData(A,0,0),a.toDataURL()}function copyToTexture(e,t,n={}){var{sourceX:r=0,sourceY:i=0,targetMipmaplevel:o=0,targetInternalFormat:a=6408}=n;let{targetX:s,targetY:A,targetZ:l,width:c,height:g}=n;const{framebuffer:u,deleteFramebuffer:d}=getFramebuffer(e),{gl:h,handle:p}=(Object(y.a)(u),u);n=void 0!==s||void 0!==A||void 0!==l,s=s||0,A=A||0,l=l||0,e=h.bindFramebuffer(36160,p);Object(y.a)(t);let f=null;if(t instanceof C.a&&(f=t,c=Number.isFinite(c)?c:f.width,g=Number.isFinite(g)?g:f.height,f.bind(0),t=f.target),n)switch(t){case 3553:case 34067:h.copyTexSubImage2D(t,o,s,A,r,i,c,g);break;case 35866:case 32879:const I=Object(m.a)(h);I.copyTexSubImage3D(t,o,s,A,l,r,i,c,g)}else h.copyTexImage2D(t,o,a,r,i,c,g,0);return f&&f.unbind(),h.bindFramebuffer(36160,e||null),d&&u.delete(),f}function getFramebuffer(e){return e instanceof r.a?{framebuffer:e,deleteFramebuffer:!1}:{framebuffer:Object(i.b)(e),deleteFramebuffer:!0}}},function(e,t,n){"use strict";n.d(t,"a",function(){return shader_module_ShaderModule}),n.d(t,"b",function(){return normalizeShaderModule});var g=n(381);const i={number:{validate(e,t){return Number.isFinite(e)&&(!("max"in t)||e<=t.max)&&(!("min"in t)||e>=t.min)}},array:{validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function parsePropTypes(e){const t={};for(const r in e){var n=function parsePropType(e){let t=getTypeOf(e);if("object"!==t)return Object.assign({type:t,value:e},i[t]);if(!e)return{type:"object",value:null};if("type"in e)return Object.assign({},e,i[e.type]);return"value"in e?(t=getTypeOf(e.value),Object.assign({type:t},e,i[t])):{type:"object",value:e}}(e[r]);t[r]=n}return t}function getTypeOf(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}class shader_module_ShaderModule{constructor({name:e,vs:t,fs:n,dependencies:r=[],uniforms:i,getUniforms:o,deprecations:a=[],defines:s={},inject:A={},vertexShader:l,fragmentShader:c}){Object(g.a)("string"==typeof e),this.name=e,this.vs=t||l,this.fs=n||c,this.getModuleUniforms=o,this.dependencies=r,this.deprecations=this._parseDeprecationDefinitions(a),this.defines=s,this.injections=function normalizeInjections(t){const n={vs:{},fs:{}};for(const i in t){let e=t[i];var r=i.slice(0,2);"string"==typeof e&&(e={order:0,injection:e}),n[r][i]=e}return n}(A),i&&(this.uniforms=parsePropTypes(i))}getModuleSource(e){let t;switch(e){case"vs":t=this.vs||"";break;case"fs":t=this.fs||"";break;default:Object(g.a)(!1)}return`#define MODULE_${this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_")} ${t}// END MODULE_${this.name} -`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):this.uniforms?this._defaultGetUniforms(e):{}}getDefines(){return this.defines}checkDeprecations(t,n){this.deprecations.forEach(e=>{e.regex.test(t)&&(e.deprecated?n.deprecated(e.old,e.new):n.removed(e.old,e.new))()})}_parseDeprecationDefinitions(e){return e.forEach(e=>{"function"===e.type?e.regex=new RegExp(`\\b${e.old}\\(`):e.regex=new RegExp(`${e.type} ${e.old};`)}),e}_defaultGetUniforms(e={}){const t={};var n=this.uniforms;for(const r in n){const i=n[r];r in e&&!i.private?(i.validate&&Object(g.a)(i.validate(e[r],i),this.name+": invalid "+r),t[r]=e[r]):t[r]=i.value}return t}}function normalizeShaderModule(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){const t=new shader_module_ShaderModule(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return tickIncrement}),n.d(t,"c",function(){return tickStep});var i=Math.sqrt(50),o=Math.sqrt(10),a=Math.sqrt(2);function tickIncrement(e,t,n){t=(t-e)/Math.max(0,n),e=Math.floor(Math.log(t)/Math.LN10),n=t/Math.pow(10,e);return 0<=e?(i<=n?10:o<=n?5:a<=n?2:1)*Math.pow(10,e):-Math.pow(10,-e)/(i<=n?10:o<=n?5:a<=n?2:1)}function tickStep(e,t,n){var n=Math.abs(t-e)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),n=n/r;return i<=n?r*=10:o<=n?r*=5:a<=n&&(r*=2),tr&&--t,o=new Array(i=t-e+1);++sr&&--t,o=new Array(i=t-e+1);++s{e.regex.test(t)&&(e.deprecated?n.deprecated(e.old,e.new):n.removed(e.old,e.new))()})}_parseDeprecationDefinitions(e){return e.forEach(e=>{"function"===e.type?e.regex=new RegExp(`\\b${e.old}\\(`):e.regex=new RegExp(`${e.type} ${e.old};`)}),e}_defaultGetUniforms(e={}){const t={};var n=this.uniforms;for(const r in n){const i=n[r];r in e&&!i.private?(i.validate&&Object(g.a)(i.validate(e[r],i),this.name+": invalid "+r),t[r]=e[r]):t[r]=i.value}return t}}function normalizeShaderModule(e){if(!e.normalized&&(e.normalized=!0,e.uniforms&&!e.getUniforms)){const t=new shader_module_ShaderModule(e);e.getUniforms=t.getUniforms.bind(t)}return e}},function(e,t,n){"use strict";n.d(t,"b",function(){return tickIncrement}),n.d(t,"c",function(){return tickStep});var i=Math.sqrt(50),o=Math.sqrt(10),a=Math.sqrt(2);function tickIncrement(e,t,n){t=(t-e)/Math.max(0,n),e=Math.floor(Math.log(t)/Math.LN10),n=t/Math.pow(10,e);return 0<=e?(i<=n?10:o<=n?5:a<=n?2:1)*Math.pow(10,e):-Math.pow(10,-e)/(i<=n?10:o<=n?5:a<=n?2:1)}function tickStep(e,t,n){var n=Math.abs(t-e)/Math.max(0,n),r=Math.pow(10,Math.floor(Math.log(n)/Math.LN10)),n=n/r;return i<=n?r*=10:o<=n?r*=5:a<=n&&(r*=2),tr&&--t,o=new Array(i=t-e+1);++sr&&--t,o=new Array(i=t-e+1);++ss[l](...e):"function"==typeof i[A]&&(e=i[A].bind(n))),e&&(n[A]=e,r[A]=e)}}(e,{extension:n,target:e.luma,target2:e})}(e,g.b),function installOverrides(n,{target:r,target2:i}){Object.keys(g.a).forEach(e=>{var t;"function"==typeof g.a[e]&&(t=n[e]?n[e].bind(n):()=>{},t=g.a[e].bind(null,n,t),r[e]=t,i[e]=t)})}(e,{target:t,target2:e}),t.polyfilled=!0),e}}.call(this,r(59))},function(e,r,i){"use strict";!function(e,t){var n=i(75),n=(Object.defineProperty(r,"__esModule",{value:!0}),r.console=r.process=r.document=r.global=r.window=r.self=void 0,n(i(220))),e={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===t?"undefined":(0,n.default)(t))&&t},n=(r.self=e.self||e.window||e.global,e.window||e.self||e.global),t=(r.window=n,e.global||e.self||e.window),n=(r.global=t,e.document||{}),t=(r.document=n,e.process||{}),n=(r.process=t,console);r.console=n}.call(this,i(59),i(97))},function(e,i,o){"use strict";!function(e){var t=o(75),n=(Object.defineProperty(i,"__esModule",{value:!0}),i.default=isBrowser,i.isBrowserMainThread=function isBrowserMainThread(){return isBrowser()&&"undefined"!=typeof document},t(o(220))),r=t(o(394));function isBrowser(){return!("object"===(void 0===e?"undefined":(0,n.default)(e))&&"[object process]"===String(e)&&!e.browser)||(0,r.default)()}}.call(this,o(97))},function(e,t,n){"use strict";n=n(196);t.a={name:"project32",dependencies:[n.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},function(e,t,n){"use strict";n=n(1074);t.a={inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}},...n.a}},function(e,t,n){"use strict";n.d(t,"a",function(){return Tesselator});var A=n(92),r=n(122),l=n(68),g=n(62);class Tesselator{constructor(e={}){var{attributes:t={}}=e;this.typedArrayManager=r.a,this.indexStarts=null,this.vertexStarts=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=t,this.opts=e,this.updateGeometry(e),Object.seal(this)}updateGeometry(e){Object.assign(this.opts,e);const{data:t,buffers:n={},getGeometry:r,geometryBuffer:i,positionFormat:o,dataChanged:a,normalize:s=!0}=this.opts;if(this.data=t,this.getGeometry=r,this.positionSize=i&&i.size||("XY"===o?2:3),this.buffers=n,this.normalize=s,i&&(Object(l.a)(t.startIndices),this.getGeometry=this.getGeometryFromBuffer(i),s||(n.positions=i)),this.geometryBuffer=n.positions,Array.isArray(a))for(const A of a)this._rebuildGeometry(A);else this._rebuildGeometry()}updatePartialGeometry({startRow:e,endRow:t}){this._rebuildGeometry({startRow:e,endRow:t})}normalizeGeometry(e){return e}updateGeometryAttributes(e,t,n){throw new Error("Not implemented")}getGeometrySize(e){throw new Error("Not implemented")}getGeometryFromBuffer(e){var t=e.value||e;return Object(l.a)(ArrayBuffer.isView(t)),Object(A.b)(t,{size:this.positionSize,offset:e.offset,stride:e.stride,startIndices:this.data.startIndices})}_allocate(e,t){const{attributes:n,buffers:r,_attributeDefs:i,typedArrayManager:o}=this;for(const a in i)if(a in r)o.release(n[a]),n[a]=null;else{const s=i[a];s.copy=t,n[a]=o.allocate(n[a],e,s)}}_forEachGeometry(e,t,n){const{data:r,getGeometry:i}=this,{iterable:o,objectInfo:a}=Object(A.a)(r,t,n);for(const s of o)a.index++,e(i(s,a),a.index)}_rebuildGeometry(e){if(this.data&&this.getGeometry){let{indexStarts:r,vertexStarts:i,instanceCount:o}=this;var t,{data:n,geometryBuffer:a}=this,{startRow:s=0,endRow:A=1/0}=e||{};const l={},c=(e||(r=[0],i=[0]),o=this.normalize||!a?(this._forEachGeometry((e,t)=>{e=this.normalizeGeometry(e),l[t]=e,i[t+1]=i[t]+this.getGeometrySize(e)},s,A),i[i.length-1]):a.buffer instanceof g.a?(t=a.stride||4*this.positionSize,(i=n.startIndices)[n.length]||a.buffer.byteLength/t):(t=a.value||a,a=a.stride/t.BYTES_PER_ELEMENT||this.positionSize,(i=n.startIndices)[n.length]||t.length/a),this._allocate(o,Boolean(e)),this.indexStarts=r,this.vertexStarts=i,this.instanceCount=o,{});this._forEachGeometry((e,t)=>{e=l[t]||e,c.vertexStart=i[t],c.indexStart=r[t];var n=t0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const n={handle:e,priority:0,getPriority:t};t=new Promise(e=>(n.resolve=e,n));return this.requestQueue.push(n),this.requestMap.set(e,t),this._issueNewRequests(),t}_issueRequest(e){const{handle:t,resolve:n}=e;let r=!1;e=()=>{r||(r=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:e}):Promise.resolve({done:e})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;ee.priority-t.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return LayerExtension});var r=n(136);class LayerExtension{constructor(e={}){this.opts=e}equals(e){return this===e||this.constructor===e.constructor&&Object(r.a)(this.opts,e.opts)}getShaders(e){return null}getSubLayerProps(e){var t,n,{defaultProps:r={}}=e.constructor;const i={updateTriggers:{}};for(const o in r)o in this.props&&(t=r[o],n=this.props[o],i[o]=n,t&&"accessor"===t.type&&(i.updateTriggers[o]=this.props.updateTriggers[o],"function"==typeof n&&(i[o]=this.getSubLayerAccessor(n,!0))));return i}initializeState(e,t){}updateState(e,t){}draw(e,t){}finalizeState(e){}}},function(e,t,n){"use strict";n.d(t,"a",function(){return PolygonLayer});var t=n(450),r=n(28),h=n(92),R=n(239),F=n(240),p=n(281),i=n(358);const D=[0,0,0,255];n={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:e=>e.polygon},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:D},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};class PolygonLayer extends t.a{initializeState(){this.state={paths:[]},this.props.getLineDashArray&&r.a.removed("getLineDashArray","PathStyleExtension")()}updateState({changeFlags:e}){var t=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(t&&Array.isArray(e.dataChanged)){const n=this.state.paths.slice();e=e.dataChanged.map(e=>Object(i.a)({data:n,getIndex:e=>e.__source.index,dataRange:e,replace:this._getPaths(e)}));this.setState({paths:n,pathsDiff:e})}else t&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(e={}){const{data:t,getPolygon:n,positionFormat:r,_normalize:i}=this.props,o=[];var a="XY"===r?2:3,{startRow:e,endRow:s}=e;const{iterable:A,objectInfo:l}=Object(h.a)(t,e,s);for(const u of A){l.index++;let e=n(u,l);var c=(e=i?p.b(e,a):e)["holeIndices"];const d=e.positions||e;if(c)for(let e=0;e<=c.length;e++){var g=d.slice(c[e-1]||0,c[e]||d.length);o.push(this.getSubLayerRow({path:g},u,l.index))}else o.push(this.getSubLayerRow({path:d},u,l.index))}return o}renderLayers(){var{data:e,_dataDiff:t,stroked:n,filled:r,extruded:i,wireframe:o,_normalize:a,_windingOrder:s,elevationScale:A,transitions:l,positionFormat:c}=this.props,{lineWidthUnits:g,lineWidthScale:u,lineWidthMinPixels:d,lineWidthMaxPixels:h,lineJointRounded:p,lineMiterLimit:f,lineDashJustified:I}=this.props,{getFillColor:C,getLineColor:m,getLineWidth:y,getLineDashArray:B,getElevation:b,getPolygon:v,updateTriggers:E,material:Q}=this.props;const{paths:w,pathsDiff:S}=this.state,_=this.getSubLayerClass("fill",R.a),x=this.getSubLayerClass("stroke",F.a);t=this.shouldRenderSubLayer("fill",w)&&new _({_dataDiff:t,extruded:i,elevationScale:A,filled:r,wireframe:o,_normalize:a,_windingOrder:s,getElevation:b,getFillColor:C,getLineColor:i&&o?m:D,material:Q,transitions:l},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:E.getPolygon,getElevation:E.getElevation,getFillColor:E.getFillColor,lineColors:i&&o,getLineColor:E.getLineColor}}),{data:e,positionFormat:c,getPolygon:v});return[!i&&t,!i&&n&&this.shouldRenderSubLayer("stroke",w)&&new x({_dataDiff:S&&(()=>S),widthUnits:g,widthScale:u,widthMinPixels:d,widthMaxPixels:h,jointRounded:p,miterLimit:f,dashJustified:I,_pathType:"loop",transitions:l&&{getWidth:l.getLineWidth,getColor:l.getLineColor,getPath:l.getPolygon},getColor:this.getSubLayerAccessor(m),getWidth:this.getSubLayerAccessor(y),getDashArray:this.getSubLayerAccessor(B)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:E.getLineWidth,getColor:E.getLineColor,getDashArray:E.getLineDashArray}}),{data:w,positionFormat:c,getPath:e=>e.path}),i&&t]}}PolygonLayer.layerName="PolygonLayer",PolygonLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return OrthographicView});var t=n(112),r=n(76),l=n(12),i=n(36),o=n(49),a=n(332);const c=(new l.Matrix4).lookAt({eye:[0,0,1]});class OrthographicViewport extends r.a{constructor(e){var{width:t,height:n,near:r=.1,far:i=1e3,zoom:o=0,target:a=[0,0,0],flipY:s=!0}=e,A=Math.pow(2,o);super({...e,longitude:null,position:a,viewMatrix:c.clone().scale([A,A*(s?-1:1),A]),projectionMatrix:function getProjectionMatrix({width:e,height:t,near:n,far:r}){return e=e||1,t=t||1,(new l.Matrix4).ortho({left:-e/2,right:e/2,bottom:-t/2,top:t/2,near:n,far:r})}({width:t,height:n,near:r,far:i}),zoom:o})}panByPosition(e,t){t=Object(i.p)(t,this.pixelUnprojectionMatrix),e=o.a([],e,o.d([],t));return{target:o.a([],this.center,e)}}}class OrthographicView extends t.a{constructor(e){super({...e,type:OrthographicViewport})}get controller(){return this._getControllerProps({type:a.a})}}OrthographicView.displayName="OrthographicView"},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,A=(1<>1,c=-7,g=n?i-1:0,u=n?-1:1,i=e[t+g];for(g+=u,o=i&(1<<-c)-1,i>>=-c,c+=s;0>=-c,c+=r;0>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,u=r?0:o-1,d=r?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-a))<1&&(a--,r*=2),2<=(t+=1<=a+c?g/r:g*Math.pow(2,1-c))*r&&(a++,r/=2),l<=a+c?(s=0,a=l):1<=a+c?(s=(t*r-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));8<=i;e[n+u]=255&s,u+=d,s/=256,i-=8);for(a=a<r;){if(o-r>600){var s=o-r+1,A=n-r+1,l=Math.log(s),c=.5*Math.exp(2*l/3),g=.5*Math.sqrt(l*c*(s-c)/s)*(A-s/2<0?-1:1),u=Math.max(r,Math.floor(n-A*c/s+g)),d=Math.min(o,Math.floor(n+(s-A)*c/s+g));t(e,n,u,d,a)}var h=e[n],p=r,f=o;for(i(e,r,n),a(e[o],h)>0&&i(e,r,o);p0;)f--}0===a(e[r],h)?i(e,r,f):i(e,++f,o),f<=n&&(r=f+1),n<=f&&(o=f-1)}}(e,t,r||0,o||e.length-1,a||n)}function i(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function p(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!c(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=p(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(e,t){this.data=p([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,a,s,A,l,c=1/0,g=1/0,u=t;u<=n-t;u++){var d=h(e,0,u,this.toBBox),p=h(e,u,n,this.toBBox),I=(i=d,o=p,a=void 0,s=void 0,A=void 0,l=void 0,a=Math.max(i.minX,o.minX),s=Math.max(i.minY,o.minY),A=Math.min(i.maxX,o.maxX),l=Math.min(i.maxY,o.maxY),Math.max(0,A-a)*Math.max(0,l-s)),C=f(d)+f(p);I=t;g--){var d=e.children[g];o(s,e.leaf?i(d):d),A+=u(s)}return A},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)o(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():a(e[t],this.toBBox)},r}()},function(e,t,n){"use strict";var r=Array.prototype.slice,i=n(519),o=Object.keys,a=o?function keys(e){return o(e)}:n(767),s=Object.keys;a.shim=function shimObjectKeys(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function keys(e){return i(e)?s(r.call(e)):s(e)}):Object.keys=a,Object.keys||a},e.exports=a},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function isArguments(e){var t=r.call(e);return"[object Arguments]"===t||"[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&0<=e.length&&"[object Function]"===r.call(e.callee)}},function(e,t,n){"use strict";var r,u=SyntaxError,i=Function,d=TypeError,o=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(e){h=null}function TF5(){throw new d}var a=h?function(){try{return TF5}catch(e){try{return h(arguments,"callee").get}catch(e){return TF5}}}():TF5,s=n(521)(),A=Object.getPrototypeOf||function(e){return e.__proto__},l={},c="undefined"==typeof Uint8Array?r:A(Uint8Array),p={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":s?A([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":l,"%AsyncGenerator%":l,"%AsyncGeneratorFunction%":l,"%AsyncIteratorPrototype%":l,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":l,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":s?A(A([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&s?A((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&s?A((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":s?A(""[Symbol.iterator]()):r,"%Symbol%":s?Symbol:r,"%SyntaxError%":u,"%ThrowTypeError%":a,"%TypedArray%":c,"%TypeError%":d,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},g=function doEval(e){var t,n;return"%AsyncFunction%"===e?t=o("async function () {}"):"%GeneratorFunction%"===e?t=o("function* () {}"):"%AsyncGeneratorFunction%"===e?t=o("async function* () {}"):"%AsyncGenerator%"===e?(n=doEval("%AsyncGeneratorFunction%"))&&(t=n.prototype):"%AsyncIteratorPrototype%"===e&&(n=doEval("%AsyncGenerator%"))&&(t=A(n.prototype)),p[e]=t},f={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},s=n(411),I=n(774),C=s.call(Function.call,Array.prototype.concat),m=s.call(Function.apply,Array.prototype.splice),y=s.call(Function.call,String.prototype.replace),B=s.call(Function.call,String.prototype.slice),b=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,v=/\\(\\)?/g,E=function stringToPath(e){var t=B(e,0,1),n=B(e,-1);if("%"===t&&"%"!==n)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var i=[];return y(e,b,function(e,t,n,r){i[i.length]=n?y(r,v,"$1"):t||e}),i},Q=function getBaseIntrinsic(e,t){var n,r=e;if(I(f,r)&&(r="%"+(n=f[r])[0]+"%"),I(p,r)){var i=p[r];if(void 0!==(i=i===l?g(r):i)||t)return{alias:n,name:r,value:i};throw new d("intrinsic "+e+" exists, but is not available. Please file an issue!")}throw new u("intrinsic "+e+" does not exist!")};e.exports=function GetIntrinsic(e,t){if("string"!=typeof e||0===e.length)throw new d("intrinsic name must be a non-empty string");if(1=n.length?(A=!!(g=h(o,l)))&&"get"in g&&!("originalValue"in g.get)?g.get:o[l]:(A=I(o,l),o[l]),A&&!a&&(p[c]=o)}}return o}},function(r,e,i){"use strict";!function(e){var t=e.Symbol,n=i(772);r.exports=function hasNativeSymbols(){return"function"==typeof t&&("function"==typeof Symbol&&("symbol"==typeof t("foo")&&("symbol"==typeof Symbol("bar")&&n())))}}.call(this,i(59))},function(e,t,n){"use strict";function dH5(e){return e!=e}e.exports=function is(e,t){return 0===e&&0===t?1/e==1/t:e===t||!(!dH5(e)||!dH5(t))}},function(e,t,n){"use strict";var r=n(522);e.exports=function getPolyfill(){return"function"==typeof Object.is?Object.is:r}},function(e,t,n){"use strict";var r=Object,i=TypeError;e.exports=function flags(){if(null!=this&&this!==r(this))throw new i("RegExp.prototype.flags getter called on non-object");var e="";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e}},function(e,t,n){"use strict";var r=n(524),i=n(262).supportsDescriptors,o=Object.getOwnPropertyDescriptor,a=TypeError;e.exports=function getPolyfill(){if(!i)throw new a("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if("gim"===/a/gim.flags){var e=o(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof/a/.dotAll)return e.get}return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_STYLE=t.MAX_ARROWS=t.DEFAULT_ARROWS=t.ArrowStyles=void 0;var r={NONE:0,FORWARD:1,BACKWARD:2,BOTH:3},r=(t.ArrowStyles=r,t.DEFAULT_ARROWS=1,t.MAX_ARROWS=3,{arrowColor:[0,0,0,1],arrowCount:1,arrowStyle:r.NONE,fillColor:[0,0,0,1],lineColor:[0,0,0,1],lineWidthMeters:5,outlineRadiusMeters:0,opacity:1,zLevel:0});t.DEFAULT_STYLE=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SELECTION_TYPE=void 0;var s=n(55),A=n(6),r=_interopRequireDefault(n(73)),i=_interopRequireDefault(n(223)),l=_interopRequireDefault(n(448)),c=_interopRequireDefault(n(309)),g=_interopRequireDefault(n(57));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||_unsupportedIterableToArray(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ni&&!o.warned&&(o.warned=!0,(r=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=e,r.type=t,r.count=o.length,function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}(r))),e}function _onceWrap(e,t,n){e={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},t=function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e);return t.listener=n,e.wrapFn=t}function _listeners(e,t,n){e=e._events;if(void 0===e)return[];e=e[t];return void 0===e?[]:"function"==typeof e?n?[e.listener||e]:[e]:n?function unwrapListeners(e){for(var t=new Array(e.length),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nr[1])&&(r=t),t=(0,A.default)(e,n),i=Math.max(i,t)),n=e}),r&&[r[0],r[1]+i/1e3]),o=(0,c.lineString)([r,t]),t=(0,c.point)(t,{guideType:"editHandle",editHandleType:"rotate"});return(0,c.featureCollection)([(0,h.default)(e),t,o])}},{key:"handleDragging",value:function handleDragging(e,t){var n;this._isRotating&&((n=this.getRotateAction(e.pointerDownMapCoords,e.mapCoords,"rotating",t))&&t.onEdit(n),e.cancelPan())}},{key:"handlePointerMove",value:function handlePointerMove(e,t){this._isRotating||(e=(0,r.getPickedEditHandle)(e.picks),this._selectedEditHandle=e&&"rotate"===e.properties.editHandleType?e:null),this.updateCursor(t)}},{key:"handleStartDragging",value:function handleStartDragging(e,t){this._selectedEditHandle&&(this._isRotating=!0,this._geometryBeingRotated=this.getSelectedFeaturesAsFeatureCollection(t))}},{key:"handleStopDragging",value:function handleStopDragging(e,t){this._isRotating&&((e=this.getRotateAction(e.pointerDownMapCoords,e.mapCoords,"rotated",t))&&t.onEdit(e),this._geometryBeingRotated=null,this._selectedEditHandle=null,this._isRotating=!1)}},{key:"updateCursor",value:function updateCursor(e){this._selectedEditHandle?e.onUpdateCursor("crosshair"):e.onUpdateCursor(null)}},{key:"getRotateAction",value:function getRotateAction(e,t,n,r){if(!this._geometryBeingRotated)return null;for(var i=(0,g.default)(this._geometryBeingRotated),e=function getRotationAngle(e,t,n){t=(0,u.default)(e,t);return(0,u.default)(e,n)-t}(i,e,t),o=(0,d.default)(this._geometryBeingRotated,e,{pivot:i}),a=new f.ImmutableFeatureCollection(r.data),s=r.selectedIndexes,A=0;Ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}(this._modes);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push.apply(n,_toConsumableArray(i.getGuides(e).features))}}catch(e){r.e(e)}finally{r.f()}return{type:"FeatureCollection",features:n}}}]),CompositeMode}();t.CompositeMode=n},function(e,t,n){"use strict";n.r(t);var I=n(6),C=n(151),m=n(451),y=n(15);function getTanDeg(e){e=e*Math.PI/180;return Math.tan(e)}t.default=function ellipse(e,t,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",a=r.angle||0,s=r.pivot||e,A=r.properties||e.properties||{};if(!e)throw new Error("center is required");if(!t)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!Object(I.isObject)(r))throw new Error("options must be an object");if(!Object(I.isNumber)(i))throw new Error("steps must be a number");if(!Object(I.isNumber)(a))throw new Error("angle must be a number");for(var l,c=Object(y.getCoord)(e),g=("degrees"===o?l=Object(I.degreesToRadians)(a):(t=Object(C.a)(e,t,90,{units:o}),n=Object(C.a)(e,n,0,{units:o}),t=Object(y.getCoord)(t)[0]-c[0],n=Object(y.getCoord)(n)[1]-c[1]),[]),u=0;u=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.x&&(n=Math.min(n,e.x)),e.y>t.y&&(r=Math.min(r,e.y))}),Number.isFinite(n)&&(t.w=n-t.x),Number.isFinite(r)&&(t.h=r-t.y)),i||(t.w=o,t.h=a),t}),2),g=i[0],i=i[1];i&&(e={w:i.w,h:i.h,x:i.x,y:i.y,static:!0,i:e},d.props.onResize(g,r,i,e,n,t),d.setState({layout:c?g:(0,B.compact)(g,(0,B.compactType)(d.props),A),activeDrag:e}))}),_defineProperty(_assertThisInitialized(d),"onResizeStop",function(e,t,n,r){var i=r.e,r=r.node,o=d.state,a=o.layout,o=o.oldResizeItem,s=d.props,A=s.cols,s=s.allowOverlap,e=(0,B.getLayoutItem)(a,e),o=(d.props.onResizeStop(a,o,e,null,i,r),s?a:(0,B.compact)(a,(0,B.compactType)(d.props),A)),e=d.state.oldLayout;d.setState({activeDrag:null,layout:o,oldResizeItem:null,oldLayout:null}),d.onLayoutMaybeChanged(o,e)}),_defineProperty(_assertThisInitialized(d),"onDragOver",function(e){if(e.preventDefault(),e.stopPropagation(),f&&(null==(t=e.nativeEvent.target)||!t.classList.contains(p)))return!1;var t=d.props,n=t.droppingItem,r=t.onDropDragOver,i=t.margin,o=t.cols,a=t.rowHeight,s=t.maxRows,A=t.width,l=t.containerPadding,t=t.transformScale,r=null==r?void 0:r(e);if(!1===r)return d.state.droppingDOMNode&&d.removeDroppingPlaceholder(),!1;var c,n=_objectSpread(_objectSpread({},n),r),r=d.state.layout,g=e.nativeEvent,u=g.layerX,g=g.layerY,t={left:u/t,top:g/t,e:e};d.state.droppingDOMNode?d.state.droppingPosition&&(c=(e=d.state.droppingPosition).left,e=e.top,c==u&&e==g||d.setState({droppingPosition:t})):(c=(0,h.calcXY)({cols:o,margin:i,maxRows:s,rowHeight:a,containerWidth:A,containerPadding:l||i},g,u,n.w,n.h),d.setState({droppingDOMNode:y.createElement("div",{key:n.i}),droppingPosition:t,layout:[].concat(_toConsumableArray(r),[_objectSpread(_objectSpread({},n),{},{x:c.x,y:c.y,static:!1,isDraggable:!0})])}))}),_defineProperty(_assertThisInitialized(d),"removeDroppingPlaceholder",function(){var e=d.props,t=e.droppingItem,e=e.cols,n=d.state.layout,n=(0,B.compact)(n.filter(function(e){return e.i!==t.i}),(0,B.compactType)(d.props),e);d.setState({layout:n,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),_defineProperty(_assertThisInitialized(d),"onDragLeave",function(e){e.preventDefault(),d.dragEnterCounter--,0===d.dragEnterCounter&&d.removeDroppingPlaceholder()}),_defineProperty(_assertThisInitialized(d),"onDragEnter",function(e){e.preventDefault(),d.dragEnterCounter++}),_defineProperty(_assertThisInitialized(d),"onDrop",function(e){e.preventDefault();var t=d.props.droppingItem,n=d.state.layout,r=n.find(function(e){return e.i===t.i});d.dragEnterCounter=0,d.removeDroppingPlaceholder(),d.props.onDrop(n,r,e)}),d}return function _createClass(e,t,n){t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n)}(ReactGridLayout,[{key:"componentDidMount",value:function componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(e,t){return this.props.children!==e.children||!(0,B.fastRGLPropsEqual)(this.props,e,i.default)||this.state.activeDrag!==t.activeDrag||this.state.mounted!==t.mounted||this.state.droppingPosition!==t.droppingPosition}},{key:"componentDidUpdate",value:function componentDidUpdate(e,t){var n;this.state.activeDrag||(n=this.state.layout,t=t.layout,this.onLayoutMaybeChanged(n,t))}},{key:"containerHeight",value:function containerHeight(){var e,t;if(this.props.autoSize)return e=(0,B.bottom)(this.state.layout),t=(this.props.containerPadding||this.props.margin)[1],e*this.props.rowHeight+(e-1)*this.props.margin[1]+2*t+"px"}},{key:"onLayoutMaybeChanged",value:function onLayoutMaybeChanged(e,t){t=t||this.state.layout,(0,i.default)(t,e)||this.props.onLayoutChange(e)}},{key:"placeholder",value:function placeholder(){var e=this.state.activeDrag;if(!e)return null;var t=this.props,n=t.width,r=t.cols,i=t.margin,o=t.containerPadding,a=t.rowHeight,s=t.maxRows,A=t.useCSSTransforms,t=t.transformScale;return y.createElement(b.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:"react-grid-placeholder",containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:A,transformScale:t},y.createElement("div",null))}},{key:"processGridItem",value:function processGridItem(e,t){if(e&&e.key){var n=(0,B.getLayoutItem)(this.state.layout,String(e.key));if(!n)return null;var r=this.props,i=r.width,o=r.cols,a=r.margin,s=r.containerPadding,A=r.rowHeight,l=r.maxRows,c=r.isDraggable,g=r.isResizable,u=r.isBounded,d=r.useCSSTransforms,h=r.transformScale,p=r.draggableCancel,f=r.draggableHandle,I=r.resizeHandles,r=r.resizeHandle,C=this.state,m=C.mounted,C=C.droppingPosition,c="boolean"==typeof n.isDraggable?n.isDraggable:!n.static&&c,g="boolean"==typeof n.isResizable?n.isResizable:!n.static&&g,I=n.resizeHandles||I,u=c&&u&&!1!==n.isBounded;return y.createElement(b.default,{containerWidth:i,cols:o,margin:a,containerPadding:s||a,maxRows:l,rowHeight:A,cancel:p,handle:f,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:c,isResizable:g,isBounded:u,useCSSTransforms:d&&m,usePercentages:!m,transformScale:h,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:t?C:void 0,resizeHandles:I,resizeHandle:r},e)}}},{key:"render",value:function render(){var t=this,e=this.props,n=e.className,r=e.style,i=e.isDroppable,e=e.innerRef,n=(0,o.default)(p,n),r=_objectSpread({height:this.containerHeight()},r);return y.createElement("div",{ref:e,className:n,style:r,onDrop:i?this.onDrop:B.noop,onDragLeave:i?this.onDragLeave:B.noop,onDragEnter:i?this.onDragEnter:B.noop,onDragOver:i?this.onDragOver:B.noop},y.Children.map(this.props.children,function(e){return t.processGridItem(e)}),i&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(e,t){var n;return t.activeDrag?null:((0,i.default)(e.layout,t.propsLayout)&&e.compactType===t.compactType?(0,B.childrenEqual)(e.children,t.children)||(n=t.layout):n=e.layout,n?{layout:(0,B.synchronizeLayoutWithChildren)(n,e.children,e.cols,(0,B.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}}]),ReactGridLayout}();_defineProperty(t.default=r,"displayName","ReactGridLayout"),_defineProperty(r,"propTypes",n.default),_defineProperty(r,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:B.noop,onDragStart:B.noop,onDrag:B.noop,onDragStop:B.noop,onResizeStart:B.noop,onResize:B.noop,onResizeStop:B.noop,onDrop:B.noop,onDropDragOver:B.noop})},function(e,t,n){"use strict";function calcGridColWidth(e){var t=e.margin,n=e.containerPadding,r=e.containerWidth,e=e.cols;return(r-t[0]*(e-1)-2*n[0])/e}function calcGridItemWHPx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function clamp(e,t,n){return Math.max(Math.min(e,n),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.calcGridColWidth=calcGridColWidth,t.calcGridItemWHPx=calcGridItemWHPx,t.calcGridItemPosition=function calcGridItemPosition(e,t,n,r,i,o){var a=e.margin,s=e.containerPadding,A=e.rowHeight,e=calcGridColWidth(e),l={};o&&o.resizing?(l.width=Math.round(o.resizing.width),l.height=Math.round(o.resizing.height)):(l.width=calcGridItemWHPx(r,e,a[0]),l.height=calcGridItemWHPx(i,A,a[1]));o&&o.dragging?(l.top=Math.round(o.dragging.top),l.left=Math.round(o.dragging.left)):(l.top=Math.round((A+a[1])*n+s[1]),l.left=Math.round((e+a[0])*t+s[0]));return l},t.calcXY=function calcXY(e,t,n,r,i){var o=e.margin,a=e.cols,s=e.rowHeight,A=e.maxRows,e=calcGridColWidth(e),n=Math.round((n-o[0])/(e+o[0])),e=Math.round((t-o[1])/(s+o[1]));return n=clamp(n,0,a-r),e=clamp(e,0,A-i),{x:n,y:e}},t.calcWH=function calcWH(e,t,n,r,i){var o=e.margin,a=e.maxRows,s=e.cols,A=e.rowHeight,e=calcGridColWidth(e),t=Math.round((t+o[0])/(e+o[0])),e=Math.round((n+o[1])/(A+o[1]));return t=clamp(t,0,s-r),e=clamp(e,0,a-i),{w:t,h:e}},t.clamp=clamp},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundPosition=function getBoundPosition(e,t,n){if(!e.props.bounds)return[t,n];var r=e.props.bounds,e=(r="string"==typeof r?r:function cloneBounds(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(r),findDOMNode(e));if("string"==typeof r){var i=e.ownerDocument,o=i.defaultView;if(!((i="parent"===r?e.parentNode:i.querySelector(r))instanceof o.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');var a=o.getComputedStyle(e),o=o.getComputedStyle(i);r={left:-e.offsetLeft+(0,s.int)(o.paddingLeft)+(0,s.int)(a.marginLeft),top:-e.offsetTop+(0,s.int)(o.paddingTop)+(0,s.int)(a.marginTop),right:(0,A.innerWidth)(i)-(0,A.outerWidth)(e)-e.offsetLeft+(0,s.int)(o.paddingRight)-(0,s.int)(a.marginRight),bottom:(0,A.innerHeight)(i)-(0,A.outerHeight)(e)-e.offsetTop+(0,s.int)(o.paddingBottom)-(0,s.int)(a.marginBottom)}}(0,s.isNum)(r.right)&&(t=Math.min(t,r.right));(0,s.isNum)(r.bottom)&&(n=Math.min(n,r.bottom));(0,s.isNum)(r.left)&&(t=Math.max(t,r.left));(0,s.isNum)(r.top)&&(n=Math.max(n,r.top));return[t,n]},t.snapToGrid=function snapToGrid(e,t,n){t=Math.round(t/e[0])*e[0],n=Math.round(n/e[1])*e[1];return[t,n]},t.canDragX=function canDragX(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function canDragY(e){return"both"===e.props.axis||"y"===e.props.axis},t.getControlPosition=function getControlPosition(e,t,n){var r="number"==typeof t?(0,A.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;t=findDOMNode(n),t=n.props.offsetParent||t.offsetParent||t.ownerDocument.body;return(0,A.offsetXYFromParent)(r||e,t,n.props.scale)},t.createCoreData=function createCoreData(e,t,n){var r=e.state,i=!(0,s.isNum)(r.lastX),e=findDOMNode(e);return i?{node:e,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:e,deltaX:t-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:t,y:n}},t.createDraggableData=function createDraggableData(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}};var s=n(314),A=n(422);function findDOMNode(e){e=e.findDOMNode();if(e)return e;throw new Error(": Unmounted during event!")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function log(){}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var n,r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e){var o;"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((o=i?Object.getOwnPropertyDescriptor(e,n):null)&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n])}r.default=e,t&&t.set(e,r);return r}(n(0)),s=n(421),A=n(843),n=n(548),l=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?n:t})(e)}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;tMath.abs(a*n)?t=e/n:e=t*n);var o=e,a=t,n=this.slack||[0,0],s=n[0],n=n[1];return e+=s,t+=n,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[s+(o-e),n+(a-t)],[e,t]},e.resizeHandler=function resizeHandler(l,c){var g=this;return function(e,t){var n,r,i,o=t.node,a=t.deltaX,t=t.deltaY,s=("onResizeStart"===l&&g.resetData(),("both"===g.props.axis||"x"===g.props.axis)&&"n"!==c&&"s"!==c),A=("both"===g.props.axis||"y"===g.props.axis)&&"e"!==c&&"w"!==c;(s||A)&&(n=c[0],i=c[c.length-1],r=o.getBoundingClientRect(),null!=g.lastHandleRect&&("w"===i&&(a+=r.left-g.lastHandleRect.left),"n"===n&&(t+=r.top-g.lastHandleRect.top)),g.lastHandleRect=r,"w"===i&&(a=-a),"n"===n&&(t=-t),r=g.props.width+(s?a/g.props.transformScale:0),i=g.props.height+(A?t/g.props.transformScale:0),r=(n=g.runConstraints(r,i))[0],i=n[1],s=r!==g.props.width||i!==g.props.height,(a="function"==typeof g.props[l]?g.props[l]:null)&&("onResize"!==l||s)&&(null!=e.persist&&e.persist(),a(e,{node:o,size:{width:r,height:i},handle:c})),"onResizeStop"===l&&g.resetData())}},e.renderResizeHandle=function renderResizeHandle(e,t){var n=this.props.handle;if(!n)return a.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:t});if("function"==typeof n)return n(e,t);t=_objectSpread({ref:t},"string"==typeof n.type?{}:{handleAxis:e});return a.cloneElement(n,t)},e.render=function render(){var n=this,e=this.props,t=e.children,r=e.className,i=e.draggableOpts,o=(e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart,e.resizeHandles),e=(e.transformScale,function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};for(var n,r={},i=Object.keys(e),o=0;oe[a]&&(r=a)}return r},t.getColsFromBreakpoint=function getColsFromBreakpoint(e,t){if(t[e])return t[e];throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!")},t.findOrGenerateResponsiveLayout=function findOrGenerateResponsiveLayout(e,t,n,r,i,o){if(e[n])return(0,g.cloneLayout)(e[n]);for(var a=e[r],r=sortBreakpoints(t),s=r.slice(r.indexOf(n)),A=0,l=s.length;A",v=C?">":"<",E=void 0;if(!f&&"number"!=typeof g&&void 0!==g)throw new Error(t+" must be number");if(!B&&void 0!==y&&"number"!=typeof y&&"boolean"!=typeof y)throw new Error(m+" must be number or boolean");B?(c=e.util.getData(y.$data,c,e.dataPathArr),o="exclIsNumber"+l,a="' + "+(s="op"+l)+" + '",E=m,(Q=Q||[]).push(A=A+(" var schemaExcl"+l+" = "+c+"; ")+(" var "+(r="exclusive"+l)+"; var "+(i="exclType"+l)+" = typeof "+(c="schemaExcl"+l)+"; if ("+i+" != 'boolean' && "+i+" != 'undefined' && "+i+" != 'number') { ")),A="",!1!==e.createErrors?(A+=" { keyword: '"+(E||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",!1!==e.opts.messages&&(A+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(A+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),A+=" } "):A+=" {} ",w=A,A=Q.pop(),!e.compositeRule&&h?e.async?A+=" throw new ValidationError(["+w+"]); ":A+=" validate.errors = ["+w+"]; return false; ":A+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",A+=" } else if ( ",f&&(A+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),A+=" "+i+" == 'number' ? ( ("+r+" = "+I+" === undefined || "+c+" "+b+"= "+I+") ? "+p+" "+v+"= "+c+" : "+p+" "+v+" "+I+" ) : ( ("+r+" = "+c+" === true) ? "+p+" "+v+"= "+I+" : "+p+" "+v+" "+I+" ) || "+p+" !== "+p+") { var op"+l+" = "+r+" ? '"+b+"' : '"+b+"='; ",void 0===g&&(d=e.errSchemaPath+"/"+(E=m),I=c,f=B)):(a=b,(o="number"==typeof y)&&f?(s="'"+a+"'",A+=" if ( ",f&&(A+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),A+=" ( "+I+" === undefined || "+y+" "+b+"= "+I+" ? "+p+" "+v+"= "+y+" : "+p+" "+v+" "+I+" ) || "+p+" !== "+p+") { "):(o&&void 0===g?(r=!0,d=e.errSchemaPath+"/"+(E=m),I=y,v+="="):(o&&(I=Math[C?"min":"max"](y,g)),y===(!o||I)?(r=!0,d=e.errSchemaPath+"/"+(E=m),v+="="):(r=!1,a+="=")),s="'"+a+"'",A+=" if ( ",f&&(A+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),A+=" "+p+" "+v+" "+I+" || "+p+" !== "+p+") { ")),E=E||t;(Q=Q||[]).push(A),A="",!1!==e.createErrors?(A+=" { keyword: '"+(E||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { comparison: "+s+", limit: "+I+", exclusive: "+r+" } ",!1!==e.opts.messages&&(A=A+" , message: 'should be "+a+" "+(f?"' + "+I:I+"'")),e.opts.verbose&&(A=(A+=" , schema: ")+(f?"validate.schema"+u:""+g)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),A+=" } "):A+=" {} ";var Q,w=A;return A=Q.pop(),!e.compositeRule&&h?e.async?A+=" throw new ValidationError(["+w+"]); ":A+=" validate.errors = ["+w+"]; return false; ":A+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",A+=" } ",h&&(A+=" else { "),A}},function(e,t,n){"use strict";e.exports=function generate__limitItems(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),A=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),g=e.opts.$data&&a&&a.$data,o=g?(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ","schema"+i):a;if(!g&&"number"!=typeof a)throw new Error(t+" must be number");r+="if ( ",g&&(r+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");var i=t,u=[],i=(u.push(r+=" "+c+".length "+("maxItems"==t?">":"<")+" "+o+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(A)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT have ")+("maxItems"==t?"more":"fewer")+" than ")+(g?"' + "+o+" + '":""+a)+" items' "),e.opts.verbose&&(r=(r+=" , schema: ")+(g?"validate.schema"+s:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r),r=u.pop();return!e.compositeRule&&l?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",l&&(r+=" else { "),r}},function(e,t,n){"use strict";e.exports=function generate__limitLength(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),A=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),g=e.opts.$data&&a&&a.$data,o=g?(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ","schema"+i):a;if(!g&&"number"!=typeof a)throw new Error(t+" must be number");r+="if ( ",g&&(r+=" ("+o+" !== undefined && typeof "+o+" != 'number') || "),!1===e.opts.unicode?r+=" "+c+".length ":r+=" ucs2length("+c+") ";var i=t,u=[],i=(u.push(r+=" "+("maxLength"==t?">":"<")+" "+o+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(A)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT be ")+("maxLength"==t?"longer":"shorter")+" than ")+(g?"' + "+o+" + '":""+a)+" characters' "),e.opts.verbose&&(r=(r+=" , schema: ")+(g?"validate.schema"+s:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r),r=u.pop();return!e.compositeRule&&l?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",l&&(r+=" else { "),r}},function(e,t,n){"use strict";e.exports=function generate__limitProperties(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),A=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),g=e.opts.$data&&a&&a.$data,o=g?(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ","schema"+i):a;if(!g&&"number"!=typeof a)throw new Error(t+" must be number");r+="if ( ",g&&(r+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");var i=t,u=[],i=(u.push(r+=" Object.keys("+c+").length "+("maxProperties"==t?">":"<")+" "+o+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(A)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT have ")+("maxProperties"==t?"more":"fewer")+" than ")+(g?"' + "+o+" + '":""+a)+" properties' "),e.opts.verbose&&(r=(r+=" , schema: ")+(g?"validate.schema"+s:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r),r=u.pop();return!e.compositeRule&&l?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",l&&(r+=" else { "),r}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e,t,n){var i=n(559),o=n(304),a=Object.prototype.hasOwnProperty;e.exports=function assignValue(e,t,n){var r=e[t];a.call(e,t)&&o(r,n)&&(void 0!==n||t in e)||i(e,t,n)}},function(e,t,n){var r=n(560);e.exports=function baseAssignValue(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(189),n=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},function(e,t,n){var r=n(403),i=n(426),o=n(404),n=n(512),a=Object.getOwnPropertySymbols;e.exports=a?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:n},function(e,t){e.exports=function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ni;)!a(r,n=t[i++])||~A(o,n)||o.push(n);return o}},function(e,t,n){var r=n(574);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports={default:n(934),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r=_interopRequireDefault(n(936)),i=_interopRequireDefault(n(948)),o="function"==typeof i.default&&"symbol"==typeof r.default?function(e){return typeof e}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof i.default&&"symbol"===o(r.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}},function(e,t,n){"use strict";function q6g(){return this}var f=n(319),I=n(227),C=n(578),m=n(228),y=n(437),B=n(940),b=n(439),v=n(943),E=n(231)("iterator"),Q=!([].keys&&"next"in[].keys()),w="values";e.exports=function(e,t,n,r,i,o,a){B(n,t,r);function y6g(e){if(!Q&&e in g)return g[e];switch(e){case"keys":return function keys(){return new n(this,e)};case w:return function values(){return new n(this,e)}}return function entries(){return new n(this,e)}}var s,A,r=t+" Iterator",l=i==w,c=!1,g=e.prototype,u=g[E]||g["@@iterator"]||i&&g[i],d=u||y6g(i),h=i?l?y6g("entries"):d:void 0,p="Array"==t&&g.entries||u;if(p&&(p=v(p.call(new e)))!==Object.prototype&&p.next&&(b(p,r,!0),f||"function"==typeof p[E]||m(p,E,q6g)),l&&u&&u.name!==w&&(c=!0,d=function values(){return u.call(this)}),f&&!a||!Q&&!c&&g[E]||m(g,E,d),y[t]=d,y[r]=q6g,i)if(s={values:l?d:y6g(w),keys:o?d:y6g("keys"),entries:h},a)for(A in s)A in g||C(g,A,s[A]);else I(I.P+I.F*(Q||c),t,s);return s}},function(e,t,n){e.exports=n(228)},function(e,t,n){var r=n(572),i=n(434).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return r(e,i)}},function(e,t,n){var r=n(321),i=n(317),o=n(230),a=n(429),s=n(191),A=n(570),l=Object.getOwnPropertyDescriptor;t.f=n(164)?l:function getOwnPropertyDescriptor(e,t){if(e=o(e),t=a(t,!0),A)try{return l(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(968),i=n(261);e.exports=function baseForOwn(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(143);e.exports=function isStrictComparable(e){return e==e&&!r(e)}},function(e,t){e.exports=function matchesStrictComparable(t,n){return function(e){return null!=e&&(e[t]===n&&(void 0!==n||t in Object(e)))}}},function(e,t,n){var i=n(585),o=n(322);e.exports=function baseGet(e,t){for(var n=0,r=(t=i(t,e)).length;null!=e&&ne.token}};class s2_layer_S2Layer extends e.a{renderLayers(){const{data:e,getS2Token:n}=this.props;var{elevationScale:t,extruded:r,wireframe:i,filled:o,stroked:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:g,lineMiterLimit:u,lineDashJustified:d,getElevation:h,getFillColor:p,getLineColor:f,getLineWidth:I,getLineDashArray:C}=this.props,{updateTriggers:m,material:y}=this.props;const B=this.getSubLayerClass("cell",b.a);return new B({filled:o,wireframe:i,extruded:r,elevationScale:t,stroked:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:g,lineMiterLimit:u,lineDashJustified:d,material:y,getElevation:h,getFillColor:p,getLineColor:f,getLineWidth:I,getLineDashArray:C},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth,getLineDashArray:m.getLineDashArray}}),{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(e,t)=>function getS2Polygon(e){return getGeoBounds(FromHilbertQuadKey(getS2QuadKey(e)))}(n(e,t))})}}s2_layer_S2Layer.layerName="S2Layer",s2_layer_S2Layer.defaultProps=n;var m=t(195);class trips_layer_TripsLayer extends t(240).a{getShaders(){const e=super.getShaders();return e.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},e}initializeState(e){super.initializeState(e);const t=this.getAttributeManager();t.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(e){var{fadeTrail:t,trailLength:n,currentTime:r}=this.props;e.uniforms={...e.uniforms,fadeTrail:t,trailLength:n,currentTime:r},super.draw(e)}}trips_layer_TripsLayer.layerName="TripsLayer",trips_layer_TripsLayer.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var c=t(95),M=t(92),n={...b.a.defaultProps,getHexagons:{type:"accessor",value:e=>e.hexagons}};class h3_cluster_layer_H3ClusterLayer extends e.a{updateState({props:e,changeFlags:t}){if(t.dataChanged||t.updateTriggers&&t.updateTriggers.getHexagons){const{data:r,getHexagons:i}=e,o=[],{iterable:a,objectInfo:s}=Object(M.a)(r);for(const A of a){s.index++;var n=i(A,s);for(const l of Object(c.h3SetToMultiPolygon)(n,!0))o.push(this.getSubLayerRow({polygon:l},A,s.index))}this.setState({polygons:o})}}renderLayers(){var{elevationScale:e,extruded:t,wireframe:n,filled:r,stroked:i,lineWidthScale:o,lineWidthMinPixels:a,lineWidthMaxPixels:s,lineJointRounded:A,lineMiterLimit:l,lineDashJustified:c,material:g,getFillColor:u,getLineColor:d,getLineWidth:h,getLineDashArray:p,getElevation:f,transitions:I,updateTriggers:C}=this.props;const m=this.getSubLayerClass("cluster-region",b.a);return new m({filled:r,wireframe:n,extruded:t,elevationScale:e,stroked:i,lineWidthScale:o,lineWidthMinPixels:a,lineWidthMaxPixels:s,lineJointRounded:A,lineMiterLimit:l,lineDashJustified:c,material:g,transitions:I,getFillColor:this.getSubLayerAccessor(u),getLineColor:this.getSubLayerAccessor(d),getLineWidth:this.getSubLayerAccessor(h),getLineDashArray:this.getSubLayerAccessor(p),getElevation:this.getSubLayerAccessor(f)},this.getSubLayerProps({id:"cluster-region",updateTriggers:C}),{data:this.state.polygons,getPolygon:e=>e.polygon})}}h3_cluster_layer_H3ClusterLayer.defaultProps=n,h3_cluster_layer_H3ClusterLayer.layerName="H3ClusterLayer";var a=t(12),U=t(338);function normalizeLongitudes(e,t){t=void 0===t?e[0][0]:t;for(const r of e){var n=r[0]-t;180e.hexagon},extruded:!0};delete O.getLineDashArray;class h3_hexagon_layer_H3HexagonLayer extends e.a{shouldUpdateState({changeFlags:e}){return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState({props:r,changeFlags:e}){if(e.dataChanged||e.updateTriggers&&e.updateTriggers.getHexagon){let e=-1,t=!1,n=!1;const{iterable:a,objectInfo:s}=Object(M.a)(r.data);for(const A of a){s.index++;var i=r.getHexagon(A,s),o=Object(c.h3GetResolution)(i);if(e<0)e=o;else if(e!==o){n=!0;break}if(Object(c.h3IsPentagon)(i)){t=!0;break}}this.setState({resolution:e,edgeLengthKM:0<=e?Object(c.edgeLength)(e,c.UNITS.km):0,hasMultipleRes:n,hasPentagon:t})}this._updateVertices(this.context.viewport)}_shouldUseHighPrecision(){var{resolution:e,hasPentagon:t,hasMultipleRes:n}=this.state,r=this.context["viewport"];return this.props.highPrecision||r.resolution||n||t||0<=e&&e<=5}_updateVertices(t){if(!this._shouldUseHighPrecision()){var{resolution:n,edgeLengthKM:r,centerHex:i}=this.state;if(!(n<0)){n=this.props.centerHexagon||Object(c.geoToH3)(t.latitude,t.longitude,n);if(i!==n){if(i){i=Object(c.h3Distance)(i,n);if(0<=i&&i*r<10)return}const o=t.distanceScales["unitsPerMeter"];let e=h3ToPolygon(n);var[i,r]=Object(c.h3ToGeo)(n);const[a,s]=t.projectFlat([r,i]);e=e.map(e=>{e=t.projectFlat(e);return[(e[0]-a)/o[0],(e[1]-s)/o[1]]}),this.setState({centerHex:n,vertices:e})}}}}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){var{elevationScale:e,material:t,coverage:n,extruded:r,wireframe:i,stroked:o,filled:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,getFillColor:g,getElevation:u,getLineColor:d,getLineWidth:h,transitions:p,updateTriggers:f}=this.props;return{elevationScale:e,extruded:r,coverage:n,wireframe:i,stroked:o,filled:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,material:t,getElevation:u,getFillColor:g,getLineColor:d,getLineWidth:h,transitions:p,updateTriggers:{getFillColor:f.getFillColor,getElevation:f.getElevation,getLineColor:f.getLineColor,getLineWidth:f.getLineWidth}}}_renderPolygonLayer(){const{data:e,getHexagon:n,updateTriggers:t,coverage:r}=this.props,i=this.getSubLayerClass("hexagon-cell-hifi",b.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function mergeTriggers(e,t){let n;return n=null==e?t:"object"==typeof e?{...e,coverage:t}:{getHexagon:e,coverage:t}}(t.getHexagon,r),new i(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:(e,t)=>{return h3ToPolygon(n(e,t),r,!0)}})}_renderColumnLayer(){var{data:e,getHexagon:t,updateTriggers:n}=this.props;const r=this.getSubLayerClass("hexagon-cell",U.a),i=this._getForwardProps();return i.updateTriggers.getPosition=n.getHexagon,new r(i,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:i.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:function getHexagonCentroid(e,t,n){var e=e(t,n),[t,n]=Object(c.h3ToGeo)(e);return[n,t]}.bind(null,t)})}}h3_hexagon_layer_H3HexagonLayer.defaultProps=O,h3_hexagon_layer_H3HexagonLayer.layerName="H3HexagonLayer";var L=t(114),g=t(22),P=t(606),V=t(601),Z=t(630),W=t(1161),H=t(370),j=t(607);class mesh_layer_MeshLayer extends j.a{getShaders(){var e=super.getShaders();const t=e.modules;return t.push(W.a),{...e,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool u_pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec2 uv = fract(texCoords) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n\n geometry.uv = uv;\n geometry.uv = texCoords;\n\n if (u_pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * normals);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){var e=this.props["featureIds"];super.initializeState(),e&&this.state.attributeManager.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),e.pbrMaterial!==t.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(e){var t=this.props["featureIds"];this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,u_pickFeatureIds:Boolean(t)}),super.draw(e))}getModel(e){var{id:t,pbrMaterial:n}=this.props,n=this.parseMaterial(n,e),r=this.getShaders(),t=(!function validateGeometryAttributes(e){e.COLOR_0||e.colors||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),e.uvRegions||(e.uvRegions={constant:!0,value:new Float32Array([0,0,1,1])})}(e.attributes),new H.a(this.context.gl,{...this.getShaders(),id:t,geometry:e,defines:{...r.defines,...null==n?void 0:n.defines},parameters:null==n?void 0:n.parameters,isInstanced:!0}));return t}updatePbrMaterialUniforms(e){const t=this.state["model"];var n;t&&(n=this.props["mesh"],e=this.parseMaterial(e,n),t.setUniforms(e.uniforms))}parseMaterial(e,t){var n=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return new Z.a(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:{unlit:n,...e},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(e){var t=this.props["featureIds"];const n=new Uint8ClampedArray(t.length*e.size);var r=[];for(let e=0;ee),q=new Q.a;function fromCartographic(e,t,n=X){return Object(I.m)(e)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=n(e.longitude),t[1]=n(e.latitude),t[2]=e.height):(t[0]=n(e.x),t[1]=n(e.y),t[2]=e.z),t}function toCartographic(e,t,n=X){return Object(I.m)(t)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=n(e[0]),t.latitude=n(e[1]),t.height=e[2]):(t.x=n(e[0]),t.y=n(e[1]),t.z=e[2]),t}const $=new Q.a,ee=new Q.a,te=new Q.a;const ne=new Q.a,re={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ie={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},C={east:new Q.a,north:new Q.a,up:new Q.a,west:new Q.a,south:new Q.a,down:new Q.a},oe=new Q.a,ae=new Q.a,se=new Q.a;function localFrameToFixedFrame(e,t,n,r,i,o){var a=re[t]&&re[t][n];Object(f.a)(a&&(!r||r===a));let s,A,l;a=ne.copy(i);if(Object(I.j)(a.x,0,1e-14)&&Object(I.j)(a.y,0,1e-14)){i=Math.sign(a.z);s=oe.fromArray(ie[t]),"east"!==t&&"west"!==t&&s.scale(i),A=ae.fromArray(ie[n]),"east"!==n&&"west"!==n&&A.scale(i),l=se.fromArray(ie[r]),"east"!==r&&"west"!==r&&l.scale(i)}else{const{up:c,east:g,north:u}=C,{down:d,west:h,south:p}=(g.set(-a.y,a.x,0).normalize(),e.geodeticSurfaceNormal(a,c),u.copy(c).cross(g),C);d.copy(c).scale(-1),h.copy(g).scale(-1),p.copy(u).scale(-1),s=C[t],A=C[n],l=C[r]}return o[0]=s.x,o[1]=s.y,o[2]=s.z,o[3]=0,o[4]=A.x,o[5]=A.y,o[6]=A.z,o[7]=0,o[8]=l.x,o[9]=l.y,o[10]=l.z,o[11]=0,o[12]=a.x,o[13]=a.y,o[14]=a.z,o[15]=1,o}const Ae=new Q.a,le=new Q.a,ce=new Q.a,l=new Q.a,ge=new Q.a,ue=new Q.a;let de;class ellipsoid_Ellipsoid{static get WGS84(){return de=de||new ellipsoid_Ellipsoid(r,s,A)}constructor(e=0,t=0,n=0){Object(f.a)(0<=e),Object(f.a)(0<=t),Object(f.a)(0<=n),this.radii=new Q.a(e,t,n),this.radiiSquared=new Q.a(e*e,t*t,n*n),this.radiiToTheFourth=new Q.a(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new Q.a(0===e?0:1/e,0===t?0:1/t,0===n?0:1/n),this.oneOverRadiiSquared=new Q.a(0===e?0:1/(e*e),0===t?0:1/(t*t),0===n?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.centerToleranceSquared=J.a.EPSILON1,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const n=le,r=ce;var[,,i]=e,e=(this.geodeticSurfaceNormalCartographic(e,n),r.copy(this.radiiSquared).scale(n),Math.sqrt(n.dot(r)));return r.scale(1/e),n.scale(i),r.add(n),r.to(t)}cartesianToCartographic(e,t=[0,0,0]){ue.from(e);e=this.scaleToGeodeticSurface(ue,l);if(e){var n=this.geodeticSurfaceNormal(e,le);const r=ge;return r.copy(ue).subtract(e),function toCartographicFromRadians(e,t){return toCartographic(e,t,I.f._cartographicRadians?X:I.r)}([Math.atan2(n.y,n.x),Math.asin(n.z),Math.sign(K.e(r,ue))*K.h(r)],t)}}eastNorthUpToFixedFrame(e,t=new y.a){return localFrameToFixedFrame(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,n,r,i=new y.a){return localFrameToFixedFrame(this,e,t,n,r,i)}geocentricSurfaceNormal(e,t=[0,0,0]){return Ae.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){var e=function fromCartographicToRadians(e,t=q){return fromCartographic(e,t,I.f._cartographicRadians?X:I.s)}(e),n=e[0],e=e[1],r=Math.cos(e);return Ae.set(r*Math.cos(n),r*Math.sin(n),Math.sin(e)).normalize(),Ae.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return Ae.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function scaleToGeodeticSurface(o,e,a=new Q.a){var{oneOverRadii:e,oneOverRadiiSquared:s,centerToleranceSquared:A}=e,l=($.from(o),o.x),t=o.y,n=o.z,c=e.x,r=e.y,e=e.z,g=l*l*c*c,u=t*t*r*r,d=n*n*e*e,l=g+u+d,c=Math.sqrt(1/l);if(Number.isFinite(c)){const v=ee;if(v.copy(o).scale(c),lJ.a.EPSILON12);return $.scale([n,r,i]).to(a)}}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){l.from(e);var e=l.x,n=l.y,r=l.z,i=this.oneOverRadiiSquared,e=1/Math.sqrt(e*e*i.x+n*n*i.y+r*r*i.z);return l.multiplyScalar(e).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return l.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return l.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){Object(f.a)(Object(I.j)(this.radii.x,this.radii.y,J.a.EPSILON15)),Object(f.a)(0=this.radii.z-t))return l.set(0,0,e).to(n)}}var he=t(284),u=t(199),pe=t(56),fe=t(501);class DoublyLinkedListNode{constructor(e,t,n){this.item=e,this.previous=t,this.next=n}}class doubly_linked_list_DoublyLinkedList{constructor(){this.head=null,this.tail=null,this._length=0}get length(){return this._length}add(e){e=new DoublyLinkedListNode(e,this.tail,null);return this.tail?this.tail.next=e:this.head=e,this.tail=e,++this._length,e}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,++this._length}}function defined(e){return null!=e}class tileset_cache_TilesetCache{constructor(){Object(i.a)(this,"_list",void 0),Object(i.a)(this,"_sentinel",void 0),Object(i.a)(this,"_trimTiles",void 0),this._list=new doubly_linked_list_DoublyLinkedList,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){e=e._cacheNode;defined(e)&&this._list.splice(this._sentinel,e)}add(e,t,n){defined(t._cacheNode)||(t._cacheNode=this._list.add(t),n&&n(e,t))}unloadTile(e,t,n){var r=t._cacheNode;defined(r)&&(this._list.remove(r),t._cacheNode=void 0,n&&n(e,t))}unloadTiles(e,t){var n=this._trimTiles,r=(this._trimTiles=!1,this._list),i=1024*e.maximumMemoryUsage*1024,o=this._sentinel;let a=r.head;for(;a!==o&&(e.gpuMemoryUsageInBytes>i||n);){var s=a.item;a=a.next,this.unloadTile(e,s,t)}}trim(){this._trimTiles=!0}}var d=t(63);const Ie=new Q.a,Ce=new Q.a,me=new d.c([new d.e,new d.e,new d.e,new d.e,new d.e,new d.e]);function getFrameState(e,t){var{cameraDirection:n,cameraUp:r,height:i}=e,o=e.distanceScales["metersPerUnit"],a=[e.longitude,e.latitude,0],a=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian(a,new Q.a);const s=ellipsoid_Ellipsoid.WGS84.eastNorthUpToFixedFrame(a);var A=e.unprojectPosition(e.cameraPosition),A=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian(A,new Q.a),n=new Q.a(s.transformAsVector(new Q.a(n).scale(o))).normalize(),r=new Q.a(s.transformAsVector(new Q.a(r).scale(o))).normalize();return function commonSpacePlanesToWGS84(e,t){var n=e.getFrustumPlanes();let r=0;for(const o in n){const a=n[o];var i=a.normal.dot(e.center),i=(Ce.copy(a.normal).scale(a.distance-i).add(e.center),e.unprojectPosition(Ce)),i=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian(i,new Q.a);me.planes[r++].fromPointNormal(i,Ie.copy(t).subtract(i))}}(e,a),{camera:{position:A,direction:n,up:r},viewport:e,height:i,cullingVolume:me,frameNumber:t,sseDenominator:1.15}}const ye=6356752.314245179,Be=new Q.a;function getZoomFromBoundingVolume(e){var{halfAxes:e,radius:t,width:n,height:r}=e;return e?(e=function getObbSize(e){e.getColumn(0,Be);const t=e.getColumn(1),n=e.getColumn(2),r=Be.add(t).add(n),i=r.len();return i}(e),Math.log2(ye/e)):t?Math.log2(ye/t):r&&n?(Math.log2(6378137/n)+Math.log2(6378137/r))/2:1}const h={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},p={ADD:1,REPLACE:2},B={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},v={I3S:"I3S",TILES3D:"TILES3D"},be={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},ve={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};var Ee=t(275),Qe=t(493);function bounding_volume_defined(e){return null!=e}const we=new Q.a,Se=new Q.a,_e=new Q.a;function createBoundingVolume(e,t,n){if(Object(u.a)(e,"3D Tile: boundingVolume must be defined"),e.box)return function createBox(e,t,n){var r=new Q.a(e[0],e[1],e[2]);t.transform(r,r);let i=[];if(10===e.length){var o=e.slice(3,6);const a=new Ee.a,s=(a.fromArray(e,6),new Q.a([1,0,0])),A=new Q.a([0,1,0]),l=new Q.a([0,0,1]);s.transformByQuaternion(a),s.scale(o[0]),A.transformByQuaternion(a),A.scale(o[1]),l.transformByQuaternion(a),l.scale(o[2]),i=[...s.toArray(),...A.toArray(),...l.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];o=t.transformAsVector(i.slice(0,3)),e=t.transformAsVector(i.slice(3,6)),t=t.transformAsVector(i.slice(6,9)),o=new Qe.a([o[0],o[1],o[2],e[0],e[1],e[2],t[0],t[1],t[2]]);if(bounding_volume_defined(n))return n.center=r,n.halfAxes=o,n;return new d.d(r,o)}(e.box,t,n);var r,i,o,a,s,A;if(e.region)return[o,r,A,a,s,i]=e.region,o=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian([Object(I.i)(o),Object(I.i)(a),s],Se),a=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian([Object(I.i)(A),Object(I.i)(r),i],_e),s=(new Q.a).addVectors(o,a).multiplyScalar(.5),A=(new Q.a).subVectors(o,a).len()/2,createSphere([s[0],s[1],s[2],A],new y.a);if(e.sphere)return createSphere(e.sphere,t,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function createSphere(e,t,n){var r=new Q.a(e[0],e[1],e[2]),t=(t.transform(r,r),t.getScale(we)),t=Math.max(Math.max(t[0],t[1]),t[2]),e=e[3]*t;return bounding_volume_defined(n)?(n.center=r,n.radius=e,n):new d.b(r,e)}new Q.a,new Q.a,new y.a,new Q.a,new Q.a,new Q.a;function getDynamicScreenSpaceError(e,t){var n;return e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity?(n=e.dynamicScreenSpaceErrorComputedDensity,e=e.dynamicScreenSpaceErrorFactor,function fog(e,t){return e*=t,1-Math.exp(-e*e)}(t,n)*e):0}const E=6378137,xe=Math.PI/2;function projectVertexToSphere([e,t,n]){var r=Object(I.s)(e),i=Object(I.s)(t),o=1+n/E,a=o*Math.cos(i);return[e=a*Math.cos(r),t=a*Math.sin(r),n=o*Math.sin(i)]}function getDistanceFromLatLon(e,t){var[e,n,r=0]=e,[t,i,o=0]=t,t=projectVertexToSphere([t,i,o]),i=projectVertexToSphere([e,n,r]),o=i[0]-t[0],e=i[1]-t[1],n=i[2]-t[2];return o*o+e*e+n*n}function getI3ScreenSize(e,t){const n=t.viewport;var r=e.header.mbs[1],i=e.header.mbs[0],o=e.header.mbs[2],e=e.header.mbs[3],i=[i,r,o],r=getDistanceFromLatLon(n.unprojectPosition(n.cameraPosition),i),o=e/E,i=r-o*o;return i<=0?170141175e30:function getTanOfHalfVFAngle(e){e=e.viewport.projectionMatrix,e=e[5];return e}(t)*o/Math.sqrt(i)*300}class managed_array_ManagedArray{constructor(e=0){this._array=new Array(e),this._map=new Map,this._length=e}get length(){return this._length}set length(e){(this._length=e)>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return Object(u.a)(e=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){var t=this._map.get(e);0<=t&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){var t;this._map.has(e)||(t=this.length++,this._array[t]=e,this._map.set(e,t))}pop(){var e=this._array[--this.length];return this._map.delete(e),e}reserve(e){Object(u.a)(0<=e),e>this._array.length&&(this._array.length=e)}resize(e){Object(u.a)(0<=e),this.length=e}trim(e){null==e&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const Re={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class tileset_traverser_TilesetTraverser{constructor(e){Object(i.a)(this,"options",void 0),Object(i.a)(this,"root",void 0),Object(i.a)(this,"requestedTiles",void 0),Object(i.a)(this,"selectedTiles",void 0),Object(i.a)(this,"emptyTiles",void 0),Object(i.a)(this,"_traversalStack",void 0),Object(i.a)(this,"_emptyTraversalStack",void 0),Object(i.a)(this,"_frameNumber",void 0),this.options={...Re,...e},this._traversalStack=new managed_array_ManagedArray,this._emptyTraversalStack=new managed_array_ManagedArray,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(e,t,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const n=this._traversalStack;for(e._selectionDepth=1,n.push(e);0this.options.maximumScreenSpaceError}updateTileVisibility(e,t){const n=[];if(this.options.viewportTraversersMap)for(const r in this.options.viewportTraversersMap)this.options.viewportTraversersMap[r]===t.viewport.id&&n.push(r);else n.push(t.viewport.id);e.updateVisibility(t,n)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let n=!1;for(const r of e.children)r.updateVisibility(t),n=n||r.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,t){let n=!0;const r=this._emptyTraversalStack;for(r.push(e);0{this._statusMap[t].status=De.COMPLETED,this._statusMap[t].callback(e,r)}).catch(e=>{this._statusMap[t].status=De.ERROR,n(e)}))}update(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}find(e){return this._statusMap[e]}}class i3s_tileset_traverser_I3STilesetTraverser extends tileset_traverser_TilesetTraverser{constructor(e){super(e),Object(i.a)(this,"_tileManager",void 0),this._tileManager=new i3s_tile_manager_I3STileManager}shouldRefine(e,t){return e._lodJudge=function lodJudge(e,t){var n=(s=t.viewport).metersPerPixel,r=e.header.mbs[1],i=e.header.mbs[0],o=e.header.mbs[2],a=e.header.mbs[3],{height:s,width:A,latitude:l,longitude:c}=s,g=[c,l],o=[i,r,o],c=[c,r],r=[i,l],i=Math.sqrt(s*s+A*A)*n[0],l=getDistanceFromLatLon(g,o),n=.5*s+a/E,o=.5*A+a/E;return l>i+a/E||getDistanceFromLatLon(g,c)>n||getDistanceFromLatLon(g,r)>o?"OUT":0===e.lodMetricValue?"DIG":(s=getI3ScreenSize(e,t),(s*=xe)<.5?"OUT":!e.header.children||s<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT")}(e,t),"DIG"===e._lodJudge}updateChildTiles(t,n){var e=t.header.children||[];const r=t.children,i=t.tileset;for(const a of e){const s="".concat(a.id,"-").concat(n.viewport.id);var o=r&&r.find(e=>e.id===s);if(o)this.updateTile(o,n);else{let e=()=>this._loadTile(a.id,i);this._tileManager.find(s)?this._tileManager.update(s,n):(i.tileset.nodePages&&(e=()=>i.tileset.nodePagesTile.formTileFromNodePages(a.id)),this._tileManager.add(e,s,e=>this._onTileLoad(e,t,s),n))}}return!1}async _loadTile(e,t){var n=t["loader"],e=t.getTileUrl("".concat(t.url,"/nodes/").concat(e)),t={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return Object(z.a)(e,n,t)}_onTileLoad(e,t,n){e=new tile_3d_TileHeader(t.tileset,e,t,n),t.children.push(e),n=this._tileManager.find(e.id).frameState;this.updateTile(e,n),this._frameNumber===n.frameNumber&&this.executeTraversal(e,n)}}const Ge={description:"",ellipsoid:ellipsoid_Ellipsoid.WGS84,modelMatrix:new y.a,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Ne="Tiles In Tileset(s)",ke="Tiles In Memory",Te="Tiles In View",Me="Tiles To Render",Ue="Tiles Loaded",Oe="Tiles Loading",Le="Tiles Unloaded",Pe="Failed Tile Loads",Ve="Tile Memory Use";class tileset_3d_Tileset3D{constructor(e,t){Object(i.a)(this,"options",void 0),Object(i.a)(this,"loadOptions",void 0),Object(i.a)(this,"type",void 0),Object(i.a)(this,"tileset",void 0),Object(i.a)(this,"loader",void 0),Object(i.a)(this,"url",void 0),Object(i.a)(this,"basePath",void 0),Object(i.a)(this,"modelMatrix",void 0),Object(i.a)(this,"ellipsoid",void 0),Object(i.a)(this,"lodMetricType",void 0),Object(i.a)(this,"lodMetricValue",void 0),Object(i.a)(this,"refine",void 0),Object(i.a)(this,"root",void 0),Object(i.a)(this,"roots",void 0),Object(i.a)(this,"asset",void 0),Object(i.a)(this,"description",void 0),Object(i.a)(this,"properties",void 0),Object(i.a)(this,"extras",void 0),Object(i.a)(this,"attributions",void 0),Object(i.a)(this,"credits",void 0),Object(i.a)(this,"stats",void 0),Object(i.a)(this,"traverseCounter",void 0),Object(i.a)(this,"geometricError",void 0),Object(i.a)(this,"selectedTiles",void 0),Object(i.a)(this,"cartographicCenter",void 0),Object(i.a)(this,"cartesianCenter",void 0),Object(i.a)(this,"zoom",void 0),Object(i.a)(this,"boundingVolume",void 0),Object(i.a)(this,"gpuMemoryUsageInBytes",void 0),Object(i.a)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Object(i.a)(this,"_traverser",void 0),Object(i.a)(this,"_cache",void 0),Object(i.a)(this,"_requestScheduler",void 0),Object(i.a)(this,"_frameNumber",void 0),Object(i.a)(this,"_queryParamsString",void 0),Object(i.a)(this,"_queryParams",void 0),Object(i.a)(this,"_extensionsUsed",void 0),Object(i.a)(this,"_tiles",void 0),Object(i.a)(this,"_pendingCount",void 0),Object(i.a)(this,"lastUpdatedVieports",void 0),Object(i.a)(this,"_requestedTiles",void 0),Object(i.a)(this,"_emptyTiles",void 0),Object(i.a)(this,"frameStateData",void 0),Object(i.a)(this,"maximumMemoryUsage",void 0),Object(u.a)(e),this.options={...Ge,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||pe.a.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new tileset_cache_TilesetCache,this._requestScheduler=new fe.a({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new he.a({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function getQueryParamString(e){const t=[];for(const n of Object.keys(e))t.push("".concat(n,"=").concat(e[n]));switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(e){this.options={...this.options,...e}}setOptions(e){this.options={...this.options,...e}}getTileUrl(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}hasExtension(e){return Boolean(this._extensionsUsed&&-1e.id)),r=new Set(t.map(e=>e.id));return 0!r.has(e.id)).length||0!n.has(e.id)).length}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount&&(t+=n.content.pointCount));this.stats.get(Te).count=this.selectedTiles.length,this.stats.get(Me).count=e,this.stats.get("Points").count=t}_initializeTileSet(e){this.root=this._initializeTileHeaders(e,null),this.type===v.TILES3D&&this._initializeCesiumTileset(e),this.type===v.I3S&&this._initializeI3STileset(),this._calculateViewProps()}_calculateViewProps(){var e=this.root,t=(Object(u.a)(e),e.boundingVolume)["center"];if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Q.a,void(this.zoom=1);this.cartographicCenter=ellipsoid_Ellipsoid.WGS84.cartesianToCartographic(t,new Q.a),this.cartesianCenter=t,this.zoom=getZoomFromBoundingVolume(e.boundingVolume)}_initializeStats(){this.stats.get(Ne),this.stats.get(Oe),this.stats.get(ke),this.stats.get(Te),this.stats.get(Me),this.stats.get(Ue),this.stats.get(Le),this.stats.get(Pe),this.stats.get("Points","memory"),this.stats.get(Ve,"memory")}_initializeTileHeaders(e,t){const n=new tile_3d_TileHeader(this,e.root,t);if(t&&(t.children.push(n),n.depth=t.depth+1),this.type===v.TILES3D){const r=[];for(r.push(n);0e._updateCacheStats(t))}_updateCacheStats(e){this.stats.get(Ue).incrementCount(),this.stats.get(ke).incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get(Ve).count=this.gpuMemoryUsageInBytes}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get(ke).decrementCount(),this.stats.get(Le).incrementCount(),this.stats.get(Ve).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);0e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Je={SCALAR:(e,t,n)=>{t[n]=e},VEC2:(e,t,n)=>{t[2*n+0]=e[0],t[2*n+1]=e[1]},VEC3:(e,t,n)=>{t[3*n+0]=e[0],t[3*n+1]=e[1],t[3*n+2]=e[2]},VEC4:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT2:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT3:(e,t,n)=>{t[9*n+0]=e[0],t[9*n+1]=e[1],t[9*n+2]=e[2],t[9*n+3]=e[3],t[9*n+4]=e[4],t[9*n+5]=e[5],t[9*n+6]=e[6],t[9*n+7]=e[7],t[9*n+8]=e[8],t[9*n+9]=e[9]},MAT4:(e,t,n)=>{t[16*n+0]=e[0],t[16*n+1]=e[1],t[16*n+2]=e[2],t[16*n+3]=e[3],t[16*n+4]=e[4],t[16*n+5]=e[5],t[16*n+6]=e[6],t[16*n+7]=e[7],t[16*n+8]=e[8],t[16*n+9]=e[9],t[16*n+10]=e[10],t[16*n+11]=e[11],t[16*n+12]=e[12],t[16*n+13]=e[13],t[16*n+14]=e[14],t[16*n+15]=e[15]}};const x=e=>void 0!==e;function initializeHierarchy(e,t,n){if(!t)return null;let r=e.getExtension("3DTILES_batch_table_hierarchy");e=t.HIERARCHY;return e&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=e,r=e),r?function initializeHierarchyValues(e,t){let n,r,i;const o=e.instancesLength,a=e.classes;let s=e.classIds,A=e.parentCounts,l=e.parentIds,c=o;x(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,o));let g;if(x(A))for(x(A.byteOffset)&&(A.componentType=defaultValue(A.componentType,GL.UNSIGNED_SHORT),A.type=AttributeType.SCALAR,i=getBinaryAccessor(A),A=i.createArrayBufferView(t.buffer,t.byteOffset+A.byteOffset,o)),g=new Uint16Array(o),c=0,n=0;ne,Xe={HIERARCHY:!0,extensions:!0,extras:!0};class tile_3d_batch_table_Tile3DBatchTableParser{constructor(e,t,n,r={}){Object(u.a)(0<=n),this.json=e||{},this.binary=t,this.featureCount=n,this._extensions=(null==(e=this.json)?void 0:e.extensions)||{},this._properties={};for(const i in this.json)Xe[i]||(this._properties[i]=this.json[i]);this._binaryProperties=this._initializeBinaryProperties(),r["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=initializeHierarchy(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,n){return this._checkBatchId(e),Object(u.a)("string"==typeof n,n),!!this._hierarchy&&tile_3d_batch_table_defined(traverseHierarchy(this._hierarchy,e,(e,t)=>{t=e.classIds[t];return e.classes[t].name===n}))}isExactClass(e,t){return Object(u.a)("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy)return e=this._hierarchy.classIds[e],this._hierarchy.classes[e].name}hasProperty(e,t){return this._checkBatchId(e),Object(u.a)("string"==typeof t,t),tile_3d_batch_table_defined(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=tile_3d_batch_table_defined(t)?t:[]).length=0;var n=Object.keys(this._properties);return t.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),Object(u.a)("string"==typeof t,t),this._binaryProperties){var n=this._binaryProperties[t];if(tile_3d_batch_table_defined(n))return this._getBinaryProperty(n,e)}n=this._properties[t];if(tile_3d_batch_table_defined(n))return Ke(n[e]);if(this._hierarchy){n=this._getHierarchyProperty(e,t);if(tile_3d_batch_table_defined(n))return n}}setProperty(t,n,r){var i=this.featureCount;if(this._checkBatchId(t),Object(u.a)("string"==typeof n,n),this._binaryProperties){var e=this._binaryProperties[n];if(e)return void this._setBinaryProperty(e,t,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,t,n,r)){let e=this._properties[n];tile_3d_batch_table_defined(e)||(this._properties[n]=new Array(i),e=this._properties[n]),e[t]=r}}_checkBatchId(e){if(!(0<=e&&e{t=e.classIds[t];return tile_3d_batch_table_defined(e.classes[t].instances[n])});return tile_3d_batch_table_defined(e)}_getPropertyNamesInHierarchy(e,i){traverseHierarchy(this._hierarchy,e,(e,t)=>{t=e.classIds[t];const n=e.classes[t].instances;for(const r in n)n.hasOwnProperty(r)&&-1===i.indexOf(r)&&i.push(r)})}_getHierarchyProperty(e,r){return traverseHierarchy(this._hierarchy,e,(e,t)=>{var n=e.classIds[t],n=e.classes[n],e=e.classIndexes[t],t=n.instances[r];return tile_3d_batch_table_defined(t)?tile_3d_batch_table_defined(t.typedArray)?this._getBinaryProperty(t,e):Ke(t[e]):null})}_setHierarchyProperty(e,i,o,a){var t=traverseHierarchy(this._hierarchy,i,(e,t)=>{var n=e.classIds[t],n=e.classes[n],e=e.classIndexes[t];const r=n.instances[o];return!!tile_3d_batch_table_defined(r)&&(Object(u.a)(t===i,'Inherited property "'.concat(o,'" is read-only.')),tile_3d_batch_table_defined(r.typedArray)?this._setBinaryProperty(r,e,a):r[e]=a,!0)});return tile_3d_batch_table_defined(t)}}const qe=4;function parse3DTileHeaderSync(e,t,n=0){const r=new DataView(t);if(e.magic=r.getUint32(n,!0),n+=qe,e.version=r.getUint32(n,!0),n+=qe,e.byteLength=r.getUint32(n,!0),n+=qe,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return n}const R=4,$e="b3dm tile in legacy format.";function parse3DTileTablesHeaderSync(e,t,n){const r=new DataView(t);let i,o=(e.header=e.header||{},r.getUint32(n,!0)),a=(n+=R,r.getUint32(n,!0)),s=(n+=R,r.getUint32(n,!0)),A=(n+=R,r.getUint32(n,!0));return n+=R,570425344<=s?(n-=2*R,i=o,s=a,A=0,o=0,a=0,console.warn($e)):570425344<=A&&(n-=R,i=s,s=o,A=a,o=0,a=0,console.warn($e)),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=a,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=A,e.header.batchLength=i,n}function parse3DTileTablesSync(e,t,n){return n=function parse3DTileBatchTable(e,t,n,r){var{batchTableJsonByteLength:i,batchTableBinaryByteLength:o}=e.header;{var a;0255*e);s[3*e]=o[0],s[3*e+1]=o[1],s[3*e+2]=o[2]}return{type:_.UNSIGNED_BYTE,value:s,size:3,normalized:!0}}if(e){const l=new Uint8ClampedArray(3*i);for(let e=0;e>5&63,r=31&e;return t[0]=(e>>11&31)<<3,t[1]=n<<2,t[2]=r<<3,t}(t[e]);l[3*e]=a[0],l[3*e+1]=a[1],l[3*e+2]=a[2]}return{type:_.UNSIGNED_BYTE,value:l,size:3,normalized:!0}}return t&&t.length===3*i?{type:_.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:_.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}n=t(491);function assert_assert(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new n.a,new Q.a,new n.a,new n.a,new Uint8Array(1);function fromSNorm(e,t=255){return Object(I.d)(e,0,t)/t*2-1}function signNotZero(e){return e<0?-1:1}function octDecodeInRange(e,t,n,r){if(assert_assert(r),e<0||n{},compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:(e,t,n)=>{},compare:!1},_getMeshColor:{type:"function",value:e=>[255,255,255],compare:!1}};class tile_3d_layer_Tile3DLayer extends e.a{initializeState(){"onTileLoadFail"in this.props&&Y.a.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){const e=this.state["tileset3d"];return e&&e.isLoaded()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(e.data&&e.data!==t.data&&this._loadTileset(e.data),n.viewportChanged&&(t=this.state["activeViewports"],Object.keys(t).length&&(this._updateTileset(t),this.state.lastUpdatedViewports=t,this.state.activeViewports={})),n.propsChanged){const r=this.state["layerMap"];for(const i in r)r[i].needsUpdate=!0}}activateViewport(e){const{activeViewports:t,lastUpdatedViewports:n}=this.state;this.internalState.viewport=e,t[e.id]=e;var r=null==n?void 0:n[e.id];r&&e.equals(r)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:e,sourceLayer:t}){var n=this.state["layerMap"];const r=t&&t.id;if(r){const i=r.substring(this.id.length+1);t=i.substring(i.indexOf("-")+1);e.object=n[t]&&n[t].tile}return e}filterSubLayer({layer:e,viewport:t}){const n=e.props["tile"];e=t.id;return this.props.visible&&n.selected&&n.viewportIds.includes(e)}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}async _loadTileset(e){var{loadOptions:t={}}=this.props;let n=this.props.loader||this.props.loaders;Array.isArray(n)&&(n=n[0]);const r={loadOptions:{...t}};n.preload&&((t=await n.preload(e,t)).headers&&(r.loadOptions.fetch={...r.loadOptions.fetch,headers:t.headers}),Object.assign(r,t));t=await Object(z.a)(e,n,r.loadOptions),e=new tileset_3d_Tileset3D(t,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError,...r});this.setState({tileset3d:e,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(e)}_onTileLoad(e){var t=this.state["lastUpdatedViewports"];this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}_onTileUnload(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}_updateTileset(e){const t=this.state["tileset3d"];var n=this.context["timeline"],r=Object.keys(e).length;n&&r&&t&&(n=t.update(Object.values(e)),this.state.frameNumber!==n&&this.setState({frameNumber:n}))}_getSubLayer(e,t){if(!e.content)return null;switch(e.type){case B.POINTCLOUD:return this._makePointCloudLayer(e,t);case B.SCENEGRAPH:return this._make3DModelLayer(e,t);case B.MESH:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}_makePointCloudLayer(e,t){var{attributes:n,pointCount:r,constantRGBA:i,cartographicOrigin:o,modelMatrix:a}=e.content,{positions:n,normals:s,colors:A}=n;if(!n)return null;var t=t&&t.props.data||{header:{vertexCount:r},attributes:{POSITION:n,NORMAL:s,COLOR_0:A}},{pointSize:r,getPointColor:n}=this.props;const l=this.getSubLayerClass("pointcloud",P.a);return new l({pointSize:r},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:t,coordinateSystem:g.a.METER_OFFSETS,coordinateOrigin:o,modelMatrix:a,getColor:i||n,_offset:0})}_make3DModelLayer(e){var{gltf:t,instances:n,cartographicOrigin:r,modelMatrix:i}=e.content;const o=this.getSubLayerClass("scenegraph",V.a);return new o({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||ot,scenegraph:t,coordinateSystem:g.a.METER_OFFSETS,coordinateOrigin:r,modelMatrix:i,getTransformMatrix:e=>e.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(e,t){var{attributes:n,indices:r,modelMatrix:i,cartographicOrigin:o,material:a,featureIds:s}=e.content;const A=this.props["_getMeshColor"];t=t&&t.props.mesh||new L.a({drawMode:4,attributes:function getMeshGeometry(e){const t={};t.positions={...e.positions,value:new Float32Array(e.positions.value)},e.normals&&(t.normals=e.normals);e.texCoords&&(t.texCoords=e.texCoords);e.colors&&(t.colors=e.colors);e.uvRegions&&(t.uvRegions=e.uvRegions);return t}(n),indices:r});const l=this.getSubLayerClass("mesh",mesh_layer_MeshLayer);return new l(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:t,data:ot,getColor:A(e),pbrMaterial:a,modelMatrix:i,coordinateOrigin:o,coordinateSystem:g.a.METER_OFFSETS,featureIds:s,_offset:0})}renderLayers(){const{tileset3d:e,layerMap:r}=this.state;return e?e.tiles.map(e=>{const t=r[e.id]=r[e.id]||{tile:e};let n=t["layer"];return e.selected&&(n?t.needsUpdate&&(n=this._getSubLayer(e,n),t.needsUpdate=!1):n=this._getSubLayer(e)),t.layer=n}).filter(Boolean):null}}tile_3d_layer_Tile3DLayer.layerName="Tile3DLayer",tile_3d_layer_Tile3DLayer.defaultProps=n;var at=t(233),n={name:"Terrain",id:"terrain",module:"terrain",version:"3.0.13",worker:!0,extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}},F=t(94);const st=[1];n={...m.a.defaultProps,elevationData:F.f,texture:{...F.f,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0,loaders:[n]};function urlTemplateToUpdateTrigger(e){return Array.isArray(e)?e.join(";"):e}class terrain_layer_TerrainLayer extends e.a{updateState({props:e,oldProps:t}){var n=e.elevationData!==t.elevationData;if(n){const i=e["elevationData"];var r=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:r})}r=n||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;!this.state.isTiled&&r&&(n=this.loadTerrain(e),this.setState({terrain:n})),e.workerUrl&&Y.a.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:n,meshMaxError:r,signal:i}){var o;if(!e)return null;var a={...a=this.getLoadOptions(),terrain:{skirtHeight:this.state.isTiled?2*r:0,...null==(o=a)?void 0:o.terrain,bounds:t,meshMaxError:r,elevationDecoder:n}};const s=this.props["fetch"];return s(e,{propName:"elevationData",layer:this,loadOptions:a,signal:i})}getTiledTerrainData(e){const{elevationData:t,fetch:n,texture:r,elevationDecoder:i,meshMaxError:o}=this.props;var a=Object(F.b)(t,e),s=Object(F.b)(r,e),{bbox:e,signal:A,z:l}=e;const c=new at.a({longitude:(e.west+e.east)/2,latitude:(e.north+e.south)/2,zoom:l});l=c.projectFlat([e.west,e.south]),e=c.projectFlat([e.east,e.north]),l=[l[0],l[1],e[0],e[1]],e=this.loadTerrain({elevationData:a,bounds:l,elevationDecoder:i,meshMaxError:o,signal:A}),a=s?n(s,{propName:"texture",layer:this,loaders:[],signal:A}).catch(e=>null):Promise.resolve(null);return Promise.all([e,a])}renderSubLayers(e){const t=this.getSubLayerClass("mesh",j.a);var{data:n,color:r}=e;if(!n)return null;var[n,i]=n;return new t(e,{data:st,mesh:n,texture:i,coordinateSystem:g.a.CARTESIAN,getPosition:e=>[0,0,0],getColor:r})}onViewportLoad(e){if(e){var t,n=this.state["zRange"];const r=e.map(e=>e.content).filter(Boolean).map(e=>{const t=e[0].header.boundingBox;return t.map(e=>e[2])});0!==r.length&&(e=Math.min(...r.map(e=>e[0])),t=Math.max(...r.map(e=>e[1])),(!n||en[1])&&this.setState({zRange:[e,t]}))}}renderLayers(){var{color:e,material:t,elevationData:n,texture:r,wireframe:i,meshMaxError:o,elevationDecoder:a,tileSize:s,maxZoom:A,minZoom:l,extent:c,maxRequests:g,onTileLoad:u,onTileUnload:d,onTileError:h,maxCacheSize:p,maxCacheByteSize:f,refinementStrategy:I}=this.props;if(this.state.isTiled)return new m.a(this.getSubLayerProps({id:"tiles"}),{wireframe:i,color:e,material:t,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:urlTemplateToUpdateTrigger(n),texture:urlTemplateToUpdateTrigger(r),meshMaxError:o,elevationDecoder:a}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:s,maxZoom:A,minZoom:l,extent:c,maxRequests:g,onTileLoad:u,onTileUnload:d,onTileError:h,maxCacheSize:p,maxCacheByteSize:f,refinementStrategy:I});const C=this.getSubLayerClass("mesh",j.a);return new C(this.getSubLayerProps({id:"mesh"}),{data:st,mesh:this.state.terrain,texture:r,_instanced:!1,getPosition:e=>[0,0,0],getColor:e,material:t,wireframe:i})}}terrain_layer_TerrainLayer.layerName="TerrainLayer",terrain_layer_TerrainLayer.defaultProps=n;t(71);t(458);e={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.0.13",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{coordinates:"local",layerProperty:"layerName",layers:null,tileIndex:null}}};function binaryToGeojson(e,t){var n=null==t?void 0:t.globalFeatureId;return void 0!==n?function getSingleFeature(r,i){var e=normalizeInput(r);for(const r of e){let t=0,n=r.featureIds.value[0];for(let e=0;et<=e&&e<=n),e=2n<=e&&e<=r);const a=t.primitivePolygonIndices.value.filter(e=>n<=e&&e<=r);const e=2LineString(e,t,n))},Polygon:Polygon,MultiPolygon:function MultiPolygon(e,t,n){return e.map(e=>Polygon(e,t,n))}};function Point([e,t],[n,r],i){e=Object(a.lerp)(n[0],r[0],e),n=Object(a.lerp)(n[1],r[1],t);return i.unprojectFlat([e,n])}function getPoints(e,t,n){return e.map(e=>Point(e,t,n))}function LineString(e,t,n){return getPoints(e,t,n)}function Polygon(e,t,n){return e.map(e=>getPoints(e,t,n))}const pt=["points","lines","polygons"];function findIndexBinary(e,t,n,r){for(const o of pt){var i=e[o]&&function findIndexByType(e,t,n,r){const i=e.featureIds.value;if(!i.length)return-1;let o=0,a=i[i.length-1]+1;if(r){r=function getLayerRange(e,t){if(!e.__layers){const i={};var n=e["properties"];for(let e=0;ee===n&&i[t]>=o&&i[t]e[t]===n,o,a):findIndex(e.fields,e=>e.id===n,o,a)}return 0<=s?function getGlobalFeatureId(e,t){if(!e.__ids){const i=[];var n=e.featureIds.value,r=e.globalFeatureIds.value;for(let e=0;ee.minZoom&&(t.minZoom=n.minzoom),Number.isFinite(n.maxzoom)&&(!Number.isFinite(e.maxZoom)||n.maxzoom{var t=getFeatureUniqueId(e,r)===A,e=s||getFeatureLayerName(e)===n;return t&&e}):a&&o?findIndexBinary(a,r,A,s?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context;var r=n.width,i=n.height,o=n.x,a=n.y,s=[this.id];return t.pickObjects({x:o,y:a,width:r,height:i,layerIds:s,maxObjects:e})}getRenderedFeatures(e=null){e=this._pickObjects(e);const t=new Set,n=[];for(const i of e){var r=getFeatureUniqueId(i.object,this.props.uniqueIdProperty);void 0===r?n.push(i.object):t.has(r)||(t.add(r),n.push(i.object))}return n}_setWGS84PropertyForTiles(){const e="dataInWGS84",t=this.state["tileset"];t.selectedTiles.forEach(t=>{t.hasOwnProperty(e)||Object.defineProperty(t,e,{get:()=>{if(!t.content)return null;if(this.props.binary&&Array.isArray(t.content)&&!t.content.length)return[];if(void 0===t._contentWGS84){const e=this.props.binary?binaryToGeojson(t.content):t.content;t._contentWGS84=e.map(e=>transformTileCoordsToWGS84(e,t.bbox,this.context.viewport))}return t._contentWGS84}})})}}function getFeatureUniqueId(e,t){return t?e.properties[t]:"id"in e?e.id:void 0}function getFeatureLayerName(e){return(null==(e=e.properties)?void 0:e.layerName)||null}function isFeatureIdDefined(e){return null!=e&&""!==e}function transformTileCoordsToWGS84(e,t,n){var r={...e,geometry:{type:e.geometry.type}};return Object.defineProperty(r.geometry,"coordinates",{get:()=>{return function coordinate_transform_transform(e,t,n){return t=[n.projectFlat([t.west,t.north]),n.projectFlat([t.east,t.south])],{...e,coordinates:ht[e.type](e.coordinates,t,n)}}(e.geometry,t,n).coordinates}}),r}mvt_layer_MVTLayer.layerName="MVTLayer",mvt_layer_MVTLayer.defaultProps=lt},function(R,e,t){"use strict";t.d(e,"a",function(){return deck_Deck});var i=t(341),n=t(136),b=t(28),r=t(119);class view_manager_ViewManager{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){var t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(t){return t?this._viewports.filter(e=>e.containsPixel(t)):this._viewports}getViews(){const t={};return this.views.forEach(e=>{t[e.id]=e}),t}getView(t){return"string"==typeof t?this.views.find(e=>e.id===t):t}getViewState(e){const t=this.getView(e);e=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(e):e}getViewport(e){return this._viewportMap[e]}unproject(t,n){var r=this.getViewports(),i={x:t[0],y:t[1]};for(let e=r.length-1;0<=e;--e){const o=r[e];if(o.containsPixel(i)){const a=t.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,n)}}return null}setProps(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()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=Object(r.b)(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(Object(n.a)(e,this.viewState)||this.setNeedsUpdate("viewState changed"),this.viewState=e):b.a.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(t,e){const n=e.type;return new n({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>t._getViewport(e,{width:e.width,height:e.height}),...e})}_updateController(e,t,n,r){var i=e.controller;return i?(i={...t,...e.props,...i,id:e.id,x:n.x,y:n.y,width:n.width,height:n.height},r?r.setProps(i):r=this._createController(e,i),r):null}_rebuildViewports(){var{width:n,height:r,views:i}=this;const o=this.controllers;this._viewports=[];let a=!(this.controllers={});for(let t=i.length;t--;){const l=i[t];var s=this.getViewState(l),A=l.makeViewport({width:n,height:r,viewState:s});let e=o[l.id];!(a=l.controller&&!e?!0:a)&&l.controller||!e||(e.finalize(),e=null),this.controllers[l.id]=this._updateController(l,s,A,e),this._viewports.unshift(A)}for(const e in o)o[e]&&!this.controllers[e]&&o[e].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(n,r){return n.length!==r.length||n.some((e,t)=>!n[t].equals(r[t]))}}var o=t(333),a=t(274);const s=new a.a;class effect_manager_EffectManager{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(n.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}needsRedraw(e={clearRedrawFlags:!1}){var t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof a.a)||this._internalEffects.push(s)}}var A=t(170),l=t(344),c=t(134),g=t(203),v=t(7),u=t(474),d=t(360);const E={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function getEmptyPickingInfo({pickInfo:e,mode:t,viewports:n,layerFilter:r,pixelRatio:i,x:o,y:a,z:s}){const A=e&&e.pickedLayer;const l=function getViewportFromCoordinates(t,n,r){for(let e=t.length-1;0<=e;e--){const i=t[e];if(i.containsPixel(n)&&(!r||r(i)))return i}return t[0]}(n,{x:o,y:a},r&&A&&(e=>r({layer:A,viewport:e,isPicking:!0,renderPass:"picking:".concat(t)})));n=l&&l.unproject([o-l.x,a-l.y],{targetZ:s});return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:o,y:a,pixel:[o,a],coordinate:n,devicePixel:e&&[e.pickedX,e.pickedY],pixelRatio:i}}function getLayerPickingInfo({layer:e,info:t,mode:n}){for(;e&&t;){var r=t.layer||null;t.sourceLayer=r,t.layer=e,t=e.getPickingInfo({info:t,mode:n,sourceLayer:r}),e=e.parent}return t}class deck_picker_DeckPicker{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new d.a(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:n,viewports:r},i=this.lastPickedInfo.info){const o=i&&i.layer&&i.layer.id,a=i&&i.viewport&&i.viewport.id;n=o?n.find(e=>e.id===o):null;const s=a&&r.find(e=>e.id===a)||r[0];r=s&&s.unproject([e-s.x,t-s.y]),e={x:e,y:t,viewport:s,coordinate:r,layer:n};return n?{...i,...e}:Object.assign(e,{color:null,object:null,index:-1})}_resizeBuffer(){var e=this["gl"];return this.pickingFBO||(this.pickingFBO=new c.a(e),c.a.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new c.a(e),this.depthFBO.attach({[36064]:new g.a(e,{format:Object(v.j)(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(e=>e.isPickable()&&!e.isComposite);return 255t)r+=4*g;else for(let e=0;ee.props.id===d))&&A.unshift(l),n.layerId=c,n.index=s,n.info=null)}const g=getEmptyPickingInfo(e),u=new Map;return u.set(null,g),A.forEach(e=>{let t={...g};e===a&&(t.color=o,t.index=s,t.picked=!0),t=getLayerPickingInfo({layer:e,info:t,mode:r}),e===a&&"hover"===r&&(n.info=t),u.set(t.layer.id,t),"hover"===r&&t.layer.updateAutoHighlight(t)}),u}({pickInfo:m,lastPickedInfo:this.lastPickedInfo,mode:A,layers:n,layerFilter:this.layerFilter,viewports:i,x:o,y:a,z:e,pixelRatio:g})).values())y.layer&&f.push(y);if(!m.pickedColor)break}for(const B in I)n[B].restorePickingColors();return{result:f,emptyInfo:p&&p.get(null)}}_pickVisibleObjects({layers:e,views:t,viewports:n,x:r,y:i,width:o=1,height:a=1,mode:s="query",maxObjects:A=null,onViewportActive:l}){if(!(e=this._getPickable(e)))return[];this._resizeBuffer();var c=Object(v.e)(this.gl),g=Object(v.d)(this.gl,[r,i],!0),u=g.x,g=g.y+g.height,d=Object(v.d)(this.gl,[r+o,i+a],!0),h=d.x+d.width,d=d.y,p=function getUniqueObjects({pickedColors:t,layers:n}){const r=new Map;if(t)for(let e=0;e=A);e++){var C=p[e],m={color:C.pickedColor,layer:null,index:C.pickedObjectIndex,picked:!0,x:r,y:i,width:o,height:a,pixelRatio:c},m=getLayerPickingInfo({layer:C.pickedLayer,info:m,mode:s});f.has(m.object)||f.set(m.object,m)}return Array.from(f.values())}_drawAndSample({layers:e,views:t,viewports:n,onViewportActive:r,deviceRect:i,pass:o,redrawReason:a,pickZ:s}){if(e.length<1)return null;var A=s?this.depthFBO:this.pickingFBO,{x:e,y:t,width:n,height:r}=(this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:n,onViewportActive:r,pickingFBO:A,deviceRect:i,pass:o,redrawReason:a,pickZ:s}),i),o=new(s?Float32Array:Uint8Array)(n*r*4);return Object(u.c)(A,{sourceX:e,sourceY:t,sourceWidth:n,sourceHeight:r,target:o}),o}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:n,deviceWidth:r,deviceHeight:i}){var o=Math.max(0,e-n),a=Math.max(0,t-n),r=Math.min(r,e+n+1)-o,e=Math.min(i,t+n+1)-a;return r<=0||e<=0?null:{x:o,y:a,width:r,height:e}}}const F={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Tooltip{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,F),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,n){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(n,"px)")}remove(){this.el&&this.el.remove()}}var D=t(122),e=t(452),G=t(43),N=t(1160),k=t(1148),T=t(286),M=t(284),h=t(288),h=t.n(h);const U={mousedown:1,mousemove:2,mouseup:4};!function enhancePointerEventInput(e){const n=e.prototype.handler;e.prototype.handler=function handler(t){const e=this.store;0e.pointerId===t.pointerId)&&e.push(t),n.call(this,t)}}(h.a.PointerEventInput),function enhanceMouseInput(e){e.prototype.handler=function handler(e){let t=U[e.type];1&t&&0<=e.button&&(this.pressed=!0),2&t&&0===e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}}(h.a.MouseInput);var O=h.a.Manager,h=h.a;const L=h?[[h.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[h.Rotate,{enable:!1}],[h.Pinch,{enable:!1}],[h.Swipe,{enable:!1}],[h.Pan,{threshold:0,enable:!1}],[h.Press,{enable:!1}],[h.Tap,{event:"doubletap",taps:2,enable:!1}],[h.Tap,{event:"anytap",enable:!1}],[h.Tap,{enable:!1}]]:null,p={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},P={doubletap:["tap"]},V={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"};h={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]};const Z={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},f={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"};var I=t(212);const W=-1!==I.b.indexOf("firefox"),H=h["WHEEL_EVENTS"],C=4.000244140625;class wheel_input_WheelInput{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=H.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!I.a&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(t){if(this.options.enable){let e=t.deltaY;I.c.WheelEvent&&(W&&t.deltaMode===I.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=I.c.devicePixelRatio),t.deltaMode===I.c.WheelEvent.DOM_DELTA_LINE&&(e*=40));var n={x:t.clientX,y:t.clientY};0!==e&&e%C==0&&(e=Math.floor(e/C)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}}_onWheel(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const j=h["MOUSE_EVENTS"],m="pointermove",y="pointerover",B="pointerout",Q="pointerleave";class MoveInput{constructor(t,e,n={}){this.element=t,this.callback=e,this.pressed=!1,this.options=Object.assign({enable:!0},n),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=j.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===m&&(this.enableMoveEvent=t),e===y&&(this.enableOverEvent=t),e===B&&(this.enableOutEvent=t),e===Q&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:y,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:B,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:Q,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":0<=e.button&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:m,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const Y=h["KEY_EVENTS"];class KeyInput{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Y.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=n.tabIndex||0,t.style.outline="none",this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(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}))}}const w="contextmenu";class ContextmenuInput{constructor(e,t,n={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},n),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===w&&(this.options.enable=t)}handleEvent(e){this.options.enable&&this.callback({type:w,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const z={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};const S={srcElement:"root",priority:0};class event_registrar_EventRegistrar{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,n,r=!1,i=!1){const{handlers:o,handlersByElement:a}=this;n=(n=n&&("object"!=typeof n||n.addEventListener)?{srcElement:n}:n)?Object.assign({},S,n):S;let s=a.get(n.srcElement);s||(s=[],a.set(n.srcElement,s));const A={type:e,handler:t,srcElement:n.srcElement,priority:n.priority};r&&(A.once=!0),i&&(A.passive=!0),o.push(A),this._active=this._active||!A.passive;let l=s.length-1;for(;0<=l&&!(s[l].priority>=A.priority);)l--;s.splice(l+1,0,A)}remove(t,n){const{handlers:r,handlersByElement:i}=this;for(let e=r.length-1;0<=e;e--){var o=r[e];if(o.type===t&&o.handler===n){r.splice(e,1);const a=i.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&i.delete(o.srcElement)}}this._active=r.some(e=>!e.passive)}handleEvent(t){if(!this.isEmpty()){var n=this._normalizeEvent(t);let e=t.srcEvent.target;for(;e&&e!==n.rootElement;){if(this._emit(n,e),n.handled)return;e=e.parentNode}this._emit(n,"root")}}_emit(n,e){var r=this.handlersByElement.get(e);if(r){let t=!1;var i=()=>{n.handled=!0},o=()=>{n.handled=!0,t=!0};const A=[];for(let e=0;e{const t=this.manager.get(e);t&&p[e].forEach(e=>{t.recognizeWith(e)})});for(const o in r.recognizerOptions){const a=this.manager.get(o);if(a){const s=r.recognizerOptions[o];delete s.enable,a.set(s)}}this.wheelInput=new wheel_input_WheelInput(e,this._onOtherEvent,{enable:!1}),this.moveInput=new MoveInput(e,this._onOtherEvent,{enable:!1}),this.keyInput=new KeyInput(e,this._onOtherEvent,{enable:!1,tabIndex:r.tabIndex}),this.contextmenuInput=new ContextmenuInput(e,this._onOtherEvent,{enable:!1});for([t,n]of this.events)n.isEmpty()||(this._toggleRecognizer(n.recognizerName,!0),this.manager.on(t,n.handleEvent))}}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,n){this._addEventHandler(e,t,n,!1)}once(e,t,n){this._addEventHandler(e,t,n,!0)}watch(e,t,n){this._addEventHandler(e,t,n,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(n,r){const i=this["manager"];if(i){const o=i.get(n);if(o&&o.options.enable!==r){o.set({enable:r});const e=P[n];e&&!this.options.recognizers&&e.forEach(e=>{const t=i.get(e);r?(t.requireFailure(n),o.dropRequireFailure(e)):t.dropRequireFailure(n)})}this.wheelInput.enableEventType(n,r),this.moveInput.enableEventType(n,r),this.keyInput.enableEventType(n,r),this.contextmenuInput.enableEventType(n,r)}}_addEventHandler(t,n,r,i,o){if("string"!=typeof t){r=n;for(const e in t)this._addEventHandler(e,t[e],r,i,o)}else{const{manager:s,events:A}=this;var a=f[t]||t;let e=A.get(a);e||(e=new event_registrar_EventRegistrar(this),A.set(a,e),e.recognizerName=Z[a]||a,s&&s.on(a,e.handleEvent)),e.add(t,n,r,i,o),e.isEmpty()||this._toggleRecognizer(e.recognizerName,!0)}}_removeEventHandler(e,t){if("string"!=typeof e)for(const i in e)this._removeEventHandler(i,e[i]);else{const o=this["events"];var n=f[e]||e;const a=o.get(n);if(a&&(a.remove(e,t),a.isEmpty())){var r=a["recognizerName"];let e=!1;for(const s of o.values())if(s.recognizerName===r&&!s.isEmpty()){e=!0;break}e||this._toggleRecognizer(r,!1)}}}_onBasicInput(e){var t=e["srcEvent"],t=V[t.type];t&&this.manager.emit(t,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}var K=t(68),_=t(22);function noop(){}const x={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:noop,onResize:noop,onViewStateChange:noop,onInteractionStateChange:noop,onBeforeRender:noop,onAfterRender:noop,onLoad:noop,onError:(e,t)=>b.a.error(e)(),_onMetrics:null,getCursor:({isDragging:e})=>e?"grabbing":"grab",debug:!1,drawPickingColors:!1};class deck_Deck{constructor(e){e={...x,...e},this.props={},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=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&b.a.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===Object(G.getBrowser)()&&b.a.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new M.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&D.a.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&b.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&b.a.removed("onLayerClick","onClick")(),e.initialViewState&&!Object(n.a)(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";var t=this._needsRedraw,n=(e.clearRedrawFlags&&(this._needsRedraw=!1),this.viewManager.needsRedraw(e)),r=this.layerManager.needsRedraw(e),i=this.effectManager.needsRedraw(e),e=this.deckRenderer.needsRedraw(e);return t||n||r||i||e}redraw(e){!this.layerManager||(e=e||this.needsRedraw({clearRedrawFlags:!0}))&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){e=this._pick("pickObject","pickObject Time",e).result;return e.length?e[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const n in e)this.layerManager.resourceManager.add({resourceId:n,data:e[n],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,n){const r=this["stats"];r.get("Pick Count").incrementCount(),r.get(t).timeStart();e=this.deckPicker[e]({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport,...n});return r.get(t).timeEnd(),e}_createCanvas(e){let t=e.canvas;if("string"==typeof t&&(t=document.getElementById(t),Object(K.a)(t)),!t){(t=document.createElement("canvas")).id=e.id||"deckgl-overlay";const n=e.parent||document.body;n.appendChild(t)}return Object.assign(t.style,e.style),t}_setCanvasSize(n){if(this.canvas){let{width:e,height:t}=n;!e&&0!==e||(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),!t&&0!==t||(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.position="absolute",this.canvas.style.height=t)}}_updateCanvasSize(){var e,t;this._checkForCanvasSizeChange()&&({width:e,height:t}=this,this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height}))}_checkForCanvasSizeChange(){var e=this["canvas"];if(!e)return!1;var t=e.clientWidth||e.width,e=e.clientHeight||e.height;return(t!==this.width||e!==this.height)&&(this.width=t,this.height=e,!0)}_createAnimationLoop(e){const{width:t,height:n,gl:r,glOptions:i,debug:o,onError:a,onBeforeRender:s,onAfterRender:A,useDevicePixels:l,autoResizeDrawingBuffer:c}=e;return new N.a({width:t,height:n,useDevicePixels:l,autoResizeDrawingBuffer:c,autoResizeViewport:!1,gl:r,onCreateContext:e=>Object(v.c)({...i,...e,canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()}),onInitialize:e=>this._setGLContext(e.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:s,onAfterRender:A,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new o.a({id:"default-view"})];return(e=Array.isArray(e)?e:[e]).length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const e=this.props["onError"];this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const 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.event=e,t.mode="hover"}_pickAndCallback(){const n=this["_pickRequest"];if(n.event){var{result:r,emptyInfo:i}=this._pick("pickObject","pickObject Time",n);this.interactiveState.isHovering=0e instanceof scenegraph_node_ScenegraphNode),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children;e=t.indexOf(e);return-1e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new a.a}={}){var n=new a.a(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof group_node_GroupNode?r.traverse(e,{worldMatrix:n}):e(r,{worldMatrix:n})}}var g=t(275);const h={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},p={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function accessorToJsArray(e){if(!e._animation){const o=p[e.componentType];var t=h[e.type],n=t*e.count,{buffer:r,byteOffset:i}=e.bufferView.data;const a=new o(r,i+(e.byteOffset||0),n);if(1===t)e._animation=Array.from(a);else{const s=[];for(let e=0;ee>=a),A=Math.max(0,s-1);if(!Array.isArray(i[o]))switch(o){case"translation":i[o]=[0,0,0];break;case"rotation":i[o]=[0,0,0,1];break;case"scale":i[o]=[1,1,1];break;default:u.k.warn("Bad animation path "+o)()}Object(d.a)(i[o].length===r[A].length);var l,c=t[A],g=t[s];switch(n){case"STEP":!function stepInterpolate(t,n,r){for(let e=0;e{interpolate(r,e,t,n),function applyTranslationRotationScale(e,t){var n;t.matrix.identity(),e.translation&&t.matrix.translate(e.translation),e.rotation&&(n=f.fromQuaternion(e.rotation),t.matrix.multiplyRight(n)),e.scale&&t.matrix.scale(e.scale)}(t,t._node)})}}}class GLTFAnimator{constructor(r){this.animations=r.animations.map((e,t)=>{t=e.name||"Animation-"+t;const n=e.samplers.map(({input:e,interpolation:t="LINEAR",output:n})=>({input:accessorToJsArray(r.accessors[e]),interpolation:t,output:accessorToJsArray(r.accessors[n])}));e=e.channels.map(({sampler:e,target:t})=>({sampler:n[e],target:r.nodes[t.node],path:t.path}));return new GLTFAnimation({name:t,channels:e})})}animate(e){this.setTime(e)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}var C=t(370);class model_node_ModelNode extends scenegraph_node_ScenegraphNode{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof C.a?(this.model=e,this._setModelNodeProps(t)):this.model=new C.a(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}var m=t(630);function addVersionToShader(e,t){return Object(u.j)(e)?`#version 300 es +*/var A=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;e.exports=function shouldUseNative(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},r)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var n,r=function toObject(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),i=1;is[l](...e):"function"==typeof i[A]&&(e=i[A].bind(n))),e&&(n[A]=e,r[A]=e)}}(e,{extension:n,target:e.luma,target2:e})}(e,g.b),function installOverrides(n,{target:r,target2:i}){Object.keys(g.a).forEach(e=>{var t;"function"==typeof g.a[e]&&(t=n[e]?n[e].bind(n):()=>{},t=g.a[e].bind(null,n,t),r[e]=t,i[e]=t)})}(e,{target:t,target2:e}),t.polyfilled=!0),e}}.call(this,r(64))},function(e,r,i){"use strict";!function(e,t){var n=i(75),n=(Object.defineProperty(r,"__esModule",{value:!0}),r.console=r.process=r.document=r.global=r.window=r.self=void 0,n(i(224))),e={self:"undefined"!=typeof self&&self,window:"undefined"!=typeof window&&window,global:void 0!==e&&e,document:"undefined"!=typeof document&&document,process:"object"===(void 0===t?"undefined":(0,n.default)(t))&&t},n=(r.self=e.self||e.window||e.global,e.window||e.self||e.global),t=(r.window=n,e.global||e.self||e.window),n=(r.global=t,e.document||{}),t=(r.document=n,e.process||{}),n=(r.process=t,console);r.console=n}.call(this,i(64),i(89))},function(e,i,o){"use strict";!function(e){var t=o(75),n=(Object.defineProperty(i,"__esModule",{value:!0}),i.default=isBrowser,i.isBrowserMainThread=function isBrowserMainThread(){return isBrowser()&&"undefined"!=typeof document},t(o(224))),r=t(o(401));function isBrowser(){return!("object"===(void 0===e?"undefined":(0,n.default)(e))&&"[object process]"===String(e)&&!e.browser)||(0,r.default)()}}.call(this,o(89))},function(e,t,n){"use strict";n=n(201);t.a={name:"project32",dependencies:[n.a],vs:"\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n vec3 projectedPosition = project_position(position, position64Low);\n if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n // offset is specified as ENU\n // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n mat3 rotation = project_get_orientation_matrix(projectedPosition);\n offset = rotation * offset;\n }\n commonPosition = vec4(projectedPosition + offset, 1.0);\n return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n vec3 position, vec3 position64Low, vec3 offset\n) {\n vec4 commonPosition;\n return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},function(e,t,n){"use strict";n=n(1142);t.a={inject:{"vs:DECKGL_FILTER_COLOR":"\n picking_setPickingColor(geometry.pickingColor);\n // for picking depth values\n picking_setPickingAttribute(geometry.position.z);\n ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n // use highlight color if this fragment belongs to the selected object.\n color = picking_filterHighlightColor(color);\n\n // use picking color if rendering to picking FBO.\n color = picking_filterPickingColor(color);\n "}},...n.a}},function(e,t,n){"use strict";n.d(t,"a",function(){return Tesselator});var A=n(94),r=n(125),l=n(69),g=n(62);class Tesselator{constructor(e={}){var{attributes:t={}}=e;this.typedArrayManager=r.a,this.indexStarts=null,this.vertexStarts=null,this.vertexCount=0,this.instanceCount=0,this.attributes={},this._attributeDefs=t,this.opts=e,this.updateGeometry(e),Object.seal(this)}updateGeometry(e){Object.assign(this.opts,e);const{data:t,buffers:n={},getGeometry:r,geometryBuffer:i,positionFormat:o,dataChanged:a,normalize:s=!0}=this.opts;if(this.data=t,this.getGeometry=r,this.positionSize=i&&i.size||("XY"===o?2:3),this.buffers=n,this.normalize=s,i&&(Object(l.a)(t.startIndices),this.getGeometry=this.getGeometryFromBuffer(i),s||(n.positions=i)),this.geometryBuffer=n.positions,Array.isArray(a))for(const A of a)this._rebuildGeometry(A);else this._rebuildGeometry()}updatePartialGeometry({startRow:e,endRow:t}){this._rebuildGeometry({startRow:e,endRow:t})}normalizeGeometry(e){return e}updateGeometryAttributes(e,t,n){throw new Error("Not implemented")}getGeometrySize(e){throw new Error("Not implemented")}getGeometryFromBuffer(e){var t=e.value||e;return Object(l.a)(ArrayBuffer.isView(t)),Object(A.b)(t,{size:this.positionSize,offset:e.offset,stride:e.stride,startIndices:this.data.startIndices})}_allocate(e,t){const{attributes:n,buffers:r,_attributeDefs:i,typedArrayManager:o}=this;for(const a in i)if(a in r)o.release(n[a]),n[a]=null;else{const s=i[a];s.copy=t,n[a]=o.allocate(n[a],e,s)}}_forEachGeometry(e,t,n){const{data:r,getGeometry:i}=this,{iterable:o,objectInfo:a}=Object(A.a)(r,t,n);for(const s of o)a.index++,e(i(s,a),a.index)}_rebuildGeometry(e){if(this.data&&this.getGeometry){let{indexStarts:r,vertexStarts:i,instanceCount:o}=this;var t,{data:n,geometryBuffer:a}=this,{startRow:s=0,endRow:A=1/0}=e||{};const l={},c=(e||(r=[0],i=[0]),o=this.normalize||!a?(this._forEachGeometry((e,t)=>{e=this.normalizeGeometry(e),l[t]=e,i[t+1]=i[t]+this.getGeometrySize(e)},s,A),i[i.length-1]):a.buffer instanceof g.a?(t=a.stride||4*this.positionSize,(i=n.startIndices)[n.length]||a.buffer.byteLength/t):(t=a.value||a,a=a.stride/t.BYTES_PER_ELEMENT||this.positionSize,(i=n.startIndices)[n.length]||t.length/a),this._allocate(o,Boolean(e)),this.indexStarts=r,this.vertexStarts=i,this.instanceCount=o,{});this._forEachGeometry((e,t)=>{e=l[t]||e,c.vertexStart=i[t],c.indexStart=r[t];var n=t0){if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(e))return this.requestMap.get(e);const n={handle:e,priority:0,getPriority:t};t=new Promise(e=>(n.resolve=e,n));return this.requestQueue.push(n),this.requestMap.set(e,t),this._issueNewRequests(),t}_issueRequest(e){const{handle:t,resolve:n}=e;let r=!1;e=()=>{r||(r=!0,this.requestMap.delete(t),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,n?n({done:e}):Promise.resolve({done:e})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout(()=>this._issueNewRequestsAsync(),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;var t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;ee.priority-t.priority)}_updateRequest(e){return e.priority=e.getPriority(e.handle),!(e.priority<0)||(e.resolve(null),!1)}}},function(e,t,n){"use strict";n.d(t,"a",function(){return PolygonLayer});var t=n(461),r=n(28),h=n(94),R=n(245),F=n(246),p=n(287),i=n(365);const D=[0,0,0,255];n={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:e=>e.polygon},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:D},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};class PolygonLayer extends t.a{initializeState(){this.state={paths:[]},this.props.getLineDashArray&&r.a.removed("getLineDashArray","PathStyleExtension")()}updateState({changeFlags:e}){var t=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(t&&Array.isArray(e.dataChanged)){const n=this.state.paths.slice();e=e.dataChanged.map(e=>Object(i.a)({data:n,getIndex:e=>e.__source.index,dataRange:e,replace:this._getPaths(e)}));this.setState({paths:n,pathsDiff:e})}else t&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(e={}){const{data:t,getPolygon:n,positionFormat:r,_normalize:i}=this.props,o=[];var a="XY"===r?2:3,{startRow:e,endRow:s}=e;const{iterable:A,objectInfo:l}=Object(h.a)(t,e,s);for(const u of A){l.index++;let e=n(u,l);var c=(e=i?p.b(e,a):e)["holeIndices"];const d=e.positions||e;if(c)for(let e=0;e<=c.length;e++){var g=d.slice(c[e-1]||0,c[e]||d.length);o.push(this.getSubLayerRow({path:g},u,l.index))}else o.push(this.getSubLayerRow({path:d},u,l.index))}return o}renderLayers(){var{data:e,_dataDiff:t,stroked:n,filled:r,extruded:i,wireframe:o,_normalize:a,_windingOrder:s,elevationScale:A,transitions:l,positionFormat:c}=this.props,{lineWidthUnits:g,lineWidthScale:u,lineWidthMinPixels:d,lineWidthMaxPixels:h,lineJointRounded:p,lineMiterLimit:f,lineDashJustified:I}=this.props,{getFillColor:C,getLineColor:m,getLineWidth:y,getLineDashArray:B,getElevation:b,getPolygon:v,updateTriggers:E,material:Q}=this.props;const{paths:w,pathsDiff:S}=this.state,_=this.getSubLayerClass("fill",R.a),x=this.getSubLayerClass("stroke",F.a);t=this.shouldRenderSubLayer("fill",w)&&new _({_dataDiff:t,extruded:i,elevationScale:A,filled:r,wireframe:o,_normalize:a,_windingOrder:s,getElevation:b,getFillColor:C,getLineColor:i&&o?m:D,material:Q,transitions:l},this.getSubLayerProps({id:"fill",updateTriggers:{getPolygon:E.getPolygon,getElevation:E.getElevation,getFillColor:E.getFillColor,lineColors:i&&o,getLineColor:E.getLineColor}}),{data:e,positionFormat:c,getPolygon:v});return[!i&&t,!i&&n&&this.shouldRenderSubLayer("stroke",w)&&new x({_dataDiff:S&&(()=>S),widthUnits:g,widthScale:u,widthMinPixels:d,widthMaxPixels:h,jointRounded:p,miterLimit:f,dashJustified:I,_pathType:"loop",transitions:l&&{getWidth:l.getLineWidth,getColor:l.getLineColor,getPath:l.getPolygon},getColor:this.getSubLayerAccessor(m),getWidth:this.getSubLayerAccessor(y),getDashArray:this.getSubLayerAccessor(B)},this.getSubLayerProps({id:"stroke",updateTriggers:{getWidth:E.getLineWidth,getColor:E.getLineColor,getDashArray:E.getLineDashArray}}),{data:w,positionFormat:c,getPath:e=>e.path}),i&&t]}}PolygonLayer.layerName="PolygonLayer",PolygonLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return OrthographicView});var t=n(114),r=n(76),l=n(12),i=n(36),o=n(49),a=n(339);const c=(new l.Matrix4).lookAt({eye:[0,0,1]});class OrthographicViewport extends r.a{constructor(e){var{width:t,height:n,near:r=.1,far:i=1e3,zoom:o=0,target:a=[0,0,0],flipY:s=!0}=e,A=Math.pow(2,o);super({...e,longitude:null,position:a,viewMatrix:c.clone().scale([A,A*(s?-1:1),A]),projectionMatrix:function getProjectionMatrix({width:e,height:t,near:n,far:r}){return e=e||1,t=t||1,(new l.Matrix4).ortho({left:-e/2,right:e/2,bottom:-t/2,top:t/2,near:n,far:r})}({width:t,height:n,near:r,far:i}),zoom:o})}panByPosition(e,t){t=Object(i.p)(t,this.pixelUnprojectionMatrix),e=o.a([],e,o.d([],t));return{target:o.a([],this.center,e)}}}class OrthographicView extends t.a{constructor(e){super({...e,type:OrthographicViewport})}get controller(){return this._getControllerProps({type:a.a})}}OrthographicView.displayName="OrthographicView"},function(e,t){t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,A=(1<>1,c=-7,g=n?i-1:0,u=n?-1:1,i=e[t+g];for(g+=u,o=i&(1<<-c)-1,i>>=-c,c+=s;0>=-c,c+=r;0>1,g=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,u=r?0:o-1,d=r?1:-1,o=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-a))<1&&(a--,r*=2),2<=(t+=1<=a+c?g/r:g*Math.pow(2,1-c))*r&&(a++,r/=2),l<=a+c?(s=0,a=l):1<=a+c?(s=(t*r-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));8<=i;e[n+u]=255&s,u+=d,s/=256,i-=8);for(a=a<r;){if(o-r>600){var s=o-r+1,A=n-r+1,l=Math.log(s),c=.5*Math.exp(2*l/3),g=.5*Math.sqrt(l*c*(s-c)/s)*(A-s/2<0?-1:1),u=Math.max(r,Math.floor(n-A*c/s+g)),d=Math.min(o,Math.floor(n+(s-A)*c/s+g));t(e,n,u,d,a)}var h=e[n],p=r,f=o;for(i(e,r,n),a(e[o],h)>0&&i(e,r,o);p0;)f--}0===a(e[r],h)?i(e,r,f):i(e,++f,o),f<=n&&(r=f+1),n<=f&&(o=f-1)}}(e,t,r||0,o||e.length-1,a||n)}function i(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return et?1:0}var r=function(e){void 0===e&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function e(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r=e.minX&&t.maxY>=e.minY}function p(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function d(e,n,r,i,o){for(var a=[n,r];a.length;)if(!((r=a.pop())-(n=a.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,o),a.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!c(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var o=0;o=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=p(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(e,t){this.data=p([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,o,a,s,A,l,c=1/0,g=1/0,u=t;u<=n-t;u++){var d=h(e,0,u,this.toBBox),p=h(e,u,n,this.toBBox),I=(i=d,o=p,a=void 0,s=void 0,A=void 0,l=void 0,a=Math.max(i.minX,o.minX),s=Math.max(i.minY,o.minY),A=Math.min(i.maxX,o.maxX),l=Math.min(i.maxY,o.maxY),Math.max(0,A-a)*Math.max(0,l-s)),C=f(d)+f(p);I=t;g--){var d=e.children[g];o(s,e.leaf?i(d):d),A+=u(s)}return A},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)o(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)0===e[t].children.length?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():a(e[t],this.toBBox)},r}()},function(e,t,n){"use strict";var r=Array.prototype.slice,i=n(528),o=Object.keys,a=o?function keys(e){return o(e)}:n(798),s=Object.keys;a.shim=function shimObjectKeys(){return Object.keys?function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2)||(Object.keys=function keys(e){return i(e)?s(r.call(e)):s(e)}):Object.keys=a,Object.keys||a},e.exports=a},function(e,t,n){"use strict";var r=Object.prototype.toString;e.exports=function isArguments(e){var t=r.call(e);return"[object Arguments]"===t||"[object Array]"!==t&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&0<=e.length&&"[object Function]"===r.call(e.callee)}},function(e,t,n){"use strict";var r=n(418)(),i=n(121)("Object.prototype.toString"),o=function isArguments(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},n=function isArguments(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&0<=e.length&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=n,e.exports=a?o:n},function(e,t,n){"use strict";var r=n(50)("%Object.defineProperty%",!0),i=function hasPropertyDescriptors(){if(r)try{return r({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function hasArrayLengthDefineBug(){if(!i())return null;try{return 1!==r([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},function(e,t,n){"use strict";function eI5(e){return e!=e}e.exports=function is(e,t){return 0===e&&0===t?1/e==1/t:e===t||!(!eI5(e)||!eI5(t))}},function(e,t,n){"use strict";var r=n(531);e.exports=function getPolyfill(){return"function"==typeof Object.is?Object.is:r}},function(e,t,n){"use strict";var r,i,o,a,s,A=n(121),n=n(418)(),l=(n&&(r=A("Object.prototype.hasOwnProperty"),i=A("RegExp.prototype.exec"),o={},s={toString:a=function(){throw o},valueOf:a},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=a)),A("Object.prototype.toString")),c=Object.getOwnPropertyDescriptor;e.exports=n?function isRegex(e){if(!e||"object"!=typeof e)return!1;var t=c(e,"lastIndex");if(!(t&&r(t,"value")))return!1;try{i(e,s)}catch(e){return e===o}}:function isRegex(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===l(e)}},function(e,t,n){"use strict";var n=n(803).functionsHaveConfigurableNames(),r=Object,i=TypeError;e.exports=function flags(){if(null!=this&&this!==r(this))throw new i("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e},n&&Object.defineProperty&&Object.defineProperty(e.exports,"name",{value:"get flags"})},function(e,t,n){"use strict";var r=n(534),i=n(148).supportsDescriptors,o=Object.getOwnPropertyDescriptor;e.exports=function getPolyfill(){if(i&&"gim"===/a/gim.flags){var e=o(RegExp.prototype,"flags");if(e&&"function"==typeof e.get&&"boolean"==typeof RegExp.prototype.dotAll&&"boolean"==typeof RegExp.prototype.hasIndices){var t="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){t+="d"}}),Object.defineProperty(n,"sticky",{get:function(){t+="y"}}),"dy"===t)return e.get}}return r}},function(e,t,n){"use strict";var r=Date.prototype.getDay,i=function tryDateGetDayCall(e){try{return r.call(e),!0}catch(e){return!1}},o=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function isDateObject(e){return"object"==typeof e&&null!==e&&(a?i(e):"[object Date]"===o.call(e))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_STYLE=t.MAX_ARROWS=t.DEFAULT_ARROWS=t.ArrowStyles=void 0;var r={NONE:0,FORWARD:1,BACKWARD:2,BOTH:3},r=(t.ArrowStyles=r,t.DEFAULT_ARROWS=1,t.MAX_ARROWS=3,{arrowColor:[0,0,0,1],arrowCount:1,arrowStyle:r.NONE,fillColor:[0,0,0,1],lineColor:[0,0,0,1],lineWidthMeters:5,outlineRadiusMeters:0,opacity:1,zLevel:0});t.DEFAULT_STYLE=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=t.SELECTION_TYPE=void 0;var s=n(56),A=n(6),r=_interopRequireDefault(n(73)),i=_interopRequireDefault(n(228)),l=_interopRequireDefault(n(459)),c=_interopRequireDefault(n(315)),g=_interopRequireDefault(n(58));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(t,e){var n,r=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)),r}function _slicedToArray(e,t){return function _arrayWithHoles(e){if(Array.isArray(e))return e}(e)||function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}return n}}(e,t)||_unsupportedIterableToArray(e,t)||function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _toConsumableArray(e){return function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}(e)||function _iterableToArray(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||_unsupportedIterableToArray(e)||function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Map"===(n="Object"===n&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ni&&!o.warned&&(o.warned=!0,(r=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",r.emitter=e,r.type=t,r.count=o.length,function ProcessEmitWarning(e){console&&console.warn&&console.warn(e)}(r))),e}function _onceWrap(e,t,n){e={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},t=function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(e);return t.listener=n,e.wrapFn=t}function _listeners(e,t,n){e=e._events;if(void 0===e)return[];e=e[t];return void 0===e?[]:"function"==typeof e?n?[e.listener||e]:[e]:n?function unwrapListeners(e){for(var t=new Array(e.length),n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nr[1])&&(r=t),t=(0,A.default)(e,n),i=Math.max(i,t)),n=e}),r&&[r[0],r[1]+i/1e3]),o=(0,c.lineString)([r,t]),t=(0,c.point)(t,{guideType:"editHandle",editHandleType:"rotate"});return(0,c.featureCollection)([(0,h.default)(e),t,o])}},{key:"handleDragging",value:function handleDragging(e,t){var n;this._isRotating&&((n=this.getRotateAction(e.pointerDownMapCoords,e.mapCoords,"rotating",t))&&t.onEdit(n),e.cancelPan())}},{key:"handlePointerMove",value:function handlePointerMove(e,t){this._isRotating||(e=(0,r.getPickedEditHandle)(e.picks),this._selectedEditHandle=e&&"rotate"===e.properties.editHandleType?e:null),this.updateCursor(t)}},{key:"handleStartDragging",value:function handleStartDragging(e,t){this._selectedEditHandle&&(this._isRotating=!0,this._geometryBeingRotated=this.getSelectedFeaturesAsFeatureCollection(t))}},{key:"handleStopDragging",value:function handleStopDragging(e,t){this._isRotating&&((e=this.getRotateAction(e.pointerDownMapCoords,e.mapCoords,"rotated",t))&&t.onEdit(e),this._geometryBeingRotated=null,this._selectedEditHandle=null,this._isRotating=!1)}},{key:"updateCursor",value:function updateCursor(e){this._selectedEditHandle?e.onUpdateCursor("crosshair"):e.onUpdateCursor(null)}},{key:"getRotateAction",value:function getRotateAction(e,t,n,r){if(!this._geometryBeingRotated)return null;for(var i=(0,g.default)(this._geometryBeingRotated),e=function getRotationAngle(e,t,n){t=(0,u.default)(e,t);return(0,u.default)(e,n)-t}(i,e,t),o=(0,d.default)(this._geometryBeingRotated,e,{pivot:i}),a=new f.ImmutableFeatureCollection(r.data),s=r.selectedIndexes,A=0;Ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}(this._modes);try{for(r.s();!(t=r.n()).done;){var i=t.value;n.push.apply(n,_toConsumableArray(i.getGuides(e).features))}}catch(e){r.e(e)}finally{r.f()}return{type:"FeatureCollection",features:n}}}]),CompositeMode}();t.CompositeMode=n},function(e,t,n){"use strict";n.r(t);var I=n(6),C=n(155),m=n(462),y=n(15);function getTanDeg(e){e=e*Math.PI/180;return Math.tan(e)}t.default=function ellipse(e,t,n,r){var i=(r=r||{}).steps||64,o=r.units||"kilometers",a=r.angle||0,s=r.pivot||e,A=r.properties||e.properties||{};if(!e)throw new Error("center is required");if(!t)throw new Error("xSemiAxis is required");if(!n)throw new Error("ySemiAxis is required");if(!Object(I.isObject)(r))throw new Error("options must be an object");if(!Object(I.isNumber)(i))throw new Error("steps must be a number");if(!Object(I.isNumber)(a))throw new Error("angle must be a number");for(var l,c=Object(y.getCoord)(e),g=("degrees"===o?l=Object(I.degreesToRadians)(a):(t=Object(C.a)(e,t,90,{units:o}),n=Object(C.a)(e,n,0,{units:o}),t=Object(y.getCoord)(t)[0]-c[0],n=Object(y.getCoord)(n)[1]-c[1]),[]),u=0;u=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function e(t){throw t},f:i};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a,A=!0,l=!1;return{s:function s(){o=t[Symbol.iterator]()},n:function n(){var e=o.next();return A=e.done,e},e:function e(t){l=!0,a=t},f:function f(){try{A||null==o.return||o.return()}finally{if(l)throw a}}}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nt.x&&(n=Math.min(n,e.x)),e.y>t.y&&(r=Math.min(r,e.y))}),Number.isFinite(n)&&(t.w=n-t.x),Number.isFinite(r)&&(t.h=r-t.y)),i||(t.w=o,t.h=a),t}),2),g=i[0],i=i[1];i&&(e={w:i.w,h:i.h,x:i.x,y:i.y,static:!0,i:e},d.props.onResize(g,r,i,e,n,t),d.setState({layout:c?g:(0,B.compact)(g,(0,B.compactType)(d.props),A),activeDrag:e}))}),_defineProperty(_assertThisInitialized(d),"onResizeStop",function(e,t,n,r){var i=r.e,r=r.node,o=d.state,a=o.layout,o=o.oldResizeItem,s=d.props,A=s.cols,s=s.allowOverlap,e=(0,B.getLayoutItem)(a,e),o=(d.props.onResizeStop(a,o,e,null,i,r),s?a:(0,B.compact)(a,(0,B.compactType)(d.props),A)),e=d.state.oldLayout;d.setState({activeDrag:null,layout:o,oldResizeItem:null,oldLayout:null}),d.onLayoutMaybeChanged(o,e)}),_defineProperty(_assertThisInitialized(d),"onDragOver",function(e){if(e.preventDefault(),e.stopPropagation(),f&&(null==(t=e.nativeEvent.target)||!t.classList.contains(p)))return!1;var t=d.props,n=t.droppingItem,r=t.onDropDragOver,i=t.margin,o=t.cols,a=t.rowHeight,s=t.maxRows,A=t.width,l=t.containerPadding,t=t.transformScale,r=null==r?void 0:r(e);if(!1===r)return d.state.droppingDOMNode&&d.removeDroppingPlaceholder(),!1;var c,n=_objectSpread(_objectSpread({},n),r),r=d.state.layout,g=e.nativeEvent,u=g.layerX,g=g.layerY,t={left:u/t,top:g/t,e:e};d.state.droppingDOMNode?d.state.droppingPosition&&(c=(e=d.state.droppingPosition).left,e=e.top,c==u&&e==g||d.setState({droppingPosition:t})):(c=(0,h.calcXY)({cols:o,margin:i,maxRows:s,rowHeight:a,containerWidth:A,containerPadding:l||i},g,u,n.w,n.h),d.setState({droppingDOMNode:y.createElement("div",{key:n.i}),droppingPosition:t,layout:[].concat(_toConsumableArray(r),[_objectSpread(_objectSpread({},n),{},{x:c.x,y:c.y,static:!1,isDraggable:!0})])}))}),_defineProperty(_assertThisInitialized(d),"removeDroppingPlaceholder",function(){var e=d.props,t=e.droppingItem,e=e.cols,n=d.state.layout,n=(0,B.compact)(n.filter(function(e){return e.i!==t.i}),(0,B.compactType)(d.props),e);d.setState({layout:n,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),_defineProperty(_assertThisInitialized(d),"onDragLeave",function(e){e.preventDefault(),d.dragEnterCounter--,0===d.dragEnterCounter&&d.removeDroppingPlaceholder()}),_defineProperty(_assertThisInitialized(d),"onDragEnter",function(e){e.preventDefault(),d.dragEnterCounter++}),_defineProperty(_assertThisInitialized(d),"onDrop",function(e){e.preventDefault();var t=d.props.droppingItem,n=d.state.layout,r=n.find(function(e){return e.i===t.i});d.dragEnterCounter=0,d.removeDroppingPlaceholder(),d.props.onDrop(n,r,e)}),d}return function _createClass(e,t,n){t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n)}(ReactGridLayout,[{key:"componentDidMount",value:function componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(e,t){return this.props.children!==e.children||!(0,B.fastRGLPropsEqual)(this.props,e,i.default)||this.state.activeDrag!==t.activeDrag||this.state.mounted!==t.mounted||this.state.droppingPosition!==t.droppingPosition}},{key:"componentDidUpdate",value:function componentDidUpdate(e,t){var n;this.state.activeDrag||(n=this.state.layout,t=t.layout,this.onLayoutMaybeChanged(n,t))}},{key:"containerHeight",value:function containerHeight(){var e,t;if(this.props.autoSize)return e=(0,B.bottom)(this.state.layout),t=(this.props.containerPadding||this.props.margin)[1],e*this.props.rowHeight+(e-1)*this.props.margin[1]+2*t+"px"}},{key:"onLayoutMaybeChanged",value:function onLayoutMaybeChanged(e,t){t=t||this.state.layout,(0,i.default)(t,e)||this.props.onLayoutChange(e)}},{key:"placeholder",value:function placeholder(){var e=this.state.activeDrag;if(!e)return null;var t=this.props,n=t.width,r=t.cols,i=t.margin,o=t.containerPadding,a=t.rowHeight,s=t.maxRows,A=t.useCSSTransforms,t=t.transformScale;return y.createElement(b.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:"react-grid-placeholder",containerWidth:n,cols:r,margin:i,containerPadding:o||i,maxRows:s,rowHeight:a,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:A,transformScale:t},y.createElement("div",null))}},{key:"processGridItem",value:function processGridItem(e,t){if(e&&e.key){var n=(0,B.getLayoutItem)(this.state.layout,String(e.key));if(!n)return null;var r=this.props,i=r.width,o=r.cols,a=r.margin,s=r.containerPadding,A=r.rowHeight,l=r.maxRows,c=r.isDraggable,g=r.isResizable,u=r.isBounded,d=r.useCSSTransforms,h=r.transformScale,p=r.draggableCancel,f=r.draggableHandle,I=r.resizeHandles,r=r.resizeHandle,C=this.state,m=C.mounted,C=C.droppingPosition,c="boolean"==typeof n.isDraggable?n.isDraggable:!n.static&&c,g="boolean"==typeof n.isResizable?n.isResizable:!n.static&&g,I=n.resizeHandles||I,u=c&&u&&!1!==n.isBounded;return y.createElement(b.default,{containerWidth:i,cols:o,margin:a,containerPadding:s||a,maxRows:l,rowHeight:A,cancel:p,handle:f,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:c,isResizable:g,isBounded:u,useCSSTransforms:d&&m,usePercentages:!m,transformScale:h,w:n.w,h:n.h,x:n.x,y:n.y,i:n.i,minH:n.minH,minW:n.minW,maxH:n.maxH,maxW:n.maxW,static:n.static,droppingPosition:t?C:void 0,resizeHandles:I,resizeHandle:r},e)}}},{key:"render",value:function render(){var t=this,e=this.props,n=e.className,r=e.style,i=e.isDroppable,e=e.innerRef,n=(0,o.default)(p,n),r=_objectSpread({height:this.containerHeight()},r);return y.createElement("div",{ref:e,className:n,style:r,onDrop:i?this.onDrop:B.noop,onDragLeave:i?this.onDragLeave:B.noop,onDragEnter:i?this.onDragEnter:B.noop,onDragOver:i?this.onDragOver:B.noop},y.Children.map(this.props.children,function(e){return t.processGridItem(e)}),i&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}],[{key:"getDerivedStateFromProps",value:function getDerivedStateFromProps(e,t){var n;return t.activeDrag?null:((0,i.default)(e.layout,t.propsLayout)&&e.compactType===t.compactType?(0,B.childrenEqual)(e.children,t.children)||(n=t.layout):n=e.layout,n?{layout:(0,B.synchronizeLayoutWithChildren)(n,e.children,e.cols,(0,B.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}}]),ReactGridLayout}();_defineProperty(t.default=r,"displayName","ReactGridLayout"),_defineProperty(r,"propTypes",n.default),_defineProperty(r,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:B.noop,onDragStart:B.noop,onDrag:B.noop,onDragStop:B.noop,onResizeStart:B.noop,onResize:B.noop,onResizeStop:B.noop,onDrop:B.noop,onDropDragOver:B.noop})},function(e,t,n){"use strict";function calcGridColWidth(e){var t=e.margin,n=e.containerPadding,r=e.containerWidth,e=e.cols;return(r-t[0]*(e-1)-2*n[0])/e}function calcGridItemWHPx(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function clamp(e,t,n){return Math.max(Math.min(e,n),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.calcGridColWidth=calcGridColWidth,t.calcGridItemWHPx=calcGridItemWHPx,t.calcGridItemPosition=function calcGridItemPosition(e,t,n,r,i,o){var a=e.margin,s=e.containerPadding,A=e.rowHeight,e=calcGridColWidth(e),l={};o&&o.resizing?(l.width=Math.round(o.resizing.width),l.height=Math.round(o.resizing.height)):(l.width=calcGridItemWHPx(r,e,a[0]),l.height=calcGridItemWHPx(i,A,a[1]));o&&o.dragging?(l.top=Math.round(o.dragging.top),l.left=Math.round(o.dragging.left)):(l.top=Math.round((A+a[1])*n+s[1]),l.left=Math.round((e+a[0])*t+s[0]));return l},t.calcXY=function calcXY(e,t,n,r,i){var o=e.margin,a=e.cols,s=e.rowHeight,A=e.maxRows,e=calcGridColWidth(e),n=Math.round((n-o[0])/(e+o[0])),e=Math.round((t-o[1])/(s+o[1]));return n=clamp(n,0,a-r),e=clamp(e,0,A-i),{x:n,y:e}},t.calcWH=function calcWH(e,t,n,r,i){var o=e.margin,a=e.maxRows,s=e.cols,A=e.rowHeight,e=calcGridColWidth(e),t=Math.round((t+o[0])/(e+o[0])),e=Math.round((n+o[1])/(A+o[1]));return t=clamp(t,0,s-r),e=clamp(e,0,a-i),{w:t,h:e}},t.clamp=clamp},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBoundPosition=function getBoundPosition(e,t,n){if(!e.props.bounds)return[t,n];var r=e.props.bounds,e=(r="string"==typeof r?r:function cloneBounds(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(r),findDOMNode(e));if("string"==typeof r){var i=e.ownerDocument,o=i.defaultView;if(!((i="parent"===r?e.parentNode:i.querySelector(r))instanceof o.HTMLElement))throw new Error('Bounds selector "'+r+'" could not find an element.');var a=o.getComputedStyle(e),o=o.getComputedStyle(i);r={left:-e.offsetLeft+(0,s.int)(o.paddingLeft)+(0,s.int)(a.marginLeft),top:-e.offsetTop+(0,s.int)(o.paddingTop)+(0,s.int)(a.marginTop),right:(0,A.innerWidth)(i)-(0,A.outerWidth)(e)-e.offsetLeft+(0,s.int)(o.paddingRight)-(0,s.int)(a.marginRight),bottom:(0,A.innerHeight)(i)-(0,A.outerHeight)(e)-e.offsetTop+(0,s.int)(o.paddingBottom)-(0,s.int)(a.marginBottom)}}(0,s.isNum)(r.right)&&(t=Math.min(t,r.right));(0,s.isNum)(r.bottom)&&(n=Math.min(n,r.bottom));(0,s.isNum)(r.left)&&(t=Math.max(t,r.left));(0,s.isNum)(r.top)&&(n=Math.max(n,r.top));return[t,n]},t.snapToGrid=function snapToGrid(e,t,n){t=Math.round(t/e[0])*e[0],n=Math.round(n/e[1])*e[1];return[t,n]},t.canDragX=function canDragX(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function canDragY(e){return"both"===e.props.axis||"y"===e.props.axis},t.getControlPosition=function getControlPosition(e,t,n){var r="number"==typeof t?(0,A.getTouch)(e,t):null;if("number"==typeof t&&!r)return null;t=findDOMNode(n),t=n.props.offsetParent||t.offsetParent||t.ownerDocument.body;return(0,A.offsetXYFromParent)(r||e,t,n.props.scale)},t.createCoreData=function createCoreData(e,t,n){var r=e.state,i=!(0,s.isNum)(r.lastX),e=findDOMNode(e);return i?{node:e,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:e,deltaX:t-r.lastX,deltaY:n-r.lastY,lastX:r.lastX,lastY:r.lastY,x:t,y:n}},t.createDraggableData=function createDraggableData(e,t){var n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}};var s=n(320),A=n(431);function findDOMNode(e){e=e.findDOMNode();if(e)return e;throw new Error(": Unmounted during event!")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function log(){}},function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var a=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};t=_getRequireWildcardCache(t);if(t&&t.has(e))return t.get(e);var n,r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(n in e){var o;"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&((o=i?Object.getOwnPropertyDescriptor(e,n):null)&&(o.get||o.set)?Object.defineProperty(r,n,o):r[n]=e[n])}r.default=e,t&&t.set(e,r);return r}(n(0)),s=n(430),A=n(867),n=n(560),l=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?n:t})(e)}function _extends(){return(_extends=Object.assign||function(e){for(var t=1;tMath.abs(a*n)?t=e/n:e=t*n);var o=e,a=t,n=this.slack||[0,0],s=n[0],n=n[1];return e+=s,t+=n,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[s+(o-e),n+(a-t)],[e,t]},e.resizeHandler=function resizeHandler(l,c){var g=this;return function(e,t){var n,r,i,o=t.node,a=t.deltaX,t=t.deltaY,s=("onResizeStart"===l&&g.resetData(),("both"===g.props.axis||"x"===g.props.axis)&&"n"!==c&&"s"!==c),A=("both"===g.props.axis||"y"===g.props.axis)&&"e"!==c&&"w"!==c;(s||A)&&(n=c[0],i=c[c.length-1],r=o.getBoundingClientRect(),null!=g.lastHandleRect&&("w"===i&&(a+=r.left-g.lastHandleRect.left),"n"===n&&(t+=r.top-g.lastHandleRect.top)),g.lastHandleRect=r,"w"===i&&(a=-a),"n"===n&&(t=-t),r=g.props.width+(s?a/g.props.transformScale:0),i=g.props.height+(A?t/g.props.transformScale:0),r=(n=g.runConstraints(r,i))[0],i=n[1],s=r!==g.props.width||i!==g.props.height,(a="function"==typeof g.props[l]?g.props[l]:null)&&("onResize"!==l||s)&&(null!=e.persist&&e.persist(),a(e,{node:o,size:{width:r,height:i},handle:c})),"onResizeStop"===l&&g.resetData())}},e.renderResizeHandle=function renderResizeHandle(e,t){var n=this.props.handle;if(!n)return a.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:t});if("function"==typeof n)return n(e,t);t=_objectSpread({ref:t},"string"==typeof n.type?{}:{handleAxis:e});return a.cloneElement(n,t)},e.render=function render(){var n=this,e=this.props,t=e.children,r=e.className,i=e.draggableOpts,o=(e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart,e.resizeHandles),e=(e.transformScale,function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};for(var n,r={},i=Object.keys(e),o=0;oe[a]&&(r=a)}return r},t.getColsFromBreakpoint=function getColsFromBreakpoint(e,t){if(t[e])return t[e];throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!")},t.findOrGenerateResponsiveLayout=function findOrGenerateResponsiveLayout(e,t,n,r,i,o){if(e[n])return(0,g.cloneLayout)(e[n]);for(var a=e[r],r=sortBreakpoints(t),s=r.slice(r.indexOf(n)),A=0,l=s.length;A",v=C?">":"<",E=void 0;if(!f&&"number"!=typeof g&&void 0!==g)throw new Error(t+" must be number");if(!B&&void 0!==y&&"number"!=typeof y&&"boolean"!=typeof y)throw new Error(m+" must be number or boolean");B?(c=e.util.getData(y.$data,c,e.dataPathArr),o="exclIsNumber"+l,a="' + "+(s="op"+l)+" + '",E=m,(Q=Q||[]).push(A=A+(" var schemaExcl"+l+" = "+c+"; ")+(" var "+(r="exclusive"+l)+"; var "+(i="exclType"+l)+" = typeof "+(c="schemaExcl"+l)+"; if ("+i+" != 'boolean' && "+i+" != 'undefined' && "+i+" != 'number') { ")),A="",!1!==e.createErrors?(A+=" { keyword: '"+(E||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: {} ",!1!==e.opts.messages&&(A+=" , message: '"+m+" should be boolean' "),e.opts.verbose&&(A+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),A+=" } "):A+=" {} ",w=A,A=Q.pop(),!e.compositeRule&&h?e.async?A+=" throw new ValidationError(["+w+"]); ":A+=" validate.errors = ["+w+"]; return false; ":A+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",A+=" } else if ( ",f&&(A+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),A+=" "+i+" == 'number' ? ( ("+r+" = "+I+" === undefined || "+c+" "+b+"= "+I+") ? "+p+" "+v+"= "+c+" : "+p+" "+v+" "+I+" ) : ( ("+r+" = "+c+" === true) ? "+p+" "+v+"= "+I+" : "+p+" "+v+" "+I+" ) || "+p+" !== "+p+") { var op"+l+" = "+r+" ? '"+b+"' : '"+b+"='; ",void 0===g&&(d=e.errSchemaPath+"/"+(E=m),I=c,f=B)):(a=b,(o="number"==typeof y)&&f?(s="'"+a+"'",A+=" if ( ",f&&(A+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),A+=" ( "+I+" === undefined || "+y+" "+b+"= "+I+" ? "+p+" "+v+"= "+y+" : "+p+" "+v+" "+I+" ) || "+p+" !== "+p+") { "):(o&&void 0===g?(r=!0,d=e.errSchemaPath+"/"+(E=m),I=y,v+="="):(o&&(I=Math[C?"min":"max"](y,g)),y===(!o||I)?(r=!0,d=e.errSchemaPath+"/"+(E=m),v+="="):(r=!1,a+="=")),s="'"+a+"'",A+=" if ( ",f&&(A+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),A+=" "+p+" "+v+" "+I+" || "+p+" !== "+p+") { ")),E=E||t;(Q=Q||[]).push(A),A="",!1!==e.createErrors?(A+=" { keyword: '"+(E||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(d)+" , params: { comparison: "+s+", limit: "+I+", exclusive: "+r+" } ",!1!==e.opts.messages&&(A=A+" , message: 'should be "+a+" "+(f?"' + "+I:I+"'")),e.opts.verbose&&(A=(A+=" , schema: ")+(f?"validate.schema"+u:""+g)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),A+=" } "):A+=" {} ";var Q,w=A;return A=Q.pop(),!e.compositeRule&&h?e.async?A+=" throw new ValidationError(["+w+"]); ":A+=" validate.errors = ["+w+"]; return false; ":A+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",A+=" } ",h&&(A+=" else { "),A}},function(e,t,n){"use strict";e.exports=function generate__limitItems(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),A=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),g=e.opts.$data&&a&&a.$data,o=g?(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ","schema"+i):a;if(!g&&"number"!=typeof a)throw new Error(t+" must be number");r+="if ( ",g&&(r+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");var i=t,u=[],i=(u.push(r+=" "+c+".length "+("maxItems"==t?">":"<")+" "+o+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(A)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT have ")+("maxItems"==t?"more":"fewer")+" than ")+(g?"' + "+o+" + '":""+a)+" items' "),e.opts.verbose&&(r=(r+=" , schema: ")+(g?"validate.schema"+s:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r),r=u.pop();return!e.compositeRule&&l?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",l&&(r+=" else { "),r}},function(e,t,n){"use strict";e.exports=function generate__limitLength(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),A=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),g=e.opts.$data&&a&&a.$data,o=g?(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ","schema"+i):a;if(!g&&"number"!=typeof a)throw new Error(t+" must be number");r+="if ( ",g&&(r+=" ("+o+" !== undefined && typeof "+o+" != 'number') || "),!1===e.opts.unicode?r+=" "+c+".length ":r+=" ucs2length("+c+") ";var i=t,u=[],i=(u.push(r+=" "+("maxLength"==t?">":"<")+" "+o+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(A)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT be ")+("maxLength"==t?"longer":"shorter")+" than ")+(g?"' + "+o+" + '":""+a)+" characters' "),e.opts.verbose&&(r=(r+=" , schema: ")+(g?"validate.schema"+s:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r),r=u.pop();return!e.compositeRule&&l?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",l&&(r+=" else { "),r}},function(e,t,n){"use strict";e.exports=function generate__limitProperties(e,t,n){var r=" ",i=e.level,o=e.dataLevel,a=e.schema[t],s=e.schemaPath+e.util.getProperty(t),A=e.errSchemaPath+"/"+t,l=!e.opts.allErrors,c="data"+(o||""),g=e.opts.$data&&a&&a.$data,o=g?(r+=" var schema"+i+" = "+e.util.getData(a.$data,o,e.dataPathArr)+"; ","schema"+i):a;if(!g&&"number"!=typeof a)throw new Error(t+" must be number");r+="if ( ",g&&(r+=" ("+o+" !== undefined && typeof "+o+" != 'number') || ");var i=t,u=[],i=(u.push(r+=" Object.keys("+c+").length "+("maxProperties"==t?">":"<")+" "+o+") { "),r="",!1!==e.createErrors?(r+=" { keyword: '"+(i||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(A)+" , params: { limit: "+o+" } ",!1!==e.opts.messages&&(r=(r=(r+=" , message: 'should NOT have ")+("maxProperties"==t?"more":"fewer")+" than ")+(g?"' + "+o+" + '":""+a)+" properties' "),e.opts.verbose&&(r=(r+=" , schema: ")+(g?"validate.schema"+s:""+a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),r+=" } "):r+=" {} ",r),r=u.pop();return!e.compositeRule&&l?e.async?r+=" throw new ValidationError(["+i+"]); ":r+=" validate.errors = ["+i+"]; return false; ":r+=" var err = "+i+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",r+="} ",l&&(r+=" else { "),r}},function(e){e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},function(e,t,n){var i=n(571),o=n(310),a=Object.prototype.hasOwnProperty;e.exports=function assignValue(e,t,n){var r=e[t];a.call(e,t)&&o(r,n)&&(void 0!==n||t in e)||i(e,t,n)}},function(e,t,n){var r=n(572);e.exports=function baseAssignValue(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},function(e,t,n){var r=n(194),n=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=n},function(e,t,n){var r=n(410),i=n(435),o=n(411),n=n(521),a=Object.getOwnPropertySymbols;e.exports=a?function(e){for(var t=[];e;)r(t,o(e)),e=i(e);return t}:n},function(e,t){e.exports=function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ni;)!a(r,n=t[i++])||~A(o,n)||o.push(n);return o}},function(e,t,n){var r=n(586);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){e.exports={default:n(958),__esModule:!0}},function(e,t,n){"use strict";t.__esModule=!0;var r=_interopRequireDefault(n(960)),i=_interopRequireDefault(n(972)),o="function"==typeof i.default&&"symbol"==typeof r.default?function(e){return typeof e}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":typeof e};function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}t.default="function"==typeof i.default&&"symbol"===o(r.default)?function(e){return void 0===e?"undefined":o(e)}:function(e){return e&&"function"==typeof i.default&&e.constructor===i.default&&e!==i.default.prototype?"symbol":void 0===e?"undefined":o(e)}},function(e,t,n){"use strict";function o7g(){return this}var f=n(325),I=n(232),C=n(590),m=n(233),y=n(446),B=n(964),b=n(448),v=n(967),E=n(236)("iterator"),Q=!([].keys&&"next"in[].keys()),w="values";e.exports=function(e,t,n,r,i,o,a){B(n,t,r);function w7g(e){if(!Q&&e in g)return g[e];switch(e){case"keys":return function keys(){return new n(this,e)};case w:return function values(){return new n(this,e)}}return function entries(){return new n(this,e)}}var s,A,r=t+" Iterator",l=i==w,c=!1,g=e.prototype,u=g[E]||g["@@iterator"]||i&&g[i],d=u||w7g(i),h=i?l?w7g("entries"):d:void 0,p="Array"==t&&g.entries||u;if(p&&(p=v(p.call(new e)))!==Object.prototype&&p.next&&(b(p,r,!0),f||"function"==typeof p[E]||m(p,E,o7g)),l&&u&&u.name!==w&&(c=!0,d=function values(){return u.call(this)}),f&&!a||!Q&&!c&&g[E]||m(g,E,d),y[t]=d,y[r]=o7g,i)if(s={values:l?d:w7g(w),keys:o?d:w7g("keys"),entries:h},a)for(A in s)A in g||C(g,A,s[A]);else I(I.P+I.F*(Q||c),t,s);return s}},function(e,t,n){e.exports=n(233)},function(e,t,n){var r=n(584),i=n(443).concat("length","prototype");t.f=Object.getOwnPropertyNames||function getOwnPropertyNames(e){return r(e,i)}},function(e,t,n){var r=n(327),i=n(323),o=n(235),a=n(438),s=n(196),A=n(582),l=Object.getOwnPropertyDescriptor;t.f=n(169)?l:function getOwnPropertyDescriptor(e,t){if(e=o(e),t=a(t,!0),A)try{return l(e,t)}catch(e){}if(s(e,t))return i(!r.f.call(e,t),e[t])}},function(e,t,n){var r=n(992),i=n(268);e.exports=function baseForOwn(e,t){return e&&r(e,t,i)}},function(e,t,n){var r=n(146);e.exports=function isStrictComparable(e){return e==e&&!r(e)}},function(e,t){e.exports=function matchesStrictComparable(t,n){return function(e){return null!=e&&(e[t]===n&&(void 0!==n||t in Object(e)))}}},function(e,t,n){var i=n(597),o=n(328);e.exports=function baseGet(e,t){for(var n=0,r=(t=i(t,e)).length;null!=e&&ne.token}};class s2_layer_S2Layer extends e.a{renderLayers(){const{data:e,getS2Token:n}=this.props;var{elevationScale:t,extruded:r,wireframe:i,filled:o,stroked:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:g,lineMiterLimit:u,lineDashJustified:d,getElevation:h,getFillColor:p,getLineColor:f,getLineWidth:I,getLineDashArray:C}=this.props,{updateTriggers:m,material:y}=this.props;const B=this.getSubLayerClass("cell",b.a);return new B({filled:o,wireframe:i,extruded:r,elevationScale:t,stroked:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,lineJointRounded:g,lineMiterLimit:u,lineDashJustified:d,material:y,getElevation:h,getFillColor:p,getLineColor:f,getLineWidth:I,getLineDashArray:C},this.getSubLayerProps({id:"cell",updateTriggers:{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth,getLineDashArray:m.getLineDashArray}}),{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(e,t)=>function getS2Polygon(e){return getGeoBounds(FromHilbertQuadKey(getS2QuadKey(e)))}(n(e,t))})}}s2_layer_S2Layer.layerName="S2Layer",s2_layer_S2Layer.defaultProps=n;var m=t(200);class trips_layer_TripsLayer extends t(246).a{getShaders(){const e=super.getShaders();return e.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},e}initializeState(e){super.initializeState(e);const t=this.getAttributeManager();t.addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(e){var{fadeTrail:t,trailLength:n,currentTime:r}=this.props;e.uniforms={...e.uniforms,fadeTrail:t,trailLength:n,currentTime:r},super.draw(e)}}trips_layer_TripsLayer.layerName="TripsLayer",trips_layer_TripsLayer.defaultProps={fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:null}};var c=t(97),M=t(94),n={...b.a.defaultProps,getHexagons:{type:"accessor",value:e=>e.hexagons}};class h3_cluster_layer_H3ClusterLayer extends e.a{updateState({props:e,changeFlags:t}){if(t.dataChanged||t.updateTriggers&&t.updateTriggers.getHexagons){const{data:r,getHexagons:i}=e,o=[],{iterable:a,objectInfo:s}=Object(M.a)(r);for(const A of a){s.index++;var n=i(A,s);for(const l of Object(c.h3SetToMultiPolygon)(n,!0))o.push(this.getSubLayerRow({polygon:l},A,s.index))}this.setState({polygons:o})}}renderLayers(){var{elevationScale:e,extruded:t,wireframe:n,filled:r,stroked:i,lineWidthScale:o,lineWidthMinPixels:a,lineWidthMaxPixels:s,lineJointRounded:A,lineMiterLimit:l,lineDashJustified:c,material:g,getFillColor:u,getLineColor:d,getLineWidth:h,getLineDashArray:p,getElevation:f,transitions:I,updateTriggers:C}=this.props;const m=this.getSubLayerClass("cluster-region",b.a);return new m({filled:r,wireframe:n,extruded:t,elevationScale:e,stroked:i,lineWidthScale:o,lineWidthMinPixels:a,lineWidthMaxPixels:s,lineJointRounded:A,lineMiterLimit:l,lineDashJustified:c,material:g,transitions:I,getFillColor:this.getSubLayerAccessor(u),getLineColor:this.getSubLayerAccessor(d),getLineWidth:this.getSubLayerAccessor(h),getLineDashArray:this.getSubLayerAccessor(p),getElevation:this.getSubLayerAccessor(f)},this.getSubLayerProps({id:"cluster-region",updateTriggers:C}),{data:this.state.polygons,getPolygon:e=>e.polygon})}}h3_cluster_layer_H3ClusterLayer.defaultProps=n,h3_cluster_layer_H3ClusterLayer.layerName="H3ClusterLayer";var a=t(12),U=t(345);function normalizeLongitudes(e,t){t=void 0===t?e[0][0]:t;for(const r of e){var n=r[0]-t;180e.hexagon},extruded:!0};delete O.getLineDashArray;class h3_hexagon_layer_H3HexagonLayer extends e.a{shouldUpdateState({changeFlags:e}){return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState({props:r,changeFlags:e}){if(e.dataChanged||e.updateTriggers&&e.updateTriggers.getHexagon){let e=-1,t=!1,n=!1;const{iterable:a,objectInfo:s}=Object(M.a)(r.data);for(const A of a){s.index++;var i=r.getHexagon(A,s),o=Object(c.h3GetResolution)(i);if(e<0)e=o;else if(e!==o){n=!0;break}if(Object(c.h3IsPentagon)(i)){t=!0;break}}this.setState({resolution:e,edgeLengthKM:0<=e?Object(c.edgeLength)(e,c.UNITS.km):0,hasMultipleRes:n,hasPentagon:t})}this._updateVertices(this.context.viewport)}_shouldUseHighPrecision(){var{resolution:e,hasPentagon:t,hasMultipleRes:n}=this.state,r=this.context["viewport"];return this.props.highPrecision||r.resolution||n||t||0<=e&&e<=5}_updateVertices(t){if(!this._shouldUseHighPrecision()){var{resolution:n,edgeLengthKM:r,centerHex:i}=this.state;if(!(n<0)){n=this.props.centerHexagon||Object(c.geoToH3)(t.latitude,t.longitude,n);if(i!==n){if(i){i=Object(c.h3Distance)(i,n);if(0<=i&&i*r<10)return}const o=t.distanceScales["unitsPerMeter"];let e=h3ToPolygon(n);var[i,r]=Object(c.h3ToGeo)(n);const[a,s]=t.projectFlat([r,i]);e=e.map(e=>{e=t.projectFlat(e);return[(e[0]-a)/o[0],(e[1]-s)/o[1]]}),this.setState({centerHex:n,vertices:e})}}}}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){var{elevationScale:e,material:t,coverage:n,extruded:r,wireframe:i,stroked:o,filled:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,getFillColor:g,getElevation:u,getLineColor:d,getLineWidth:h,transitions:p,updateTriggers:f}=this.props;return{elevationScale:e,extruded:r,coverage:n,wireframe:i,stroked:o,filled:a,lineWidthUnits:s,lineWidthScale:A,lineWidthMinPixels:l,lineWidthMaxPixels:c,material:t,getElevation:u,getFillColor:g,getLineColor:d,getLineWidth:h,transitions:p,updateTriggers:{getFillColor:f.getFillColor,getElevation:f.getElevation,getLineColor:f.getLineColor,getLineWidth:f.getLineWidth}}}_renderPolygonLayer(){const{data:e,getHexagon:n,updateTriggers:t,coverage:r}=this.props,i=this.getSubLayerClass("hexagon-cell-hifi",b.a),o=this._getForwardProps();return o.updateTriggers.getPolygon=function mergeTriggers(e,t){let n;return n=null==e?t:"object"==typeof e?{...e,coverage:t}:{getHexagon:e,coverage:t}}(t.getHexagon,r),new i(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:e,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:(e,t)=>{return h3ToPolygon(n(e,t),r,!0)}})}_renderColumnLayer(){var{data:e,getHexagon:t,updateTriggers:n}=this.props;const r=this.getSubLayerClass("hexagon-cell",U.a),i=this._getForwardProps();return i.updateTriggers.getPosition=n.getHexagon,new r(i,this.getSubLayerProps({id:"hexagon-cell",updateTriggers:i.updateTriggers}),{data:e,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:function getHexagonCentroid(e,t,n){var e=e(t,n),[t,n]=Object(c.h3ToGeo)(e);return[n,t]}.bind(null,t)})}}h3_hexagon_layer_H3HexagonLayer.defaultProps=O,h3_hexagon_layer_H3HexagonLayer.layerName="H3HexagonLayer";var L=t(116),g=t(22),P=t(637),V=t(632),Z=t(661),W=t(1229),H=t(377),j=t(638);class mesh_layer_MeshLayer extends j.a{getShaders(){var e=super.getShaders();const t=e.modules;return t.push(W.a),{...e,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool u_pickFeatureIds;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n vec2 uv = fract(texCoords) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n\n geometry.uv = uv;\n geometry.uv = texCoords;\n\n if (u_pickFeatureIds) {\n geometry.pickingColor = featureIdsPickingColors;\n } else {\n geometry.pickingColor = instancePickingColors;\n }\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * normals);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = uv;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n vTexCoord = uv;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n vec3 projectedPosition = project_position(positions);\n position_commonspace = vec4(projectedPosition, 1.0);\n gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n geometry.position = position_commonspace;\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n \n#ifdef MODULE_PBR\n\n fragColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n fragColor.a *= opacity;\n\n#else\n\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){var e=this.props["featureIds"];super.initializeState(),e&&this.state.attributeManager.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),e.pbrMaterial!==t.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(e){var t=this.props["featureIds"];this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,u_pickFeatureIds:Boolean(t)}),super.draw(e))}getModel(e){var{id:t,pbrMaterial:n}=this.props,n=this.parseMaterial(n,e),r=this.getShaders(),t=(!function validateGeometryAttributes(e){e.COLOR_0||e.colors||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),e.uvRegions||(e.uvRegions={constant:!0,value:new Float32Array([0,0,1,1])})}(e.attributes),new H.a(this.context.gl,{...this.getShaders(),id:t,geometry:e,defines:{...r.defines,...null==n?void 0:n.defines},parameters:null==n?void 0:n.parameters,isInstanced:!0}));return t}updatePbrMaterialUniforms(e){const t=this.state["model"];var n;t&&(n=this.props["mesh"],e=this.parseMaterial(e,n),t.setUniforms(e.uniforms))}parseMaterial(e,t){var n=Boolean(e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture);return new Z.a(this.context.gl,{attributes:{NORMAL:t.attributes.normals,TEXCOORD_0:t.attributes.texCoords},material:{unlit:n,...e},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(e){var t=this.props["featureIds"];const n=new Uint8ClampedArray(t.length*e.size);var r=[];for(let e=0;ee),q=new Q.a;function fromCartographic(e,t,n=X){return Object(I.m)(e)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in e?(t[0]=n(e.longitude),t[1]=n(e.latitude),t[2]=e.height):(t[0]=n(e.x),t[1]=n(e.y),t[2]=e.z),t}function toCartographic(e,t,n=X){return Object(I.m)(t)?(t[0]=n(e[0]),t[1]=n(e[1]),t[2]=e[2]):"longitude"in t?(t.longitude=n(e[0]),t.latitude=n(e[1]),t.height=e[2]):(t.x=n(e[0]),t.y=n(e[1]),t.z=e[2]),t}const $=new Q.a,ee=new Q.a,te=new Q.a;const ne=new Q.a,re={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ie={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},C={east:new Q.a,north:new Q.a,up:new Q.a,west:new Q.a,south:new Q.a,down:new Q.a},oe=new Q.a,ae=new Q.a,se=new Q.a;function localFrameToFixedFrame(e,t,n,r,i,o){var a=re[t]&&re[t][n];Object(f.a)(a&&(!r||r===a));let s,A,l;a=ne.copy(i);if(Object(I.j)(a.x,0,1e-14)&&Object(I.j)(a.y,0,1e-14)){i=Math.sign(a.z);s=oe.fromArray(ie[t]),"east"!==t&&"west"!==t&&s.scale(i),A=ae.fromArray(ie[n]),"east"!==n&&"west"!==n&&A.scale(i),l=se.fromArray(ie[r]),"east"!==r&&"west"!==r&&l.scale(i)}else{const{up:c,east:g,north:u}=C,{down:d,west:h,south:p}=(g.set(-a.y,a.x,0).normalize(),e.geodeticSurfaceNormal(a,c),u.copy(c).cross(g),C);d.copy(c).scale(-1),h.copy(g).scale(-1),p.copy(u).scale(-1),s=C[t],A=C[n],l=C[r]}return o[0]=s.x,o[1]=s.y,o[2]=s.z,o[3]=0,o[4]=A.x,o[5]=A.y,o[6]=A.z,o[7]=0,o[8]=l.x,o[9]=l.y,o[10]=l.z,o[11]=0,o[12]=a.x,o[13]=a.y,o[14]=a.z,o[15]=1,o}const Ae=new Q.a,le=new Q.a,ce=new Q.a,l=new Q.a,ge=new Q.a,ue=new Q.a;let de;class ellipsoid_Ellipsoid{static get WGS84(){return de=de||new ellipsoid_Ellipsoid(r,s,A)}constructor(e=0,t=0,n=0){Object(f.a)(0<=e),Object(f.a)(0<=t),Object(f.a)(0<=n),this.radii=new Q.a(e,t,n),this.radiiSquared=new Q.a(e*e,t*t,n*n),this.radiiToTheFourth=new Q.a(e*e*e*e,t*t*t*t,n*n*n*n),this.oneOverRadii=new Q.a(0===e?0:1/e,0===t?0:1/t,0===n?0:1/n),this.oneOverRadiiSquared=new Q.a(0===e?0:1/(e*e),0===t?0:1/(t*t),0===n?0:1/(n*n)),this.minimumRadius=Math.min(e,t,n),this.maximumRadius=Math.max(e,t,n),this.centerToleranceSquared=J.a.EPSILON1,0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,t=[0,0,0]){const n=le,r=ce;var[,,i]=e,e=(this.geodeticSurfaceNormalCartographic(e,n),r.copy(this.radiiSquared).scale(n),Math.sqrt(n.dot(r)));return r.scale(1/e),n.scale(i),r.add(n),r.to(t)}cartesianToCartographic(e,t=[0,0,0]){ue.from(e);e=this.scaleToGeodeticSurface(ue,l);if(e){var n=this.geodeticSurfaceNormal(e,le);const r=ge;return r.copy(ue).subtract(e),function toCartographicFromRadians(e,t){return toCartographic(e,t,I.f._cartographicRadians?X:I.r)}([Math.atan2(n.y,n.x),Math.asin(n.z),Math.sign(K.e(r,ue))*K.h(r)],t)}}eastNorthUpToFixedFrame(e,t=new y.a){return localFrameToFixedFrame(this,"east","north","up",e,t)}localFrameToFixedFrame(e,t,n,r,i=new y.a){return localFrameToFixedFrame(this,e,t,n,r,i)}geocentricSurfaceNormal(e,t=[0,0,0]){return Ae.from(e).normalize().to(t)}geodeticSurfaceNormalCartographic(e,t=[0,0,0]){var e=function fromCartographicToRadians(e,t=q){return fromCartographic(e,t,I.f._cartographicRadians?X:I.s)}(e),n=e[0],e=e[1],r=Math.cos(e);return Ae.set(r*Math.cos(n),r*Math.sin(n),Math.sin(e)).normalize(),Ae.to(t)}geodeticSurfaceNormal(e,t=[0,0,0]){return Ae.from(e).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(e,t){return function scaleToGeodeticSurface(o,e,a=new Q.a){var{oneOverRadii:e,oneOverRadiiSquared:s,centerToleranceSquared:A}=e,l=($.from(o),o.x),t=o.y,n=o.z,c=e.x,r=e.y,e=e.z,g=l*l*c*c,u=t*t*r*r,d=n*n*e*e,l=g+u+d,c=Math.sqrt(1/l);if(Number.isFinite(c)){const v=ee;if(v.copy(o).scale(c),lJ.a.EPSILON12);return $.scale([n,r,i]).to(a)}}(e,this,t)}scaleToGeocentricSurface(e,t=[0,0,0]){l.from(e);var e=l.x,n=l.y,r=l.z,i=this.oneOverRadiiSquared,e=1/Math.sqrt(e*e*i.x+n*n*i.y+r*r*i.z);return l.multiplyScalar(e).to(t)}transformPositionToScaledSpace(e,t=[0,0,0]){return l.from(e).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(e,t=[0,0,0]){return l.from(e).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(e,t=0,n=[0,0,0]){Object(f.a)(Object(I.j)(this.radii.x,this.radii.y,J.a.EPSILON15)),Object(f.a)(0=this.radii.z-t))return l.set(0,0,e).to(n)}}var he=t(290),u=t(204),pe=t(57),fe=t(511);class DoublyLinkedListNode{constructor(e,t,n){this.item=e,this.previous=t,this.next=n}}class doubly_linked_list_DoublyLinkedList{constructor(){this.head=null,this.tail=null,this._length=0}get length(){return this._length}add(e){e=new DoublyLinkedListNode(e,this.tail,null);return this.tail?this.tail.next=e:this.head=e,this.tail=e,++this._length,e}remove(e){e&&(e.previous&&e.next?(e.previous.next=e.next,e.next.previous=e.previous):e.previous?(e.previous.next=null,this.tail=e.previous):e.next?(e.next.previous=null,this.head=e.next):(this.head=null,this.tail=null),e.next=null,e.previous=null,--this._length)}splice(e,t){e!==t&&(this.remove(t),this._insert(e,t))}_insert(e,t){const n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e,++this._length}}function defined(e){return null!=e}class tileset_cache_TilesetCache{constructor(){Object(i.a)(this,"_list",void 0),Object(i.a)(this,"_sentinel",void 0),Object(i.a)(this,"_trimTiles",void 0),this._list=new doubly_linked_list_DoublyLinkedList,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(e){e=e._cacheNode;defined(e)&&this._list.splice(this._sentinel,e)}add(e,t,n){defined(t._cacheNode)||(t._cacheNode=this._list.add(t),n&&n(e,t))}unloadTile(e,t,n){var r=t._cacheNode;defined(r)&&(this._list.remove(r),t._cacheNode=void 0,n&&n(e,t))}unloadTiles(e,t){var n=this._trimTiles,r=(this._trimTiles=!1,this._list),i=1024*e.maximumMemoryUsage*1024,o=this._sentinel;let a=r.head;for(;a!==o&&(e.gpuMemoryUsageInBytes>i||n);){var s=a.item;a=a.next,this.unloadTile(e,s,t)}}trim(){this._trimTiles=!0}}var d=t(63);const Ie=new Q.a,Ce=new Q.a,me=new d.c([new d.e,new d.e,new d.e,new d.e,new d.e,new d.e]);function getFrameState(e,t){var{cameraDirection:n,cameraUp:r,height:i}=e,o=e.distanceScales["metersPerUnit"],a=[e.longitude,e.latitude,0],a=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian(a,new Q.a);const s=ellipsoid_Ellipsoid.WGS84.eastNorthUpToFixedFrame(a);var A=e.unprojectPosition(e.cameraPosition),A=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian(A,new Q.a),n=new Q.a(s.transformAsVector(new Q.a(n).scale(o))).normalize(),r=new Q.a(s.transformAsVector(new Q.a(r).scale(o))).normalize();return function commonSpacePlanesToWGS84(e,t){var n=e.getFrustumPlanes();let r=0;for(const o in n){const a=n[o];var i=a.normal.dot(e.center),i=(Ce.copy(a.normal).scale(a.distance-i).add(e.center),e.unprojectPosition(Ce)),i=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian(i,new Q.a);me.planes[r++].fromPointNormal(i,Ie.copy(t).subtract(i))}}(e,a),{camera:{position:A,direction:n,up:r},viewport:e,height:i,cullingVolume:me,frameNumber:t,sseDenominator:1.15}}const ye=6356752.314245179,Be=new Q.a;function getZoomFromBoundingVolume(e){var{halfAxes:e,radius:t,width:n,height:r}=e;return e?(e=function getObbSize(e){e.getColumn(0,Be);const t=e.getColumn(1),n=e.getColumn(2),r=Be.add(t).add(n),i=r.len();return i}(e),Math.log2(ye/e)):t?Math.log2(ye/t):r&&n?(Math.log2(6378137/n)+Math.log2(6378137/r))/2:1}const h={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},p={ADD:1,REPLACE:2},B={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},v={I3S:"I3S",TILES3D:"TILES3D"},be={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},ve={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};var Ee=t(281),Qe=t(503);function bounding_volume_defined(e){return null!=e}const we=new Q.a,Se=new Q.a,_e=new Q.a;function createBoundingVolume(e,t,n){if(Object(u.a)(e,"3D Tile: boundingVolume must be defined"),e.box)return function createBox(e,t,n){var r=new Q.a(e[0],e[1],e[2]);t.transform(r,r);let i=[];if(10===e.length){var o=e.slice(3,6);const a=new Ee.a,s=(a.fromArray(e,6),new Q.a([1,0,0])),A=new Q.a([0,1,0]),l=new Q.a([0,0,1]);s.transformByQuaternion(a),s.scale(o[0]),A.transformByQuaternion(a),A.scale(o[1]),l.transformByQuaternion(a),l.scale(o[2]),i=[...s.toArray(),...A.toArray(),...l.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];o=t.transformAsVector(i.slice(0,3)),e=t.transformAsVector(i.slice(3,6)),t=t.transformAsVector(i.slice(6,9)),o=new Qe.a([o[0],o[1],o[2],e[0],e[1],e[2],t[0],t[1],t[2]]);if(bounding_volume_defined(n))return n.center=r,n.halfAxes=o,n;return new d.d(r,o)}(e.box,t,n);var r,i,o,a,s,A;if(e.region)return[o,r,A,a,s,i]=e.region,o=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian([Object(I.i)(o),Object(I.i)(a),s],Se),a=ellipsoid_Ellipsoid.WGS84.cartographicToCartesian([Object(I.i)(A),Object(I.i)(r),i],_e),s=(new Q.a).addVectors(o,a).multiplyScalar(.5),A=(new Q.a).subVectors(o,a).len()/2,createSphere([s[0],s[1],s[2],A],new y.a);if(e.sphere)return createSphere(e.sphere,t,n);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function createSphere(e,t,n){var r=new Q.a(e[0],e[1],e[2]),t=(t.transform(r,r),t.getScale(we)),t=Math.max(Math.max(t[0],t[1]),t[2]),e=e[3]*t;return bounding_volume_defined(n)?(n.center=r,n.radius=e,n):new d.b(r,e)}new Q.a,new Q.a,new y.a,new Q.a,new Q.a,new Q.a;function getDynamicScreenSpaceError(e,t){var n;return e.dynamicScreenSpaceError&&e.dynamicScreenSpaceErrorComputedDensity?(n=e.dynamicScreenSpaceErrorComputedDensity,e=e.dynamicScreenSpaceErrorFactor,function fog(e,t){return e*=t,1-Math.exp(-e*e)}(t,n)*e):0}const E=6378137,xe=Math.PI/2;function projectVertexToSphere([e,t,n]){var r=Object(I.s)(e),i=Object(I.s)(t),o=1+n/E,a=o*Math.cos(i);return[e=a*Math.cos(r),t=a*Math.sin(r),n=o*Math.sin(i)]}function getDistanceFromLatLon(e,t){var[e,n,r=0]=e,[t,i,o=0]=t,t=projectVertexToSphere([t,i,o]),i=projectVertexToSphere([e,n,r]),o=i[0]-t[0],e=i[1]-t[1],n=i[2]-t[2];return o*o+e*e+n*n}function getI3ScreenSize(e,t){const n=t.viewport;var r=e.header.mbs[1],i=e.header.mbs[0],o=e.header.mbs[2],e=e.header.mbs[3],i=[i,r,o],r=getDistanceFromLatLon(n.unprojectPosition(n.cameraPosition),i),o=e/E,i=r-o*o;return i<=0?170141175e30:function getTanOfHalfVFAngle(e){e=e.viewport.projectionMatrix,e=e[5];return e}(t)*o/Math.sqrt(i)*300}class managed_array_ManagedArray{constructor(e=0){this._array=new Array(e),this._map=new Map,this._length=e}get length(){return this._length}set length(e){(this._length=e)>this._array.length&&(this._array.length=e)}get values(){return this._array}get(e){return Object(u.a)(e=this.length&&(this.length=e+1),this._map.has(this._array[e])&&this._map.delete(this._array[e]),this._array[e]=t,this._map.set(t,e)}delete(e){var t=this._map.get(e);0<=t&&(this._array.splice(t,1),this._map.delete(e),this.length--)}peek(){return this._array[this._length-1]}push(e){var t;this._map.has(e)||(t=this.length++,this._array[t]=e,this._map.set(e,t))}pop(){var e=this._array[--this.length];return this._map.delete(e),e}reserve(e){Object(u.a)(0<=e),e>this._array.length&&(this._array.length=e)}resize(e){Object(u.a)(0<=e),this.length=e}trim(e){null==e&&(e=this.length),this._array.length=e}reset(){this._array=[],this._map=new Map,this._length=0}find(e){return this._map.has(e)}}const Re={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class tileset_traverser_TilesetTraverser{constructor(e){Object(i.a)(this,"options",void 0),Object(i.a)(this,"root",void 0),Object(i.a)(this,"requestedTiles",void 0),Object(i.a)(this,"selectedTiles",void 0),Object(i.a)(this,"emptyTiles",void 0),Object(i.a)(this,"_traversalStack",void 0),Object(i.a)(this,"_emptyTraversalStack",void 0),Object(i.a)(this,"_frameNumber",void 0),this.options={...Re,...e},this._traversalStack=new managed_array_ManagedArray,this._emptyTraversalStack=new managed_array_ManagedArray,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(e,t,n){this.root=e,this.options={...this.options,...n},this.reset(),this.updateTile(e,t),this._frameNumber=t.frameNumber,this.executeTraversal(e,t)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(e,t){const n=this._traversalStack;for(e._selectionDepth=1,n.push(e);0this.options.maximumScreenSpaceError}updateTileVisibility(e,t){const n=[];if(this.options.viewportTraversersMap)for(const r in this.options.viewportTraversersMap)this.options.viewportTraversersMap[r]===t.viewport.id&&n.push(r);else n.push(t.viewport.id);e.updateVisibility(t,n)}compareDistanceToCamera(e,t){return e._distanceToCamera-t._distanceToCamera}anyChildrenVisible(e,t){let n=!1;for(const r of e.children)r.updateVisibility(t),n=n||r.isVisibleAndInRequestVolume;return n}executeEmptyTraversal(e,t){let n=!0;const r=this._emptyTraversalStack;for(r.push(e);0{this._statusMap[t].status=De.COMPLETED,this._statusMap[t].callback(e,r)}).catch(e=>{this._statusMap[t].status=De.ERROR,n(e)}))}update(e,t){this._statusMap[e]&&(this._statusMap[e].frameState=t)}find(e){return this._statusMap[e]}}class i3s_tileset_traverser_I3STilesetTraverser extends tileset_traverser_TilesetTraverser{constructor(e){super(e),Object(i.a)(this,"_tileManager",void 0),this._tileManager=new i3s_tile_manager_I3STileManager}shouldRefine(e,t){return e._lodJudge=function lodJudge(e,t){var n=(s=t.viewport).metersPerPixel,r=e.header.mbs[1],i=e.header.mbs[0],o=e.header.mbs[2],a=e.header.mbs[3],{height:s,width:A,latitude:l,longitude:c}=s,g=[c,l],o=[i,r,o],c=[c,r],r=[i,l],i=Math.sqrt(s*s+A*A)*n[0],l=getDistanceFromLatLon(g,o),n=.5*s+a/E,o=.5*A+a/E;return l>i+a/E||getDistanceFromLatLon(g,c)>n||getDistanceFromLatLon(g,r)>o?"OUT":0===e.lodMetricValue?"DIG":(s=getI3ScreenSize(e,t),(s*=xe)<.5?"OUT":!e.header.children||s<=e.lodMetricValue?"DRAW":e.header.children?"DIG":"OUT")}(e,t),"DIG"===e._lodJudge}updateChildTiles(t,n){var e=t.header.children||[];const r=t.children,i=t.tileset;for(const a of e){const s="".concat(a.id,"-").concat(n.viewport.id);var o=r&&r.find(e=>e.id===s);if(o)this.updateTile(o,n);else{let e=()=>this._loadTile(a.id,i);this._tileManager.find(s)?this._tileManager.update(s,n):(i.tileset.nodePages&&(e=()=>i.tileset.nodePagesTile.formTileFromNodePages(a.id)),this._tileManager.add(e,s,e=>this._onTileLoad(e,t,s),n))}}return!1}async _loadTile(e,t){var n=t["loader"],e=t.getTileUrl("".concat(t.url,"/nodes/").concat(e)),t={...t.loadOptions,i3s:{...t.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return Object(z.a)(e,n,t)}_onTileLoad(e,t,n){e=new tile_3d_TileHeader(t.tileset,e,t,n),t.children.push(e),n=this._tileManager.find(e.id).frameState;this.updateTile(e,n),this._frameNumber===n.frameNumber&&this.executeTraversal(e,n)}}const Ge={description:"",ellipsoid:ellipsoid_Ellipsoid.WGS84,modelMatrix:new y.a,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:e=>e,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},Ne="Tiles In Tileset(s)",ke="Tiles In Memory",Te="Tiles In View",Me="Tiles To Render",Ue="Tiles Loaded",Oe="Tiles Loading",Le="Tiles Unloaded",Pe="Failed Tile Loads",Ve="Tile Memory Use";class tileset_3d_Tileset3D{constructor(e,t){Object(i.a)(this,"options",void 0),Object(i.a)(this,"loadOptions",void 0),Object(i.a)(this,"type",void 0),Object(i.a)(this,"tileset",void 0),Object(i.a)(this,"loader",void 0),Object(i.a)(this,"url",void 0),Object(i.a)(this,"basePath",void 0),Object(i.a)(this,"modelMatrix",void 0),Object(i.a)(this,"ellipsoid",void 0),Object(i.a)(this,"lodMetricType",void 0),Object(i.a)(this,"lodMetricValue",void 0),Object(i.a)(this,"refine",void 0),Object(i.a)(this,"root",void 0),Object(i.a)(this,"roots",void 0),Object(i.a)(this,"asset",void 0),Object(i.a)(this,"description",void 0),Object(i.a)(this,"properties",void 0),Object(i.a)(this,"extras",void 0),Object(i.a)(this,"attributions",void 0),Object(i.a)(this,"credits",void 0),Object(i.a)(this,"stats",void 0),Object(i.a)(this,"traverseCounter",void 0),Object(i.a)(this,"geometricError",void 0),Object(i.a)(this,"selectedTiles",void 0),Object(i.a)(this,"cartographicCenter",void 0),Object(i.a)(this,"cartesianCenter",void 0),Object(i.a)(this,"zoom",void 0),Object(i.a)(this,"boundingVolume",void 0),Object(i.a)(this,"gpuMemoryUsageInBytes",void 0),Object(i.a)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),Object(i.a)(this,"_traverser",void 0),Object(i.a)(this,"_cache",void 0),Object(i.a)(this,"_requestScheduler",void 0),Object(i.a)(this,"_frameNumber",void 0),Object(i.a)(this,"_queryParamsString",void 0),Object(i.a)(this,"_queryParams",void 0),Object(i.a)(this,"_extensionsUsed",void 0),Object(i.a)(this,"_tiles",void 0),Object(i.a)(this,"_pendingCount",void 0),Object(i.a)(this,"lastUpdatedVieports",void 0),Object(i.a)(this,"_requestedTiles",void 0),Object(i.a)(this,"_emptyTiles",void 0),Object(i.a)(this,"frameStateData",void 0),Object(i.a)(this,"maximumMemoryUsage",void 0),Object(u.a)(e),this.options={...Ge,...t},this.tileset=e,this.loader=e.loader,this.type=e.type,this.url=e.url,this.basePath=e.basePath||pe.a.dirname(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=e.lodMetricType,this.lodMetricValue=e.lodMetricValue,this.refine=e.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new tileset_cache_TilesetCache,this._requestScheduler=new fe.a({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new he.a({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this._initializeTileSet(e)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function getQueryParamString(e){const t=[];for(const n of Object.keys(e))t.push("".concat(n,"=").concat(e[n]));switch(t.length){case 0:return"";case 1:return"?".concat(t[0]);default:return"?".concat(t.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(e){this.options={...this.options,...e}}setOptions(e){this.options={...this.options,...e}}getTileUrl(e){return e.startsWith("data:")?e:"".concat(e).concat(this.queryParams)}hasExtension(e){return Boolean(this._extensionsUsed&&-1e.id)),r=new Set(t.map(e=>e.id));return 0!r.has(e.id)).length||0!n.has(e.id)).length}_loadTiles(){for(const e of this._requestedTiles)e.contentUnloaded&&this._loadTile(e)}_unloadTiles(){this._cache.unloadTiles(this,(e,t)=>e._unloadTile(t))}_updateStats(){let e=0,t=0;for(const n of this.selectedTiles)n.contentAvailable&&n.content&&(e++,n.content.pointCount&&(t+=n.content.pointCount));this.stats.get(Te).count=this.selectedTiles.length,this.stats.get(Me).count=e,this.stats.get("Points").count=t}_initializeTileSet(e){this.root=this._initializeTileHeaders(e,null),this.type===v.TILES3D&&this._initializeCesiumTileset(e),this.type===v.I3S&&this._initializeI3STileset(),this._calculateViewProps()}_calculateViewProps(){var e=this.root,t=(Object(u.a)(e),e.boundingVolume)["center"];if(!t)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new Q.a,void(this.zoom=1);this.cartographicCenter=ellipsoid_Ellipsoid.WGS84.cartesianToCartographic(t,new Q.a),this.cartesianCenter=t,this.zoom=getZoomFromBoundingVolume(e.boundingVolume)}_initializeStats(){this.stats.get(Ne),this.stats.get(Oe),this.stats.get(ke),this.stats.get(Te),this.stats.get(Me),this.stats.get(Ue),this.stats.get(Le),this.stats.get(Pe),this.stats.get("Points","memory"),this.stats.get(Ve,"memory")}_initializeTileHeaders(e,t){const n=new tile_3d_TileHeader(this,e.root,t);if(t&&(t.children.push(n),n.depth=t.depth+1),this.type===v.TILES3D){const r=[];for(r.push(n);0e._updateCacheStats(t))}_updateCacheStats(e){this.stats.get(Ue).incrementCount(),this.stats.get(ke).incrementCount(),this.gpuMemoryUsageInBytes+=e.content.byteLength||0,this.stats.get(Ve).count=this.gpuMemoryUsageInBytes}_unloadTile(e){this.gpuMemoryUsageInBytes-=e.content&&e.content.byteLength||0,this.stats.get(ke).decrementCount(),this.stats.get(Le).incrementCount(),this.stats.get(Ve).count=this.gpuMemoryUsageInBytes,this.options.onTileUnload(e),e.unloadContent()}_destroy(){const e=[];for(this.root&&e.push(this.root);0e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Je={SCALAR:(e,t,n)=>{t[n]=e},VEC2:(e,t,n)=>{t[2*n+0]=e[0],t[2*n+1]=e[1]},VEC3:(e,t,n)=>{t[3*n+0]=e[0],t[3*n+1]=e[1],t[3*n+2]=e[2]},VEC4:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT2:(e,t,n)=>{t[4*n+0]=e[0],t[4*n+1]=e[1],t[4*n+2]=e[2],t[4*n+3]=e[3]},MAT3:(e,t,n)=>{t[9*n+0]=e[0],t[9*n+1]=e[1],t[9*n+2]=e[2],t[9*n+3]=e[3],t[9*n+4]=e[4],t[9*n+5]=e[5],t[9*n+6]=e[6],t[9*n+7]=e[7],t[9*n+8]=e[8],t[9*n+9]=e[9]},MAT4:(e,t,n)=>{t[16*n+0]=e[0],t[16*n+1]=e[1],t[16*n+2]=e[2],t[16*n+3]=e[3],t[16*n+4]=e[4],t[16*n+5]=e[5],t[16*n+6]=e[6],t[16*n+7]=e[7],t[16*n+8]=e[8],t[16*n+9]=e[9],t[16*n+10]=e[10],t[16*n+11]=e[11],t[16*n+12]=e[12],t[16*n+13]=e[13],t[16*n+14]=e[14],t[16*n+15]=e[15]}};const x=e=>void 0!==e;function initializeHierarchy(e,t,n){if(!t)return null;let r=e.getExtension("3DTILES_batch_table_hierarchy");e=t.HIERARCHY;return e&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=e,r=e),r?function initializeHierarchyValues(e,t){let n,r,i;const o=e.instancesLength,a=e.classes;let s=e.classIds,A=e.parentCounts,l=e.parentIds,c=o;x(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,o));let g;if(x(A))for(x(A.byteOffset)&&(A.componentType=defaultValue(A.componentType,GL.UNSIGNED_SHORT),A.type=AttributeType.SCALAR,i=getBinaryAccessor(A),A=i.createArrayBufferView(t.buffer,t.byteOffset+A.byteOffset,o)),g=new Uint16Array(o),c=0,n=0;ne,Xe={HIERARCHY:!0,extensions:!0,extras:!0};class tile_3d_batch_table_Tile3DBatchTableParser{constructor(e,t,n,r={}){Object(u.a)(0<=n),this.json=e||{},this.binary=t,this.featureCount=n,this._extensions=(null==(e=this.json)?void 0:e.extensions)||{},this._properties={};for(const i in this.json)Xe[i]||(this._properties[i]=this.json[i]);this._binaryProperties=this._initializeBinaryProperties(),r["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=initializeHierarchy(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,n){return this._checkBatchId(e),Object(u.a)("string"==typeof n,n),!!this._hierarchy&&tile_3d_batch_table_defined(traverseHierarchy(this._hierarchy,e,(e,t)=>{t=e.classIds[t];return e.classes[t].name===n}))}isExactClass(e,t){return Object(u.a)("string"==typeof t,t),this.getExactClassName(e)===t}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy)return e=this._hierarchy.classIds[e],this._hierarchy.classes[e].name}hasProperty(e,t){return this._checkBatchId(e),Object(u.a)("string"==typeof t,t),tile_3d_batch_table_defined(this._properties[t])||this._hasPropertyInHierarchy(e,t)}getPropertyNames(e,t){this._checkBatchId(e),(t=tile_3d_batch_table_defined(t)?t:[]).length=0;var n=Object.keys(this._properties);return t.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,t),t}getProperty(e,t){if(this._checkBatchId(e),Object(u.a)("string"==typeof t,t),this._binaryProperties){var n=this._binaryProperties[t];if(tile_3d_batch_table_defined(n))return this._getBinaryProperty(n,e)}n=this._properties[t];if(tile_3d_batch_table_defined(n))return Ke(n[e]);if(this._hierarchy){n=this._getHierarchyProperty(e,t);if(tile_3d_batch_table_defined(n))return n}}setProperty(t,n,r){var i=this.featureCount;if(this._checkBatchId(t),Object(u.a)("string"==typeof n,n),this._binaryProperties){var e=this._binaryProperties[n];if(e)return void this._setBinaryProperty(e,t,r)}if(!this._hierarchy||!this._setHierarchyProperty(this,t,n,r)){let e=this._properties[n];tile_3d_batch_table_defined(e)||(this._properties[n]=new Array(i),e=this._properties[n]),e[t]=r}}_checkBatchId(e){if(!(0<=e&&e{t=e.classIds[t];return tile_3d_batch_table_defined(e.classes[t].instances[n])});return tile_3d_batch_table_defined(e)}_getPropertyNamesInHierarchy(e,i){traverseHierarchy(this._hierarchy,e,(e,t)=>{t=e.classIds[t];const n=e.classes[t].instances;for(const r in n)n.hasOwnProperty(r)&&-1===i.indexOf(r)&&i.push(r)})}_getHierarchyProperty(e,r){return traverseHierarchy(this._hierarchy,e,(e,t)=>{var n=e.classIds[t],n=e.classes[n],e=e.classIndexes[t],t=n.instances[r];return tile_3d_batch_table_defined(t)?tile_3d_batch_table_defined(t.typedArray)?this._getBinaryProperty(t,e):Ke(t[e]):null})}_setHierarchyProperty(e,i,o,a){var t=traverseHierarchy(this._hierarchy,i,(e,t)=>{var n=e.classIds[t],n=e.classes[n],e=e.classIndexes[t];const r=n.instances[o];return!!tile_3d_batch_table_defined(r)&&(Object(u.a)(t===i,'Inherited property "'.concat(o,'" is read-only.')),tile_3d_batch_table_defined(r.typedArray)?this._setBinaryProperty(r,e,a):r[e]=a,!0)});return tile_3d_batch_table_defined(t)}}const qe=4;function parse3DTileHeaderSync(e,t,n=0){const r=new DataView(t);if(e.magic=r.getUint32(n,!0),n+=qe,e.version=r.getUint32(n,!0),n+=qe,e.byteLength=r.getUint32(n,!0),n+=qe,1!==e.version)throw new Error("3D Tile Version ".concat(e.version," not supported"));return n}const R=4,$e="b3dm tile in legacy format.";function parse3DTileTablesHeaderSync(e,t,n){const r=new DataView(t);let i,o=(e.header=e.header||{},r.getUint32(n,!0)),a=(n+=R,r.getUint32(n,!0)),s=(n+=R,r.getUint32(n,!0)),A=(n+=R,r.getUint32(n,!0));return n+=R,570425344<=s?(n-=2*R,i=o,s=a,A=0,o=0,a=0,console.warn($e)):570425344<=A&&(n-=R,i=s,s=o,A=a,o=0,a=0,console.warn($e)),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=a,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=A,e.header.batchLength=i,n}function parse3DTileTablesSync(e,t,n){return n=function parse3DTileBatchTable(e,t,n,r){var{batchTableJsonByteLength:i,batchTableBinaryByteLength:o}=e.header;{var a;0255*e);s[3*e]=o[0],s[3*e+1]=o[1],s[3*e+2]=o[2]}return{type:_.UNSIGNED_BYTE,value:s,size:3,normalized:!0}}if(e){const l=new Uint8ClampedArray(3*i);for(let e=0;e>5&63,r=31&e;return t[0]=(e>>11&31)<<3,t[1]=n<<2,t[2]=r<<3,t}(t[e]);l[3*e]=a[0],l[3*e+1]=a[1],l[3*e+2]=a[2]}return{type:_.UNSIGNED_BYTE,value:l,size:3,normalized:!0}}return t&&t.length===3*i?{type:_.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:_.UNSIGNED_BYTE,value:t,size:4,normalized:!0}}n=t(501);function assert_assert(e,t){if(!e)throw new Error("math.gl assertion failed. ".concat(t))}new n.a,new Q.a,new n.a,new n.a,new Uint8Array(1);function fromSNorm(e,t=255){return Object(I.d)(e,0,t)/t*2-1}function signNotZero(e){return e<0?-1:1}function octDecodeInRange(e,t,n,r){if(assert_assert(r),e<0||n{},compare:!1},onTileLoad:{type:"function",value:e=>{},compare:!1},onTileUnload:{type:"function",value:e=>{},compare:!1},onTileError:{type:"function",value:(e,t,n)=>{},compare:!1},_getMeshColor:{type:"function",value:e=>[255,255,255],compare:!1}};class tile_3d_layer_Tile3DLayer extends e.a{initializeState(){"onTileLoadFail"in this.props&&Y.a.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){const e=this.state["tileset3d"];return e&&e.isLoaded()}shouldUpdateState({changeFlags:e}){return e.somethingChanged}updateState({props:e,oldProps:t,changeFlags:n}){if(e.data&&e.data!==t.data&&this._loadTileset(e.data),n.viewportChanged&&(t=this.state["activeViewports"],Object.keys(t).length&&(this._updateTileset(t),this.state.lastUpdatedViewports=t,this.state.activeViewports={})),n.propsChanged){const r=this.state["layerMap"];for(const i in r)r[i].needsUpdate=!0}}activateViewport(e){const{activeViewports:t,lastUpdatedViewports:n}=this.state;this.internalState.viewport=e,t[e.id]=e;var r=null==n?void 0:n[e.id];r&&e.equals(r)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo({info:e,sourceLayer:t}){var n=this.state["layerMap"];const r=t&&t.id;if(r){const i=r.substring(this.id.length+1);t=i.substring(i.indexOf("-")+1);e.object=n[t]&&n[t].tile}return e}filterSubLayer({layer:e,viewport:t}){const n=e.props["tile"];e=t.id;return this.props.visible&&n.selected&&n.viewportIds.includes(e)}_updateAutoHighlight(e){e.sourceLayer&&e.sourceLayer.updateAutoHighlight(e)}async _loadTileset(e){var{loadOptions:t={}}=this.props;let n=this.props.loader||this.props.loaders;Array.isArray(n)&&(n=n[0]);const r={loadOptions:{...t}};n.preload&&((t=await n.preload(e,t)).headers&&(r.loadOptions.fetch={...r.loadOptions.fetch,headers:t.headers}),Object.assign(r,t));t=await Object(z.a)(e,n,r.loadOptions),e=new tileset_3d_Tileset3D(t,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileLoadFail:this.props.onTileError,...r});this.setState({tileset3d:e,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(e)}_onTileLoad(e){var t=this.state["lastUpdatedViewports"];this.props.onTileLoad(e),this._updateTileset(t),this.setNeedsUpdate()}_onTileUnload(e){delete this.state.layerMap[e.id],this.props.onTileUnload(e)}_updateTileset(e){const t=this.state["tileset3d"];var n=this.context["timeline"],r=Object.keys(e).length;n&&r&&t&&(n=t.update(Object.values(e)),this.state.frameNumber!==n&&this.setState({frameNumber:n}))}_getSubLayer(e,t){if(!e.content)return null;switch(e.type){case B.POINTCLOUD:return this._makePointCloudLayer(e,t);case B.SCENEGRAPH:return this._make3DModelLayer(e,t);case B.MESH:return this._makeSimpleMeshLayer(e,t);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(e.content.type))}}_makePointCloudLayer(e,t){var{attributes:n,pointCount:r,constantRGBA:i,cartographicOrigin:o,modelMatrix:a}=e.content,{positions:n,normals:s,colors:A}=n;if(!n)return null;var t=t&&t.props.data||{header:{vertexCount:r},attributes:{POSITION:n,NORMAL:s,COLOR_0:A}},{pointSize:r,getPointColor:n}=this.props;const l=this.getSubLayerClass("pointcloud",P.a);return new l({pointSize:r},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(e.id),tile:e,data:t,coordinateSystem:g.a.METER_OFFSETS,coordinateOrigin:o,modelMatrix:a,getColor:i||n,_offset:0})}_make3DModelLayer(e){var{gltf:t,instances:n,cartographicOrigin:r,modelMatrix:i}=e.content;const o=this.getSubLayerClass("scenegraph",V.a);return new o({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(e.id),tile:e,data:n||ot,scenegraph:t,coordinateSystem:g.a.METER_OFFSETS,coordinateOrigin:r,modelMatrix:i,getTransformMatrix:e=>e.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(e,t){var{attributes:n,indices:r,modelMatrix:i,cartographicOrigin:o,material:a,featureIds:s}=e.content;const A=this.props["_getMeshColor"];t=t&&t.props.mesh||new L.a({drawMode:4,attributes:function getMeshGeometry(e){const t={};t.positions={...e.positions,value:new Float32Array(e.positions.value)},e.normals&&(t.normals=e.normals);e.texCoords&&(t.texCoords=e.texCoords);e.colors&&(t.colors=e.colors);e.uvRegions&&(t.uvRegions=e.uvRegions);return t}(n),indices:r});const l=this.getSubLayerClass("mesh",mesh_layer_MeshLayer);return new l(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(e.id),tile:e,mesh:t,data:ot,getColor:A(e),pbrMaterial:a,modelMatrix:i,coordinateOrigin:o,coordinateSystem:g.a.METER_OFFSETS,featureIds:s,_offset:0})}renderLayers(){const{tileset3d:e,layerMap:r}=this.state;return e?e.tiles.map(e=>{const t=r[e.id]=r[e.id]||{tile:e};let n=t["layer"];return e.selected&&(n?t.needsUpdate&&(n=this._getSubLayer(e,n),t.needsUpdate=!1):n=this._getSubLayer(e)),t.layer=n}).filter(Boolean):null}}tile_3d_layer_Tile3DLayer.layerName="Tile3DLayer",tile_3d_layer_Tile3DLayer.defaultProps=n;var at=t(239),n={name:"Terrain",id:"terrain",module:"terrain",version:"3.0.13",worker:!0,extensions:["png","pngraw"],mimeTypes:["image/png"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}},F=t(96);const st=[1];n={...m.a.defaultProps,elevationData:F.f,texture:{...F.f,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0,loaders:[n]};function urlTemplateToUpdateTrigger(e){return Array.isArray(e)?e.join(";"):e}class terrain_layer_TerrainLayer extends e.a{updateState({props:e,oldProps:t}){var n=e.elevationData!==t.elevationData;if(n){const i=e["elevationData"];var r=i&&(Array.isArray(i)||i.includes("{x}")&&i.includes("{y}"));this.setState({isTiled:r})}r=n||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;!this.state.isTiled&&r&&(n=this.loadTerrain(e),this.setState({terrain:n})),e.workerUrl&&Y.a.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:n,meshMaxError:r,signal:i}){var o;if(!e)return null;var a={...a=this.getLoadOptions(),terrain:{skirtHeight:this.state.isTiled?2*r:0,...null==(o=a)?void 0:o.terrain,bounds:t,meshMaxError:r,elevationDecoder:n}};const s=this.props["fetch"];return s(e,{propName:"elevationData",layer:this,loadOptions:a,signal:i})}getTiledTerrainData(e){const{elevationData:t,fetch:n,texture:r,elevationDecoder:i,meshMaxError:o}=this.props;var a=Object(F.b)(t,e),s=Object(F.b)(r,e),{bbox:e,signal:A,z:l}=e;const c=new at.a({longitude:(e.west+e.east)/2,latitude:(e.north+e.south)/2,zoom:l});l=c.projectFlat([e.west,e.south]),e=c.projectFlat([e.east,e.north]),l=[l[0],l[1],e[0],e[1]],e=this.loadTerrain({elevationData:a,bounds:l,elevationDecoder:i,meshMaxError:o,signal:A}),a=s?n(s,{propName:"texture",layer:this,loaders:[],signal:A}).catch(e=>null):Promise.resolve(null);return Promise.all([e,a])}renderSubLayers(e){const t=this.getSubLayerClass("mesh",j.a);var{data:n,color:r}=e;if(!n)return null;var[n,i]=n;return new t(e,{data:st,mesh:n,texture:i,coordinateSystem:g.a.CARTESIAN,getPosition:e=>[0,0,0],getColor:r})}onViewportLoad(e){if(e){var t,n=this.state["zRange"];const r=e.map(e=>e.content).filter(Boolean).map(e=>{const t=e[0].header.boundingBox;return t.map(e=>e[2])});0!==r.length&&(e=Math.min(...r.map(e=>e[0])),t=Math.max(...r.map(e=>e[1])),(!n||en[1])&&this.setState({zRange:[e,t]}))}}renderLayers(){var{color:e,material:t,elevationData:n,texture:r,wireframe:i,meshMaxError:o,elevationDecoder:a,tileSize:s,maxZoom:A,minZoom:l,extent:c,maxRequests:g,onTileLoad:u,onTileUnload:d,onTileError:h,maxCacheSize:p,maxCacheByteSize:f,refinementStrategy:I}=this.props;if(this.state.isTiled)return new m.a(this.getSubLayerProps({id:"tiles"}),{wireframe:i,color:e,material:t,getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:urlTemplateToUpdateTrigger(n),texture:urlTemplateToUpdateTrigger(r),meshMaxError:o,elevationDecoder:a}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:s,maxZoom:A,minZoom:l,extent:c,maxRequests:g,onTileLoad:u,onTileUnload:d,onTileError:h,maxCacheSize:p,maxCacheByteSize:f,refinementStrategy:I});const C=this.getSubLayerClass("mesh",j.a);return new C(this.getSubLayerProps({id:"mesh"}),{data:st,mesh:this.state.terrain,texture:r,_instanced:!1,getPosition:e=>[0,0,0],getColor:e,material:t,wireframe:i})}}terrain_layer_TerrainLayer.layerName="TerrainLayer",terrain_layer_TerrainLayer.defaultProps=n;t(71);t(469);e={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.0.13",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{coordinates:"local",layerProperty:"layerName",layers:null,tileIndex:null}}};function binaryToGeojson(e,t){var n=null==t?void 0:t.globalFeatureId;return void 0!==n?function getSingleFeature(r,i){var e=normalizeInput(r);for(const r of e){let t=0,n=r.featureIds.value[0];for(let e=0;et<=e&&e<=n),e=2n<=e&&e<=r);const a=t.primitivePolygonIndices.value.filter(e=>n<=e&&e<=r);const e=2LineString(e,t,n))},Polygon:Polygon,MultiPolygon:function MultiPolygon(e,t,n){return e.map(e=>Polygon(e,t,n))}};function Point([e,t],[n,r],i){e=Object(a.lerp)(n[0],r[0],e),n=Object(a.lerp)(n[1],r[1],t);return i.unprojectFlat([e,n])}function getPoints(e,t,n){return e.map(e=>Point(e,t,n))}function LineString(e,t,n){return getPoints(e,t,n)}function Polygon(e,t,n){return e.map(e=>getPoints(e,t,n))}const pt=["points","lines","polygons"];function findIndexBinary(e,t,n,r){for(const o of pt){var i=e[o]&&function findIndexByType(e,t,n,r){const i=e.featureIds.value;if(!i.length)return-1;let o=0,a=i[i.length-1]+1;if(r){r=function getLayerRange(e,t){if(!e.__layers){const i={};var n=e["properties"];for(let e=0;ee===n&&i[t]>=o&&i[t]e[t]===n,o,a):findIndex(e.fields,e=>e.id===n,o,a)}return 0<=s?function getGlobalFeatureId(e,t){if(!e.__ids){const i=[];var n=e.featureIds.value,r=e.globalFeatureIds.value;for(let e=0;ee.minZoom&&(t.minZoom=n.minzoom),Number.isFinite(n.maxzoom)&&(!Number.isFinite(e.maxZoom)||n.maxzoom{var t=getFeatureUniqueId(e,r)===A,e=s||getFeatureLayerName(e)===n;return t&&e}):a&&o?findIndexBinary(a,r,A,s?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context;var r=n.width,i=n.height,o=n.x,a=n.y,s=[this.id];return t.pickObjects({x:o,y:a,width:r,height:i,layerIds:s,maxObjects:e})}getRenderedFeatures(e=null){e=this._pickObjects(e);const t=new Set,n=[];for(const i of e){var r=getFeatureUniqueId(i.object,this.props.uniqueIdProperty);void 0===r?n.push(i.object):t.has(r)||(t.add(r),n.push(i.object))}return n}_setWGS84PropertyForTiles(){const e="dataInWGS84",t=this.state["tileset"];t.selectedTiles.forEach(t=>{t.hasOwnProperty(e)||Object.defineProperty(t,e,{get:()=>{if(!t.content)return null;if(this.props.binary&&Array.isArray(t.content)&&!t.content.length)return[];if(void 0===t._contentWGS84){const e=this.props.binary?binaryToGeojson(t.content):t.content;t._contentWGS84=e.map(e=>transformTileCoordsToWGS84(e,t.bbox,this.context.viewport))}return t._contentWGS84}})})}}function getFeatureUniqueId(e,t){return t?e.properties[t]:"id"in e?e.id:void 0}function getFeatureLayerName(e){return(null==(e=e.properties)?void 0:e.layerName)||null}function isFeatureIdDefined(e){return null!=e&&""!==e}function transformTileCoordsToWGS84(e,t,n){var r={...e,geometry:{type:e.geometry.type}};return Object.defineProperty(r.geometry,"coordinates",{get:()=>{return function coordinate_transform_transform(e,t,n){return t=[n.projectFlat([t.west,t.north]),n.projectFlat([t.east,t.south])],{...e,coordinates:ht[e.type](e.coordinates,t,n)}}(e.geometry,t,n).coordinates}}),r}mvt_layer_MVTLayer.layerName="MVTLayer",mvt_layer_MVTLayer.defaultProps=lt},function(R,e,t){"use strict";t.d(e,"a",function(){return deck_Deck});var i=t(348),n=t(139),b=t(28),r=t(122);class view_manager_ViewManager{constructor(e={}){this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=e.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="Initial render",this._needsUpdate=!0,this._eventManager=e.eventManager,this._eventCallbacks={onViewStateChange:e.onViewStateChange,onInteractionStateChange:e.onInteractionStateChange},Object.seal(this),this.setProps(e)}finalize(){for(const e in this.controllers)this.controllers[e]&&this.controllers[e].finalize();this.controllers={}}needsRedraw(e={clearRedrawFlags:!1}){var t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}setNeedsUpdate(e){this._needsUpdate=this._needsUpdate||e,this._needsRedraw=this._needsRedraw||e}updateViewStates(){for(const e in this.controllers){const t=this.controllers[e];t&&t.updateTransition()}}getViewports(t){return t?this._viewports.filter(e=>e.containsPixel(t)):this._viewports}getViews(){const t={};return this.views.forEach(e=>{t[e.id]=e}),t}getView(t){return"string"==typeof t?this.views.find(e=>e.id===t):t}getViewState(e){const t=this.getView(e);e=t&&this.viewState[t.getViewStateId()]||this.viewState;return t?t.filterViewState(e):e}getViewport(e){return this._viewportMap[e]}unproject(t,n){var r=this.getViewports(),i={x:t[0],y:t[1]};for(let e=r.length-1;0<=e;--e){const o=r[e];if(o.containsPixel(i)){const a=t.slice();return a[0]-=o.x,a[1]-=o.y,o.unproject(a,n)}}return null}setProps(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()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(e,t){e===this.width&&t===this.height||(this.width=e,this.height=t,this.setNeedsUpdate("Size changed"))}_setViews(e){e=Object(r.b)(e,Boolean),this._diffViews(e,this.views)&&this.setNeedsUpdate("views changed"),this.views=e}_setViewState(e){e?(Object(n.a)(e,this.viewState)||this.setNeedsUpdate("viewState changed"),this.viewState=e):b.a.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(e,t){t.viewId=e,this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange(t)}_createController(t,e){const n=e.type;return new n({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>t._getViewport(e,{width:e.width,height:e.height}),...e})}_updateController(e,t,n,r){var i=e.controller;return i?(i={...t,...e.props,...i,id:e.id,x:n.x,y:n.y,width:n.width,height:n.height},r?r.setProps(i):r=this._createController(e,i),r):null}_rebuildViewports(){var{width:n,height:r,views:i}=this;const o=this.controllers;this._viewports=[];let a=!(this.controllers={});for(let t=i.length;t--;){const l=i[t];var s=this.getViewState(l),A=l.makeViewport({width:n,height:r,viewState:s});let e=o[l.id];!(a=l.controller&&!e?!0:a)&&l.controller||!e||(e.finalize(),e=null),this.controllers[l.id]=this._updateController(l,s,A,e),this._viewports.unshift(A)}for(const e in o)o[e]&&!this.controllers[e]&&o[e].finalize();this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach(e=>{e.id&&(this._viewportMap[e.id]=this._viewportMap[e.id]||e)})}_diffViews(n,r){return n.length!==r.length||n.some((e,t)=>!n[t].equals(r[t]))}}var o=t(340),a=t(280);const s=new a.a;class effect_manager_EffectManager{constructor(){this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(e){"effects"in e&&(e.effects.length===this.effects.length&&Object(n.a)(e.effects,this.effects)||(this.setEffects(e.effects),this._needsRedraw="effects changed"))}needsRedraw(e={clearRedrawFlags:!1}){var t=this._needsRedraw;return e.clearRedrawFlags&&(this._needsRedraw=!1),t}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(e=[]){this.cleanup(),this.effects=e,this._createInternalEffects()}cleanup(){for(const e of this.effects)e.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}_createInternalEffects(){this._internalEffects=this.effects.slice(),this.effects.some(e=>e instanceof a.a)||this._internalEffects.push(s)}}var A=t(175),l=t(351),c=t(137),g=t(208),v=t(7),u=t(485),d=t(367);const E={pickedColor:null,pickedLayer:null,pickedObjectIndex:-1};function getEmptyPickingInfo({pickInfo:e,mode:t,viewports:n,layerFilter:r,pixelRatio:i,x:o,y:a,z:s}){const A=e&&e.pickedLayer;const l=function getViewportFromCoordinates(t,n,r){for(let e=t.length-1;0<=e;e--){const i=t[e];if(i.containsPixel(n)&&(!r||r(i)))return i}return t[0]}(n,{x:o,y:a},r&&A&&(e=>r({layer:A,viewport:e,isPicking:!0,renderPass:"picking:".concat(t)})));n=l&&l.unproject([o-l.x,a-l.y],{targetZ:s});return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:o,y:a,pixel:[o,a],coordinate:n,devicePixel:e&&[e.pickedX,e.pickedY],pixelRatio:i}}function getLayerPickingInfo({layer:e,info:t,mode:n}){for(;e&&t;){var r=t.layer||null;t.sourceLayer=r,t.layer=e,t=e.getPickingInfo({info:t,mode:n,sourceLayer:r}),e=e.parent}return t}class deck_picker_DeckPicker{constructor(e){this.gl=e,this.pickingFBO=null,this.pickLayersPass=new d.a(e),this.layerFilter=null,this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(e){"layerFilter"in e&&(this.layerFilter=e.layerFilter),"_pickable"in e&&(this._pickable=e._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}pickObject(e){return this._pickClosestObject(e)}pickObjects(e){return this._pickVisibleObjects(e)}getLastPickedObject({x:e,y:t,layers:n,viewports:r},i=this.lastPickedInfo.info){const o=i&&i.layer&&i.layer.id,a=i&&i.viewport&&i.viewport.id;n=o?n.find(e=>e.id===o):null;const s=a&&r.find(e=>e.id===a)||r[0];r=s&&s.unproject([e-s.x,t-s.y]),e={x:e,y:t,viewport:s,coordinate:r,layer:n};return n?{...i,...e}:Object.assign(e,{color:null,object:null,index:-1})}_resizeBuffer(){var e=this["gl"];return this.pickingFBO||(this.pickingFBO=new c.a(e),c.a.isSupported(e,{colorBufferFloat:!0})&&(this.depthFBO=new c.a(e),this.depthFBO.attach({[36064]:new g.a(e,{format:Object(v.j)(e)?34836:6408,type:5126})}))),this.pickingFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.depthFBO&&this.depthFBO.resize({width:e.canvas.width,height:e.canvas.height}),this.pickingFBO}_getPickable(e){if(!1===this._pickable)return null;const t=e.filter(e=>e.isPickable()&&!e.isComposite);return 255t)r+=4*g;else for(let e=0;ee.props.id===d))&&A.unshift(l),n.layerId=c,n.index=s,n.info=null)}const g=getEmptyPickingInfo(e),u=new Map;return u.set(null,g),A.forEach(e=>{let t={...g};e===a&&(t.color=o,t.index=s,t.picked=!0),t=getLayerPickingInfo({layer:e,info:t,mode:r}),e===a&&"hover"===r&&(n.info=t),u.set(t.layer.id,t),"hover"===r&&t.layer.updateAutoHighlight(t)}),u}({pickInfo:m,lastPickedInfo:this.lastPickedInfo,mode:A,layers:n,layerFilter:this.layerFilter,viewports:i,x:o,y:a,z:e,pixelRatio:g})).values())y.layer&&f.push(y);if(!m.pickedColor)break}for(const B in I)n[B].restorePickingColors();return{result:f,emptyInfo:p&&p.get(null)}}_pickVisibleObjects({layers:e,views:t,viewports:n,x:r,y:i,width:o=1,height:a=1,mode:s="query",maxObjects:A=null,onViewportActive:l}){if(!(e=this._getPickable(e)))return[];this._resizeBuffer();var c=Object(v.e)(this.gl),g=Object(v.d)(this.gl,[r,i],!0),u=g.x,g=g.y+g.height,d=Object(v.d)(this.gl,[r+o,i+a],!0),h=d.x+d.width,d=d.y,p=function getUniqueObjects({pickedColors:t,layers:n}){const r=new Map;if(t)for(let e=0;e=A);e++){var C=p[e],m={color:C.pickedColor,layer:null,index:C.pickedObjectIndex,picked:!0,x:r,y:i,width:o,height:a,pixelRatio:c},m=getLayerPickingInfo({layer:C.pickedLayer,info:m,mode:s});f.has(m.object)||f.set(m.object,m)}return Array.from(f.values())}_drawAndSample({layers:e,views:t,viewports:n,onViewportActive:r,deviceRect:i,pass:o,redrawReason:a,pickZ:s}){if(e.length<1)return null;var A=s?this.depthFBO:this.pickingFBO,{x:e,y:t,width:n,height:r}=(this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:t,viewports:n,onViewportActive:r,pickingFBO:A,deviceRect:i,pass:o,redrawReason:a,pickZ:s}),i),o=new(s?Float32Array:Uint8Array)(n*r*4);return Object(u.c)(A,{sourceX:e,sourceY:t,sourceWidth:n,sourceHeight:r,target:o}),o}_getPickingRect({deviceX:e,deviceY:t,deviceRadius:n,deviceWidth:r,deviceHeight:i}){var o=Math.max(0,e-n),a=Math.max(0,t-n),r=Math.min(r,e+n+1)-o,e=Math.min(i,t+n+1)-a;return r<=0||e<=0?null:{x:o,y:a,width:r,height:e}}}const F={zIndex:1,position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:0,left:0,display:"none"};class Tooltip{constructor(e){const t=e.parentElement;t&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,F),t.appendChild(this.el)),this.isVisible=!1}setTooltip(e,t,n){const r=this.el;if("string"==typeof e)r.innerText=e;else{if(!e)return this.isVisible=!1,void(r.style.display="none");"text"in e&&(r.innerText=e.text),"html"in e&&(r.innerHTML=e.html),"className"in e&&(r.className=e.className),Object.assign(r.style,e.style)}this.isVisible=!0,r.style.display="block",r.style.transform="translate(".concat(t,"px, ").concat(n,"px)")}remove(){this.el&&this.el.remove()}}var D=t(125),e=t(463),G=t(43),N=t(1228),k=t(1216),T=t(292),M=t(290),h=t(294),h=t.n(h);const U={mousedown:1,mousemove:2,mouseup:4};!function enhancePointerEventInput(e){const n=e.prototype.handler;e.prototype.handler=function handler(t){const e=this.store;0e.pointerId===t.pointerId)&&e.push(t),n.call(this,t)}}(h.a.PointerEventInput),function enhanceMouseInput(e){e.prototype.handler=function handler(e){let t=U[e.type];1&t&&0<=e.button&&(this.pressed=!0),2&t&&0===e.which&&(t=4),this.pressed&&(4&t&&(this.pressed=!1),this.callback(this.manager,t,{pointers:[e],changedPointers:[e],pointerType:"mouse",srcEvent:e}))}}(h.a.MouseInput);var O=h.a.Manager,h=h.a;const L=h?[[h.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[h.Rotate,{enable:!1}],[h.Pinch,{enable:!1}],[h.Swipe,{enable:!1}],[h.Pan,{threshold:0,enable:!1}],[h.Press,{enable:!1}],[h.Tap,{event:"doubletap",taps:2,enable:!1}],[h.Tap,{event:"anytap",enable:!1}],[h.Tap,{enable:!1}]]:null,p={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},P={doubletap:["tap"]},V={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"};h={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]};const Z={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},f={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"};var I=t(216);const W=-1!==I.b.indexOf("firefox"),H=h["WHEEL_EVENTS"],C=4.000244140625;class wheel_input_WheelInput{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.events=H.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent,!!I.a&&{passive:!1}))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"wheel"===e&&(this.options.enable=t)}handleEvent(t){if(this.options.enable){let e=t.deltaY;I.c.WheelEvent&&(W&&t.deltaMode===I.c.WheelEvent.DOM_DELTA_PIXEL&&(e/=I.c.devicePixelRatio),t.deltaMode===I.c.WheelEvent.DOM_DELTA_LINE&&(e*=40));var n={x:t.clientX,y:t.clientY};0!==e&&e%C==0&&(e=Math.floor(e/C)),t.shiftKey&&e&&(e*=.25),this._onWheel(t,-e,n)}}_onWheel(e,t,n){this.callback({type:"wheel",center:n,delta:t,srcEvent:e,pointerType:"mouse",target:e.target})}}const j=h["MOUSE_EVENTS"],m="pointermove",y="pointerover",B="pointerout",Q="pointerleave";class MoveInput{constructor(t,e,n={}){this.element=t,this.callback=e,this.pressed=!1,this.options=Object.assign({enable:!0},n),this.enableMoveEvent=this.options.enable,this.enableLeaveEvent=this.options.enable,this.enableOutEvent=this.options.enable,this.enableOverEvent=this.options.enable,this.events=j.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){e===m&&(this.enableMoveEvent=t),e===y&&(this.enableOverEvent=t),e===B&&(this.enableOutEvent=t),e===Q&&(this.enableLeaveEvent=t)}handleEvent(e){this.handleOverEvent(e),this.handleOutEvent(e),this.handleLeaveEvent(e),this.handleMoveEvent(e)}handleOverEvent(e){this.enableOverEvent&&"mouseover"===e.type&&this.callback({type:y,srcEvent:e,pointerType:"mouse",target:e.target})}handleOutEvent(e){this.enableOutEvent&&"mouseout"===e.type&&this.callback({type:B,srcEvent:e,pointerType:"mouse",target:e.target})}handleLeaveEvent(e){this.enableLeaveEvent&&"mouseleave"===e.type&&this.callback({type:Q,srcEvent:e,pointerType:"mouse",target:e.target})}handleMoveEvent(e){if(this.enableMoveEvent)switch(e.type){case"mousedown":0<=e.button&&(this.pressed=!0);break;case"mousemove":0===e.which&&(this.pressed=!1),this.pressed||this.callback({type:m,srcEvent:e,pointerType:"mouse",target:e.target});break;case"mouseup":this.pressed=!1}}}const Y=h["KEY_EVENTS"];class KeyInput{constructor(t,e,n={}){this.element=t,this.callback=e,this.options=Object.assign({enable:!0},n),this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=Y.concat(n.events||[]),this.handleEvent=this.handleEvent.bind(this),t.tabIndex=n.tabIndex||0,t.style.outline="none",this.events.forEach(e=>t.addEventListener(e,this.handleEvent))}destroy(){this.events.forEach(e=>this.element.removeEventListener(e,this.handleEvent))}enableEventType(e,t){"keydown"===e&&(this.enableDownEvent=t),"keyup"===e&&(this.enableUpEvent=t)}handleEvent(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}))}}const w="contextmenu";class ContextmenuInput{constructor(e,t,n={}){this.element=e,this.callback=t,this.options=Object.assign({enable:!0},n),this.handleEvent=this.handleEvent.bind(this),e.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(e,t){e===w&&(this.options.enable=t)}handleEvent(e){this.options.enable&&this.callback({type:w,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const z={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};const S={srcElement:"root",priority:0};class event_registrar_EventRegistrar{constructor(e){this.eventManager=e,this.handlers=[],this.handlersByElement=new Map,this.handleEvent=this.handleEvent.bind(this),this._active=!1}isEmpty(){return!this._active}add(e,t,n,r=!1,i=!1){const{handlers:o,handlersByElement:a}=this;n=(n=n&&("object"!=typeof n||n.addEventListener)?{srcElement:n}:n)?Object.assign({},S,n):S;let s=a.get(n.srcElement);s||(s=[],a.set(n.srcElement,s));const A={type:e,handler:t,srcElement:n.srcElement,priority:n.priority};r&&(A.once=!0),i&&(A.passive=!0),o.push(A),this._active=this._active||!A.passive;let l=s.length-1;for(;0<=l&&!(s[l].priority>=A.priority);)l--;s.splice(l+1,0,A)}remove(t,n){const{handlers:r,handlersByElement:i}=this;for(let e=r.length-1;0<=e;e--){var o=r[e];if(o.type===t&&o.handler===n){r.splice(e,1);const a=i.get(o.srcElement);a.splice(a.indexOf(o),1),0===a.length&&i.delete(o.srcElement)}}this._active=r.some(e=>!e.passive)}handleEvent(t){if(!this.isEmpty()){var n=this._normalizeEvent(t);let e=t.srcEvent.target;for(;e&&e!==n.rootElement;){if(this._emit(n,e),n.handled)return;e=e.parentNode}this._emit(n,"root")}}_emit(n,e){var r=this.handlersByElement.get(e);if(r){let t=!1;var i=()=>{n.handled=!0},o=()=>{n.handled=!0,t=!0};const A=[];for(let e=0;e{const t=this.manager.get(e);t&&p[e].forEach(e=>{t.recognizeWith(e)})});for(const o in r.recognizerOptions){const a=this.manager.get(o);if(a){const s=r.recognizerOptions[o];delete s.enable,a.set(s)}}this.wheelInput=new wheel_input_WheelInput(e,this._onOtherEvent,{enable:!1}),this.moveInput=new MoveInput(e,this._onOtherEvent,{enable:!1}),this.keyInput=new KeyInput(e,this._onOtherEvent,{enable:!1,tabIndex:r.tabIndex}),this.contextmenuInput=new ContextmenuInput(e,this._onOtherEvent,{enable:!1});for([t,n]of this.events)n.isEmpty()||(this._toggleRecognizer(n.recognizerName,!0),this.manager.on(t,n.handleEvent))}}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(e,t,n){this._addEventHandler(e,t,n,!1)}once(e,t,n){this._addEventHandler(e,t,n,!0)}watch(e,t,n){this._addEventHandler(e,t,n,!1,!0)}off(e,t){this._removeEventHandler(e,t)}_toggleRecognizer(n,r){const i=this["manager"];if(i){const o=i.get(n);if(o&&o.options.enable!==r){o.set({enable:r});const e=P[n];e&&!this.options.recognizers&&e.forEach(e=>{const t=i.get(e);r?(t.requireFailure(n),o.dropRequireFailure(e)):t.dropRequireFailure(n)})}this.wheelInput.enableEventType(n,r),this.moveInput.enableEventType(n,r),this.keyInput.enableEventType(n,r),this.contextmenuInput.enableEventType(n,r)}}_addEventHandler(t,n,r,i,o){if("string"!=typeof t){r=n;for(const e in t)this._addEventHandler(e,t[e],r,i,o)}else{const{manager:s,events:A}=this;var a=f[t]||t;let e=A.get(a);e||(e=new event_registrar_EventRegistrar(this),A.set(a,e),e.recognizerName=Z[a]||a,s&&s.on(a,e.handleEvent)),e.add(t,n,r,i,o),e.isEmpty()||this._toggleRecognizer(e.recognizerName,!0)}}_removeEventHandler(e,t){if("string"!=typeof e)for(const i in e)this._removeEventHandler(i,e[i]);else{const o=this["events"];var n=f[e]||e;const a=o.get(n);if(a&&(a.remove(e,t),a.isEmpty())){var r=a["recognizerName"];let e=!1;for(const s of o.values())if(s.recognizerName===r&&!s.isEmpty()){e=!0;break}e||this._toggleRecognizer(r,!1)}}}_onBasicInput(e){var t=e["srcEvent"],t=V[t.type];t&&this.manager.emit(t,e)}_onOtherEvent(e){this.manager.emit(e.type,e)}}var K=t(69),_=t(22);function noop(){}const x={id:"",width:"100%",height:"100%",pickingRadius:0,layerFilter:null,glOptions:{},gl:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},onWebGLInitialized:noop,onResize:noop,onViewStateChange:noop,onInteractionStateChange:noop,onBeforeRender:noop,onAfterRender:noop,onLoad:noop,onError:(e,t)=>b.a.error(e)(),_onMetrics:null,getCursor:({isDragging:e})=>e?"grabbing":"grab",debug:!1,drawPickingColors:!1};class deck_Deck{constructor(e){e={...x,...e},this.props={},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=null,this.interactiveState={isHovering:!1,isDragging:!1},this._onEvent=this._onEvent.bind(this),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),e.viewState&&e.initialViewState&&b.a.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===Object(G.getBrowser)()&&b.a.warn("IE 11 support will be deprecated in v8.0")(),e.gl||"undefined"!=typeof document&&(this.canvas=this._createCanvas(e)),this.animationLoop=this._createAnimationLoop(e),this.stats=new M.a({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(e),e._typedArrayManagerProps&&D.a.setProps(e._typedArrayManagerProps),this.animationLoop.start()}finalize(){this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,this.layerManager&&(this.layerManager.finalize(),this.layerManager=null,this.viewManager.finalize(),this.viewManager=null,this.effectManager.finalize(),this.effectManager=null,this.deckRenderer.finalize(),this.deckRenderer=null,this.deckPicker.finalize(),this.deckPicker=null,this.eventManager.destroy(),this.eventManager=null,this.tooltip.remove(),this.tooltip=null),this.props.canvas||this.props.gl||!this.canvas||(this.canvas.parentElement.removeChild(this.canvas),this.canvas=null)}setProps(e){this.stats.get("setProps Time").timeStart(),"onLayerHover"in e&&b.a.removed("onLayerHover","onHover")(),"onLayerClick"in e&&b.a.removed("onLayerClick","onClick")(),e.initialViewState&&!Object(n.a)(this.props.initialViewState,e.initialViewState)&&(this.viewState=e.initialViewState),Object.assign(this.props,e),this._setCanvasSize(this.props);e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(e={clearRedrawFlags:!1}){if(this.props._animate)return"Deck._animate";var t=this._needsRedraw,n=(e.clearRedrawFlags&&(this._needsRedraw=!1),this.viewManager.needsRedraw(e)),r=this.layerManager.needsRedraw(e),i=this.effectManager.needsRedraw(e),e=this.deckRenderer.needsRedraw(e);return t||n||r||i||e}redraw(e){!this.layerManager||(e=e||this.needsRedraw({clearRedrawFlags:!0}))&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}getViews(){return this.viewManager.views}getViewports(e){return this.viewManager.getViewports(e)}pickObject(e){e=this._pick("pickObject","pickObject Time",e).result;return e.length?e[0]:null}pickMultipleObjects(e){return e.depth=e.depth||10,this._pick("pickObject","pickMultipleObjects Time",e).result}pickObjects(e){return this._pick("pickObjects","pickObjects Time",e)}_addResources(e,t=!1){for(const n in e)this.layerManager.resourceManager.add({resourceId:n,data:e[n],forceUpdate:t})}_removeResources(e){for(const t of e)this.layerManager.resourceManager.remove(t)}_pick(e,t,n){const r=this["stats"];r.get("Pick Count").incrementCount(),r.get(t).timeStart();e=this.deckPicker[e]({layers:this.layerManager.getLayers(n),views:this.viewManager.getViews(),viewports:this.getViewports(n),onViewportActive:this.layerManager.activateViewport,...n});return r.get(t).timeEnd(),e}_createCanvas(e){let t=e.canvas;if("string"==typeof t&&(t=document.getElementById(t),Object(K.a)(t)),!t){(t=document.createElement("canvas")).id=e.id||"deckgl-overlay";const n=e.parent||document.body;n.appendChild(t)}return Object.assign(t.style,e.style),t}_setCanvasSize(n){if(this.canvas){let{width:e,height:t}=n;!e&&0!==e||(e=Number.isFinite(e)?"".concat(e,"px"):e,this.canvas.style.width=e),!t&&0!==t||(t=Number.isFinite(t)?"".concat(t,"px"):t,this.canvas.style.position="absolute",this.canvas.style.height=t)}}_updateCanvasSize(){var e,t;this._checkForCanvasSizeChange()&&({width:e,height:t}=this,this.viewManager.setProps({width:e,height:t}),this.props.onResize({width:this.width,height:this.height}))}_checkForCanvasSizeChange(){var e=this["canvas"];if(!e)return!1;var t=e.clientWidth||e.width,e=e.clientHeight||e.height;return(t!==this.width||e!==this.height)&&(this.width=t,this.height=e,!0)}_createAnimationLoop(e){const{width:t,height:n,gl:r,glOptions:i,debug:o,onError:a,onBeforeRender:s,onAfterRender:A,useDevicePixels:l,autoResizeDrawingBuffer:c}=e;return new N.a({width:t,height:n,useDevicePixels:l,autoResizeDrawingBuffer:c,autoResizeViewport:!1,gl:r,onCreateContext:e=>Object(v.c)({...i,...e,canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()}),onInitialize:e=>this._setGLContext(e.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:s,onAfterRender:A,onError:a})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let e=this.props.views||[new o.a({id:"default-view"})];return(e=Array.isArray(e)?e:[e]).length&&this.props.controller&&(e[0].props.controller=this.props.controller),e}_onContextLost(){const e=this.props["onError"];this.animationLoop&&e&&e(new Error("WebGL context is lost"))}_onPointerMove(e){const 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.event=e,t.mode="hover"}_pickAndCallback(){const n=this["_pickRequest"];if(n.event){var{result:r,emptyInfo:i}=this._pick("pickObject","pickObject Time",n);this.interactiveState.isHovering=0e instanceof scenegraph_node_ScenegraphNode),"every child must an instance of ScenegraphNode"),super(e),this.children=t}add(...e){for(const t of e)Array.isArray(t)?this.add(...t):this.children.push(t);return this}remove(e){const t=this.children;e=t.indexOf(e);return-1e.delete()),this.removeAll(),super.delete()}traverse(e,{worldMatrix:t=new a.a}={}){var n=new a.a(t).multiplyRight(this.matrix);for(const r of this.children)r instanceof group_node_GroupNode?r.traverse(e,{worldMatrix:n}):e(r,{worldMatrix:n})}}var g=t(281);const h={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},p={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function accessorToJsArray(e){if(!e._animation){const o=p[e.componentType];var t=h[e.type],n=t*e.count,{buffer:r,byteOffset:i}=e.bufferView.data;const a=new o(r,i+(e.byteOffset||0),n);if(1===t)e._animation=Array.from(a);else{const s=[];for(let e=0;ee>=a),A=Math.max(0,s-1);if(!Array.isArray(i[o]))switch(o){case"translation":i[o]=[0,0,0];break;case"rotation":i[o]=[0,0,0,1];break;case"scale":i[o]=[1,1,1];break;default:u.k.warn("Bad animation path "+o)()}Object(d.a)(i[o].length===r[A].length);var l,c=t[A],g=t[s];switch(n){case"STEP":!function stepInterpolate(t,n,r){for(let e=0;e{interpolate(r,e,t,n),function applyTranslationRotationScale(e,t){var n;t.matrix.identity(),e.translation&&t.matrix.translate(e.translation),e.rotation&&(n=f.fromQuaternion(e.rotation),t.matrix.multiplyRight(n)),e.scale&&t.matrix.scale(e.scale)}(t,t._node)})}}}class GLTFAnimator{constructor(r){this.animations=r.animations.map((e,t)=>{t=e.name||"Animation-"+t;const n=e.samplers.map(({input:e,interpolation:t="LINEAR",output:n})=>({input:accessorToJsArray(r.accessors[e]),interpolation:t,output:accessorToJsArray(r.accessors[n])}));e=e.channels.map(({sampler:e,target:t})=>({sampler:n[e],target:r.nodes[t.node],path:t.path}));return new GLTFAnimation({name:t,channels:e})})}animate(e){this.setTime(e)}setTime(t){this.animations.forEach(e=>e.animate(t))}getAnimations(){return this.animations}}var C=t(377);class model_node_ModelNode extends scenegraph_node_ScenegraphNode{constructor(e,t={}){super(t),this.onBeforeRender=null,this.AfterRender=null,e instanceof C.a?(this.model=e,this._setModelNodeProps(t)):this.model=new C.a(e,t),this.managedResources=t.managedResources||[]}setProps(e){return super.setProps(e),this._setModelNodeProps(e),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach(e=>e.delete()),this.managedResources=[]}draw(...e){return this.model.draw(...e)}setUniforms(...e){return this.model.setUniforms(...e),this}setAttributes(...e){return this.model.setAttributes(...e),this}updateModuleSettings(...e){return this.model.updateModuleSettings(...e),this}_setModelNodeProps(e){this.model.setProps(e)}}var m=t(661);function addVersionToShader(e,t){return Object(u.j)(e)?`#version 300 es `+t:t}const y={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},B={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class gltf_instantiator_GLTFInstantiator{constructor(e,t={}){this.gl=e,this.options=Object.assign({},B,t)}instantiate(e){return((this.gltf=e).scenes||[]).map(e=>this.createScene(e))}createAnimator(){return Array.isArray(this.gltf.animations)?new GLTFAnimator(this.gltf):null}createScene(e){const t=e.nodes||[];var n=t.map(e=>this.createNode(e));return new group_node_GroupNode({id:e.name||e.id,children:n})}createNode(e){if(!e._node){const n=e.children||[],r=n.map(e=>this.createNode(e)),i=(e.mesh&&r.push(this.createMesh(e.mesh)),new group_node_GroupNode({id:e.name||e.id,children:r}));var t;e.matrix?i.setMatrix(e.matrix):(i.matrix.identity(),e.translation&&i.matrix.translate(e.translation),e.rotation&&(t=(new a.a).fromQuaternion(e.rotation),i.matrix.multiplyRight(t)),e.scale&&i.matrix.scale(e.scale)),e._node=i}return e._node}createMesh(n){if(!n._mesh){const t=n.primitives||[];var e=t.map((e,t)=>this.createPrimitive(e,t,n)),e=new group_node_GroupNode({id:n.name||n.id,children:e});n._mesh=e}return n._mesh}getVertexCount(e){u.k.warn("getVertexCount() not found")()}createPrimitive(e,t,n){return function createGLTFModel(e,t){var{id:n,drawMode:r,vertexCount:i,attributes:o,modelOptions:a}=t,t=new m.a(e,t);u.k.info(4,"createGLTFModel defines: ",t.defines)();const s=[],A=(s.push(...t.generatedTextures),s.push(...Object.values(o).map(e=>e.buffer)),new model_node_ModelNode(e,Object.assign({id:n,drawMode:r,vertexCount:i,modules:[l.a],defines:t.defines,parameters:t.parameters,vs:addVersionToShader(e,` #if (__VERSION__ < 300) #define _attr attribute @@ -939,7 +939,7 @@ object-assign void main(void) { fragmentColor = pbr_filterColor(vec4(0)); } -`),managedResources:s},a)));return A.setProps({attributes:o}),A.setUniforms(t.uniforms),A}(this.gl,Object.assign({id:e.name||`${n.name||n.id}-primitive-`+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))}createAttributes(t,e){const n={};return Object.keys(t).forEach(e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),u.k.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(e,t){e.bufferView||(e.bufferView={});const n=e["bufferView"];return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new A.a(this.gl,{id:"from-"+n.id,data:n.data||e.value,target:t})),n.lumaBuffers[t]}createAccessor(e,t){return new c.a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:y[e.type]})}createSampler(e){return e}needsPOT(){return!1}}g=t(1152);async function waitForGLTFAssets(e){const t=[];return e.scenes.forEach(e=>{e.traverse(e=>{Object.values(e.model.getUniforms()).forEach(e=>{!1===e.loaded&&t.push(e)})})}),async function waitWhileCondition(e){for(;e();)await new Promise(e=>requestAnimationFrame(e))}(()=>t.some(e=>!e.loaded))}var b=t(256);const v=[255,255,255,255];t={scenegraph:{type:"object",value:null,async:!0},getScene:e=>e&&e.scenes?"object"==typeof e.scene?e.scene:e.scenes[e.scene||0]:e,getAnimator:e=>e&&e.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:v},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[g.a]};class scenegraph_layer_ScenegraphLayer extends e.a{getShaders(){const e=[n.a,r.a];return"pbr"===this.props._lighting&&e.push(l.a),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:e}}initializeState(){const e=this.getAttributeManager();e.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:v,transition:!0},instanceModelMatrix:b.a})}updateState(e){super.updateState(e);var{props:e,oldProps:t}=e;e.scenegraph!==t.scenegraph?this._updateScenegraph(e):e._animations!==t._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(e){var t=this.context["gl"];let n=null;e.scenegraph instanceof scenegraph_node_ScenegraphNode?n={scenes:[e.scenegraph]}:e.scenegraph&&!e.scenegraph.gltf?(i=function createGLTFObjects(e,t,n){const r=new gltf_instantiator_GLTFInstantiator(e,n);return{scenes:r.instantiate(t),animator:r.createAnimator()}}(t,r=e.scenegraph,this._getModelOptions()),n={gltf:r,...i},waitForGLTFAssets(i).then(()=>this.setNeedsRedraw())):e.scenegraph&&(o.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=e.scenegraph);var r={layer:this,gl:t},i=e.getScene(n,r),t=e.getAnimator(n,r);i instanceof scenegraph_node_ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(i),this._applyAnimationsProp(i,t,e._animations),this.setState({scenegraph:i,animator:t})):null!==i&&o.a.warn("invalid scenegraph:",i)()}_applyAllAttributes(e){if(this.state.attributesAvailable){const t=this.getAttributeManager().getAttributes();e.traverse(e=>{this._setModelAttributes(e.model,t)})}}_applyAnimationsProp(e,t,r){if(e&&t&&r){const i=t.getAnimations();Object.keys(r).sort().forEach(t=>{const n=r[t];var e;"*"===t?i.forEach(e=>{Object.assign(e,n)}):Number.isFinite(Number(t))?0<=(e=Number(t))&&ee===t))?Object.assign(e,n):o.a.warn("animation ".concat(t," not found"))()})}}_deleteScenegraph(){const e=this.state["scenegraph"];e instanceof scenegraph_node_ScenegraphNode&&e.delete()}_getModelOptions(){const e=this.props["_imageBasedLightingEnvironment"];let t=null;return e&&(t="function"==typeof e?e({gl:this.context.gl,layer:this}):e),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:t,modelOptions:{isInstanced:!0,transpileToGLSL100:!Object(u.j)(this.context.gl),...this.getShaders()},useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(e=>{this._setModelAttributes(e.model,t)})}draw({moduleParameters:n=null,parameters:r={},context:e}){if(this.state.scenegraph){this.props._animations&&this.state.animator&&(this.state.animator.animate(e.timeline.getTime()),this.setNeedsRedraw());const i=this.context["viewport"],{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:s,opacity:A,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse((e,{worldMatrix:t})=>{e.model.setInstanceCount(c),e.updateModuleSettings(n),e.draw({parameters:r,uniforms:{sizeScale:o,opacity:A,sizeMinPixels:a,sizeMaxPixels:s,composeModelMatrix:Object(b.b)(i,l),sceneModelMatrix:t,u_Camera:e.model.getUniforms().project_uCameraPosition}})})}}}scenegraph_layer_ScenegraphLayer.layerName="ScenegraphLayer",scenegraph_layer_ScenegraphLayer.defaultProps=t},function(e,t,n){"use strict";n.d(t,"a",function(){return geojson_layer_GeoJsonLayer});var t=n(450),g=n(28),u=n(358);function binaryToFeatureForAccesor(e,t){if(!e)return null;var t="startIndices"in e?e.startIndices[t]:t,n=e.featureIds.value[t];return-1!==t?function getPropertiesForIndex(e,t,n){const r={properties:{...e.properties[t]}};for(const i in e.numericProps)r.properties[i]=e.numericProps[i].value[n];return r}(e,n,t):null}var r=n(241),i=n(339),o=n(337),a=n(240),n=n(239);const l={circle:{type:i.a,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:r.a,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:o.a,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},s={type:a.a,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",getLineColor:"getColor",getLineWidth:"getWidth"}},A={type:n.a,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function getDefaultProps({type:e,props:t}){const n={};for(const r in t)n[r]=e.defaultProps[t[r]];return n}function forwardProps(t,n){var{transitions:r,updateTriggers:i}=t.props;const o={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(const s in n){var a=n[s];let e=t.props[s];s.startsWith("get")&&(e=t.getSubLayerAccessor(e),o.updateTriggers[a]=i[s],r&&(o.transitions[a]=r[s])),o[a]=e}return o}function separateGeojsonFeatures(e,n,r={}){var i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:r=0,endRow:o=e.length}=r;for(let t=r;t{s.push(n({geometry:{type:"Point",coordinates:e}},r,i))});break;case"LineString":A.push(n({geometry:e},r,i));break;case"MultiLineString":a.forEach(e=>{A.push(n({geometry:{type:"LineString",coordinates:e}},r,i))});break;case"Polygon":l.push(n({geometry:e},r,i)),a.forEach(e=>{c.push(n({geometry:{type:"LineString",coordinates:e}},r,i))});break;case"MultiPolygon":a.forEach(e=>{l.push(n({geometry:{type:"Polygon",coordinates:e}},r,i)),e.forEach(e=>{c.push(n({geometry:{type:"LineString",coordinates:e}},r,i))})})}else g.a.warn("".concat(o," coordinates are malformed"))()}const d={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function createEmptyLayerProps(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function getCoordinates(e){return e.geometry.coordinates}function createLayerPropsFromBinary(e,t){const n=createEmptyLayerProps();var{points:r,lines:i,polygons:o}=e,e=function calculatePickingColors(e,t){const n={points:null,lines:null,polygons:null};for(const o in n){var r=e[o].globalFeatureIds.value,i=(n[o]=new Uint8ClampedArray(3*r.length),[]);for(let e=0;ee.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}};class geojson_layer_GeoJsonLayer extends t.a{initializeState(){this.state={layerProps:{},features:{}},this.props.getLineDashArray&&g.a.removed("getLineDashArray","PathStyleExtension")()}updateState({props:e,changeFlags:t}){var n;t.dataChanged&&(n=this.props["data"],n=n&&"points"in n&&"polygons"in n&&"lines"in n,this.setState({binary:n}),n?this._updateStateBinary({props:e,changeFlags:t}):this._updateStateJSON({props:e,changeFlags:t}))}_updateStateBinary({props:e}){e=createLayerPropsFromBinary(e.data,this.encodePickingColor);this.setState({layerProps:e})}_updateStateJSON({props:e,changeFlags:t}){var n=function getGeojsonFeatures(e){if(Array.isArray(e))return e;switch(g.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return g.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(e.data),r=this.getSubLayerRow.bind(this);let i={};const o={};if(Array.isArray(t.dataChanged)){const s=this.state.features;for(const A in s)i[A]=s[A].slice(),o[A]=[];for(const l of t.dataChanged){var a=separateGeojsonFeatures(n,r,l);for(const c in s)o[c].push(Object(u.a)({data:i[c],getIndex:e=>e.__source.index,dataRange:l,replace:a[c]}))}}else i=separateGeojsonFeatures(n,r);e=function createLayerPropsFromFeatures(e,t){const n=createEmptyLayerProps();var{pointFeatures:e,lineFeatures:r,polygonFeatures:i,polygonOutlineFeatures:o}=e;return n.points.data=e,n.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),n.points.getPosition=getCoordinates,n.lines.data=r,n.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),n.lines.getPath=getCoordinates,n.polygons.data=i,n.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),n.polygons.getPolygon=getCoordinates,n.polygonsOutline.data=o,n.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),n.polygonsOutline.getPath=getCoordinates,n}(i,o);this.setState({features:i,featuresDiff:o,layerProps:e})}_updateAutoHighlight(e){var t="".concat(this.id,"-points-"),n=e.sourceLayer.id.startsWith(t);for(const r of this.getSubLayers())r.id.startsWith(t)===n&&r.updateAutoHighlight(e)}_renderPolygonLayer(){var{extruded:e,wireframe:t}=this.props,n=this.state["layerProps"],r="polygons-fill";const i=this.shouldRenderSubLayer(r,n.polygons.data)&&this.getSubLayerClass(r,A.type);if(i){const o=forwardProps(this,A.props);e=e&&t;return e||delete o.getLineColor,o.updateTriggers.lineColors=e,new i(o,this.getSubLayerProps({id:r,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){var{extruded:e,stroked:t}=this.props,n=this.state["layerProps"],r="polygons-stroke",i="linestrings";const o=!e&&t&&this.shouldRenderSubLayer(r,n.polygonsOutline.data)&&this.getSubLayerClass(r,s.type),a=this.shouldRenderSubLayer(i,n.lines.data)&&this.getSubLayerClass(i,s.type);return o||a?(e=forwardProps(this,s.props),[o&&new o(e,this.getSubLayerProps({id:r,updateTriggers:e.updateTriggers}),n.polygonsOutline),a&&new a(e,this.getSubLayerProps({id:i,updateTriggers:e.updateTriggers}),n.lines)]):null}_renderPointLayers(){const e=this.props["pointType"],{layerProps:t,binary:n}=this.state;let r=this.props["highlightedObjectIndex"];!n&&Number.isFinite(r)&&(r=t.points.data.findIndex(e=>e.__source.index===r));const i=[];for(const s of new Set(e.split("+"))){var o="points-".concat(s),a=l[s];const A=a&&this.shouldRenderSubLayer(o,t.points.data)&&this.getSubLayerClass(o,a.type);A&&(a=forwardProps(this,a.props),i.push(new A(a,this.getSubLayerProps({id:o,updateTriggers:a.updateTriggers,highlightedObjectIndex:r}),t.points)))}return i}renderLayers(){var e=this.props["extruded"],t=this._renderPolygonLayer();return[!e&&t,this._renderLineLayers(),this._renderPointLayers(),e&&t]}getSubLayerAccessor(i){var e=this.state["binary"];return e&&"function"==typeof i?(e,t)=>{var{data:n,index:r}=t,n=binaryToFeatureForAccesor(n,r);return i(n,t)}:super.getSubLayerAccessor(i)}}geojson_layer_GeoJsonLayer.layerName="GeoJsonLayer",geojson_layer_GeoJsonLayer.defaultProps=i},function(e,t,n){"use strict";n.d(t,"a",function(){return bitmap_layer_BitmapLayer});var o=n(22),t=n(335),r=n(498),i=n(499),a=n(370),s=n(114),A=n(36),h=n(12);const p=new Uint16Array([0,2,1,0,3,2]),f=new Float32Array([0,1,0,0,1,0,1,1]);function createMesh(n,e){if(!e)return function createQuad(t){const n=new Float64Array(12);for(let e=0;e 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive) {\n // Since instance information is not used, we can use picking color for pixel index\n gl_FragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n"),n={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:o.a.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};class bitmap_layer_BitmapLayer extends t.a{getShaders(){return super.getShaders({vs:"\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:l,modules:[r.a,i.a]})}initializeState(){const e=this.getAttributeManager();e.remove(["instancePickingColors"]);e.add({indices:{size:1,isIndexed:!0,update:e=>e.value=this.state.mesh.indices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:e=>e.value=this.state.mesh.positions,noAlloc:!0},texCoords:{size:2,update:e=>e.value=this.state.mesh.texCoords,noAlloc:!0}})}updateState({props:e,oldProps:t,changeFlags:n}){var r;n.extensionsChanged&&(n=this.context["gl"],null!=(r=this.state.model)&&r.delete(),this.state.model=this._getModel(n),this.getAttributeManager().invalidateAll());const i=this.getAttributeManager();if(e.bounds!==t.bounds){var o=this.state.mesh,a=this._createMesh();this.state.model.setVertexCount(a.vertexCount);for(const s in a)o&&o[s]!==a[s]&&i.invalidate(s);this.setState({mesh:a,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==t._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo({info:e}){var t=this.props["image"];if(!e.color||!t)return e.bitmap=null,e;var{width:t,height:n}=t,r=(e.index=0,function unpackUVsFromRGB(e){var[e,t,n]=e,r=(240&n)/256,n=(15&n)/16;return[(e+n)/256,(t+r)/256]}(e.color)),i=[Math.floor(r[0]*t),Math.floor(r[1]*n)];return e.bitmap={size:{width:t,height:n},uv:r,pixel:i},e}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(e){super._updateAutoHighlight({...e,color:this.encodePickingColor(0)})}_createMesh(){var e=this.props["bounds"];let t=e;return createMesh(t=Number.isFinite(e[0])?[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]:t,this.context.viewport.resolution)}_getModel(e){return e?new a.a(e,{...this.getShaders(),id:this.props.id,geometry:new s.a({drawMode:4,vertexCount:6}),isInstanced:!1}):null}draw(e){var{uniforms:e,moduleParameters:t}=e;const{model:n,coordinateConversion:r,bounds:i,disablePicking:o}=this.state,{image:a,desaturate:s,transparentColor:A,tintColor:l}=this.props;t.pickingActive&&o||a&&n&&n.setUniforms(e).setUniforms({bitmapTexture:a,desaturate:s,transparentColor:A.map(e=>e/255),tintColor:l.slice(0,3).map(e=>e/255),coordinateConversion:r,bounds:i}).draw()}_getCoordinateUniforms(){var{LNGLAT:e,CARTESIAN:t,DEFAULT:n}=o.a,r=this.props["_imageCoordinateSystem"];if(r!==n){n=this.props["bounds"];if(!Number.isFinite(n[0]))throw new Error("_imageCoordinateSystem only supports rectangular bounds");var i=this.context.viewport.resolution?e:t;if((r=r===e?e:t)===e&&i===t)return{coordinateConversion:-1,bounds:n};if(r===t&&i===e)return r=Object(A.n)([n[0],n[1]]),t=Object(A.n)([n[2],n[3]]),{coordinateConversion:1,bounds:[r[0],r[1],t[0],t[1]]}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}bitmap_layer_BitmapLayer.layerName="BitmapLayer",bitmap_layer_BitmapLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return line_layer_LineLayer});var t=n(335),r=n(498),i=n(499),o=n(370),a=n(114),n={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>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}};class line_layer_LineLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float useShortestPath;\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\nvec3 splitLine(vec3 a, vec3 b, float x) {\n float t = (x - a.x) / (b.x - a.x);\n return vec3(x, mix(a.yz, b.yz, t));\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n vec3 source_world_64low = instanceSourcePositions64Low;\n vec3 target_world_64low = instanceTargetPositions64Low;\n\n if (useShortestPath > 0.5 || useShortestPath < -0.5) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n float deltaLng = target_world.x - source_world.x;\n\n if (deltaLng * useShortestPath > 180.) {\n source_world.x += 360. * useShortestPath;\n source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n source_world_64low = vec3(0.0);\n } else if (deltaLng * useShortestPath < -180.) {\n target_world.x += 360. * useShortestPath;\n target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n target_world_64low = vec3(0.0);\n } else if (useShortestPath < 0.) {\n gl_Position = vec4(0.);\n return;\n }\n }\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\n 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 geometry.pickingColor = instancePickingColors;\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}\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:[r.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const e=this.getAttributeManager();e.addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{widthUnits:n,widthScale:r,widthMinPixels:i,widthMaxPixels:o,wrapLongitude:a}=this.props,n="pixels"===n?t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({widthScale:r*n,widthMinPixels:i,widthMaxPixels:o,useShortestPath:a?1:0}).draw(),a&&this.state.model.setUniforms({useShortestPath:-1}).draw()}_getModel(e){return new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0})}}line_layer_LineLayer.layerName="LineLayer",line_layer_LineLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return arc_layer_ArcLayer});var t=n(335),r=n(498),i=n(499),o=n(370),a=n(114);const s=[0,0,0,255];n={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>e.targetPosition},getSourceColor:{type:"accessor",value:s},getTargetColor:{type:"accessor",value:s},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class arc_layer_ArcLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\n\n float deltaZ = targetZ - sourceZ;\n float dh = distance * instanceHeights;\n if (dh == 0.0) {\n return sourceZ + deltaZ * ratio;\n }\n float unitZ = deltaZ / dh;\n float p2 = unitZ * unitZ + 1.0;\n float dir = step(deltaZ, 0.0);\n float z0 = mix(sourceZ, targetZ, dir);\n float r = mix(ratio, 1.0 - ratio, dir);\n return sqrt(r * (p2 - r)) * dh + z0;\n}\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 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\n float distance = length(source.xy - target.xy);\n float z = paraboloid(distance, source.z, target.z, segmentRatio);\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target.xy - source.xy);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\n\n return vec3(\n mix(source.xy, target.xy, segmentRatio) + tilt,\n z * cos(tiltAngle)\n );\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 sourceRadians = radians(source);\n vec2 targetRadians = radians(target);\n vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\n vec2 shd_sq = sin_half_delta * sin_half_delta;\n\n float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\n return 2.0 * asin(sqrt(a));\n}\n\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\n vec2 lngLat;\n if(abs(angularDist - PI) < 0.001) {\n lngLat = (1.0 - t) * source.xy + t * target.xy;\n } else {\n float a = sin((1.0 - t) * angularDist);\n float b = sin(t * angularDist);\n vec3 p = source3D.yxz * a + target3D.yxz * b;\n lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n }\n\n float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\n\n return vec3(lngLat, z);\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\n float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n isValid = 1.0;\n\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n\n vec4 curr;\n vec4 next;\n vec3 source;\n vec3 target;\n\n if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\n target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\n float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\n\n vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\n vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\n vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\n\n if (abs(currPos.x - prevPos.x) > 180.0) {\n indexDir = -1.0;\n isValid = 0.0;\n } else if (abs(currPos.x - nextPos.x) > 180.0) {\n indexDir = 1.0;\n isValid = 0.0;\n }\n nextPos = indexDir < 0.0 ? prevPos : nextPos;\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n\n if (isValid == 0.0) {\n nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\n float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\n currPos = mix(currPos, nextPos, t);\n segmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n }\n\n vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\n vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\n \n curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n \n } else {\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n if (useShortestPath) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n float deltaLng = target_world.x - source_world.x;\n if (deltaLng > 180.) target_world.x -= 360.;\n if (deltaLng < -180.) source_world.x -= 360.;\n }\n source = project_position(source_world, instanceSourcePositions64Low);\n target = project_position(target_world, instanceTargetPositions64Low);\n float antiMeridianX = 0.0;\n\n if (useShortestPath) {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n }\n float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\n\n if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\n isValid = 0.0;\n indexDir = sign(segmentRatio - thresholdRatio);\n segmentRatio = thresholdRatio;\n }\n }\n\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n vec3 currPos = interpolateFlat(source, target, segmentRatio);\n vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\n\n if (useShortestPath) {\n if (nextPos.x < antiMeridianX) {\n currPos.x += TILE_SIZE;\n nextPos.x += TILE_SIZE;\n }\n }\n\n curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n }\n 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}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nvoid main(void) {\n if (isValid == 0.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const e=this.getAttributeManager();e.addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:s},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:s},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{widthUnits:n,widthScale:r,widthMinPixels:i,widthMaxPixels:o,greatCircle:a,wrapLongitude:s}=this.props,n="pixels"===n?t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({greatCircle:a,widthScale:r*n,widthMinPixels:i,widthMaxPixels:o,useShortestPath:s}).draw()}_getModel(e){let t=[];for(let e=0;e<50;e++)t=t.concat([e,1,0,e,-1,0]);const n=new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0});return n.setUniforms({numSegments:50}),n}}arc_layer_ArcLayer.layerName="ArcLayer",arc_layer_ArcLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return point_cloud_layer_PointCloudLayer});var t=n(335),r=n(498),i=n(1163),o=n(499),a=n(370),s=n(114);const A=[0,0,0,255],l=[0,0,1];n={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:e=>e.position},getNormal:{type:"accessor",value:l},getColor:{type:"accessor",value:A},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class point_cloud_layer_PointCloudLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\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 geometry.pickingColor = instancePickingColors;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n 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}\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:[r.a,i.a,o.a]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:l},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:A}})}updateState({props:e,oldProps:t,changeFlags:n}){var r;super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(t=this.context["gl"],null!=(r=this.state.model)&&r.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()),n.dataChanged&&function normalizeData(e){const{header:t,attributes:n}=e;t&&n&&(e.length=t.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0&&(n.instanceColors=n.COLOR_0))}(e.data)}draw({uniforms:e}){var t=this.context["viewport"],{pointSize:n,sizeUnits:r}=this.props,r="meters"===r?1/t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({radiusPixels:n*r}).draw()}_getModel(e){const t=[];for(let e=0;e<3;e++){var n=e/3*Math.PI*2;t.push(2*Math.cos(n),2*Math.sin(n),0)}return new a.a(e,{...this.getShaders(),id:this.props.id,geometry:new s.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0})}}point_cloud_layer_PointCloudLayer.layerName="PointCloudLayer",point_cloud_layer_PointCloudLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return simple_mesh_layer_SimpleMeshLayer});var r=n(28),t=n(335),i=n(498),o=n(1163),a=n(499),s=n(114),A=n(7),l=n(203),c=n(370),g=n(660),u=n(372),d=n(256);function validateGeometryAttributes(e,t){(e.COLOR_0||e.colors)&&t||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),r.a.assert(e.positions||e.POSITION,'no "postions" or "POSITION" attribute in mesh')}n={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:e=>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:[]}};class simple_mesh_layer_SimpleMeshLayer extends t.a{getShaders(){var e=!Object(A.j)(this.context.gl);const t={};return Object(g.b)(this.context.gl,u.a.GLSL_DERIVATIVES)&&(t.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\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 geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[i.a,o.b,a.a],transpileToGLSL100:e,defines:t})}initializeState(){const e=this.getAttributeManager();e.addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:d.a}),this.setState({emptyTexture:new l.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),e.mesh===t.mesh&&!n.extensionsChanged||(null!=(n=this.state.model)&&n.delete(),e.mesh&&(this.state.model=this.getModel(e.mesh),n=e.mesh.attributes||e.mesh,this.setState({hasNormals:Boolean(n.NORMAL||n.normals)})),this.getAttributeManager().invalidateAll()),e.texture!==t.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:e}){var t,n,r,i;this.state.model&&(t=this.context["viewport"],{sizeScale:n,coordinateSystem:r,_instanced:i}=this.props,this.state.model.setUniforms(e).setUniforms({sizeScale:n,composeModelMatrix:!i||Object(d.b)(t,r),flatShading:!this.state.hasNormals}).draw())}getModel(e){const t=new c.a(this.context.gl,{...this.getShaders(),id:this.props.id,geometry:function getGeometry(e,t){if(e.attributes)return validateGeometryAttributes(e.attributes,t),e instanceof s.a?e:new s.a(e);if(e.positions||e.POSITION)return validateGeometryAttributes(e,t),new s.a({attributes:e});throw Error("Invalid mesh")}(e,this.props._useMeshColors),isInstanced:!0});var e=this.props["texture"],n=this.state["emptyTexture"];return t.setUniforms({sampler:e||n,hasTexture:Boolean(e)}),t}setTexture(e){const{emptyTexture:t,model:n}=this.state;null!==n&&void 0!==n&&n.setUniforms({sampler:e||t,hasTexture:Boolean(e)})}}simple_mesh_layer_SimpleMeshLayer.layerName="SimpleMeshLayer",simple_mesh_layer_SimpleMeshLayer.defaultProps=n},function(e,t,n){"use strict";n.r(t),n.d(t,"capitalize",function(){return r.a}),n.d(t,"createChainedFunction",function(){return i.a}),n.d(t,"createSvgIcon",function(){return o.a}),n.d(t,"debounce",function(){return a.a}),n.d(t,"deprecatedPropType",function(){return s.a}),n.d(t,"isMuiElement",function(){return A.a}),n.d(t,"ownerDocument",function(){return l.a}),n.d(t,"ownerWindow",function(){return c.a}),n.d(t,"requirePropFactory",function(){return g.a}),n.d(t,"setRef",function(){return u.a}),n.d(t,"unsupportedProp",function(){return d.a}),n.d(t,"useControlled",function(){return h.a}),n.d(t,"useEventCallback",function(){return p.a}),n.d(t,"useForkRef",function(){return f.a}),n.d(t,"unstable_useId",function(){return useId}),n.d(t,"useIsFocusVisible",function(){return C.a});var r=n(26),i=n(133),o=n(89),a=n(121),s=n(127),A=n(175),l=n(53),c=n(168),g=n(392),u=n(113),d=n(393),h=n(131),p=n(50),f=n(37),I=n(0);function useId(e){var t=I.useState(e),n=t[0],r=t[1],t=e||n;return I.useEffect(function(){null==n&&r("mui-".concat(Math.round(1e5*Math.random())))},[n]),t}var C=n(167)},function(e,c,t){"use strict";!function(i){ +`),managedResources:s},a)));return A.setProps({attributes:o}),A.setUniforms(t.uniforms),A}(this.gl,Object.assign({id:e.name||`${n.name||n.id}-primitive-`+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))}createAttributes(t,e){const n={};return Object.keys(t).forEach(e=>{n[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))}),e&&(n.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),u.k.info(4,"glTF Attributes",{attributes:t,indices:e,generated:n})(),n}createBuffer(e,t){e.bufferView||(e.bufferView={});const n=e["bufferView"];return n.lumaBuffers||(n.lumaBuffers={}),n.lumaBuffers[t]||(n.lumaBuffers[t]=new A.a(this.gl,{id:"from-"+n.id,data:n.data||e.value,target:t})),n.lumaBuffers[t]}createAccessor(e,t){return new c.a({buffer:t,offset:e.byteOffset||0,stride:e.bufferView.byteStride||0,type:e.componentType,size:y[e.type]})}createSampler(e){return e}needsPOT(){return!1}}g=t(1220);async function waitForGLTFAssets(e){const t=[];return e.scenes.forEach(e=>{e.traverse(e=>{Object.values(e.model.getUniforms()).forEach(e=>{!1===e.loaded&&t.push(e)})})}),async function waitWhileCondition(e){for(;e();)await new Promise(e=>requestAnimationFrame(e))}(()=>t.some(e=>!e.loaded))}var b=t(262);const v=[255,255,255,255];t={scenegraph:{type:"object",value:null,async:!0},getScene:e=>e&&e.scenes?"object"==typeof e.scene?e.scene:e.scenes[e.scene||0]:e,getAnimator:e=>e&&e.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:v},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[g.a]};class scenegraph_layer_ScenegraphLayer extends e.a{getShaders(){const e=[n.a,r.a];return"pbr"===this.props._lighting&&e.push(l.a),{vs:"#version 300 es\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\nin vec4 POSITION;\n\n#ifdef HAS_UV\n in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n in vec4 NORMAL;\n #endif\n#endif\nout vec4 vColor;\n#ifndef MODULE_PBR\n #ifdef HAS_UV\n out vec2 vTEXCOORD_0;\n #endif\n#endif\nvoid main(void) {\n #if defined(HAS_UV) && !defined(MODULE_PBR)\n vTEXCOORD_0 = TEXCOORD_0;\n geometry.uv = vTEXCOORD_0;\n #endif\n\n geometry.worldPosition = instancePositions;\n geometry.pickingColor = instancePickingColors;\n\n #ifdef MODULE_PBR\n #ifdef HAS_NORMALS\n pbr_vNormal = project_normal(instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz);\n geometry.normal = pbr_vNormal;\n #endif\n\n #ifdef HAS_UV\n pbr_vUV = TEXCOORD_0;\n #else\n pbr_vUV = vec2(0., 0.);\n #endif\n geometry.uv = pbr_vUV;\n #endif\n\n float originalSize = project_size_to_pixel(sizeScale);\n float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n if(composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n }\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n #ifdef MODULE_PBR\n pbr_vPosition = geometry.position.xyz;\n #endif\n\n vColor = instanceColors;\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\nuniform float opacity;\nin vec4 vColor;\n\nout vec4 fragmentColor;\n#ifndef MODULE_PBR\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n in vec2 vTEXCOORD_0;\n uniform sampler2D u_BaseColorSampler;\n #endif\n#endif\n\nvoid main(void) {\n #ifdef MODULE_PBR\n fragmentColor = vColor * pbr_filterColor(vec4(0));\n geometry.uv = pbr_vUV;\n #else\n #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n geometry.uv = vTEXCOORD_0;\n #else\n fragmentColor = vColor;\n #endif\n #endif\n\n fragmentColor.a *= opacity;\n DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:e}}initializeState(){const e=this.getAttributeManager();e.addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:v,transition:!0},instanceModelMatrix:b.a})}updateState(e){super.updateState(e);var{props:e,oldProps:t}=e;e.scenegraph!==t.scenegraph?this._updateScenegraph(e):e._animations!==t._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(){super.finalizeState(),this._deleteScenegraph()}_updateScenegraph(e){var t=this.context["gl"];let n=null;e.scenegraph instanceof scenegraph_node_ScenegraphNode?n={scenes:[e.scenegraph]}:e.scenegraph&&!e.scenegraph.gltf?(i=function createGLTFObjects(e,t,n){const r=new gltf_instantiator_GLTFInstantiator(e,n);return{scenes:r.instantiate(t),animator:r.createAnimator()}}(t,r=e.scenegraph,this._getModelOptions()),n={gltf:r,...i},waitForGLTFAssets(i).then(()=>this.setNeedsRedraw())):e.scenegraph&&(o.a.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),n=e.scenegraph);var r={layer:this,gl:t},i=e.getScene(n,r),t=e.getAnimator(n,r);i instanceof scenegraph_node_ScenegraphNode?(this._deleteScenegraph(),this._applyAllAttributes(i),this._applyAnimationsProp(i,t,e._animations),this.setState({scenegraph:i,animator:t})):null!==i&&o.a.warn("invalid scenegraph:",i)()}_applyAllAttributes(e){if(this.state.attributesAvailable){const t=this.getAttributeManager().getAttributes();e.traverse(e=>{this._setModelAttributes(e.model,t)})}}_applyAnimationsProp(e,t,r){if(e&&t&&r){const i=t.getAnimations();Object.keys(r).sort().forEach(t=>{const n=r[t];var e;"*"===t?i.forEach(e=>{Object.assign(e,n)}):Number.isFinite(Number(t))?0<=(e=Number(t))&&ee===t))?Object.assign(e,n):o.a.warn("animation ".concat(t," not found"))()})}}_deleteScenegraph(){const e=this.state["scenegraph"];e instanceof scenegraph_node_ScenegraphNode&&e.delete()}_getModelOptions(){const e=this.props["_imageBasedLightingEnvironment"];let t=null;return e&&(t="function"==typeof e?e({gl:this.context.gl,layer:this}):e),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:t,modelOptions:{isInstanced:!0,transpileToGLSL100:!Object(u.j)(this.context.gl),...this.getShaders()},useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse(e=>{this._setModelAttributes(e.model,t)})}draw({moduleParameters:n=null,parameters:r={},context:e}){if(this.state.scenegraph){this.props._animations&&this.state.animator&&(this.state.animator.animate(e.timeline.getTime()),this.setNeedsRedraw());const i=this.context["viewport"],{sizeScale:o,sizeMinPixels:a,sizeMaxPixels:s,opacity:A,coordinateSystem:l}=this.props,c=this.getNumInstances();this.state.scenegraph.traverse((e,{worldMatrix:t})=>{e.model.setInstanceCount(c),e.updateModuleSettings(n),e.draw({parameters:r,uniforms:{sizeScale:o,opacity:A,sizeMinPixels:a,sizeMaxPixels:s,composeModelMatrix:Object(b.b)(i,l),sceneModelMatrix:t,u_Camera:e.model.getUniforms().project_uCameraPosition}})})}}}scenegraph_layer_ScenegraphLayer.layerName="ScenegraphLayer",scenegraph_layer_ScenegraphLayer.defaultProps=t},function(e,t,n){"use strict";n.d(t,"a",function(){return geojson_layer_GeoJsonLayer});var t=n(461),g=n(28),u=n(365);function binaryToFeatureForAccesor(e,t){if(!e)return null;var t="startIndices"in e?e.startIndices[t]:t,n=e.featureIds.value[t];return-1!==t?function getPropertiesForIndex(e,t,n){const r={properties:{...e.properties[t]}};for(const i in e.numericProps)r.properties[i]=e.numericProps[i].value[n];return r}(e,n,t):null}var r=n(247),i=n(346),o=n(344),a=n(246),n=n(245);const l={circle:{type:i.a,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:r.a,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:o.a,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPixels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},s={type:a.a,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",getLineColor:"getColor",getLineWidth:"getWidth"}},A={type:n.a,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function getDefaultProps({type:e,props:t}){const n={};for(const r in t)n[r]=e.defaultProps[t[r]];return n}function forwardProps(t,n){var{transitions:r,updateTriggers:i}=t.props;const o={updateTriggers:{},transitions:r&&{getPosition:r.geometry}};for(const s in n){var a=n[s];let e=t.props[s];s.startsWith("get")&&(e=t.getSubLayerAccessor(e),o.updateTriggers[a]=i[s],r&&(o.transitions[a]=r[s])),o[a]=e}return o}function separateGeojsonFeatures(e,n,r={}){var i={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:r=0,endRow:o=e.length}=r;for(let t=r;t{s.push(n({geometry:{type:"Point",coordinates:e}},r,i))});break;case"LineString":A.push(n({geometry:e},r,i));break;case"MultiLineString":a.forEach(e=>{A.push(n({geometry:{type:"LineString",coordinates:e}},r,i))});break;case"Polygon":l.push(n({geometry:e},r,i)),a.forEach(e=>{c.push(n({geometry:{type:"LineString",coordinates:e}},r,i))});break;case"MultiPolygon":a.forEach(e=>{l.push(n({geometry:{type:"Polygon",coordinates:e}},r,i)),e.forEach(e=>{c.push(n({geometry:{type:"LineString",coordinates:e}},r,i))})})}else g.a.warn("".concat(o," coordinates are malformed"))()}const d={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function createEmptyLayerProps(){return{points:{},lines:{},polygons:{},polygonsOutline:{}}}function getCoordinates(e){return e.geometry.coordinates}function createLayerPropsFromBinary(e,t){const n=createEmptyLayerProps();var{points:r,lines:i,polygons:o}=e,e=function calculatePickingColors(e,t){const n={points:null,lines:null,polygons:null};for(const o in n){var r=e[o].globalFeatureIds.value,i=(n[o]=new Uint8ClampedArray(3*r.length),[]);for(let e=0;ee.properties.icon},getText:{type:"accessor",value:e=>e.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}};class geojson_layer_GeoJsonLayer extends t.a{initializeState(){this.state={layerProps:{},features:{}},this.props.getLineDashArray&&g.a.removed("getLineDashArray","PathStyleExtension")()}updateState({props:e,changeFlags:t}){var n;t.dataChanged&&(n=this.props["data"],n=n&&"points"in n&&"polygons"in n&&"lines"in n,this.setState({binary:n}),n?this._updateStateBinary({props:e,changeFlags:t}):this._updateStateJSON({props:e,changeFlags:t}))}_updateStateBinary({props:e}){e=createLayerPropsFromBinary(e.data,this.encodePickingColor);this.setState({layerProps:e})}_updateStateJSON({props:e,changeFlags:t}){var n=function getGeojsonFeatures(e){if(Array.isArray(e))return e;switch(g.a.assert(e.type,"GeoJSON does not have type"),e.type){case"Feature":return[e];case"FeatureCollection":return g.a.assert(Array.isArray(e.features),"GeoJSON does not have features array"),e.features;default:return[{geometry:e}]}}(e.data),r=this.getSubLayerRow.bind(this);let i={};const o={};if(Array.isArray(t.dataChanged)){const s=this.state.features;for(const A in s)i[A]=s[A].slice(),o[A]=[];for(const l of t.dataChanged){var a=separateGeojsonFeatures(n,r,l);for(const c in s)o[c].push(Object(u.a)({data:i[c],getIndex:e=>e.__source.index,dataRange:l,replace:a[c]}))}}else i=separateGeojsonFeatures(n,r);e=function createLayerPropsFromFeatures(e,t){const n=createEmptyLayerProps();var{pointFeatures:e,lineFeatures:r,polygonFeatures:i,polygonOutlineFeatures:o}=e;return n.points.data=e,n.points._dataDiff=t.pointFeatures&&(()=>t.pointFeatures),n.points.getPosition=getCoordinates,n.lines.data=r,n.lines._dataDiff=t.lineFeatures&&(()=>t.lineFeatures),n.lines.getPath=getCoordinates,n.polygons.data=i,n.polygons._dataDiff=t.polygonFeatures&&(()=>t.polygonFeatures),n.polygons.getPolygon=getCoordinates,n.polygonsOutline.data=o,n.polygonsOutline._dataDiff=t.polygonOutlineFeatures&&(()=>t.polygonOutlineFeatures),n.polygonsOutline.getPath=getCoordinates,n}(i,o);this.setState({features:i,featuresDiff:o,layerProps:e})}_updateAutoHighlight(e){var t="".concat(this.id,"-points-"),n=e.sourceLayer.id.startsWith(t);for(const r of this.getSubLayers())r.id.startsWith(t)===n&&r.updateAutoHighlight(e)}_renderPolygonLayer(){var{extruded:e,wireframe:t}=this.props,n=this.state["layerProps"],r="polygons-fill";const i=this.shouldRenderSubLayer(r,n.polygons.data)&&this.getSubLayerClass(r,A.type);if(i){const o=forwardProps(this,A.props);e=e&&t;return e||delete o.getLineColor,o.updateTriggers.lineColors=e,new i(o,this.getSubLayerProps({id:r,updateTriggers:o.updateTriggers}),n.polygons)}return null}_renderLineLayers(){var{extruded:e,stroked:t}=this.props,n=this.state["layerProps"],r="polygons-stroke",i="linestrings";const o=!e&&t&&this.shouldRenderSubLayer(r,n.polygonsOutline.data)&&this.getSubLayerClass(r,s.type),a=this.shouldRenderSubLayer(i,n.lines.data)&&this.getSubLayerClass(i,s.type);return o||a?(e=forwardProps(this,s.props),[o&&new o(e,this.getSubLayerProps({id:r,updateTriggers:e.updateTriggers}),n.polygonsOutline),a&&new a(e,this.getSubLayerProps({id:i,updateTriggers:e.updateTriggers}),n.lines)]):null}_renderPointLayers(){const e=this.props["pointType"],{layerProps:t,binary:n}=this.state;let r=this.props["highlightedObjectIndex"];!n&&Number.isFinite(r)&&(r=t.points.data.findIndex(e=>e.__source.index===r));const i=[];for(const s of new Set(e.split("+"))){var o="points-".concat(s),a=l[s];const A=a&&this.shouldRenderSubLayer(o,t.points.data)&&this.getSubLayerClass(o,a.type);A&&(a=forwardProps(this,a.props),i.push(new A(a,this.getSubLayerProps({id:o,updateTriggers:a.updateTriggers,highlightedObjectIndex:r}),t.points)))}return i}renderLayers(){var e=this.props["extruded"],t=this._renderPolygonLayer();return[!e&&t,this._renderLineLayers(),this._renderPointLayers(),e&&t]}getSubLayerAccessor(i){var e=this.state["binary"];return e&&"function"==typeof i?(e,t)=>{var{data:n,index:r}=t,n=binaryToFeatureForAccesor(n,r);return i(n,t)}:super.getSubLayerAccessor(i)}}geojson_layer_GeoJsonLayer.layerName="GeoJsonLayer",geojson_layer_GeoJsonLayer.defaultProps=i},function(e,t,n){"use strict";n.d(t,"a",function(){return bitmap_layer_BitmapLayer});var o=n(22),t=n(342),r=n(508),i=n(509),a=n(377),s=n(116),A=n(36),h=n(12);const p=new Uint16Array([0,2,1,0,3,2]),f=new Float32Array([0,1,0,0,1,0,1,1]);function createMesh(n,e){if(!e)return function createQuad(t){const n=new Float64Array(12);for(let e=0;e 0.5) {\n vec2 commonPos = lnglat_to_mercator(vTexPos);\n uv = getUV(commonPos);\n }\n vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n geometry.uv = uv;\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n if (picking_uActive) {\n // Since instance information is not used, we can use picking color for pixel index\n gl_FragColor.rgb = packUVsIntoRGB(uv);\n }\n}\n"),n={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:o.a.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};class bitmap_layer_BitmapLayer extends t.a{getShaders(){return super.getShaders({vs:"\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n geometry.worldPosition = positions;\n geometry.uv = texCoords;\n geometry.pickingColor = pickingColor;\n\n gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n vTexCoord = texCoords;\n\n if (coordinateConversion < -0.5) {\n vTexPos = geometry.position.xy;\n } else if (coordinateConversion > 0.5) {\n vTexPos = geometry.worldPosition.xy;\n }\n\n vec4 color = vec4(0.0);\n DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:l,modules:[r.a,i.a]})}initializeState(){const e=this.getAttributeManager();e.remove(["instancePickingColors"]);e.add({indices:{size:1,isIndexed:!0,update:e=>e.value=this.state.mesh.indices,noAlloc:!0},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:e=>e.value=this.state.mesh.positions,noAlloc:!0},texCoords:{size:2,update:e=>e.value=this.state.mesh.texCoords,noAlloc:!0}})}updateState({props:e,oldProps:t,changeFlags:n}){var r;n.extensionsChanged&&(n=this.context["gl"],null!=(r=this.state.model)&&r.delete(),this.state.model=this._getModel(n),this.getAttributeManager().invalidateAll());const i=this.getAttributeManager();if(e.bounds!==t.bounds){var o=this.state.mesh,a=this._createMesh();this.state.model.setVertexCount(a.vertexCount);for(const s in a)o&&o[s]!==a[s]&&i.invalidate(s);this.setState({mesh:a,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==t._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo({info:e}){var t=this.props["image"];if(!e.color||!t)return e.bitmap=null,e;var{width:t,height:n}=t,r=(e.index=0,function unpackUVsFromRGB(e){var[e,t,n]=e,r=(240&n)/256,n=(15&n)/16;return[(e+n)/256,(t+r)/256]}(e.color)),i=[Math.floor(r[0]*t),Math.floor(r[1]*n)];return e.bitmap={size:{width:t,height:n},uv:r,pixel:i},e}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(e){super._updateAutoHighlight({...e,color:this.encodePickingColor(0)})}_createMesh(){var e=this.props["bounds"];let t=e;return createMesh(t=Number.isFinite(e[0])?[[e[0],e[1]],[e[0],e[3]],[e[2],e[3]],[e[2],e[1]]]:t,this.context.viewport.resolution)}_getModel(e){return e?new a.a(e,{...this.getShaders(),id:this.props.id,geometry:new s.a({drawMode:4,vertexCount:6}),isInstanced:!1}):null}draw(e){var{uniforms:e,moduleParameters:t}=e;const{model:n,coordinateConversion:r,bounds:i,disablePicking:o}=this.state,{image:a,desaturate:s,transparentColor:A,tintColor:l}=this.props;t.pickingActive&&o||a&&n&&n.setUniforms(e).setUniforms({bitmapTexture:a,desaturate:s,transparentColor:A.map(e=>e/255),tintColor:l.slice(0,3).map(e=>e/255),coordinateConversion:r,bounds:i}).draw()}_getCoordinateUniforms(){var{LNGLAT:e,CARTESIAN:t,DEFAULT:n}=o.a,r=this.props["_imageCoordinateSystem"];if(r!==n){n=this.props["bounds"];if(!Number.isFinite(n[0]))throw new Error("_imageCoordinateSystem only supports rectangular bounds");var i=this.context.viewport.resolution?e:t;if((r=r===e?e:t)===e&&i===t)return{coordinateConversion:-1,bounds:n};if(r===t&&i===e)return r=Object(A.n)([n[0],n[1]]),t=Object(A.n)([n[2],n[3]]),{coordinateConversion:1,bounds:[r[0],r[1],t[0],t[1]]}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}bitmap_layer_BitmapLayer.layerName="BitmapLayer",bitmap_layer_BitmapLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return line_layer_LineLayer});var t=n(342),r=n(508),i=n(509),o=n(377),a=n(116),n={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>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}};class line_layer_LineLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float useShortestPath;\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\nvec3 splitLine(vec3 a, vec3 b, float x) {\n float t = (x - a.x) / (b.x - a.x);\n return vec3(x, mix(a.yz, b.yz, t));\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n vec3 source_world_64low = instanceSourcePositions64Low;\n vec3 target_world_64low = instanceTargetPositions64Low;\n\n if (useShortestPath > 0.5 || useShortestPath < -0.5) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n float deltaLng = target_world.x - source_world.x;\n\n if (deltaLng * useShortestPath > 180.) {\n source_world.x += 360. * useShortestPath;\n source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n source_world_64low = vec3(0.0);\n } else if (deltaLng * useShortestPath < -180.) {\n target_world.x += 360. * useShortestPath;\n target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n target_world_64low = vec3(0.0);\n } else if (useShortestPath < 0.) {\n gl_Position = vec4(0.);\n return;\n }\n }\n vec4 source_commonspace;\n vec4 target_commonspace;\n vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\n vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\n 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 geometry.pickingColor = instancePickingColors;\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}\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:[r.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const e=this.getAttributeManager();e.addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{widthUnits:n,widthScale:r,widthMinPixels:i,widthMaxPixels:o,wrapLongitude:a}=this.props,n="pixels"===n?t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({widthScale:r*n,widthMinPixels:i,widthMaxPixels:o,useShortestPath:a?1:0}).draw(),a&&this.state.model.setUniforms({useShortestPath:-1}).draw()}_getModel(e){return new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.a({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0})}}line_layer_LineLayer.layerName="LineLayer",line_layer_LineLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return arc_layer_ArcLayer});var t=n(342),r=n(508),i=n(509),o=n(377),a=n(116);const s=[0,0,0,255];n={getSourcePosition:{type:"accessor",value:e=>e.sourcePosition},getTargetPosition:{type:"accessor",value:e=>e.targetPosition},getSourceColor:{type:"accessor",value:s},getTargetColor:{type:"accessor",value:s},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class arc_layer_ArcLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\n\n float deltaZ = targetZ - sourceZ;\n float dh = distance * instanceHeights;\n if (dh == 0.0) {\n return sourceZ + deltaZ * ratio;\n }\n float unitZ = deltaZ / dh;\n float p2 = unitZ * unitZ + 1.0;\n float dir = step(deltaZ, 0.0);\n float z0 = mix(sourceZ, targetZ, dir);\n float r = mix(ratio, 1.0 - ratio, dir);\n return sqrt(r * (p2 - r)) * dh + z0;\n}\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 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\n float distance = length(source.xy - target.xy);\n float z = paraboloid(distance, source.z, target.z, segmentRatio);\n\n float tiltAngle = radians(instanceTilts);\n vec2 tiltDirection = normalize(target.xy - source.xy);\n vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\n\n return vec3(\n mix(source.xy, target.xy, segmentRatio) + tilt,\n z * cos(tiltAngle)\n );\n}\nfloat getAngularDist (vec2 source, vec2 target) {\n vec2 sourceRadians = radians(source);\n vec2 targetRadians = radians(target);\n vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\n vec2 shd_sq = sin_half_delta * sin_half_delta;\n\n float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\n return 2.0 * asin(sqrt(a));\n}\n\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\n vec2 lngLat;\n if(abs(angularDist - PI) < 0.001) {\n lngLat = (1.0 - t) * source.xy + t * target.xy;\n } else {\n float a = sin((1.0 - t) * angularDist);\n float b = sin(t * angularDist);\n vec3 p = source3D.yxz * a + target3D.yxz * b;\n lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n }\n\n float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\n\n return vec3(lngLat, z);\n}\n\nvoid main(void) {\n geometry.worldPosition = instanceSourcePositions;\n geometry.worldPositionAlt = instanceTargetPositions;\n\n float segmentIndex = positions.x;\n float segmentRatio = getSegmentRatio(segmentIndex);\n float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\n float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\n float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n isValid = 1.0;\n\n uv = vec2(segmentRatio, positions.y);\n geometry.uv = uv;\n geometry.pickingColor = instancePickingColors;\n\n vec4 curr;\n vec4 next;\n vec3 source;\n vec3 target;\n\n if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\n target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\n float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\n\n vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\n vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\n vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\n\n if (abs(currPos.x - prevPos.x) > 180.0) {\n indexDir = -1.0;\n isValid = 0.0;\n } else if (abs(currPos.x - nextPos.x) > 180.0) {\n indexDir = 1.0;\n isValid = 0.0;\n }\n nextPos = indexDir < 0.0 ? prevPos : nextPos;\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n\n if (isValid == 0.0) {\n nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\n float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\n currPos = mix(currPos, nextPos, t);\n segmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n }\n\n vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\n vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\n \n curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n \n } else {\n vec3 source_world = instanceSourcePositions;\n vec3 target_world = instanceTargetPositions;\n if (useShortestPath) {\n source_world.x = mod(source_world.x + 180., 360.0) - 180.;\n target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n float deltaLng = target_world.x - source_world.x;\n if (deltaLng > 180.) target_world.x -= 360.;\n if (deltaLng < -180.) source_world.x -= 360.;\n }\n source = project_position(source_world, instanceSourcePositions64Low);\n target = project_position(target_world, instanceTargetPositions64Low);\n float antiMeridianX = 0.0;\n\n if (useShortestPath) {\n if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n }\n float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\n\n if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\n isValid = 0.0;\n indexDir = sign(segmentRatio - thresholdRatio);\n segmentRatio = thresholdRatio;\n }\n }\n\n nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n vec3 currPos = interpolateFlat(source, target, segmentRatio);\n vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\n\n if (useShortestPath) {\n if (nextPos.x < antiMeridianX) {\n currPos.x += TILE_SIZE;\n nextPos.x += TILE_SIZE;\n }\n }\n\n curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n geometry.position = vec4(currPos, 1.0);\n }\n 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}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nvoid main(void) {\n if (isValid == 0.0) {\n discard;\n }\n\n gl_FragColor = vColor;\n geometry.uv = uv;\n\n DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[r.a,i.a]})}get wrapLongitude(){return!1}initializeState(){const e=this.getAttributeManager();e.addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:s},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:s},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(e=this.context["gl"],null!=(t=this.state.model)&&t.delete(),this.state.model=this._getModel(e),this.getAttributeManager().invalidateAll())}draw({uniforms:e}){var t=this.context["viewport"],{widthUnits:n,widthScale:r,widthMinPixels:i,widthMaxPixels:o,greatCircle:a,wrapLongitude:s}=this.props,n="pixels"===n?t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({greatCircle:a,widthScale:r*n,widthMinPixels:i,widthMaxPixels:o,useShortestPath:s}).draw()}_getModel(e){let t=[];for(let e=0;e<50;e++)t=t.concat([e,1,0,e,-1,0]);const n=new o.a(e,{...this.getShaders(),id:this.props.id,geometry:new a.a({drawMode:5,attributes:{positions:new Float32Array(t)}}),isInstanced:!0});return n.setUniforms({numSegments:50}),n}}arc_layer_ArcLayer.layerName="ArcLayer",arc_layer_ArcLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return point_cloud_layer_PointCloudLayer});var t=n(342),r=n(508),i=n(1231),o=n(509),a=n(377),s=n(116);const A=[0,0,0,255],l=[0,0,1];n={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:e=>e.position},getNormal:{type:"accessor",value:l},getColor:{type:"accessor",value:A},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class point_cloud_layer_PointCloudLayer extends t.a{getShaders(){return super.getShaders({vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\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 geometry.pickingColor = instancePickingColors;\n vec3 offset = vec3(positions.xy * radiusPixels, 0.0);\n DECKGL_FILTER_SIZE(offset, geometry);\n\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n 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}\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:[r.a,i.a,o.a]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:l},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:A}})}updateState({props:e,oldProps:t,changeFlags:n}){var r;super.updateState({props:e,oldProps:t,changeFlags:n}),n.extensionsChanged&&(t=this.context["gl"],null!=(r=this.state.model)&&r.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()),n.dataChanged&&function normalizeData(e){const{header:t,attributes:n}=e;t&&n&&(e.length=t.vertexCount,n.POSITION&&(n.instancePositions=n.POSITION),n.NORMAL&&(n.instanceNormals=n.NORMAL),n.COLOR_0&&(n.instanceColors=n.COLOR_0))}(e.data)}draw({uniforms:e}){var t=this.context["viewport"],{pointSize:n,sizeUnits:r}=this.props,r="meters"===r?1/t.metersPerPixel:1;this.state.model.setUniforms(e).setUniforms({radiusPixels:n*r}).draw()}_getModel(e){const t=[];for(let e=0;e<3;e++){var n=e/3*Math.PI*2;t.push(2*Math.cos(n),2*Math.sin(n),0)}return new a.a(e,{...this.getShaders(),id:this.props.id,geometry:new s.a({drawMode:4,attributes:{positions:new Float32Array(t)}}),isInstanced:!0})}}point_cloud_layer_PointCloudLayer.layerName="PointCloudLayer",point_cloud_layer_PointCloudLayer.defaultProps=n},function(e,t,n){"use strict";n.d(t,"a",function(){return simple_mesh_layer_SimpleMeshLayer});var r=n(28),t=n(342),i=n(508),o=n(1231),a=n(509),s=n(116),A=n(7),l=n(208),c=n(377),g=n(692),u=n(379),d=n(262);function validateGeometryAttributes(e,t){(e.COLOR_0||e.colors)&&t||(e.colors={constant:!0,value:new Float32Array([1,1,1])}),r.a.assert(e.positions||e.POSITION,'no "postions" or "POSITION" attribute in mesh')}n={mesh:{value:null,type:"object",async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:e=>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:[]}};class simple_mesh_layer_SimpleMeshLayer extends t.a{getShaders(){var e=!Object(A.j)(this.context.gl);const t={};return Object(g.b)(this.context.gl,u.a.GLSL_DERIVATIVES)&&(t.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\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 geometry.pickingColor = instancePickingColors;\n\n vTexCoord = texCoords;\n cameraPosition = project_uCameraPosition;\n normals_commonspace = project_normal(instanceModelMatrix * normals);\n vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n geometry.normal = normals_commonspace;\n\n vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n if (composeModelMatrix) {\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n }\n else {\n pos = project_size(pos);\n DECKGL_FILTER_SIZE(pos, geometry);\n gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n }\n\n geometry.position = position_commonspace;\n DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n geometry.uv = vTexCoord;\n\n vec3 normal;\n if (flatShading) {\n#ifdef DERIVATIVES_AVAILABLE\n normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n normal = vec3(0.0, 0.0, 1.0);\n#endif\n } else {\n normal = normals_commonspace;\n }\n\n vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n fragColor = vec4(lightColor, color.a * opacity);\n\n DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[i.a,o.b,a.a],transpileToGLSL100:e,defines:t})}initializeState(){const e=this.getAttributeManager();e.addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:d.a}),this.setState({emptyTexture:new l.a(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState({props:e,oldProps:t,changeFlags:n}){super.updateState({props:e,oldProps:t,changeFlags:n}),e.mesh===t.mesh&&!n.extensionsChanged||(null!=(n=this.state.model)&&n.delete(),e.mesh&&(this.state.model=this.getModel(e.mesh),n=e.mesh.attributes||e.mesh,this.setState({hasNormals:Boolean(n.NORMAL||n.normals)})),this.getAttributeManager().invalidateAll()),e.texture!==t.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(){super.finalizeState(),this.state.emptyTexture.delete()}draw({uniforms:e}){var t,n,r,i;this.state.model&&(t=this.context["viewport"],{sizeScale:n,coordinateSystem:r,_instanced:i}=this.props,this.state.model.setUniforms(e).setUniforms({sizeScale:n,composeModelMatrix:!i||Object(d.b)(t,r),flatShading:!this.state.hasNormals}).draw())}getModel(e){const t=new c.a(this.context.gl,{...this.getShaders(),id:this.props.id,geometry:function getGeometry(e,t){if(e.attributes)return validateGeometryAttributes(e.attributes,t),e instanceof s.a?e:new s.a(e);if(e.positions||e.POSITION)return validateGeometryAttributes(e,t),new s.a({attributes:e});throw Error("Invalid mesh")}(e,this.props._useMeshColors),isInstanced:!0});var e=this.props["texture"],n=this.state["emptyTexture"];return t.setUniforms({sampler:e||n,hasTexture:Boolean(e)}),t}setTexture(e){const{emptyTexture:t,model:n}=this.state;null!==n&&void 0!==n&&n.setUniforms({sampler:e||t,hasTexture:Boolean(e)})}}simple_mesh_layer_SimpleMeshLayer.layerName="SimpleMeshLayer",simple_mesh_layer_SimpleMeshLayer.defaultProps=n},function(e,t,n){"use strict";n.r(t),n.d(t,"capitalize",function(){return r.a}),n.d(t,"createChainedFunction",function(){return i.a}),n.d(t,"createSvgIcon",function(){return o.a}),n.d(t,"debounce",function(){return a.a}),n.d(t,"deprecatedPropType",function(){return s.a}),n.d(t,"isMuiElement",function(){return A.a}),n.d(t,"ownerDocument",function(){return l.a}),n.d(t,"ownerWindow",function(){return c.a}),n.d(t,"requirePropFactory",function(){return g.a}),n.d(t,"setRef",function(){return u.a}),n.d(t,"unsupportedProp",function(){return d.a}),n.d(t,"useControlled",function(){return h.a}),n.d(t,"useEventCallback",function(){return p.a}),n.d(t,"useForkRef",function(){return f.a}),n.d(t,"unstable_useId",function(){return useId}),n.d(t,"useIsFocusVisible",function(){return C.a});var r=n(26),i=n(136),o=n(91),a=n(124),s=n(130),A=n(180),l=n(54),c=n(173),g=n(399),u=n(115),d=n(400),h=n(134),p=n(51),f=n(37),I=n(0);function useId(e){var t=I.useState(e),n=t[0],r=t[1],t=e||n;return I.useEffect(function(){null==n&&r("mui-".concat(Math.round(1e5*Math.random())))},[n]),t}var C=n(172)},function(e,c,t){"use strict";!function(i){ /**! * @fileOverview Kickass library to create and place poppers near their reference elements. * @version 1.16.1-lts @@ -964,9 +964,9 @@ object-assign * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -var n="undefined"!=typeof window&&"undefined"!=typeof document&&"undefined"!=typeof navigator,o=function(){for(var e=["Edge","Trident","Firefox"],t=0;t=n.clientWidth&&e>=n.clientHeight}),t=(0A[e]&&!r.escapeWithReference&&(n=Math.min(l[t],A[e]-("right"===e?l.width:l.height))),Qk6({},t,n)}};return t.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";l=f({},l,c[t](e))}),e.offsets.popper=l,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function keepTogether(e){var t=(n=e.offsets).popper,n=n.reference,r=e.placement.split("-")[0],i=Math.floor,o=(r=-1!==["top","bottom"].indexOf(r))?"right":"bottom",a=r?"left":"top",r=r?"width":"height";return t[o]i(n[o])&&(e.offsets.popper[a]=i(n[o])),e}},arrow:{order:500,enabled:!0,fn:function arrow(e,t){if(!isModifierRequired(e.instance.modifiers,"arrow","keepTogether"))return e;if("string"==typeof(t=t.element)){if(!(t=e.instance.popper.querySelector(t)))return e}else if(!e.instance.popper.contains(t))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var n=e.placement.split("-")[0],r=(i=e.offsets).popper,i=i.reference,o=(n=-1!==["left","right"].indexOf(n))?"height":"width",a=(c=n?"Top":"Left").toLowerCase(),s=n?"left":"top",n=n?"bottom":"right",A=getOuterSizes(t)[o],n=(i[n]-Ar[n]&&(e.offsets.popper[a]+=i[a]+A-r[n]),e.offsets.popper=getClientRect(e.offsets.popper),i[a]+i[o]/2-A/2),i=getStyleComputedProperty(e.instance.popper),l=parseFloat(i["margin"+c]),i=parseFloat(i["border"+c+"Width"]),c=n-e.offsets.popper[a]-l-i,c=Math.max(Math.min(r[o]-A,c),0);return e.arrowElement=t,e.offsets.arrow=(Qk6(n={},a,Math.round(c)),Qk6(n,s,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function flip(l,c){if(isModifierEnabled(l.instance.modifiers,"inner"))return l;if(l.flipped&&l.placement===l.originalPlacement)return l;var g=getBoundaries(l.instance.popper,l.instance.reference,c.padding,c.boundariesElement,l.positionFixed),u=l.placement.split("-")[0],d=getOppositePlacement(u),h=l.placement.split("-")[1]||"",p=[];switch(c.behavior){case I:p=[u,d];break;case C:p=clockwise(u);break;case m:p=clockwise(u,!0);break;default:p=c.behavior}return p.forEach(function(e,t){if(u!==e||p.length===t+1)return l;u=l.placement.split("-")[0],d=getOppositePlacement(u);var e=l.offsets.popper,n=l.offsets.reference,r=Math.floor,n="left"===u&&r(e.right)>r(n.left)||"right"===u&&r(e.left)r(n.top)||"bottom"===u&&r(e.top)r(g.right),a=r(e.top)r(g.bottom),r="left"===u&&i||"right"===u&&o||"top"===u&&a||"bottom"===u&&e,s=-1!==["top","bottom"].indexOf(u),A=!!c.flipVariations&&(s&&"start"===h&&i||s&&"end"===h&&o||!s&&"start"===h&&a||!s&&"end"===h&&e),o=!!c.flipVariationsByContent&&(s&&"start"===h&&o||s&&"end"===h&&i||!s&&"start"===h&&e||!s&&"end"===h&&a),i=A||o;(n||r||i)&&(l.flipped=!0,(n||r)&&(u=p[t+1]),i&&(h=function getOppositeVariation(e){return"end"===e?"start":"start"===e?"end":e}(h)),l.placement=u+(h?"-"+h:""),l.offsets.popper=f({},l.offsets.popper,getPopperOffsets(l.instance.popper,l.offsets.reference,l.placement)),l=runModifiers(l.instance.modifiers,l,"flip"))}),l},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function inner(e){var t=e.placement,n=t.split("-")[0],r=(i=e.offsets).popper,i=i.reference,o=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return r[o?"left":"top"]=i[n]-(a?r[o?"width":"height"]:0),e.placement=getOppositePlacement(t),e.offsets.popper=getClientRect(r),e}},hide:{order:800,enabled:!0,fn:function hide(e){if(!isModifierRequired(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=find(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right{!function log(e){r.global.console&&r.global.console.log&&r.global.console.log(e)}("OESVertexArrayObject emulation library context restored"),A.reset_()},!0),this.reset_()});function polyfillVertexArrayObject(n){if("function"!=typeof n.createVertexArray){const t=n.getSupportedExtensions,r=(n.getSupportedExtensions=function getSupportedExtensions(){const e=t.call(this)||[];return e.indexOf("OES_vertex_array_object")<0&&e.push("OES_vertex_array_object"),e},n.getExtension);n.getExtension=function getExtension(e){var t=r.call(this,e);return t||("OES_vertex_array_object"!==e?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new a(this)),this.__OESVertexArrayObject))}}}a.prototype.VERTEX_ARRAY_BINDING_OES=34229,a.prototype.reset_=function reset_(){if(void 0!==this.vertexArrayObjects)for(let e=0;e{this.loaded=!0,t&&this.generateMipmap(e),this.setParameters(n)}),this}subImage({face:e,data:t,x:n=0,y:r=0,mipmapLevel:i=0}){return this._subImage({target:e,data:t,x:n,y:r,mipmapLevel:i})}async setCubeMapImageData({width:r,height:i,pixels:e,data:t,border:o=0,format:a=6408,type:s=5121}){const A=this["gl"],n=e||t,l=await Promise.all(g.map(e=>{e=n[e];return Promise.all(Array.isArray(e)?e:[e])}));this.bind(),g.forEach((n,e)=>{1{r&&i?A.texImage2D(n,t,a,r,i,o,a,s,e):A.texImage2D(n,t,a,a,s,e)})}),this.unbind()}setImageDataForFace(t){const{face:n,width:e,height:r,pixels:i,data:o,border:a=0,format:s=6408,type:A=5121}=t,l=this["gl"],c=i||o;return this.bind(),c instanceof Promise?c.then(e=>this.setImageDataForFace(Object.assign({},t,{face:n,data:e,pixels:e}))):this.width||this.height?l.texImage2D(n,0,s,e,r,a,s,A,c):l.texImage2D(n,0,s,s,A,c),this}}TextureCube.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return Texture3D});var u=n(7),t=n(98),d=n(158),h=n(62);class Texture3D extends t.a{static isSupported(e){return Object(u.j)(e)}constructor(e,t={}){Object(u.a)(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:n,height:r,depth:i=1,border:o=0,format:a,type:s=5121,offset:A=0,data:l,parameters:c={}}){var g;return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(u.o)(this.gl,c,()=>{ArrayBuffer.isView(l)&&this.gl.texImage3D(this.target,e,t,n,r,i,o,a,s,l),l instanceof h.a&&(this.gl.bindBuffer(35052,l.handle),this.gl.texImage3D(this.target,e,t,n,r,i,o,a,s,A))}),l&&l.byteLength?this._trackAllocatedMemory(l.byteLength,"Texture"):(c=d.a[this.dataFormat]||4,g=d.c[this.type]||1,this._trackAllocatedMemory(this.width*this.height*this.depth*c*g,"Texture")),this.loaded=!0,this}}},function(e,t,n){"use strict";n.d(t,"b",function(){return registerLoaders}),n.d(t,"a",function(){return getRegisteredLoaders});var i=n(149),r=n(155);const o=()=>{const e=Object(r.b)();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function registerLoaders(e){const t=o();for(const n of e=Array.isArray(e)?e:[e]){const r=Object(i.b)(n);t.find(e=>r===e)||t.unshift(r)}}function getRegisteredLoaders(){return o()}},function(e,t,n){"use strict";e.exports=TinySDF,e.exports.default=TinySDF;var h=1e20;function TinySDF(e,t,n,r,i,o){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;e=this.size=this.fontSize+2*this.buffer,t=e+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=e,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(t*t),this.gridInner=new Float64Array(t*t),this.f=new Float64Array(t),this.z=new Float64Array(t+1),this.v=new Uint16Array(t),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(e/2*(0<=navigator.userAgent.indexOf("Gecko/")?1.2:1))}function edt(e,t,n,r,i,o){for(var a=0;a=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&a=r.x&&r.x>=c&&i!==r.x&&pointInTriangle(on.x||r.x===n.x&&function sectorContainsSector(e,t){return area(e.prev,e,t.prev)<0&&area(t.next,e,e.next)<0}(n,r)))&&(n=r,u=A)),r=r.next,r!==l;);return n}(e,t);if(!n)return t;var e=splitPolygon(n,e),r=filterPoints(n,n.next);return filterPoints(e,e.next),t===n?r:t}(A[i],n),n=filterPoints(n,n.next);return n}(e,t,c,n)),e.length>80*n){for(var u=r=e[0],d=i=e[1],h=n;ho.x?i.x>a.x?i:a:o.x>a.x?o:a).x,c=(i.y>o.y?i.y>a.y?i:a:o.y>a.y?o:a).y,g=zOrder(s,A,t,n,r),u=zOrder(l,c,t,n,r),d=e.prevZ,h=e.nextZ;for(;d&&d.z>=g&&h&&h.z<=u;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=area(d.prev,d,d.next))return;if(d=d.prevZ,h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=area(h.prev,h,h.next))return;h=h.nextZ}for(;d&&d.z>=g;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=area(d.prev,d,d.next))return;d=d.prevZ}for(;h&&h.z<=u;){if(h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=area(h.prev,h,h.next))return;h=h.nextZ}return 1}(e,r,i,o):function isEar(e){var t=e.prev,n=e,r=e.next;if(0<=area(t,n,r))return;var i=e.next.next;for(;i!==e.prev;){if(pointInTriangle(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=area(i.prev,i,i.next))return;i=i.next}return 1}(e))t.push(s.i/n),t.push(e.i/n),t.push(A.i/n),removeNode(e),e=A.next,l=A.next;else if((e=A)===l){a?1===a?earcutLinked(e=function cureLocalIntersections(e,t,n){var r=e;do{var i=r.prev,o=r.next.next}while(!equals(i,o)&&intersects(i,r,r.next,o)&&locallyInside(i,o)&&locallyInside(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),removeNode(r),removeNode(r.next),r=e=o),r=r.next,r!==e);return filterPoints(r)}(filterPoints(e),t,n),t,n,r,i,o,2):2===a&&function splitEarcut(e,t,n,r,i,o){var a=e;do{for(var s,A=a.next.next;A!==a.prev;){if(a.i!==A.i&&function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function intersectsPolygon(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&&intersects(n,n.next,e,t))return 1}while(n=n.next,n!==e);return}(e,t)&&(locallyInside(e,t)&&locallyInside(t,e)&&function middleInside(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(area(e.prev,e,t.prev)||area(e,t.prev,t))||equals(e,t)&&0=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function sign(e){return 0>3],Q<<=7&w),A=0;A>3])?(s&&(s[w]=1),f=(o=_.encoding<2?b[v++]:E)>=6,2===(C.offsetType=m))C.offset=o.getInt8(1),I++;else if(1===m)C.offset=o.getInt16(1,!0),I+=2;else{if(0!==m)throw"Invalid block offset type";C.offset=o.getFloat32(1,!0),I+=4}if(1===C.encoding)if(m=o.getUint8(I),I++,C.bitsPerPixel=63&m,m>>=6,2===(C.numValidPixelsType=m))C.numValidPixels=o.getUint8(I),I++;else if(1===m)C.numValidPixels=o.getUint16(I,!0),I+=2;else{if(0!==m)throw"Invalid valid pixel count type";C.numValidPixels=o.getUint32(I,!0),I+=4}}if(t+=I,3!==C.encoding)if(0===C.encoding){var m=(r.pixels.numBytes-1)/4;if(m!==Math.floor(m))throw"uncompressed block has invalid length";f=new ArrayBuffer(4*m),new Uint8Array(f).set(new Uint8Array(e,t,4*m));var I=new Float32Array(f);C.rawData=I,t+=4*m}else 1===C.encoding&&(I=Math.ceil(C.numValidPixels*C.bitsPerPixel/8),m=Math.ceil(I/4),f=new ArrayBuffer(4*m),new Uint8Array(f).set(new Uint8Array(e,t,I)),C.stuffedData=new Uint32Array(f),t+=I)}}return r.eofOffset=t,r},x=function(e,t,n,r,i,o,a){var s,A,l,c,g=(1<>>d-t&g,d-=t):(l=(c&g)<<(A=t-d)&g,l+=(c=e[u++])>>>(d=32-A)),o[s]=l=n.clientWidth&&e>=n.clientHeight}),t=(0A[e]&&!r.escapeWithReference&&(n=Math.min(l[t],A[e]-("right"===e?l.width:l.height))),qq6({},t,n)}};return t.forEach(function(e){var t=-1!==["left","top"].indexOf(e)?"primary":"secondary";l=f({},l,c[t](e))}),e.offsets.popper=l,e},priority:["left","right","top","bottom"],padding:5,boundariesElement:"scrollParent"},keepTogether:{order:400,enabled:!0,fn:function keepTogether(e){var t=(n=e.offsets).popper,n=n.reference,r=e.placement.split("-")[0],i=Math.floor,o=(r=-1!==["top","bottom"].indexOf(r))?"right":"bottom",a=r?"left":"top",r=r?"width":"height";return t[o]i(n[o])&&(e.offsets.popper[a]=i(n[o])),e}},arrow:{order:500,enabled:!0,fn:function arrow(e,t){if(!isModifierRequired(e.instance.modifiers,"arrow","keepTogether"))return e;if("string"==typeof(t=t.element)){if(!(t=e.instance.popper.querySelector(t)))return e}else if(!e.instance.popper.contains(t))return console.warn("WARNING: `arrow.element` must be child of its popper element!"),e;var n=e.placement.split("-")[0],r=(i=e.offsets).popper,i=i.reference,o=(n=-1!==["left","right"].indexOf(n))?"height":"width",a=(c=n?"Top":"Left").toLowerCase(),s=n?"left":"top",n=n?"bottom":"right",A=getOuterSizes(t)[o],n=(i[n]-Ar[n]&&(e.offsets.popper[a]+=i[a]+A-r[n]),e.offsets.popper=getClientRect(e.offsets.popper),i[a]+i[o]/2-A/2),i=getStyleComputedProperty(e.instance.popper),l=parseFloat(i["margin"+c]),i=parseFloat(i["border"+c+"Width"]),c=n-e.offsets.popper[a]-l-i,c=Math.max(Math.min(r[o]-A,c),0);return e.arrowElement=t,e.offsets.arrow=(qq6(n={},a,Math.round(c)),qq6(n,s,""),n),e},element:"[x-arrow]"},flip:{order:600,enabled:!0,fn:function flip(l,c){if(isModifierEnabled(l.instance.modifiers,"inner"))return l;if(l.flipped&&l.placement===l.originalPlacement)return l;var g=getBoundaries(l.instance.popper,l.instance.reference,c.padding,c.boundariesElement,l.positionFixed),u=l.placement.split("-")[0],d=getOppositePlacement(u),h=l.placement.split("-")[1]||"",p=[];switch(c.behavior){case I:p=[u,d];break;case C:p=clockwise(u);break;case m:p=clockwise(u,!0);break;default:p=c.behavior}return p.forEach(function(e,t){if(u!==e||p.length===t+1)return l;u=l.placement.split("-")[0],d=getOppositePlacement(u);var e=l.offsets.popper,n=l.offsets.reference,r=Math.floor,n="left"===u&&r(e.right)>r(n.left)||"right"===u&&r(e.left)r(n.top)||"bottom"===u&&r(e.top)r(g.right),a=r(e.top)r(g.bottom),r="left"===u&&i||"right"===u&&o||"top"===u&&a||"bottom"===u&&e,s=-1!==["top","bottom"].indexOf(u),A=!!c.flipVariations&&(s&&"start"===h&&i||s&&"end"===h&&o||!s&&"start"===h&&a||!s&&"end"===h&&e),o=!!c.flipVariationsByContent&&(s&&"start"===h&&o||s&&"end"===h&&i||!s&&"start"===h&&e||!s&&"end"===h&&a),i=A||o;(n||r||i)&&(l.flipped=!0,(n||r)&&(u=p[t+1]),i&&(h=function getOppositeVariation(e){return"end"===e?"start":"start"===e?"end":e}(h)),l.placement=u+(h?"-"+h:""),l.offsets.popper=f({},l.offsets.popper,getPopperOffsets(l.instance.popper,l.offsets.reference,l.placement)),l=runModifiers(l.instance.modifiers,l,"flip"))}),l},behavior:"flip",padding:5,boundariesElement:"viewport",flipVariations:!1,flipVariationsByContent:!1},inner:{order:700,enabled:!1,fn:function inner(e){var t=e.placement,n=t.split("-")[0],r=(i=e.offsets).popper,i=i.reference,o=-1!==["left","right"].indexOf(n),a=-1===["top","left"].indexOf(n);return r[o?"left":"top"]=i[n]-(a?r[o?"width":"height"]:0),e.placement=getOppositePlacement(t),e.offsets.popper=getClientRect(r),e}},hide:{order:800,enabled:!0,fn:function hide(e){if(!isModifierRequired(e.instance.modifiers,"hide","preventOverflow"))return e;var t=e.offsets.reference,n=find(e.instance.modifiers,function(e){return"preventOverflow"===e.name}).boundaries;if(t.bottomn.right||t.top>n.bottom||t.right{!function log(e){r.global.console&&r.global.console.log&&r.global.console.log(e)}("OESVertexArrayObject emulation library context restored"),A.reset_()},!0),this.reset_()});function polyfillVertexArrayObject(n){if("function"!=typeof n.createVertexArray){const t=n.getSupportedExtensions,r=(n.getSupportedExtensions=function getSupportedExtensions(){const e=t.call(this)||[];return e.indexOf("OES_vertex_array_object")<0&&e.push("OES_vertex_array_object"),e},n.getExtension);n.getExtension=function getExtension(e){var t=r.call(this,e);return t||("OES_vertex_array_object"!==e?null:(n.__OESVertexArrayObject||(this.__OESVertexArrayObject=new a(this)),this.__OESVertexArrayObject))}}}a.prototype.VERTEX_ARRAY_BINDING_OES=34229,a.prototype.reset_=function reset_(){if(void 0!==this.vertexArrayObjects)for(let e=0;e{this.loaded=!0,t&&this.generateMipmap(e),this.setParameters(n)}),this}subImage({face:e,data:t,x:n=0,y:r=0,mipmapLevel:i=0}){return this._subImage({target:e,data:t,x:n,y:r,mipmapLevel:i})}async setCubeMapImageData({width:r,height:i,pixels:e,data:t,border:o=0,format:a=6408,type:s=5121}){const A=this["gl"],n=e||t,l=await Promise.all(g.map(e=>{e=n[e];return Promise.all(Array.isArray(e)?e:[e])}));this.bind(),g.forEach((n,e)=>{1{r&&i?A.texImage2D(n,t,a,r,i,o,a,s,e):A.texImage2D(n,t,a,a,s,e)})}),this.unbind()}setImageDataForFace(t){const{face:n,width:e,height:r,pixels:i,data:o,border:a=0,format:s=6408,type:A=5121}=t,l=this["gl"],c=i||o;return this.bind(),c instanceof Promise?c.then(e=>this.setImageDataForFace(Object.assign({},t,{face:n,data:e,pixels:e}))):this.width||this.height?l.texImage2D(n,0,s,e,r,a,s,A,c):l.texImage2D(n,0,s,s,A,c),this}}TextureCube.FACES=g},function(e,t,n){"use strict";n.d(t,"a",function(){return Texture3D});var u=n(7),t=n(99),d=n(162),h=n(62);class Texture3D extends t.a{static isSupported(e){return Object(u.j)(e)}constructor(e,t={}){Object(u.a)(e),super(e,t=Object.assign({depth:1},t,{target:32879,unpackFlipY:!1})),this.initialize(t),Object.seal(this)}setImageData({level:e=0,dataFormat:t=6408,width:n,height:r,depth:i=1,border:o=0,format:a,type:s=5121,offset:A=0,data:l,parameters:c={}}){var g;return this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),Object(u.o)(this.gl,c,()=>{ArrayBuffer.isView(l)&&this.gl.texImage3D(this.target,e,t,n,r,i,o,a,s,l),l instanceof h.a&&(this.gl.bindBuffer(35052,l.handle),this.gl.texImage3D(this.target,e,t,n,r,i,o,a,s,A))}),l&&l.byteLength?this._trackAllocatedMemory(l.byteLength,"Texture"):(c=d.a[this.dataFormat]||4,g=d.c[this.type]||1,this._trackAllocatedMemory(this.width*this.height*this.depth*c*g,"Texture")),this.loaded=!0,this}}},function(e,t,n){"use strict";n.d(t,"b",function(){return registerLoaders}),n.d(t,"a",function(){return getRegisteredLoaders});var i=n(153),r=n(159);const o=()=>{const e=Object(r.b)();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function registerLoaders(e){const t=o();for(const n of e=Array.isArray(e)?e:[e]){const r=Object(i.b)(n);t.find(e=>r===e)||t.unshift(r)}}function getRegisteredLoaders(){return o()}},function(e,t,n){"use strict";e.exports=TinySDF,e.exports.default=TinySDF;var h=1e20;function TinySDF(e,t,n,r,i,o){this.fontSize=e||24,this.buffer=void 0===t?3:t,this.cutoff=r||.25,this.fontFamily=i||"sans-serif",this.fontWeight=o||"normal",this.radius=n||8;e=this.size=this.fontSize+2*this.buffer,t=e+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=e,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(t*t),this.gridInner=new Float64Array(t*t),this.f=new Float64Array(t),this.z=new Float64Array(t+1),this.v=new Uint16Array(t),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(e/2*(0<=navigator.userAgent.indexOf("Gecko/")?1.2:1))}function edt(e,t,n,r,i,o){for(var a=0;a=r.next.y&&r.next.y!==r.y){var s=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(s<=i&&a=r.x&&r.x>=c&&i!==r.x&&pointInTriangle(on.x||r.x===n.x&&function sectorContainsSector(e,t){return area(e.prev,e,t.prev)<0&&area(t.next,e,e.next)<0}(n,r)))&&(n=r,u=A)),r=r.next,r!==l;);return n}(e,t);if(!n)return t;var e=splitPolygon(n,e),r=filterPoints(n,n.next);return filterPoints(e,e.next),t===n?r:t}(A[i],n),n=filterPoints(n,n.next);return n}(e,t,c,n)),e.length>80*n){for(var u=r=e[0],d=i=e[1],h=n;ho.x?i.x>a.x?i:a:o.x>a.x?o:a).x,c=(i.y>o.y?i.y>a.y?i:a:o.y>a.y?o:a).y,g=zOrder(s,A,t,n,r),u=zOrder(l,c,t,n,r),d=e.prevZ,h=e.nextZ;for(;d&&d.z>=g&&h&&h.z<=u;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=area(d.prev,d,d.next))return;if(d=d.prevZ,h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=area(h.prev,h,h.next))return;h=h.nextZ}for(;d&&d.z>=g;){if(d!==e.prev&&d!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,d.x,d.y)&&0<=area(d.prev,d,d.next))return;d=d.prevZ}for(;h&&h.z<=u;){if(h!==e.prev&&h!==e.next&&pointInTriangle(i.x,i.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=area(h.prev,h,h.next))return;h=h.nextZ}return 1}(e,r,i,o):function isEar(e){var t=e.prev,n=e,r=e.next;if(0<=area(t,n,r))return;var i=e.next.next;for(;i!==e.prev;){if(pointInTriangle(t.x,t.y,n.x,n.y,r.x,r.y,i.x,i.y)&&0<=area(i.prev,i,i.next))return;i=i.next}return 1}(e))t.push(s.i/n),t.push(e.i/n),t.push(A.i/n),removeNode(e),e=A.next,l=A.next;else if((e=A)===l){a?1===a?earcutLinked(e=function cureLocalIntersections(e,t,n){var r=e;do{var i=r.prev,o=r.next.next}while(!equals(i,o)&&intersects(i,r,r.next,o)&&locallyInside(i,o)&&locallyInside(o,i)&&(t.push(i.i/n),t.push(r.i/n),t.push(o.i/n),removeNode(r),removeNode(r.next),r=e=o),r=r.next,r!==e);return filterPoints(r)}(filterPoints(e),t,n),t,n,r,i,o,2):2===a&&function splitEarcut(e,t,n,r,i,o){var a=e;do{for(var s,A=a.next.next;A!==a.prev;){if(a.i!==A.i&&function isValidDiagonal(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function intersectsPolygon(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&&intersects(n,n.next,e,t))return 1}while(n=n.next,n!==e);return}(e,t)&&(locallyInside(e,t)&&locallyInside(t,e)&&function middleInside(e,t){var n=e,r=!1,i=(e.x+t.x)/2,o=(e.y+t.y)/2;for(;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next,n!==e;);return r}(e,t)&&(area(e.prev,e,t.prev)||area(e,t.prev,t))||equals(e,t)&&0=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function sign(e){return 0>3],Q<<=7&w),A=0;A>3])?(s&&(s[w]=1),f=(o=_.encoding<2?b[v++]:E)>=6,2===(C.offsetType=m))C.offset=o.getInt8(1),I++;else if(1===m)C.offset=o.getInt16(1,!0),I+=2;else{if(0!==m)throw"Invalid block offset type";C.offset=o.getFloat32(1,!0),I+=4}if(1===C.encoding)if(m=o.getUint8(I),I++,C.bitsPerPixel=63&m,m>>=6,2===(C.numValidPixelsType=m))C.numValidPixels=o.getUint8(I),I++;else if(1===m)C.numValidPixels=o.getUint16(I,!0),I+=2;else{if(0!==m)throw"Invalid valid pixel count type";C.numValidPixels=o.getUint32(I,!0),I+=4}}if(t+=I,3!==C.encoding)if(0===C.encoding){var m=(r.pixels.numBytes-1)/4;if(m!==Math.floor(m))throw"uncompressed block has invalid length";f=new ArrayBuffer(4*m),new Uint8Array(f).set(new Uint8Array(e,t,4*m));var I=new Float32Array(f);C.rawData=I,t+=4*m}else 1===C.encoding&&(I=Math.ceil(C.numValidPixels*C.bitsPerPixel/8),m=Math.ceil(I/4),f=new ArrayBuffer(4*m),new Uint8Array(f).set(new Uint8Array(e,t,I)),C.stuffedData=new Uint32Array(f),t+=I)}}return r.eofOffset=t,r},x=function(e,t,n,r,i,o,a){var s,A,l,c,g=(1<>>d-t&g,d-=t):(l=(c&g)<<(A=t-d)&g,l+=(c=e[u++])>>>(d=32-A)),o[s]=l>>p-n&d,p-=n):(l=(c&d)<<(g=n-p)&d,l+=(c=e[h++])>>>(p=32-g)),t[A]=i[l];else for(u=Math.ceil((s-o)/a),A=0;A>>p-n&d,p-=n):(l=(c&d)<<(g=n-p)&d,l+=(c=e[h++])>>>(p=32-g)),t[A]=l>>g-t&A,g-=t):(u=(s&A)<<(a=t-g)&A,u+=(s=e[l++])>>>(g=32-a)),d[c]=u>>h&g,d-=n,h+=n):(A=l>>>h&g,d=32-(c=n-d),A|=((l=e[u++])&(1<>>h&g,d-=n,h+=n):(A=l>>>h&g,d=32-(c=n-d),A|=((l=e[u++])&(1<>>d&A,g-=t,d+=t):(u=s>>>d&A,g=32-(a=t-g),u|=((s=e[l++])&(1<>>c-n&A,c-=n):(o=(a&A)<<(s=n-c)&A,o+=(a=e[l++])>>>(c=32-s)),t[i]=o;return t},Q=function(e,t,n,r){for(var i,o,a,s=(1<>>c&s,l-=n,c+=n):(i=o>>>c&s,l=32-(a=n-l),i|=((o=e[A++])&(1<>>16),n=(65535&n)+(n>>>16)}return 1&r&&(n+=t+=e[o]<<8),((n=(65535&n)+(n>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var n=t.ptr,r=new Uint8Array(e,n,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,r),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;n+=6;var r=new DataView(e,n,8),o=r.getInt32(0,!0);if(n+=4,3<=(i.fileVersion=o)&&(i.checksum=r.getUint32(4,!0),n+=4),r=new DataView(e,n,12),i.height=r.getUint32(0,!0),i.width=r.getUint32(4,!0),n+=8,4<=o?(i.numDims=r.getUint32(8,!0),n+=4):i.numDims=1,r=new DataView(e,n,40),i.numValidPixel=r.getUint32(0,!0),i.microBlockSize=r.getInt32(4,!0),i.blobSize=r.getInt32(8,!0),i.imageType=r.getInt32(12,!0),i.maxZError=r.getFloat64(16,!0),i.zMin=r.getFloat64(24,!0),i.zMax=r.getFloat64(32,!0),n+=40,t.headerInfo=i,t.ptr=n,3<=o&&this.computeChecksumFletcher32(new Uint8Array(e,n-(4<=o?52:48),i.blobSize-14))!==i.checksum)throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var n=t.headerInfo,r=this.getDataTypeArray(n.imageType),i=n.numDims*this.getDataTypeSize(n.imageType),o=this.readSubArray(e,t.ptr,r,i),a=this.readSubArray(e,t.ptr+i,r,i);t.ptr+=2*i;for(var s=!0,A=0;A>3],d<<=7&h):d=A[h>>3],128&d&&(u[h]=1);t.pixels.resultMask=u,a.bitset=A,n+=a.numBytes}return t.ptr=n,t.mask=a,!0},readDataOneSweep:function(e,t,n){var r=t.ptr,i=t.headerInfo,o=i.numDims,a=i.width*i.height,s=i.imageType,i=i.numValidPixel*T.getDataTypeSize(s)*o,A=t.pixels.resultMask,l=n===Uint8Array?new Uint8Array(e,r,i):(s=new ArrayBuffer(i),new Uint8Array(s).set(new Uint8Array(e,r,i)),new n(s));if(l.length===a*o)t.pixels.resultPixels=l;else{t.pixels.resultPixels=new n(a*o);var c,g=0,u=0,d=0;if(1>>32-l,l<=32-p?32===(p+=l)&&(p=0,I=h[++f]):(I=h[++f],g[s].second|=I>>>32-(p+=l-32)));var C=0,m=0,y=new S;for(u=0;u>>E&1?(Q.right||(Q.right=new S),Q.right):(Q.left||(Q.left=new S),Q.left),0!==E||Q.val||(Q.val=B[1]);return{decodeLut:w,numBitsLUTQick:m,numBitsLUT:C,tree:y,stuffedData:h,srcPtr:f,bitPos:p}},readHuffman:function(e,t,n){for(var r,i,o,a,s,A,l,c,g,u=t.headerInfo,d=u.numDims,h=t.headerInfo.height,p=t.headerInfo.width,f=p*h,e=this.readHuffmanTree(e,t),I=e.decodeLut,C=e.tree,m=e.stuffedData,y=e.srcPtr,B=e.bitPos,b=e.numBitsLUTQick,v=e.numBitsLUT,E=0===t.headerInfo.imageType?128:0,Q=t.pixels.resultMask,w=0,S=(0>>32-b,I[s=32-B>>64-B-b:s])i=I[s][1],B+=I[s][0];else for(s=a=S<>>32-v,32-B>>64-B-v),r=C,g=0;g>>v-g-1&1?r.right:r.left).left&&!r.right){i=r.val,B=B+g+1;break}32<=B&&(B-=32,S=m[++y]),o=i-E,_?(o=o+(!(0>>32-b,I[s=32-B>>64-B-b:s])i=I[s][1],B+=I[s][0];else for(s=a=S<>>32-v,32-B>>64-B-v),r=C,g=0;g>>v-g-1&1?r.right:r.left).left&&!r.right){i=r.val,B=B+g+1;break}32<=B&&(B-=32,S=m[++y]),o=i-E,_?(!(0>6),c=0==c?4:3-c,g=0<(32&l),l=31&l,u=0;if(1==c)u=A.getUint8(s),s++;else if(2==c)u=A.getUint16(s,!0),s+=2;else{if(4!=c)throw"Invalid valid pixel count type";u=A.getUint32(s,!0),s+=4}var d,h,p,f,I,C,m,c=2*o.maxZError,i=1>>m;)m++;f=Math.ceil(u*m/8),I=Math.ceil(f/4),h=new ArrayBuffer(4*I),(p=new Uint8Array(h)).set(new Uint8Array(e,t.ptr,f)),d=new Uint32Array(h),t.ptr+=f,g=(3<=a?v:B)(o,l,C-1,r,c,i),(3<=a?b:y)(d,n,m,u,g)}else t.counter.bitstuffer++,m=l,t.ptr+=s,0>6&255,(c>>2&15)!=(Q*I>>3&15))throw"integrity issue";if(3<(c=3&c))throw t.ptr+=x,"Invalid block encoding ("+c+")";if(2==c)t.counter.constant++,t.ptr+=x;else if(0==c){if(t.counter.uncompressed++,t.ptr+=x,S=(S=r*i*m)<(g=e.byteLength-t.ptr)?S:g,g=new ArrayBuffer(S%m==0?S:S+m-S%m),new Uint8Array(g).set(new Uint8Array(e,t.ptr,S)),l=new n(g),_=0,N)for(b=0;b1;const p=(e,t,n)=>{const r=e[d].get(t);if(r){t=r.value;if(f(e,t)){if(C(e,r),!e[o])return}else n&&(e[i]&&(r.value.now=Date.now()),e[u].unshiftNode(r));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},I=t=>{if(t[s]>t[a])for(let e=t[u].tail;t[s]>t[a]&&null!==e;){var n=e.prev;C(t,e),e=n}},C=(e,t)=>{var n;t&&(n=t.value,e[c]&&e[c](n.key,n.value),e[s]-=n.length,e[d].delete(n.key),e[u].removeNode(t))};class Entry{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const m=(e,t,n,r)=>{let i=n.value;f(e,i)&&(C(e,n),e[o]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class LRUCache{constructor(e){if((e=(e="number"==typeof e?{max:e}:e)||{}).max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[a]=e.max||1/0;var t=e.length||h;if(this[A]="function"!=typeof t?h:t,this[o]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[g]=e.noDisposeOnSet||!1,this[i]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,I(this)}get max(){return this[a]}set allowStale(e){this[o]=!!e}get allowStale(){return this[o]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,I(this)}get maxAge(){return this[l]}set lengthCalculator(e){(e="function"!=typeof e?h:e)!==this[A]&&(this[A]=e,this[s]=0,this[u].forEach(e=>{e.length=this[A](e.value,e.key),this[s]+=e.length})),I(this)}get lengthCalculator(){return this[A]}get length(){return this[s]}get itemCount(){return this[u].length}rforEach(t,n){n=n||this;for(let e=this[u].tail;null!==e;){var r=e.prev;m(this,t,e,n),e=r}}forEach(t,n){n=n||this;for(let e=this[u].head;null!==e;){var r=e.next;m(this,t,e,n),e=r}}keys(){return this[u].toArray().map(e=>e.key)}values(){return this[u].toArray().map(e=>e.value)}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach(e=>this[c](e.key,e.value)),this[d]=new Map,this[u]=new r,this[s]=0}dump(){return this[u].map(e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[u]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[A](t,e);if(this[d].has(e)){if(i>this[a])return C(this,this[d].get(e)),!1;const o=this[d].get(e).value;return this[c]&&!this[g]&&this[c](e,o.value),o.now=r,o.maxAge=n,o.value=t,this[s]+=i-o.length,o.length=i,this.get(e),I(this),!0}i=new Entry(e,t,i,r,n);return i.length>this[a]?(this[c]&&this[c](e,t),!1):(this[s]+=i.length,this[u].unshift(i),this[d].set(e,this[u].head),I(this),!0)}has(e){if(!this[d].has(e))return!1;e=this[d].get(e).value;return!f(this,e)}get(e){return p(this,e,!0)}peek(e){return p(this,e,!1)}pop(){var e=this[u].tail;return e?(C(this,e),e.value):null}del(e){C(this,this[d].get(e))}load(t){this.reset();var n=Date.now();for(let e=t.length-1;0<=e;e--){var r=t[e],i=r.e||0;0===i?this.set(r.k,r.v):0<(i=i-n)&&this.set(r.k,r.v,i)}}prune(){this[d].forEach((e,t)=>p(this,t,!1))}}},function(e,i,s){"use strict";!function(o){s.d(i,"a",function(){return HttpClient});var e=s(624),t=s.n(e),e=s(625),n=s.n(e),e=s(626),r=s.n(e),e=s(156),a=s(40);class HttpResponse extends e.b{constructor(e,t){super(),this.response=e,this.dataPromise=t}get status(){return this.response.statusCode}getHeader(e){return this.response.headers[e]}async getData(){return await this.dataPromise}}class HttpClient extends e.a{constructor(e){super(e),this.parsedUrl=r.a.parse(this.url),this.httpApi=("http:"===this.parsedUrl.protocol?t:n).a}constructRequest(t,i){return new Promise((n,r)=>{const e=this.httpApi.get({...this.parsedUrl,headers:t},e=>{var t=new Promise(t=>{const n=[];e.on("data",e=>{n.push(e)}),e.on("end",()=>{var e=o.concat(n).buffer;t(e)}),e.on("error",r)});n(new HttpResponse(e,t))});e.on("error",r),i&&(i.aborted&&e.destroy(new a.a("Request aborted")),i.addEventListener("abort",()=>e.destroy(new a.a("Request aborted"))))})}async request({headers:e,signal:t}={}){return await this.constructRequest(e,t)}}}.call(this,s(301).Buffer)},function(e,t){},function(e,t){},function(e,t){},function(e,n,r){"use strict";!function(t){r.d(n,"a",function(){return makeFileSource});var e=r(375),o=r.n(e);class FileSource extends r(137).a{constructor(e){super(),this.path=e,this.openRequest=function openAsync(e,t,i=void 0){return new Promise((n,r)=>{o.a.open(e,t,i,(e,t)=>{e?r(e):n(t)})})}(e,"r")}async fetchSlice(e){e=(await function readAsync(...e){return new Promise((r,i)=>{o.a.read(...e,(e,t,n)=>{e?i(e):r({bytesRead:t,buffer:n})})})}(await this.openRequest,t.alloc(e.length),0,e.length,e.offset)).buffer;return e.buffer}async close(){await function closeAsync(e){return new Promise((t,n)=>{o.a.close(e,e=>{e?n(e):t()})})}(await this.openRequest)}}function makeFileSource(e){return new FileSource(e)}}.call(this,r(301).Buffer)},function(e,t,n){"use strict";var I=n(517),C=n(761),m=n(762),r=n(765).orient2d;function concaveman(e,t,n){t=Math.max(0,void 0===t?2:t),n=n||0;for(var r,i=function fastConvexHull(e){for(var t=e[0],n=e[0],r=e[0],i=e[0],o=0;or[0]&&(r=a),a[1]i[1]&&(i=a)}var s=[t,n,r,i],A=s.slice();for(o=0;o=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function noIntersections(e,t,n){for(var r=Math.min(e[0],t[0]),i=Math.min(e[1],t[1]),o=Math.max(e[0],t[0]),a=Math.max(e[1],t[1]),s=n.search({minX:r,minY:i,maxX:o,maxY:a}),A=0;A1e19)throw new RangeError("Input expected to be < 1e19");if(e<-1e19)throw new RangeError("Input expected to be > 1e19");if(Math.abs(e)<1e3)return e;var t;var n;var r;var i=e<0?"-":"";var o={K:6,M:9,B:12,T:16};e=Math.abs(e);r=Math.floor(e).toString().length;n=r%3===0?r-3:r-r%3;t=Math.round(10*(e/Math.pow(10,n)))/10;for(var a in o)if(n0&&a.length>i){a.warned=true;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. "+"Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning";s.emitter=e;s.type=t;s.count=a.length;emitWarning(s)}}}return e}function emitWarning(e){typeof console.warn==="function"?console.warn(e):console.log(e)}function _onceWrap(e,t,n){var r=false;function g(){e.removeListener(t,g);if(!r){r=true;n.apply(e,arguments)}}g.listener=n;return g}function listenerCount(e){var t=this._events;if(t){var n=t[e];if(typeof n==="function")return 1;else if(n)return n.length}return 0}function spliceOne(e,t){for(var n=t,r=n+1,i=e.length;r0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener;i=o;break}if(i<0)return this;if(n.length===1){n[0]=undefined;if(--this._eventsCount===0){this._events=new EventHandlers;return this}else delete r[e]}else spliceOne(n,i);if(r.removeListener)this.emit("removeListener",e,a||t)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t,n;n=this._events;if(!n)return this;if(!n.removeListener){if(arguments.length===0){this._events=new EventHandlers;this._eventsCount=0}else if(n[e])if(--this._eventsCount===0)this._events=new EventHandlers;else delete n[e];return this}if(arguments.length===0){var r=Object.keys(n);for(var i=0,o;i0?Reflect.ownKeys(this._events):[]};var r=typeof Xt!=="undefined"?Xt:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},l=[],c=[],p=typeof Uint8Array!=="undefined"?Uint8Array:Array,f=false;function init(){f=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var t=0,n=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[s-2]==="="?2:e[s-1]==="="?1:0;a=new p(s*3/4-o);r=o>0?s-4:s;var A=0;for(t=0,n=0;t>16&255;a[A++]=i>>8&255;a[A++]=i&255}if(o===2){i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4;a[A++]=i&255}else if(o===1){i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2;a[A++]=i>>8&255;a[A++]=i&255}return a}function tripletToBase64(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[e&63]}function encodeChunk(e,t,n){var r;var i=[];for(var o=t;oA?A:s+a));if(r===1){t=e[n-1];i+=l[t>>2];i+=l[t<<4&63];i+="=="}else if(r===2){t=(e[n-2]<<8)+e[n-1];i+=l[t>>10];i+=l[t>>4&63];i+=l[t<<2&63];i+="="}o.push(i);return o.join("")}function read(e,t,n,r,i){var o,a;var s=i*8-r-1;var A=(1<>1;var c=-7;var g=n?i-1:0;var u=n?-1:1;var d=e[t+g];g+=u;o=d&(1<<-c)-1;d>>=-c;c+=s;for(;c>0;o=o*256+e[t+g],g+=u,c-=8);a=o&(1<<-c)-1;o>>=-c;c+=r;for(;c>0;a=a*256+e[t+g],g+=u,c-=8);if(o===0)o=1-l;else if(o===A)return a?NaN:(d?-1:1)*Infinity;else{a=a+Math.pow(2,r);o=o-l}return(d?-1:1)*a*Math.pow(2,o-r)}function write(e,t,n,r,i,o){var a,s,A;var l=o*8-i-1;var c=(1<>1;var u=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=r?0:o-1;var h=r?1:-1;var p=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){s=isNaN(t)?1:0;a=c}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(A=Math.pow(2,-a))<1){a--;A*=2}if(a+g>=1)t+=u/A;else t+=u*Math.pow(2,1-g);if(t*A>=2){a++;A/=2}if(a+g>=c){s=0;a=c}else if(a+g>=1){s=(t*A-1)*Math.pow(2,i);a=a+g}else{s=t*Math.pow(2,g-1)*Math.pow(2,i);a=0}}for(;i>=8;e[n+d]=s&255,d+=h,s/=256,i-=8);a=a<0;e[n+d]=a&255,d+=h,a/=256,l-=8);e[n+d-h]|=p*128}var I={}.toString,C=Array.isArray||function(e){return I.call(e)=="[object Array]"},m=50;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes");return e|0}function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}function byteLength(e,t){if(internalIsBuffer(e))return e.length;if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;if(typeof e!=="string")e=""+e;var n=e.length;if(n===0)return 0;var r=false;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return base64ToBytes(e).length;default:if(r)return utf8ToBytes(e).length;t=(""+t).toLowerCase();r=true}}function slowToString(e,t,n){var r=false;if(t===undefined||t<0)t=0;if(t>this.length)return"";if(n===undefined||n>this.length)n=this.length;if(n<=0)return"";n>>>=0;t>>>=0;if(n<=t)return"";if(!e)e="utf8";while(true)switch(e){case"hex":return hexSlice(this,t,n);case"utf8":case"utf-8":return utf8Slice(this,t,n);case"ascii":return asciiSlice(this,t,n);case"latin1":case"binary":return latin1Slice(this,t,n);case"base64":return base64Slice(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();r=true}}function swap(e,t,n){var r=e[t];e[t]=e[n];e[n]=r}function bidirectionalIndexOf(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==="string"){r=n;n=0}else if(n>2147483647)n=2147483647;else if(n<-2147483648)n=-2147483648;n=+n;if(isNaN(n))n=i?0:e.length-1;if(n<0)n=e.length+n;if(n>=e.length)if(i)return-1;else n=e.length-1;else if(n<0)if(i)n=0;else return-1;if(typeof t==="string")t=Buffer.from(t,r);if(internalIsBuffer(t)){if(t.length===0)return-1;return arrayIndexOf(e,t,n,r,i)}else if(typeof t==="number"){t=t&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function")if(i)return Uint8Array.prototype.indexOf.call(e,t,n);else return Uint8Array.prototype.lastIndexOf.call(e,t,n);return arrayIndexOf(e,[t],n,r,i)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,n,r,i){var o=1;var a=e.length;var s=t.length;if(r!==undefined){r=String(r).toLowerCase();if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){if(e.length<2||t.length<2)return-1;o=2;a/=2;s/=2;n/=2}}function read(e,t){if(o===1)return e[t];else return e.readUInt16BE(t*o)}var A;if(i){var l=-1;for(A=n;Aa)n=a-s;for(A=n;A>=0;A--){var c=true;for(var g=0;gi)r=i}var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(r>o/2)r=o/2;for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=n){var A,l,c,g;switch(s){case 1:if(o<128)a=o;break;case 2:A=e[i+1];if((A&192)===128){g=(o&31)<<6|A&63;if(g>127)a=g}break;case 3:A=e[i+1];l=e[i+2];if((A&192)===128&&(l&192)===128){g=(o&15)<<12|(A&63)<<6|l&63;if(g>2047&&(g<55296||g>57343))a=g}break;case 4:A=e[i+1];l=e[i+2];c=e[i+3];if((A&192)===128&&(l&192)===128&&(c&192)===128){g=(o&15)<<18|(A&63)<<12|(l&63)<<6|c&63;if(g>65535&&g<1114112)a=g}}}if(a===null){a=65533;s=1}else if(a>65535){a-=65536;r.push(a>>>10&1023|55296);a=56320|a&1023}r.push(a);i+=s}return decodeCodePointsArray(r)}Buffer.alloc=function(e,t,n){return alloc(null,e,t,n)},Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)},Buffer.isBuffer=isBuffer,Buffer.compare=function compare(e,t){if(!internalIsBuffer(e)||!internalIsBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;var n=e.length;var r=t.length;for(var i=0,o=Math.min(n,r);i0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""},Buffer.prototype.compare=function compare(e,t,n,r,i){if(!internalIsBuffer(e))throw new TypeError("Argument must be a Buffer");if(t===undefined)t=0;if(n===undefined)n=e?e.length:0;if(r===undefined)r=0;if(i===undefined)i=this.length;if(t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;t>>>=0;n>>>=0;r>>>=0;i>>>=0;if(this===e)return 0;var o=i-r;var a=n-t;var s=Math.min(o,a);var A=this.slice(r,i);var l=e.slice(t,n);for(var c=0;ci)n=i;if(e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");if(!r)r="utf8";var o=false;for(;;)switch(r){case"hex":return hexWrite(this,e,t,n);case"utf8":case"utf-8":return utf8Write(this,e,t,n);case"ascii":return asciiWrite(this,e,t,n);case"latin1":case"binary":return latin1Write(this,e,t,n);case"base64":return base64Write(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();o=true}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var y=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=y)return String.fromCharCode.apply(String,e);var n="";var r=0;while(rr)n=r;var i="";for(var o=t;on)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,n,r,i,o){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,n,r){if(t<0)t=65535+t+1;for(var i=0,o=Math.min(e.length-n,2);i>>(r?i:1-i)*8}function objectWriteUInt32(e,t,n,r){if(t<0)t=4294967295+t+1;for(var i=0,o=Math.min(e.length-n,4);i>>(r?i:3-i)*8&255}function checkIEEE754(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(e,t,n,r,i){if(!i)checkIEEE754(e,t,n,4,34028234663852886e22,-34028234663852886e22);write(e,t,n,r,23,4);return n+4}function writeDouble(e,t,n,r,i){if(!i)checkIEEE754(e,t,n,8,17976931348623157e292,-17976931348623157e292);write(e,t,n,r,52,8);return n+8}Buffer.prototype.slice=function slice(e,t){var n=this.length;e=~~e;t=t===undefined?n:~~t;if(e<0){e+=n;if(e<0)e=0}else if(e>n)e=n;if(t<0){t+=n;if(t<0)t=0}else if(t>n)t=n;if(t0&&(i*=256))r+=this[e+--t]*i;return r},Buffer.prototype.readUInt8=function readUInt8(e,t){if(!t)checkOffset(e,1,this.length);return this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){if(!t)checkOffset(e,2,this.length);return this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){if(!t)checkOffset(e,2,this.length);return this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){if(!t)checkOffset(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,n){e=e|0;t=t|0;if(!n)checkOffset(e,t,this.length);var r=this[e];var i=1;var o=0;while(++o=i)r-=Math.pow(2,8*t);return r},Buffer.prototype.readIntBE=function readIntBE(e,t,n){e=e|0;t=t|0;if(!n)checkOffset(e,t,this.length);var r=t;var i=1;var o=this[e+--r];while(r>0&&(i*=256))o+=this[e+--r]*i;i*=128;if(o>=i)o-=Math.pow(2,8*t);return o},Buffer.prototype.readInt8=function readInt8(e,t){if(!t)checkOffset(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1},Buffer.prototype.readInt16LE=function readInt16LE(e,t){if(!t)checkOffset(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt16BE=function readInt16BE(e,t){if(!t)checkOffset(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt32LE=function readInt32LE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){if(!t)checkOffset(e,4,this.length);return read(this,e,true,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){if(!t)checkOffset(e,4,this.length);return read(this,e,false,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){if(!t)checkOffset(e,8,this.length);return read(this,e,true,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){if(!t)checkOffset(e,8,this.length);return read(this,e,false,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,n,r){e=+e;t=t|0;n=n|0;if(!r){var i=Math.pow(2,8*n)-1;checkInt(this,e,t,n,i,0)}var o=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256))this[t+o]=e/a&255;return t+n},Buffer.prototype.writeUInt8=function writeUInt8(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else objectWriteUInt16(this,e,t,true);return t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else objectWriteUInt16(this,e,t,false);return t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else objectWriteUInt32(this,e,t,true);return t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else objectWriteUInt32(this,e,t,false);return t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,n,r){e=+e;t=t|0;if(!r){var i=Math.pow(2,8*n-1);checkInt(this,e,t,n,i-1,-i)}var o=0;var a=1;var s=0;this[t]=e&255;while(++o>0)-s&255}return t+n},Buffer.prototype.writeIntBE=function writeIntBE(e,t,n,r){e=+e;t=t|0;if(!r){var i=Math.pow(2,8*n-1);checkInt(this,e,t,n,i-1,-i)}var o=n-1;var a=1;var s=0;this[t+o]=e&255;while(--o>=0&&(a*=256)){if(e<0&&s===0&&this[t+o+1]!==0)s=1;this[t+o]=(e/a>>0)-s&255}return t+n},Buffer.prototype.writeInt8=function writeInt8(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e&255;return t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else objectWriteUInt16(this,e,t,true);return t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else objectWriteUInt16(this,e,t,false);return t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else objectWriteUInt32(this,e,t,true);return t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else objectWriteUInt32(this,e,t,false);return t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,n){return writeFloat(this,e,t,true,n)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,n){return writeFloat(this,e,t,false,n)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,n){return writeDouble(this,e,t,true,n)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,n){return writeDouble(this,e,t,false,n)},Buffer.prototype.copy=function copy(e,t,n,r){if(!n)n=0;if(!r&&r!==0)r=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");if(r>this.length)r=this.length;if(e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(o=0;o>>0;n=n===undefined?this.length:n>>>0;if(!e)e=0;var o;if(typeof e==="number")for(o=t;o55295&&n<57344){if(!i){if(n>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(a+1===r){if((t-=3)>-1)o.push(239,191,189);continue}i=n;continue}if(n<56320){if((t-=3)>-1)o.push(239,191,189);i=n;continue}n=(i-55296<<10|n-56320)+65536}else if(i)if((t-=3)>-1)o.push(239,191,189);i=null;if(n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function asciiToBytes(e){var t=[];for(var n=0;n>8;i=n%256;o.push(i);o.push(r)}return o}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,n,r){for(var i=0;i=t.length||i>=e.length)break;t[i+n]=e[i]}return i}function isnan(e){return e!==e}function isBuffer(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&isFastBuffer(e.slice(0,0))}function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var n=defaultSetTimout,i=defaultClearTimeout;if(typeof r.setTimeout==="function")n=setTimeout;if(typeof r.clearTimeout==="function")i=clearTimeout;function runTimeout(t){if(n===setTimeout)return setTimeout(t,0);if((n===defaultSetTimout||!n)&&setTimeout){n=setTimeout;return setTimeout(t,0)}try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}function runClearTimeout(t){if(i===clearTimeout)return clearTimeout(t);if((i===defaultClearTimeout||!i)&&clearTimeout){i=clearTimeout;return clearTimeout(t)}try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}var o=[],b=false,a,v=-1;function cleanUpNextTick(){if(!b||!a)return;b=false;if(a.length)o=a.concat(o);else v=-1;if(o.length)drainQueue()}function drainQueue(){if(b)return;var e=runTimeout(cleanUpNextTick);b=true;var t=o.length;while(t){a=o;o=[];while(++v1)for(var n=1;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}});for(var a=r[n];n=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(isBoolean(t))n.showHidden=t;else if(t)_extend(n,t);if(isUndefined(n.showHidden))n.showHidden=false;if(isUndefined(n.depth))n.depth=2;if(isUndefined(n.colors))n.colors=false;if(isUndefined(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=stylizeWithColor;return formatValue(n,e,n.depth)}function stylizeWithColor(e,t){var n=inspect.styles[t];if(n)return"["+inspect.colors[n][0]+"m"+e+"["+inspect.colors[n][1]+"m";else return e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var n={};e.forEach(function(e,t){n[e]=true});return n}function formatValue(t,n,r){if(t.customInspect&&n&&isFunction(n.inspect)&&n.inspect!==inspect&&!(n.constructor&&n.constructor.prototype===n)){var e=n.inspect(r,t);if(!isString(e))e=formatValue(t,e,r);return e}var i=formatPrimitive(t,n);if(i)return i;var o=Object.keys(n);var a=arrayToHash(o);if(t.showHidden)o=Object.getOwnPropertyNames(n);if(isError(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(n);if(o.length===0){if(isFunction(n)){var s=n.name?": "+n.name:"";return t.stylize("[Function"+s+"]","special")}if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(isDate(n))return t.stylize(Date.prototype.toString.call(n),"date");if(isError(n))return formatError(n)}var A="",l=false,c=["{","}"];if(isArray$1(n)){l=true;c=["[","]"]}if(isFunction(n)){var g=n.name?": "+n.name:"";A=" [Function"+g+"]"}if(isRegExp(n))A=" "+RegExp.prototype.toString.call(n);if(isDate(n))A=" "+Date.prototype.toUTCString.call(n);if(isError(n))A=" "+formatError(n);if(o.length===0&&(!l||n.length==0))return c[0]+A+c[1];if(r<0)if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");else return t.stylize("[Object]","special");t.seen.push(n);var u;if(l)u=formatArray(t,n,r,a,o);else u=o.map(function(e){return formatProperty(t,n,r,a,e,l)});t.seen.pop();return reduceToSingleString(u,A,c)}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(t,n,r,i,e){var o=[];for(var a=0,s=n.length;a-1)if(o)s=s.split("\n").map(function(e){return" "+e}).join("\n").substr(2);else s="\n"+s.split("\n").map(function(e){return" "+e}).join("\n")}else s=e.stylize("[Circular]","special");if(isUndefined(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i);if(a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){a=a.substr(1,a.length-2);a=e.stylize(a,"name")}else{a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");a=e.stylize(a,"string")}}return a+": "+s}function reduceToSingleString(e,t,n){var r=e.reduce(function(e,t){if(t.indexOf("\n")>=0);return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(r>60)return n[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}function isArray$1(e){return Array.isArray(e)}function isBoolean(e){return typeof e==="boolean"}function isNull(e){return e===null}function isNumber(e){return typeof e==="number"}function isString(e){return typeof e==="string"}function isUndefined(e){return e===void 0}function isRegExp(e){return isObject(e)&&objectToString(e)==="[object RegExp]"}function isObject(e){return typeof e==="object"&&e!==null}function isDate(e){return isObject(e)&&objectToString(e)==="[object Date]"}function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}function isFunction(e){return typeof e==="function"}function objectToString(e){return Object.prototype.toString.call(e)}function _extend(e,t){if(!t||!isObject(t))return e;var n=Object.keys(t);var r=n.length;while(r--)e[n[r]]=t[n[r]];return e}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BufferList(){this.head=null;this.tail=null;this.length=0}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},BufferList.prototype.push=function(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length},BufferList.prototype.unshift=function(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length},BufferList.prototype.shift=function(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e},BufferList.prototype.clear=function(){this.head=this.tail=null;this.length=0},BufferList.prototype.join=function(e){if(this.length===0)return"";var t=this.head;var n=""+t.data;while(t=t.next)n+=e+t.data;return n},BufferList.prototype.concat=function(e){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;var t=Buffer.allocUnsafe(e>>>0);var n=this.head;var r=0;while(n){n.data.copy(t,r);r+=n.data.length;n=n.next}return t};var J=Buffer.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(e){if(e&&!J(e))throw new Error("Unknown encoding: "+e)}function StringDecoder(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0}function passThroughWrite(e){return e.toString(this.encoding)}function utf16DetectIncompleteChar(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}StringDecoder.prototype.write=function(e){var t="";while(this.charLength){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,n);this.charReceived+=n;if(this.charReceived=55296&&r<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0)return t;break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var r=t.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;this.charLength+=o;this.charReceived+=o;this.charBuffer.copy(this.charBuffer,o,0,o);e.copy(this.charBuffer,0,0,o);return t.substring(0,i)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var n=this.charReceived;var r=this.charBuffer;var i=this.encoding;t+=r.slice(0,n).toString(i)}return t},Readable.ReadableState=ReadableState;var g=debuglog("stream");function prependListener(e,t,n){if(typeof e.prependListener==="function")return e.prependListener(t,n);else if(!e._events||!e._events[t])e.on(t,n);else if(Array.isArray(e._events[t]))e._events[t].unshift(n);else e._events[t]=[n,e._events[t]]}function listenerCount$1(e,t){return e.listeners(t).length}function ReadableState(e,t){e=e||{};this.objectMode=!!e.objectMode;if(t instanceof Duplex)this.objectMode=this.objectMode||!!e.readableObjectMode;var n=e.highWaterMark;var r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r;this.highWaterMark=~~this.highWaterMark;this.buffer=new BufferList;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){this.decoder=new StringDecoder(e.encoding);this.encoding=e.encoding}}function Readable(e){if(!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this);this.readable=true;if(e&&typeof e.read==="function")this._read=e.read;EventEmitter.call(this)}function readableAddChunk(e,t,n,r,i){var o=chunkInvalid(t,n);if(o)e.emit("error",o);else if(n===null){t.reading=false;onEofChunk(e,t)}else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var A;if(t.decoder&&!i&&!r){n=t.decoder.write(n);A=!t.objectMode&&n.length===0}if(!i)t.reading=false;if(!A)if(t.flowing&&t.length===0&&!t.sync){e.emit("data",n);e.read(0)}else{t.length+=t.objectMode?1:n.length;if(i)t.buffer.unshift(n);else t.buffer.push(n);if(t.needReadable)emitReadable(e)}maybeReadMore(e,t)}else if(!i)t.reading=false;return needMoreData(t)}function needMoreData(e){return!e.ended&&(e.needReadable||e.length=K)e=K;else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}function chunkInvalid(e,t){var n=null;if(!isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode)n=new TypeError("Invalid non-string/buffer chunk");return n}function onEofChunk(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();if(n&&n.length){t.buffer.push(n);t.length+=t.objectMode?1:n.length}}t.ended=true;emitReadable(e)}function emitReadable(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){g("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)nextTick(emitReadable_,e);else emitReadable_(e)}}function emitReadable_(e){g("emit readable");e.emit("readable");flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=t.length){if(t.decoder)n=t.buffer.join("");else if(t.buffer.length===1)n=t.buffer.head.data;else n=t.buffer.concat(t.length);t.buffer.clear()}else n=fromListPartial(e,t.buffer,t.decoder);return n}function fromListPartial(e,t,n){var r;if(eo.length?o.length:e;if(a===o.length)i+=o;else i+=o.slice(0,e);e-=a;if(e===0){if(a===o.length){++r;if(n.next)t.head=n.next;else t.head=t.tail=null}else{t.head=n;n.data=o.slice(a)}break}++r}t.length-=r;return i}function copyFromBuffer(e,t){var n=Buffer.allocUnsafe(e);var r=t.head;var i=1;r.data.copy(n);e-=r.data.length;while(r=r.next){var o=r.data;var a=e>o.length?o.length:e;o.copy(n,n.length-e,0,a);e-=a;if(e===0){if(a===o.length){++i;if(r.next)t.head=r.next;else t.head=t.tail=null}else{t.head=r;r.data=o.slice(a)}break}++i}t.length-=i;return n}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!t.endEmitted){t.ended=true;nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function forEach(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended)){g("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var r=t.needReadable;g("need readable",r);if(t.length===0||t.length-e0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=true;e=0}else t.length-=e;if(t.length===0){if(!t.ended)t.needReadable=true;if(n!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i},Readable.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(n,e){var r=this;var i=this._readableState;switch(i.pipesCount){case 0:i.pipes=n;break;case 1:i.pipes=[i.pipes,n];break;default:i.pipes.push(n);break}i.pipesCount+=1;g("pipe count=%d opts=%j",i.pipesCount,e);var t=!e||e.end!==false;var o=t?onend:cleanup;if(i.endEmitted)nextTick(o);else r.once("end",o);n.on("unpipe",onunpipe);function onunpipe(e){g("onunpipe");if(e===r)cleanup()}function onend(){g("onend");n.end()}var a=pipeOnDrain(r);n.on("drain",a);var s=false;function cleanup(){g("cleanup");n.removeListener("close",onclose);n.removeListener("finish",onfinish);n.removeListener("drain",a);n.removeListener("error",onerror);n.removeListener("unpipe",onunpipe);r.removeListener("end",onend);r.removeListener("end",cleanup);r.removeListener("data",ondata);s=true;if(i.awaitDrain&&(!n._writableState||n._writableState.needDrain))a()}var A=false;r.on("data",ondata);function ondata(e){g("ondata");A=false;var t=n.write(e);if(false===t&&!A){if((i.pipesCount===1&&i.pipes===n||i.pipesCount>1&&indexOf(i.pipes,n)!==-1)&&!s){g("false write response, pause",r._readableState.awaitDrain);r._readableState.awaitDrain++;A=true}r.pause()}}function onerror(e){g("onerror",e);unpipe();n.removeListener("error",onerror);if(listenerCount$1(n,"error")===0)n.emit("error",e)}prependListener(n,"error",onerror);function onclose(){n.removeListener("finish",onfinish);unpipe()}n.once("close",onclose);function onfinish(){g("onfinish");n.removeListener("close",onclose);unpipe()}n.once("finish",onfinish);function unpipe(){g("unpipe");r.unpipe(n)}n.emit("pipe",r);if(!i.flowing){g("pipe resume");r.resume()}return n},Readable.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var n=t.pipes;var r=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e;return this},Writable.prototype._write=function(e,t,n){n(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,n){var r=this._writableState;if(typeof e==="function"){n=e;e=null;t=null}else if(typeof t==="function"){n=t;t=null}if(e!==null&&e!==undefined)this.write(e,t);if(r.corked){r.corked=1;this.uncork()}if(!r.ending&&!r.finished)endWritable(this,r,n)},H(Duplex,Readable);for(var X=Object.keys(Writable.prototype),q=0,$;q-1}function listCacheSet(e,t){var n=this.__data__,r=assocIndexOf(n,e);if(r<0)n.push([e,t]);else n[r][1]=t;return this}function MapCache(e){var t=-1,n=e?e.length:0;this.clear();while(++t1?setProp(e[i]||{},r.slice(1),n):n;return Object.assign({},e,_defineProperty({},i,o))}function flattenReducer(t,n){try{t.push.apply(t,_toConsumableArray(n));return t}catch(e){return t.concat(n)}}function fastJoin(e,n){var r=true;return e.reduce(function(e,t){if(t===null||t===undefined)t="";if(r){r=false;return"".concat(t)}return"".concat(e).concat(n).concat(t)},"")}var t={getProp:getProp,setProp:setProp,fastJoin:fastJoin,flattenReducer:flattenReducer},Oe=t.getProp,Le=t.setProp,Pe=t.fastJoin,Ve=t.flattenReducer,Ze,We=function(){function JSON2CSVBase(e){_classCallCheck(this,JSON2CSVBase);this.opts=this.preprocessOpts(e);this.preprocessRow=this.memoizePreprocessRow()}_createClass(JSON2CSVBase,[{key:"preprocessOpts",value:function preprocessOpts(e){var t=Object.assign({},e);t.unwind=!Array.isArray(t.unwind)?t.unwind?[t.unwind]:[]:t.unwind;t.delimiter=t.delimiter||",";t.flattenSeparator=t.flattenSeparator||".";t.eol=t.eol||re.EOL;t.quote=typeof t.quote==="string"?e.quote:'"';t.doubleQuote=typeof t.doubleQuote==="string"?t.doubleQuote:t.quote+t.quote;t.header=t.header!==false;t.includeEmptyRows=t.includeEmptyRows||false;t.withBOM=t.withBOM||false;return t}},{key:"preprocessFieldsInfo",value:function preprocessFieldsInfo(e){var i=this;return e.map(function(t){if(typeof t==="string")return{label:t,value:t.includes(".")||t.includes("[")?function(e){return Ue(e,t,i.opts.defaultValue)}:function(e){return Oe(e,t,i.opts.defaultValue)},stringify:true};if(_typeof(t)==="object"){var n="default"in t?t.default:i.opts.defaultValue;if(typeof t.value==="string")return{label:t.label||t.value,value:t.value.includes(".")||t.value.includes("[")?function(e){return Ue(e,t.value,n)}:function(e){return Oe(e,t.value,n)},stringify:t.stringify!==undefined?t.stringify:true};if(typeof t.value==="function"){var e=t.label||t.value.name||"";var r={label:e,default:n};return{label:e,value:function value(e){var value=t.value(e,r);return value===null||value===undefined?n:value},stringify:t.stringify!==undefined?t.stringify:true}}}throw new Error("Invalid field info option. "+JSON.stringify(t))})}},{key:"getHeader",value:function getHeader(){var t=this;return Pe(this.opts.fields.map(function(e){return t.processValue(e.label,true)}),this.opts.delimiter)}},{key:"memoizePreprocessRow",value:function memoizePreprocessRow(){if(this.opts.unwind&&this.opts.unwind.length){if(this.opts.flatten)return function(e){var t=this;return this.unwindData(e,this.opts.unwind).map(function(e){return t.flatten(e,t.opts.flattenSeparator)})};return function(e){return this.unwindData(e,this.opts.unwind)}}if(this.opts.flatten)return function(e){return[this.flatten(e,this.opts.flattenSeparator)]};return function(e){return[e]}}},{key:"preprocessRow",value:function preprocessRow(){}},{key:"processRow",value:function processRow(t){var n=this;if(!t)return undefined;var e=this.opts.fields.map(function(e){return n.processCell(t,e)});if(!this.opts.includeEmptyRows&&e.every(function(e){return e===undefined}))return undefined;return Pe(e,this.opts.delimiter)}},{key:"processCell",value:function processCell(e,t){return this.processValue(t.value(e),t.stringify)}},{key:"processValue",value:function processValue(e,t){if(e===null||e===undefined)return undefined;var n=_typeof(e);if(n!=="boolean"&&n!=="number"&&n!=="string"){e=JSON.stringify(e);if(e===undefined)return undefined;if(e[0]==='"')e=e.replace(/^"(.+)"$/,"$1")}if(typeof e==="string"){if(e.includes(this.opts.quote))e=e.replace(new RegExp(this.opts.quote,"g"),this.opts.doubleQuote);if(t)e="".concat(this.opts.quote).concat(e).concat(this.opts.quote);else e=e.replace(new RegExp("^".concat(this.opts.doubleQuote)),this.opts.quote).replace(new RegExp("".concat(this.opts.doubleQuote,"$")),this.opts.quote);if(this.opts.excelStrings)e='"="'.concat(e,'""')}return e}},{key:"flatten",value:function flatten(e,a){function step(r,i,o){Object.keys(r).forEach(function(e){var t=r[e];var n=o?"".concat(o).concat(a).concat(e):e;if(_typeof(t)!=="object"||t===null||Array.isArray(t)||Object.prototype.toString.call(t.toJSON)==="[object Function]"||!Object.keys(t).length){i[n]=t;return}step(t,i,n)});return i}return step(e,{})}},{key:"unwindData",value:function unwindData(e,t){var o=this;var n=function unwind(e,i){return e.map(function(r){var e=Ue(r,i);if(!Array.isArray(e))return r;if(!e.length)return Le(r,i,undefined);return e.map(function(e,t){var n=o.opts.unwindBlank&&t>0?{}:r;return Le(n,i,e)})}).reduce(Ve,[])};return t.reduce(n,[e])}}]);return JSON2CSVBase}(),He=t.fastJoin,je=t.flattenReducer,Ye,ze=function(e){_inherits(JSON2CSVParser,e);function JSON2CSVParser(e){var t;_classCallCheck(this,JSON2CSVParser);t=_possibleConstructorReturn(this,_getPrototypeOf(JSON2CSVParser).call(this,e));if(t.opts.fields)t.opts.fields=t.preprocessFieldsInfo(t.opts.fields);return t}_createClass(JSON2CSVParser,[{key:"parse",value:function parse(e){var t=this.preprocessData(e);if(!this.opts.fields){this.opts.fields=t.reduce(function(t,e){Object.keys(e).forEach(function(e){if(!t.includes(e))t.push(e)});return t},[]);this.opts.fields=this.preprocessFieldsInfo(this.opts.fields)}var n=this.opts.header?this.getHeader():"";var r=this.processData(t);var i=(this.opts.withBOM?"\ufeff":"")+n+(n&&r?this.opts.eol:"")+r;return i}},{key:"preprocessData",value:function preprocessData(e){var t=this;var n=Array.isArray(e)?e:[e];if(!this.opts.fields&&(n.length===0||_typeof(n[0])!=="object"))throw new Error('Data should not be empty or the "fields" option should be included');if((!this.opts.unwind||!this.opts.unwind.length)&&!this.opts.flatten)return n;return n.map(function(e){return t.preprocessRow(e)}).reduce(je,[])}},{key:"processData",value:function processData(e){var t=this;return He(e.map(function(e){return t.processRow(e)}).filter(function(e){return e}),this.opts.eol)}}]);return JSON2CSVParser}(We),s={},Je=s.LEFT_BRACE=1,Ke=s.RIGHT_BRACE=2,Xe=s.LEFT_BRACKET=3,qe=s.RIGHT_BRACKET=4,$e=s.COLON=5,et=s.COMMA=6,tt=s.TRUE=7,nt=s.FALSE=8,rt=s.NULL=9,it=s.STRING=10,ot=s.NUMBER=11,A=s.START=17,at=s.STOP=18,st=s.TRUE1=33,At=s.TRUE2=34,lt=s.TRUE3=35,ct=s.FALSE1=49,gt=s.FALSE2=50,ut=s.FALSE3=51,dt=s.FALSE4=52,ht=s.NULL1=65,pt=s.NULL2=66,ft=s.NULL3=67,It=s.NUMBER1=81,Ct=s.NUMBER3=83,u=s.STRING1=97,mt=s.STRING2=98,yt=s.STRING3=99,Bt=s.STRING4=100,bt=s.STRING5=101,vt=s.STRING6=102,Et=s.VALUE=113,Qt=s.KEY=114,wt=s.OBJECT=129,St=s.ARRAY=130,_t="\\".charCodeAt(0),xt="/".charCodeAt(0),Rt="\b".charCodeAt(0),Ft="\f".charCodeAt(0),Dt="\n".charCodeAt(0),Gt="\r".charCodeAt(0),Nt="\t".charCodeAt(0),kt=64*1024;function Parser(){this.tState=A;this.value=undefined;this.string=undefined;this.stringBuffer=Buffer.alloc?Buffer.alloc(kt):new Buffer(kt);this.stringBufferOffset=0;this.unicode=undefined;this.highSurrogate=undefined;this.key=undefined;this.mode=undefined;this.stack=[];this.state=Et;this.bytes_remaining=0;this.bytes_in_sequence=0;this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)};this.offset=-1}Parser.toknam=function(e){var t=Object.keys(s);for(var n=0,r=t.length;n=kt){this.string+=this.stringBuffer.toString("utf8");this.stringBufferOffset=0}this.stringBuffer[this.stringBufferOffset++]=e},d.appendStringBuf=function(e,t,n){var r=e.length;if(typeof t==="number")if(typeof n==="number")if(n<0)r=e.length-t+n;else r=n-t;else r=e.length-t;if(r<0)r=0;if(this.stringBufferOffset+r>kt){this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset);this.stringBufferOffset=0}e.copy(this.stringBuffer,this.stringBufferOffset,t,n);this.stringBufferOffset+=r},d.write=function(e){if(typeof e==="string")e=new Buffer(e);var t;for(var n=0,r=e.length;n=48&&t<64){this.string=String.fromCharCode(t);this.tState=Ct}else if(t===32||t===9||t===10||t===13);else return this.charError(e,n)}else if(this.tState===u){t=e[n];if(this.bytes_remaining>0){for(var i=0;i=128){if(t<=193||t>244)return this.onError(new Error("Invalid UTF-8 character at position "+n+" in state "+Parser.toknam(this.tState)));if(t>=194&&t<=223)this.bytes_in_sequence=2;if(t>=224&&t<=239)this.bytes_in_sequence=3;if(t>=240&&t<=244)this.bytes_in_sequence=4;if(this.bytes_in_sequence+n>e.length){for(var o=0;o<=e.length-1-n;o++)this.temp_buffs[this.bytes_in_sequence][o]=e[n+o];this.bytes_remaining=n+this.bytes_in_sequence-e.length;n=e.length-1}else{this.appendStringBuf(e,n,n+this.bytes_in_sequence);n=n+this.bytes_in_sequence-1}}else if(t===34){this.tState=A;this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset);this.stringBufferOffset=0;this.onToken(it,this.string);this.offset+=Buffer.byteLength(this.string,"utf8")+1;this.string=undefined}else if(t===92)this.tState=mt;else if(t>=32)this.appendStringChar(t);else return this.charError(e,n)}else if(this.tState===mt){t=e[n];if(t===34){this.appendStringChar(t);this.tState=u}else if(t===92){this.appendStringChar(_t);this.tState=u}else if(t===47){this.appendStringChar(xt);this.tState=u}else if(t===98){this.appendStringChar(Rt);this.tState=u}else if(t===102){this.appendStringChar(Ft);this.tState=u}else if(t===110){this.appendStringChar(Dt);this.tState=u}else if(t===114){this.appendStringChar(Gt);this.tState=u}else if(t===116){this.appendStringChar(Nt);this.tState=u}else if(t===117){this.unicode="";this.tState=yt}else return this.charError(e,n)}else if(this.tState===yt||this.tState===Bt||this.tState===bt||this.tState===vt){t=e[n];if(t>=48&&t<64||t>64&&t<=70||t>96&&t<=102){this.unicode+=String.fromCharCode(t);if(this.tState++===vt){var a=parseInt(this.unicode,16);this.unicode=undefined;if(this.highSurrogate!==undefined&&a>=56320&&a<57343+1){this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,a)));this.highSurrogate=undefined}else if(this.highSurrogate===undefined&&a>=55296&&a<56319+1)this.highSurrogate=a;else{if(this.highSurrogate!==undefined){this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate)));this.highSurrogate=undefined}this.appendStringBuf(new Buffer(String.fromCharCode(a)))}this.tState=u}}else return this.charError(e,n)}else if(this.tState===It||this.tState===Ct){t=e[n];switch(t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(t);this.tState=Ct;break;default:this.tState=A;var s=Number(this.string);if(isNaN(s))return this.charError(e,n);if(this.string.match(/[0-9]+/)==this.string&&s.toString()!=this.string)this.onToken(it,this.string);else this.onToken(ot,s);this.offset+=this.string.length-1;this.string=undefined;n--;break}}else if(this.tState===st)if(e[n]===114)this.tState=At;else return this.charError(e,n);else if(this.tState===At)if(e[n]===117)this.tState=lt;else return this.charError(e,n);else if(this.tState===lt)if(e[n]===101){this.tState=A;this.onToken(tt,true);this.offset+=3}else return this.charError(e,n);else if(this.tState===ct)if(e[n]===97)this.tState=gt;else return this.charError(e,n);else if(this.tState===gt)if(e[n]===108)this.tState=ut;else return this.charError(e,n);else if(this.tState===ut)if(e[n]===115)this.tState=dt;else return this.charError(e,n);else if(this.tState===dt)if(e[n]===101){this.tState=A;this.onToken(nt,false);this.offset+=4}else return this.charError(e,n);else if(this.tState===ht)if(e[n]===117)this.tState=pt;else return this.charError(e,n);else if(this.tState===pt)if(e[n]===108)this.tState=ft;else return this.charError(e,n);else if(this.tState===ft)if(e[n]===108){this.tState=A;this.onToken(rt,null);this.offset+=3}else return this.charError(e,n)},d.onToken=function(e,t){},d.parseError=function(e,t){this.tState=at;this.onError(new Error("Unexpected "+Parser.toknam(e)+(t?"("+JSON.stringify(t)+")":"")+" in state "+Parser.toknam(this.state)))},d.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},d.pop=function(){var e=this.value;var t=this.stack.pop();this.value=t.value;this.key=t.key;this.mode=t.mode;this.emit(e);if(!this.mode)this.state=Et},d.emit=function(e){if(this.mode)this.state=et;this.onValue(e)},d.onValue=function(e){},d.onToken=function(e,t){if(this.state===Et)if(e===it||e===ot||e===tt||e===nt||e===rt){if(this.value)this.value[this.key]=t;this.emit(t)}else if(e===Je){this.push();if(this.value)this.value=this.value[this.key]={};else this.value={};this.key=undefined;this.state=Qt;this.mode=wt}else if(e===Xe){this.push();if(this.value)this.value=this.value[this.key]=[];else this.value=[];this.key=0;this.mode=St;this.state=Et}else if(e===Ke)if(this.mode===wt)this.pop();else return this.parseError(e,t);else if(e===qe)if(this.mode===St)this.pop();else return this.parseError(e,t);else return this.parseError(e,t);else if(this.state===Qt)if(e===it){this.key=t;this.state=$e}else if(e===Ke)this.pop();else return this.parseError(e,t);else if(this.state===$e)if(e===$e)this.state=Et;else return this.parseError(e,t);else if(this.state===et)if(e===et){if(this.mode===St){this.key++;this.state=Et}else if(this.mode===wt)this.state=Qt}else if(e===qe&&this.mode===St||e===Ke&&this.mode===wt)this.pop();else return this.parseError(e,t);else return this.parseError(e,t)},Parser.C=s,Parser),Mt,Ut,Ot=function(e){_inherits(JSON2CSVTransform,e);function JSON2CSVTransform(e,t){var n;_classCallCheck(this,JSON2CSVTransform);n=_possibleConstructorReturn(this,_getPrototypeOf(JSON2CSVTransform).call(this,t));Object.getOwnPropertyNames(We.prototype).forEach(function(e){return n[e]=We.prototype[e]});n.opts=n.preprocessOpts(e);n.preprocessRow=n.memoizePreprocessRow();n._data="";n._hasWritten=false;if(n._readableState.objectMode)n.initObjectModeParse();else if(n.opts.ndjson)n.initNDJSONParse();else n.initJSONParser();if(n.opts.withBOM)n.push("\ufeff");if(n.opts.fields){n.opts.fields=n.preprocessFieldsInfo(n.opts.fields);n.pushHeader()}return n}_createClass(JSON2CSVTransform,[{key:"initObjectModeParse",value:function initObjectModeParse(){var t=this;this.parser={write:function write(e){t.pushLine(e)},getPendingData:function getPendingData(){return undefined}}}},{key:"initNDJSONParse",value:function initNDJSONParse(){var o=this;this.parser={_data:"",write:function write(e){this._data+=e.toString();var r=this._data.split("\n").map(function(e){return e.trim()}).filter(function(e){return e!==""});var i=false;r.forEach(function(t,n){try{o.pushLine(JSON.parse(t))}catch(e){if(n===r.length-1)i=true;else{e.message="Invalid JSON ("+t+")";o.emit("error",e)}}});this._data=i?this._data.slice(this._data.lastIndexOf("\n")):""},getPendingData:function getPendingData(){return this._data}}}},{key:"initJSONParser",value:function initJSONParser(){var n=this;this.parser=new Tt;this.parser.onValue=function(e){if(this.stack.length!==this.depthToEmit)return;n.pushLine(e)};this.parser._onToken=this.parser.onToken;this.parser.onToken=function(e,t){n.parser._onToken(e,t);if(this.stack.length===0&&!n.opts.fields&&this.mode!==Tt.C.ARRAY&&this.mode!==Tt.C.OBJECT)this.onError(new Error('Data should not be empty or the "fields" option should be included'));if(this.stack.length===1){if(this.depthToEmit===undefined)this.depthToEmit=this.mode===Tt.C.ARRAY?1:0;if(this.depthToEmit!==0&&this.stack.length===1)this.value=undefined}};this.parser.getPendingData=function(){return this.value};this.parser.onError=function(e){if(e.message.includes("Unexpected"))e.message="Invalid JSON ("+e.message+")";n.emit("error",e)}}},{key:"_transform",value:function _transform(e,t,n){this.parser.write(e);n()}},{key:"_flush",value:function _flush(e){if(this.parser.getPendingData())e(new Error("Invalid data received from stdin",this.parser.getPendingData()));e()}},{key:"pushHeader",value:function pushHeader(){if(this.opts.header){var e=this.getHeader();this.emit("header",e);this.push(e);this._hasWritten=true}}},{key:"pushLine",value:function pushLine(e){var n=this;var t=this.preprocessRow(e);if(!this._hasWritten){this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(Object.keys(t[0]));this.pushHeader()}t.forEach(function(e){var t=n.processRow(e,n.opts);if(t===undefined)return;n.emit("line",t);n.push(n._hasWritten?n.opts.eol+t:t);n._hasWritten=true})}}]);return JSON2CSVTransform}(Stream.Transform),Lt=Stream.Transform,Pt=t.fastJoin,Vt,Zt=function(){function JSON2CSVAsyncParser(e,t){_classCallCheck(this,JSON2CSVAsyncParser);this.input=new Lt(t);this.input._read=function(){};this.transform=new Ot(e,t);this.processor=this.input.pipe(this.transform)}_createClass(JSON2CSVAsyncParser,[{key:"fromInput",value:function fromInput(e){if(this._input)throw new Error("Async parser already has an input.");this._input=e;this.input=this._input.pipe(this.processor);return this}},{key:"throughTransform",value:function throughTransform(e){if(this._output)throw new Error("Can't add transforms once an output has been added.");this.processor=this.processor.pipe(e);return this}},{key:"toOutput",value:function toOutput(e){if(this._output)throw new Error("Async parser already has an output.");this._output=e;this.processor=this.processor.pipe(e);return this}},{key:"promise",value:function promise(){var r=this;return new Promise(function(e,t){var n=[];r.processor.on("data",function(e){return n.push(e.toString())}).on("finish",function(){return e(Pt(n,""))}).on("error",function(e){return t(e)})})}}]);return JSON2CSVAsyncParser}(),Wt=Stream.Readable,Ht=ze,jt=Zt,Yt=Ot,zt=function parse(e,t){return new ze(t).parse(e)},Jt=function parseAsync(e,t,n){try{if(!(e instanceof Wt))n=Object.assign({},n,{objectMode:true});var r=new Zt(t,n);var i=r.promise();if(Array.isArray(e)){e.forEach(function(e){return r.input.push(e)});r.input.push(null)}else if(e instanceof Wt)r.fromInput(e);else{r.input.push(e);r.input.push(null)}return i}catch(e){return Promise.reject(e)}},Kt;e.default={Parser:Ht,AsyncParser:jt,Transform:Yt,parse:zt,parseAsync:Jt},e.Parser=Ht,e.AsyncParser=jt,e.Transform=Yt,e.parse=zt,e.parseAsync=Jt,Object.defineProperty(e,"__esModule",{value:true})}(t)}.call(this,n(59))},function(e,t,n){var r=n(905),i=n(906),o=n(563),a=n(907);e.exports=function _toConsumableArray(e){return r(e)||i(e)||o(e)||a()}},function(e,t,n){var r=n(908),i=n(909),o=n(563),a=n(910);e.exports=function _slicedToArray(e,t){return r(e)||i(e,t)||o(e,t)||a()}},function(e,t,n){var r=n(564),i=n(565),o=n(918),a=n(568),n=i(function(e){return o(r(e,1,a,!0))});e.exports=n},function(e,t,n){var r=n(925),i=n(564),o=n(565),a=n(568),n=o(function(e,t){return a(e)?r(e,i(t,1,a,!0)):[]});e.exports=n},function(e,t,n){"use strict";t.a=function stubFalse(){return!1}},function(e,i,o){"use strict";!function(e){var t=o(61),n="object"==typeof exports&&exports&&!exports.nodeType&&exports,e=n&&"object"==typeof e&&e&&!e.nodeType&&e,e=e&&e.exports===n?t.a.Buffer:void 0,r=e?e.allocUnsafe:void 0;i.a=function cloneBuffer(e,t){return t?e.slice():(t=e.length,t=r?r(t):new e.constructor(t),e.copy(t),t)}}.call(this,o(444)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t/build","src"]}}')},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var r={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},i={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>tee<=t,">=":(e,t)=>t<=e,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},o={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const a=Array.prototype.slice,s=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,a.call(t,1))};var A={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return s("join",arguments)},indexof:function(){return s("indexOf",arguments)},lastindexof:function(){return s("lastIndexOf",arguments)},slice:function(){return s("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const l=["view","item","group","xy","x","y"],c={Literal:(e,t)=>t.value,Identifier:(e,t)=>{t=t.name;return 0{var n=!t.computed,r=e(t.object),t=(n&&(e.memberDepth+=1),e(t.property));return n&&--e.memberDepth,r[t]},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return"if"===(r=r.startsWith("_")?r.slice(1):r)?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||A[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>i[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>o[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(r,e)=>e.properties.reduce((e,t)=>{r.memberDepth+=1;var n=r(t.key);return--r.memberDepth,e[n]=r(t.value),e},{})};function interpret(e,t,n,r,i,o){const a=e=>c[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,l.forEach(t=>a.fn[t]=(...e)=>i.vega[t](...e)),a(e)}var g={operator(e,t){const n=t.ast,r=e.functions;return e=>interpret(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>interpret(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>interpret(n,r,void 0,void 0,e)},handler(e,t){const r=t.ast,i=e.functions;return(e,t)=>{var n=t.item&&t.item.datum;return interpret(r,i,e,n,t)}},encode(e,t){const{marktype:a,channels:s}=t,A=e.functions,l="group"===a||"image"===a||"rect"===a;return(e,t)=>{var n=e.datum;let r=0,i;for(const o in s)i=interpret(s[o].ast,A,t,n,void 0,e),e[o]!==i&&(e[o]=i,r=1);return"rule"!==a&&function adjustSpatial(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,s,l),r}}}},function(t,e,n){!function(B){var e=function(){"use strict";function _instanceof(e,t){return null!=t&&e instanceof t}var C,m,y;try{C=Map}catch(e){C=function(){}}try{m=Set}catch(e){m=function(){}}try{y=Promise}catch(e){y=function(){}}function clone(e,u,t,d,h){"object"==typeof u&&(t=u.depth,d=u.prototype,h=u.includeNonEnumerable,u=u.circular);var p=[],f=[],I=void 0!==B;return void 0===u&&(u=!0),function _clone(e,r){if(null===e)return null;if(0===r)return e;var n,t,i;if("object"!=typeof e)return e;if(_instanceof(e,C))n=new C;else if(_instanceof(e,m))n=new m;else if(_instanceof(e,y))n=new y(function(t,n){e.then(function(e){t(_clone(e,r-1))},function(e){n(_clone(e,r-1))})});else if(clone.__isArray(e))n=[];else if(clone.__isRegExp(e))n=new RegExp(e.source,__getRegExpFlags(e)),e.lastIndex&&(n.lastIndex=e.lastIndex);else if(clone.__isDate(e))n=new Date(e.getTime());else{if(I&&B.isBuffer(e))return n=B.allocUnsafe?B.allocUnsafe(e.length):new B(e.length),e.copy(n),n;_instanceof(e,Error)?n=Object.create(e):void 0===d?(t=Object.getPrototypeOf(e),n=Object.create(t)):(n=Object.create(d),t=d)}if(u){var o=p.indexOf(e);if(-1!=o)return f[o];p.push(e),f.push(n)}for(s in _instanceof(e,C)&&e.forEach(function(e,t){t=_clone(t,r-1),e=_clone(e,r-1),n.set(t,e)}),_instanceof(e,m)&&e.forEach(function(e){e=_clone(e,r-1),n.add(e)}),e)(i=t?Object.getOwnPropertyDescriptor(t,s):i)&&null==i.set||(n[s]=_clone(e[s],r-1));if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(e),s=0;sr?"[Object]":0<=i.indexOf(t)?"[Circular]":(i.push(t),t)}}(t))}var r=`#vg-tooltip-element { +I=i={defaultNoDataValue:-34027999387901484e22,decode:function(e,t){var n=(t=t||{}).encodedMaskData||null===t.encodedMaskData,e=A(e,t.inputOffset||0,n),n=null!==t.noDataValue?t.noDataValue:i.defaultNoDataValue,r=o(e,t.pixelType||Float32Array,t.encodedMaskData,n,t.returnMask),n={width:e.width,height:e.height,pixelData:r.resultPixels,minValue:r.minValue,maxValue:e.pixels.maxValue,noDataValue:n};return r.resultMask&&(n.maskData=r.resultMask),t.returnEncodedMask&&e.mask&&(n.encodedMaskData=e.mask.bitset||null),t.returnFileInfo&&(n.fileInfo=a(e),t.computeUsedBitDepths&&(n.fileInfo.bitDepths=s(e))),n}},C=function(){"use strict";var y=function(e,t,n,r,i,o,a,s){var A,l,c,g,u,d=(1<>>p-n&d,p-=n):(l=(c&d)<<(g=n-p)&d,l+=(c=e[h++])>>>(p=32-g)),t[A]=i[l];else for(u=Math.ceil((s-o)/a),A=0;A>>p-n&d,p-=n):(l=(c&d)<<(g=n-p)&d,l+=(c=e[h++])>>>(p=32-g)),t[A]=l>>g-t&A,g-=t):(u=(s&A)<<(a=t-g)&A,u+=(s=e[l++])>>>(g=32-a)),d[c]=u>>h&g,d-=n,h+=n):(A=l>>>h&g,d=32-(c=n-d),A|=((l=e[u++])&(1<>>h&g,d-=n,h+=n):(A=l>>>h&g,d=32-(c=n-d),A|=((l=e[u++])&(1<>>d&A,g-=t,d+=t):(u=s>>>d&A,g=32-(a=t-g),u|=((s=e[l++])&(1<>>c-n&A,c-=n):(o=(a&A)<<(s=n-c)&A,o+=(a=e[l++])>>>(c=32-s)),t[i]=o;return t},Q=function(e,t,n,r){for(var i,o,a,s=(1<>>c&s,l-=n,c+=n):(i=o>>>c&s,l=32-(a=n-l),i|=((o=e[A++])&(1<>>16),n=(65535&n)+(n>>>16)}return 1&r&&(n+=t+=e[o]<<8),((n=(65535&n)+(n>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var n=t.ptr,r=new Uint8Array(e,n,6),i={};if(i.fileIdentifierString=String.fromCharCode.apply(null,r),0!==i.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+i.fileIdentifierString;n+=6;var r=new DataView(e,n,8),o=r.getInt32(0,!0);if(n+=4,3<=(i.fileVersion=o)&&(i.checksum=r.getUint32(4,!0),n+=4),r=new DataView(e,n,12),i.height=r.getUint32(0,!0),i.width=r.getUint32(4,!0),n+=8,4<=o?(i.numDims=r.getUint32(8,!0),n+=4):i.numDims=1,r=new DataView(e,n,40),i.numValidPixel=r.getUint32(0,!0),i.microBlockSize=r.getInt32(4,!0),i.blobSize=r.getInt32(8,!0),i.imageType=r.getInt32(12,!0),i.maxZError=r.getFloat64(16,!0),i.zMin=r.getFloat64(24,!0),i.zMax=r.getFloat64(32,!0),n+=40,t.headerInfo=i,t.ptr=n,3<=o&&this.computeChecksumFletcher32(new Uint8Array(e,n-(4<=o?52:48),i.blobSize-14))!==i.checksum)throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var n=t.headerInfo,r=this.getDataTypeArray(n.imageType),i=n.numDims*this.getDataTypeSize(n.imageType),o=this.readSubArray(e,t.ptr,r,i),a=this.readSubArray(e,t.ptr+i,r,i);t.ptr+=2*i;for(var s=!0,A=0;A>3],d<<=7&h):d=A[h>>3],128&d&&(u[h]=1);t.pixels.resultMask=u,a.bitset=A,n+=a.numBytes}return t.ptr=n,t.mask=a,!0},readDataOneSweep:function(e,t,n){var r=t.ptr,i=t.headerInfo,o=i.numDims,a=i.width*i.height,s=i.imageType,i=i.numValidPixel*T.getDataTypeSize(s)*o,A=t.pixels.resultMask,l=n===Uint8Array?new Uint8Array(e,r,i):(s=new ArrayBuffer(i),new Uint8Array(s).set(new Uint8Array(e,r,i)),new n(s));if(l.length===a*o)t.pixels.resultPixels=l;else{t.pixels.resultPixels=new n(a*o);var c,g=0,u=0,d=0;if(1>>32-l,l<=32-p?32===(p+=l)&&(p=0,I=h[++f]):(I=h[++f],g[s].second|=I>>>32-(p+=l-32)));var C=0,m=0,y=new S;for(u=0;u>>E&1?(Q.right||(Q.right=new S),Q.right):(Q.left||(Q.left=new S),Q.left),0!==E||Q.val||(Q.val=B[1]);return{decodeLut:w,numBitsLUTQick:m,numBitsLUT:C,tree:y,stuffedData:h,srcPtr:f,bitPos:p}},readHuffman:function(e,t,n){for(var r,i,o,a,s,A,l,c,g,u=t.headerInfo,d=u.numDims,h=t.headerInfo.height,p=t.headerInfo.width,f=p*h,e=this.readHuffmanTree(e,t),I=e.decodeLut,C=e.tree,m=e.stuffedData,y=e.srcPtr,B=e.bitPos,b=e.numBitsLUTQick,v=e.numBitsLUT,E=0===t.headerInfo.imageType?128:0,Q=t.pixels.resultMask,w=0,S=(0>>32-b,I[s=32-B>>64-B-b:s])i=I[s][1],B+=I[s][0];else for(s=a=S<>>32-v,32-B>>64-B-v),r=C,g=0;g>>v-g-1&1?r.right:r.left).left&&!r.right){i=r.val,B=B+g+1;break}32<=B&&(B-=32,S=m[++y]),o=i-E,_?(o=o+(!(0>>32-b,I[s=32-B>>64-B-b:s])i=I[s][1],B+=I[s][0];else for(s=a=S<>>32-v,32-B>>64-B-v),r=C,g=0;g>>v-g-1&1?r.right:r.left).left&&!r.right){i=r.val,B=B+g+1;break}32<=B&&(B-=32,S=m[++y]),o=i-E,_?(!(0>6),c=0==c?4:3-c,g=0<(32&l),l=31&l,u=0;if(1==c)u=A.getUint8(s),s++;else if(2==c)u=A.getUint16(s,!0),s+=2;else{if(4!=c)throw"Invalid valid pixel count type";u=A.getUint32(s,!0),s+=4}var d,h,p,f,I,C,m,c=2*o.maxZError,i=1>>m;)m++;f=Math.ceil(u*m/8),I=Math.ceil(f/4),h=new ArrayBuffer(4*I),(p=new Uint8Array(h)).set(new Uint8Array(e,t.ptr,f)),d=new Uint32Array(h),t.ptr+=f,g=(3<=a?v:B)(o,l,C-1,r,c,i),(3<=a?b:y)(d,n,m,u,g)}else t.counter.bitstuffer++,m=l,t.ptr+=s,0>6&255,(c>>2&15)!=(Q*I>>3&15))throw"integrity issue";if(3<(c=3&c))throw t.ptr+=x,"Invalid block encoding ("+c+")";if(2==c)t.counter.constant++,t.ptr+=x;else if(0==c){if(t.counter.uncompressed++,t.ptr+=x,S=(S=r*i*m)<(g=e.byteLength-t.ptr)?S:g,g=new ArrayBuffer(S%m==0?S:S+m-S%m),new Uint8Array(g).set(new Uint8Array(e,t.ptr,S)),l=new n(g),_=0,N)for(b=0;b1;const p=(e,t,n)=>{const r=e[d].get(t);if(r){t=r.value;if(f(e,t)){if(C(e,r),!e[o])return}else n&&(e[i]&&(r.value.now=Date.now()),e[u].unshiftNode(r));return t.value}},f=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;var n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},I=t=>{if(t[s]>t[a])for(let e=t[u].tail;t[s]>t[a]&&null!==e;){var n=e.prev;C(t,e),e=n}},C=(e,t)=>{var n;t&&(n=t.value,e[c]&&e[c](n.key,n.value),e[s]-=n.length,e[d].delete(n.key),e[u].removeNode(t))};class Entry{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const m=(e,t,n,r)=>{let i=n.value;f(e,i)&&(C(e,n),e[o]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class LRUCache{constructor(e){if((e=(e="number"==typeof e?{max:e}:e)||{}).max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[a]=e.max||1/0;var t=e.length||h;if(this[A]="function"!=typeof t?h:t,this[o]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[g]=e.noDisposeOnSet||!1,this[i]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[a]=e||1/0,I(this)}get max(){return this[a]}set allowStale(e){this[o]=!!e}get allowStale(){return this[o]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,I(this)}get maxAge(){return this[l]}set lengthCalculator(e){(e="function"!=typeof e?h:e)!==this[A]&&(this[A]=e,this[s]=0,this[u].forEach(e=>{e.length=this[A](e.value,e.key),this[s]+=e.length})),I(this)}get lengthCalculator(){return this[A]}get length(){return this[s]}get itemCount(){return this[u].length}rforEach(t,n){n=n||this;for(let e=this[u].tail;null!==e;){var r=e.prev;m(this,t,e,n),e=r}}forEach(t,n){n=n||this;for(let e=this[u].head;null!==e;){var r=e.next;m(this,t,e,n),e=r}}keys(){return this[u].toArray().map(e=>e.key)}values(){return this[u].toArray().map(e=>e.value)}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach(e=>this[c](e.key,e.value)),this[d]=new Map,this[u]=new r,this[s]=0}dump(){return this[u].map(e=>!f(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[u]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");var r=n?Date.now():0,i=this[A](t,e);if(this[d].has(e)){if(i>this[a])return C(this,this[d].get(e)),!1;const o=this[d].get(e).value;return this[c]&&!this[g]&&this[c](e,o.value),o.now=r,o.maxAge=n,o.value=t,this[s]+=i-o.length,o.length=i,this.get(e),I(this),!0}i=new Entry(e,t,i,r,n);return i.length>this[a]?(this[c]&&this[c](e,t),!1):(this[s]+=i.length,this[u].unshift(i),this[d].set(e,this[u].head),I(this),!0)}has(e){if(!this[d].has(e))return!1;e=this[d].get(e).value;return!f(this,e)}get(e){return p(this,e,!0)}peek(e){return p(this,e,!1)}pop(){var e=this[u].tail;return e?(C(this,e),e.value):null}del(e){C(this,this[d].get(e))}load(t){this.reset();var n=Date.now();for(let e=t.length-1;0<=e;e--){var r=t[e],i=r.e||0;0===i?this.set(r.k,r.v):0<(i=i-n)&&this.set(r.k,r.v,i)}}prune(){this[d].forEach((e,t)=>p(this,t,!1))}}},function(e,i,s){"use strict";!function(o){s.d(i,"a",function(){return HttpClient});var e=s(655),t=s.n(e),e=s(656),n=s.n(e),e=s(657),r=s.n(e),e=s(160),a=s(40);class HttpResponse extends e.b{constructor(e,t){super(),this.response=e,this.dataPromise=t}get status(){return this.response.statusCode}getHeader(e){return this.response.headers[e]}async getData(){return await this.dataPromise}}class HttpClient extends e.a{constructor(e){super(e),this.parsedUrl=r.a.parse(this.url),this.httpApi=("http:"===this.parsedUrl.protocol?t:n).a}constructRequest(t,i){return new Promise((n,r)=>{const e=this.httpApi.get({...this.parsedUrl,headers:t},e=>{var t=new Promise(t=>{const n=[];e.on("data",e=>{n.push(e)}),e.on("end",()=>{var e=o.concat(n).buffer;t(e)}),e.on("error",r)});n(new HttpResponse(e,t))});e.on("error",r),i&&(i.aborted&&e.destroy(new a.a("Request aborted")),i.addEventListener("abort",()=>e.destroy(new a.a("Request aborted"))))})}async request({headers:e,signal:t}={}){return await this.constructRequest(e,t)}}}.call(this,s(307).Buffer)},function(e,t){},function(e,t){},function(e,t){},function(e,n,r){"use strict";!function(t){r.d(n,"a",function(){return makeFileSource});var e=r(382),o=r.n(e);class FileSource extends r(140).a{constructor(e){super(),this.path=e,this.openRequest=function openAsync(e,t,i=void 0){return new Promise((n,r)=>{o.a.open(e,t,i,(e,t)=>{e?r(e):n(t)})})}(e,"r")}async fetchSlice(e){e=(await function readAsync(...e){return new Promise((r,i)=>{o.a.read(...e,(e,t,n)=>{e?i(e):r({bytesRead:t,buffer:n})})})}(await this.openRequest,t.alloc(e.length),0,e.length,e.offset)).buffer;return e.buffer}async close(){await function closeAsync(e){return new Promise((t,n)=>{o.a.close(e,e=>{e?n(e):t()})})}(await this.openRequest)}}function makeFileSource(e){return new FileSource(e)}}.call(this,r(307).Buffer)},function(e,t,n){"use strict";var I=n(526),C=n(792),m=n(793),r=n(796).orient2d;function concaveman(e,t,n){t=Math.max(0,void 0===t?2:t),n=n||0;for(var r,i=function fastConvexHull(e){for(var t=e[0],n=e[0],r=e[0],i=e[0],o=0;or[0]&&(r=a),a[1]i[1]&&(i=a)}var s=[t,n,r,i],A=s.slice();for(o=0;o=t.minX&&e[0]<=t.maxX&&e[1]>=t.minY&&e[1]<=t.maxY}function noIntersections(e,t,n){for(var r=Math.min(e[0],t[0]),i=Math.min(e[1],t[1]),o=Math.max(e[0],t[0]),a=Math.max(e[1],t[1]),s=n.search({minX:r,minY:i,maxX:o,maxY:a}),A=0;A1e19)throw new RangeError("Input expected to be < 1e19");if(e<-1e19)throw new RangeError("Input expected to be > 1e19");if(Math.abs(e)<1e3)return e;var t;var n;var r;var i=e<0?"-":"";var o={K:6,M:9,B:12,T:16};e=Math.abs(e);r=Math.floor(e).toString().length;n=r%3===0?r-3:r-r%3;t=Math.round(10*(e/Math.pow(10,n)))/10;for(var a in o)if(n0&&a.length>i){a.warned=true;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. "+"Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning";s.emitter=e;s.type=t;s.count=a.length;emitWarning(s)}}}return e}function emitWarning(e){typeof console.warn==="function"?console.warn(e):console.log(e)}function _onceWrap(e,t,n){var r=false;function g(){e.removeListener(t,g);if(!r){r=true;n.apply(e,arguments)}}g.listener=n;return g}function listenerCount(e){var t=this._events;if(t){var n=t[e];if(typeof n==="function")return 1;else if(n)return n.length}return 0}function spliceOne(e,t){for(var n=t,r=n+1,i=e.length;r0;)if(n[o]===t||n[o].listener&&n[o].listener===t){a=n[o].listener;i=o;break}if(i<0)return this;if(n.length===1){n[0]=undefined;if(--this._eventsCount===0){this._events=new EventHandlers;return this}else delete r[e]}else spliceOne(n,i);if(r.removeListener)this.emit("removeListener",e,a||t)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(e){var t,n;n=this._events;if(!n)return this;if(!n.removeListener){if(arguments.length===0){this._events=new EventHandlers;this._eventsCount=0}else if(n[e])if(--this._eventsCount===0)this._events=new EventHandlers;else delete n[e];return this}if(arguments.length===0){var r=Object.keys(n);for(var i=0,o;i0?Reflect.ownKeys(this._events):[]};var r=typeof Xt!=="undefined"?Xt:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{},l=[],c=[],p=typeof Uint8Array!=="undefined"?Uint8Array:Array,f=false;function init(){f=true;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var t=0,n=e.length;t0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[s-2]==="="?2:e[s-1]==="="?1:0;a=new p(s*3/4-o);r=o>0?s-4:s;var A=0;for(t=0,n=0;t>16&255;a[A++]=i>>8&255;a[A++]=i&255}if(o===2){i=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4;a[A++]=i&255}else if(o===1){i=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2;a[A++]=i>>8&255;a[A++]=i&255}return a}function tripletToBase64(e){return l[e>>18&63]+l[e>>12&63]+l[e>>6&63]+l[e&63]}function encodeChunk(e,t,n){var r;var i=[];for(var o=t;oA?A:s+a));if(r===1){t=e[n-1];i+=l[t>>2];i+=l[t<<4&63];i+="=="}else if(r===2){t=(e[n-2]<<8)+e[n-1];i+=l[t>>10];i+=l[t>>4&63];i+=l[t<<2&63];i+="="}o.push(i);return o.join("")}function read(e,t,n,r,i){var o,a;var s=i*8-r-1;var A=(1<>1;var c=-7;var g=n?i-1:0;var u=n?-1:1;var d=e[t+g];g+=u;o=d&(1<<-c)-1;d>>=-c;c+=s;for(;c>0;o=o*256+e[t+g],g+=u,c-=8);a=o&(1<<-c)-1;o>>=-c;c+=r;for(;c>0;a=a*256+e[t+g],g+=u,c-=8);if(o===0)o=1-l;else if(o===A)return a?NaN:(d?-1:1)*Infinity;else{a=a+Math.pow(2,r);o=o-l}return(d?-1:1)*a*Math.pow(2,o-r)}function write(e,t,n,r,i,o){var a,s,A;var l=o*8-i-1;var c=(1<>1;var u=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=r?0:o-1;var h=r?1:-1;var p=t<0||t===0&&1/t<0?1:0;t=Math.abs(t);if(isNaN(t)||t===Infinity){s=isNaN(t)?1:0;a=c}else{a=Math.floor(Math.log(t)/Math.LN2);if(t*(A=Math.pow(2,-a))<1){a--;A*=2}if(a+g>=1)t+=u/A;else t+=u*Math.pow(2,1-g);if(t*A>=2){a++;A/=2}if(a+g>=c){s=0;a=c}else if(a+g>=1){s=(t*A-1)*Math.pow(2,i);a=a+g}else{s=t*Math.pow(2,g-1)*Math.pow(2,i);a=0}}for(;i>=8;e[n+d]=s&255,d+=h,s/=256,i-=8);a=a<0;e[n+d]=a&255,d+=h,a/=256,l-=8);e[n+d-h]|=p*128}var I={}.toString,C=Array.isArray||function(e){return I.call(e)=="[object Array]"},m=50;function kMaxLength(){return Buffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(e,t){if(kMaxLength()=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+kMaxLength().toString(16)+" bytes");return e|0}function internalIsBuffer(e){return!!(e!=null&&e._isBuffer)}function byteLength(e,t){if(internalIsBuffer(e))return e.length;if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;if(typeof e!=="string")e=""+e;var n=e.length;if(n===0)return 0;var r=false;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case undefined:return utf8ToBytes(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return base64ToBytes(e).length;default:if(r)return utf8ToBytes(e).length;t=(""+t).toLowerCase();r=true}}function slowToString(e,t,n){var r=false;if(t===undefined||t<0)t=0;if(t>this.length)return"";if(n===undefined||n>this.length)n=this.length;if(n<=0)return"";n>>>=0;t>>>=0;if(n<=t)return"";if(!e)e="utf8";while(true)switch(e){case"hex":return hexSlice(this,t,n);case"utf8":case"utf-8":return utf8Slice(this,t,n);case"ascii":return asciiSlice(this,t,n);case"latin1":case"binary":return latin1Slice(this,t,n);case"base64":return base64Slice(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase();r=true}}function swap(e,t,n){var r=e[t];e[t]=e[n];e[n]=r}function bidirectionalIndexOf(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==="string"){r=n;n=0}else if(n>2147483647)n=2147483647;else if(n<-2147483648)n=-2147483648;n=+n;if(isNaN(n))n=i?0:e.length-1;if(n<0)n=e.length+n;if(n>=e.length)if(i)return-1;else n=e.length-1;else if(n<0)if(i)n=0;else return-1;if(typeof t==="string")t=Buffer.from(t,r);if(internalIsBuffer(t)){if(t.length===0)return-1;return arrayIndexOf(e,t,n,r,i)}else if(typeof t==="number"){t=t&255;if(Buffer.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function")if(i)return Uint8Array.prototype.indexOf.call(e,t,n);else return Uint8Array.prototype.lastIndexOf.call(e,t,n);return arrayIndexOf(e,[t],n,r,i)}throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(e,t,n,r,i){var o=1;var a=e.length;var s=t.length;if(r!==undefined){r=String(r).toLowerCase();if(r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le"){if(e.length<2||t.length<2)return-1;o=2;a/=2;s/=2;n/=2}}function read(e,t){if(o===1)return e[t];else return e.readUInt16BE(t*o)}var A;if(i){var l=-1;for(A=n;Aa)n=a-s;for(A=n;A>=0;A--){var c=true;for(var g=0;gi)r=i}var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(r>o/2)r=o/2;for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=n){var A,l,c,g;switch(s){case 1:if(o<128)a=o;break;case 2:A=e[i+1];if((A&192)===128){g=(o&31)<<6|A&63;if(g>127)a=g}break;case 3:A=e[i+1];l=e[i+2];if((A&192)===128&&(l&192)===128){g=(o&15)<<12|(A&63)<<6|l&63;if(g>2047&&(g<55296||g>57343))a=g}break;case 4:A=e[i+1];l=e[i+2];c=e[i+3];if((A&192)===128&&(l&192)===128&&(c&192)===128){g=(o&15)<<18|(A&63)<<12|(l&63)<<6|c&63;if(g>65535&&g<1114112)a=g}}}if(a===null){a=65533;s=1}else if(a>65535){a-=65536;r.push(a>>>10&1023|55296);a=56320|a&1023}r.push(a);i+=s}return decodeCodePointsArray(r)}Buffer.alloc=function(e,t,n){return alloc(null,e,t,n)},Buffer.allocUnsafe=function(e){return allocUnsafe(null,e)},Buffer.allocUnsafeSlow=function(e){return allocUnsafe(null,e)},Buffer.isBuffer=isBuffer,Buffer.compare=function compare(e,t){if(!internalIsBuffer(e)||!internalIsBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;var n=e.length;var r=t.length;for(var i=0,o=Math.min(n,r);i0){e=this.toString("hex",0,t).match(/.{2}/g).join(" ");if(this.length>t)e+=" ... "}return""},Buffer.prototype.compare=function compare(e,t,n,r,i){if(!internalIsBuffer(e))throw new TypeError("Argument must be a Buffer");if(t===undefined)t=0;if(n===undefined)n=e?e.length:0;if(r===undefined)r=0;if(i===undefined)i=this.length;if(t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;t>>>=0;n>>>=0;r>>>=0;i>>>=0;if(this===e)return 0;var o=i-r;var a=n-t;var s=Math.min(o,a);var A=this.slice(r,i);var l=e.slice(t,n);for(var c=0;ci)n=i;if(e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");if(!r)r="utf8";var o=false;for(;;)switch(r){case"hex":return hexWrite(this,e,t,n);case"utf8":case"utf-8":return utf8Write(this,e,t,n);case"ascii":return asciiWrite(this,e,t,n);case"latin1":case"binary":return latin1Write(this,e,t,n);case"base64":return base64Write(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase();o=true}},Buffer.prototype.toJSON=function toJSON(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var y=4096;function decodeCodePointsArray(e){var t=e.length;if(t<=y)return String.fromCharCode.apply(String,e);var n="";var r=0;while(rr)n=r;var i="";for(var o=t;on)throw new RangeError("Trying to access beyond buffer length")}function checkInt(e,t,n,r,i,o){if(!internalIsBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function objectWriteUInt16(e,t,n,r){if(t<0)t=65535+t+1;for(var i=0,o=Math.min(e.length-n,2);i>>(r?i:1-i)*8}function objectWriteUInt32(e,t,n,r){if(t<0)t=4294967295+t+1;for(var i=0,o=Math.min(e.length-n,4);i>>(r?i:3-i)*8&255}function checkIEEE754(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function writeFloat(e,t,n,r,i){if(!i)checkIEEE754(e,t,n,4,34028234663852886e22,-34028234663852886e22);write(e,t,n,r,23,4);return n+4}function writeDouble(e,t,n,r,i){if(!i)checkIEEE754(e,t,n,8,17976931348623157e292,-17976931348623157e292);write(e,t,n,r,52,8);return n+8}Buffer.prototype.slice=function slice(e,t){var n=this.length;e=~~e;t=t===undefined?n:~~t;if(e<0){e+=n;if(e<0)e=0}else if(e>n)e=n;if(t<0){t+=n;if(t<0)t=0}else if(t>n)t=n;if(t0&&(i*=256))r+=this[e+--t]*i;return r},Buffer.prototype.readUInt8=function readUInt8(e,t){if(!t)checkOffset(e,1,this.length);return this[e]},Buffer.prototype.readUInt16LE=function readUInt16LE(e,t){if(!t)checkOffset(e,2,this.length);return this[e]|this[e+1]<<8},Buffer.prototype.readUInt16BE=function readUInt16BE(e,t){if(!t)checkOffset(e,2,this.length);return this[e]<<8|this[e+1]},Buffer.prototype.readUInt32LE=function readUInt32LE(e,t){if(!t)checkOffset(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},Buffer.prototype.readUInt32BE=function readUInt32BE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Buffer.prototype.readIntLE=function readIntLE(e,t,n){e=e|0;t=t|0;if(!n)checkOffset(e,t,this.length);var r=this[e];var i=1;var o=0;while(++o=i)r-=Math.pow(2,8*t);return r},Buffer.prototype.readIntBE=function readIntBE(e,t,n){e=e|0;t=t|0;if(!n)checkOffset(e,t,this.length);var r=t;var i=1;var o=this[e+--r];while(r>0&&(i*=256))o+=this[e+--r]*i;i*=128;if(o>=i)o-=Math.pow(2,8*t);return o},Buffer.prototype.readInt8=function readInt8(e,t){if(!t)checkOffset(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1},Buffer.prototype.readInt16LE=function readInt16LE(e,t){if(!t)checkOffset(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt16BE=function readInt16BE(e,t){if(!t)checkOffset(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},Buffer.prototype.readInt32LE=function readInt32LE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Buffer.prototype.readInt32BE=function readInt32BE(e,t){if(!t)checkOffset(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Buffer.prototype.readFloatLE=function readFloatLE(e,t){if(!t)checkOffset(e,4,this.length);return read(this,e,true,23,4)},Buffer.prototype.readFloatBE=function readFloatBE(e,t){if(!t)checkOffset(e,4,this.length);return read(this,e,false,23,4)},Buffer.prototype.readDoubleLE=function readDoubleLE(e,t){if(!t)checkOffset(e,8,this.length);return read(this,e,true,52,8)},Buffer.prototype.readDoubleBE=function readDoubleBE(e,t){if(!t)checkOffset(e,8,this.length);return read(this,e,false,52,8)},Buffer.prototype.writeUIntLE=function writeUIntLE(e,t,n,r){e=+e;t=t|0;n=n|0;if(!r){var i=Math.pow(2,8*n)-1;checkInt(this,e,t,n,i,0)}var o=1;var a=0;this[t]=e&255;while(++a=0&&(a*=256))this[t+o]=e/a&255;return t+n},Buffer.prototype.writeUInt8=function writeUInt8(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,1,255,0);if(!Buffer.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[t]=e&255;return t+1},Buffer.prototype.writeUInt16LE=function writeUInt16LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else objectWriteUInt16(this,e,t,true);return t+2},Buffer.prototype.writeUInt16BE=function writeUInt16BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,65535,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else objectWriteUInt16(this,e,t,false);return t+2},Buffer.prototype.writeUInt32LE=function writeUInt32LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t+3]=e>>>24;this[t+2]=e>>>16;this[t+1]=e>>>8;this[t]=e&255}else objectWriteUInt32(this,e,t,true);return t+4},Buffer.prototype.writeUInt32BE=function writeUInt32BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,4294967295,0);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else objectWriteUInt32(this,e,t,false);return t+4},Buffer.prototype.writeIntLE=function writeIntLE(e,t,n,r){e=+e;t=t|0;if(!r){var i=Math.pow(2,8*n-1);checkInt(this,e,t,n,i-1,-i)}var o=0;var a=1;var s=0;this[t]=e&255;while(++o>0)-s&255}return t+n},Buffer.prototype.writeIntBE=function writeIntBE(e,t,n,r){e=+e;t=t|0;if(!r){var i=Math.pow(2,8*n-1);checkInt(this,e,t,n,i-1,-i)}var o=n-1;var a=1;var s=0;this[t+o]=e&255;while(--o>=0&&(a*=256)){if(e<0&&s===0&&this[t+o+1]!==0)s=1;this[t+o]=(e/a>>0)-s&255}return t+n},Buffer.prototype.writeInt8=function writeInt8(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,1,127,-128);if(!Buffer.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[t]=e&255;return t+1},Buffer.prototype.writeInt16LE=function writeInt16LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8}else objectWriteUInt16(this,e,t,true);return t+2},Buffer.prototype.writeInt16BE=function writeInt16BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,2,32767,-32768);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>8;this[t+1]=e&255}else objectWriteUInt16(this,e,t,false);return t+2},Buffer.prototype.writeInt32LE=function writeInt32LE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,2147483647,-2147483648);if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e&255;this[t+1]=e>>>8;this[t+2]=e>>>16;this[t+3]=e>>>24}else objectWriteUInt32(this,e,t,true);return t+4},Buffer.prototype.writeInt32BE=function writeInt32BE(e,t,n){e=+e;t=t|0;if(!n)checkInt(this,e,t,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(Buffer.TYPED_ARRAY_SUPPORT){this[t]=e>>>24;this[t+1]=e>>>16;this[t+2]=e>>>8;this[t+3]=e&255}else objectWriteUInt32(this,e,t,false);return t+4},Buffer.prototype.writeFloatLE=function writeFloatLE(e,t,n){return writeFloat(this,e,t,true,n)},Buffer.prototype.writeFloatBE=function writeFloatBE(e,t,n){return writeFloat(this,e,t,false,n)},Buffer.prototype.writeDoubleLE=function writeDoubleLE(e,t,n){return writeDouble(this,e,t,true,n)},Buffer.prototype.writeDoubleBE=function writeDoubleBE(e,t,n){return writeDouble(this,e,t,false,n)},Buffer.prototype.copy=function copy(e,t,n,r){if(!n)n=0;if(!r&&r!==0)r=this.length;if(t>=e.length)t=e.length;if(!t)t=0;if(r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");if(r>this.length)r=this.length;if(e.length-t=0;--o)e[o+t]=this[o+n];else if(i<1e3||!Buffer.TYPED_ARRAY_SUPPORT)for(o=0;o>>0;n=n===undefined?this.length:n>>>0;if(!e)e=0;var o;if(typeof e==="number")for(o=t;o55295&&n<57344){if(!i){if(n>56319){if((t-=3)>-1)o.push(239,191,189);continue}else if(a+1===r){if((t-=3)>-1)o.push(239,191,189);continue}i=n;continue}if(n<56320){if((t-=3)>-1)o.push(239,191,189);i=n;continue}n=(i-55296<<10|n-56320)+65536}else if(i)if((t-=3)>-1)o.push(239,191,189);i=null;if(n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function asciiToBytes(e){var t=[];for(var n=0;n>8;i=n%256;o.push(i);o.push(r)}return o}function base64ToBytes(e){return toByteArray(base64clean(e))}function blitBuffer(e,t,n,r){for(var i=0;i=t.length||i>=e.length)break;t[i+n]=e[i]}return i}function isnan(e){return e!==e}function isBuffer(e){return e!=null&&(!!e._isBuffer||isFastBuffer(e)||isSlowBuffer(e))}function isFastBuffer(e){return!!e.constructor&&typeof e.constructor.isBuffer==="function"&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return typeof e.readFloatLE==="function"&&typeof e.slice==="function"&&isFastBuffer(e.slice(0,0))}function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var n=defaultSetTimout,i=defaultClearTimeout;if(typeof r.setTimeout==="function")n=setTimeout;if(typeof r.clearTimeout==="function")i=clearTimeout;function runTimeout(t){if(n===setTimeout)return setTimeout(t,0);if((n===defaultSetTimout||!n)&&setTimeout){n=setTimeout;return setTimeout(t,0)}try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}function runClearTimeout(t){if(i===clearTimeout)return clearTimeout(t);if((i===defaultClearTimeout||!i)&&clearTimeout){i=clearTimeout;return clearTimeout(t)}try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}var o=[],b=false,a,v=-1;function cleanUpNextTick(){if(!b||!a)return;b=false;if(a.length)o=a.concat(o);else v=-1;if(o.length)drainQueue()}function drainQueue(){if(b)return;var e=runTimeout(cleanUpNextTick);b=true;var t=o.length;while(t){a=o;o=[];while(++v1)for(var n=1;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}});for(var a=r[n];n=3)n.depth=arguments[2];if(arguments.length>=4)n.colors=arguments[3];if(isBoolean(t))n.showHidden=t;else if(t)_extend(n,t);if(isUndefined(n.showHidden))n.showHidden=false;if(isUndefined(n.depth))n.depth=2;if(isUndefined(n.colors))n.colors=false;if(isUndefined(n.customInspect))n.customInspect=true;if(n.colors)n.stylize=stylizeWithColor;return formatValue(n,e,n.depth)}function stylizeWithColor(e,t){var n=inspect.styles[t];if(n)return"["+inspect.colors[n][0]+"m"+e+"["+inspect.colors[n][1]+"m";else return e}function stylizeNoColor(e,t){return e}function arrayToHash(e){var n={};e.forEach(function(e,t){n[e]=true});return n}function formatValue(t,n,r){if(t.customInspect&&n&&isFunction(n.inspect)&&n.inspect!==inspect&&!(n.constructor&&n.constructor.prototype===n)){var e=n.inspect(r,t);if(!isString(e))e=formatValue(t,e,r);return e}var i=formatPrimitive(t,n);if(i)return i;var o=Object.keys(n);var a=arrayToHash(o);if(t.showHidden)o=Object.getOwnPropertyNames(n);if(isError(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return formatError(n);if(o.length===0){if(isFunction(n)){var s=n.name?": "+n.name:"";return t.stylize("[Function"+s+"]","special")}if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(isDate(n))return t.stylize(Date.prototype.toString.call(n),"date");if(isError(n))return formatError(n)}var A="",l=false,c=["{","}"];if(isArray$1(n)){l=true;c=["[","]"]}if(isFunction(n)){var g=n.name?": "+n.name:"";A=" [Function"+g+"]"}if(isRegExp(n))A=" "+RegExp.prototype.toString.call(n);if(isDate(n))A=" "+Date.prototype.toUTCString.call(n);if(isError(n))A=" "+formatError(n);if(o.length===0&&(!l||n.length==0))return c[0]+A+c[1];if(r<0)if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");else return t.stylize("[Object]","special");t.seen.push(n);var u;if(l)u=formatArray(t,n,r,a,o);else u=o.map(function(e){return formatProperty(t,n,r,a,e,l)});t.seen.pop();return reduceToSingleString(u,A,c)}function formatPrimitive(e,t){if(isUndefined(t))return e.stylize("undefined","undefined");if(isString(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(isNumber(t))return e.stylize(""+t,"number");if(isBoolean(t))return e.stylize(""+t,"boolean");if(isNull(t))return e.stylize("null","null")}function formatError(e){return"["+Error.prototype.toString.call(e)+"]"}function formatArray(t,n,r,i,e){var o=[];for(var a=0,s=n.length;a-1)if(o)s=s.split("\n").map(function(e){return" "+e}).join("\n").substr(2);else s="\n"+s.split("\n").map(function(e){return" "+e}).join("\n")}else s=e.stylize("[Circular]","special");if(isUndefined(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i);if(a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)){a=a.substr(1,a.length-2);a=e.stylize(a,"name")}else{a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'");a=e.stylize(a,"string")}}return a+": "+s}function reduceToSingleString(e,t,n){var r=e.reduce(function(e,t){if(t.indexOf("\n")>=0);return e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(r>60)return n[0]+(t===""?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}function isArray$1(e){return Array.isArray(e)}function isBoolean(e){return typeof e==="boolean"}function isNull(e){return e===null}function isNumber(e){return typeof e==="number"}function isString(e){return typeof e==="string"}function isUndefined(e){return e===void 0}function isRegExp(e){return isObject(e)&&objectToString(e)==="[object RegExp]"}function isObject(e){return typeof e==="object"&&e!==null}function isDate(e){return isObject(e)&&objectToString(e)==="[object Date]"}function isError(e){return isObject(e)&&(objectToString(e)==="[object Error]"||e instanceof Error)}function isFunction(e){return typeof e==="function"}function objectToString(e){return Object.prototype.toString.call(e)}function _extend(e,t){if(!t||!isObject(t))return e;var n=Object.keys(t);var r=n.length;while(r--)e[n[r]]=t[n[r]];return e}function hasOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function BufferList(){this.head=null;this.tail=null;this.length=0}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},BufferList.prototype.push=function(e){var t={data:e,next:null};if(this.length>0)this.tail.next=t;else this.head=t;this.tail=t;++this.length},BufferList.prototype.unshift=function(e){var t={data:e,next:this.head};if(this.length===0)this.tail=t;this.head=t;++this.length},BufferList.prototype.shift=function(){if(this.length===0)return;var e=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;--this.length;return e},BufferList.prototype.clear=function(){this.head=this.tail=null;this.length=0},BufferList.prototype.join=function(e){if(this.length===0)return"";var t=this.head;var n=""+t.data;while(t=t.next)n+=e+t.data;return n},BufferList.prototype.concat=function(e){if(this.length===0)return Buffer.alloc(0);if(this.length===1)return this.head.data;var t=Buffer.allocUnsafe(e>>>0);var n=this.head;var r=0;while(n){n.data.copy(t,r);r+=n.data.length;n=n.next}return t};var J=Buffer.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return true;default:return false}};function assertEncoding(e){if(e&&!J(e))throw new Error("Unknown encoding: "+e)}function StringDecoder(e){this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,"");assertEncoding(e);switch(this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2;this.detectIncompleteChar=utf16DetectIncompleteChar;break;case"base64":this.surrogateSize=3;this.detectIncompleteChar=base64DetectIncompleteChar;break;default:this.write=passThroughWrite;return}this.charBuffer=new Buffer(6);this.charReceived=0;this.charLength=0}function passThroughWrite(e){return e.toString(this.encoding)}function utf16DetectIncompleteChar(e){this.charReceived=e.length%2;this.charLength=this.charReceived?2:0}function base64DetectIncompleteChar(e){this.charReceived=e.length%3;this.charLength=this.charReceived?3:0}StringDecoder.prototype.write=function(e){var t="";while(this.charLength){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;e.copy(this.charBuffer,this.charReceived,0,n);this.charReceived+=n;if(this.charReceived=55296&&r<=56319){this.charLength+=this.surrogateSize;t="";continue}this.charReceived=this.charLength=0;if(e.length===0)return t;break}this.detectIncompleteChar(e);var i=e.length;if(this.charLength){e.copy(this.charBuffer,0,e.length-this.charReceived,i);i-=this.charReceived}t+=e.toString(this.encoding,0,i);var i=t.length-1;var r=t.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;this.charLength+=o;this.charReceived+=o;this.charBuffer.copy(this.charBuffer,o,0,o);e.copy(this.charBuffer,0,0,o);return t.substring(0,i)}return t},StringDecoder.prototype.detectIncompleteChar=function(e){var t=e.length>=3?3:e.length;for(;t>0;t--){var n=e[e.length-t];if(t==1&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},StringDecoder.prototype.end=function(e){var t="";if(e&&e.length)t=this.write(e);if(this.charReceived){var n=this.charReceived;var r=this.charBuffer;var i=this.encoding;t+=r.slice(0,n).toString(i)}return t},Readable.ReadableState=ReadableState;var g=debuglog("stream");function prependListener(e,t,n){if(typeof e.prependListener==="function")return e.prependListener(t,n);else if(!e._events||!e._events[t])e.on(t,n);else if(Array.isArray(e._events[t]))e._events[t].unshift(n);else e._events[t]=[n,e._events[t]]}function listenerCount$1(e,t){return e.listeners(t).length}function ReadableState(e,t){e=e||{};this.objectMode=!!e.objectMode;if(t instanceof Duplex)this.objectMode=this.objectMode||!!e.readableObjectMode;var n=e.highWaterMark;var r=this.objectMode?16:16*1024;this.highWaterMark=n||n===0?n:r;this.highWaterMark=~~this.highWaterMark;this.buffer=new BufferList;this.length=0;this.pipes=null;this.pipesCount=0;this.flowing=null;this.ended=false;this.endEmitted=false;this.reading=false;this.sync=true;this.needReadable=false;this.emittedReadable=false;this.readableListening=false;this.resumeScheduled=false;this.defaultEncoding=e.defaultEncoding||"utf8";this.ranOut=false;this.awaitDrain=0;this.readingMore=false;this.decoder=null;this.encoding=null;if(e.encoding){this.decoder=new StringDecoder(e.encoding);this.encoding=e.encoding}}function Readable(e){if(!(this instanceof Readable))return new Readable(e);this._readableState=new ReadableState(e,this);this.readable=true;if(e&&typeof e.read==="function")this._read=e.read;EventEmitter.call(this)}function readableAddChunk(e,t,n,r,i){var o=chunkInvalid(t,n);if(o)e.emit("error",o);else if(n===null){t.reading=false;onEofChunk(e,t)}else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var A;if(t.decoder&&!i&&!r){n=t.decoder.write(n);A=!t.objectMode&&n.length===0}if(!i)t.reading=false;if(!A)if(t.flowing&&t.length===0&&!t.sync){e.emit("data",n);e.read(0)}else{t.length+=t.objectMode?1:n.length;if(i)t.buffer.unshift(n);else t.buffer.push(n);if(t.needReadable)emitReadable(e)}maybeReadMore(e,t)}else if(!i)t.reading=false;return needMoreData(t)}function needMoreData(e){return!e.ended&&(e.needReadable||e.length=K)e=K;else{e--;e|=e>>>1;e|=e>>>2;e|=e>>>4;e|=e>>>8;e|=e>>>16;e++}return e}function howMuchToRead(e,t){if(e<=0||t.length===0&&t.ended)return 0;if(t.objectMode)return 1;if(e!==e)if(t.flowing&&t.length)return t.buffer.head.data.length;else return t.length;if(e>t.highWaterMark)t.highWaterMark=computeNewHighWaterMark(e);if(e<=t.length)return e;if(!t.ended){t.needReadable=true;return 0}return t.length}function chunkInvalid(e,t){var n=null;if(!isBuffer(t)&&typeof t!=="string"&&t!==null&&t!==undefined&&!e.objectMode)n=new TypeError("Invalid non-string/buffer chunk");return n}function onEofChunk(e,t){if(t.ended)return;if(t.decoder){var n=t.decoder.end();if(n&&n.length){t.buffer.push(n);t.length+=t.objectMode?1:n.length}}t.ended=true;emitReadable(e)}function emitReadable(e){var t=e._readableState;t.needReadable=false;if(!t.emittedReadable){g("emitReadable",t.flowing);t.emittedReadable=true;if(t.sync)nextTick(emitReadable_,e);else emitReadable_(e)}}function emitReadable_(e){g("emit readable");e.emit("readable");flow(e)}function maybeReadMore(e,t){if(!t.readingMore){t.readingMore=true;nextTick(maybeReadMore_,e,t)}}function maybeReadMore_(e,t){var n=t.length;while(!t.reading&&!t.flowing&&!t.ended&&t.length=t.length){if(t.decoder)n=t.buffer.join("");else if(t.buffer.length===1)n=t.buffer.head.data;else n=t.buffer.concat(t.length);t.buffer.clear()}else n=fromListPartial(e,t.buffer,t.decoder);return n}function fromListPartial(e,t,n){var r;if(eo.length?o.length:e;if(a===o.length)i+=o;else i+=o.slice(0,e);e-=a;if(e===0){if(a===o.length){++r;if(n.next)t.head=n.next;else t.head=t.tail=null}else{t.head=n;n.data=o.slice(a)}break}++r}t.length-=r;return i}function copyFromBuffer(e,t){var n=Buffer.allocUnsafe(e);var r=t.head;var i=1;r.data.copy(n);e-=r.data.length;while(r=r.next){var o=r.data;var a=e>o.length?o.length:e;o.copy(n,n.length-e,0,a);e-=a;if(e===0){if(a===o.length){++i;if(r.next)t.head=r.next;else t.head=t.tail=null}else{t.head=r;r.data=o.slice(a)}break}++i}t.length-=i;return n}function endReadable(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');if(!t.endEmitted){t.ended=true;nextTick(endReadableNT,t,e)}}function endReadableNT(e,t){if(!e.endEmitted&&e.length===0){e.endEmitted=true;t.readable=false;t.emit("end")}}function forEach(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended)){g("read: emitReadable",t.length,t.ended);if(t.length===0&&t.ended)endReadable(this);else emitReadable(this);return null}e=howMuchToRead(e,t);if(e===0&&t.ended){if(t.length===0)endReadable(this);return null}var r=t.needReadable;g("need readable",r);if(t.length===0||t.length-e0)i=fromList(e,t);else i=null;if(i===null){t.needReadable=true;e=0}else t.length-=e;if(t.length===0){if(!t.ended)t.needReadable=true;if(n!==e&&t.ended)endReadable(this)}if(i!==null)this.emit("data",i);return i},Readable.prototype._read=function(e){this.emit("error",new Error("not implemented"))},Readable.prototype.pipe=function(n,e){var r=this;var i=this._readableState;switch(i.pipesCount){case 0:i.pipes=n;break;case 1:i.pipes=[i.pipes,n];break;default:i.pipes.push(n);break}i.pipesCount+=1;g("pipe count=%d opts=%j",i.pipesCount,e);var t=!e||e.end!==false;var o=t?onend:cleanup;if(i.endEmitted)nextTick(o);else r.once("end",o);n.on("unpipe",onunpipe);function onunpipe(e){g("onunpipe");if(e===r)cleanup()}function onend(){g("onend");n.end()}var a=pipeOnDrain(r);n.on("drain",a);var s=false;function cleanup(){g("cleanup");n.removeListener("close",onclose);n.removeListener("finish",onfinish);n.removeListener("drain",a);n.removeListener("error",onerror);n.removeListener("unpipe",onunpipe);r.removeListener("end",onend);r.removeListener("end",cleanup);r.removeListener("data",ondata);s=true;if(i.awaitDrain&&(!n._writableState||n._writableState.needDrain))a()}var A=false;r.on("data",ondata);function ondata(e){g("ondata");A=false;var t=n.write(e);if(false===t&&!A){if((i.pipesCount===1&&i.pipes===n||i.pipesCount>1&&indexOf(i.pipes,n)!==-1)&&!s){g("false write response, pause",r._readableState.awaitDrain);r._readableState.awaitDrain++;A=true}r.pause()}}function onerror(e){g("onerror",e);unpipe();n.removeListener("error",onerror);if(listenerCount$1(n,"error")===0)n.emit("error",e)}prependListener(n,"error",onerror);function onclose(){n.removeListener("finish",onfinish);unpipe()}n.once("close",onclose);function onfinish(){g("onfinish");n.removeListener("close",onclose);unpipe()}n.once("finish",onfinish);function unpipe(){g("unpipe");r.unpipe(n)}n.emit("pipe",r);if(!i.flowing){g("pipe resume");r.resume()}return n},Readable.prototype.unpipe=function(e){var t=this._readableState;if(t.pipesCount===0)return this;if(t.pipesCount===1){if(e&&e!==t.pipes)return this;if(!e)e=t.pipes;t.pipes=null;t.pipesCount=0;t.flowing=false;if(e)e.emit("unpipe",this);return this}if(!e){var n=t.pipes;var r=t.pipesCount;t.pipes=null;t.pipesCount=0;t.flowing=false;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);this._writableState.defaultEncoding=e;return this},Writable.prototype._write=function(e,t,n){n(new Error("not implemented"))},Writable.prototype._writev=null,Writable.prototype.end=function(e,t,n){var r=this._writableState;if(typeof e==="function"){n=e;e=null;t=null}else if(typeof t==="function"){n=t;t=null}if(e!==null&&e!==undefined)this.write(e,t);if(r.corked){r.corked=1;this.uncork()}if(!r.ending&&!r.finished)endWritable(this,r,n)},H(Duplex,Readable);for(var X=Object.keys(Writable.prototype),q=0,$;q-1}function listCacheSet(e,t){var n=this.__data__,r=assocIndexOf(n,e);if(r<0)n.push([e,t]);else n[r][1]=t;return this}function MapCache(e){var t=-1,n=e?e.length:0;this.clear();while(++t1?setProp(e[i]||{},r.slice(1),n):n;return Object.assign({},e,_defineProperty({},i,o))}function flattenReducer(t,n){try{t.push.apply(t,_toConsumableArray(n));return t}catch(e){return t.concat(n)}}function fastJoin(e,n){var r=true;return e.reduce(function(e,t){if(t===null||t===undefined)t="";if(r){r=false;return"".concat(t)}return"".concat(e).concat(n).concat(t)},"")}var t={getProp:getProp,setProp:setProp,fastJoin:fastJoin,flattenReducer:flattenReducer},Oe=t.getProp,Le=t.setProp,Pe=t.fastJoin,Ve=t.flattenReducer,Ze,We=function(){function JSON2CSVBase(e){_classCallCheck(this,JSON2CSVBase);this.opts=this.preprocessOpts(e);this.preprocessRow=this.memoizePreprocessRow()}_createClass(JSON2CSVBase,[{key:"preprocessOpts",value:function preprocessOpts(e){var t=Object.assign({},e);t.unwind=!Array.isArray(t.unwind)?t.unwind?[t.unwind]:[]:t.unwind;t.delimiter=t.delimiter||",";t.flattenSeparator=t.flattenSeparator||".";t.eol=t.eol||re.EOL;t.quote=typeof t.quote==="string"?e.quote:'"';t.doubleQuote=typeof t.doubleQuote==="string"?t.doubleQuote:t.quote+t.quote;t.header=t.header!==false;t.includeEmptyRows=t.includeEmptyRows||false;t.withBOM=t.withBOM||false;return t}},{key:"preprocessFieldsInfo",value:function preprocessFieldsInfo(e){var i=this;return e.map(function(t){if(typeof t==="string")return{label:t,value:t.includes(".")||t.includes("[")?function(e){return Ue(e,t,i.opts.defaultValue)}:function(e){return Oe(e,t,i.opts.defaultValue)},stringify:true};if(_typeof(t)==="object"){var n="default"in t?t.default:i.opts.defaultValue;if(typeof t.value==="string")return{label:t.label||t.value,value:t.value.includes(".")||t.value.includes("[")?function(e){return Ue(e,t.value,n)}:function(e){return Oe(e,t.value,n)},stringify:t.stringify!==undefined?t.stringify:true};if(typeof t.value==="function"){var e=t.label||t.value.name||"";var r={label:e,default:n};return{label:e,value:function value(e){var value=t.value(e,r);return value===null||value===undefined?n:value},stringify:t.stringify!==undefined?t.stringify:true}}}throw new Error("Invalid field info option. "+JSON.stringify(t))})}},{key:"getHeader",value:function getHeader(){var t=this;return Pe(this.opts.fields.map(function(e){return t.processValue(e.label,true)}),this.opts.delimiter)}},{key:"memoizePreprocessRow",value:function memoizePreprocessRow(){if(this.opts.unwind&&this.opts.unwind.length){if(this.opts.flatten)return function(e){var t=this;return this.unwindData(e,this.opts.unwind).map(function(e){return t.flatten(e,t.opts.flattenSeparator)})};return function(e){return this.unwindData(e,this.opts.unwind)}}if(this.opts.flatten)return function(e){return[this.flatten(e,this.opts.flattenSeparator)]};return function(e){return[e]}}},{key:"preprocessRow",value:function preprocessRow(){}},{key:"processRow",value:function processRow(t){var n=this;if(!t)return undefined;var e=this.opts.fields.map(function(e){return n.processCell(t,e)});if(!this.opts.includeEmptyRows&&e.every(function(e){return e===undefined}))return undefined;return Pe(e,this.opts.delimiter)}},{key:"processCell",value:function processCell(e,t){return this.processValue(t.value(e),t.stringify)}},{key:"processValue",value:function processValue(e,t){if(e===null||e===undefined)return undefined;var n=_typeof(e);if(n!=="boolean"&&n!=="number"&&n!=="string"){e=JSON.stringify(e);if(e===undefined)return undefined;if(e[0]==='"')e=e.replace(/^"(.+)"$/,"$1")}if(typeof e==="string"){if(e.includes(this.opts.quote))e=e.replace(new RegExp(this.opts.quote,"g"),this.opts.doubleQuote);if(t)e="".concat(this.opts.quote).concat(e).concat(this.opts.quote);else e=e.replace(new RegExp("^".concat(this.opts.doubleQuote)),this.opts.quote).replace(new RegExp("".concat(this.opts.doubleQuote,"$")),this.opts.quote);if(this.opts.excelStrings)e='"="'.concat(e,'""')}return e}},{key:"flatten",value:function flatten(e,a){function step(r,i,o){Object.keys(r).forEach(function(e){var t=r[e];var n=o?"".concat(o).concat(a).concat(e):e;if(_typeof(t)!=="object"||t===null||Array.isArray(t)||Object.prototype.toString.call(t.toJSON)==="[object Function]"||!Object.keys(t).length){i[n]=t;return}step(t,i,n)});return i}return step(e,{})}},{key:"unwindData",value:function unwindData(e,t){var o=this;var n=function unwind(e,i){return e.map(function(r){var e=Ue(r,i);if(!Array.isArray(e))return r;if(!e.length)return Le(r,i,undefined);return e.map(function(e,t){var n=o.opts.unwindBlank&&t>0?{}:r;return Le(n,i,e)})}).reduce(Ve,[])};return t.reduce(n,[e])}}]);return JSON2CSVBase}(),He=t.fastJoin,je=t.flattenReducer,Ye,ze=function(e){_inherits(JSON2CSVParser,e);function JSON2CSVParser(e){var t;_classCallCheck(this,JSON2CSVParser);t=_possibleConstructorReturn(this,_getPrototypeOf(JSON2CSVParser).call(this,e));if(t.opts.fields)t.opts.fields=t.preprocessFieldsInfo(t.opts.fields);return t}_createClass(JSON2CSVParser,[{key:"parse",value:function parse(e){var t=this.preprocessData(e);if(!this.opts.fields){this.opts.fields=t.reduce(function(t,e){Object.keys(e).forEach(function(e){if(!t.includes(e))t.push(e)});return t},[]);this.opts.fields=this.preprocessFieldsInfo(this.opts.fields)}var n=this.opts.header?this.getHeader():"";var r=this.processData(t);var i=(this.opts.withBOM?"\ufeff":"")+n+(n&&r?this.opts.eol:"")+r;return i}},{key:"preprocessData",value:function preprocessData(e){var t=this;var n=Array.isArray(e)?e:[e];if(!this.opts.fields&&(n.length===0||_typeof(n[0])!=="object"))throw new Error('Data should not be empty or the "fields" option should be included');if((!this.opts.unwind||!this.opts.unwind.length)&&!this.opts.flatten)return n;return n.map(function(e){return t.preprocessRow(e)}).reduce(je,[])}},{key:"processData",value:function processData(e){var t=this;return He(e.map(function(e){return t.processRow(e)}).filter(function(e){return e}),this.opts.eol)}}]);return JSON2CSVParser}(We),s={},Je=s.LEFT_BRACE=1,Ke=s.RIGHT_BRACE=2,Xe=s.LEFT_BRACKET=3,qe=s.RIGHT_BRACKET=4,$e=s.COLON=5,et=s.COMMA=6,tt=s.TRUE=7,nt=s.FALSE=8,rt=s.NULL=9,it=s.STRING=10,ot=s.NUMBER=11,A=s.START=17,at=s.STOP=18,st=s.TRUE1=33,At=s.TRUE2=34,lt=s.TRUE3=35,ct=s.FALSE1=49,gt=s.FALSE2=50,ut=s.FALSE3=51,dt=s.FALSE4=52,ht=s.NULL1=65,pt=s.NULL2=66,ft=s.NULL3=67,It=s.NUMBER1=81,Ct=s.NUMBER3=83,u=s.STRING1=97,mt=s.STRING2=98,yt=s.STRING3=99,Bt=s.STRING4=100,bt=s.STRING5=101,vt=s.STRING6=102,Et=s.VALUE=113,Qt=s.KEY=114,wt=s.OBJECT=129,St=s.ARRAY=130,_t="\\".charCodeAt(0),xt="/".charCodeAt(0),Rt="\b".charCodeAt(0),Ft="\f".charCodeAt(0),Dt="\n".charCodeAt(0),Gt="\r".charCodeAt(0),Nt="\t".charCodeAt(0),kt=64*1024;function Parser(){this.tState=A;this.value=undefined;this.string=undefined;this.stringBuffer=Buffer.alloc?Buffer.alloc(kt):new Buffer(kt);this.stringBufferOffset=0;this.unicode=undefined;this.highSurrogate=undefined;this.key=undefined;this.mode=undefined;this.stack=[];this.state=Et;this.bytes_remaining=0;this.bytes_in_sequence=0;this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)};this.offset=-1}Parser.toknam=function(e){var t=Object.keys(s);for(var n=0,r=t.length;n=kt){this.string+=this.stringBuffer.toString("utf8");this.stringBufferOffset=0}this.stringBuffer[this.stringBufferOffset++]=e},d.appendStringBuf=function(e,t,n){var r=e.length;if(typeof t==="number")if(typeof n==="number")if(n<0)r=e.length-t+n;else r=n-t;else r=e.length-t;if(r<0)r=0;if(this.stringBufferOffset+r>kt){this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset);this.stringBufferOffset=0}e.copy(this.stringBuffer,this.stringBufferOffset,t,n);this.stringBufferOffset+=r},d.write=function(e){if(typeof e==="string")e=new Buffer(e);var t;for(var n=0,r=e.length;n=48&&t<64){this.string=String.fromCharCode(t);this.tState=Ct}else if(t===32||t===9||t===10||t===13);else return this.charError(e,n)}else if(this.tState===u){t=e[n];if(this.bytes_remaining>0){for(var i=0;i=128){if(t<=193||t>244)return this.onError(new Error("Invalid UTF-8 character at position "+n+" in state "+Parser.toknam(this.tState)));if(t>=194&&t<=223)this.bytes_in_sequence=2;if(t>=224&&t<=239)this.bytes_in_sequence=3;if(t>=240&&t<=244)this.bytes_in_sequence=4;if(this.bytes_in_sequence+n>e.length){for(var o=0;o<=e.length-1-n;o++)this.temp_buffs[this.bytes_in_sequence][o]=e[n+o];this.bytes_remaining=n+this.bytes_in_sequence-e.length;n=e.length-1}else{this.appendStringBuf(e,n,n+this.bytes_in_sequence);n=n+this.bytes_in_sequence-1}}else if(t===34){this.tState=A;this.string+=this.stringBuffer.toString("utf8",0,this.stringBufferOffset);this.stringBufferOffset=0;this.onToken(it,this.string);this.offset+=Buffer.byteLength(this.string,"utf8")+1;this.string=undefined}else if(t===92)this.tState=mt;else if(t>=32)this.appendStringChar(t);else return this.charError(e,n)}else if(this.tState===mt){t=e[n];if(t===34){this.appendStringChar(t);this.tState=u}else if(t===92){this.appendStringChar(_t);this.tState=u}else if(t===47){this.appendStringChar(xt);this.tState=u}else if(t===98){this.appendStringChar(Rt);this.tState=u}else if(t===102){this.appendStringChar(Ft);this.tState=u}else if(t===110){this.appendStringChar(Dt);this.tState=u}else if(t===114){this.appendStringChar(Gt);this.tState=u}else if(t===116){this.appendStringChar(Nt);this.tState=u}else if(t===117){this.unicode="";this.tState=yt}else return this.charError(e,n)}else if(this.tState===yt||this.tState===Bt||this.tState===bt||this.tState===vt){t=e[n];if(t>=48&&t<64||t>64&&t<=70||t>96&&t<=102){this.unicode+=String.fromCharCode(t);if(this.tState++===vt){var a=parseInt(this.unicode,16);this.unicode=undefined;if(this.highSurrogate!==undefined&&a>=56320&&a<57343+1){this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate,a)));this.highSurrogate=undefined}else if(this.highSurrogate===undefined&&a>=55296&&a<56319+1)this.highSurrogate=a;else{if(this.highSurrogate!==undefined){this.appendStringBuf(new Buffer(String.fromCharCode(this.highSurrogate)));this.highSurrogate=undefined}this.appendStringBuf(new Buffer(String.fromCharCode(a)))}this.tState=u}}else return this.charError(e,n)}else if(this.tState===It||this.tState===Ct){t=e[n];switch(t){case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:case 46:case 101:case 69:case 43:case 45:this.string+=String.fromCharCode(t);this.tState=Ct;break;default:this.tState=A;var s=Number(this.string);if(isNaN(s))return this.charError(e,n);if(this.string.match(/[0-9]+/)==this.string&&s.toString()!=this.string)this.onToken(it,this.string);else this.onToken(ot,s);this.offset+=this.string.length-1;this.string=undefined;n--;break}}else if(this.tState===st)if(e[n]===114)this.tState=At;else return this.charError(e,n);else if(this.tState===At)if(e[n]===117)this.tState=lt;else return this.charError(e,n);else if(this.tState===lt)if(e[n]===101){this.tState=A;this.onToken(tt,true);this.offset+=3}else return this.charError(e,n);else if(this.tState===ct)if(e[n]===97)this.tState=gt;else return this.charError(e,n);else if(this.tState===gt)if(e[n]===108)this.tState=ut;else return this.charError(e,n);else if(this.tState===ut)if(e[n]===115)this.tState=dt;else return this.charError(e,n);else if(this.tState===dt)if(e[n]===101){this.tState=A;this.onToken(nt,false);this.offset+=4}else return this.charError(e,n);else if(this.tState===ht)if(e[n]===117)this.tState=pt;else return this.charError(e,n);else if(this.tState===pt)if(e[n]===108)this.tState=ft;else return this.charError(e,n);else if(this.tState===ft)if(e[n]===108){this.tState=A;this.onToken(rt,null);this.offset+=3}else return this.charError(e,n)},d.onToken=function(e,t){},d.parseError=function(e,t){this.tState=at;this.onError(new Error("Unexpected "+Parser.toknam(e)+(t?"("+JSON.stringify(t)+")":"")+" in state "+Parser.toknam(this.state)))},d.push=function(){this.stack.push({value:this.value,key:this.key,mode:this.mode})},d.pop=function(){var e=this.value;var t=this.stack.pop();this.value=t.value;this.key=t.key;this.mode=t.mode;this.emit(e);if(!this.mode)this.state=Et},d.emit=function(e){if(this.mode)this.state=et;this.onValue(e)},d.onValue=function(e){},d.onToken=function(e,t){if(this.state===Et)if(e===it||e===ot||e===tt||e===nt||e===rt){if(this.value)this.value[this.key]=t;this.emit(t)}else if(e===Je){this.push();if(this.value)this.value=this.value[this.key]={};else this.value={};this.key=undefined;this.state=Qt;this.mode=wt}else if(e===Xe){this.push();if(this.value)this.value=this.value[this.key]=[];else this.value=[];this.key=0;this.mode=St;this.state=Et}else if(e===Ke)if(this.mode===wt)this.pop();else return this.parseError(e,t);else if(e===qe)if(this.mode===St)this.pop();else return this.parseError(e,t);else return this.parseError(e,t);else if(this.state===Qt)if(e===it){this.key=t;this.state=$e}else if(e===Ke)this.pop();else return this.parseError(e,t);else if(this.state===$e)if(e===$e)this.state=Et;else return this.parseError(e,t);else if(this.state===et)if(e===et){if(this.mode===St){this.key++;this.state=Et}else if(this.mode===wt)this.state=Qt}else if(e===qe&&this.mode===St||e===Ke&&this.mode===wt)this.pop();else return this.parseError(e,t);else return this.parseError(e,t)},Parser.C=s,Parser),Mt,Ut,Ot=function(e){_inherits(JSON2CSVTransform,e);function JSON2CSVTransform(e,t){var n;_classCallCheck(this,JSON2CSVTransform);n=_possibleConstructorReturn(this,_getPrototypeOf(JSON2CSVTransform).call(this,t));Object.getOwnPropertyNames(We.prototype).forEach(function(e){return n[e]=We.prototype[e]});n.opts=n.preprocessOpts(e);n.preprocessRow=n.memoizePreprocessRow();n._data="";n._hasWritten=false;if(n._readableState.objectMode)n.initObjectModeParse();else if(n.opts.ndjson)n.initNDJSONParse();else n.initJSONParser();if(n.opts.withBOM)n.push("\ufeff");if(n.opts.fields){n.opts.fields=n.preprocessFieldsInfo(n.opts.fields);n.pushHeader()}return n}_createClass(JSON2CSVTransform,[{key:"initObjectModeParse",value:function initObjectModeParse(){var t=this;this.parser={write:function write(e){t.pushLine(e)},getPendingData:function getPendingData(){return undefined}}}},{key:"initNDJSONParse",value:function initNDJSONParse(){var o=this;this.parser={_data:"",write:function write(e){this._data+=e.toString();var r=this._data.split("\n").map(function(e){return e.trim()}).filter(function(e){return e!==""});var i=false;r.forEach(function(t,n){try{o.pushLine(JSON.parse(t))}catch(e){if(n===r.length-1)i=true;else{e.message="Invalid JSON ("+t+")";o.emit("error",e)}}});this._data=i?this._data.slice(this._data.lastIndexOf("\n")):""},getPendingData:function getPendingData(){return this._data}}}},{key:"initJSONParser",value:function initJSONParser(){var n=this;this.parser=new Tt;this.parser.onValue=function(e){if(this.stack.length!==this.depthToEmit)return;n.pushLine(e)};this.parser._onToken=this.parser.onToken;this.parser.onToken=function(e,t){n.parser._onToken(e,t);if(this.stack.length===0&&!n.opts.fields&&this.mode!==Tt.C.ARRAY&&this.mode!==Tt.C.OBJECT)this.onError(new Error('Data should not be empty or the "fields" option should be included'));if(this.stack.length===1){if(this.depthToEmit===undefined)this.depthToEmit=this.mode===Tt.C.ARRAY?1:0;if(this.depthToEmit!==0&&this.stack.length===1)this.value=undefined}};this.parser.getPendingData=function(){return this.value};this.parser.onError=function(e){if(e.message.includes("Unexpected"))e.message="Invalid JSON ("+e.message+")";n.emit("error",e)}}},{key:"_transform",value:function _transform(e,t,n){this.parser.write(e);n()}},{key:"_flush",value:function _flush(e){if(this.parser.getPendingData())e(new Error("Invalid data received from stdin",this.parser.getPendingData()));e()}},{key:"pushHeader",value:function pushHeader(){if(this.opts.header){var e=this.getHeader();this.emit("header",e);this.push(e);this._hasWritten=true}}},{key:"pushLine",value:function pushLine(e){var n=this;var t=this.preprocessRow(e);if(!this._hasWritten){this.opts.fields=this.opts.fields||this.preprocessFieldsInfo(Object.keys(t[0]));this.pushHeader()}t.forEach(function(e){var t=n.processRow(e,n.opts);if(t===undefined)return;n.emit("line",t);n.push(n._hasWritten?n.opts.eol+t:t);n._hasWritten=true})}}]);return JSON2CSVTransform}(Stream.Transform),Lt=Stream.Transform,Pt=t.fastJoin,Vt,Zt=function(){function JSON2CSVAsyncParser(e,t){_classCallCheck(this,JSON2CSVAsyncParser);this.input=new Lt(t);this.input._read=function(){};this.transform=new Ot(e,t);this.processor=this.input.pipe(this.transform)}_createClass(JSON2CSVAsyncParser,[{key:"fromInput",value:function fromInput(e){if(this._input)throw new Error("Async parser already has an input.");this._input=e;this.input=this._input.pipe(this.processor);return this}},{key:"throughTransform",value:function throughTransform(e){if(this._output)throw new Error("Can't add transforms once an output has been added.");this.processor=this.processor.pipe(e);return this}},{key:"toOutput",value:function toOutput(e){if(this._output)throw new Error("Async parser already has an output.");this._output=e;this.processor=this.processor.pipe(e);return this}},{key:"promise",value:function promise(){var r=this;return new Promise(function(e,t){var n=[];r.processor.on("data",function(e){return n.push(e.toString())}).on("finish",function(){return e(Pt(n,""))}).on("error",function(e){return t(e)})})}}]);return JSON2CSVAsyncParser}(),Wt=Stream.Readable,Ht=ze,jt=Zt,Yt=Ot,zt=function parse(e,t){return new ze(t).parse(e)},Jt=function parseAsync(e,t,n){try{if(!(e instanceof Wt))n=Object.assign({},n,{objectMode:true});var r=new Zt(t,n);var i=r.promise();if(Array.isArray(e)){e.forEach(function(e){return r.input.push(e)});r.input.push(null)}else if(e instanceof Wt)r.fromInput(e);else{r.input.push(e);r.input.push(null)}return i}catch(e){return Promise.reject(e)}},Kt;e.default={Parser:Ht,AsyncParser:jt,Transform:Yt,parse:zt,parseAsync:Jt},e.Parser=Ht,e.AsyncParser=jt,e.Transform=Yt,e.parse=zt,e.parseAsync=Jt,Object.defineProperty(e,"__esModule",{value:true})}(t)}.call(this,n(64))},function(e,t,n){var r=n(929),i=n(930),o=n(575),a=n(931);e.exports=function _toConsumableArray(e){return r(e)||i(e)||o(e)||a()}},function(e,t,n){var r=n(932),i=n(933),o=n(575),a=n(934);e.exports=function _slicedToArray(e,t){return r(e)||i(e,t)||o(e,t)||a()}},function(e,t,n){var r=n(576),i=n(577),o=n(942),a=n(580),n=i(function(e){return o(r(e,1,a,!0))});e.exports=n},function(e,t,n){var r=n(949),i=n(576),o=n(577),a=n(580),n=o(function(e,t){return a(e)?r(e,i(t,1,a,!0)):[]});e.exports=n},function(e,t,n){"use strict";t.a=function stubFalse(){return!1}},function(e,i,o){"use strict";!function(e){var t=o(61),n="object"==typeof exports&&exports&&!exports.nodeType&&exports,e=n&&"object"==typeof e&&e&&!e.nodeType&&e,e=e&&e.exports===n?t.a.Buffer:void 0,r=e?e.allocUnsafe:void 0;i.a=function cloneBuffer(e,t){return t?e.slice():(t=e.length,t=r?r(t):new e.constructor(t),e.copy(t),t)}}.call(this,o(453)(e))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t/build","src"]}}')},function(e,t,n){"use strict";n.d(t,"a",function(){return g});var r={NaN:NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE},i={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>tee<=t,">=":(e,t)=>t<=e,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t},o={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const a=Array.prototype.slice,s=(e,t,n)=>{const r=n?n(t[0]):t[0];return r[e].apply(r,a.call(t,1))};var A={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,n)=>Math.max(t,Math.min(n,e)),now:Date.now,utc:Date.UTC,datetime:(e,t,n,r,i,o,a)=>new Date(e,t||0,null!=n?n:1,r||0,i||0,o||0,a||0),date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return s("join",arguments)},indexof:function(){return s("indexOf",arguments)},lastindexof:function(){return s("lastIndexOf",arguments)},slice:function(){return s("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat:parseFloat,parseInt:parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return s("substring",arguments,String)},split:function(){return s("split",arguments,String)},replace:function(){return s("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const l=["view","item","group","xy","x","y"],c={Literal:(e,t)=>t.value,Identifier:(e,t)=>{t=t.name;return 0{var n=!t.computed,r=e(t.object),t=(n&&(e.memberDepth+=1),e(t.property));return n&&--e.memberDepth,r[t]},CallExpression:(e,t)=>{const n=t.arguments;let r=t.callee.name;return"if"===(r=r.startsWith("_")?r.slice(1):r)?e(n[0])?e(n[1]):e(n[2]):(e.fn[r]||A[r]).apply(e.fn,n.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>i[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>o[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>"&&"===t.operator?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(r,e)=>e.properties.reduce((e,t)=>{r.memberDepth+=1;var n=r(t.key);return--r.memberDepth,e[n]=r(t.value),e},{})};function interpret(e,t,n,r,i,o){const a=e=>c[e.type](a,e);return a.memberDepth=0,a.fn=Object.create(t),a.params=n,a.datum=r,a.event=i,a.item=o,l.forEach(t=>a.fn[t]=(...e)=>i.vega[t](...e)),a(e)}var g={operator(e,t){const n=t.ast,r=e.functions;return e=>interpret(n,r,e)},parameter(e,t){const n=t.ast,r=e.functions;return(e,t)=>interpret(n,r,t,e)},event(e,t){const n=t.ast,r=e.functions;return e=>interpret(n,r,void 0,void 0,e)},handler(e,t){const r=t.ast,i=e.functions;return(e,t)=>{var n=t.item&&t.item.datum;return interpret(r,i,e,n,t)}},encode(e,t){const{marktype:a,channels:s}=t,A=e.functions,l="group"===a||"image"===a||"rect"===a;return(e,t)=>{var n=e.datum;let r=0,i;for(const o in s)i=interpret(s[o].ast,A,t,n,void 0,e),e[o]!==i&&(e[o]=i,r=1);return"rule"!==a&&function adjustSpatial(e,t,n){let r;t.x2&&(t.x?(n&&e.x>e.x2&&(r=e.x,e.x=e.x2,e.x2=r),e.width=e.x2-e.x):e.x=e.x2-(e.width||0)),t.xc&&(e.x=e.xc-(e.width||0)/2),t.y2&&(t.y?(n&&e.y>e.y2&&(r=e.y,e.y=e.y2,e.y2=r),e.height=e.y2-e.y):e.y=e.y2-(e.height||0)),t.yc&&(e.y=e.yc-(e.height||0)/2)}(e,s,l),r}}}},function(t,e,n){!function(B){var e=function(){"use strict";function _instanceof(e,t){return null!=t&&e instanceof t}var C,m,y;try{C=Map}catch(e){C=function(){}}try{m=Set}catch(e){m=function(){}}try{y=Promise}catch(e){y=function(){}}function clone(e,u,t,d,h){"object"==typeof u&&(t=u.depth,d=u.prototype,h=u.includeNonEnumerable,u=u.circular);var p=[],f=[],I=void 0!==B;return void 0===u&&(u=!0),function _clone(e,r){if(null===e)return null;if(0===r)return e;var n,t,i;if("object"!=typeof e)return e;if(_instanceof(e,C))n=new C;else if(_instanceof(e,m))n=new m;else if(_instanceof(e,y))n=new y(function(t,n){e.then(function(e){t(_clone(e,r-1))},function(e){n(_clone(e,r-1))})});else if(clone.__isArray(e))n=[];else if(clone.__isRegExp(e))n=new RegExp(e.source,__getRegExpFlags(e)),e.lastIndex&&(n.lastIndex=e.lastIndex);else if(clone.__isDate(e))n=new Date(e.getTime());else{if(I&&B.isBuffer(e))return n=B.allocUnsafe?B.allocUnsafe(e.length):new B(e.length),e.copy(n),n;_instanceof(e,Error)?n=Object.create(e):void 0===d?(t=Object.getPrototypeOf(e),n=Object.create(t)):(n=Object.create(d),t=d)}if(u){var o=p.indexOf(e);if(-1!=o)return f[o];p.push(e),f.push(n)}for(s in _instanceof(e,C)&&e.forEach(function(e,t){t=_clone(t,r-1),e=_clone(e,r-1),n.set(t,e)}),_instanceof(e,m)&&e.forEach(function(e){e=_clone(e,r-1),n.add(e)}),e)(i=t?Object.getOwnPropertyDescriptor(t,s):i)&&null==i.set||(n[s]=_clone(e[s],r-1));if(Object.getOwnPropertySymbols)for(var a=Object.getOwnPropertySymbols(e),s=0;sr?"[Object]":0<=i.indexOf(t)?"[Circular]":(i.push(t),t)}}(t))}var r=`#vg-tooltip-element { visibility: hidden; padding: 8px; position: fixed; @@ -1028,8 +1028,8 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ -function __rest(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r${n(i)}`),o&&(t+=``),Object.keys(a));if(0";for(const s of i){let e=a[s];void 0!==e&&(Object(A.H)(e)&&(e=stringify(e,r)),t+=`${n(s)}:${n(e)}`)}t+=""}return t||"{}"}return n(e)}};class Handler{constructor(e){this.options=Object.assign(Object.assign({},o),e);e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style"),n=(t.setAttribute("id",this.options.styleId),t.innerHTML=function createDefaultStyle(e){if(/^[A-Za-z]+[-:.\w]*$/.test(e))return r.toString().replace(i,e);throw new Error("Invalid HTML ID")}(e),document.head);0window.innerWidth&&(i=+e.clientX-n-t.width),e.clientY+r);return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY),this.el.setAttribute("style",`top: ${r}px; left: ${i}px`))}}},function(e,t,n){function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var i,o;e.exports=(i={17:function(t,n,r){"use strict";n.__esModule=!0,n.default=void 0;var i=r(18);function e(){}e.getFirstMatch=function(e,t){t=t.match(e);return t&&0A[1][a])return 1;if(A[0][a]===A[1][a]){if(a===s)return 0;--a}else if(A[0][a]"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),-1function(e){return e[t]},l=n=>{const r=n.length;return function(t){for(let e=0;ea&&push(),i=a=s+1):"]"===A&&(i||error("Access path missing open bracket: "+e),0a?push():a=s+1);return i&&error("Access path missing closing bracket: "+e),r&&error("Access path missing closing quote: "+e),s>a&&(s++,push()),t}function vega_util_module_field(e,t,n){var r=splitAccessPath(e);return e=1===r.length?r[0]:e,accessor((n&&n.get||getter)(r),[e],t||e)}vega_util_module_field("id");const u=accessor(e=>e,[],"identity");accessor(()=>0,[],"zero"),accessor(()=>1,[],"one"),accessor(()=>!0,[],"true"),accessor(()=>!1,[],"false");function log$1(e,t,n){t=[t].concat([].slice.call(n));console[e].apply(console,t)}var R=Array.isArray;function isObject(e){return e===Object(e)}const p=e=>"__proto__"!==e;function mergeConfig(...e){return e.reduce((e,t)=>{for(const r in t){var n;"signals"===r?e.signals=function mergeNamed(e,t){if(null==e)return t;const n={},r=[];function add(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(add),e.forEach(add),r}(e.signals,t.signals):(n="legend"===r?{layout:1}:"style"===r||null,writeConfig(e,r,t[r],n))}return e},{})}function writeConfig(n,r,i,o){if(p(r)){let e,t;if(isObject(i)&&!R(i))for(e in t=isObject(n[r])?n[r]:n[r]={},i)o&&(!0===o||o[e])?writeConfig(t,e,i[e]):p(e)&&(t[e]=i[e]);else n[r]=i}}function array(e){return null!=e?R(e)?e:[e]:[]}function isFunction(e){return"function"==typeof e}const f=Object.prototype.hasOwnProperty;function has(e,t){return f.call(e,t)}function isBoolean(e){return"boolean"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function $(e){return R(e)?"["+e.map($)+"]":isObject(e)||isString(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function toSet(t){const n={},r=t.length;for(let e=0;eC()(e)).join(",")})`};const A=C.a;function hash(e){if(isNumber(e))return e;const t=isString(e)?e:C()(e);if(t.length<250)return t;let n=0;for(let e=0;e0===t?e:`[${e}]`);for(const o of i.map((e,t)=>i.slice(0,t+1).join("")))t.add(o)}return t}function fieldIntersection(e,t){return void 0===e||void 0===t||hasIntersection(prefixGenerator(e),prefixGenerator(t))}function isEmpty(e){return 0===y(e).length}const y=Object.keys,B=Object.values,v=Object.entries;function util_isBoolean(e){return!0===e||!1===e}function varName(e){var t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function logicalExpr(e,t){return e.not?"!("+logicalExpr(e.not,t)+")":e.and?"("+e.and.map(e=>logicalExpr(e,t)).join(") && (")+")":e.or?"("+e.or.map(e=>logicalExpr(e,t)).join(") || (")+")":t(e)}function deleteNestedProperty(e,t){if(0===t.length)return!0;var n=t.shift();return n in e&&deleteNestedProperty(e[n],t)&&delete e[n],isEmpty(e)}function titleCase(e){return e.charAt(0).toUpperCase()+e.substr(1)}function accessPathWithDatum(e,t="datum"){const n=splitAccessPath(e),r=[];for(let e=1;e<=n.length;e++){var i=`[${n.slice(0,e).map($).join("][")}]`;r.push(t+i)}return r.join(" && ")}function flatAccessWithDatum(e,t="datum"){return`${t}[${$(splitAccessPath(e).join("."))}]`}function escapePathAccess(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function replacePathInField(e){return""+splitAccessPath(e).map(escapePathAccess).join("\\.")}function replaceAll(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function removePathFromField(e){return""+splitAccessPath(e).join(".")}function accessPathDepth(e){return e?splitAccessPath(e).length:0}function getFirstDefined(...e){for(const t of e)if(void 0!==t)return t}let E=42;function uniqueId(e){var t=++E;return e?String(e)+t:t}function resetIdCounter(){E=42}function internalField(e){return isInternalField(e)?e:"__"+e}function isInternalField(e){return 0===e.indexOf("__")}function normalizeAngle(e){if(void 0!==e)return(e%360+360)%360}function isNumeric(e){return!!isNumber(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Q={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function isConditionalAxisValue(e){return e&&e.condition}const w=["domain","grid","labels","ticks","title"],S={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"};t={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1};const _=Object.assign(Object.assign({},t),{style:1,labelExpr:1,encoding:1});function isAxisProperty(e){return _[e]}y(_);const F=y({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),D={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},G={count:1,min:1,max:1};function isArgminDef(e){return e&&e.argmin}function isArgmaxDef(e){return e&&e.argmax}y(D);function isAggregateOp(e){return isString(e)&&!!D[e]}const N=["count","valid","missing","distinct"];function isCountingAggregateOp(e){return isString(e)&&util_contains(N,e)}const k=["count","sum","distinct","valid","missing"];const T=toSet(["mean","average","median","q1","q3","min","max"]);n=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);risSelectionExtent(t[e])?varName(`_${e}_`+v(t[e])):varName(`_${e}_`+t[e])).join("")}function isBinning(e){return!0===e||isBinParams(e)&&!e.binned}function isBinned(e){return"binned"===e||isBinParams(e)&&!0===e.binned}function isBinParams(e){return isObject(e)}function isSelectionExtent(e){return null==e?void 0:e.selection}function autoMaxBins(e){switch(e){case M:case U:case te:case K:case X:case q:case ae:case re:case ie:case oe:case ee:return 6;case se:return 4;default:return 10}}function invalidSpec(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const ke='Autosize "fit" only works for single views and layered views.';function containerSizeNonSingle(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function containerSizeNotCompatibleWithAutosize(e){return("width"==e?"Width":"Height")+` "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function droppingFit(e){return e?`Dropping "fit-${e}" because spec has discrete ${getSizeChannel(e)}.`:'Dropping "fit" because spec has discrete size.'}function unknownField(e){return`Unknown field for ${e}. Cannot calculate view size.`}function cannotProjectOnChannelWithoutField(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function cannotProjectAggregate(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function nearestNotSupportForContinuous(e){return`The "nearest" transform is not supported for ${e} marks.`}function selectionNotSupported(e){return`Selection not supported for ${e} yet.`}function selectionNotFound(e){return`Cannot find a selection named "${e}".`}const Te="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Me="Legend bindings are only supported for selections over an individual field or encoding channel.";function noSameUnitLookup(e){return`Cannot define and lookup the "${e}" selection in the same view. `+"Try moving the lookup into a second, layered view?"}const Ue="The same selection must be used to override scale domains in a layered view.",Oe='Interval selections should be initialized using "x" and/or "y" keys.';function noSuchRepeatedValue(e){return`Unknown repeated value "${e}".`}function columnsNotSupportByRowCol(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Le="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function unrecognizedParse(e){return`Unrecognized parse "${e}".`}function differentParse(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Pe="Attempt to add the same child twice.";function invalidTransformIgnored(e){return`Ignoring an invalid transform: ${A(e)}.`}const Ve='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function customFormatTypeNotAllowed(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function projectionOverridden(e){var{parentProjection:e,projection:t}=e;return`Layer's shared projection ${A(e)} is overridden by a child projection ${A(t)}.`}const Ze="Arc marks uses theta channel rather than angle, replacing angle with theta.";function primitiveChannelDef(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${A(n)}}.`}function invalidFieldType(e){return`Invalid field type "${e}".`}function invalidFieldTypeForCountAggregate(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function invalidAggregate(e){return`Invalid aggregation operator "${e}".`}function missingFieldType(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}function droppingColor(e,t){var{fill:t,stroke:n}=t;return`Dropping color ${e} as the plot also has ${t&&n?"fill and stroke":t?"fill":"stroke"}.`}function emptyFieldDef(e,t){return`Dropping ${A(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function latLongDeprecated(e,t,n){return e+`-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`}const We="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function incompatibleChannel(e,t,n){return e+` dropped as it is incompatible with "${t}"${n?" when "+n:""}.`}function invalidEncodingChannel(e){return e+`-encoding is dropped as ${e} is not a valid encoding channel.`}function facetChannelShouldBeDiscrete(e){return e+" encoding should be discrete (ordinal / nominal / binned)."}function facetChannelDropped(e){return`Facet encoding dropped as ${e.join(" and ")} ${1e.substr(0,3)),nt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],rt=nt.map(e=>e.substr(0,3));function dateTimeParts(e,t){const n=[];var r;t&&void 0!==e.day&&1n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(0"+predicateValueExpr(e.gt,r);if(isFieldLTEPredicate(e))return n+"<="+predicateValueExpr(e.lte,r);if(isFieldGTEPredicate(e))return n+">="+predicateValueExpr(e.gte,r);if(isFieldOneOfPredicate(e))return`indexof([${function predicateValuesExpr(e,t){return e.map(e=>predicateValueExpr(e,t))}(e.oneOf,r).join(",")}], ${n}) !== -1`;if(function isFieldValidPredicate(e){return e&&e.field&&void 0!==e.valid}(e))return fieldValidPredicate(n,e.valid);if(isFieldRangePredicate(e)){var i=e["range"],o=isSignalRef(i)?{signal:i.signal+"[0]"}:i[0],i=isSignalRef(i)?{signal:i.signal+"[1]"}:i[1];if(null!==o&&null!==i&&t)return"inrange("+n+", ["+predicateValueExpr(o,r)+", "+predicateValueExpr(i,r)+"])";const a=[];return null!==o&&a.push(n+" >= "+predicateValueExpr(o,r)),null!==i&&a.push(n+" <= "+predicateValueExpr(i,r)),0varName(("unit"===e?"":`_${e}_`)+r[e])).join(""):(n?"utc":"")+"timeunit"+y(r).map(e=>varName(`_${e}_`+r[e])).join("")}(a),s=(!util_contains(["range","mid"],n.binSuffix)&&n.binSuffix||"")+(null!=(i=n.suffix)?i:""))):e=t.op),e&&(r=r?e+"_"+r:e)}return s&&(r=r+"_"+s),e&&(r=e+"_"+r),n.forAs?removePathFromField(r):n.expr?flatAccessWithDatum(r,n.expr)+A:replacePathInField(r)+A}function isDiscrete(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return 1;case"quantitative":return isFieldDef(e)&&e.bin;case"temporal":return}throw new Error(x.invalidFieldType(e.type))}function isContinuous(e){return!isDiscrete(e)}const Kt=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function functionalTitleFormatter(e){var{aggregate:e,bin:t,timeUnit:n,field:r}=e;if(isArgmaxDef(e))return`${r} for argmax(${e.argmax})`;if(isArgminDef(e))return`${r} for argmin(${e.argmin})`;n=normalizeTimeUnit(n);const i=e||(null==n?void 0:n.unit)||(null==n?void 0:n.maxbins)&&"timeunit"||isBinning(t)&&"bin";return i?i.toUpperCase()+"("+r+")":r}(e);default:return function verbalTitleFormatter(e,t){var{field:e,bin:n,timeUnit:r,aggregate:i}=e;if("count"===i)return t.countTitle;if(isBinning(n))return e+" (binned)";if(r){n=null==(t=normalizeTimeUnit(r))?void 0:t.unit;if(n)return`${e} (${getTimeUnitParts(n).join("-")})`}else if(i)return isArgmaxDef(i)?e+" for max "+i.argmax:isArgminDef(i)?e+" for min "+i.argmin:titleCase(i)+" of "+e;return e}(e,t)}};let Xt=Kt;function setTitleFormatter(e){Xt=e}function channeldef_title(e,t,{allowDisabling:n,includeDefault:r=!0}){var i=null==(i=getGuide(e))?void 0:i.title;if(!isFieldDef(e))return i;r=r?defaultTitle(e,t):void 0;return n?getFirstDefined(i,e.title,r):null!=(t=null!=i?i:e.title)?t:r}function getGuide(e){return isPositionFieldOrDatumDef(e)&&e.axis?e.axis:isMarkPropFieldOrDatumDef(e)&&e.legend?e.legend:isFacetFieldDef(e)&&e.header?e.header:void 0}function defaultTitle(e,t){return Xt(e,t)}function getFormatMixins(e){var t,n;return isStringFieldOrDatumDef(e)?({format:t,formatType:n}=e,{format:t,formatType:n}):({format:n,formatType:e}=null!=(t=getGuide(e))?t:{},{format:n,formatType:e})}function getFieldDef(e){return isFieldDef(e)?e:hasConditionalFieldDef(e)?e.condition:void 0}function getFieldOrDatumDef(e){return isFieldOrDatumDef(e)?e:hasConditionalFieldOrDatumDef(e)?e.condition:void 0}function initChannelDef(e,t,n,r={}){var i;return isString(e)||isNumber(e)||isBoolean(e)?(i=isString(e)?"string":isNumber(e)?"number":"boolean",warn(x.primitiveChannelDef(t,i,e)),{value:e}):isFieldOrDatumDef(e)?initFieldOrDatumDef(e,t,n,r):hasConditionalFieldOrDatumDef(e)?Object.assign(Object.assign({},e),{condition:initFieldOrDatumDef(e.condition,t,n,r)}):e}function initFieldOrDatumDef(e,t,n,r){if(isStringFieldOrDatumDef(e)){var i=e["formatType"],o=Jt(e,["format","formatType"]);if(isCustomFormatType(i)&&!n.customFormatTypes)return warn(x.customFormatTypeNotAllowed(t)),initFieldOrDatumDef(o,t,n,r)}else{i=isPositionFieldOrDatumDef(e)?"axis":isMarkPropFieldOrDatumDef(e)?"legend":isFacetFieldDef(e)?"header":null;if(i&&e[i]){var o=e[i],a=o["formatType"],o=Jt(o,["format","formatType"]);if(isCustomFormatType(a)&&!n.customFormatTypes)return warn(x.customFormatTypeNotAllowed(t)),initFieldOrDatumDef(Object.assign(Object.assign({},e),{[i]:o}),t,n,r)}}return isFieldDef(e)?initFieldDef(e,t,r):function initDatumDef(e){var t=e.type;if(t)return e;var n=e["datum"];return t=isNumber(n)?"quantitative":isString(n)?"nominal":isDateTime(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function initFieldDef(e,t,{compositeMark:n=!1}={}){var{aggregate:r,timeUnit:i,bin:o,field:a}=e;const s=Object.assign({},e);if(n||!r||isAggregateOp(r)||isArgmaxDef(r)||isArgminDef(r)||(warn(x.invalidAggregate(r)),delete s.aggregate),i&&(s.timeUnit=normalizeTimeUnit(i)),a&&(s.field=""+a),isBinning(o)&&(s.bin=normalizeBin(o,t)),isBinned(o)&&!isXorY(t)&&warn(x.channelShouldNotBeUsedForBinned(t)),isTypedFieldDef(s)?(e=s["type"],e!==(n=function getFullName(e){if(e)switch(e=e.toLowerCase()){case"q":case ut:return"quantitative";case"t":case ht:return"temporal";case"o":case dt:return"ordinal";case"n":case pt:return"nominal";case ft:return"geojson"}}(e))&&(s.type=n),"quantitative"!==e&&isCountingAggregateOp(r)&&(warn(x.invalidFieldTypeForCountAggregate(e,r)),s.type="quantitative")):isSecondaryRangeChannel(t)||(i=function defaultType(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if("sort"in e&&R(e.sort))return"ordinal";var{aggregate:t,bin:n,timeUnit:r}=e;if(r)return"temporal";if(n||t&&!isArgmaxDef(t)&&!isArgminDef(t))return"quantitative";if(isScaleFieldDef(e)&&null!=(r=e.scale)&&r.type)switch(Ct[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t),s.type=i),isTypedFieldDef(s)&&({compatible:a,warning:o}=function channelCompatibility(e,t){var n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case M:case U:case O:return isContinuous(e)?{compatible:!1,warning:x.facetChannelShouldBeDiscrete(t)}:qt;case b:case h:case K:case X:case q:case Ae:case ce:case ge:case ue:case de:case he:case ne:case W:case V:case pe:return qt;case Y:case J:case j:case z:return n!==ut?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:qt;case re:case ie:case oe:case ae:case te:case H:case Z:case L:case P:return"nominal"!==n||e.sort?qt:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case se:return util_contains(["ordinal","nominal"],e.type)?qt:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case ee:return util_contains(["ordinal","nominal","geojson"],e.type)?qt:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case le:return"nominal"!==e.type||"sort"in e?qt:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{},!1===a&&warn(o)),"sort"in s&&isString(s.sort)){const A=s["sort"];if(isSortByChannel(A))return Object.assign(Object.assign({},s),{sort:{encoding:A}});n=A.substr(1);if("-"===A.charAt(0)&&isSortByChannel(n))return Object.assign(Object.assign({},s),{sort:{encoding:n,order:"descending"}})}if(isFacetFieldDef(s)){e=s["header"],r=e["orient"],i=Jt(e,["orient"]);if(r)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},i),{labelOrient:e.labelOrient||r,titleOrient:e.titleOrient||r})})}return s}function normalizeBin(e,t){return isBoolean(e)?{maxbins:autoMaxBins(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:autoMaxBins(t)})}const qt={compatible:!0};function isFieldOrDatumDefForTimeFormat(e){var t=getFormatMixins(e)["formatType"];return"time"===t||!t&&function isTimeFieldDef(e){return e&&("temporal"===e.type||isFieldDef(e)&&e.timeUnit)}(e)}function valueExpr(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){t=t&&(null==(t=normalizeTimeUnit(t))?void 0:t.unit);let o=t||"temporal"===n,a;return isExprRef(e)?a=e.expr:isSignalRef(e)?a=e.signal:isDateTime(e)?(o=!0,a=dateTimeToExpr(e)):(isString(e)||isNumber(e))&&o&&(a=`datetime(${JSON.stringify(e)})`,function isLocalSingleTimeUnit(e){return ot[e]}(t)&&(isNumber(e)&&e<1e4||isString(e)&&isNaN(Date.parse(e)))&&(a=dateTimeToExpr({[t]:e}))),a?r&&o?`time(${a})`:a:i?void 0:JSON.stringify(e)}function valueArray(n,e){const r=n["type"];return e.map(e=>{var t=valueExpr(e,{timeUnit:isFieldDef(n)?n.timeUnit:void 0,type:r,undefinedIfExprNotRequired:!0});return void 0!==t?{signal:t}:e})}function binRequiresRange(e,t){if(isBinning(e.bin))return isScaleChannel(t)&&util_contains(["ordinal","nominal"],e.type);console.warn("Only call this method for binned field defs.")}var $t=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{return e.field.push(vgField(t,n)),e.order.push(null!=(t=t.sort)?t:"ascending"),e},{field:[],order:[]})}function mergeTitleFieldDefs(e,t){const n=[...e];return t.forEach(e=>{for(const t of n)if(m(t,e))return;n.push(e)}),n}function mergeTitle(e,t){return m(e,t)||!t?e:e?[...array(e),...array(t)].join(", "):t}function mergeTitleComponent(e,t){var n=e.value,t=t.value;if(null==n||null===t)return{explicit:e.explicit,value:null};if((isText(n)||isSignalRef(n))&&(isText(t)||isSignalRef(t)))return{explicit:e.explicit,value:mergeTitle(n,t)};if(isText(n)||isSignalRef(n))return{explicit:e.explicit,value:n};if(isText(t)||isSignalRef(t))return{explicit:e.explicit,value:t};if(isText(n)||isSignalRef(n)||isText(t)||isSignalRef(t))throw new Error("It should never reach here");return{explicit:e.explicit,value:mergeTitleFieldDefs(n,t)}}class base_CompositeMarkNormalizer{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return"mark"in e&&function getMarkType(e){return e.type||e}(e.mark)===this.name}}var tn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r!!e.field):isFieldDef(e)||hasConditionalFieldDef(e))}function encoding_isAggregate(t){return some(Be,e=>{return!!channelHasField(t,e)&&(e=t[e],R(e)?some(e,e=>!!e.aggregate):(e=getFieldDef(e))&&!!e.aggregate)})}function extractTransformsFromEncoding(t,g){const u=[],d=[],h=[],p=[],f={};return forEach(t,(e,n)=>{if(isFieldDef(e)){var{field:r,aggregate:i,bin:o,timeUnit:a}=e,s=tn(e,["field","aggregate","bin","timeUnit"]);if(i||a||o){var A=getGuide(e),A=A&&A.title;let t=vgField(e,{forAs:!0});const l=Object.assign(Object.assign(Object.assign({},A?[]:{title:channeldef_title(e,g,{allowDisabling:!0})}),s),{field:t});if(i){let e;if(isArgmaxDef(i)?(e="argmax",t=vgField({op:"argmax",field:i.argmax},{forAs:!0}),l.field=t+"."+r):isArgminDef(i)?(e="argmin",t=vgField({op:"argmin",field:i.argmin},{forAs:!0}),l.field=t+"."+r):"boxplot"!==i&&"errorbar"!==i&&"errorband"!==i&&(e=i),e){const c={op:e,as:t};r&&(c.field=r),p.push(c)}}else u.push(t),isTypedFieldDef(e)&&isBinning(o)?(d.push({bin:o,field:r,as:t}),u.push(vgField(e,{binSuffix:"end"})),binRequiresRange(e,n)&&u.push(vgField(e,{binSuffix:"range"})),isXorY(n)&&(A={field:t+"_end"},f[n+"2"]=A),l.bin="binned",isSecondaryRangeChannel(n)||(l.type=ut)):a&&(h.push({timeUnit:a,field:r,as:t}),(s=isTypedFieldDef(e)&&e.type!==ht&&"time")&&(n===Ae||n===ue?l.formatType=s:!function isNonPositionScaleChannel(e){return Ee[e]}(n)?isXorY(n)&&(l.axis=Object.assign({formatType:s},l.axis)):l.legend=Object.assign({formatType:s},l.legend)));f[n]=l}else u.push(r),f[n]=t[n]}else f[n]=t[n]}),{bins:d,timeUnits:h,aggregate:p,groupby:u,encoding:f}}function initEncoding(i,o,a,s){return y(i).reduce((e,n)=>{if(!isChannel(n))return warn(x.invalidEncodingChannel(n)),e;var t=i[n];if("angle"!==n||"arc"!==o||i.theta||(warn(x.REPLACE_ANGLE_WITH_THETA),n=W),!function markChannelCompatible(e,t,n){return(n=supportMark(t,n))&&("binned"!==n||!!(isFieldDef(n=e[t===L?b:h])&&isFieldDef(e[t])&&isBinned(n.bin)))}(i,n,o))return warn(x.incompatibleChannel(n,o)),e;if(n===te&&"line"===o){var r=getFieldDef(i[n]);if(null!=r&&r.aggregate)return warn(x.LINE_WITH_VARYING_SIZE),e}if(n===K&&(a?"fill"in i:"stroke"in i))return warn(x.droppingColor("encoding",{fill:"fill"in i,stroke:"stroke"in i})),e;if(n===ce||n===le&&!R(t)&&!isValueDef(t)||n===ue&&R(t))t&&(e[n]=array(t).reduce((e,t)=>(isFieldDef(t)?e.push(initFieldDef(t,n)):warn(x.emptyFieldDef(t,n)),e),[]));else{if(n===ue&&null===t)e[n]=null;else if(!(isFieldDef(t)||isDatumDef(t)||isValueDef(t)||isConditionalDef(t)||isSignalRef(t)))return warn(x.emptyFieldDef(t,n)),e;e[n]=initChannelDef(t,n,s)}return e},{})}function normalizeEncoding(e,t){const n={};for(const i of y(e)){var r=initChannelDef(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function forEach(e,t,n){if(e)for(const i of y(e)){var r=e[i];if(R(r))for(const o of r)t.call(n,o,i);else t.call(n,r,i)}}function pathGroupingFields(i,o){return y(o).reduce((e,t)=>{switch(t){case b:case h:case de:case pe:case he:case L:case P:case W:case H:case V:case Z:case j:case Y:case z:case J:case Ae:case ee:case ne:case ue:return e;case le:if("line"===i||"trail"===i)return e;case ce:case ge:var n=o[t];if(R(n)||isFieldDef(n))for(const r of array(n))r.aggregate||e.push(vgField(r,{}));return e;case te:if("trail"===i)return e;case K:case X:case q:case re:case ie:case oe:case se:case ae:n=getFieldDef(o[t]);return n&&!n.aggregate&&e.push(vgField(n,{})),e}},[])}var nn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var n=i?" of "+getTitle(r):"";return{field:e+r.field,type:r.type,title:isSignalRef(t)?{signal:t+`"${escape(n)}"`}:t+n}}),t=function fieldDefs(e){const t=[];for(const n of y(e))if(channelHasField(e,n))for(const r of array(e[n]))isFieldDef(r)?t.push(r):hasConditionalFieldDef(r)&&t.push(r.condition);return t}(t).map(toStringFieldDef);return{tooltip:[...e,...unique(t,hash)]}}function getTitle(e){var{title:e,field:t}=e;return getFirstDefined(e,t)}function makeCompositeAggregatePartFactory(a,s,A,l,c){const{scale:g,axis:u}=A;return({partName:e,mark:t,positionPrefix:n,endPositionPrefix:r=void 0,extraEncoding:i={}})=>{var o=getTitle(A);return partLayerMixins(a,e,c,{mark:t,encoding:Object.assign(Object.assign(Object.assign({[s]:Object.assign(Object.assign(Object.assign({field:n+"_"+A.field,type:A.type},void 0!==o?{title:o}:{}),void 0!==g?{scale:g}:{}),void 0!==u?{axis:u}:{})},isString(r)?{[s+"2"]:{field:r+"_"+A.field}}:{}),l),i)})}}function partLayerMixins(e,t,n,r){var{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),r.mark.type?r.mark:{type:r.mark}),{style:s+"-"+t}),isBoolean(e[t])?{}:e[t])})]:[]}function compositeMarkContinuousAxis(e,t,n){var e=e["encoding"],t="vertical"===t?"y":"x",r=e[t],i=e[t+"2"],o=e[t+"Error"],e=e[t+"Error2"];return{continuousAxisChannelDef:filterAggregateFromChannelDef(r,n),continuousAxisChannelDef2:filterAggregateFromChannelDef(i,n),continuousAxisChannelDefError:filterAggregateFromChannelDef(o,n),continuousAxisChannelDefError2:filterAggregateFromChannelDef(e,n),continuousAxis:t}}function filterAggregateFromChannelDef(e,t){var n,r;return e&&e.aggregate?(n=e["aggregate"],r=nn(e,["aggregate"]),n!==t&&warn(x.errorBarContinuousAxisHasCustomizedAggregate(n,t)),r):e}function compositeMarkOrient(e,t){var{mark:e,encoding:n}=e,{x:n,y:r}=n;if(e.type&&e.orient)return e.orient;if(isContinuousFieldOrDatumDef(n)){if(isContinuousFieldOrDatumDef(r)){var e=isFieldDef(n)&&n.aggregate,i=isFieldDef(r)&&r.aggregate;if(e||i!==t){if(i||e!==t){if(e===t&&i===t)throw new Error("Both x and y cannot have aggregate");return isFieldOrDatumDefForTimeFormat(r)&&!isFieldOrDatumDefForTimeFormat(n)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(isContinuousFieldOrDatumDef(r))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}var rn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rmakeCompositeAggregatePartFactory(o,g,c,e,t.boxplot);const B=y(m),b=y(h),v=y(Object.assign(Object.assign({},m),C?{size:C}:{}));var y=getCompositeMarkTooltip([{fieldPrefix:"min-max"===a?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===a?"lower_whisker_":"min_",titlePrefix:"Min"}],c,h),C={type:"tick",color:"black",opacity:1,orient:p,invalid:null,aria:!1},E="min-max"===a?y:getCompositeMarkTooltip([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],c,h),C=[...B({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:E}),...B({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:E}),...B({partName:"ticks",mark:C,positionPrefix:"lower_whisker",extraEncoding:E}),...B({partName:"ticks",mark:C,positionPrefix:"upper_whisker",extraEncoding:E})],E=[..."tukey"!==a?C:[],...b({partName:"box",mark:Object.assign(Object.assign({type:"bar"},n?{size:n}:{}),{orient:f,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:y}),...v({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},isObject(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),n?{size:n}:{}),{orient:p,aria:!1}),positionPrefix:"mid_box",extraEncoding:y})];if("min-max"===a)return Object.assign(Object.assign({},i),{transform:(null!=(n=i.transform)?n:[]).concat(l),layer:E});var y=`datum["lower_box_${c.field}"]`,a=`datum["upper_box_${c.field}"]`,n=`(${a} - ${y})`,y=y+` - ${r} * `+n,a=a+` + ${r} * `+n,r=`datum["${c.field}"]`,n={joinaggregate:boxParamsQuartiles(c.field),groupby:u},C={transform:[{filter:`(${y} <= ${r}) && (${r} <= ${a})`},{aggregate:[{op:"min",field:c.field,as:"lower_whisker_"+c.field},{op:"max",field:c.field,as:"upper_whisker_"+c.field},{op:"min",field:"lower_box_"+c.field,as:"lower_box_"+c.field},{op:"max",field:"upper_box_"+c.field,as:"upper_box_"+c.field},...d],groupby:u}],layer:C},{}=m,m=rn(m,["tooltip"]),{scale:Q,axis:w}=c,S=getTitle(c),w=omit(w,["title"]),y=partLayerMixins(o,"outliers",t.boxplot,{transform:[{filter:`(${r} < ${y}) || (${r} > ${a})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[g]:Object.assign(Object.assign(Object.assign({field:c.field,type:c.type},void 0!==S?{title:S}:{}),void 0!==Q?{scale:Q}:{}),isEmpty(w)?{}:{axis:w})},m),e?{color:e}:{}),I?{tooltip:I}:{})})[0];let _;r=[...s,...A,n];return y?_={transform:r,layer:[y,C]}:(_=C).transform.unshift(...r),Object.assign(Object.assign({},i),{layer:[_,{transform:l,layer:E}]})}function boxParamsQuartiles(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var sn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function isLegendBinding(e){return!(!e||"legend"!==e&&!e.legend)}function isLegendStreamBinding(e){return isLegendBinding(e)&&isObject(e)}function isStep(e){return isObject(e)&&void 0!==e.step}function isFrameMixins(e){return e.view||e.width||e.height}const En=y({align:1,bounds:1,center:1,columns:1,spacing:1});var Qn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rthis.mapLayerOrUnit(e,t))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map(e=>this.map(e,t))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map(e=>this.map(e,t))})}mapConcat(e,t){const n=e["concat"],r=Nn(e,["concat"]);return Object.assign(Object.assign({},r),{concat:n.map(e=>this.map(e,t))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const kn={zero:1,center:1,normalize:1};const Tn=new Set([I,xt,_t,Nt,Dt,Ut,Ot,Ft,kt,Tt]),Mn=new Set([xt,_t,I]);function potentialStackedChannel(e,t){var n="x"===t?"y":"radius",r=e[t],e=e[n];if(isFieldDef(r)&&isFieldDef(e))if("quantitative"===channelDefType(r)&&"quantitative"===channelDefType(e)){if(r.stack)return t;if(e.stack)return n;var i=isFieldDef(r)&&!!r.aggregate;if(i!==(isFieldDef(e)&&!!e.aggregate))return i?t:n;var i=null==(i=r.scale)?void 0:i.type,o=null==(o=e.scale)?void 0:o.type;if(i&&"linear"!==i)return n;if(o&&"linear"!==o)return t}else{if("quantitative"===channelDefType(r))return t;if("quantitative"===channelDefType(e))return n}else{if("quantitative"===channelDefType(r))return t;if("quantitative"===channelDefType(e))return n}}function stack_stack(e,o,t={}){e=e.type||e;if(!Tn.has(e))return null;var n=potentialStackedChannel(o,"x")||potentialStackedChannel(o,"theta");if(!n)return null;var r=o[n],i=isFieldDef(r)?vgField(r,{}):void 0;let a=function getDimensionChannel(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(n),s=o[a],A=isFieldDef(s)?vgField(s,{}):void 0;A===i&&(A=void 0,s=void 0,a=void 0);i=Qe.reduce((e,t)=>{if("tooltip"!==t&&channelHasField(o,t))for(const i of array(o[t])){var n,r=getFieldDef(i);r.aggregate||((n=vgField(r,{}))&&n===A||e.push({channel:t,fieldDef:r}))}return e},[]);let l;if(void 0!==r.stack?l=isBoolean(r.stack)?r.stack?"zero":null:r.stack:0replaceRepeaterInChannelDef(e,t)).filter(e=>e):void 0!==(r=replaceRepeaterInChannelDef(o,t))&&(n[i]=r)}return n}class ruleforrangedline_RuleForRangedLineNormalizer{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if("mark"in e){var{encoding:t,mark:e}=e;if("line"===e)for(const r of ve){var n=t[getMainRangeChannel(r)];if(t[r]&&(isFieldDef(n)&&!isBinned(n.bin)||isDatumDef(n)))return!0}}return!1}run(e,t,n){var r=e["encoding"];return warn(x.lineWithRange(!!r.x2,!!r.y2)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}var d,Pn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var t=Object.assign(Object.assign({},A),{layer:e}),e=(i.name||"")+l+("child__layer_"+varName(e));const n=this.mapLayerOrUnit(i,Object.assign(Object.assign({},r),{repeater:t,repeaterPrefix:e}));return n.name=e,n})})}mapNonLayerRepeat(e,t){var n,{repeat:r,spec:i,data:o}=e,a=Pn(e,["repeat","spec","data"]);!R(r)&&e.columns&&(e=omit(e,["columns"]),warn(x.columnsNotSupportByRowCol("repeat")));const s=[];var{repeater:A={},repeaterPrefix:l=""}=t,c=!R(r)&&r.row||[A?A.row:null],g=!R(r)&&r.column||[A?A.column:null];for(const h of R(r)&&r||[A?A.repeat:null])for(const p of c)for(const f of g){var u={repeat:h,row:p,column:f,layer:A.layer},d=(i.name||"")+l+"child__"+(R(r)?""+varName(h):(r.row?"row_"+varName(p):"")+(r.column?"column_"+varName(f):""));const I=this.map(i,Object.assign(Object.assign({},t),{repeater:u,repeaterPrefix:d}));I.name=d,s.push(omit(I,["data"]))}e=R(r)?e.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!=(n=i.data)?n:o,align:"all"},a),{columns:e,concat:s})}mapFacet(e,t){var n=e["facet"];return isFacetMapping(n)&&e.columns&&(e=omit(e,["columns"]),warn(x.columnsNotSupportByRowCol("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){var{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,o=mergeProjection({parentProjection:o,projection:r}),r=mergeEncoding({parentEncoding:i,encoding:replaceRepeaterInEncoding(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),o?{projection:o}:{}),r?{encoding:r}:{}),{config:a})}mapFacetedUnit(e,t){var n=e.encoding,{row:r,column:i,facet:o}=n,n=Pn(n,["row","column","facet"]),{mark:a,width:s,projection:A,height:l,view:c,selection:g}=e,e=Pn(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:r,layout:i}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),o=replaceRepeaterInEncoding(n,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},e),i),{facet:r,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s?{width:s}:{}),l?{height:l}:{}),c?{view:c}:{}),A?{projection:A}:{}),{mark:a,encoding:o}),g?{selection:g}:{})}),t)}getFacetMappingAndLayout(e,t){var n,r,i,{row:o,column:a,facet:s}=e;if(o||a){s&&warn(x.facetChannelDropped([...o?[M]:[],...a?[U]:[]]));const c={},g={};for(const u of[M,U]){var A=e[u];if(A){var{}=A,l=Pn(A,["align","center","spacing","columns"]);c[u]=l;for(const d of["align","center","spacing"])void 0!==A[d]&&(g[d]=null!=(n=g[d])?n:{},g[d][u]=A[d])}}return{facetMapping:c,layout:g}}return{align:o,center:a,spacing:r,columns:i}=s,{facetMapping:function replaceRepeaterInFacet(e,t){return t?(isFacetMapping(e)?replaceRepeaterInMapping:replaceRepeaterInFieldDef)(e,t):e}(Pn(s,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},o?{align:o}:{}),a?{center:a}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,t=Pn(t,["parentEncoding","parentProjection"]),{encoding:i,projection:o}=e,e=Pn(e,["encoding","projection"]),t=Object.assign(Object.assign({},t),{parentEncoding:mergeEncoding({parentEncoding:n,encoding:i,layer:!0}),parentProjection:mergeProjection({parentProjection:r,projection:o})});return super.mapLayer(e,t)}};function _normalizeAutoSize(e){return isString(e)?{type:e}:null!=e?e:{}}const Zn=["background","padding"];function extractTopLevelProperties(e,t){const n={};for(const r of Zn)e&&void 0!==e[r]&&(n[r]=signalRefOrValue(e[r]));return t&&(n.params=e.params),n}class split_Split{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new split_Split(g(this.explicit),g(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return getFirstDefined(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const n of y(e.combine())){var t=e.getWithExplicit(n);this.setWithExplicit(n,t)}}}function makeExplicit(e){return{explicit:!0,value:e}}function makeImplicit(e){return{explicit:!1,value:e}}function tieBreakByComparing(o){return(e,t,n,r)=>{var i=o(e.value,t.value);return 0isFilter(e)?{filter:function normalizeLogicalComposition(e,t){return e.not?{not:normalizeLogicalComposition(e.not,t)}:e.and?{and:e.and.map(e=>normalizeLogicalComposition(e,t))}:e.or?{or:e.or.map(e=>normalizeLogicalComposition(e,t))}:t(e)}(e.filter,normalizePredicate)}:e)}(Ht=d=d||{})[Ht.Raw=0]="Raw",Ht[Ht.Main=1]="Main",Ht[Ht.Row=2]="Row",Ht[Ht.Column=3]="Column",Ht[Ht.Lookup=4]="Lookup";const Wn="[",Hn="]",jn="{",Yn="}",zn=":",Jn=",",Kn="@",Xn=">",qn=/[[\]{}]/,$n={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let er,tr;function eventSelector(e,t,n){return er=t||"view",tr=n||$n,parseMerge(e.trim()).map(parseSelector)}function find(e,t,n,r,i){var o=e.length;let a=0,s;for(;t' after between selector: "+e;r=r.map(parseSelector);const i=parseSelector(e.slice(1).trim());{if(i.between)return{between:r,stream:i};i.between=r}return i}:function parseStream(t){const e={source:er},n=[];let r=[0,0],i=0,o=0,a=t.length,s=0,A,l;if(t[a-1]===Yn){if(!(0<=(s=t.lastIndexOf(jn))))throw"Unmatched right brace: "+t;try{r=function parseThrottle(t){const e=t.split(Jn);if(!t.length||2{e=+e;if(e!=e)throw t;return e})}(t.substring(s+1,a-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,s).trim(),a=t.length,s=0}if(!a)throw t;t[0]===Kn&&(i=++s);(A=find(t,s,zn)){var t=r(e),e=function isConditionalSelection(e){return e.selection}(e)?parseSelectionPredicate(n,e.selection):predicate_expression(n,e.test);return Object.assign({test:e},t)}),...void 0!==e?[e]:[]]}}return void 0!==e?{[t]:e}:{}}function text_text(t,e="text"){var n=t.encoding[e];return wrapCondition(t,n,e,e=>textRef(e,t.config))}function textRef(e,t,n="datum"){if(e){if(isValueDef(e))return signalOrValueRef(e.value);var r,i;if(isFieldOrDatumDef(e))return{format:r,formatType:i}=getFormatMixins(e),formatSignalRef({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}function tooltip_tooltip(e,n={}){const{encoding:r,markDef:i,config:o,stack:a}=e;var t=r.tooltip;if(R(t))return{tooltip:tooltipRefForEncoding({tooltip:t},a,o,n)};{const s=n.reactiveGeom?"datum.datum":"datum";return wrapCondition(e,t,"tooltip",e=>{var t=textRef(e,o,s);if(t)return t;if(null!==e){let e=getMarkPropOrConfig("tooltip",i,o);return isString(e=!0===e?{content:"encoding"}:e)?{value:e}:isObject(e)?isSignalRef(e)?e:"encoding"===e.content?tooltipRefForEncoding(r,a,o,n):{signal:s}:void 0}})}}function tooltipData(l,c,g,{reactiveGeom:e}={}){const u={},d=e?"datum.datum":"datum",h=[];function add(e,t){var n,r,i,o,a,s=getMainRangeChannel(t),e=isTypedFieldDef(e)?e:Object.assign(Object.assign({},e),{type:l[s].type}),s=array(e.title||defaultTitle(e,g)).join(", ");let A;isXorY(t)&&(a=getFieldDef(l[n="x"===t?"x2":"y2"]),isBinned(e.bin)&&a?(o=vgField(e,{expr:d}),a=vgField(a,{expr:d}),{format:r,formatType:i}=getFormatMixins(e),A=binFormatExpression(o,a,r,i,g),u[n]=!0):c&&c.fieldChannel===t&&"normalize"===c.offset&&({format:o,formatType:a}=getFormatMixins(e),A=formatSignalRef({fieldOrDatumDef:e,format:o,formatType:a,expr:d,config:g,normalizeStack:!0}).signal)),A=null!==A&&void 0!==A?A:textRef(e,g,d).signal,h.push({channel:t,key:s,value:A})}forEach(l,(e,t)=>{isFieldDef(e)?add(e,t):hasConditionalFieldDef(e)&&add(e.condition,t)});const t={};for(var{channel:n,key:r,value:i}of h)u[n]||t[r]||(t[r]=i);return t}function tooltipRefForEncoding(e,t,n,{reactiveGeom:r}={}){e=tooltipData(e,t,n,{reactiveGeom:r});const i=v(e).map(([e,t])=>`"${e}": `+t);return 0textRef(e,t.config));o=getMarkPropOrConfig("description",n,r);if(null!=o)return{description:signalOrValueRef(o)};if(!1===r.aria)return{};n=tooltipData(e,i,r);if(isEmpty(n))return;return{description:{signal:v(n).map(([e,t],n)=>`"${0midPoint({channel:t,channelDef:e,markDef:r,config:o,scaleName:n.scaleName(t),scale:n.getScaleComponent(t),stack:null,defaultRef:s}))}function color_color(e,t={filled:void 0}){var{markDef:n,encoding:r,config:i}=e,o=n["type"],t=null!=(t=t.filled)?t:getMarkPropOrConfig("filled",n,i),o=util_contains(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,a=null!=(a=null!=(a=getMarkPropOrConfig(!0===t?"color":void 0,n,i,{vgChannel:"fill"}))?a:i.mark[!0===t&&"color"])?a:o,o=null!=(o=getMarkPropOrConfig(!1===t?"color":void 0,n,i,{vgChannel:"stroke"}))?o:i.mark[!1===t&&"color"],i=t?"fill":"stroke",s=Object.assign(Object.assign({},a?{fill:signalOrValueRef(a)}:{}),o?{stroke:signalOrValueRef(o)}:{});return n.color&&(t?n.fill:n.stroke)&&warn(x.droppingColor("property",{fill:"fill"in n,stroke:"stroke"in n})),Object.assign(Object.assign(Object.assign(Object.assign({},s),nonPosition("color",e,{vgChannel:i,defaultValue:t?a:o})),nonPosition("fill",e,{defaultValue:r.fill?a:void 0})),nonPosition("stroke",e,{defaultValue:r.stroke?o:void 0}))}function getOffset(e,t){t=t[function getOffsetChannel(e){switch(e){case b:return"xOffset";case h:return"yOffset";case L:return"x2Offset";case P:return"y2Offset";case W:return"thetaOffset";case V:return"radiusOffset";case H:return"theta2Offset";case Z:return"radius2Offset"}}(e)];if(t)return t}function pointPosition(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){var{encoding:o,markDef:a,config:s,stack:A}=t,l=o[e],c=o[getSecondaryRangeChannel(e)],g=t.scaleName(e),u=t.getScaleComponent(e),d=getOffset(e,a),n=pointPositionDefaultRef({model:t,defaultPos:n,channel:e,scaleName:g,scale:u}),o=!l&&isXorY(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function positionRef(e){var{channel:t,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:A}=e;if(isFieldOrDatumDef(n)&&o&&t===o.fieldChannel){if(isFieldDef(n)){t=getBand({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:A});if(void 0!==t)return interpolatedSignalRef({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:t,offset:a})}return valueRefForFieldOrDatumDef(n,i,{suffix:"end"},{offset:a})}return midPointRefWithPositionInvalidTest(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:g,scale:u,stack:A,offset:d,defaultRef:n});return o?{[r||e]:o}:void 0}function pointPositionDefaultRef({model:r,defaultPos:i,channel:o,scaleName:a,scale:s}){const{markDef:A,config:l}=r;return()=>{var e=getMainRangeChannel(o),t=getVgPositionChannel(o),t=getMarkPropOrConfig(o,A,l,{vgChannel:t});if(void 0!==t)return widthHeightValueOrSignalRef(o,t);switch(i){case"zeroOrMin":case"zeroOrMax":if(a){var n=s.get("type");if(!util_contains([It.LOG,It.TIME,It.UTC],n)&&s.domainDefinitelyIncludesZero())return{scale:a,value:0}}if("zeroOrMin"===i)return"y"===e?{field:{group:"height"}}:{value:0};switch(e){case"radius":return{signal:`min(${r.width.signal},${r.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":n=r[getSizeChannel(o)];return Object.assign(Object.assign({},n),{mult:.5})}}}const nr={left:"x",center:"xc",right:"x2"},rr={top:"y",middle:"yc",bottom:"y2"};function vgAlignedPositionChannel(e,t,n,r="middle"){if("radius"===e||"theta"===e)return getVgPositionChannel(e);var i="x"===e?"align":"baseline",t=getMarkPropOrConfig(i,t,n);let o;return o=isSignalRef(t)?void warn(x.rangeMarkAlignmentCannotBeExpression(i)):t,"x"===e?nr[o||("top"===r?"left":"center")]:rr[o||r]}function pointOrRangePosition(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?rangePosition(e,t,{defaultPos:n,defaultPos2:r}):pointPosition(e,t,{defaultPos:n})}function rangePosition(e,t,{defaultPos:n,defaultPos2:r}){var{markDef:i,config:o}=t,a=getSecondaryRangeChannel(e),s=getSizeChannel(e),r=function pointPosition2OrSize(e,t,n){var{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,A=getMainRangeChannel(n),l=getSizeChannel(n),c=getVgPositionChannel(n),g=r[A],u=e.scaleName(A),d=e.getScaleComponent(A),A=n in r||n in o?getOffset(n,e.markDef):getOffset(A,e.markDef);if(!g&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:e.getName(n)}};g=function position2Ref({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:A,defaultRef:l}){if(isFieldOrDatumDef(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return valueRefForFieldOrDatumDef(t,o,{suffix:"start"},{offset:A});return midPointRefWithPositionInvalidTest({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:A,defaultRef:l})}({channel:n,channelDef:g,channel2Def:r[n],markDef:o,config:s,scaleName:u,scale:d,stack:a,offset:A,defaultRef:void 0});return void 0===g?position2orSize(n,o)||position2orSize(n,{[n]:getMarkStyleConfig(n,o,s.style),[l]:getMarkStyleConfig(l,o,s.style)})||position2orSize(n,s[i])||position2orSize(n,s.mark)||{[c]:pointPositionDefaultRef({model:e,defaultPos:t,channel:n,scaleName:u,scale:d})()}:{[c]:g}}(t,r,a),a=r[s]?vgAlignedPositionChannel(e,i,o):getVgPositionChannel(e);return Object.assign(Object.assign({},pointPosition(e,t,{defaultPos:n,vgChannel:a})),r)}function position2orSize(e,t){var n=getSizeChannel(e),r=getVgPositionChannel(e);return void 0!==t[r]?{[r]:widthHeightValueOrSignalRef(e,t[r])}:void 0!==t[e]?{[r]:widthHeightValueOrSignalRef(e,t[e])}:t[n]?{[n]:widthHeightValueOrSignalRef(e,t[n])}:void 0}function rectPosition(e,t,n){var{config:r,encoding:i,markDef:o,stack:a}=e,s=getSecondaryRangeChannel(t),A=getSizeChannel(t),l=i[t],s=i[s];const c=e.getScaleComponent(t);var g=c?c.get("type"):void 0,u=e.scaleName(t),d=o.orient,i=null!=(h=null!=(h=i[A])?h:i.size)?h:getMarkPropOrConfig("size",o,r,{vgChannel:A}),h="bar"===n&&("x"===t?"vertical"===d:"horizontal"===d);if(!isFieldDef(l)||!(isBinning(l.bin)||isBinned(l.bin)||l.timeUnit&&!s)||i||hasDiscreteDomain(g))return(isFieldOrDatumDef(l)&&hasDiscreteDomain(g)||h)&&!s?function positionAndSize(e,t,n,r){const{markDef:i,encoding:o,config:a,stack:s}=r,A=i.orient,l=r.scaleName(n),c=r.getScaleComponent(n),g=getSizeChannel(n),u=getSecondaryRangeChannel(n),d="horizontal"===A&&"y"===n||"vertical"===A&&"x"===n,h=getMarkPropOrConfig(d?"size":g,i,a,{vgChannel:g});let p;!o.size&&void 0===h||(d?p=nonPosition("size",r,{vgChannel:g,defaultValue:h}):warn(x.cannotApplySizeToNonOrientedMark(i.type)));var f=null!=(f=isFieldOrDatumDef(t)?getBand({channel:n,fieldDef:t,markDef:i,stack:s,config:a}):void 0)?f:1,e=(p=p||{[g]:function defaultSizeRef(e,t,n,r,i,o){if(r)return"point"!==(a=r.get("type"))&&"band"!==a?{value:i[e].continuousBandSize}:void 0!==i[e].discreteBandSize?{value:i[e].discreteBandSize}:a===It.POINT?(a=r.get("range")).step&&isNumber(a.step)?{value:a.step-2}:{value:wn-2}:{scale:n,band:o};var r=getViewConfigDiscreteStep(i.view,t),a=getFirstDefined(i[e].discreteBandSize,r-2);return void 0!==a?{value:a}:void 0}(e,g,l,c,a,f)},"band"!==(null===c||void 0===c?void 0:c.get("type"))||!("band"in p[g])),I=vgAlignedPositionChannel(n,i,a,e?"middle":"top"),C=getOffset(n,i),t=midPointRefWithPositionInvalidTest({channel:n,channelDef:t,markDef:i,config:a,scaleName:l,scale:c,stack:s,offset:C,defaultRef:pointPositionDefaultRef({model:r,defaultPos:"mid",channel:n,scaleName:l,scale:c}),band:e?.5:(1-f)/2});return g?Object.assign({[I]:t},p):(r=getVgPositionChannel(u),n=p[g],e=C?Object.assign(Object.assign({},n),{offset:C}):n,{[I]:t,[r]:R(t)?[t[0],Object.assign(Object.assign({},t[1]),{offset:e})]:Object.assign(Object.assign({},t),{offset:e})})}(n,l,t,e):rangePosition(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"});{A=getBand({channel:t,fieldDef:l,stack:a,markDef:o,config:r});const p=null==(d=e.component.axes[t])?void 0:d[0];return function rectBinPosition({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:A,config:l}){var c=getSecondaryRangeChannel(n),g=getVgPositionChannel(n),u=getVgPositionChannel(c),d=getOffset(n,o);{if(isBinning(e.bin)||e.timeUnit)return{[u]:rectBinRef({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:getBinSpacing(c,a,A,s,d),config:l}),[g]:rectBinRef({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:getBinSpacing(n,a,A,s,d),config:l})};if(isBinned(e.bin)){o=valueRefForFieldOrDatumDef(e,i,{},{offset:getBinSpacing(c,a,A,s,d)});if(isFieldDef(t))return{[u]:o,[g]:valueRefForFieldOrDatumDef(t,i,{},{offset:getBinSpacing(n,a,A,s,d)})};if(isBinParams(e.bin)&&e.bin.step)return{[u]:o,[g]:{signal:`scale("${i}", ${vgField(e,{expr:"datum"})} + ${e.bin.step})`,offset:getBinSpacing(n,a,A,s,d)}}}}return warn(x.channelRequiredForBinned(c)),void 0}({fieldDef:l,fieldDef2:s,channel:t,markDef:o,scaleName:u,band:A,axisTranslate:null!=(i=null===p||void 0===p?void 0:p.get("translate"))?i:.5,spacing:isXorY(t)?getMarkPropOrConfig("binSpacing",o,r):void 0,reverse:c.get("reverse"),config:r})}}function getBinSpacing(e,t,n,r,i){if(isPolarPositionChannel(e))return 0;var o,a,e="x"===e||"y2"===e?-t/2:t/2;return isSignalRef(n)||isSignalRef(i)||isSignalRef(r)?(t=signalOrStringValue(n),o=signalOrStringValue(i),{signal:((a=signalOrStringValue(r))?a+" + ":"")+(t?`(${t} ? -1 : 1) * `:"")+(o?`(${o} + ${e})`:e)}):(i=i||0,r+(n?-i-e:+i+e))}function rectBinRef({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return wrapPositionInvalidTest({fieldDef:t,channel:e,markDef:r,ref:interpolatedSignalRef({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const ir=new Set(["aria"]);function baseEncodeEntry(e,t){var{fill:n=void 0,stroke:r=void 0}="include"===t.color?color_color(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function markDefProperties(n,r){return At.reduce((e,t)=>(ir.has(t)||void 0===n[t]||"ignore"===r[t]||(e[t]=signalOrValueRef(n[t])),e),{})}(e.markDef,t)),wrapAllFieldsInvalid(e,"fill",n)),wrapAllFieldsInvalid(e,"stroke",r)),nonPosition("opacity",e)),nonPosition("fillOpacity",e)),nonPosition("strokeOpacity",e)),nonPosition("strokeWidth",e)),nonPosition("strokeDash",e)),function zindex_zindex(e){var{encoding:t,mark:n}=e,t=t.order;return!isPathMark(n)&&isValueDef(t)?wrapCondition(e,t,"zindex",e=>signalOrValueRef(e.value)):{}}(e)),tooltip_tooltip(e)),text_text(e,"href")),aria_aria(e))}function wrapAllFieldsInvalid(e,t,n){var{config:r,mark:i,markDef:o}=e;if("hide"===getMarkPropOrConfig("invalid",o,r)&&n&&!isPathMark(i)){o=function allFieldsInvalidPredicate(i,{invalid:t=!1,channels:e}){const n=e.reduce((e,t)=>{const n=i.getScaleComponent(t);var r;return n&&(r=n.get("type"),(t=i.vgField(t,{expr:"datum"}))&&hasContinuousDomain(r)&&(e[t]=!0)),e},{}),r=y(n);if(0fieldInvalidPredicate(e,t)).join(` ${e} `);return}(e,{invalid:!0,channels:De});if(o)return{[t]:[{test:o,value:null},...array(n)]}}return n?{[t]:n}:{}}function defined(e){var{config:t,markDef:n}=e;if(getMarkPropOrConfig("invalid",n,t)){n=function defined_allFieldsInvalidPredicate(i,{invalid:t=!1,channels:e}){const n=e.reduce((e,t)=>{const n=i.getScaleComponent(t);var r;return n&&(r=n.get("type"),(t=i.vgField(t,{expr:"datum"}))&&hasContinuousDomain(r)&&(e[t]=!0)),e},{}),r=y(n);if(0fieldInvalidPredicate(e,t)).join(` ${e} `);return}(e,{channels:Se});if(n)return{defined:{signal:n}}}return{}}function valueIfDefined(e,t){if(void 0!==t)return{[e]:signalOrValueRef(t)}}const or="voronoi";var ar={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(or)},marks:(r,e,t)=>{var{x:e,y:n}=e.project.hasChannel,i=r.mark;if(isPathMark(i))return warn(x.nearestNotSupportForContinuous(i)),t;i={name:r.getName(or),type:"path",interactive:!0,from:{data:r.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},tooltip_tooltip(r,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:e||!n?"datum.datum.x || 0":"0"},y:{expr:n||!e?"datum.datum.y || 0":"0"},size:[r.getSizeSignalRef("width"),r.getSizeSignalRef("height")]}]};let o=0,a=!1;return t.forEach((e,t)=>{const n=null!=(e=e.name)?e:"";n===r.component.mark[0].name?o=t:0<=n.indexOf(or)&&(a=!0)}),a||t.splice(o+1,0,i),t}};class dataflow_DataFlowNode{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){(this._parent=e)&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){-1{var{field:r,timeUnit:i}=t,o=isUnitModel(a)?a.encoding[getSecondaryRangeChannel(n)]:void 0,n=isUnitModel(a)&&hasBand(n,t,o,a.stack,a.markDef,a.config);return i&&(e[hash({as:o=vgField(t,{forAs:!0}),field:r,timeUnit:i})]=Object.assign({as:o,field:r,timeUnit:i},n?{band:!0}:{})),e},{});return isEmpty(t)?null:new timeunit_TimeUnitNode(e,t)}static makeFromTransform(e,t){var t=Object.assign({},t),n=t["timeUnit"],t=sr(t,["timeUnit"]),n=normalizeTimeUnit(n),t=Object.assign(Object.assign({},t),{timeUnit:n});return new timeunit_TimeUnitNode(e,{[hash(t)]:t})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}removeFormulas(e){const t={};for(var[n,r]of v(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(B(this.formula).map(e=>e.as))}dependentFields(){return new Set(B(this.formula).map(e=>e.field))}hash(){return"TimeUnit "+hash(this.formula)}assemble(){const e=[];for(const a of B(this.formula)){var{field:t,as:n,timeUnit:r}=a,r=normalizeTimeUnit(r),{unit:i,utc:o}=r,r=sr(r,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:replacePathInField(t),type:"timeunit"},i?{units:getTimeUnitParts(i)}:{}),o?{timezone:"utc"}:{}),r),{as:[n,n+"_end"]}))}return e}}var Ar=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!isLegendBinding(e.bind),parse:(e,t,n,r)=>{r.on||delete t.events,r.clear||delete t.clear},topLevelSignals:(e,r,i)=>{const o=r.name,t=r.project,a=r.bind,s=r.init&&r.init[0],A=ar.has(r)?"(item().isVoronoi ? datum.datum : datum)":"datum";return t.items.forEach((e,t)=>{const n=varName(o+"_"+e.field);i.filter(e=>e.name===n).length||i.unshift(Object.assign(Object.assign({name:n},s?{init:assembleInit(s[t])}:{value:null}),{on:r.events?[{events:r.events,update:`datum && item().mark.marktype !== 'group' ? ${A}[${$(e.field)}] : null`}]:[],bind:null!=(t=null!=(t=a[e.field])?t:a[e.channel])?t:a}))}),i},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter(e=>e.name===r+Qr)[0];t=r+lr;const a=i.items.map(e=>varName(r+"_"+e.field));var s=a.map(e=>e+" !== null").join(" && ");return a.length&&(o.update=`${s} ? {fields: ${t}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}};const gr="_toggle";var ur={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+gr,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{var n=t.name+Qr,r=t.name+gr;return r+` ? null : ${n}, `+("global"===t.resolve?r+" ? null : true, ":r+` ? null : {unit: ${selection_unitName(e)}}, `)+r+` ? ${n} : null`}},dr={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){var r=i.channel;if(isScaleChannel(r)){const o=e.getScaleComponent(r);var r=o?o.get("type"):void 0;o&&hasContinuousDomain(r)?(r={selection:t.name,field:i.field},o.set("selectionExtent",r,!0),n.push(i)):warn(x.SCALE_BINDINGS_CONTINUOUS)}}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(t=>0===n.filter(e=>e.name===t.signals.data).length);if(!e.parent||isTopLevelLayer(e)||0===r.length)return n;const i=n.filter(e=>e.name===t.name)[0];let o=i.update;if(0<=o.indexOf(Sr))i.update=`{${r.map(e=>$(e.field)+": "+e.signals.data).join(", ")}}`;else{for(const s of r){var a=$(s.field)+": "+s.signals.data;o.indexOf(a)<0&&(o=o.substring(0,o.length-1)+`, ${a}}`)}i.update=o}return n.concat(r.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!isTopLevelLayer(e))for(const r of t.scales){const i=n.filter(e=>e.name===r.signals.data)[0];i.push="outer",delete i.value,delete i.update}return n}};function scales_domain(e,t){return`domain(${$(e.scaleName(t))})`}function isTopLevelLayer(e){var t;return e.parent&&isLayerModel(e.parent)&&(null!==(t=!e.parent.parent)?t:isTopLevelLayer(e.parent.parent))}const hr={has:e=>{var t="global"===e.resolve&&e.bind&&isLegendBinding(e.bind),e=1===e.project.items.length&&e.project.items[0].field!==bn;return t&&!e&&warn(x.LEGEND_BINDINGS_MUST_HAVE_PROJECTION),t&&e},parse:(e,t,n,r)=>{var i;if(r.on||delete t.events,r.clear||delete t.clear,r.on||r.clear){var o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=array(null!=(i=a.filter)?i:[]),a.filter.indexOf(o)<0&&a.filter.push(o)}const a=isLegendStreamBinding(t.bind)?t.bind.legend:"click";r=isString(a)?eventSelector(a,"view"):array(a);t.bind={legend:{merge:r}}},topLevelSignals:(e,t,n)=>{var r=t.name;const i=isLegendStreamBinding(t.bind)&&t.bind.legend;var o=n=>e=>{const t=g(e);return t.markname=n,t};for(const s of t.project.items)if(s.hasLegend){var a=varName(s.field)+"_legend";const A=r+"_"+a;0===n.filter(e=>e.name===A).length&&(a=i.merge.map(o(a+"_symbols")).concat(i.merge.map(o(a+"_labels"))).concat(i.merge.map(o(a+"_entries"))),n.unshift(Object.assign(Object.assign({name:A},t.init?{}:{value:null}),{on:[{events:a,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:"!event.item || !datum ? null : "+A,force:!0}]})))}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(e=>e.name===r+Qr);var a=r+lr;const s=i.items.filter(e=>e.hasLegend).map(e=>varName(`${r}_${varName(e.field)}_legend`));a=`${s.map(e=>e+" !== null").join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&0({signal:e})),update:a}):0e.name===r+gr);a=isLegendStreamBinding(t.bind)&&t.bind.legend;return A&&(t.events?A.on.push(Object.assign(Object.assign({},A.on[0]),{events:a})):A.on[0].events=a),n}};vn=hr;const pr="_translate_anchor",fr="_translate_delta";function onDelta(e,t,n,r,i){var o=t.name,a=o+pr,o=o+fr,s=n.channel;const A=dr.has(t),l=i.filter(e=>e.name===n.signals[A?"data":"visual"])[0];t=e.getSizeSignalRef(r).signal;const c=e.getScaleComponent(s);i=c.get("type"),r=a+".extent_"+s,e=(A&&s===b?"-":"")+o+`.${s} / `+(A?""+t:`span(${r})`),s=(A?"log"===i?"panLog":"pow"===i?"panPow":"panLinear":"panLinear")+`(${r}, `+e+(A&&"pow"===i?", "+(null!=(a=c.get("exponent"))?a:1):"")+")";l.on.push({events:{signal:o},update:A?s:`clampRange(${s}, 0, ${t})`})}const Ir="_zoom_anchor",Cr="_zoom_delta";function zoom_onDelta(e,t,n,r,i){var o=t.name,a=n.channel;const s=dr.has(t),A=i.filter(e=>e.name===n.signals[s?"data":"visual"])[0];t=e.getSizeSignalRef(r).signal;const l=e.getScaleComponent(a);i=l.get("type"),r=s?scales_domain(e,a):A.name,e=o+Cr,o=""+o+Ir+"."+a,r=(s?"log"===i?"zoomLog":"pow"===i?"zoomPow":"zoomLinear":"zoomLinear")+`(${r}, ${o}, `+e+(s&&"pow"===i?", "+(null!=(a=l.get("exponent"))?a:1):"")+")";A.on.push({events:{signal:e},update:s?r:`clampRange(${r}, 0, ${t})`})}const mr=[{has:()=>!0,parse:(n,r,e)=>{const i=r.name,o=null!=(u=r.project)?u:r.project=new SelectionProjectionComponent,a={},s={},A=new Set;var l=(e,t)=>{var n="visual"===t?e.channel:e.field;let r=varName(i+"_"+n);for(let e=1;A.has(r);e++)r=varName(i+`_${n}_`+e);return A.add(r),{[t]:r}};if(!e.fields&&!e.encodings){var t=n.config.selection[e.type];if(e.init)for(const d of array(e.init))for(const h of y(d))!function isSingleDefUnitChannel(e){return be[e]}(h)?"interval"===e.type?(warn(x.INTERVAL_INITIALIZED_WITH_X_Y),e.encodings=t.encodings):(e.fields||(e.fields=[])).push(h):(e.encodings||(e.encodings=[])).push(h);else e.encodings=t.encodings,e.fields=t.fields}for(const p of null!=(u=e.fields)?u:[]){const f={type:"E",field:p};f.signals=Object.assign({},l(f,"data")),o.items.push(f),o.hasField[p]=f}for(const I of null!=(u=e.encodings)?u:[]){var c,g=n.fieldDef(I);if(g){let t=g.field;if(g.aggregate)warn(x.cannotProjectAggregate(I,g.aggregate));else if(t){if(g.timeUnit&&(t=n.vgField(I),c={timeUnit:g.timeUnit,as:t,field:g.field},s[hash(c)]=c),!a[t]){let e="E";"interval"===r.type?hasContinuousDomain(n.getScaleComponent(I).get("type"))&&(e="R"):g.bin&&(e="R-RE");const C={field:t,channel:I,type:e};C.signals=Object.assign(Object.assign({},l(C,"data")),l(C,"visual")),o.items.push(a[t]=C),o.hasField[t]=o.hasChannel[I]=a[t]}}else warn(x.cannotProjectOnChannelWithoutField(I))}else warn(x.cannotProjectOnChannelWithoutField(I))}if(e.init){var u=t=>o.items.map(e=>void 0!==t[e.channel]?t[e.channel]:t[e.field]);if("interval"===e.type)r.init=u(e.init);else{const m=array(e.init);r.init=m.map(u)}}isEmpty(s)||(o.timeUnit=new timeunit_TimeUnitNode(null,s))},signals:(e,t,n)=>{const r=t.name+lr;return 0e.name===r).length?n:n.concat({name:r,value:t.project.items.map(e=>{const{}=e,t=Ar(e,["signals","hasLegend"]);return t.field=replacePathInField(t.field),t})})}},ur,dr,vn,{has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name;var i=dr.has(t),o=r+pr,{x:a,y:s}=t.project.hasChannel;let A=eventSelector(t.translate,"scope");return i||(A=A.map(e=>(e.between[0].markname=r+br,e))),n.push({name:o,value:{},on:[{events:A.map(e=>e.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?scales_domain(e,b):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?scales_domain(e,h):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+fr,value:{},on:[{events:A,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&onDelta(e,t,a,"width",n),void 0!==s&&onDelta(e,t,s,"height",n),n}},{has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name;var i=dr.has(t),o=r+Cr,{x:a,y:s}=t.project.hasChannel,A=$(e.scaleName(b)),l=$(e.scaleName(h));let c=eventSelector(t.zoom,"scope");return i||(c=c.map(e=>(e.markname=r+br,e))),n.push({name:r+Ir,on:[{events:c,update:i?"{"+[A?`x: invert(${A}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(e=>!!e).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&zoom_onDelta(e,t,a,"width",n),void 0!==s&&zoom_onDelta(e,t,s,"height",n),n}},cr,ar,{has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=isString(n.clear)?eventSelector(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(cr.has(t))for(const i of t.project.items){var r=n.findIndex(e=>e.name===varName(t.name+"_"+i.field));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,n,r)=>{function addClear(e,t){-1!==e&&r[e].on&&r[e].on.push({events:n.clear,update:t})}if("interval"===n.type)for(const i of n.project.items){var t=r.findIndex(e=>e.name===i.signals.visual);addClear(t,"[0, 0]"),-1===t&&addClear(r.findIndex(e=>e.name===i.signals.data),"null")}else addClear(r.findIndex(e=>e.name===n.name+Qr),"null"),ur.has(n)&&addClear(r.findIndex(e=>e.name===n.name+gr),"false");return r}}];function forEachTransform(e,t){for(const n of mr)n.has(e)&&t(n)}var yr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rassembleInit(e,t,n));return t?`[${r.join(", ")}]`:r}return isDateTime(e)?n((t?dateTimeToExpr:function dateTimeToTimestamp(e){var t=dateTimeParts(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)})(e)):t?n(JSON.stringify(e)):e}function assembleUnitSelectionMarks(n,r){return forEachSelection(n,(t,e)=>{r=e.marks?e.marks(n,t,r):r,forEachTransform(t,e=>{e.marks&&(r=e.marks(n,t,r))})}),r}function cleanupEmptyOnArray(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}var Br=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rt.between?n(e,t):(warn(t+" is not an ordered event stream for interval selections."),e),[])}function singleOrMultiSignals(n,e){var t=e.name,r=t+lr;const i=e.project,o="(item().isVoronoi ? datum.datum : datum)";var a=i.items.map(e=>{var t=n.fieldDef(e.channel);return t&&t.bin?`[${o}[${$(n.vgField(e.channel,{}))}], `+o+`[${$(n.vgField(e.channel,{binSuffix:"end"}))}]]`:o+`[${$(e.field)}]`}).join(", "),r=`unit: ${selection_unitName(n)}, fields: ${r}, values`,e=e.events;return[{name:t+Qr,on:e?[{events:e,update:`datum && item().mark.marktype !== 'group' ? {${r}: [${a}]} : null`,force:!0}]:[]}]}const Er="_store",Qr="_tuple";var a,s,wr,c;const Sr="vlSelectionResolve",_r={single:{signals:singleOrMultiSignals,modifyExpr:(e,t)=>{return t.name+Qr+", "+("global"===t.resolve?"true":`{unit: ${selection_unitName(e)}}`)}},multi:{signals:singleOrMultiSignals,modifyExpr:(e,t)=>{return t.name+Qr+", "+("global"===t.resolve?"null":`{unit: ${selection_unitName(e)}}`)}},interval:{signals:(a,s)=>{var e=s.name,t=e+lr,n=dr.has(s);const A=[],l=[],c=[];if(s.translate&&!n){const i="!event.item || event.item.mark.name !== "+$(e+br);interval_events(s,(e,t)=>{var n;const r=array(null!=(n=t.between[0].filter)?n:t.between[0].filter=[]);return r.indexOf(i)<0&&r.push(i),e})}s.project.items.forEach((e,t)=>{var n,r,i,o=e.channel;o!==b&&o!==h?warn("Interval selections only support x and y encoding channels."):(t=s.init?s.init[t]:null,t=function channelSignals(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=dr.has(t),A=$(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,g=e=>`scale(${A}, ${e})`,u=e.getSizeSignalRef(i===b?"width":"height").signal,d=i+"(unit)",h=interval_events(t,(e,t)=>[...e,{events:t.between[0],update:`[${d}, ${d}]`},{events:t,update:`[${o}[0], clamp(${d}, 0, ${u})]`}]);return h.push({events:{signal:t.name+vr},update:hasContinuousDomain(c)?`[${g(a+"[0]")}, ${g(a+"[1]")}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:assembleInit(r,!0,g)}:{value:[]}),{on:h}),Object.assign(Object.assign({name:a},r?{init:assembleInit(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${A}, ${o})`}]})]}(a,s,e,t),n=e.signals.data,e=e.signals.visual,r=$(a.scaleName(o)),i=hasContinuousDomain(a.getScaleComponent(o).get("type"))?"+":"",A.push(...t),l.push(n),c.push({scaleName:a.scaleName(o),expr:`(!isArray(${n}) || `+`(${i}invert(${r}, ${e})[0] === ${i}${n}[0] && `+i+`invert(${r}, ${e})[1] === ${i}${n}[1]))`}))}),n||A.push({name:e+vr,value:{},on:[{events:c.map(e=>({scale:e.scaleName})),update:c.map(e=>e.expr).join(" && ")+` ? ${e+vr} : {}`}]});n=s.init,t=`unit: ${selection_unitName(a)}, fields: ${t}, values`;return A.concat(Object.assign(Object.assign({name:e+Qr},n?{init:`{${t}: ${assembleInit(n)}}`}:{}),{on:[{events:[{signal:l.join(" || ")}],update:l.join(" && ")+` ? {${t}: [${l}]} : null`}]}))},modifyExpr:(e,t)=>{return t.name+Qr+", "+("global"===t.resolve?"true":`{unit: ${selection_unitName(e)}}`)},marks:(e,t,n)=>{var r=t.name;const{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual;var A=`data(${$(t.name+Er)})`;if(dr.has(t))return n;const l={x:void 0!==i?{signal:a+"[0]"}:{value:0},y:void 0!==o?{signal:s+"[0]"}:{value:0},x2:void 0!==i?{signal:a+"[1]"}:{field:{group:"width"}},y2:void 0!==o?{signal:s+"[1]"}:{field:{group:"height"}}};if("global"===t.resolve)for(const p of y(l))l[p]=[Object.assign({test:A+`.length && ${A}[0].unit === `+selection_unitName(e)},l[p]),{value:0}];const c=t.mark,{fill:g,fillOpacity:u,cursor:d}=c,h=Br(c,["fill","fillOpacity","cursor"]);t=y(h).reduce((e,t)=>(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter(e=>e).join(" && "),value:h[t]},{value:null}],e),{});return[{name:r+br+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:g},fillOpacity:{value:u}},update:l}},...n,{name:r+br,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},d?{cursor:{value:d}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),t)}}]}}};function forEachSelection(e,t){e=e.component.selection;if(e)for(const n of B(e))if(!0===t(n,_r[n.type]))break}function selection_unitName(e,{escape:t}={escape:!0}){let n=t?$(e.name):e.name;const r=function getFacetModel(e){let t=e.parent;for(;t&&!isFacetModel(t);)t=t.parent;return t}(e);if(r){var i=r["facet"];for(const o of me)i[o]&&(n+=` + '__facet_${o}_' + (facet[${$(r.vgField(o))}])`)}return n}function requiresSelectionId(e){let t=!1;return forEachSelection(e,e=>{t=t||e.project.items.some(e=>e.field===bn)}),t}function ASTNode(e){this.type=e}ASTNode.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function vega_expression_module_children(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",n[3]="Identifier",n[4]="Keyword",n[5]="Null",n[6]="Numeric",n[Rr]="Punctuator",n[8]="String",n[9]="RegularExpression","ConditionalExpression"),Dr="Identifier",Gr="Unexpected token %0",Nr="Invalid regular expression",kr="Invalid regular expression: missing /",Tr="Octal literals are not allowed in strict mode.",Mr="ILLEGAL",Ur="Disabled.",Or=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Lr=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function assert(e,t){if(!e)throw new Error("ASSERT: "+t)}function isDecimalDigit(e){return 48<=e&&e<=57}function isHexDigit(e){return 0<="0123456789abcdefABCDEF".indexOf(e)}function isOctalDigit(e){return 0<="01234567".indexOf(e)}function isLineTerminator(e){return 10===e||13===e||8232===e||8233===e}function isIdentifierStart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||92===e||128<=e&&Or.test(String.fromCharCode(e))}function isIdentifierPart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||48<=e&&e<=57||92===e||128<=e&&Lr.test(String.fromCharCode(e))}const Pr={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function skipComment(){for(;s>>="===(t=a.substr(s,4))?{type:Rr,value:t,start:n,end:s+=4}:">>>"===(t=t.substr(0,3))||"<<="===t||">>="===t?{type:Rr,value:t,start:n,end:s+=3}:i===(t=t.substr(0,2))[1]&&0<="+-<>&|".indexOf(i)||"=>"===t?{type:Rr,value:t,start:n,end:s+=2}:("//"===t&&throwError({},Gr,Mr),0<="<>=!+-*%&|^/".indexOf(i)?{type:Rr,value:i,start:n,end:++s}:void throwError({},Gr,Mr))}function scanNumericLiteral(){var e,t,n=a[s];if(assert(isDecimalDigit(n.charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=s,e="","."!==n){if(e=a[s++],n=a[s],"0"===e){if("x"===n||"X"===n)return++s,function scanHexLiteral(e){let t="";for(;s>10),56320+(t-65536&1023))}()):r+=scanHexEscape(t);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:isOctalDigit(t)?(0!==(n="01234567".indexOf(t))&&(i=!0),s{if(parseInt(t,16)<=1114111)return"x";throwError({},Nr)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){throwError({},Nr)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:s}}function advance(){if(skipComment(),wr<=s)return{type:xr,start:s,end:s};var e=a.charCodeAt(s);return(isIdentifierStart(e)?scanIdentifier:40===e||41===e||59===e?scanPunctuator:39===e||34===e?scanStringLiteral:46===e?isDecimalDigit(a.charCodeAt(s+1))?scanNumericLiteral:scanPunctuator:isDecimalDigit(e)?scanNumericLiteral:scanPunctuator)()}function lex(){var e=c;return s=e.end,c=advance(),s=e.end,e}function vega_expression_module_peek(){var e=s;c=advance(),s=e}function finishBinaryExpression(e,t,n){const r=new ASTNode("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return r.operator=e,r.left=t,r.right=n,r}function finishIdentifier(e){const t=new ASTNode(Dr);return t.name=e,t}function finishLiteral(e){const t=new ASTNode("Literal");return t.value=e.value,t.raw=a.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function finishMemberExpression(e,t,n){const r=new ASTNode("MemberExpression");return r.computed="["===e,r.object=t,r.property=n,r.computed||(n.member=!0),r}function finishProperty(e,t,n){const r=new ASTNode("Property");return r.key=t,r.value=n,r.kind=e,r}function throwError(e,t){var n=Array.prototype.slice.call(arguments,2),t=t.replace(/%(\d)/g,(e,t)=>(assert(t":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function parseConditionalExpression(){var e,t=function parseBinaryExpression(){var e,t,n,r,i,o,a=c,s=parseUnaryExpression(),A=c,l=binaryPrecedence(A);if(0===l)return s;for(A.prec=l,lex(),e=[a,c],n=[s,A,parseUnaryExpression()];0<(l=binaryPrecedence(c));){for(;2{"MemberExpression"===e.type&&function startsWithDatum(e){return"MemberExpression"===e.object.type?startsWithDatum(e.object):"datum"===e.object.name}(e)&&n.add(function getName(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...getName(e.object)),t.push(...getName(e.property))),t)}(e).slice(1).join("."))}),n}class filter_FilterNode extends dataflow_DataFlowNode{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=predicate_expression(this.model,this.filter,this),this._dependentFields=getDependentFields(this.expr)}clone(){return new filter_FilterNode(null,this.model,g(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter "+this.expr}}var Zr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r`length(data(${e}))`).join(" || ")+") || ":"")+`(${e})`}function parseSelectionBinExtent(e,t){const n=t.encoding;let r=t.field;var i;return n||r?n&&!r&&(!(i=e.project.items.filter(e=>e.channel===n)).length||1isString(e)?e:function isSelectionPredicate(e){return null!=e&&e.selection}(e)?parseSelectionPredicate(t,e.selection,n):fieldFilterExpression(e))}var Wr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var t=e["test"],e=Wr(e,["test"]);return Object.assign({test:predicate_expression(null,t)},e)}),h],setAxisEncode(g,I,p,f),delete g[m]):null===u&&(I={signal:y.map(e=>{var t=e["test"],e=Wr(e,["test"]);return`${predicate_expression(null,t)} ? ${exprFromValueOrSignalRef(e)} : `}).join("")+exprFromValueOrSignalRef(h)},g[m]=I)}else!isSignalRef(d)||(p=Q[m])&&({vgProp:f,part:u}=p,setAxisEncode(g,u,f,d),delete g[m])}if("grid"===t){if(g.grid)return g.encode&&(C=g.encode["grid"],g.encode=Object.assign({},C?{grid:C}:{}),isEmpty(g.encode)&&delete g.encode),Object.assign(Object.assign({scale:s,orient:a},g),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:getFirstDefined(c,0)})}else if(r.header||!e.mainExtracted){if(void 0!==A){let e=A;null!=(r=null==(C=g.encode)?void 0:C.labels)&&r.update&&isSignalRef(g.encode.labels.update.text)&&(e=replaceAll(A,"datum.label",g.encode.labels.update.text.signal)),setAxisEncode(g,"labels","text",{signal:e})}if(null===g.labelAlign&&delete g.labelAlign,g.encode){for(const B of w)e.hasAxisPart(B)||delete g.encode[B];isEmpty(g.encode)&&delete g.encode}var C=function assembleTitle(e,t){if(e)return R(e)&&!isText(e)?e.map(e=>defaultTitle(e,t)).join(", "):e}(l,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:s,orient:a,grid:!1},C?{title:C}:{}),g),!1===n.aria?{aria:!1}:{}),{zindex:getFirstDefined(c,0)})}}}function assembleAxisSignals(e){var t,n,r=e.component["axes"];const i=[];for(const o of Se)if(r[o])for(const a of r[o])a.get("disable")||a.get("gridScale")||(t="x"===o?"height":"width")!==(n=e.getSizeSignalRef(t).signal)&&i.push({name:t,update:n});return i}function getAxisConfigFromConfigTypes(e,s,A,l){return Object.assign.apply(null,[{},...e.map(e=>{if("axisOrient"!==e)return s[e];{var t="x"===A?"bottom":"left",n=s["x"===A?"axisBottom":"axisLeft"]||{},r=s["x"===A?"axisTop":"axisRight"]||{};const i=new Set([...y(n),...y(r)]),o={};for(const a of i.values())o[a]={signal:`${l.signal} === "${t}" ? ${signalOrStringValue(n[a])} : `+signalOrStringValue(r[a])};return o}})])}function getAxisConfigs(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:function isQuantitative(e){return e in bt}(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY";var t=isSignalRef(n)?"axisOrient":"axis"+titleCase(n),a=[...i,...i.map(e=>o+e.substr(4))],t=["axis",t,o];return{vlOnlyAxisConfig:getAxisConfigFromConfigTypes(a,r,e,n),vgAxisConfig:getAxisConfigFromConfigTypes(t,r,e,n),axisConfigStyle:function getAxisConfigStyle(e,t){const n=[{}];for(const i of e){var r=null==(r=t[i])?void 0:r.style;if(r)for(const o of r=array(r))n.push(t.style[o])}return Object.assign.apply(null,n)}([...t,...a],r)}}function getAxisConfig(e,t,n,r={}){var i,n=getStyleConfig(e,n,t);if(void 0!==n)return{configFrom:"style",configValue:n};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null==(i=r[o])?void 0:i[e]))return{configFrom:o,configValue:r[o][e]};return{}}const Hr={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{var{format:n,formatType:r}=n;return guideFormat(e,e.type,n,r,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{e=e.formatType;return guideFormatType(e,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{return(!isFieldDef(e)||!isBinned(e.bin))&&(null!=(t=t.grid)?t:function defaultGrid(e,t){return!hasDiscreteDomain(e)&&isFieldDef(t)&&!isBinning(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function gridScale(e,t){t="x"===t?"y":"x";if(e.getScaleComponent(t))return e.scaleName(t);return}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||defaultLabelAlign(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||defaultLabelBaseline(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{return null!=(e=e.labelFlush)?e:function defaultLabelFlush(e,t){if("x"===t&&util_contains(["quantitative","temporal"],e))return!0;return}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{return null!=(e=e.labelOverlap)?e:function defaultLabelOverlap(e,t,n,r){if(n&&!isObject(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy";return}(t.type,n,isFieldDef(t)&&!!t.timeUnit,isFieldDef(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var e="x"===e?"width":"y"===e?"height":void 0,t=e?t.getSizeSignalRef(e):void 0;return null!=(e=n.tickCount)?e:function defaultTickCount({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){if(!r&&!hasDiscreteDomain(t)&&"log"!==t){if(isFieldDef(e)){if(isBinning(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&util_contains(["month","hours","day","quarter"],null==(r=normalizeTimeUnit(e.timeUnit))?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}({fieldOrDatumDef:r,scaleType:i,size:t,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;e=getFieldDefTitle(t,n);if(void 0!==e)return e;e=t.typedFieldDef(n),t=t.fieldDef("x"===n?"x2":"y2");return mergeTitleFieldDefs(e?[toFieldDefBase(e)]:[],isFieldDef(t)?[toFieldDefBase(t)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function properties_values(e,t){e=e.values;{if(R(e))return valueArray(t,e);if(isSignalRef(e))return e}return}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{return null!=(e=e.zindex)?e:function defaultZindex(e,t){if("rect"===e&&isDiscrete(t))return 1;return 0}(n,t)}};function normalizeAngleExpr(e){return`(((${e.signal} % 360) + 360) % 360)`}function defaultLabelBaseline(e,t,n,r){if(void 0!==e)return"x"===n?isSignalRef(e)?{signal:`(45 < ${n=normalizeAngleExpr(e)} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :`+`(${n} <= 45 || 315 <= ${n}) === ${isSignalRef(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}:45{if(isScaleFieldDef(e)&&isSortArray(e.sort)){const{field:r,timeUnit:i}=e,o=e.sort;var n=o.map((e,t)=>fieldFilterExpression({field:r,timeUnit:i,equal:e})+` ? ${t} : `).join("")+o.length;a=new calculate_CalculateNode(a,{calculate:n,as:sortArrayIndexField(e,t,{forAs:!0})})}}),a}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate "+hash(this.transform)}}function sortArrayIndexField(e,t,n){return vgField(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function getHeaderChannel(e,t){return!util_contains(["top","bottom"],t)&&(util_contains(["left","right"],t)||"row"===e)?"row":"column"}function getHeaderProperty(e,t,n,r){r="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return getFirstDefined((t||{})[e],r[e],n.header[e])}function getHeaderProperties(e,t,n,r){const i={};for(const a of e){var o=getHeaderProperty(a,t||{},n,r);void 0!==o&&(i[a]=o)}return i}const jr=["row","column"],Yr=["header","footer"];function defaultHeaderGuideAlign(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}n=defaultLabelAlign(t,"row"===e?"left":"top","row"===e?"y":"x");return n?{align:n}:{}}function defaultHeaderGuideBaseline(e,t){e=defaultLabelBaseline(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return e?{baseline:e}:{}}function assembleHeaderGroups(e,t){var n=e.component.layoutHeaders[t];const r=[];for(const o of Yr)if(n[o])for(const a of n[o]){var i=function assembleHeaderGroup(t,n,r,i,o){if(o){let e=null;var a,s=i["facetFieldDef"],A=t.config||void 0,l=(s&&o.labels&&(l=getHeaderProperties(["labelOrient"],s.header,A,n)["labelOrient"],("row"===n&&!util_contains(["top","bottom"],l)||"column"===n&&!util_contains(["left","right"],l))&&(e=assembleLabelTitle(s,n,A))),isFacetModel(t)&&!isFacetMapping(t.facet)),A=o.axes,c=0<(null==A?void 0:A.length);if(e||c)return a="row"===n?"height":"width",Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName(n+"_"+r),type:"group",role:n+"-"+r},i.facetFieldDef?{from:{data:t.getName(n+"_domain")},sort:function getSort(e,t){var n;var r=e["sort"];return isSortField(r)?{field:vgField(r,{expr:"datum"}),order:null!=(n=r.order)?n:"ascending"}:R(r)?{field:sortArrayIndexField(e,t,{expr:"datum"}),order:"ascending"}:{field:vgField(e,{expr:"datum"}),order:null!=r?r:"ascending"}}(s,n)}:{}),c&&l?{from:{data:t.getName("facet_domain_"+n)}}:{}),e?{title:e}:{}),o.sizeSignal?{encode:{update:{[a]:o.sizeSignal}}}:{}),c?{axes:A}:{})}return null}(e,t,o,n,a);null!=i&&r.push(i)}return r}function assembleLabelTitle(e,t,n){var{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:A}=getHeaderProperties(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),r=formatSignalRef({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,i=getHeaderChannel(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:A?replaceAll(replaceAll(A,"datum.label",r),"datum.value",vgField(e,{expr:"parent"})):r}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),defaultHeaderGuideBaseline(o,i)),defaultHeaderGuideAlign(i,o,a)),assembleHeaderProperties(n,e,t,In,pn))}const zr={column:{start:0,end:1},row:{start:1,end:0}};function assembleLayoutTitleBand(e,t){const n={};for(const o of me){var r,i=e[o];null!=i&&i.facetFieldDef&&({titleAnchor:i,titleOrient:r}=getHeaderProperties(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,o),void 0!==(r=function getLayoutTitleBand(e,t){return zr[t][e]}(i,i=getHeaderChannel(o,r)))&&(n[i]=r))}return isEmpty(n)?void 0:n}function assembleHeaderProperties(e,t,n,r,i){const o={};for(const s of r){var a;i[s]&&(void 0!==(a=getHeaderProperty(s,null==t?void 0:t.header,e,n))&&(o[i[s]]=a))}return o}function assembleLayoutSignals(e){return[...sizeSignals(e,"width"),...sizeSignals(e,"height"),...sizeSignals(e,"childWidth"),...sizeSignals(e,"childHeight")]}function sizeSignals(e,t){var n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"!==r)return"container"==r?(o=`isFinite(${o=(t=i.endsWith("width"))?"containerSize()[0]":"containerSize()[1]"}) ? ${o} : `+getViewConfigContinuousSize(e.config.view,t?"width":"height"),[{name:i,init:o,on:[{update:o,events:"window:resize"}]}]):[{name:i,value:r}];{const a=e.getScaleComponent(n);if(a){var t=a.get("type"),o=a.get("range");if(hasDiscreteDomain(t)&&o.step){r=e.scaleName(n);if(isFacetModel(e.parent))if("independent"===e.parent.component.resolve.scale[n])return[stepSignal(r,o)];return[stepSignal(r,o),{name:i,update:sizeExpr(r,a,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}}function stepSignal(e,t){return{name:e+"_step",value:t.step}}function sizeExpr(e,t,n){var r=t.get("type"),i=t.get("padding"),o=getFirstDefined(t.get("paddingOuter"),i);let a=t.get("paddingInner");return`bandspace(${n}, ${signalOrStringValue(a="band"===r?void 0!==a?a:i:1)}, ${signalOrStringValue(o)}) * ${e}_step`}function getSizeTypeFromLayoutSizeType(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function guideEncodeEntry(r,i){return y(r).reduce((e,t)=>{var n=r[t];return Object.assign(Object.assign({},e),wrapCondition(i,n,t,e=>signalOrValueRef(e.value)))},{})}function parseGuideResolve(e,t){var n=e.scale[t],r=isXorY(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&warn(x.independentScaleMeansIndependentGuide(t)),"independent"):e[r][t]||"shared"}e=Object.assign(Object.assign({},yn),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1});const Jr=y(e);class component_LegendComponent extends split_Split{}const Kr={symbols:function symbols(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if("symbol"!==o)return;var{markDef:o,encoding:a,config:s,mark:A}=n,A=o.filled&&"trail"!==A;let l=Object.assign(Object.assign({},function applyMarkConfig(e,t,n){for(const i of n){var r=getMarkConfig(i,t.markDef,t.config);void 0!==r&&(e[i]=signalOrValueRef(r))}return e}({},n,Pt)),color_color(n,{filled:A}));var c=null!=(c=i.get("symbolOpacity"))?c:s.legend.symbolOpacity,g=null!=(g=i.get("symbolFillColor"))?g:s.legend.symbolFillColor,u=null!=(u=i.get("symbolStrokeColor"))?u:s.legend.symbolStrokeColor,c=void 0===c?null!=(c=getMaxValue(a.opacity))?c:o.opacity:void 0;l.fill&&("fill"===r||A&&r===K?delete l.fill:l.fill.field?g?delete l.fill:(l.fill=signalOrValueRef(null!=(g=s.legend.symbolBaseFillColor)?g:"black"),l.fillOpacity=signalOrValueRef(null!=c?c:1)):R(l.fill)&&(g=null!=(g=null!=(g=getFirstConditionValue(null!=(g=a.fill)?g:a.color))?g:o.fill)?g:A&&o.color)&&(l.fill=signalOrValueRef(g)));l.stroke&&("stroke"===r||!A&&r===K||l.stroke.field||u?delete l.stroke:R(l.stroke)&&(g=getFirstDefined(getFirstConditionValue(a.stroke||a.color),o.stroke,A?o.color:void 0))&&(l.stroke={value:g}));r!==re&&((u=isFieldDef(t)&&selectedCondition(0,i,t))?l.opacity=[Object.assign({test:u},signalOrValueRef(null!=c?c:1)),signalOrValueRef(s.legend.unselectedOpacity)]:c&&(l.opacity=signalOrValueRef(c)));return isEmpty(l=Object.assign(Object.assign({},l),e))?void 0:l},gradient:function gradient(e,{model:t,legendType:n,legendCmpt:r}){if("gradient"!==n)return;var{config:n,markDef:t,encoding:i}=t;let o={};r=null!=(r=r.get("gradientOpacity"))?r:n.legend.gradientOpacity,n=void 0===r?getMaxValue(i.opacity)||t.opacity:void 0;n&&(o.opacity=signalOrValueRef(n));return isEmpty(o=Object.assign(Object.assign({},o),e))?void 0:o},labels:function encode_labels(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){var r=n.legend(r)||{},o=n.config,n=isFieldDef(t)?selectedCondition(0,i,t):void 0,i=n?[{test:n,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:n,formatType:r}=r,t=isCustomFormatType(r)?formatCustomType({fieldOrDatumDef:t,field:"datum.value",format:n,formatType:r,config:o}):void 0,n=Object.assign(Object.assign(Object.assign({},i?{opacity:i}:{}),t?{text:t}:{}),e);return isEmpty(n)?void 0:n},entries:function encode_entries(e,{legendCmpt:t}){t=t.get("selections");return null!=t&&t.length?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function getMaxValue(e){return getConditionValue(e,(e,t)=>Math.max(e,t.value))}function getFirstConditionValue(e){return getConditionValue(e,(e,t)=>getFirstDefined(e,t.value))}function getConditionValue(e,t){return function hasConditionalValueDef(e){return(e=e&&e.condition)&&(R(e)||isValueDef(e))}(e)?array(e.condition).reduce(t,e.value):isValueDef(e)?e.value:void 0}function selectedCondition(e,t,n){const r=t.get("selections");if(null!==r&&void 0!==r&&r.length){const i=$(n.field);return r.map(e=>{return`(!length(data(${$(varName(e)+Er)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`}).join(" || ")}}const Xr={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{var{format:t,formatType:r}=t;return guideFormat(e,e.type,t,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{e=e.formatType;return guideFormatType(e,t,n)},gradientLength:e=>{var{legend:t,legendConfig:n}=e;return null!=(t=null!=(t=t.gradientLength)?t:n.gradientLength)?t:function defaultGradientLength({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){var{gradientHorizontalMaxLength:e,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:s}=e;if(isContinuousToContinuous(i))return"horizontal"===n?"top"===r||"bottom"===r?gradientLengthSignal(t,"width",o,e):o:gradientLengthSignal(t,"height",s,a);return}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{return null!=(e=null!=(e=e.labelOverlap)?e:t.labelOverlap)?e:function properties_defaultLabelOverlap(e){if(util_contains(["quantile","threshold","log","symlog"],e))return"greedy";return}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>{return null!=(e=e.symbolType)?e:function defaultSymbolType(e,t,n,r){if("shape"!==t){n=null!=(t=getFirstConditionValue(n))?t:r;if(n)return n}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>channeldef_title(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(isColorChannel(n)&&isContinuousToContinuous(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function legend_properties_values(e,t){e=e.values;{if(R(e))return valueArray(t,e);if(isSignalRef(e))return e}return}(t,e)};function getLegendType(e){var t=e["legend"];return getFirstDefined(t.type,function properties_defaultType({channel:e,timeUnit:t,scaleType:n}){if(isColorChannel(e)){if(util_contains(["quarter","month","day"],t))return"symbol";if(isContinuousToContinuous(n))return"gradient"}return"symbol"}(e))}function getDirection({legendConfig:e,legendType:t,orient:n,legend:r}){return null!=(r=null!=(r=r.direction)?r:e[t?"gradientDirection":"symbolDirection"])?r:function defaultDirection(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function gradientLengthSignal(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function parseLegend(e){var t=(isUnitModel(e)?function parseUnitLegend(e){const t=e["encoding"],n={};for(const i of[K,...mn]){var r=getFieldOrDatumDef(t[i]);r&&e.getScaleComponent(i)&&(i===ee&&isFieldDef(r)&&r.type===ft||(n[i]=function parseLegendForChannel(e,t){let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,a=o.legend,s=new component_LegendComponent({},function getLegendDefWithScale(e,t){var n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"!==t?{[t]:n}:e.markDef.filled?{fill:n}:{stroke:n}}(e,t)),A=(function parseInteractiveLegend(e,i,o){var t;const a=null==(t=e.fieldDef(i))?void 0:t.field;forEachSelection(e,e=>{var t;const n=null!=(t=e.project.hasField[a])?t:e.project.hasChannel[i];if(n&&hr.has(e)){const r=null!=(t=o.get("selections"))?t:[];r.push(e.name),o.set("selections",r,!1),n.hasLegend=!0}})}(e,t,s),void 0!==n?!n:a.disable);if(s.set("disable",A,void 0!==n),A)return s;n=n||{};var l=e.getScaleComponent(t).get("type"),c=getFieldOrDatumDef(i[t]),g=!isFieldDef(c)||null==(g=normalizeTimeUnit(c.timeUnit))?void 0:g.unit,u=n.orient||o.legend.orient||"right",d=getLegendType({legend:n,channel:t,timeUnit:g,scaleType:l}),g=getDirection({legend:n,legendType:d,orient:u,legendConfig:a}),h={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:c,legendConfig:a,config:o,scaleType:l,orient:u,legendType:d,direction:g};for(const b of Jr){var p,f;"gradient"===d&&b.startsWith("symbol")||"symbol"===d&&b.startsWith("gradient")||(void 0===(p=b in Xr?Xr[b](h):n[b])||!(f=function isExplicit(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!(null==n||!n.values);case"title":if("title"===t&&e===(null==r?void 0:r.title))return!0}return e===(n||{})[t]}(p,b,n,e.fieldDef(t)))&&void 0!==o.legend[b]||s.set(b,p,f))}const I=null!=(l=null===n||void 0===n?void 0:n.encoding)?l:{},C=s.get("selections"),m={},y={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:s,legendType:d};for(const v of["labels","legend","title","symbols","gradient","entries"]){var B=guideEncodeEntry(null!=(B=I[v])?B:{},e),B=v in Kr?Kr[v](B,y):B;void 0===B||isEmpty(B)||(m[v]=Object.assign(Object.assign(Object.assign({},null!=C&&C.length&&isFieldDef(c)?{name:varName(c.field)+"_legend_"+v}:{}),null!=C&&C.length?{interactive:!!C}:{}),{update:B}))}isEmpty(m)||s.set("encode",m,!(null===n||void 0===n||!n.encoding));return s}(e,i)))}return n}:function parseNonUnitLegend(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){parseLegend(r);for(const i of y(r.component.legends))n.legend[i]=parseGuideResolve(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=mergeLegendComponent(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const o of y(t))for(const a of e.children)a.component.legends[o]&&"shared"===n.legend[o]&&delete a.component.legends[o];return t})(e);e.component.legends=t}function mergeLegendComponent(e,t){if(!e)return t.clone();var r=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(!r.explicit||!i.explicit||r.value===i.value){let n=!1;for(const a of Jr){var o=mergeValuesWithExplicit(e.getWithExplicit(a),t.getWithExplicit(a),a,"legend",(e,t)=>{switch(a){case"symbolType":return function mergeSymbolType(e,t){return"circle"!==t.value?e:t}(e,t);case"title":return mergeTitleComponent(e,t);case"type":return n=!0,makeImplicit("symbol")}return defaultTieBreaker(e,t,a,"legend")});e.setWithExplicit(a,o)}return n&&(null!=(i=null==(r=e.implicit)?void 0:r.encode)&&i.gradient&&deleteNestedProperty(e.implicit,["encode","gradient"]),null!=(i=null==(r=e.explicit)?void 0:r.encode)&&i.gradient&&deleteNestedProperty(e.explicit,["encode","gradient"])),e}}var qr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rfunction assembleLegend(t,n){const e=t.combine(),{disable:r,labelExpr:i}=e,o=qr(e,["disable","labelExpr","selections"]);if(r)return;!1===n.aria&&null==o.aria&&(o.aria=!1);if(null!=(t=o.encode)&&t.symbols){const a=o.encode.symbols.update;!a.fill||"transparent"===a.fill.value||a.stroke||o.stroke||(a.stroke={value:"transparent"});for(const s of mn)o[s]&&delete a[s]}o.title||delete o.title;if(void 0!==i){let e=i;null!=(t=null==(n=o.encode)?void 0:n.labels)&&t.update&&isSignalRef(o.encode.labels.update.text)&&(e=replaceAll(i,"datum.label",o.encode.labels.update.text.signal)),!function setLegendEncode(e,t,n,r){var i;e.encode=null!=(i=e.encode)?i:{},e.encode[t]=null!=(i=e.encode[t])?i:{},e.encode[t].update=null!=(i=e.encode[t].update)?i:{},e.encode[t].update[n]=r}(o,"labels","text",{signal:e})}return o}(e,t.config)).filter(e=>void 0!==e)}function assembleProjections(e){return(isLayerModel(e)||isConcatModel(e)?function assembleProjectionsForModelAndChildren(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),assembleProjectionForModel(e))}:assembleProjectionForModel)(e)}function assembleProjectionForModel(n){const e=n.component.projection;if(!e||e.merged)return[];var t=e.combine(),r=t["name"];if(e.data){var i={signal:`[${e.size.map(e=>e.signal).join(", ")}]`};const o=e.data.reduce((e,t)=>{t=isSignalRef(t)?t.signal:`data('${n.lookupDataSource(t)}')`;return util_contains(e,t)||e.push(t),e},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:1{var t,e=e.component.projection;return!e||(n?((t=function mergeIfNoConflict(t,n){var e=every($r,e=>!has(t.explicit,e)&&!has(n.explicit,e)||!(!has(t.explicit,e)||!has(n.explicit,e)||A(t.get(e))!==A(n.get(e)))),r=A(t.size)===A(n.size);if(r){if(e)return t;if(A(t.explicit)===A({}))return n;if(A(n.explicit)===A({}))return t}return null}(n,e))&&(n=t),!!t):(n=e,!0))});if(n&&t){var r=e.projectionName(!0);const o=new component_ProjectionComponent(r,n.specifiedProjection,n.size,g(n.data));for(const a of e.children){const s=a.component.projection;s&&(s.isFit&&o.data.push(...a.component.projection.data),a.renameProjection(s.get("name"),r),s.merged=!0)}return o}return})(e)}var ei=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var r,i;return isTypedFieldDef(t)&&isBinning(t.bin)&&({key:r,binComponent:i}=createBinComponent(t,t.bin,o),e[r]=Object.assign(Object.assign(Object.assign({},i),e[r]),function rangeFormula(e,t,n,r){var i;return binRequiresRange(t,n)?(e=isUnitModel(e)&&null!=(i=null!=(i=e.axis(n))?i:e.legend(n))?i:{},n=vgField(t,{expr:"datum"}),i=vgField(t,{expr:"datum",binSuffix:"end"}),{formulaAs:vgField(t,{binSuffix:"range",forAs:!0}),formula:binFormatExpression(n,i,e.format,e.formatType,r)}):{}}(o,t,n,o.config))),e},{});return isEmpty(t)?null:new bin_BinNode(e,t)}static makeFromTransform(e,t,n){var{key:t,binComponent:n}=createBinComponent(t,t.bin,n);return new bin_BinNode(e,{[t]:n})}merge(e,t){for(const n of y(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=unique([...this.bins[n].as,...e.bins[n].as],hash)):this.bins[n]=e.bins[n];for(const r of e.children)e.removeChild(r),r.parent=this;e.remove()}producedFields(){return new Set(B(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(B(this.bins).map(e=>e.field))}hash(){return"Bin "+hash(this.bins)}assemble(){return B(this.bins).flatMap(e=>{const t=[];var[n,...r]=e.as,i=e.bin,o=i["extent"],i=ei(i,["extent"]);const a=Object.assign(Object.assign(Object.assign({type:"bin",field:replacePathInField(e.field),as:n,signal:e.signal},isSelectionExtent(o)?{extent:null}:{extent:o}),e.span?{span:{signal:`span(${e.span})`}}:{}),i);!o&&e.extentSignal&&(t.push({type:"extent",field:replacePathInField(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const s of r)for(let e=0;e<2;e++)t.push({type:"formula",expr:vgField({field:n[e]},{expr:"datum"}),as:s[e]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}function addDimension(e,t,n,r){var i=isUnitModel(r)?r.encoding[getSecondaryRangeChannel(t)]:void 0;isTypedFieldDef(n)&&isUnitModel(r)&&hasBand(t,n,i,r.stack,r.markDef,r.config)?(e.add(vgField(n,{})),e.add(vgField(n,{suffix:"end"})),n.bin&&binRequiresRange(n,t)&&e.add(vgField(n,{binSuffix:"range"}))):!function isGeoPositionChannel(e){return e in Ie}(t)?e.add(vgField(n)):(i=function getPositionChannelFromLatLong(e){switch(e){case j:return"y";case z:return"y2";case Y:return"x";case J:return"x2"}}(t),e.add(r.getName(i)))}class aggregate_AggregateNode extends dataflow_DataFlowNode{constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}clone(){return new aggregate_AggregateNode(null,new Set(this.dimensions),g(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(e,s){let t=!1;s.forEachFieldDef(e=>{e.aggregate&&(t=!0)});const A={},l=new Set;return t?(s.forEachFieldDef((e,t)=>{var n,r,i,{aggregate:o,field:a}=e;o?"count"===o?(A["*"]=null!=(r=A["*"])?r:{},A["*"].count=new Set([vgField(e,{forAs:!0})])):(isArgminDef(o)||isArgmaxDef(o)?(i=o[r=isArgminDef(o)?"argmin":"argmax"],A[i]=null!=(n=A[i])?n:{},A[i][r]=new Set([vgField({op:r,field:i},{forAs:!0})])):(A[a]=null!=(n=A[a])?n:{},A[a][o]=new Set([vgField(e,{forAs:!0})])),isScaleChannel(t)&&"unaggregated"===s.scaleDomain(t)&&(A[a]=null!=(r=A[a])?r:{},A[a].min=new Set([vgField({field:a,aggregate:"min"},{forAs:!0})]),A[a].max=new Set([vgField({field:a,aggregate:"max"},{forAs:!0})]))):addDimension(l,t,e,s)}),l.size+y(A).length===0?null:new aggregate_AggregateNode(e,l,A)):null}static makeFromTransform(e,t){var n;const r=new Set,i={};for(const A of t.aggregate){var{op:o,field:a,as:s}=A;o&&("count"===o?(i["*"]=null!=(n=i["*"])?n:{},i["*"].count=new Set([s||vgField(A,{forAs:!0})])):(i[a]=null!=(n=i[a])?n:{},i[a][o]=new Set([s||vgField(A,{forAs:!0})])))}for(const l of null!=(t=t.groupby)?t:[])r.add(l);return r.size+y(i).length===0?null:new aggregate_AggregateNode(e,r,i)}merge(e){return setEqual(this.dimensions,e.dimensions)?(function mergeMeasures(e,t){var n;for(const i of y(t)){var r=t[i];for(const o of y(r))i in e?e[i][o]=new Set([...null!=(n=e[i][o])?n:[],...r[o]]):e[i]={[o]:r[o]}}}(this.measures,e.measures),!0):(function debug(...e){$e.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...y(this.measures)])}producedFields(){const e=new Set;for(const t of y(this.measures))for(const n of y(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(n+"_"+t):r.forEach(e.add,e)}return e}hash(){return"Aggregate "+hash({dimensions:this.dimensions,measures:this.measures})}assemble(){const e=[],t=[],n=[];for(const r of y(this.measures))for(const i of y(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:replacePathInField(r));return{type:"aggregate",groupby:[...this.dimensions].map(replacePathInField),ops:e,fields:t,as:n}}}class facet_FacetNode extends dataflow_DataFlowNode{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const s of me){var i,o,a=t.facet[s];a&&({bin:i,sort:o}=a,this[s]=Object.assign({name:t.getName(s+"_domain"),fields:[vgField(a),...isBinning(i)?[vgField(a,{binSuffix:"end"})]:[]]},isSortField(o)?{sortField:o}:R(o)?{sortIndexField:sortArrayIndexField(a,s)}:{}))}this.childModel=t.child}hash(){let e="Facet";for(const t of me)this[t]&&(e+=` ${t.charAt(0)}:`+hash(this[t]));return e}get fields(){var e;const t=[];for(const n of me)null!=(e=this[n])&&e.fields&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of me)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const r of Se){const i=this.childModel.component.scales[r];var t,n;i&&!i.merged&&(n=i.get("type"),t=i.get("range"),hasDiscreteDomain(n)&&t.step&&((n=getFieldFromDomain(assembleDomain(this.childModel,r)))?e[r]=n:warn(x.unknownField(r))))}return e}assembleRowColumnHeaderData(e,t,n){var r={row:"y",column:"x"}[e];const i=[],o=[],a=[];n&&n[r]&&(t?(i.push("distinct_"+n[r]),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push("distinct_"+n[r]));var s,A,{sortField:n,sortIndexField:r}=this[e];return n?({op:s=Yt,field:A}=n,i.push(A),o.push(s),a.push(vgField(n,{forAs:!0}))):r&&(i.push(r),o.push("max"),a.push(r)),{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n,r,i=this.model.layout["columns"],o=this.model.component["layoutHeaders"];const a=[],s={};for(const c of jr){for(const g of Yr)for(const u of null!=(t=o[c]&&o[c][g])?t:[])if(0<(null==(n=u.axes)?void 0:n.length)){s[c]=!0;break}s[c]&&(r=`length(data("${this.facet.name}"))`,r="row"===c?i?{signal:`ceil(${r} / ${i})`}:1:i?{signal:`min(${r}, ${i})`}:{signal:r},a.push({name:this.facet.name+"_"+c,transform:[{type:"sequence",start:0,stop:r}]}))}var{row:A,column:l}=s;return(A||l)&&a.unshift(this.assembleRowColumnHeaderData("facet",null,e)),a}assemble(){const e=[];let t=null;var n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:o}=this;if(r&&i&&(n.x||n.y)){t=`cross_${this.column.name}_`+this.row.name;const a=[].concat(null!=(r=n.x)?r:[],null!=(i=n.y)?i:[]);r=a.map(()=>"distinct");e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:r}]})}for(const s of[U,M])this[s]&&e.push(this.assembleRowColumnHeaderData(s,t,n));return o&&(i=this.assembleFacetHeaderData(n))&&e.push(...i),e}}function unquote(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function getImplicitFromFilterTransform(e){const r={};return function forEachLeaf(e,t){if(e.not)forEachLeaf(e.not,t);else if(e.and)for(const n of e.and)forEachLeaf(n,t);else if(e.or)for(const r of e.or)forEachLeaf(r,t);else t(e)}(e.filter,t=>{var n;if(isFieldPredicate(t)){let e=null;isFieldEqualPredicate(t)?e=signalRefOrValue(t.equal):isFieldLTEPredicate(t)?e=signalRefOrValue(t.lte):isFieldLTPredicate(t)?e=signalRefOrValue(t.lt):isFieldGTPredicate(t)?e=signalRefOrValue(t.gt):isFieldGTEPredicate(t)?e=signalRefOrValue(t.gte):isFieldRangePredicate(t)?e=t.range[0]:isFieldOneOfPredicate(t)&&(e=(null!=(n=t.oneOf)?n:t.in)[0]),e&&(isDateTime(e)?r[t.field]="date":isNumber(e)?r[t.field]="number":isString(e)&&(r[t.field]="string")),t.timeUnit&&(r[t.field]="date")}}),r}function getImplicitFromEncoding(n){const t={};function add(e){isFieldOrDatumDefForTimeFormat(e)?t[e.field]="date":"quantitative"===e.type&&function isMinMaxOp(e){return isString(e)&&util_contains(["min","max"],e)}(e.aggregate)?t[e.field]="number":1{isTypedFieldDef(e)?add(e):(t=getMainRangeChannel(t),t=n.fieldDef(t),add(Object.assign(Object.assign({},e),{type:t.type})))}),isUnitModel(n)&&({mark:i,markDef:e,encoding:r}=n,!isPathMark(i)||n.encoding.order||!isFieldDef(i=r["horizontal"===e.orient?"y":"x"])||"quantitative"!==i.type||i.field in t||(t[i.field]="number")),t}class formatparse_ParseNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this._parse=t}clone(){return new formatparse_ParseNode(null,g(this._parse))}hash(){return"Parse "+hash(this._parse)}static makeExplicit(e,t,n){let r={};t=t.data;return!isGenerator(t)&&t&&t.format&&t.format.parse&&(r=t.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const l of y(n)){var i=r.getWithExplicit(l);void 0!==i.value&&(i.explicit||i.value===n[l]||"derived"===i.value||"flatten"===n[l]?delete n[l]:warn(x.differentParse(l,n[l],i.value)))}for(const c of y(t)){var o=r.get(c);void 0!==o&&(o===t[c]?delete t[c]:warn(x.differentParse(c,t[c],o)))}const a=new split_Split(t,n),s=(r.copyAll(a),{});for(const g of y(a.combine())){var A=a.get(g);null!==A&&(s[g]=A)}return 0===y(s).length||r.parseNothing?null:new formatparse_ParseNode(e,s)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const n of y(this._parse)){var t=this._parse[n];1===accessPathDepth(n)&&(e[n]=t)}return e}producedFields(){return new Set(y(this._parse))}dependentFields(){return new Set(y(this._parse))}assembleTransforms(t=!1){return y(this._parse).filter(e=>!t||1{var t=function formatparse_parseExpression(e,t){return e=accessPathWithDatum(e),"number"===t?`toNumber(${e})`:"boolean"===t?`toBoolean(${e})`:"string"===t?`toString(${e})`:"date"===t?`toDate(${e})`:"flatten"===t?e:0===t.indexOf("date:")?`timeParse(${e},'${unquote(t.slice(5,t.length))}')`:0===t.indexOf("utc:")?`utcParse(${e},'${unquote(t.slice(4,t.length))}')`:(warn(x.unrecognizedParse(t)),null)}(e,this._parse[e]);return t?{type:"formula",expr:t,as:removePathFromField(e)}:null}).filter(e=>null!==e)}}class identifier_IdentifierNode extends dataflow_DataFlowNode{clone(){return new identifier_IdentifierNode(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([bn])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:bn}}}class graticule_GraticuleNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.params=t}clone(){return new graticule_GraticuleNode(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule "+hash(this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class sequence_SequenceNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.params=t}clone(){return new sequence_SequenceNode(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!=(e=this.params.as)?e:"data"])}hash(){return"Hash "+hash(this.params)}assemble(){return Object.assign({type:"sequence"},this.params)}}class source_SourceNode extends dataflow_DataFlowNode{constructor(t){super(null);let n;if(isGenerator(t=null!=t?t:{name:"source"})||(n=t.format?Object.assign({},omit(t.format,["parse"])):{}),"values"in t)this._data={values:t.values};else if("url"in t){if(this._data={url:t.url},!n.type){let e=/(?:\.([^.]+))?$/.exec(t.url)[1];util_contains(["json","csv","tsv","dsv","topojson"],e)||(e="json"),n.type=e}}else"sphere"in t?this._data={values:[{type:"Sphere"}]}:(isNamedData(t)||isGenerator(t))&&(this._data={});this._generator=isGenerator(t),t.name&&(this._name=t.name),n&&!isEmpty(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var ti,ni=function(e,t,n){if(t.has(e))return t.set(e,n),n;throw new TypeError("attempted to set private field on non-instance")},ri=function(e,t){if(t.has(e))return t.get(e);throw new TypeError("attempted to get private field on non-instance")};function isDataSourceNode(e){return e instanceof source_SourceNode||e instanceof graticule_GraticuleNode||e instanceof sequence_SequenceNode}class Optimizer{constructor(){ti.set(this,void 0),ni(this,ti,!1)}setModified(){ni(this,ti,!0)}get modifiedFlag(){return ri(this,ti)}}ti=new WeakMap;class BottomUpOptimizer extends Optimizer{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=this.getNodeDepths(e,0,new Map);for(const n of[...t.entries()].sort((e,t)=>t[1]-e[1]))this.run(n[0]);return this.modifiedFlag}}class TopDownOptimizer extends Optimizer{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class optimizers_MergeIdenticalNodes extends TopDownOptimizer{mergeNodes(e,t){var n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(t){var n=t.children.map(e=>e.hash());const r={};for(let e=0;ee instanceof formatparse_ParseNode);if(1e instanceof timeunit_TimeUnitNode),n=t.pop();for(const r of t)this.setModified(),n.merge(r)}}class optimizers_MergeAggregates extends BottomUpOptimizer{run(e){const t={};for(const r of e.children.filter(e=>e instanceof aggregate_AggregateNode)){var n=hash(r.groupBy);n in t||(t[n]=[]),t[n].push(r)}for(const i of y(t)){const o=t[i];if(1e instanceof dataflow_OutputNode);if(t&&!(n.numChildren()<=1)){const i=[];let t;for(const o of e)if(o instanceof dataflow_OutputNode){let e=o;for(;1===e.numChildren();){var[r]=e.children;if(!(r instanceof dataflow_OutputNode))break;e=r}i.push(...e.children),t?(n.removeChild(o),o.parent=t.parent,t.parent.removeChild(t),t.parent=e,this.setModified()):t=e}else i.push(o);if(i.length){this.setModified();for(const a of i)a.parent.removeChild(a),a.parent=t}}}}class joinaggregate_JoinAggregateTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new joinaggregate_JoinAggregateTransformNode(null,g(this.transform))}addDimensions(e){this.transform.groupby=unique(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(e=>e.field).filter(e=>void 0!==e).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!=(t=e.as)?t:vgField(e)}hash(){return"JoinAggregateTransform "+hash(this.transform)}assemble(){const e=[],t=[],n=[];for(const i of this.transform.joinaggregate)t.push(i.op),n.push(this.getDefaultName(i)),e.push(void 0===i.field?null:i.field);var r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==r?{groupby:r}:{})}}class stack_StackNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this._stack=t}clone(){return new stack_StackNode(null,g(this._stack))}static makeFromTransform(e,t){var{stack:n,groupby:r,as:i,offset:o="zero"}=t;const a=[],s=[];if(void 0!==t.sort)for(const c of t.sort)a.push(c.field),s.push(getFirstDefined(c.order,"ascending"));var A={field:a,order:s};let l;return l=function isValidAsArray(e){return R(e)&&e.every(e=>isString(e))&&1{t=vgField(t.fieldDef);return t&&e.push(t),e},[])}(t);r=t.encoding.order;let c;return c=R(r)||isFieldDef(r)?sortParams(r):l.reduce((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e),{field:[],order:[]}),new stack_StackNode(e,{dimensionFieldDef:A,stackField:t.vgField(o),facetby:[],stackby:l,sort:c,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return"Stack "+hash(this._stack)}getGroupbyFields(){var{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[vgField(e,{binSuffix:"mid"})]:[vgField(e,{}),vgField(e,{binSuffix:"end"})]:[vgField(e)]:null!=n?n:[]}assemble(){const e=[];var t,{facetby:n,dimensionFieldDef:r,stackField:i,stackby:o,sort:a,offset:s,impute:A,as:l}=this._stack;return A&&r&&({band:A=.5,bin:t}=r,t&&e.push({type:"formula",expr:A+"*"+vgField(r,{expr:"datum"})+`+${1-A}*`+vgField(r,{expr:"datum",binSuffix:"end"}),as:vgField(r,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:i,groupby:[...o,...n],key:vgField(r,{binSuffix:"mid"}),method:"value",value:0})),e.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:a,as:l,offset:s}),e}}class window_WindowTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new window_WindowTransformNode(null,g(this.transform))}addDimensions(e){this.transform.groupby=unique(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e;const t=new Set;return(null!=(e=this.transform.groupby)?e:[]).forEach(t.add,t),(null!=(e=this.transform.sort)?e:[]).forEach(e=>t.add(e.field)),this.transform.window.map(e=>e.field).filter(e=>void 0!==e).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!=(t=e.as)?t:vgField(e)}hash(){return"WindowTransform "+hash(this.transform)}assemble(){var e;const t=[],n=[],r=[],i=[];for(const g of this.transform.window)n.push(g.op),r.push(this.getDefaultName(g)),i.push(void 0===g.param?null:g.param),t.push(void 0===g.field?null:g.field);var o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every(e=>isAggregateOp(e)))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],A=[];if(void 0!==this.transform.sort)for(const u of this.transform.sort)s.push(u.field),A.push(null!=(e=u.order)?e:"ascending");var l={field:s,order:A},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:t,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function cloneSubtree(i){return function clone(e){if(e instanceof facet_FacetNode)return e.children.flatMap(clone);{const n=e.clone();var t;n instanceof dataflow_OutputNode?(t=ii+n.getSource(),n.setSource(t),i.model.component.data.outputNodes[t]=n):(n instanceof aggregate_AggregateNode||n instanceof stack_StackNode||n instanceof window_WindowTransformNode||n instanceof joinaggregate_JoinAggregateTransformNode)&&n.addDimensions(i.fields);for(const r of e.children.flatMap(clone))r.parent=n;return[n]}}}function moveFacetDown(e){if(e instanceof facet_FacetNode)if(1!==e.numChildren()||e.children[0]instanceof dataflow_OutputNode){var t=e.model.component.data.main,n=(!function moveMainDownToFacet(e){if(e instanceof dataflow_OutputNode&&e.type===d.Main&&1===e.numChildren()){const t=e.children[0];t instanceof facet_FacetNode||(t.swapWithParent(),moveMainDownToFacet(e))}}(t),cloneSubtree(e));for(const r of e.children.map(n).flat())r.parent=t}else{const i=e.children[0];(i instanceof aggregate_AggregateNode||i instanceof stack_StackNode||i instanceof window_WindowTransformNode||i instanceof joinaggregate_JoinAggregateTransformNode)&&i.addDimensions(e.fields),i.swapWithParent(),moveFacetDown(e)}else e.children.map(moveFacetDown)}const ii="scale_",oi=5;function checkLinks(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return;if(!checkLinks(t.children))return}return 1}function runOptimizer(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function optimizationDataflowHelper(e,t,n){let r=e.sources,i=!1;return i=runOptimizer(new optimizers_RemoveUnnecessaryOutputNodes,r)||i,i=runOptimizer(new optimizers_RemoveUnnecessaryIdentifierNodes(t),r)||i,r=r.filter(e=>00e(t))}}var ai=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{return{signal:`{data: ${valueExpr(e,{timeUnit:n,type:t})}}`}})}(e,t,n):[e]}function parseSingleChannelDomain(e,t,n,r){var i=n["encoding"],i=getFieldOrDatumDef(i[r]),o=i["type"],a=i.timeUnit;if(function isDomainUnionWith(e){return e&&e.unionWith}(t))return s=parseSingleChannelDomain(e,void 0,n,r),A=convertDomainIfItIsDateTime(t.unionWith,o,a),makeExplicit([...s.value,...A]);if(isSignalRef(t))return makeExplicit([t]);if(t&&"unaggregated"!==t&&!isSelectionDomain(t))return makeExplicit(convertDomainIfItIsDateTime(t,o,a));var s=n.stack;if(s&&r===s.fieldChannel){if("normalize"===s.offset)return makeImplicit([[0,1]]);var A=n.requestDataName(d.Main);return makeImplicit([{data:A,field:n.vgField(r,{suffix:"start"})},{data:A,field:n.vgField(r,{suffix:"end"})}])}s=isScaleChannel(r)&&isFieldDef(i)?function domainSort(e,t,n){if(!hasDiscreteDomain(n))return;var n=e.fieldDef(t),r=n.sort;if(isSortArray(r))return{op:"min",field:sortArrayIndexField(n,t),order:"ascending"};const i=e["stack"],o=i?[...i.groupbyField?[i.groupbyField]:[],...i.stackBy.map(e=>e.fieldDef.field)]:void 0;{if(isSortField(r))return n=i&&!util_contains(o,r.field),normalizeSortField(r,n);if(isSortByEncoding(r)){var{encoding:n,order:a}=r,n=e.fieldDef(n),{aggregate:s,field:A}=n,l=i&&!util_contains(o,A);if(isArgminDef(s)||isArgmaxDef(s))return normalizeSortField({field:vgField(n),order:a},l);if(isAggregateOp(s)||!s)return normalizeSortField({op:s,field:A,order:a},l)}else{if("descending"===r)return{op:"min",field:e.vgField(t),order:"descending"};if(util_contains(["ascending",void 0],r))return!0}}return}(n,r,e):void 0;if(isDatumDef(i))return makeImplicit(convertDomainIfItIsDateTime([i.datum],o,a));A=i;if("unaggregated"===t)return o=i["field"],makeImplicit([{data:a=n.requestDataName(d.Main),field:vgField({field:o,aggregate:"min"})},{data:a,field:vgField({field:o,aggregate:"max"})}]);if(isBinning(A.bin)){if(hasDiscreteDomain(e))return makeImplicit("bin-ordinal"===e?[]:[{data:util_isBoolean(s)?n.requestDataName(d.Main):n.requestDataName(d.Raw),field:n.vgField(r,binRequiresRange(A,r)?{binSuffix:"range"}:{}),sort:!0!==s&&isObject(s)?s:{field:n.vgField(r,{}),op:"min"}}]);t=A["bin"];if(isBinning(t)){const l=getBinSignalName(n,A.field,t);return makeImplicit([new SignalRefWrapper(()=>{var e=n.getSignalName(l);return`[${e}.start, ${e}.stop]`})])}return makeImplicit([{data:n.requestDataName(d.Main),field:n.vgField(r,{})}])}return A.timeUnit&&util_contains(["time","utc"],e)&&hasBand(r,A,isUnitModel(n)?n.encoding[getSecondaryRangeChannel(r)]:void 0,n.stack,n.markDef,n.config)?makeImplicit([{data:i=n.requestDataName(d.Main),field:n.vgField(r)},{data:i,field:n.vgField(r,{suffix:"end"})}]):makeImplicit(s?[{data:util_isBoolean(s)?n.requestDataName(d.Main):n.requestDataName(d.Raw),field:n.vgField(r),sort:s}]:[{data:n.requestDataName(d.Main),field:n.vgField(r)}])}function normalizeSortField(e,t){var{op:e,field:n,order:r}=e;return Object.assign(Object.assign({op:null!=e?e:t?"sum":Yt},n?{field:replacePathInField(n)}:{}),r?{order:r}:{})}function canUseUnaggregatedDomain(e,t){var{aggregate:n,type:r}=e;return n?isString(n)&&!T[n]?{valid:!1,reason:x.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:x.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:x.unaggregateDomainHasNoEffectForRawField(e)}}function domainsTieBreaker(e,t,n,r){return e.explicit&&t.explicit&&warn(x.mergeConflictingDomainProperty(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function getFieldFromDomain(t){if(isDataRefDomain(t)&&isString(t.field))return t.field;if(function isDataRefUnionedDomain(e){return!R(e)&&("fields"in e&&!("data"in e))}(t)){let e;for(const n of t.fields)if(isDataRefDomain(n)&&isString(n.field))if(e){if(e!==n.field)return warn(x.FACETED_INDEPENDENT_DIFFERENT_SOURCES),e}else e=n.field;return warn(x.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES),e}return function isFieldRefUnionDomain(e){return!R(e)&&("fields"in e&&"data"in e)}(t)?(warn(x.FACETED_INDEPENDENT_SAME_SOURCE),isString(t=t.fields[0])?t:void 0):void 0}function assembleDomain(t,e){const n=t.component.scales[e];return function mergeDomains(t){const n=unique(t.map(e=>{var t;return isDataRefDomain(e)?(t=e["sort"],ai(e,["sort"])):e}),hash),r=unique(t.map(e=>{if(isDataRefDomain(e)){const t=e.sort;return void 0===t||util_isBoolean(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(e=>void 0!==e),hash);if(0!==n.length){if(1===n.length){var i=t[0];if(isDataRefDomain(i)&&0util_isBoolean(e)||!("op"in e)||isString(e.op)&&e.op in G?e:(warn(x.domainSortDropped(e)),!0)),hash);let e;1===o.length?e=o[0]:1isDataRefDomain(e)?e.data:null),e=>e);return 1===i.length&&null!==i[0]?Object.assign({data:i[0],fields:n.map(e=>e.field)},e?{sort:e}:{}):Object.assign({fields:n},e?{sort:e}:{})}}(n.get("domains").map(e=>(isDataRefDomain(e)&&(e.data=t.lookupDataSource(e.data)),e)))}var si=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{const n=c.component.scales[t];if(n.merged)return e;var r=n.combine(),{name:i,type:o,selectionExtent:a,reverse:s}=r,A=si(r,["name","type","selectionExtent","domains","range","reverse"]),r=function assembleScaleRange(e,t,n,r){if(isXorY(n)){if(e.step)return{step:{signal:t+"_step"}}}else if(isObject(e)&&isDataRefDomain(e))return Object.assign(Object.assign({},e),{data:r.lookupDataSource(e.data)});return e}(r.range,i,t,c);let l;a&&(l=function assembleSelectionScaleDomain(e,t){var n=t.selection;return{signal:parseSelectionBinExtent(e.getSelectionComponent(n,varName(n)),t)}}(c,a));a=assembleDomain(c,t);return e.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:i,type:o},a?{domain:a}:{}),l?{domainRaw:l}:{}),{range:r}),void 0!==s?{reverse:s}:{}),A)),e},[])}class component_ScaleComponent extends split_Split{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||some(this.get("domains"),e=>R(e)&&2===e.length&&e[0]<=0&&0<=e[1])}}const Ai=["range","scheme"];function range_getSizeChannel(e){return"x"===e?"width":"y"===e?"height":void 0}function parseUnitScaleRange(e){var t,n=e.component.scales;for(const r of De){const i=n[r];i&&(t=function parseRangeForChannel(e,r){const t=r.specifiedScales[e],n=r["size"],i=r.getScaleComponent(e),o=i.get("type");for(const g of Ai)if(void 0!==t[g]){var a=scaleTypeSupportProperty(o,g),s=channelScalePropertyIncompatability(e,g);if(a)if(s)warn(s);else switch(g){case"range":{const u=t.range;if(R(u)){if(isXorY(e))return makeExplicit(u.map(e=>{var t,n;return"width"===e||"height"===e?(t=r.getName(e),n=r.getSignalName.bind(r),SignalRefWrapper.fromName(n,t)):e}))}else if(isObject(u))return makeExplicit({data:r.requestDataName(d.Main),field:u.field,sort:{op:"min",field:r.vgField(e)}});return makeExplicit(u)}case"scheme":return makeExplicit(function parseScheme(e){if(function isExtendedScheme(e){return!isString(e)&&e.name}(e))return Object.assign({scheme:e.name},omit(e,["name"]));return{scheme:e}}(t[g]))}else warn(x.scalePropertyNotWorkWithScaleType(o,g,e))}if(e===b||e===h){var A=e===b?"width":"height",l=n[A];if(isStep(l)){if(hasDiscreteDomain(o))return makeExplicit({step:l.step});warn(x.stepDropped(A))}}var{rangeMin:l,rangeMax:A}=t,c=function defaultRange(e,t){const{size:n,config:r,mark:i,encoding:o}=t,a=t.getSignalName.bind(t),s=getFieldOrDatumDef(o[e])["type"],A=t.getScaleComponent(e),l=A.get("type"),{domain:c,domainMid:g}=t.specifiedScales[e];switch(e){case b:case h:if(util_contains(["point","band"],l))if(e!==b||n.width){if(e===h&&!n.height){var u=getViewConfigDiscreteSize(r.view,"height");if(isStep(u))return u}}else{u=getViewConfigDiscreteSize(r.view,"width");if(isStep(u))return u}u=range_getSizeChannel(e),u=t.getName(u);return e===h&&hasContinuousDomain(l)?[SignalRefWrapper.fromName(a,u),0]:[0,SignalRefWrapper.fromName(a,u)];case te:var u=t.component.scales[e].get("zero"),u=function sizeRangeMin(e,t,n){if(t)return isSignalRef(t)?{signal:t.signal+" ? 0 : "+sizeRangeMin(e,!1,n)}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(x.incompatibleChannel("size",e))}(i,u,r),d=function sizeRangeMax(e,t,n,r){var i={x:getBinStepSignal(n,"x"),y:getBinStepSignal(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const o=minXYStep(t,i,r.view);return isNumber(o)?o-1:new SignalRefWrapper(()=>o.signal+" - 1")}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const a=minXYStep(t,i,r.view);return isNumber(a)?Math.pow(li*a,2):new SignalRefWrapper(()=>`pow(${li} * ${a.signal}, 2)`)}}throw new Error(x.incompatibleChannel("size",e))}(i,n,t,r);return isContinuousToDiscrete(l)?function interpolateRange(r,i,o){var e=()=>{var e=signalOrStringValue(i),t=signalOrStringValue(r),n=`(${e} - ${t}) / (${o} - 1)`;return`sequence(${t}, ${e} + ${n}, ${n})`};return isSignalRef(i)?new SignalRefWrapper(e):{signal:e()}}(u,d,function defaultContinuousToDiscreteCount(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&R(n)?n.length+1:(warn(x.domainRequiredForThresholdScale(r)),3)}}(l,r,c,e)):[u,d];case W:return[0,2*Math.PI];case ne:return[0,360];case V:return[0,new SignalRefWrapper(()=>{return`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`})];case ae:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case se:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case ee:return"symbol";case K:case X:case q:return"ordinal"===l?"nominal"===s?"category":"ordinal":void 0!==g?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case re:case ie:case oe:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel "+e)}(e,r);return void 0===l&&void 0===A||!scaleTypeSupportProperty(o,"rangeMin")||!R(c)||2!==c.length?makeImplicit(c):makeExplicit([null!=l?l:c[0],null!=A?A:c[1]])}(r,e),i.setWithExplicit("range",t))}}function getBinStepSignal(t,e){var n=t.fieldDef(e);if(n&&n.bin&&isBinning(n.bin)){const r=getBinSignalName(t,n.field,n.bin);n=range_getSizeChannel(e);const i=t.getName(n);return new SignalRefWrapper(()=>{var e=t.getSignalName(r),e=`(${e}.stop - ${e}.start) / ${e}.step`;return t.getSignalName(i)+` / (${e})`})}}const li=.95;function minXYStep(e,t,n){const r=isStep(e.width)?e.width.step:getViewConfigDiscreteStep(n,"width"),i=isStep(e.height)?e.height.step:getViewConfigDiscreteStep(n,"height");return t.x||t.y?new SignalRefWrapper(()=>{const e=[t.x?t.x.signal:r,t.y?t.y.signal:i];return`min(${e.join(", ")})`}):Math.min(r,i)}function parseScaleProperty(e,t){(isUnitModel(e)?function parseUnitScaleProperty(e,t){var n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const I of y(n)){var s=a[I];const C=n[I],m=e.getScaleComponent(I);var A=getFieldOrDatumDef(i[I]),l=s[t],c=m.get("type"),g=m.get("padding"),u=m.get("paddingInner"),d=scaleTypeSupportProperty(c,t),h=channelScalePropertyIncompatability(I,t);if(void 0!==l&&(d?h&&warn(h):warn(x.scalePropertyNotWorkWithScaleType(c,t,I))),d&&void 0===h)if(void 0!==l){var p=A.timeUnit,f=A.type;switch(t){case"domainMax":case"domainMin":isDateTime(s[t])||"temporal"===f||p?C.set(t,{signal:valueExpr(s[t],{type:f,timeUnit:p})},!0):C.set(t,s[t],!0);break;default:C.copyKeyFromObject(t,s)}}else{d=t in ci?ci[t]({model:e,channel:I,fieldOrDatumDef:A,scaleType:c,scalePadding:g,scalePaddingInner:u,domain:s.domain,markDef:o,config:r}):r.scale[t];void 0!==d&&C.set(t,d,!1)}}}:parseNonUnitScaleProperty)(e,t)}const ci={bins:({model:e,fieldOrDatumDef:t})=>isFieldDef(t)?function properties_bins(e,t){var n=t.bin;{if(isBinning(n)){const r=getBinSignalName(e,t.field,n);return new SignalRefWrapper(()=>e.getSignalName(r))}if(isBinned(n)&&isBinParams(n)&&void 0!==n.step)return{step:n.step}}return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function properties_interpolate(e,t){if(util_contains([K,X,q],e)&&"nominal"!==t)return"hcl";return}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function nice(e,t,n){if(null!=(n=getFieldDef(n))&&n.bin||util_contains([It.TIME,It.UTC],e))return;return t in we||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function properties_padding(e,t,n,r,i,o){if(e in we){if(isContinuousToContinuous(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;var{type:i,orient:a}=i;if("bar"===i&&(!isFieldDef(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===It.POINT)return n.pointPadding}return}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:r})=>function properties_paddingInner(e,t,n,r){if(void 0!==e)return;if(t in we)return{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r}=r,getFirstDefined(e,"bar"===n?t:r);return}(e,t,n.type,r.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function properties_paddingOuter(e,t,n,r,i,o){if(void 0!==e)return;if(t in we)if(n===It.BAND)return e=o["bandPaddingOuter"],getFirstDefined(e,isSignalRef(i)?{signal:i.signal+"/2"}:i/2);return}(e,t,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{return function properties_reverse(e,t,n,r){if("x"===n&&void 0!==r.xReverse)return hasContinuousDomain(e)&&"descending"===t?isSignalRef(r.xReverse)?{signal:"!"+r.xReverse.signal}:!r.xReverse:r.xReverse;if(hasContinuousDomain(e)&&"descending"===t)return!0;return}(t,isFieldDef(e)?e.sort:void 0,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i})=>function properties_zero(e,t,n,r,i){var o=!!n&&"unaggregated"!==n;if(o&&hasContinuousDomain(i)){if(R(n)){o=n[0],n=n[n.length-1];if(o<=0&&0<=n)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!isContinuousToDiscrete(i))return!0;if(isFieldDef(t)&&t.bin||!util_contains([...Se,...xe],e))return!1;{var{orient:o,type:n}=r;return util_contains(["bar","area","line","trail"],n)&&("horizontal"===o&&"y"===e||"vertical"===o&&"x"===e)?!1:!0}}(e,t,n,r,i)};function parseScaleRange(e){isUnitModel(e)?parseUnitScaleRange(e):parseNonUnitScaleProperty(e,"range")}function parseNonUnitScaleProperty(t,n){const r=t.component.scales;for(const e of t.children)"range"===n?parseScaleRange(e):parseScaleProperty(e,n);for(const o of y(r)){let e;for(const a of t.children){const s=a.component.scales[o];var i;s&&(i=s.getWithExplicit(n),e=mergeValuesWithExplicit(e,i,n,"scale",tieBreakByComparing((e,t)=>"range"===n&&(e.step&&t.step)?e.step-t.step:0)))}r[o].setWithExplicit(n,e)}}function type_scaleType(e,t,n,r){r=function type_defaultType(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(isColorChannel(e)||"discrete"===rangeType(e))return"shape"===e&&"ordinal"===t.type&&warn(x.discreteChannelCannotEncode(e,"ordinal")),"ordinal";if(e in we){if(util_contains(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in _e)return"band";return void 0!==t.band||isPositionFieldOrDatumDef(t)&&null!=(r=t.axis)&&r.tickBand?"band":"point";case"temporal":return isColorChannel(e)?"time":"discrete"===rangeType(e)?(warn(x.discreteChannelCannotEncode(e,"temporal")),"ordinal"):isFieldDef(t)&&t.timeUnit&&normalizeTimeUnit(t.timeUnit).utc?"utc":"time";case"quantitative":return isColorChannel(e)?isFieldDef(t)&&isBinning(t.bin)?"bin-ordinal":"linear":"discrete"===rangeType(e)?(warn(x.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(x.invalidFieldType(t.type))}(t,n,r),e=e.type;return isScaleChannel(t)?void 0!==e?function channelSupportScaleType(e,t){if(isScaleChannel(e))switch(e){case b:case h:case W:case V:return isContinuousToContinuous(t)||util_contains(["band","point"],t);case te:case ae:case re:case ie:case oe:case ne:return isContinuousToContinuous(t)||isContinuousToDiscrete(t)||util_contains(["band","point","ordinal"],t);case K:case X:case q:return"band"!==t;case se:return"ordinal"===t||isContinuousToDiscrete(t);case ee:return"ordinal"===t}}(t,e)?isFieldDef(n)&&!function scaleTypeSupportDataType(e,t){return util_contains([dt,pt],t)?void 0===e||hasDiscreteDomain(e):t===ht?util_contains([It.TIME,It.UTC,void 0],e):t!==ut||util_contains([It.LOG,It.POW,It.SQRT,It.SYMLOG,It.QUANTILE,It.QUANTIZE,It.THRESHOLD,It.LINEAR,void 0],e)}(e,n.type)?(warn(x.scaleTypeNotWorkWithFieldDef(e,r)),r):e:(warn(x.scaleTypeNotWorkWithChannel(t,e,r)),r):r:null}function parseScaleCore(e){isUnitModel(e)?e.component.scales=function parseUnitScaleCore(i){const{encoding:o,mark:a}=i;return De.reduce((e,t)=>{var n=getFieldOrDatumDef(o[t]);if(n&&a===Lt&&t===ee&&n.type===ft)return e;let r=n&&n.scale;return n&&null!==r&&!1!==r&&(n=type_scaleType(r=null!==r&&void 0!==r?r:{},t,n,a),e[t]=new component_ScaleComponent(i.scaleName(t+"",!0),{value:n,explicit:r.type===n})),e},{})}(e):e.component.scales=function parseNonUnitScaleCore(e){const t=e.component.scales={},n={},r=e.component.resolve;for(const A of e.children){parseScaleCore(A);for(const l of y(A.component.scales)){var i,o;r.scale[l]=null!=(i=r.scale[l])?i:function defaultScaleResolve(e,t){if(isLayerModel(t)||isFacetModel(t))return"shared";if(isConcatModel(t))return isXorY(e)?"independent":"shared";throw new Error("invalid model type for resolve")}(l,e),"shared"===r.scale[l]&&(i=n[l],o=A.component.scales[l].getWithExplicit("type"),i?!function scaleCompatible(e,t){return e=Ct[e],t=Ct[t],e===t||"ordinal-position"===e&&"time"===t||"ordinal-position"===t&&"time"===e}(i.value,o.value)?(r.scale[l]="independent",delete n[l]):n[l]=mergeValuesWithExplicit(i,o,"type","scale",gi):n[l]=o)}}for(const c of y(n)){var a=e.scaleName(c,!0),s=n[c];t[c]=new component_ScaleComponent(a,s);for(const g of e.children){const u=g.component.scales[c];u&&(g.renameScale(u.get("name"),a),u.merged=!0)}}return t}(e)}const gi=tieBreakByComparing((e,t)=>scaleTypePrecedence(e)-scaleTypePrecedence(t));var ui=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=replaceExprRefInIndex(a),this.name=null!=(a=e.name)?a:r,this.title=isText(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new NameMap,this.projectionNameMap=n?n.projectionNameMap:new NameMap,this.signalNameMap=n?n.signalNameMap:new NameMap,this.data=e.data,this.description=e.description,this.transforms=normalizeTransform(null!=(a=e.transform)?a:[]),this.layout="layer"===t||"unit"===t?{}:function extractCompositionLayout(e,t,n){var r;const i={};var o,{spacing:a,columns:n}=n[t];void 0!==a&&(i.spacing=a),void 0!==n&&("facet"in e&&!isFacetMapping(e.facet)||"concat"in e)&&(i.columns=n),"vconcat"in e&&(i.columns=1);for(const s of En)void 0!==e[s]&&("spacing"===s?(o=e[s],i[s]=isNumber(o)?o:{row:null!=(r=o.row)?r:a,column:null!=(r=o.column)?r:a}):i[s]=e[s]);return i}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:"facet"in e||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new split_Split,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?g(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){var t=y(e);const n={text:signalRefOrValue(e.text)};for(const r of t)n[r]=signalRefOrValue(e[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function parseScales(e,{ignoreRange:t}={}){parseScaleCore(e),parseScaleDomain(e);for(const n of wt)parseScaleProperty(e,n);t||parseScaleRange(e)}(this)}parseProjection(){parseProjection(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){parseLegend(this)}assembleGroupStyle(){var e;if("unit"===this.type||"layer"===this.type)return null!=(e=null==(e=this.view)?void 0:e.style)?e:"cell"}assembleEncodeFromView(e){var{}=e,t=ui(e,["style"]);const n={};for(const i of y(t)){var r=t[i];void 0!==r&&(n[i]=signalOrValueRef(r))}return n}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=signalOrValueRef(this.description)),"unit"!==this.type&&"layer"!==this.type)?isEmpty(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!==t&&void 0!==t?t:{})}assembleLayout(){var e,t,n,r;if(this.layout)return t=this.layout,{spacing:e}=t,t=ui(t,["spacing"]),{component:r,config:n}=this,r=assembleLayoutTitleBand(r.layoutHeaders,n),Object.assign(Object.assign(Object.assign({padding:e},this.assembleDefaultLayout()),t),r?{titleBand:r}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){var e=this.component["layoutHeaders"];let t=[];for(const n of me)e[n].title&&t.push(function assembleTitleGroup(e,t){var n=e.component.layoutHeaders[t].title,r=e.config||void 0,{titleAnchor:i,titleAngle:o,titleOrient:a}=getHeaderProperties(["titleAnchor","titleAngle","titleOrient"],(e=e.component.layoutHeaders[t].facetFieldDef||void 0).header,r,t),a=getHeaderChannel(t,a),o=normalizeAngle(o);return{name:t+"-title",type:"group",role:a+"-title",title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),defaultHeaderGuideBaseline(o,a)),defaultHeaderGuideAlign(a,o,i)),assembleHeaderProperties(r,e,t,fn,hn))}}(this,n));for(const r of jr)t=t.concat(assembleHeaderGroups(this,r));return t}assembleAxes(){return function assembleAxes(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(e=>assembleAxis(e,"grid",t)),...r.map(e=>assembleAxis(e,"grid",t)),...n.map(e=>assembleAxis(e,"main",t)),...r.map(e=>assembleAxis(e,"main",t))].filter(e=>e)}(this.component.axes,this.config)}assembleLegends(){return assembleLegends(this)}assembleProjections(){return assembleProjections(this)}assembleTitle(){var e=null!=(e=this.title)?e:{},t=e["encoding"],e=ui(e,["encoding"]);const n=Object.assign(Object.assign(Object.assign({},extractTitleConfig(this.config.title).nonMark),e),t?{encode:{update:t}}:{});if(n.text)return util_contains(["unit","layer"],this.type)?util_contains(["middle",void 0],n.anchor)&&(n.frame=null!=(e=n.frame)?e:"group"):n.anchor=null!=(t=n.anchor)?t:"start",isEmpty(n)?void 0:n}assembleGroup(e=[]){const t={};0<(e=e.concat(this.assembleSignals())).length&&(t.signals=e);e=this.assembleLayout(),e&&(t.layout=e),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks()),e=!this.parent||isFacetModel(this.parent)?function assembleScales(e){return isLayerModel(e)||isConcatModel(e)?e.children.reduce((e,t)=>e.concat(assembleScales(t)),assembleScalesForModel(e)):assembleScalesForModel(e)}(this):[],0e.hasOrientSignalRef()))||(null==(e=this.component.axes.y)?void 0:e.some(e=>e.hasOrientSignalRef()))}}class model_ModelWithField extends model_Model{vgField(e,t={}){e=this.fieldDef(e);if(e)return vgField(e,t)}reduceFieldDef(r,e){return function reduce(r,i,e,o){return r?y(r).reduce((e,n)=>{const t=r[n];return R(t)?t.reduce((e,t)=>i.call(o,e,t,n),e):i.call(o,e,t,n)},e):e}(this.getMapping(),(e,t,n)=>{t=getFieldDef(t);return t?r(e,t,n):e},e)}forEachFieldDef(n,e){forEach(this.getMapping(),(e,t)=>{e=getFieldDef(e);e&&n(e,t)},e)}}var di=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{const r=isScaleChannel(n)&&i.getScaleComponent(n);return r&&hasContinuousDomain(r.get("type"))&&"count"!==t.aggregate&&!isPathMark(o)&&(e[t.field]=t),e},{});return y(r).length?new filterinvalid_FilterInvalidNode(e,r):null}dependentFields(){return new Set(y(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid "+hash(this.filter)}assemble(){const e=y(this.filter).reduce((e,t)=>{var t=this.filter[t],n=vgField(t,{expr:"datum"});return null!==t&&("temporal"===t.type?e.push(`(isDate(${n}) || (isValid(${n}) && isFinite(+${n})))`):"quantitative"===t.type&&(e.push(`isValid(${n})`),e.push(`isFinite(+${n})`))),e},[]);return 0{return null!=(t=r[t])?t:e})}clone(){return new flatten_FlattenTransformNode(this.parent,g(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform "+hash(this.transform)}assemble(){var{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class fold_FoldTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t,this.transform=g(t);t=null!=(e=this.transform.as)?e:[void 0,void 0];this.transform.as=[null!=(e=t[0])?e:"key",null!=(e=t[1])?e:"value"]}clone(){return new fold_FoldTransformNode(null,g(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform "+hash(this.transform)}assemble(){var{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class geojson_GeoJSONNode extends dataflow_DataFlowNode{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new geojson_GeoJSONNode(null,g(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const o of[[Y,j],[J,z]]){var r=o.map(e=>{e=getFieldOrDatumDef(t.encoding[e]);return isFieldDef(e)?e.field:isDatumDef(e)?{expr:""+e.datum}:isValueDef(e)?{expr:""+e.value}:void 0});(r[0]||r[1])&&(e=new geojson_GeoJSONNode(e,r,null,t.getName("geojson_"+n++)))}var i;return e=t.channelHasField(ee)&&(i=t.typedFieldDef(ee)).type===ft?new geojson_GeoJSONNode(e,null,i.field,t.getName("geojson_"+n++)):e}dependentFields(){var e=(null!=(e=this.fields)?e:[]).filter(isString);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} `+hash(this.fields)}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class geopoint_GeoPointNode extends dataflow_DataFlowNode{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new geopoint_GeoPointNode(null,this.projection,g(this.fields),g(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const i of[[Y,j],[J,z]]){var n=i.map(e=>{e=getFieldOrDatumDef(t.encoding[e]);return isFieldDef(e)?e.field:isDatumDef(e)?{expr:""+e.datum}:isValueDef(e)?{expr:""+e.value}:void 0}),r=i[0]===J?"2":"";(n[0]||n[1])&&(e=new geopoint_GeoPointNode(e,t.projectionName(),n,[t.getName("x"+r),t.getName("y"+r)]))}return e}dependentFields(){return new Set(this.fields.filter(isString))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${hash(this.fields)} `+hash(this.as)}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class impute_ImputeNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new impute_ImputeNode(null,g(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!=(e=this.transform.groupby)?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new impute_ImputeNode(e,t)}static makeFromEncoding(e,t){var n=t.encoding,r=n.x,i=n.y;if(isFieldDef(r)&&isFieldDef(i)){var o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;var i=r.impute?i:i.impute?r:void 0,{method:r,value:a,frame:s,keyvals:A}=o.impute,t=pathGroupingFields(t.mark,n);return new impute_ImputeNode(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:i.field},r?{method:r}:{}),void 0!==a?{value:a}:{}),s?{frame:s}:{}),void 0!==A?{keyvals:A}:{}),t.length?{groupby:t}:{}))}return null}hash(){return"Impute "+hash(this.transform)}assemble(){var{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,t=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:function isImputeSequence(e){return void 0!==(null==e?void 0:e.stop)}(n)?this.processSequence(n):n}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});return r&&"value"!==r?[t,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.`+e,as:e}]:[t]}}var hi=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);re)}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!=(e=this.transform.groupby)?e:[]])}hash(){return"PivotTransform "+hash(this.transform)}assemble(){var{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class sample_SampleTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new sample_SampleTransformNode(null,g(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform "+hash(this.transform)}assemble(){return{type:"sample",size:this.transform.sample}}}function makeWalkTree(a){let s=0;return function walkTree(t,n){var e;if(t instanceof source_SourceNode&&(t.isGenerator||"url"in t.data||(a.push(n),n={name:null,source:n.name,transform:[]})),t instanceof formatparse_ParseNode&&(t.parent instanceof source_SourceNode&&!n.source?(n.format=Object.assign(Object.assign({},null!=(e=n.format)?e:{}),{parse:t.assembleFormatParse()}),n.transform.push(...t.assembleTransforms(!0))):n.transform.push(...t.assembleTransforms())),t instanceof facet_FacetNode){n.name||(n.name="data_"+s++),!n.source||0this.facetSortFields(e)).flat(),order:me.map(e=>this.facetSortOrder(e)).flat()}}),0{var t=e.name,n=r.getName("lookup_"+t);r.component.data.outputNodes[n]=e.materialized=new dataflow_OutputNode(new filter_FilterNode(i,r,{selection:t}),n,d.Lookup,r.component.data.outputNodeRefCounts)})}(e,A);let l=null;return isFacetModel(e)&&(o=e.getName("facet"),t=null!=(a=function makeJoinAggregateFromFacet(t,n){var r,i,{row:n,column:o}=n;if(n&&o){let e=null;for(const a of[n,o])isSortField(a.sort)&&({field:r,op:i=Yt}=a.sort,t=e=new joinaggregate_JoinAggregateTransformNode(t,{joinaggregate:[{op:i,field:r,as:facetSortFieldName(a,a.sort,{forAs:!0})}],groupby:[vgField(a)]}));return e}return null}(t,e.facet))?a:t,l=new facet_FacetNode(t,e,o,A.getSource()),n[o]=l),Object.assign(Object.assign({},e.component.data),{outputNodes:n,outputNodeRefCounts:r,raw:s,main:A,facetRoot:l,ancestorParse:i})}class concat_ConcatModel extends model_Model{constructor(e,t,n,r){super(e,"concat",t,n,r,e.resolve),"shared"!==(null==(n=null==(t=e.resolve)?void 0:t.axis)?void 0:n.x)&&"shared"!==(null==(n=null==(t=e.resolve)?void 0:t.axis)?void 0:n.y)||warn(x.CONCAT_CANNOT_SHARE_AXIS),this.children=this.getChildren(e).map((e,t)=>buildModel(e,this,this.getName("concat_"+t),void 0,r))}parseData(){this.component.data=parseData(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of y(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return"vconcat"in e?e.vconcat:"hconcat"in e?e.hconcat:e.concat}parseLayoutSize(){parseConcatLayoutSize(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=assembleLayoutSignals(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{var t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup())})}assembleDefaultLayout(){var e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}I=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},t),{labelExpr:1,encode:1});const Ci=y(I);class component_AxisComponent extends split_Split{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new component_AxisComponent(g(this.explicit),g(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!function isFalseOrNull(e){return!1===e||null===e}(this.get(e)))}hasOrientSignalRef(){return isSignalRef(this.explicit.orient)}}function parseUnitAxes(n){return Se.reduce((e,t)=>(n.component.scales[t]&&(e[t]=[function parseAxis(r,i){let e=i.axis(r);const o=new component_AxisComponent,t=getFieldOrDatumDef(i.encoding[r]),{mark:n,config:a}=i,s=(null===e||void 0===e?void 0:e.orient)||(null==(g=a["x"===r?"axisX":"axisY"])?void 0:g.orient)||(null==(g=a.axis)?void 0:g.orient)||function defaultOrient(e){return"x"===e?"bottom":"left"}(r),A=i.getScaleComponent(r).get("type"),l=getAxisConfigs(r,A,s,i.config),c=void 0!==e?!e:getAxisConfig("disable",a.style,null===e||void 0===e?void 0:e.style,l).configValue;if(o.set("disable",c,void 0!==e),c)return o;e=e||{};var g=function getLabelAngle(e,t,n,r,i){var o=null==t?void 0:t.labelAngle;return void 0!==o?isSignalRef(o)?o:normalizeAngle(o):void 0!==(o=getAxisConfig("labelAngle",r,null==t?void 0:t.style,i)["configValue"])?normalizeAngle(o):n!==b||!util_contains([pt,dt],e.type)||isFieldDef(e)&&e.timeUnit?void 0:270}(t,e,r,a.style,l),u={fieldOrDatumDef:t,axis:e,channel:r,model:i,scaleType:A,orient:s,labelAngle:g,mark:n,config:a};for(const B of Ci){var d,h,p,f=B in Hr?Hr[B](u):isAxisProperty(B)?e[B]:void 0,I=void 0!==f,C=function parse_isExplicit(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(isSignalRef(n.labelAngle)?n.labelAngle:normalizeAngle(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===getFieldDefTitle(r,i))return!0}return e===n[t]}(f,B,e,i,r);I&&C?o.set(B,f,C):({configValue:d=void 0,configFrom:h=void 0}=isAxisProperty(B)&&"values"!==B?getAxisConfig(B,a.style,e.style,l):{},p=void 0!==d,I&&!p?o.set(B,f,C):("vgAxisConfig"!==h||yi.has(B)&&p||isConditionalAxisValue(d)||isSignalRef(d))&&o.set(B,d,!1))}const m=null!=(g=e.encoding)?g:{},y=w.reduce((e,t)=>{if(!o.hasAxisPart(t))return e;var n=guideEncodeEntry(null!=(n=m[t])?n:{},i),n="labels"===t?function axis_encode_labels(e,t,n){var{encoding:r,config:i}=e,o=null!=(o=getFieldOrDatumDef(r[t]))?o:getFieldOrDatumDef(r[getSecondaryRangeChannel(t)]),{format:r,formatType:e}=e.axis(t)||{};return isCustomFormatType(e)?Object.assign({text:formatCustomType({fieldOrDatumDef:o,field:"datum.value",format:r,formatType:e,config:i})},n):n}(i,r,n):n;return void 0===n||isEmpty(n)||(e[t]={update:n}),e},{});isEmpty(y)||o.set("encode",y,!!e.encoding||void 0!==e.labelAngle);return o}(t,n)]),e),{})}const mi={bottom:"top",top:"bottom",left:"right",right:"left"};function parseLayerAxes(e){var t;const{axes:n,resolve:r}=e.component,i={top:0,bottom:0,right:0,left:0};for(const s of e.children){s.parseAxesAndHeaders();for(const A of y(s.component.axes))r.axis[A]=parseGuideResolve(e.component.resolve,A),"shared"===r.axis[A]&&(n[A]=function mergeAxisComponents(t,n){{if(!t)return n.map(e=>e.clone());if(t.length!==n.length)return;var r=t.length;for(let e=0;e{switch(r){case"title":return mergeTitleComponent(e,t);case"gridScale":return{explicit:e.explicit,value:getFirstDefined(e.value,t.value)}}return defaultTieBreaker(e,t,r,"axis")});e.setWithExplicit(r,n)}return e}(a,s)}}}return t}(n[A],s.component.axes[A]),n[A]||(r.axis[A]="independent",delete n[A]))}for(const l of Se){for(const c of e.children)if(c.component.axes[l]){if("independent"===r.axis[l]){n[l]=(null!=(t=n[l])?t:[]).concat(c.component.axes[l]);for(const g of c.component.axes[l]){var{value:o,explicit:a}=g.getWithExplicit("orient");isSignalRef(o)||(0i[a]&&g.set("orient",a,!1)),i[o]++)}}delete c.component.axes[l]}if("independent"===r.axis[l]&&n[l]&&1Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),rectPosition(e,"radius","arc")),rectPosition(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),pointOrRangePosition("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),pointOrRangePosition("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),defined(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),rectPosition(e,"x","bar")),rectPosition(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>point_encodeEntry(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{var t=e["encoding"],t=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},t&&isFieldDef(t)&&t.type===ft?{field:vgField(t,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),rectPosition(e,"x","image")),rectPosition(e,"y","image")),text_text(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),nonPosition("size",e,{vgChannel:"strokeWidth"})),defined(e))},point:{vgMark:"symbol",encodeEntry:e=>point_encodeEntry(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),rectPosition(e,"x","rect")),rectPosition(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{var t=e["markDef"],t=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),pointOrRangePosition("x",e,{defaultPos:"horizontal"===t?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==t})),pointOrRangePosition("y",e,{defaultPos:"vertical"===t?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==t})),nonPosition("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>point_encodeEntry(e,"square")},text:{vgMark:"text",encodeEntry:e=>{var t=e["config"];return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),text_text(e)),nonPosition("size",e,{vgChannel:"fontSize"})),nonPosition("angle",e)),valueIfDefined("align",function text_align(e,t,n){e=getMarkPropOrConfig("align",e,n);if(void 0===e)return"center"}(e.markDef,0,t))),valueIfDefined("baseline",function text_baseline(e,t,n){e=getMarkPropOrConfig("baseline",e,n);if(void 0===e)return"middle"}(e.markDef,0,t))),pointPosition("radius",e,{defaultPos:null,isMidPoint:!0})),pointPosition("theta",e,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:e=>{var{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",r="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid",vgChannel:"xc"})),pointPosition("y",e,{defaultPos:"mid",vgChannel:"yc"})),nonPosition("size",e,{defaultValue:function defaultSize(e){const{config:t,markDef:n}=e,r=n["orient"],i="horizontal"===r?"width":"height",o=e.getScaleComponent("horizontal"===r?"x":"y"),a=null!=(e=getMarkPropOrConfig("size",n,t,{vgChannel:i}))?e:t.tick.bandSize;return void 0!==a?a:(e=o?o.get("range"):void 0)&&e.step&&isNumber(e.step)?3*e.step/4:3*getViewConfigDiscreteStep(t.view,i)/4}(e),vgChannel:i})),{[r]:signalOrValueRef(getMarkPropOrConfig("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),nonPosition("size",e)),defined(e))}};function parseMarkGroups(t){if(util_contains([Ft,_t,Mt],t.mark)){var e=pathGroupingFields(t.mark,t.encoding);if(0getMarkPropOrConfig(e,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return function getGroupsForStackedBarWithCornerRadius(r){const[i]=getMarkGroup(r,{fromPrefix:vi}),o=r.scaleName(r.stack.fieldChannel),a=(e={})=>r.vgField(r.stack.fieldChannel,e),e=(e,t)=>{const n=[a({prefix:"min",suffix:"start",expr:t}),a({prefix:"max",suffix:"start",expr:t}),a({prefix:"min",suffix:"end",expr:t}),a({prefix:"max",suffix:"end",expr:t})];return`${e}(${n.map(e=>`scale('${o}',${e})`).join(",")})`};let t,n;"x"===r.stack.fieldChannel?(t=Object.assign(Object.assign({},pick(i.encode.update,["y","yc","y2","height",...ct])),{x:{signal:e("min","datum")},x2:{signal:e("max","datum")},clip:{value:!0}}),n={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},i.encode.update=Object.assign(Object.assign({},omit(i.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(t=Object.assign(Object.assign({},pick(i.encode.update,["x","xc","x2","width"])),{y:{signal:e("min","datum")},y2:{signal:e("max","datum")},clip:{value:!0}}),n={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},i.encode.update=Object.assign(Object.assign({},omit(i.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const c of ct){var s=getMarkConfig(c,r.markDef,r.config);i.encode.update[c]?(t[c]=i.encode.update[c],delete i.encode.update[c]):s&&(t[c]=signalOrValueRef(s)),s&&(i.encode.update[c]={value:0})}const A=r.fieldDef(r.stack.groupbyChannel),l=vgField(A)?[vgField(A)]:[];(null!=A&&A.bin||null!=A&&A.timeUnit)&&l.push(vgField(A,{binSuffix:"end"}));(t=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((e,t)=>{var n;return i.encode.update[t]?Object.assign(Object.assign({},e),{[t]:i.encode.update[t]}):void 0!==(n=getMarkConfig(t,r.markDef,r.config))?Object.assign(Object.assign({},e),{[t]:signalOrValueRef(n)}):e},t)).stroke&&(t.strokeForeground={value:!0},t.strokeOffset={value:0});return[{type:"group",from:{facet:{data:r.requestDataName(d.Main),name:vi+r.requestDataName(d.Main),groupby:l,aggregate:{fields:[a({suffix:"start"}),a({suffix:"start"}),a({suffix:"end"}),a({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:t},marks:[{type:"group",encode:{update:n},marks:[i]}]}]}(t)}return getMarkGroup(t)}const bi="faceted_path_";const vi="stack_group_";function getMarkGroup(e,t={fromPrefix:""}){var{mark:n,markDef:r,encoding:i,config:o}=e,a=getFirstDefined(r.clip,function scaleClip(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function projectionClip(e){e=e.component.projection;return!(!e||e.isFit)||void 0}(e)),s=getStyles(r),i=i.key,A=function mark_getSort(e){var{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!R(a)&&isValueDef(a)&&isNullOrFalse(a.value)||!a&&isNullOrFalse(getMarkPropOrConfig("order",i,o))))return!R(a)&&!isFieldDef(a)||n?isPathMark(r)&&isFieldDef(n=t[o="horizontal"===i.orient?"y":"x"])?(r=n.sort,R(r)?{field:vgField(n,{prefix:o,suffix:"sort_index",expr:"datum"})}:isSortField(r)?{field:vgField({aggregate:encoding_isAggregate(e.encoding)?r.op:void 0,field:r.field},{expr:"datum"})}:isSortByEncoding(r)?{field:vgField(e.fieldDef(r.encoding),{expr:"datum"}),order:r.order}:null===r?void 0:{field:vgField(n,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}):void 0:sortParams(a,{expr:"datum"})}(e),l=function interactiveFlag(e){if(!e.component.selection)return null;var t=y(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=y(r.component.selection).length,r=r.parent;return n?{interactive:0isFieldOrDatumDef(t[e]));return e||n}scaleDomain(e){e=this.specifiedScales[e];return e?e.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,r){return De.reduce((e,t)=>{var n=getFieldOrDatumDef(r[t]);return n&&(e[t]=this.initScale(null!=(t=n.scale)?t:{})),e},{})}initScale(e){const{domain:t,range:n}=e,r=replaceExprRefInIndex(e);return R(t)&&(r.domain=t.map(signalRefOrValue)),R(n)&&(r.range=n.map(signalRefOrValue)),r}initAxes(r){return Se.reduce((e,t)=>{var n=r[t];return(isFieldOrDatumDef(n)||t===b&&isFieldOrDatumDef(r.x2)||t===h&&isFieldOrDatumDef(r.y2))&&(n=isFieldOrDatumDef(n)?n.axis:void 0,e[t]=n&&this.initAxis(Object.assign({},n))),e},{})}initAxis(e){const t={};for(const r of y(e)){var n=e[r];t[r]=(isConditionalAxisValue(n)?signalOrValueRefWithCondition:signalRefOrValue)(n)}return t}initLegends(r){return Re.reduce((e,t)=>{var n=getFieldOrDatumDef(r[t]);return n&&function supportLegend(e){switch(e){case K:case X:case q:case te:case ee:case re:case ae:case se:return 1;case ie:case oe:case ne:return}}(t)&&(n=n.legend,e[t]=n&&replaceExprRefInIndex(n)),e},{})}parseData(){this.component.data=parseData(this)}parseLayoutSize(){parseUnitLayoutSize(this)}parseSelections(){this.component.selection=function parseUnitSelection(t,n){var e;const r={};var i=t.config.selection;for(const s of y(null!=n?n:{})){const A=g(n[s]);var o=i[A.type],{}=o,a=Zr(o,["fields","encodings"]);for(const c in a)"encodings"===c&&A.fields||"fields"===c&&A.encodings||("mark"===c&&(A[c]=Object.assign(Object.assign({},a[c]),A[c])),void 0!==A[c]&&!0!==A[c]||(A[c]=null!=(e=a[c])?e:A[c]));o=varName(s);const l=r[o]=Object.assign(Object.assign({},A),{name:o,events:isString(A.on)?eventSelector(A.on,"scope"):g(A.on)});forEachTransform(l,e=>{e.has(l)&&e.parse&&e.parse(t,l,A,n[s])})}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=parseMarkGroups(this)}parseAxesAndHeaders(){this.component.axes=parseUnitAxes(this)}assembleSelectionTopLevelSignals(e){return function assembleTopLevelSignals(a,s){let A=!1;return forEachSelection(a,(t,e)=>{const n=t.name;var r,i,o=$(n+Er);0===s.filter(e=>e.name===n).length&&(r="global"===t.resolve?"union":t.resolve,i="multi"===t.type?", true)":")",s.push({name:t.name,update:Sr+`(${o}, `+$(r)+i})),A=!0,e.topLevelSignals&&(s=e.topLevelSignals(a,t,s)),forEachTransform(t,e=>{e.topLevelSignals&&(s=e.topLevelSignals(a,t,s))})}),A&&0===s.filter(e=>"unit"===e.name).length&&s.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),cleanupEmptyOnArray(s)}(this,e)}assembleSignals(){return[...assembleAxisSignals(this),...function assembleUnitSelectionSignals(i,o){return forEachSelection(i,(t,e)=>{var n=t.name;let r=e.modifyExpr(i,t);o.push(...e.signals(i,t)),forEachTransform(t,e=>{e.signals&&(o=e.signals(i,t,o)),e.modifyExpr&&(r=e.modifyExpr(i,t,r))}),o.push({name:n+"_modify",on:[{events:{signal:t.name+Qr},update:`modify(${$(t.name+Er)}, ${r})`}]})}),cleanupEmptyOnArray(o)}(this,[])]}assembleSelectionData(e){return function assembleUnitSelectionData(i,e){const o=[...e];return forEachSelection(i,t=>{const e={name:t.name+Er};if(t.init){const n=t.project.items.map(e=>{var{}=e;return yr(e,["signals"])}),r=t.init.map(e=>assembleInit(e,!1));e.values="interval"===t.type?[{unit:selection_unitName(i,{escape:!1}),fields:n,values:r}]:r.map(e=>({unit:selection_unitName(i,{escape:!1}),fields:n,values:e}))}o.filter(e=>e.name===t.name+Er).length||o.push(e)}),o}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return assembleLayoutSignals(this)}assembleMarks(){var e;let t=null!=(e=this.component.mark)?e:[];return(t=this.parent&&isLayerModel(this.parent)?t:assembleUnitSelectionMarks(this,t)).map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return channelHasField(this.encoding,e)}fieldDef(e){return getFieldDef(this.encoding[e])}typedFieldDef(e){e=this.fieldDef(e);return isTypedFieldDef(e)?e:null}}class layer_LayerModel extends model_Model{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map((e,t)=>{if("layer"in e)return new layer_LayerModel(e,this,this.getName("layer_"+t),o,i);if("mark"in e)return new unit_UnitModel(e,this,this.getName("layer_"+t),o,i);throw new Error(x.invalidSpec(e))})}parseData(){this.component.data=parseData(this);for(const e of this.children)e.parseData()}parseLayoutSize(){!function parseLayerLayoutSize(e){parseChildrenLayoutSize(e),parseNonUnitLayoutSizeForChannel(e,"width"),parseNonUnitLayoutSizeForChannel(e,"height")}(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of y(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){parseLayerAxes(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),assembleAxisSignals(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),assembleLayoutSignals(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle())return e}assembleLayout(){return null}assembleMarks(){return function assembleLayerSelectionMarks(e,t){for(const n of e.children)isUnitModel(n)&&(t=assembleUnitSelectionMarks(n,t));return t}(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),assembleLegends(this))}}function buildModel(e,t,n,r,i){if("facet"in e)return new facet_FacetModel(e,t,n,i);if("layer"in e)return new layer_LayerModel(e,t,n,r,i);if("mark"in e)return new unit_UnitModel(e,t,n,r,i);if(function isAnyConcatSpec(e){return"vconcat"in e||"hconcat"in e||"concat"in e}(e))return new concat_ConcatModel(e,t,n,i);throw new Error(x.invalidSpec(e))}var Ei=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1));var c=t["params"],g=Ei(t,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),g),a?{title:a}:{}),s?{style:s}:{}),A?{encode:{update:A}}:{}),{data:n}),0=A?w:Q).text.primary}var e=function augmentColor(e){var t=1(e instanceof r.a||(Object(D.a)("string"!=typeof e,`Shader module use by name is deprecated. Import shader module '${e}' and use it directly.`),Object(D.a)(e.name,"shader module has no name"),(e=new r.a(e)).dependencies=instantiateModules(e.dependencies)),e))}(e))}function getShaderDependencies(e){const t={},n={};return getDependencyGraph({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort((e,t)=>n[t]-n[e]).map(e=>t[e])}function getDependencyGraph({modules:e,level:t,moduleMap:n,moduleDepth:r}){if(5<=t)throw new Error("Possible loop in shader dependency graph");for(const i of e)(void 0===r[(n[i.name]=i).name]||r[i.name]{G[e]=e});const o={};function canCompileGLGSExtension(e,t,n={}){var r=i[t];if(Object(D.a)(r,t),!function isOldIE(e={}){var t="undefined"!=typeof window&&window.navigator||{};const n=e.userAgent||t.userAgent||"";return e=-1!==n.indexOf("MSIE "),t=-1!==n.indexOf("Trident/"),e||t}(n))return 1;if(t in o)return o[t];r=`#extension GL_${r[0]} : ${n.behavior||"enable"} -void main(void) {}`,n=e.createShader(35633),e.shaderSource(n,r),e.compileShader(n),r=e.getShaderParameter(n,35713);return e.deleteShader(n),o[t]=r}function getFeature(e,t){var n=i[t],t=(Object(D.a)(n,t),function isWebGL2(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}(e)&&n[1]||n[0]),n="string"==typeof t?Boolean(e.getExtension(t)):t;return Object(D.a)(!1===n||!0===n),n}function hasFeatures(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>getFeature(t,e))}var N=n(382);function testVariable(e){return new RegExp(`\\b${e}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}t=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]];const a=[...t,[testVariable("attribute"),"in $1"],[testVariable("varying"),"out $1"]],s=[...t,[testVariable("varying"),"in $1"]];t=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]];const A=[...t,[testVariable("in"),"attribute $1"],[testVariable("out"),"varying $1"]],l=[...t,[testVariable("in"),"varying $1"]],c="gl_FragColor",g=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,u=/void\s+main\s*\([^)]*\)\s*\{\n?/;function transpileShader(e,t,n){switch(t){case 300:return n?convertShader(e,a):function convertFragmentShaderTo300(e){var t=(e=convertShader(e,s)).match(g);if(t){t=t[1];e=e.replace(new RegExp(`\\b${c}\\b`,"g"),t)}else{const n="fragmentColor";e=e.replace(u,e=>`out vec4 ${n}; +function __rest(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r${n(i)}`),o&&(t+=``),Object.keys(a));if(0";for(const s of i){let e=a[s];void 0!==e&&(Object(A.H)(e)&&(e=stringify(e,r)),t+=`${n(s)}:${n(e)}`)}t+=""}return t||"{}"}return n(e)}};class Handler{constructor(e){this.options=Object.assign(Object.assign({},o),e);e=this.options.id;if(this.el=null,this.call=this.tooltipHandler.bind(this),!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const t=document.createElement("style"),n=(t.setAttribute("id",this.options.styleId),t.innerHTML=function createDefaultStyle(e){if(/^[A-Za-z]+[-:.\w]*$/.test(e))return r.toString().replace(i,e);throw new Error("Invalid HTML ID")}(e),document.head);0window.innerWidth&&(i=+e.clientX-n-t.width),e.clientY+r);return o+t.height>window.innerHeight&&(o=+e.clientY-r-t.height),{x:i,y:o}}(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY),this.el.setAttribute("style",`top: ${r}px; left: ${i}px`))}}},function(e,t,n){function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}var i,o;e.exports=(i={17:function(t,n,r){"use strict";n.__esModule=!0,n.default=void 0;var i=r(18);function e(){}e.getFirstMatch=function(e,t){t=t.match(e);return t&&0A[1][a])return 1;if(A[0][a]===A[1][a]){if(a===s)return 0;--a}else if(A[0][a]"===e[0]||"<"===e[0]?(n=e.substr(1),"="===e[1]?(r=!0,n=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?n=e.substr(1):"~"===e[0]&&(r=!0,n=e.substr(1)),-1function(e){return e[t]},l=n=>{const r=n.length;return function(t){for(let e=0;ea&&push(),i=a=s+1):"]"===A&&(i||error("Access path missing open bracket: "+e),0a?push():a=s+1);return i&&error("Access path missing closing bracket: "+e),r&&error("Access path missing closing quote: "+e),s>a&&(s++,push()),t}function vega_util_module_field(e,t,n){var r=splitAccessPath(e);return e=1===r.length?r[0]:e,accessor((n&&n.get||getter)(r),[e],t||e)}vega_util_module_field("id");const u=accessor(e=>e,[],"identity");accessor(()=>0,[],"zero"),accessor(()=>1,[],"one"),accessor(()=>!0,[],"true"),accessor(()=>!1,[],"false");function log$1(e,t,n){t=[t].concat([].slice.call(n));console[e].apply(console,t)}var R=Array.isArray;function isObject(e){return e===Object(e)}const p=e=>"__proto__"!==e;function mergeConfig(...e){return e.reduce((e,t)=>{for(const r in t){var n;"signals"===r?e.signals=function mergeNamed(e,t){if(null==e)return t;const n={},r=[];function add(e){n[e.name]||(n[e.name]=1,r.push(e))}return t.forEach(add),e.forEach(add),r}(e.signals,t.signals):(n="legend"===r?{layout:1}:"style"===r||null,writeConfig(e,r,t[r],n))}return e},{})}function writeConfig(n,r,i,o){if(p(r)){let e,t;if(isObject(i)&&!R(i))for(e in t=isObject(n[r])?n[r]:n[r]={},i)o&&(!0===o||o[e])?writeConfig(t,e,i[e]):p(e)&&(t[e]=i[e]);else n[r]=i}}function array(e){return null!=e?R(e)?e:[e]:[]}function isFunction(e){return"function"==typeof e}const f=Object.prototype.hasOwnProperty;function has(e,t){return f.call(e,t)}function isBoolean(e){return"boolean"==typeof e}function isNumber(e){return"number"==typeof e}function isString(e){return"string"==typeof e}function $(e){return R(e)?"["+e.map($)+"]":isObject(e)||isString(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function toSet(t){const n={},r=t.length;for(let e=0;eC()(e)).join(",")})`};const A=C.a;function hash(e){if(isNumber(e))return e;const t=isString(e)?e:C()(e);if(t.length<250)return t;let n=0;for(let e=0;e0===t?e:`[${e}]`);for(const o of i.map((e,t)=>i.slice(0,t+1).join("")))t.add(o)}return t}function fieldIntersection(e,t){return void 0===e||void 0===t||hasIntersection(prefixGenerator(e),prefixGenerator(t))}function isEmpty(e){return 0===y(e).length}const y=Object.keys,B=Object.values,v=Object.entries;function util_isBoolean(e){return!0===e||!1===e}function varName(e){var t=e.replace(/\W/g,"_");return(e.match(/^\d+/)?"_":"")+t}function logicalExpr(e,t){return e.not?"!("+logicalExpr(e.not,t)+")":e.and?"("+e.and.map(e=>logicalExpr(e,t)).join(") && (")+")":e.or?"("+e.or.map(e=>logicalExpr(e,t)).join(") || (")+")":t(e)}function deleteNestedProperty(e,t){if(0===t.length)return!0;var n=t.shift();return n in e&&deleteNestedProperty(e[n],t)&&delete e[n],isEmpty(e)}function titleCase(e){return e.charAt(0).toUpperCase()+e.substr(1)}function accessPathWithDatum(e,t="datum"){const n=splitAccessPath(e),r=[];for(let e=1;e<=n.length;e++){var i=`[${n.slice(0,e).map($).join("][")}]`;r.push(t+i)}return r.join(" && ")}function flatAccessWithDatum(e,t="datum"){return`${t}[${$(splitAccessPath(e).join("."))}]`}function escapePathAccess(e){return e.replace(/(\[|\]|\.|'|")/g,"\\$1")}function replacePathInField(e){return""+splitAccessPath(e).map(escapePathAccess).join("\\.")}function replaceAll(e,t,n){return e.replace(new RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"g"),n)}function removePathFromField(e){return""+splitAccessPath(e).join(".")}function accessPathDepth(e){return e?splitAccessPath(e).length:0}function getFirstDefined(...e){for(const t of e)if(void 0!==t)return t}let E=42;function uniqueId(e){var t=++E;return e?String(e)+t:t}function resetIdCounter(){E=42}function internalField(e){return isInternalField(e)?e:"__"+e}function isInternalField(e){return 0===e.indexOf("__")}function normalizeAngle(e){if(void 0!==e)return(e%360+360)%360}function isNumeric(e){return!!isNumber(e)||!isNaN(e)&&!isNaN(parseFloat(e))}const Q={labelAlign:{part:"labels",vgProp:"align"},labelBaseline:{part:"labels",vgProp:"baseline"},labelColor:{part:"labels",vgProp:"fill"},labelFont:{part:"labels",vgProp:"font"},labelFontSize:{part:"labels",vgProp:"fontSize"},labelFontStyle:{part:"labels",vgProp:"fontStyle"},labelFontWeight:{part:"labels",vgProp:"fontWeight"},labelOpacity:{part:"labels",vgProp:"opacity"},labelOffset:null,labelPadding:null,gridColor:{part:"grid",vgProp:"stroke"},gridDash:{part:"grid",vgProp:"strokeDash"},gridDashOffset:{part:"grid",vgProp:"strokeDashOffset"},gridOpacity:{part:"grid",vgProp:"opacity"},gridWidth:{part:"grid",vgProp:"strokeWidth"},tickColor:{part:"ticks",vgProp:"stroke"},tickDash:{part:"ticks",vgProp:"strokeDash"},tickDashOffset:{part:"ticks",vgProp:"strokeDashOffset"},tickOpacity:{part:"ticks",vgProp:"opacity"},tickSize:null,tickWidth:{part:"ticks",vgProp:"strokeWidth"}};function isConditionalAxisValue(e){return e&&e.condition}const w=["domain","grid","labels","ticks","title"],S={grid:"grid",gridCap:"grid",gridColor:"grid",gridDash:"grid",gridDashOffset:"grid",gridOpacity:"grid",gridScale:"grid",gridWidth:"grid",orient:"main",bandPosition:"both",aria:"main",description:"main",domain:"main",domainCap:"main",domainColor:"main",domainDash:"main",domainDashOffset:"main",domainOpacity:"main",domainWidth:"main",format:"main",formatType:"main",labelAlign:"main",labelAngle:"main",labelBaseline:"main",labelBound:"main",labelColor:"main",labelFlush:"main",labelFlushOffset:"main",labelFont:"main",labelFontSize:"main",labelFontStyle:"main",labelFontWeight:"main",labelLimit:"main",labelLineHeight:"main",labelOffset:"main",labelOpacity:"main",labelOverlap:"main",labelPadding:"main",labels:"main",labelSeparation:"main",maxExtent:"main",minExtent:"main",offset:"both",position:"main",tickCap:"main",tickColor:"main",tickDash:"main",tickDashOffset:"main",tickMinStep:"main",tickOffset:"both",tickOpacity:"main",tickRound:"both",ticks:"main",tickSize:"main",tickWidth:"both",title:"main",titleAlign:"main",titleAnchor:"main",titleAngle:"main",titleBaseline:"main",titleColor:"main",titleFont:"main",titleFontSize:"main",titleFontStyle:"main",titleFontWeight:"main",titleLimit:"main",titleLineHeight:"main",titleOpacity:"main",titlePadding:"main",titleX:"main",titleY:"main",encode:"both",scale:"both",tickBand:"both",tickCount:"both",tickExtra:"both",translate:"both",values:"both",zindex:"both"};t={orient:1,aria:1,bandPosition:1,description:1,domain:1,domainCap:1,domainColor:1,domainDash:1,domainDashOffset:1,domainOpacity:1,domainWidth:1,format:1,formatType:1,grid:1,gridCap:1,gridColor:1,gridDash:1,gridDashOffset:1,gridOpacity:1,gridWidth:1,labelAlign:1,labelAngle:1,labelBaseline:1,labelBound:1,labelColor:1,labelFlush:1,labelFlushOffset:1,labelFont:1,labelFontSize:1,labelFontStyle:1,labelFontWeight:1,labelLimit:1,labelLineHeight:1,labelOffset:1,labelOpacity:1,labelOverlap:1,labelPadding:1,labels:1,labelSeparation:1,maxExtent:1,minExtent:1,offset:1,position:1,tickBand:1,tickCap:1,tickColor:1,tickCount:1,tickDash:1,tickDashOffset:1,tickExtra:1,tickMinStep:1,tickOffset:1,tickOpacity:1,tickRound:1,ticks:1,tickSize:1,tickWidth:1,title:1,titleAlign:1,titleAnchor:1,titleAngle:1,titleBaseline:1,titleColor:1,titleFont:1,titleFontSize:1,titleFontStyle:1,titleFontWeight:1,titleLimit:1,titleLineHeight:1,titleOpacity:1,titlePadding:1,titleX:1,titleY:1,translate:1,values:1,zindex:1};const _=Object.assign(Object.assign({},t),{style:1,labelExpr:1,encoding:1});function isAxisProperty(e){return _[e]}y(_);const F=y({axis:1,axisBand:1,axisBottom:1,axisDiscrete:1,axisLeft:1,axisPoint:1,axisQuantitative:1,axisRight:1,axisTemporal:1,axisTop:1,axisX:1,axisXBand:1,axisXDiscrete:1,axisXPoint:1,axisXQuantitative:1,axisXTemporal:1,axisY:1,axisYBand:1,axisYDiscrete:1,axisYPoint:1,axisYQuantitative:1,axisYTemporal:1}),D={argmax:1,argmin:1,average:1,count:1,distinct:1,product:1,max:1,mean:1,median:1,min:1,missing:1,q1:1,q3:1,ci0:1,ci1:1,stderr:1,stdev:1,stdevp:1,sum:1,valid:1,values:1,variance:1,variancep:1},G={count:1,min:1,max:1};function isArgminDef(e){return e&&e.argmin}function isArgmaxDef(e){return e&&e.argmax}y(D);function isAggregateOp(e){return isString(e)&&!!D[e]}const N=["count","valid","missing","distinct"];function isCountingAggregateOp(e){return isString(e)&&util_contains(N,e)}const k=["count","sum","distinct","valid","missing"];const T=toSet(["mean","average","median","q1","q3","min","max"]);n=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);risSelectionExtent(t[e])?varName(`_${e}_`+v(t[e])):varName(`_${e}_`+t[e])).join("")}function isBinning(e){return!0===e||isBinParams(e)&&!e.binned}function isBinned(e){return"binned"===e||isBinParams(e)&&!0===e.binned}function isBinParams(e){return isObject(e)}function isSelectionExtent(e){return null==e?void 0:e.selection}function autoMaxBins(e){switch(e){case M:case U:case te:case K:case X:case q:case ae:case re:case ie:case oe:case ee:return 6;case se:return 4;default:return 10}}function invalidSpec(e){return`Invalid specification ${JSON.stringify(e)}. Make sure the specification includes at least one of the following properties: "mark", "layer", "facet", "hconcat", "vconcat", "concat", or "repeat".`}const ke='Autosize "fit" only works for single views and layered views.';function containerSizeNonSingle(e){return("width"==e?"Width":"Height")+' "container" only works for single views and layered views.'}function containerSizeNotCompatibleWithAutosize(e){return("width"==e?"Width":"Height")+` "container" only works well with autosize "fit" or "fit-${"width"==e?"x":"y"}".`}function droppingFit(e){return e?`Dropping "fit-${e}" because spec has discrete ${getSizeChannel(e)}.`:'Dropping "fit" because spec has discrete size.'}function unknownField(e){return`Unknown field for ${e}. Cannot calculate view size.`}function cannotProjectOnChannelWithoutField(e){return`Cannot project a selection on encoding channel "${e}", which has no field.`}function cannotProjectAggregate(e,t){return`Cannot project a selection on encoding channel "${e}" as it uses an aggregate function ("${t}").`}function nearestNotSupportForContinuous(e){return`The "nearest" transform is not supported for ${e} marks.`}function selectionNotSupported(e){return`Selection not supported for ${e} yet.`}function selectionNotFound(e){return`Cannot find a selection named "${e}".`}const Te="Scale bindings are currently only supported for scales with unbinned, continuous domains.",Me="Legend bindings are only supported for selections over an individual field or encoding channel.";function noSameUnitLookup(e){return`Cannot define and lookup the "${e}" selection in the same view. `+"Try moving the lookup into a second, layered view?"}const Ue="The same selection must be used to override scale domains in a layered view.",Oe='Interval selections should be initialized using "x" and/or "y" keys.';function noSuchRepeatedValue(e){return`Unknown repeated value "${e}".`}function columnsNotSupportByRowCol(e){return`The "columns" property cannot be used when "${e}" has nested row/column.`}const Le="Axes cannot be shared in concatenated or repeated views yet (https://github.com/vega/vega-lite/issues/2415).";function unrecognizedParse(e){return`Unrecognized parse "${e}".`}function differentParse(e,t,n){return`An ancestor parsed field "${e}" as ${n} but a child wants to parse the field as ${t}.`}const Pe="Attempt to add the same child twice.";function invalidTransformIgnored(e){return`Ignoring an invalid transform: ${A(e)}.`}const Ve='If "from.fields" is not specified, "as" has to be a string that specifies the key to be used for the data from the secondary source.';function customFormatTypeNotAllowed(e){return`Config.customFormatTypes is not true, thus custom format type and format for channel ${e} are dropped.`}function projectionOverridden(e){var{parentProjection:e,projection:t}=e;return`Layer's shared projection ${A(e)} is overridden by a child projection ${A(t)}.`}const Ze="Arc marks uses theta channel rather than angle, replacing angle with theta.";function primitiveChannelDef(e,t,n){return`Channel ${e} is a ${t}. Converted to {value: ${A(n)}}.`}function invalidFieldType(e){return`Invalid field type "${e}".`}function invalidFieldTypeForCountAggregate(e,t){return`Invalid field type "${e}" for aggregate: "${t}", using "quantitative" instead.`}function invalidAggregate(e){return`Invalid aggregation operator "${e}".`}function missingFieldType(e,t){return`Missing type for channel "${e}", using "${t}" instead.`}function droppingColor(e,t){var{fill:t,stroke:n}=t;return`Dropping color ${e} as the plot also has ${t&&n?"fill and stroke":t?"fill":"stroke"}.`}function emptyFieldDef(e,t){return`Dropping ${A(e)} from channel "${t}" since it does not contain any data field, datum, value, or signal.`}function latLongDeprecated(e,t,n){return e+`-encoding with type ${t} is deprecated. Replacing with ${n}-encoding.`}const We="Line marks cannot encode size with a non-groupby field. You may want to use trail marks instead.";function incompatibleChannel(e,t,n){return e+` dropped as it is incompatible with "${t}"${n?" when "+n:""}.`}function invalidEncodingChannel(e){return e+`-encoding is dropped as ${e} is not a valid encoding channel.`}function facetChannelShouldBeDiscrete(e){return e+" encoding should be discrete (ordinal / nominal / binned)."}function facetChannelDropped(e){return`Facet encoding dropped as ${e.join(" and ")} ${1e.substr(0,3)),nt=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],rt=nt.map(e=>e.substr(0,3));function dateTimeParts(e,t){const n=[];var r;t&&void 0!==e.day&&1n+3&&"day"===t&&"o"===e.charAt(n+3))&&!(0"+predicateValueExpr(e.gt,r);if(isFieldLTEPredicate(e))return n+"<="+predicateValueExpr(e.lte,r);if(isFieldGTEPredicate(e))return n+">="+predicateValueExpr(e.gte,r);if(isFieldOneOfPredicate(e))return`indexof([${function predicateValuesExpr(e,t){return e.map(e=>predicateValueExpr(e,t))}(e.oneOf,r).join(",")}], ${n}) !== -1`;if(function isFieldValidPredicate(e){return e&&e.field&&void 0!==e.valid}(e))return fieldValidPredicate(n,e.valid);if(isFieldRangePredicate(e)){var i=e["range"],o=isSignalRef(i)?{signal:i.signal+"[0]"}:i[0],i=isSignalRef(i)?{signal:i.signal+"[1]"}:i[1];if(null!==o&&null!==i&&t)return"inrange("+n+", ["+predicateValueExpr(o,r)+", "+predicateValueExpr(i,r)+"])";const a=[];return null!==o&&a.push(n+" >= "+predicateValueExpr(o,r)),null!==i&&a.push(n+" <= "+predicateValueExpr(i,r)),0varName(("unit"===e?"":`_${e}_`)+r[e])).join(""):(n?"utc":"")+"timeunit"+y(r).map(e=>varName(`_${e}_`+r[e])).join("")}(a),s=(!util_contains(["range","mid"],n.binSuffix)&&n.binSuffix||"")+(null!=(i=n.suffix)?i:""))):e=t.op),e&&(r=r?e+"_"+r:e)}return s&&(r=r+"_"+s),e&&(r=e+"_"+r),n.forAs?removePathFromField(r):n.expr?flatAccessWithDatum(r,n.expr)+A:replacePathInField(r)+A}function isDiscrete(e){switch(e.type){case"nominal":case"ordinal":case"geojson":return 1;case"quantitative":return isFieldDef(e)&&e.bin;case"temporal":return}throw new Error(x.invalidFieldType(e.type))}function isContinuous(e){return!isDiscrete(e)}const Kt=(e,t)=>{switch(t.fieldTitle){case"plain":return e.field;case"functional":return function functionalTitleFormatter(e){var{aggregate:e,bin:t,timeUnit:n,field:r}=e;if(isArgmaxDef(e))return`${r} for argmax(${e.argmax})`;if(isArgminDef(e))return`${r} for argmin(${e.argmin})`;n=normalizeTimeUnit(n);const i=e||(null==n?void 0:n.unit)||(null==n?void 0:n.maxbins)&&"timeunit"||isBinning(t)&&"bin";return i?i.toUpperCase()+"("+r+")":r}(e);default:return function verbalTitleFormatter(e,t){var{field:e,bin:n,timeUnit:r,aggregate:i}=e;if("count"===i)return t.countTitle;if(isBinning(n))return e+" (binned)";if(r){n=null==(t=normalizeTimeUnit(r))?void 0:t.unit;if(n)return`${e} (${getTimeUnitParts(n).join("-")})`}else if(i)return isArgmaxDef(i)?e+" for max "+i.argmax:isArgminDef(i)?e+" for min "+i.argmin:titleCase(i)+" of "+e;return e}(e,t)}};let Xt=Kt;function setTitleFormatter(e){Xt=e}function channeldef_title(e,t,{allowDisabling:n,includeDefault:r=!0}){var i=null==(i=getGuide(e))?void 0:i.title;if(!isFieldDef(e))return i;r=r?defaultTitle(e,t):void 0;return n?getFirstDefined(i,e.title,r):null!=(t=null!=i?i:e.title)?t:r}function getGuide(e){return isPositionFieldOrDatumDef(e)&&e.axis?e.axis:isMarkPropFieldOrDatumDef(e)&&e.legend?e.legend:isFacetFieldDef(e)&&e.header?e.header:void 0}function defaultTitle(e,t){return Xt(e,t)}function getFormatMixins(e){var t,n;return isStringFieldOrDatumDef(e)?({format:t,formatType:n}=e,{format:t,formatType:n}):({format:n,formatType:e}=null!=(t=getGuide(e))?t:{},{format:n,formatType:e})}function getFieldDef(e){return isFieldDef(e)?e:hasConditionalFieldDef(e)?e.condition:void 0}function getFieldOrDatumDef(e){return isFieldOrDatumDef(e)?e:hasConditionalFieldOrDatumDef(e)?e.condition:void 0}function initChannelDef(e,t,n,r={}){var i;return isString(e)||isNumber(e)||isBoolean(e)?(i=isString(e)?"string":isNumber(e)?"number":"boolean",warn(x.primitiveChannelDef(t,i,e)),{value:e}):isFieldOrDatumDef(e)?initFieldOrDatumDef(e,t,n,r):hasConditionalFieldOrDatumDef(e)?Object.assign(Object.assign({},e),{condition:initFieldOrDatumDef(e.condition,t,n,r)}):e}function initFieldOrDatumDef(e,t,n,r){if(isStringFieldOrDatumDef(e)){var i=e["formatType"],o=Jt(e,["format","formatType"]);if(isCustomFormatType(i)&&!n.customFormatTypes)return warn(x.customFormatTypeNotAllowed(t)),initFieldOrDatumDef(o,t,n,r)}else{i=isPositionFieldOrDatumDef(e)?"axis":isMarkPropFieldOrDatumDef(e)?"legend":isFacetFieldDef(e)?"header":null;if(i&&e[i]){var o=e[i],a=o["formatType"],o=Jt(o,["format","formatType"]);if(isCustomFormatType(a)&&!n.customFormatTypes)return warn(x.customFormatTypeNotAllowed(t)),initFieldOrDatumDef(Object.assign(Object.assign({},e),{[i]:o}),t,n,r)}}return isFieldDef(e)?initFieldDef(e,t,r):function initDatumDef(e){var t=e.type;if(t)return e;var n=e["datum"];return t=isNumber(n)?"quantitative":isString(n)?"nominal":isDateTime(n)?"temporal":void 0,Object.assign(Object.assign({},e),{type:t})}(e)}function initFieldDef(e,t,{compositeMark:n=!1}={}){var{aggregate:r,timeUnit:i,bin:o,field:a}=e;const s=Object.assign({},e);if(n||!r||isAggregateOp(r)||isArgmaxDef(r)||isArgminDef(r)||(warn(x.invalidAggregate(r)),delete s.aggregate),i&&(s.timeUnit=normalizeTimeUnit(i)),a&&(s.field=""+a),isBinning(o)&&(s.bin=normalizeBin(o,t)),isBinned(o)&&!isXorY(t)&&warn(x.channelShouldNotBeUsedForBinned(t)),isTypedFieldDef(s)?(e=s["type"],e!==(n=function getFullName(e){if(e)switch(e=e.toLowerCase()){case"q":case ut:return"quantitative";case"t":case ht:return"temporal";case"o":case dt:return"ordinal";case"n":case pt:return"nominal";case ft:return"geojson"}}(e))&&(s.type=n),"quantitative"!==e&&isCountingAggregateOp(r)&&(warn(x.invalidFieldTypeForCountAggregate(e,r)),s.type="quantitative")):isSecondaryRangeChannel(t)||(i=function defaultType(e,t){switch(t){case"latitude":case"longitude":return"quantitative";case"row":case"column":case"facet":case"shape":case"strokeDash":return"nominal";case"order":return"ordinal"}if("sort"in e&&R(e.sort))return"ordinal";var{aggregate:t,bin:n,timeUnit:r}=e;if(r)return"temporal";if(n||t&&!isArgmaxDef(t)&&!isArgminDef(t))return"quantitative";if(isScaleFieldDef(e)&&null!=(r=e.scale)&&r.type)switch(Ct[e.scale.type]){case"numeric":case"discretizing":return"quantitative";case"time":return"temporal"}return"nominal"}(s,t),s.type=i),isTypedFieldDef(s)&&({compatible:a,warning:o}=function channelCompatibility(e,t){var n=e.type;if("geojson"===n&&"shape"!==t)return{compatible:!1,warning:`Channel ${t} should not be used with a geojson data.`};switch(t){case M:case U:case O:return isContinuous(e)?{compatible:!1,warning:x.facetChannelShouldBeDiscrete(t)}:qt;case b:case h:case K:case X:case q:case Ae:case ce:case ge:case ue:case de:case he:case ne:case W:case V:case pe:return qt;case Y:case J:case j:case z:return n!==ut?{compatible:!1,warning:`Channel ${t} should be used with a quantitative field only, not ${e.type} field.`}:qt;case re:case ie:case oe:case ae:case te:case H:case Z:case L:case P:return"nominal"!==n||e.sort?qt:{compatible:!1,warning:`Channel ${t} should not be used with an unsorted discrete field.`};case se:return util_contains(["ordinal","nominal"],e.type)?qt:{compatible:!1,warning:"StrokeDash channel should be used with only discrete data."};case ee:return util_contains(["ordinal","nominal","geojson"],e.type)?qt:{compatible:!1,warning:"Shape channel should be used with only either discrete or geojson data."};case le:return"nominal"!==e.type||"sort"in e?qt:{compatible:!1,warning:"Channel order is inappropriate for nominal field, which has no inherent order."}}}(s,t)||{},!1===a&&warn(o)),"sort"in s&&isString(s.sort)){const A=s["sort"];if(isSortByChannel(A))return Object.assign(Object.assign({},s),{sort:{encoding:A}});n=A.substr(1);if("-"===A.charAt(0)&&isSortByChannel(n))return Object.assign(Object.assign({},s),{sort:{encoding:n,order:"descending"}})}if(isFacetFieldDef(s)){e=s["header"],r=e["orient"],i=Jt(e,["orient"]);if(r)return Object.assign(Object.assign({},s),{header:Object.assign(Object.assign({},i),{labelOrient:e.labelOrient||r,titleOrient:e.titleOrient||r})})}return s}function normalizeBin(e,t){return isBoolean(e)?{maxbins:autoMaxBins(t)}:"binned"===e?{binned:!0}:e.maxbins||e.step?e:Object.assign(Object.assign({},e),{maxbins:autoMaxBins(t)})}const qt={compatible:!0};function isFieldOrDatumDefForTimeFormat(e){var t=getFormatMixins(e)["formatType"];return"time"===t||!t&&function isTimeFieldDef(e){return e&&("temporal"===e.type||isFieldDef(e)&&e.timeUnit)}(e)}function valueExpr(e,{timeUnit:t,type:n,wrapTime:r,undefinedIfExprNotRequired:i}){t=t&&(null==(t=normalizeTimeUnit(t))?void 0:t.unit);let o=t||"temporal"===n,a;return isExprRef(e)?a=e.expr:isSignalRef(e)?a=e.signal:isDateTime(e)?(o=!0,a=dateTimeToExpr(e)):(isString(e)||isNumber(e))&&o&&(a=`datetime(${JSON.stringify(e)})`,function isLocalSingleTimeUnit(e){return ot[e]}(t)&&(isNumber(e)&&e<1e4||isString(e)&&isNaN(Date.parse(e)))&&(a=dateTimeToExpr({[t]:e}))),a?r&&o?`time(${a})`:a:i?void 0:JSON.stringify(e)}function valueArray(n,e){const r=n["type"];return e.map(e=>{var t=valueExpr(e,{timeUnit:isFieldDef(n)?n.timeUnit:void 0,type:r,undefinedIfExprNotRequired:!0});return void 0!==t?{signal:t}:e})}function binRequiresRange(e,t){if(isBinning(e.bin))return isScaleChannel(t)&&util_contains(["ordinal","nominal"],e.type);console.warn("Only call this method for binned field defs.")}var $t=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{return e.field.push(vgField(t,n)),e.order.push(null!=(t=t.sort)?t:"ascending"),e},{field:[],order:[]})}function mergeTitleFieldDefs(e,t){const n=[...e];return t.forEach(e=>{for(const t of n)if(m(t,e))return;n.push(e)}),n}function mergeTitle(e,t){return m(e,t)||!t?e:e?[...array(e),...array(t)].join(", "):t}function mergeTitleComponent(e,t){var n=e.value,t=t.value;if(null==n||null===t)return{explicit:e.explicit,value:null};if((isText(n)||isSignalRef(n))&&(isText(t)||isSignalRef(t)))return{explicit:e.explicit,value:mergeTitle(n,t)};if(isText(n)||isSignalRef(n))return{explicit:e.explicit,value:n};if(isText(t)||isSignalRef(t))return{explicit:e.explicit,value:t};if(isText(n)||isSignalRef(n)||isText(t)||isSignalRef(t))throw new Error("It should never reach here");return{explicit:e.explicit,value:mergeTitleFieldDefs(n,t)}}class base_CompositeMarkNormalizer{constructor(e,t){this.name=e,this.run=t}hasMatchingType(e){return"mark"in e&&function getMarkType(e){return e.type||e}(e.mark)===this.name}}var tn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r!!e.field):isFieldDef(e)||hasConditionalFieldDef(e))}function encoding_isAggregate(t){return some(Be,e=>{return!!channelHasField(t,e)&&(e=t[e],R(e)?some(e,e=>!!e.aggregate):(e=getFieldDef(e))&&!!e.aggregate)})}function extractTransformsFromEncoding(t,g){const u=[],d=[],h=[],p=[],f={};return forEach(t,(e,n)=>{if(isFieldDef(e)){var{field:r,aggregate:i,bin:o,timeUnit:a}=e,s=tn(e,["field","aggregate","bin","timeUnit"]);if(i||a||o){var A=getGuide(e),A=A&&A.title;let t=vgField(e,{forAs:!0});const l=Object.assign(Object.assign(Object.assign({},A?[]:{title:channeldef_title(e,g,{allowDisabling:!0})}),s),{field:t});if(i){let e;if(isArgmaxDef(i)?(e="argmax",t=vgField({op:"argmax",field:i.argmax},{forAs:!0}),l.field=t+"."+r):isArgminDef(i)?(e="argmin",t=vgField({op:"argmin",field:i.argmin},{forAs:!0}),l.field=t+"."+r):"boxplot"!==i&&"errorbar"!==i&&"errorband"!==i&&(e=i),e){const c={op:e,as:t};r&&(c.field=r),p.push(c)}}else u.push(t),isTypedFieldDef(e)&&isBinning(o)?(d.push({bin:o,field:r,as:t}),u.push(vgField(e,{binSuffix:"end"})),binRequiresRange(e,n)&&u.push(vgField(e,{binSuffix:"range"})),isXorY(n)&&(A={field:t+"_end"},f[n+"2"]=A),l.bin="binned",isSecondaryRangeChannel(n)||(l.type=ut)):a&&(h.push({timeUnit:a,field:r,as:t}),(s=isTypedFieldDef(e)&&e.type!==ht&&"time")&&(n===Ae||n===ue?l.formatType=s:!function isNonPositionScaleChannel(e){return Ee[e]}(n)?isXorY(n)&&(l.axis=Object.assign({formatType:s},l.axis)):l.legend=Object.assign({formatType:s},l.legend)));f[n]=l}else u.push(r),f[n]=t[n]}else f[n]=t[n]}),{bins:d,timeUnits:h,aggregate:p,groupby:u,encoding:f}}function initEncoding(i,o,a,s){return y(i).reduce((e,n)=>{if(!isChannel(n))return warn(x.invalidEncodingChannel(n)),e;var t=i[n];if("angle"!==n||"arc"!==o||i.theta||(warn(x.REPLACE_ANGLE_WITH_THETA),n=W),!function markChannelCompatible(e,t,n){return(n=supportMark(t,n))&&("binned"!==n||!!(isFieldDef(n=e[t===L?b:h])&&isFieldDef(e[t])&&isBinned(n.bin)))}(i,n,o))return warn(x.incompatibleChannel(n,o)),e;if(n===te&&"line"===o){var r=getFieldDef(i[n]);if(null!=r&&r.aggregate)return warn(x.LINE_WITH_VARYING_SIZE),e}if(n===K&&(a?"fill"in i:"stroke"in i))return warn(x.droppingColor("encoding",{fill:"fill"in i,stroke:"stroke"in i})),e;if(n===ce||n===le&&!R(t)&&!isValueDef(t)||n===ue&&R(t))t&&(e[n]=array(t).reduce((e,t)=>(isFieldDef(t)?e.push(initFieldDef(t,n)):warn(x.emptyFieldDef(t,n)),e),[]));else{if(n===ue&&null===t)e[n]=null;else if(!(isFieldDef(t)||isDatumDef(t)||isValueDef(t)||isConditionalDef(t)||isSignalRef(t)))return warn(x.emptyFieldDef(t,n)),e;e[n]=initChannelDef(t,n,s)}return e},{})}function normalizeEncoding(e,t){const n={};for(const i of y(e)){var r=initChannelDef(e[i],i,t,{compositeMark:!0});n[i]=r}return n}function forEach(e,t,n){if(e)for(const i of y(e)){var r=e[i];if(R(r))for(const o of r)t.call(n,o,i);else t.call(n,r,i)}}function pathGroupingFields(i,o){return y(o).reduce((e,t)=>{switch(t){case b:case h:case de:case pe:case he:case L:case P:case W:case H:case V:case Z:case j:case Y:case z:case J:case Ae:case ee:case ne:case ue:return e;case le:if("line"===i||"trail"===i)return e;case ce:case ge:var n=o[t];if(R(n)||isFieldDef(n))for(const r of array(n))r.aggregate||e.push(vgField(r,{}));return e;case te:if("trail"===i)return e;case K:case X:case q:case re:case ie:case oe:case se:case ae:n=getFieldDef(o[t]);return n&&!n.aggregate&&e.push(vgField(n,{})),e}},[])}var nn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var n=i?" of "+getTitle(r):"";return{field:e+r.field,type:r.type,title:isSignalRef(t)?{signal:t+`"${escape(n)}"`}:t+n}}),t=function fieldDefs(e){const t=[];for(const n of y(e))if(channelHasField(e,n))for(const r of array(e[n]))isFieldDef(r)?t.push(r):hasConditionalFieldDef(r)&&t.push(r.condition);return t}(t).map(toStringFieldDef);return{tooltip:[...e,...unique(t,hash)]}}function getTitle(e){var{title:e,field:t}=e;return getFirstDefined(e,t)}function makeCompositeAggregatePartFactory(a,s,A,l,c){const{scale:g,axis:u}=A;return({partName:e,mark:t,positionPrefix:n,endPositionPrefix:r=void 0,extraEncoding:i={}})=>{var o=getTitle(A);return partLayerMixins(a,e,c,{mark:t,encoding:Object.assign(Object.assign(Object.assign({[s]:Object.assign(Object.assign(Object.assign({field:n+"_"+A.field,type:A.type},void 0!==o?{title:o}:{}),void 0!==g?{scale:g}:{}),void 0!==u?{axis:u}:{})},isString(r)?{[s+"2"]:{field:r+"_"+A.field}}:{}),l),i)})}}function partLayerMixins(e,t,n,r){var{clip:i,color:o,opacity:a}=e,s=e.type;return e[t]||void 0===e[t]&&n[t]?[Object.assign(Object.assign({},r),{mark:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},n[t]),i?{clip:i}:{}),o?{color:o}:{}),a?{opacity:a}:{}),r.mark.type?r.mark:{type:r.mark}),{style:s+"-"+t}),isBoolean(e[t])?{}:e[t])})]:[]}function compositeMarkContinuousAxis(e,t,n){var e=e["encoding"],t="vertical"===t?"y":"x",r=e[t],i=e[t+"2"],o=e[t+"Error"],e=e[t+"Error2"];return{continuousAxisChannelDef:filterAggregateFromChannelDef(r,n),continuousAxisChannelDef2:filterAggregateFromChannelDef(i,n),continuousAxisChannelDefError:filterAggregateFromChannelDef(o,n),continuousAxisChannelDefError2:filterAggregateFromChannelDef(e,n),continuousAxis:t}}function filterAggregateFromChannelDef(e,t){var n,r;return e&&e.aggregate?(n=e["aggregate"],r=nn(e,["aggregate"]),n!==t&&warn(x.errorBarContinuousAxisHasCustomizedAggregate(n,t)),r):e}function compositeMarkOrient(e,t){var{mark:e,encoding:n}=e,{x:n,y:r}=n;if(e.type&&e.orient)return e.orient;if(isContinuousFieldOrDatumDef(n)){if(isContinuousFieldOrDatumDef(r)){var e=isFieldDef(n)&&n.aggregate,i=isFieldDef(r)&&r.aggregate;if(e||i!==t){if(i||e!==t){if(e===t&&i===t)throw new Error("Both x and y cannot have aggregate");return isFieldOrDatumDefForTimeFormat(r)&&!isFieldOrDatumDefForTimeFormat(n)?"horizontal":"vertical"}return"horizontal"}return"vertical"}return"horizontal"}if(isContinuousFieldOrDatumDef(r))return"vertical";throw new Error(`Need a valid continuous axis for ${t}s`)}var rn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rmakeCompositeAggregatePartFactory(o,g,c,e,t.boxplot);const B=y(m),b=y(h),v=y(Object.assign(Object.assign({},m),C?{size:C}:{}));var y=getCompositeMarkTooltip([{fieldPrefix:"min-max"===a?"upper_whisker_":"max_",titlePrefix:"Max"},{fieldPrefix:"upper_box_",titlePrefix:"Q3"},{fieldPrefix:"mid_box_",titlePrefix:"Median"},{fieldPrefix:"lower_box_",titlePrefix:"Q1"},{fieldPrefix:"min-max"===a?"lower_whisker_":"min_",titlePrefix:"Min"}],c,h),C={type:"tick",color:"black",opacity:1,orient:p,invalid:null,aria:!1},E="min-max"===a?y:getCompositeMarkTooltip([{fieldPrefix:"upper_whisker_",titlePrefix:"Upper Whisker"},{fieldPrefix:"lower_whisker_",titlePrefix:"Lower Whisker"}],c,h),C=[...B({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"lower_whisker",endPositionPrefix:"lower_box",extraEncoding:E}),...B({partName:"rule",mark:{type:"rule",invalid:null,aria:!1},positionPrefix:"upper_box",endPositionPrefix:"upper_whisker",extraEncoding:E}),...B({partName:"ticks",mark:C,positionPrefix:"lower_whisker",extraEncoding:E}),...B({partName:"ticks",mark:C,positionPrefix:"upper_whisker",extraEncoding:E})],E=[..."tukey"!==a?C:[],...b({partName:"box",mark:Object.assign(Object.assign({type:"bar"},n?{size:n}:{}),{orient:f,invalid:null,ariaRoleDescription:"box"}),positionPrefix:"lower_box",endPositionPrefix:"upper_box",extraEncoding:y}),...v({partName:"median",mark:Object.assign(Object.assign(Object.assign({type:"tick",invalid:null},isObject(t.boxplot.median)&&t.boxplot.median.color?{color:t.boxplot.median.color}:{}),n?{size:n}:{}),{orient:p,aria:!1}),positionPrefix:"mid_box",extraEncoding:y})];if("min-max"===a)return Object.assign(Object.assign({},i),{transform:(null!=(n=i.transform)?n:[]).concat(l),layer:E});var y=`datum["lower_box_${c.field}"]`,a=`datum["upper_box_${c.field}"]`,n=`(${a} - ${y})`,y=y+` - ${r} * `+n,a=a+` + ${r} * `+n,r=`datum["${c.field}"]`,n={joinaggregate:boxParamsQuartiles(c.field),groupby:u},C={transform:[{filter:`(${y} <= ${r}) && (${r} <= ${a})`},{aggregate:[{op:"min",field:c.field,as:"lower_whisker_"+c.field},{op:"max",field:c.field,as:"upper_whisker_"+c.field},{op:"min",field:"lower_box_"+c.field,as:"lower_box_"+c.field},{op:"max",field:"upper_box_"+c.field,as:"upper_box_"+c.field},...d],groupby:u}],layer:C},{}=m,m=rn(m,["tooltip"]),{scale:Q,axis:w}=c,S=getTitle(c),w=omit(w,["title"]),y=partLayerMixins(o,"outliers",t.boxplot,{transform:[{filter:`(${r} < ${y}) || (${r} > ${a})`}],mark:"point",encoding:Object.assign(Object.assign(Object.assign({[g]:Object.assign(Object.assign(Object.assign({field:c.field,type:c.type},void 0!==S?{title:S}:{}),void 0!==Q?{scale:Q}:{}),isEmpty(w)?{}:{axis:w})},m),e?{color:e}:{}),I?{tooltip:I}:{})})[0];let _;r=[...s,...A,n];return y?_={transform:r,layer:[y,C]}:(_=C).transform.unshift(...r),Object.assign(Object.assign({},i),{layer:[_,{transform:l,layer:E}]})}function boxParamsQuartiles(e){return[{op:"q1",field:e,as:"lower_box_"+e},{op:"q3",field:e,as:"upper_box_"+e}]}var sn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r window:mousemove!",encodings:["x","y"],translate:"[mousedown, window:mouseup] > window:mousemove!",zoom:"wheel!",mark:{fill:"#333",fillOpacity:.125,stroke:"white"},resolve:"global",clear:"dblclick"}};function isLegendBinding(e){return!(!e||"legend"!==e&&!e.legend)}function isLegendStreamBinding(e){return isLegendBinding(e)&&isObject(e)}function isStep(e){return isObject(e)&&void 0!==e.step}function isFrameMixins(e){return e.view||e.width||e.height}const En=y({align:1,bounds:1,center:1,columns:1,spacing:1});var Qn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rthis.mapLayerOrUnit(e,t))})}mapHConcat(e,t){return Object.assign(Object.assign({},e),{hconcat:e.hconcat.map(e=>this.map(e,t))})}mapVConcat(e,t){return Object.assign(Object.assign({},e),{vconcat:e.vconcat.map(e=>this.map(e,t))})}mapConcat(e,t){const n=e["concat"],r=Nn(e,["concat"]);return Object.assign(Object.assign({},r),{concat:n.map(e=>this.map(e,t))})}mapFacet(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}mapRepeat(e,t){return Object.assign(Object.assign({},e),{spec:this.map(e.spec,t)})}}const kn={zero:1,center:1,normalize:1};const Tn=new Set([I,xt,_t,Nt,Dt,Ut,Ot,Ft,kt,Tt]),Mn=new Set([xt,_t,I]);function potentialStackedChannel(e,t){var n="x"===t?"y":"radius",r=e[t],e=e[n];if(isFieldDef(r)&&isFieldDef(e))if("quantitative"===channelDefType(r)&&"quantitative"===channelDefType(e)){if(r.stack)return t;if(e.stack)return n;var i=isFieldDef(r)&&!!r.aggregate;if(i!==(isFieldDef(e)&&!!e.aggregate))return i?t:n;var i=null==(i=r.scale)?void 0:i.type,o=null==(o=e.scale)?void 0:o.type;if(i&&"linear"!==i)return n;if(o&&"linear"!==o)return t}else{if("quantitative"===channelDefType(r))return t;if("quantitative"===channelDefType(e))return n}else{if("quantitative"===channelDefType(r))return t;if("quantitative"===channelDefType(e))return n}}function stack_stack(e,o,t={}){e=e.type||e;if(!Tn.has(e))return null;var n=potentialStackedChannel(o,"x")||potentialStackedChannel(o,"theta");if(!n)return null;var r=o[n],i=isFieldDef(r)?vgField(r,{}):void 0;let a=function getDimensionChannel(e){switch(e){case"x":return"y";case"y":return"x";case"theta":return"radius";case"radius":return"theta"}}(n),s=o[a],A=isFieldDef(s)?vgField(s,{}):void 0;A===i&&(A=void 0,s=void 0,a=void 0);i=Qe.reduce((e,t)=>{if("tooltip"!==t&&channelHasField(o,t))for(const i of array(o[t])){var n,r=getFieldDef(i);r.aggregate||((n=vgField(r,{}))&&n===A||e.push({channel:t,fieldDef:r}))}return e},[]);let l;if(void 0!==r.stack?l=isBoolean(r.stack)?r.stack?"zero":null:r.stack:0replaceRepeaterInChannelDef(e,t)).filter(e=>e):void 0!==(r=replaceRepeaterInChannelDef(o,t))&&(n[i]=r)}return n}class ruleforrangedline_RuleForRangedLineNormalizer{constructor(){this.name="RuleForRangedLine"}hasMatchingType(e){if("mark"in e){var{encoding:t,mark:e}=e;if("line"===e)for(const r of ve){var n=t[getMainRangeChannel(r)];if(t[r]&&(isFieldDef(n)&&!isBinned(n.bin)||isDatumDef(n)))return!0}}return!1}run(e,t,n){var r=e["encoding"];return warn(x.lineWithRange(!!r.x2,!!r.y2)),n(Object.assign(Object.assign({},e),{mark:"rule"}),t)}}var d,Pn=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var t=Object.assign(Object.assign({},A),{layer:e}),e=(i.name||"")+l+("child__layer_"+varName(e));const n=this.mapLayerOrUnit(i,Object.assign(Object.assign({},r),{repeater:t,repeaterPrefix:e}));return n.name=e,n})})}mapNonLayerRepeat(e,t){var n,{repeat:r,spec:i,data:o}=e,a=Pn(e,["repeat","spec","data"]);!R(r)&&e.columns&&(e=omit(e,["columns"]),warn(x.columnsNotSupportByRowCol("repeat")));const s=[];var{repeater:A={},repeaterPrefix:l=""}=t,c=!R(r)&&r.row||[A?A.row:null],g=!R(r)&&r.column||[A?A.column:null];for(const h of R(r)&&r||[A?A.repeat:null])for(const p of c)for(const f of g){var u={repeat:h,row:p,column:f,layer:A.layer},d=(i.name||"")+l+"child__"+(R(r)?""+varName(h):(r.row?"row_"+varName(p):"")+(r.column?"column_"+varName(f):""));const I=this.map(i,Object.assign(Object.assign({},t),{repeater:u,repeaterPrefix:d}));I.name=d,s.push(omit(I,["data"]))}e=R(r)?e.columns:r.column?r.column.length:1;return Object.assign(Object.assign({data:null!=(n=i.data)?n:o,align:"all"},a),{columns:e,concat:s})}mapFacet(e,t){var n=e["facet"];return isFacetMapping(n)&&e.columns&&(e=omit(e,["columns"]),warn(x.columnsNotSupportByRowCol("facet"))),super.mapFacet(e,t)}mapUnitWithParentEncodingOrProjection(e,t){var{encoding:n,projection:r}=e,{parentEncoding:i,parentProjection:o,config:a}=t,o=mergeProjection({parentProjection:o,projection:r}),r=mergeEncoding({parentEncoding:i,encoding:replaceRepeaterInEncoding(n,t.repeater)});return this.mapUnit(Object.assign(Object.assign(Object.assign({},e),o?{projection:o}:{}),r?{encoding:r}:{}),{config:a})}mapFacetedUnit(e,t){var n=e.encoding,{row:r,column:i,facet:o}=n,n=Pn(n,["row","column","facet"]),{mark:a,width:s,projection:A,height:l,view:c,selection:g}=e,e=Pn(e,["mark","width","projection","height","view","selection","encoding"]),{facetMapping:r,layout:i}=this.getFacetMappingAndLayout({row:r,column:i,facet:o},t),o=replaceRepeaterInEncoding(n,t.repeater);return this.mapFacet(Object.assign(Object.assign(Object.assign({},e),i),{facet:r,spec:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},s?{width:s}:{}),l?{height:l}:{}),c?{view:c}:{}),A?{projection:A}:{}),{mark:a,encoding:o}),g?{selection:g}:{})}),t)}getFacetMappingAndLayout(e,t){var n,r,i,{row:o,column:a,facet:s}=e;if(o||a){s&&warn(x.facetChannelDropped([...o?[M]:[],...a?[U]:[]]));const c={},g={};for(const u of[M,U]){var A=e[u];if(A){var{}=A,l=Pn(A,["align","center","spacing","columns"]);c[u]=l;for(const d of["align","center","spacing"])void 0!==A[d]&&(g[d]=null!=(n=g[d])?n:{},g[d][u]=A[d])}}return{facetMapping:c,layout:g}}return{align:o,center:a,spacing:r,columns:i}=s,{facetMapping:function replaceRepeaterInFacet(e,t){return t?(isFacetMapping(e)?replaceRepeaterInMapping:replaceRepeaterInFieldDef)(e,t):e}(Pn(s,["align","center","spacing","columns"]),t.repeater),layout:Object.assign(Object.assign(Object.assign(Object.assign({},o?{align:o}:{}),a?{center:a}:{}),r?{spacing:r}:{}),i?{columns:i}:{})}}mapLayer(e,t){var{parentEncoding:n,parentProjection:r}=t,t=Pn(t,["parentEncoding","parentProjection"]),{encoding:i,projection:o}=e,e=Pn(e,["encoding","projection"]),t=Object.assign(Object.assign({},t),{parentEncoding:mergeEncoding({parentEncoding:n,encoding:i,layer:!0}),parentProjection:mergeProjection({parentProjection:r,projection:o})});return super.mapLayer(e,t)}};function _normalizeAutoSize(e){return isString(e)?{type:e}:null!=e?e:{}}const Zn=["background","padding"];function extractTopLevelProperties(e,t){const n={};for(const r of Zn)e&&void 0!==e[r]&&(n[r]=signalRefOrValue(e[r]));return t&&(n.params=e.params),n}class split_Split{constructor(e={},t={}){this.explicit=e,this.implicit=t}clone(){return new split_Split(g(this.explicit),g(this.implicit))}combine(){return Object.assign(Object.assign({},this.explicit),this.implicit)}get(e){return getFirstDefined(this.explicit[e],this.implicit[e])}getWithExplicit(e){return void 0!==this.explicit[e]?{explicit:!0,value:this.explicit[e]}:void 0!==this.implicit[e]?{explicit:!1,value:this.implicit[e]}:{explicit:!1,value:void 0}}setWithExplicit(e,t){void 0!==t.value&&this.set(e,t.value,t.explicit)}set(e,t,n){return delete this[n?"implicit":"explicit"][e],this[n?"explicit":"implicit"][e]=t,this}copyKeyFromSplit(e,t){void 0!==t.explicit[e]?this.set(e,t.explicit[e],!0):void 0!==t.implicit[e]&&this.set(e,t.implicit[e],!1)}copyKeyFromObject(e,t){void 0!==t[e]&&this.set(e,t[e],!0)}copyAll(e){for(const n of y(e.combine())){var t=e.getWithExplicit(n);this.setWithExplicit(n,t)}}}function makeExplicit(e){return{explicit:!0,value:e}}function makeImplicit(e){return{explicit:!1,value:e}}function tieBreakByComparing(o){return(e,t,n,r)=>{var i=o(e.value,t.value);return 0isFilter(e)?{filter:function normalizeLogicalComposition(e,t){return e.not?{not:normalizeLogicalComposition(e.not,t)}:e.and?{and:e.and.map(e=>normalizeLogicalComposition(e,t))}:e.or?{or:e.or.map(e=>normalizeLogicalComposition(e,t))}:t(e)}(e.filter,normalizePredicate)}:e)}(Ht=d=d||{})[Ht.Raw=0]="Raw",Ht[Ht.Main=1]="Main",Ht[Ht.Row=2]="Row",Ht[Ht.Column=3]="Column",Ht[Ht.Lookup=4]="Lookup";const Wn="[",Hn="]",jn="{",Yn="}",zn=":",Jn=",",Kn="@",Xn=">",qn=/[[\]{}]/,$n={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let er,tr;function eventSelector(e,t,n){return er=t||"view",tr=n||$n,parseMerge(e.trim()).map(parseSelector)}function find(e,t,n,r,i){var o=e.length;let a=0,s;for(;t' after between selector: "+e;r=r.map(parseSelector);const i=parseSelector(e.slice(1).trim());{if(i.between)return{between:r,stream:i};i.between=r}return i}:function parseStream(t){const e={source:er},n=[];let r=[0,0],i=0,o=0,a=t.length,s=0,A,l;if(t[a-1]===Yn){if(!(0<=(s=t.lastIndexOf(jn))))throw"Unmatched right brace: "+t;try{r=function parseThrottle(t){const e=t.split(Jn);if(!t.length||2{e=+e;if(e!=e)throw t;return e})}(t.substring(s+1,a-1))}catch(e){throw"Invalid throttle specification: "+t}t=t.slice(0,s).trim(),a=t.length,s=0}if(!a)throw t;t[0]===Kn&&(i=++s);(A=find(t,s,zn)){var t=r(e),e=function isConditionalSelection(e){return e.selection}(e)?parseSelectionPredicate(n,e.selection):predicate_expression(n,e.test);return Object.assign({test:e},t)}),...void 0!==e?[e]:[]]}}return void 0!==e?{[t]:e}:{}}function text_text(t,e="text"){var n=t.encoding[e];return wrapCondition(t,n,e,e=>textRef(e,t.config))}function textRef(e,t,n="datum"){if(e){if(isValueDef(e))return signalOrValueRef(e.value);var r,i;if(isFieldOrDatumDef(e))return{format:r,formatType:i}=getFormatMixins(e),formatSignalRef({fieldOrDatumDef:e,format:r,formatType:i,expr:n,config:t})}}function tooltip_tooltip(e,n={}){const{encoding:r,markDef:i,config:o,stack:a}=e;var t=r.tooltip;if(R(t))return{tooltip:tooltipRefForEncoding({tooltip:t},a,o,n)};{const s=n.reactiveGeom?"datum.datum":"datum";return wrapCondition(e,t,"tooltip",e=>{var t=textRef(e,o,s);if(t)return t;if(null!==e){let e=getMarkPropOrConfig("tooltip",i,o);return isString(e=!0===e?{content:"encoding"}:e)?{value:e}:isObject(e)?isSignalRef(e)?e:"encoding"===e.content?tooltipRefForEncoding(r,a,o,n):{signal:s}:void 0}})}}function tooltipData(l,c,g,{reactiveGeom:e}={}){const u={},d=e?"datum.datum":"datum",h=[];function add(e,t){var n,r,i,o,a,s=getMainRangeChannel(t),e=isTypedFieldDef(e)?e:Object.assign(Object.assign({},e),{type:l[s].type}),s=array(e.title||defaultTitle(e,g)).join(", ");let A;isXorY(t)&&(a=getFieldDef(l[n="x"===t?"x2":"y2"]),isBinned(e.bin)&&a?(o=vgField(e,{expr:d}),a=vgField(a,{expr:d}),{format:r,formatType:i}=getFormatMixins(e),A=binFormatExpression(o,a,r,i,g),u[n]=!0):c&&c.fieldChannel===t&&"normalize"===c.offset&&({format:o,formatType:a}=getFormatMixins(e),A=formatSignalRef({fieldOrDatumDef:e,format:o,formatType:a,expr:d,config:g,normalizeStack:!0}).signal)),A=null!==A&&void 0!==A?A:textRef(e,g,d).signal,h.push({channel:t,key:s,value:A})}forEach(l,(e,t)=>{isFieldDef(e)?add(e,t):hasConditionalFieldDef(e)&&add(e.condition,t)});const t={};for(var{channel:n,key:r,value:i}of h)u[n]||t[r]||(t[r]=i);return t}function tooltipRefForEncoding(e,t,n,{reactiveGeom:r}={}){e=tooltipData(e,t,n,{reactiveGeom:r});const i=v(e).map(([e,t])=>`"${e}": `+t);return 0textRef(e,t.config));o=getMarkPropOrConfig("description",n,r);if(null!=o)return{description:signalOrValueRef(o)};if(!1===r.aria)return{};n=tooltipData(e,i,r);if(isEmpty(n))return;return{description:{signal:v(n).map(([e,t],n)=>`"${0midPoint({channel:t,channelDef:e,markDef:r,config:o,scaleName:n.scaleName(t),scale:n.getScaleComponent(t),stack:null,defaultRef:s}))}function color_color(e,t={filled:void 0}){var{markDef:n,encoding:r,config:i}=e,o=n["type"],t=null!=(t=t.filled)?t:getMarkPropOrConfig("filled",n,i),o=util_contains(["bar","point","circle","square","geoshape"],o)?"transparent":void 0,a=null!=(a=null!=(a=getMarkPropOrConfig(!0===t?"color":void 0,n,i,{vgChannel:"fill"}))?a:i.mark[!0===t&&"color"])?a:o,o=null!=(o=getMarkPropOrConfig(!1===t?"color":void 0,n,i,{vgChannel:"stroke"}))?o:i.mark[!1===t&&"color"],i=t?"fill":"stroke",s=Object.assign(Object.assign({},a?{fill:signalOrValueRef(a)}:{}),o?{stroke:signalOrValueRef(o)}:{});return n.color&&(t?n.fill:n.stroke)&&warn(x.droppingColor("property",{fill:"fill"in n,stroke:"stroke"in n})),Object.assign(Object.assign(Object.assign(Object.assign({},s),nonPosition("color",e,{vgChannel:i,defaultValue:t?a:o})),nonPosition("fill",e,{defaultValue:r.fill?a:void 0})),nonPosition("stroke",e,{defaultValue:r.stroke?o:void 0}))}function getOffset(e,t){t=t[function getOffsetChannel(e){switch(e){case b:return"xOffset";case h:return"yOffset";case L:return"x2Offset";case P:return"y2Offset";case W:return"thetaOffset";case V:return"radiusOffset";case H:return"theta2Offset";case Z:return"radius2Offset"}}(e)];if(t)return t}function pointPosition(e,t,{defaultPos:n,vgChannel:r,isMidPoint:i}){var{encoding:o,markDef:a,config:s,stack:A}=t,l=o[e],c=o[getSecondaryRangeChannel(e)],g=t.scaleName(e),u=t.getScaleComponent(e),d=getOffset(e,a),n=pointPositionDefaultRef({model:t,defaultPos:n,channel:e,scaleName:g,scale:u}),o=!l&&isXorY(e)&&(o.latitude||o.longitude)?{field:t.getName(e)}:function positionRef(e){var{channel:t,channelDef:n,isMidPoint:r,scaleName:i,stack:o,offset:a,markDef:s,config:A}=e;if(isFieldOrDatumDef(n)&&o&&t===o.fieldChannel){if(isFieldDef(n)){t=getBand({channel:t,fieldDef:n,isMidPoint:r,markDef:s,stack:o,config:A});if(void 0!==t)return interpolatedSignalRef({scaleName:i,fieldOrDatumDef:n,startSuffix:"start",band:t,offset:a})}return valueRefForFieldOrDatumDef(n,i,{suffix:"end"},{offset:a})}return midPointRefWithPositionInvalidTest(e)}({channel:e,channelDef:l,channel2Def:c,markDef:a,config:s,isMidPoint:i,scaleName:g,scale:u,stack:A,offset:d,defaultRef:n});return o?{[r||e]:o}:void 0}function pointPositionDefaultRef({model:r,defaultPos:i,channel:o,scaleName:a,scale:s}){const{markDef:A,config:l}=r;return()=>{var e=getMainRangeChannel(o),t=getVgPositionChannel(o),t=getMarkPropOrConfig(o,A,l,{vgChannel:t});if(void 0!==t)return widthHeightValueOrSignalRef(o,t);switch(i){case"zeroOrMin":case"zeroOrMax":if(a){var n=s.get("type");if(!util_contains([It.LOG,It.TIME,It.UTC],n)&&s.domainDefinitelyIncludesZero())return{scale:a,value:0}}if("zeroOrMin"===i)return"y"===e?{field:{group:"height"}}:{value:0};switch(e){case"radius":return{signal:`min(${r.width.signal},${r.height.signal})/2`};case"theta":return{signal:"2*PI"};case"x":return{field:{group:"width"}};case"y":return{value:0}}break;case"mid":n=r[getSizeChannel(o)];return Object.assign(Object.assign({},n),{mult:.5})}}}const nr={left:"x",center:"xc",right:"x2"},rr={top:"y",middle:"yc",bottom:"y2"};function vgAlignedPositionChannel(e,t,n,r="middle"){if("radius"===e||"theta"===e)return getVgPositionChannel(e);var i="x"===e?"align":"baseline",t=getMarkPropOrConfig(i,t,n);let o;return o=isSignalRef(t)?void warn(x.rangeMarkAlignmentCannotBeExpression(i)):t,"x"===e?nr[o||("top"===r?"left":"center")]:rr[o||r]}function pointOrRangePosition(e,t,{defaultPos:n,defaultPos2:r,range:i}){return i?rangePosition(e,t,{defaultPos:n,defaultPos2:r}):pointPosition(e,t,{defaultPos:n})}function rangePosition(e,t,{defaultPos:n,defaultPos2:r}){var{markDef:i,config:o}=t,a=getSecondaryRangeChannel(e),s=getSizeChannel(e),r=function pointPosition2OrSize(e,t,n){var{encoding:r,mark:i,markDef:o,stack:a,config:s}=e,A=getMainRangeChannel(n),l=getSizeChannel(n),c=getVgPositionChannel(n),g=r[A],u=e.scaleName(A),d=e.getScaleComponent(A),A=n in r||n in o?getOffset(n,e.markDef):getOffset(A,e.markDef);if(!g&&("x2"===n||"y2"===n)&&(r.latitude||r.longitude))return{[c]:{field:e.getName(n)}};g=function position2Ref({channel:e,channelDef:t,channel2Def:n,markDef:r,config:i,scaleName:o,scale:a,stack:s,offset:A,defaultRef:l}){if(isFieldOrDatumDef(t)&&s&&e.charAt(0)===s.fieldChannel.charAt(0))return valueRefForFieldOrDatumDef(t,o,{suffix:"start"},{offset:A});return midPointRefWithPositionInvalidTest({channel:e,channelDef:n,scaleName:o,scale:a,stack:s,markDef:r,config:i,offset:A,defaultRef:l})}({channel:n,channelDef:g,channel2Def:r[n],markDef:o,config:s,scaleName:u,scale:d,stack:a,offset:A,defaultRef:void 0});return void 0===g?position2orSize(n,o)||position2orSize(n,{[n]:getMarkStyleConfig(n,o,s.style),[l]:getMarkStyleConfig(l,o,s.style)})||position2orSize(n,s[i])||position2orSize(n,s.mark)||{[c]:pointPositionDefaultRef({model:e,defaultPos:t,channel:n,scaleName:u,scale:d})()}:{[c]:g}}(t,r,a),a=r[s]?vgAlignedPositionChannel(e,i,o):getVgPositionChannel(e);return Object.assign(Object.assign({},pointPosition(e,t,{defaultPos:n,vgChannel:a})),r)}function position2orSize(e,t){var n=getSizeChannel(e),r=getVgPositionChannel(e);return void 0!==t[r]?{[r]:widthHeightValueOrSignalRef(e,t[r])}:void 0!==t[e]?{[r]:widthHeightValueOrSignalRef(e,t[e])}:t[n]?{[n]:widthHeightValueOrSignalRef(e,t[n])}:void 0}function rectPosition(e,t,n){var{config:r,encoding:i,markDef:o,stack:a}=e,s=getSecondaryRangeChannel(t),A=getSizeChannel(t),l=i[t],s=i[s];const c=e.getScaleComponent(t);var g=c?c.get("type"):void 0,u=e.scaleName(t),d=o.orient,i=null!=(h=null!=(h=i[A])?h:i.size)?h:getMarkPropOrConfig("size",o,r,{vgChannel:A}),h="bar"===n&&("x"===t?"vertical"===d:"horizontal"===d);if(!isFieldDef(l)||!(isBinning(l.bin)||isBinned(l.bin)||l.timeUnit&&!s)||i||hasDiscreteDomain(g))return(isFieldOrDatumDef(l)&&hasDiscreteDomain(g)||h)&&!s?function positionAndSize(e,t,n,r){const{markDef:i,encoding:o,config:a,stack:s}=r,A=i.orient,l=r.scaleName(n),c=r.getScaleComponent(n),g=getSizeChannel(n),u=getSecondaryRangeChannel(n),d="horizontal"===A&&"y"===n||"vertical"===A&&"x"===n,h=getMarkPropOrConfig(d?"size":g,i,a,{vgChannel:g});let p;!o.size&&void 0===h||(d?p=nonPosition("size",r,{vgChannel:g,defaultValue:h}):warn(x.cannotApplySizeToNonOrientedMark(i.type)));var f=null!=(f=isFieldOrDatumDef(t)?getBand({channel:n,fieldDef:t,markDef:i,stack:s,config:a}):void 0)?f:1,e=(p=p||{[g]:function defaultSizeRef(e,t,n,r,i,o){if(r)return"point"!==(a=r.get("type"))&&"band"!==a?{value:i[e].continuousBandSize}:void 0!==i[e].discreteBandSize?{value:i[e].discreteBandSize}:a===It.POINT?(a=r.get("range")).step&&isNumber(a.step)?{value:a.step-2}:{value:wn-2}:{scale:n,band:o};var r=getViewConfigDiscreteStep(i.view,t),a=getFirstDefined(i[e].discreteBandSize,r-2);return void 0!==a?{value:a}:void 0}(e,g,l,c,a,f)},"band"!==(null===c||void 0===c?void 0:c.get("type"))||!("band"in p[g])),I=vgAlignedPositionChannel(n,i,a,e?"middle":"top"),C=getOffset(n,i),t=midPointRefWithPositionInvalidTest({channel:n,channelDef:t,markDef:i,config:a,scaleName:l,scale:c,stack:s,offset:C,defaultRef:pointPositionDefaultRef({model:r,defaultPos:"mid",channel:n,scaleName:l,scale:c}),band:e?.5:(1-f)/2});return g?Object.assign({[I]:t},p):(r=getVgPositionChannel(u),n=p[g],e=C?Object.assign(Object.assign({},n),{offset:C}):n,{[I]:t,[r]:R(t)?[t[0],Object.assign(Object.assign({},t[1]),{offset:e})]:Object.assign(Object.assign({},t),{offset:e})})}(n,l,t,e):rangePosition(t,e,{defaultPos:"zeroOrMax",defaultPos2:"zeroOrMin"});{A=getBand({channel:t,fieldDef:l,stack:a,markDef:o,config:r});const p=null==(d=e.component.axes[t])?void 0:d[0];return function rectBinPosition({fieldDef:e,fieldDef2:t,channel:n,band:r,scaleName:i,markDef:o,spacing:a=0,axisTranslate:s,reverse:A,config:l}){var c=getSecondaryRangeChannel(n),g=getVgPositionChannel(n),u=getVgPositionChannel(c),d=getOffset(n,o);{if(isBinning(e.bin)||e.timeUnit)return{[u]:rectBinRef({channel:n,fieldDef:e,scaleName:i,markDef:o,band:(1-r)/2,offset:getBinSpacing(c,a,A,s,d),config:l}),[g]:rectBinRef({channel:n,fieldDef:e,scaleName:i,markDef:o,band:1-(1-r)/2,offset:getBinSpacing(n,a,A,s,d),config:l})};if(isBinned(e.bin)){o=valueRefForFieldOrDatumDef(e,i,{},{offset:getBinSpacing(c,a,A,s,d)});if(isFieldDef(t))return{[u]:o,[g]:valueRefForFieldOrDatumDef(t,i,{},{offset:getBinSpacing(n,a,A,s,d)})};if(isBinParams(e.bin)&&e.bin.step)return{[u]:o,[g]:{signal:`scale("${i}", ${vgField(e,{expr:"datum"})} + ${e.bin.step})`,offset:getBinSpacing(n,a,A,s,d)}}}}return warn(x.channelRequiredForBinned(c)),void 0}({fieldDef:l,fieldDef2:s,channel:t,markDef:o,scaleName:u,band:A,axisTranslate:null!=(i=null===p||void 0===p?void 0:p.get("translate"))?i:.5,spacing:isXorY(t)?getMarkPropOrConfig("binSpacing",o,r):void 0,reverse:c.get("reverse"),config:r})}}function getBinSpacing(e,t,n,r,i){if(isPolarPositionChannel(e))return 0;var o,a,e="x"===e||"y2"===e?-t/2:t/2;return isSignalRef(n)||isSignalRef(i)||isSignalRef(r)?(t=signalOrStringValue(n),o=signalOrStringValue(i),{signal:((a=signalOrStringValue(r))?a+" + ":"")+(t?`(${t} ? -1 : 1) * `:"")+(o?`(${o} + ${e})`:e)}):(i=i||0,r+(n?-i-e:+i+e))}function rectBinRef({channel:e,fieldDef:t,scaleName:n,markDef:r,band:i,offset:o,config:a}){return wrapPositionInvalidTest({fieldDef:t,channel:e,markDef:r,ref:interpolatedSignalRef({scaleName:n,fieldOrDatumDef:t,band:i,offset:o}),config:a})}const ir=new Set(["aria"]);function baseEncodeEntry(e,t){var{fill:n=void 0,stroke:r=void 0}="include"===t.color?color_color(e):{};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},function markDefProperties(n,r){return At.reduce((e,t)=>(ir.has(t)||void 0===n[t]||"ignore"===r[t]||(e[t]=signalOrValueRef(n[t])),e),{})}(e.markDef,t)),wrapAllFieldsInvalid(e,"fill",n)),wrapAllFieldsInvalid(e,"stroke",r)),nonPosition("opacity",e)),nonPosition("fillOpacity",e)),nonPosition("strokeOpacity",e)),nonPosition("strokeWidth",e)),nonPosition("strokeDash",e)),function zindex_zindex(e){var{encoding:t,mark:n}=e,t=t.order;return!isPathMark(n)&&isValueDef(t)?wrapCondition(e,t,"zindex",e=>signalOrValueRef(e.value)):{}}(e)),tooltip_tooltip(e)),text_text(e,"href")),aria_aria(e))}function wrapAllFieldsInvalid(e,t,n){var{config:r,mark:i,markDef:o}=e;if("hide"===getMarkPropOrConfig("invalid",o,r)&&n&&!isPathMark(i)){o=function allFieldsInvalidPredicate(i,{invalid:t=!1,channels:e}){const n=e.reduce((e,t)=>{const n=i.getScaleComponent(t);var r;return n&&(r=n.get("type"),(t=i.vgField(t,{expr:"datum"}))&&hasContinuousDomain(r)&&(e[t]=!0)),e},{}),r=y(n);if(0fieldInvalidPredicate(e,t)).join(` ${e} `);return}(e,{invalid:!0,channels:De});if(o)return{[t]:[{test:o,value:null},...array(n)]}}return n?{[t]:n}:{}}function defined(e){var{config:t,markDef:n}=e;if(getMarkPropOrConfig("invalid",n,t)){n=function defined_allFieldsInvalidPredicate(i,{invalid:t=!1,channels:e}){const n=e.reduce((e,t)=>{const n=i.getScaleComponent(t);var r;return n&&(r=n.get("type"),(t=i.vgField(t,{expr:"datum"}))&&hasContinuousDomain(r)&&(e[t]=!0)),e},{}),r=y(n);if(0fieldInvalidPredicate(e,t)).join(` ${e} `);return}(e,{channels:Se});if(n)return{defined:{signal:n}}}return{}}function valueIfDefined(e,t){if(void 0!==t)return{[e]:signalOrValueRef(t)}}const or="voronoi";var ar={has:e=>"interval"!==e.type&&e.nearest,parse:(e,t)=>{if(t.events)for(const n of t.events)n.markname=e.getName(or)},marks:(r,e,t)=>{var{x:e,y:n}=e.project.hasChannel,i=r.mark;if(isPathMark(i))return warn(x.nearestNotSupportForContinuous(i)),t;i={name:r.getName(or),type:"path",interactive:!0,from:{data:r.getName("marks")},encode:{update:Object.assign({fill:{value:"transparent"},strokeWidth:{value:.35},stroke:{value:"transparent"},isVoronoi:{value:!0}},tooltip_tooltip(r,{reactiveGeom:!0}))},transform:[{type:"voronoi",x:{expr:e||!n?"datum.datum.x || 0":"0"},y:{expr:n||!e?"datum.datum.y || 0":"0"},size:[r.getSizeSignalRef("width"),r.getSizeSignalRef("height")]}]};let o=0,a=!1;return t.forEach((e,t)=>{const n=null!=(e=e.name)?e:"";n===r.component.mark[0].name?o=t:0<=n.indexOf(or)&&(a=!0)}),a||t.splice(o+1,0,i),t}};class dataflow_DataFlowNode{constructor(e,t){this.debugName=t,this._children=[],this._parent=null,e&&(this.parent=e)}clone(){throw new Error("Cannot clone node")}get parent(){return this._parent}set parent(e){(this._parent=e)&&e.addChild(this)}get children(){return this._children}numChildren(){return this._children.length}addChild(e,t){-1{var{field:r,timeUnit:i}=t,o=isUnitModel(a)?a.encoding[getSecondaryRangeChannel(n)]:void 0,n=isUnitModel(a)&&hasBand(n,t,o,a.stack,a.markDef,a.config);return i&&(e[hash({as:o=vgField(t,{forAs:!0}),field:r,timeUnit:i})]=Object.assign({as:o,field:r,timeUnit:i},n?{band:!0}:{})),e},{});return isEmpty(t)?null:new timeunit_TimeUnitNode(e,t)}static makeFromTransform(e,t){var t=Object.assign({},t),n=t["timeUnit"],t=sr(t,["timeUnit"]),n=normalizeTimeUnit(n),t=Object.assign(Object.assign({},t),{timeUnit:n});return new timeunit_TimeUnitNode(e,{[hash(t)]:t})}merge(e){this.formula=Object.assign({},this.formula);for(const t in e.formula)this.formula[t]&&!e.formula[t].band||(this.formula[t]=e.formula[t]);for(const n of e.children)e.removeChild(n),n.parent=this;e.remove()}removeFormulas(e){const t={};for(var[n,r]of v(this.formula))e.has(r.as)||(t[n]=r);this.formula=t}producedFields(){return new Set(B(this.formula).map(e=>e.as))}dependentFields(){return new Set(B(this.formula).map(e=>e.field))}hash(){return"TimeUnit "+hash(this.formula)}assemble(){const e=[];for(const a of B(this.formula)){var{field:t,as:n,timeUnit:r}=a,r=normalizeTimeUnit(r),{unit:i,utc:o}=r,r=sr(r,["unit","utc"]);e.push(Object.assign(Object.assign(Object.assign(Object.assign({field:replacePathInField(t),type:"timeunit"},i?{units:getTimeUnitParts(i)}:{}),o?{timezone:"utc"}:{}),r),{as:[n,n+"_end"]}))}return e}}var Ar=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r"single"===e.type&&"global"===e.resolve&&e.bind&&"scales"!==e.bind&&!isLegendBinding(e.bind),parse:(e,t,n,r)=>{r.on||delete t.events,r.clear||delete t.clear},topLevelSignals:(e,r,i)=>{const o=r.name,t=r.project,a=r.bind,s=r.init&&r.init[0],A=ar.has(r)?"(item().isVoronoi ? datum.datum : datum)":"datum";return t.items.forEach((e,t)=>{const n=varName(o+"_"+e.field);i.filter(e=>e.name===n).length||i.unshift(Object.assign(Object.assign({name:n},s?{init:assembleInit(s[t])}:{value:null}),{on:r.events?[{events:r.events,update:`datum && item().mark.marktype !== 'group' ? ${A}[${$(e.field)}] : null`}]:[],bind:null!=(t=null!=(t=a[e.field])?t:a[e.channel])?t:a}))}),i},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.filter(e=>e.name===r+Qr)[0];t=r+lr;const a=i.items.map(e=>varName(r+"_"+e.field));var s=a.map(e=>e+" !== null").join(" && ");return a.length&&(o.update=`${s} ? {fields: ${t}, values: [${a.join(", ")}]} : null`),delete o.value,delete o.on,n}};const gr="_toggle";var ur={has:e=>"multi"===e.type&&!!e.toggle,signals:(e,t,n)=>n.concat({name:t.name+gr,value:!1,on:[{events:t.events,update:t.toggle}]}),modifyExpr:(e,t)=>{var n=t.name+Qr,r=t.name+gr;return r+` ? null : ${n}, `+("global"===t.resolve?r+" ? null : true, ":r+` ? null : {unit: ${selection_unitName(e)}}, `)+r+` ? ${n} : null`}},dr={has:e=>"interval"===e.type&&"global"===e.resolve&&e.bind&&"scales"===e.bind,parse:(e,t)=>{const n=t.scales=[];for(const i of t.project.items){var r=i.channel;if(isScaleChannel(r)){const o=e.getScaleComponent(r);var r=o?o.get("type"):void 0;o&&hasContinuousDomain(r)?(r={selection:t.name,field:i.field},o.set("selectionExtent",r,!0),n.push(i)):warn(x.SCALE_BINDINGS_CONTINUOUS)}}},topLevelSignals:(e,t,n)=>{const r=t.scales.filter(t=>0===n.filter(e=>e.name===t.signals.data).length);if(!e.parent||isTopLevelLayer(e)||0===r.length)return n;const i=n.filter(e=>e.name===t.name)[0];let o=i.update;if(0<=o.indexOf(Sr))i.update=`{${r.map(e=>$(e.field)+": "+e.signals.data).join(", ")}}`;else{for(const s of r){var a=$(s.field)+": "+s.signals.data;o.indexOf(a)<0&&(o=o.substring(0,o.length-1)+`, ${a}}`)}i.update=o}return n.concat(r.map(e=>({name:e.signals.data})))},signals:(e,t,n)=>{if(e.parent&&!isTopLevelLayer(e))for(const r of t.scales){const i=n.filter(e=>e.name===r.signals.data)[0];i.push="outer",delete i.value,delete i.update}return n}};function scales_domain(e,t){return`domain(${$(e.scaleName(t))})`}function isTopLevelLayer(e){var t;return e.parent&&isLayerModel(e.parent)&&(null!==(t=!e.parent.parent)?t:isTopLevelLayer(e.parent.parent))}const hr={has:e=>{var t="global"===e.resolve&&e.bind&&isLegendBinding(e.bind),e=1===e.project.items.length&&e.project.items[0].field!==bn;return t&&!e&&warn(x.LEGEND_BINDINGS_MUST_HAVE_PROJECTION),t&&e},parse:(e,t,n,r)=>{var i;if(r.on||delete t.events,r.clear||delete t.clear,r.on||r.clear){var o='event.item && indexof(event.item.mark.role, "legend") < 0';for(const a of t.events)a.filter=array(null!=(i=a.filter)?i:[]),a.filter.indexOf(o)<0&&a.filter.push(o)}const a=isLegendStreamBinding(t.bind)?t.bind.legend:"click";r=isString(a)?eventSelector(a,"view"):array(a);t.bind={legend:{merge:r}}},topLevelSignals:(e,t,n)=>{var r=t.name;const i=isLegendStreamBinding(t.bind)&&t.bind.legend;var o=n=>e=>{const t=g(e);return t.markname=n,t};for(const s of t.project.items)if(s.hasLegend){var a=varName(s.field)+"_legend";const A=r+"_"+a;0===n.filter(e=>e.name===A).length&&(a=i.merge.map(o(a+"_symbols")).concat(i.merge.map(o(a+"_labels"))).concat(i.merge.map(o(a+"_entries"))),n.unshift(Object.assign(Object.assign({name:A},t.init?{}:{value:null}),{on:[{events:a,update:"datum.value || item().items[0].items[0].datum.value",force:!0},{events:i.merge,update:"!event.item || !datum ? null : "+A,force:!0}]})))}return n},signals:(e,t,n)=>{const r=t.name,i=t.project,o=n.find(e=>e.name===r+Qr);var a=r+lr;const s=i.items.filter(e=>e.hasLegend).map(e=>varName(`${r}_${varName(e.field)}_legend`));a=`${s.map(e=>e+" !== null").join(" && ")} ? {fields: ${a}, values: [${s.join(", ")}]} : null`;t.events&&0({signal:e})),update:a}):0e.name===r+gr);a=isLegendStreamBinding(t.bind)&&t.bind.legend;return A&&(t.events?A.on.push(Object.assign(Object.assign({},A.on[0]),{events:a})):A.on[0].events=a),n}};vn=hr;const pr="_translate_anchor",fr="_translate_delta";function onDelta(e,t,n,r,i){var o=t.name,a=o+pr,o=o+fr,s=n.channel;const A=dr.has(t),l=i.filter(e=>e.name===n.signals[A?"data":"visual"])[0];t=e.getSizeSignalRef(r).signal;const c=e.getScaleComponent(s);i=c.get("type"),r=a+".extent_"+s,e=(A&&s===b?"-":"")+o+`.${s} / `+(A?""+t:`span(${r})`),s=(A?"log"===i?"panLog":"pow"===i?"panPow":"panLinear":"panLinear")+`(${r}, `+e+(A&&"pow"===i?", "+(null!=(a=c.get("exponent"))?a:1):"")+")";l.on.push({events:{signal:o},update:A?s:`clampRange(${s}, 0, ${t})`})}const Ir="_zoom_anchor",Cr="_zoom_delta";function zoom_onDelta(e,t,n,r,i){var o=t.name,a=n.channel;const s=dr.has(t),A=i.filter(e=>e.name===n.signals[s?"data":"visual"])[0];t=e.getSizeSignalRef(r).signal;const l=e.getScaleComponent(a);i=l.get("type"),r=s?scales_domain(e,a):A.name,e=o+Cr,o=""+o+Ir+"."+a,r=(s?"log"===i?"zoomLog":"pow"===i?"zoomPow":"zoomLinear":"zoomLinear")+`(${r}, ${o}, `+e+(s&&"pow"===i?", "+(null!=(a=l.get("exponent"))?a:1):"")+")";A.on.push({events:{signal:e},update:s?r:`clampRange(${r}, 0, ${t})`})}const mr=[{has:()=>!0,parse:(n,r,e)=>{const i=r.name,o=null!=(u=r.project)?u:r.project=new SelectionProjectionComponent,a={},s={},A=new Set;var l=(e,t)=>{var n="visual"===t?e.channel:e.field;let r=varName(i+"_"+n);for(let e=1;A.has(r);e++)r=varName(i+`_${n}_`+e);return A.add(r),{[t]:r}};if(!e.fields&&!e.encodings){var t=n.config.selection[e.type];if(e.init)for(const d of array(e.init))for(const h of y(d))!function isSingleDefUnitChannel(e){return be[e]}(h)?"interval"===e.type?(warn(x.INTERVAL_INITIALIZED_WITH_X_Y),e.encodings=t.encodings):(e.fields||(e.fields=[])).push(h):(e.encodings||(e.encodings=[])).push(h);else e.encodings=t.encodings,e.fields=t.fields}for(const p of null!=(u=e.fields)?u:[]){const f={type:"E",field:p};f.signals=Object.assign({},l(f,"data")),o.items.push(f),o.hasField[p]=f}for(const I of null!=(u=e.encodings)?u:[]){var c,g=n.fieldDef(I);if(g){let t=g.field;if(g.aggregate)warn(x.cannotProjectAggregate(I,g.aggregate));else if(t){if(g.timeUnit&&(t=n.vgField(I),c={timeUnit:g.timeUnit,as:t,field:g.field},s[hash(c)]=c),!a[t]){let e="E";"interval"===r.type?hasContinuousDomain(n.getScaleComponent(I).get("type"))&&(e="R"):g.bin&&(e="R-RE");const C={field:t,channel:I,type:e};C.signals=Object.assign(Object.assign({},l(C,"data")),l(C,"visual")),o.items.push(a[t]=C),o.hasField[t]=o.hasChannel[I]=a[t]}}else warn(x.cannotProjectOnChannelWithoutField(I))}else warn(x.cannotProjectOnChannelWithoutField(I))}if(e.init){var u=t=>o.items.map(e=>void 0!==t[e.channel]?t[e.channel]:t[e.field]);if("interval"===e.type)r.init=u(e.init);else{const m=array(e.init);r.init=m.map(u)}}isEmpty(s)||(o.timeUnit=new timeunit_TimeUnitNode(null,s))},signals:(e,t,n)=>{const r=t.name+lr;return 0e.name===r).length?n:n.concat({name:r,value:t.project.items.map(e=>{const{}=e,t=Ar(e,["signals","hasLegend"]);return t.field=replacePathInField(t.field),t})})}},ur,dr,vn,{has:e=>"interval"===e.type&&e.translate,signals:(e,t,n)=>{const r=t.name;var i=dr.has(t),o=r+pr,{x:a,y:s}=t.project.hasChannel;let A=eventSelector(t.translate,"scope");return i||(A=A.map(e=>(e.between[0].markname=r+br,e))),n.push({name:o,value:{},on:[{events:A.map(e=>e.between[0]),update:"{x: x(unit), y: y(unit)"+(void 0!==a?", extent_x: "+(i?scales_domain(e,b):`slice(${a.signals.visual})`):"")+(void 0!==s?", extent_y: "+(i?scales_domain(e,h):`slice(${s.signals.visual})`):"")+"}"}]},{name:r+fr,value:{},on:[{events:A,update:`{x: ${o}.x - x(unit), y: ${o}.y - y(unit)}`}]}),void 0!==a&&onDelta(e,t,a,"width",n),void 0!==s&&onDelta(e,t,s,"height",n),n}},{has:e=>"interval"===e.type&&e.zoom,signals:(e,t,n)=>{const r=t.name;var i=dr.has(t),o=r+Cr,{x:a,y:s}=t.project.hasChannel,A=$(e.scaleName(b)),l=$(e.scaleName(h));let c=eventSelector(t.zoom,"scope");return i||(c=c.map(e=>(e.markname=r+br,e))),n.push({name:r+Ir,on:[{events:c,update:i?"{"+[A?`x: invert(${A}, x(unit))`:"",l?`y: invert(${l}, y(unit))`:""].filter(e=>!!e).join(", ")+"}":"{x: x(unit), y: y(unit)}"}]},{name:o,on:[{events:c,force:!0,update:"pow(1.001, event.deltaY * pow(16, event.deltaMode))"}]}),void 0!==a&&zoom_onDelta(e,t,a,"width",n),void 0!==s&&zoom_onDelta(e,t,s,"height",n),n}},cr,ar,{has:e=>void 0!==e.clear&&!1!==e.clear,parse:(e,t,n)=>{n.clear&&(t.clear=isString(n.clear)?eventSelector(n.clear,"scope"):n.clear)},topLevelSignals:(e,t,n)=>{if(cr.has(t))for(const i of t.project.items){var r=n.findIndex(e=>e.name===varName(t.name+"_"+i.field));-1!==r&&n[r].on.push({events:t.clear,update:"null"})}return n},signals:(e,n,r)=>{function addClear(e,t){-1!==e&&r[e].on&&r[e].on.push({events:n.clear,update:t})}if("interval"===n.type)for(const i of n.project.items){var t=r.findIndex(e=>e.name===i.signals.visual);addClear(t,"[0, 0]"),-1===t&&addClear(r.findIndex(e=>e.name===i.signals.data),"null")}else addClear(r.findIndex(e=>e.name===n.name+Qr),"null"),ur.has(n)&&addClear(r.findIndex(e=>e.name===n.name+gr),"false");return r}}];function forEachTransform(e,t){for(const n of mr)n.has(e)&&t(n)}var yr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rassembleInit(e,t,n));return t?`[${r.join(", ")}]`:r}return isDateTime(e)?n((t?dateTimeToExpr:function dateTimeToTimestamp(e){var t=dateTimeParts(e,!0);return e.utc?+new Date(Date.UTC(...t)):+new Date(...t)})(e)):t?n(JSON.stringify(e)):e}function assembleUnitSelectionMarks(n,r){return forEachSelection(n,(t,e)=>{r=e.marks?e.marks(n,t,r):r,forEachTransform(t,e=>{e.marks&&(r=e.marks(n,t,r))})}),r}function cleanupEmptyOnArray(e){return e.map(e=>(e.on&&!e.on.length&&delete e.on,e))}var Br=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rt.between?n(e,t):(warn(t+" is not an ordered event stream for interval selections."),e),[])}function singleOrMultiSignals(n,e){var t=e.name,r=t+lr;const i=e.project,o="(item().isVoronoi ? datum.datum : datum)";var a=i.items.map(e=>{var t=n.fieldDef(e.channel);return t&&t.bin?`[${o}[${$(n.vgField(e.channel,{}))}], `+o+`[${$(n.vgField(e.channel,{binSuffix:"end"}))}]]`:o+`[${$(e.field)}]`}).join(", "),r=`unit: ${selection_unitName(n)}, fields: ${r}, values`,e=e.events;return[{name:t+Qr,on:e?[{events:e,update:`datum && item().mark.marktype !== 'group' ? {${r}: [${a}]} : null`,force:!0}]:[]}]}const Er="_store",Qr="_tuple";var a,s,wr,c;const Sr="vlSelectionResolve",_r={single:{signals:singleOrMultiSignals,modifyExpr:(e,t)=>{return t.name+Qr+", "+("global"===t.resolve?"true":`{unit: ${selection_unitName(e)}}`)}},multi:{signals:singleOrMultiSignals,modifyExpr:(e,t)=>{return t.name+Qr+", "+("global"===t.resolve?"null":`{unit: ${selection_unitName(e)}}`)}},interval:{signals:(a,s)=>{var e=s.name,t=e+lr,n=dr.has(s);const A=[],l=[],c=[];if(s.translate&&!n){const i="!event.item || event.item.mark.name !== "+$(e+br);interval_events(s,(e,t)=>{var n;const r=array(null!=(n=t.between[0].filter)?n:t.between[0].filter=[]);return r.indexOf(i)<0&&r.push(i),e})}s.project.items.forEach((e,t)=>{var n,r,i,o=e.channel;o!==b&&o!==h?warn("Interval selections only support x and y encoding channels."):(t=s.init?s.init[t]:null,t=function channelSignals(e,t,n,r){const i=n.channel,o=n.signals.visual,a=n.signals.data,s=dr.has(t),A=$(e.scaleName(i)),l=e.getScaleComponent(i),c=l?l.get("type"):void 0,g=e=>`scale(${A}, ${e})`,u=e.getSizeSignalRef(i===b?"width":"height").signal,d=i+"(unit)",h=interval_events(t,(e,t)=>[...e,{events:t.between[0],update:`[${d}, ${d}]`},{events:t,update:`[${o}[0], clamp(${d}, 0, ${u})]`}]);return h.push({events:{signal:t.name+vr},update:hasContinuousDomain(c)?`[${g(a+"[0]")}, ${g(a+"[1]")}]`:"[0, 0]"}),s?[{name:a,on:[]}]:[Object.assign(Object.assign({name:o},r?{init:assembleInit(r,!0,g)}:{value:[]}),{on:h}),Object.assign(Object.assign({name:a},r?{init:assembleInit(r)}:{}),{on:[{events:{signal:o},update:`${o}[0] === ${o}[1] ? null : invert(${A}, ${o})`}]})]}(a,s,e,t),n=e.signals.data,e=e.signals.visual,r=$(a.scaleName(o)),i=hasContinuousDomain(a.getScaleComponent(o).get("type"))?"+":"",A.push(...t),l.push(n),c.push({scaleName:a.scaleName(o),expr:`(!isArray(${n}) || `+`(${i}invert(${r}, ${e})[0] === ${i}${n}[0] && `+i+`invert(${r}, ${e})[1] === ${i}${n}[1]))`}))}),n||A.push({name:e+vr,value:{},on:[{events:c.map(e=>({scale:e.scaleName})),update:c.map(e=>e.expr).join(" && ")+` ? ${e+vr} : {}`}]});n=s.init,t=`unit: ${selection_unitName(a)}, fields: ${t}, values`;return A.concat(Object.assign(Object.assign({name:e+Qr},n?{init:`{${t}: ${assembleInit(n)}}`}:{}),{on:[{events:[{signal:l.join(" || ")}],update:l.join(" && ")+` ? {${t}: [${l}]} : null`}]}))},modifyExpr:(e,t)=>{return t.name+Qr+", "+("global"===t.resolve?"true":`{unit: ${selection_unitName(e)}}`)},marks:(e,t,n)=>{var r=t.name;const{x:i,y:o}=t.project.hasChannel,a=i&&i.signals.visual,s=o&&o.signals.visual;var A=`data(${$(t.name+Er)})`;if(dr.has(t))return n;const l={x:void 0!==i?{signal:a+"[0]"}:{value:0},y:void 0!==o?{signal:s+"[0]"}:{value:0},x2:void 0!==i?{signal:a+"[1]"}:{field:{group:"width"}},y2:void 0!==o?{signal:s+"[1]"}:{field:{group:"height"}}};if("global"===t.resolve)for(const p of y(l))l[p]=[Object.assign({test:A+`.length && ${A}[0].unit === `+selection_unitName(e)},l[p]),{value:0}];const c=t.mark,{fill:g,fillOpacity:u,cursor:d}=c,h=Br(c,["fill","fillOpacity","cursor"]);t=y(h).reduce((e,t)=>(e[t]=[{test:[void 0!==i&&`${a}[0] !== ${a}[1]`,void 0!==o&&`${s}[0] !== ${s}[1]`].filter(e=>e).join(" && "),value:h[t]},{value:null}],e),{});return[{name:r+br+"_bg",type:"rect",clip:!0,encode:{enter:{fill:{value:g},fillOpacity:{value:u}},update:l}},...n,{name:r+br,type:"rect",clip:!0,encode:{enter:Object.assign(Object.assign({},d?{cursor:{value:d}}:{}),{fill:{value:"transparent"}}),update:Object.assign(Object.assign({},l),t)}}]}}};function forEachSelection(e,t){e=e.component.selection;if(e)for(const n of B(e))if(!0===t(n,_r[n.type]))break}function selection_unitName(e,{escape:t}={escape:!0}){let n=t?$(e.name):e.name;const r=function getFacetModel(e){let t=e.parent;for(;t&&!isFacetModel(t);)t=t.parent;return t}(e);if(r){var i=r["facet"];for(const o of me)i[o]&&(n+=` + '__facet_${o}_' + (facet[${$(r.vgField(o))}])`)}return n}function requiresSelectionId(e){let t=!1;return forEachSelection(e,e=>{t=t||e.project.items.some(e=>e.field===bn)}),t}function ASTNode(e){this.type=e}ASTNode.prototype.visit=function(e){let t,n,r;if(e(this))return 1;for(t=function vega_expression_module_children(e){switch(e.type){case"ArrayExpression":return e.elements;case"BinaryExpression":case"LogicalExpression":return[e.left,e.right];case"CallExpression":return[e.callee].concat(e.arguments);case"ConditionalExpression":return[e.test,e.consequent,e.alternate];case"MemberExpression":return[e.object,e.property];case"ObjectExpression":return e.properties;case"Property":return[e.key,e.value];case"UnaryExpression":return[e.argument];default:return[]}}(this),n=0,r=t.length;n",n[3]="Identifier",n[4]="Keyword",n[5]="Null",n[6]="Numeric",n[Rr]="Punctuator",n[8]="String",n[9]="RegularExpression","ConditionalExpression"),Dr="Identifier",Gr="Unexpected token %0",Nr="Invalid regular expression",kr="Invalid regular expression: missing /",Tr="Octal literals are not allowed in strict mode.",Mr="ILLEGAL",Ur="Disabled.",Or=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Lr=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function assert(e,t){if(!e)throw new Error("ASSERT: "+t)}function isDecimalDigit(e){return 48<=e&&e<=57}function isHexDigit(e){return 0<="0123456789abcdefABCDEF".indexOf(e)}function isOctalDigit(e){return 0<="01234567".indexOf(e)}function isLineTerminator(e){return 10===e||13===e||8232===e||8233===e}function isIdentifierStart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||92===e||128<=e&&Or.test(String.fromCharCode(e))}function isIdentifierPart(e){return 36===e||95===e||65<=e&&e<=90||97<=e&&e<=122||48<=e&&e<=57||92===e||128<=e&&Lr.test(String.fromCharCode(e))}const Pr={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function skipComment(){for(;s>>="===(t=a.substr(s,4))?{type:Rr,value:t,start:n,end:s+=4}:">>>"===(t=t.substr(0,3))||"<<="===t||">>="===t?{type:Rr,value:t,start:n,end:s+=3}:i===(t=t.substr(0,2))[1]&&0<="+-<>&|".indexOf(i)||"=>"===t?{type:Rr,value:t,start:n,end:s+=2}:("//"===t&&throwError({},Gr,Mr),0<="<>=!+-*%&|^/".indexOf(i)?{type:Rr,value:i,start:n,end:++s}:void throwError({},Gr,Mr))}function scanNumericLiteral(){var e,t,n=a[s];if(assert(isDecimalDigit(n.charCodeAt(0))||"."===n,"Numeric literal must start with a decimal digit or a decimal point"),t=s,e="","."!==n){if(e=a[s++],n=a[s],"0"===e){if("x"===n||"X"===n)return++s,function scanHexLiteral(e){let t="";for(;s>10),56320+(t-65536&1023))}()):r+=scanHexEscape(t);break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:isOctalDigit(t)?(0!==(n="01234567".indexOf(t))&&(i=!0),s{if(parseInt(t,16)<=1114111)return"x";throwError({},Nr)}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x"));try{new RegExp(n)}catch(e){throwError({},Nr)}try{return new RegExp(e,t)}catch(e){return null}}(t.value,n.value),{literal:t.literal+n.literal,value:r,regex:{pattern:t.value,flags:n.value},start:e,end:s}}function advance(){if(skipComment(),wr<=s)return{type:xr,start:s,end:s};var e=a.charCodeAt(s);return(isIdentifierStart(e)?scanIdentifier:40===e||41===e||59===e?scanPunctuator:39===e||34===e?scanStringLiteral:46===e?isDecimalDigit(a.charCodeAt(s+1))?scanNumericLiteral:scanPunctuator:isDecimalDigit(e)?scanNumericLiteral:scanPunctuator)()}function lex(){var e=c;return s=e.end,c=advance(),s=e.end,e}function vega_expression_module_peek(){var e=s;c=advance(),s=e}function finishBinaryExpression(e,t,n){const r=new ASTNode("||"===e||"&&"===e?"LogicalExpression":"BinaryExpression");return r.operator=e,r.left=t,r.right=n,r}function finishIdentifier(e){const t=new ASTNode(Dr);return t.name=e,t}function finishLiteral(e){const t=new ASTNode("Literal");return t.value=e.value,t.raw=a.slice(e.start,e.end),e.regex&&("//"===t.raw&&(t.raw="/(?:)/"),t.regex=e.regex),t}function finishMemberExpression(e,t,n){const r=new ASTNode("MemberExpression");return r.computed="["===e,r.object=t,r.property=n,r.computed||(n.member=!0),r}function finishProperty(e,t,n){const r=new ASTNode("Property");return r.key=t,r.value=n,r.kind=e,r}function throwError(e,t){var n=Array.prototype.slice.call(arguments,2),t=t.replace(/%(\d)/g,(e,t)=>(assert(t":case"<=":case">=":case"instanceof":case"in":t=7;break;case"<<":case">>":case">>>":t=8;break;case"+":case"-":t=9;break;case"*":case"/":case"%":t=11}return t}function parseConditionalExpression(){var e,t=function parseBinaryExpression(){var e,t,n,r,i,o,a=c,s=parseUnaryExpression(),A=c,l=binaryPrecedence(A);if(0===l)return s;for(A.prec=l,lex(),e=[a,c],n=[s,A,parseUnaryExpression()];0<(l=binaryPrecedence(c));){for(;2{"MemberExpression"===e.type&&function startsWithDatum(e){return"MemberExpression"===e.object.type?startsWithDatum(e.object):"datum"===e.object.name}(e)&&n.add(function getName(e){const t=[];return"Identifier"===e.type?[e.name]:"Literal"===e.type?[e.value]:("MemberExpression"===e.type&&(t.push(...getName(e.object)),t.push(...getName(e.property))),t)}(e).slice(1).join("."))}),n}class filter_FilterNode extends dataflow_DataFlowNode{constructor(e,t,n){super(e),this.model=t,this.filter=n,this.expr=predicate_expression(this.model,this.filter,this),this._dependentFields=getDependentFields(this.expr)}clone(){return new filter_FilterNode(null,this.model,g(this.filter))}dependentFields(){return this._dependentFields}producedFields(){return new Set}assemble(){return{type:"filter",expr:this.expr}}hash(){return"Filter "+this.expr}}var Zr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r`length(data(${e}))`).join(" || ")+") || ":"")+`(${e})`}function parseSelectionBinExtent(e,t){const n=t.encoding;let r=t.field;var i;return n||r?n&&!r&&(!(i=e.project.items.filter(e=>e.channel===n)).length||1isString(e)?e:function isSelectionPredicate(e){return null!=e&&e.selection}(e)?parseSelectionPredicate(t,e.selection,n):fieldFilterExpression(e))}var Wr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var t=e["test"],e=Wr(e,["test"]);return Object.assign({test:predicate_expression(null,t)},e)}),h],setAxisEncode(g,I,p,f),delete g[m]):null===u&&(I={signal:y.map(e=>{var t=e["test"],e=Wr(e,["test"]);return`${predicate_expression(null,t)} ? ${exprFromValueOrSignalRef(e)} : `}).join("")+exprFromValueOrSignalRef(h)},g[m]=I)}else!isSignalRef(d)||(p=Q[m])&&({vgProp:f,part:u}=p,setAxisEncode(g,u,f,d),delete g[m])}if("grid"===t){if(g.grid)return g.encode&&(C=g.encode["grid"],g.encode=Object.assign({},C?{grid:C}:{}),isEmpty(g.encode)&&delete g.encode),Object.assign(Object.assign({scale:s,orient:a},g),{domain:!1,labels:!1,aria:!1,maxExtent:0,minExtent:0,ticks:!1,zindex:getFirstDefined(c,0)})}else if(r.header||!e.mainExtracted){if(void 0!==A){let e=A;null!=(r=null==(C=g.encode)?void 0:C.labels)&&r.update&&isSignalRef(g.encode.labels.update.text)&&(e=replaceAll(A,"datum.label",g.encode.labels.update.text.signal)),setAxisEncode(g,"labels","text",{signal:e})}if(null===g.labelAlign&&delete g.labelAlign,g.encode){for(const B of w)e.hasAxisPart(B)||delete g.encode[B];isEmpty(g.encode)&&delete g.encode}var C=function assembleTitle(e,t){if(e)return R(e)&&!isText(e)?e.map(e=>defaultTitle(e,t)).join(", "):e}(l,n);return Object.assign(Object.assign(Object.assign(Object.assign({scale:s,orient:a,grid:!1},C?{title:C}:{}),g),!1===n.aria?{aria:!1}:{}),{zindex:getFirstDefined(c,0)})}}}function assembleAxisSignals(e){var t,n,r=e.component["axes"];const i=[];for(const o of Se)if(r[o])for(const a of r[o])a.get("disable")||a.get("gridScale")||(t="x"===o?"height":"width")!==(n=e.getSizeSignalRef(t).signal)&&i.push({name:t,update:n});return i}function getAxisConfigFromConfigTypes(e,s,A,l){return Object.assign.apply(null,[{},...e.map(e=>{if("axisOrient"!==e)return s[e];{var t="x"===A?"bottom":"left",n=s["x"===A?"axisBottom":"axisLeft"]||{},r=s["x"===A?"axisTop":"axisRight"]||{};const i=new Set([...y(n),...y(r)]),o={};for(const a of i.values())o[a]={signal:`${l.signal} === "${t}" ? ${signalOrStringValue(n[a])} : `+signalOrStringValue(r[a])};return o}})])}function getAxisConfigs(e,t,n,r){const i="band"===t?["axisDiscrete","axisBand"]:"point"===t?["axisDiscrete","axisPoint"]:function isQuantitative(e){return e in bt}(t)?["axisQuantitative"]:"time"===t||"utc"===t?["axisTemporal"]:[],o="x"===e?"axisX":"axisY";var t=isSignalRef(n)?"axisOrient":"axis"+titleCase(n),a=[...i,...i.map(e=>o+e.substr(4))],t=["axis",t,o];return{vlOnlyAxisConfig:getAxisConfigFromConfigTypes(a,r,e,n),vgAxisConfig:getAxisConfigFromConfigTypes(t,r,e,n),axisConfigStyle:function getAxisConfigStyle(e,t){const n=[{}];for(const i of e){var r=null==(r=t[i])?void 0:r.style;if(r)for(const o of r=array(r))n.push(t.style[o])}return Object.assign.apply(null,n)}([...t,...a],r)}}function getAxisConfig(e,t,n,r={}){var i,n=getStyleConfig(e,n,t);if(void 0!==n)return{configFrom:"style",configValue:n};for(const o of["vlOnlyAxisConfig","vgAxisConfig","axisConfigStyle"])if(void 0!==(null==(i=r[o])?void 0:i[e]))return{configFrom:o,configValue:r[o][e]};return{}}const Hr={scale:({model:e,channel:t})=>e.scaleName(t),format:({fieldOrDatumDef:e,config:t,axis:n})=>{var{format:n,formatType:r}=n;return guideFormat(e,e.type,n,r,t,!0)},formatType:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{e=e.formatType;return guideFormatType(e,t,n)},grid:({fieldOrDatumDef:e,axis:t,scaleType:n})=>{return(!isFieldDef(e)||!isBinned(e.bin))&&(null!=(t=t.grid)?t:function defaultGrid(e,t){return!hasDiscreteDomain(e)&&isFieldDef(t)&&!isBinning(null==t?void 0:t.bin)}(n,e))},gridScale:({model:e,channel:t})=>function gridScale(e,t){t="x"===t?"y":"x";if(e.getScaleComponent(t))return e.scaleName(t);return}(e,t),labelAlign:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelAlign||defaultLabelAlign(t,n,r),labelAngle:({labelAngle:e})=>e,labelBaseline:({axis:e,labelAngle:t,orient:n,channel:r})=>e.labelBaseline||defaultLabelBaseline(t,n,r),labelFlush:({axis:e,fieldOrDatumDef:t,channel:n})=>{return null!=(e=e.labelFlush)?e:function defaultLabelFlush(e,t){if("x"===t&&util_contains(["quantitative","temporal"],e))return!0;return}(t.type,n)},labelOverlap:({axis:e,fieldOrDatumDef:t,scaleType:n})=>{return null!=(e=e.labelOverlap)?e:function defaultLabelOverlap(e,t,n,r){if(n&&!isObject(r)||"nominal"!==e&&"ordinal"!==e)return"log"!==t&&"symlog"!==t||"greedy";return}(t.type,n,isFieldDef(t)&&!!t.timeUnit,isFieldDef(t)?t.sort:void 0)},orient:({orient:e})=>e,tickCount:({channel:e,model:t,axis:n,fieldOrDatumDef:r,scaleType:i})=>{var e="x"===e?"width":"y"===e?"height":void 0,t=e?t.getSizeSignalRef(e):void 0;return null!=(e=n.tickCount)?e:function defaultTickCount({fieldOrDatumDef:e,scaleType:t,size:n,values:r}){if(!r&&!hasDiscreteDomain(t)&&"log"!==t){if(isFieldDef(e)){if(isBinning(e.bin))return{signal:`ceil(${n.signal}/10)`};if(e.timeUnit&&util_contains(["month","hours","day","quarter"],null==(r=normalizeTimeUnit(e.timeUnit))?void 0:r.unit))return}return{signal:`ceil(${n.signal}/40)`}}}({fieldOrDatumDef:r,scaleType:i,size:t,values:n.values})},title:({axis:e,model:t,channel:n})=>{if(void 0!==e.title)return e.title;e=getFieldDefTitle(t,n);if(void 0!==e)return e;e=t.typedFieldDef(n),t=t.fieldDef("x"===n?"x2":"y2");return mergeTitleFieldDefs(e?[toFieldDefBase(e)]:[],isFieldDef(t)?[toFieldDefBase(t)]:[])},values:({axis:e,fieldOrDatumDef:t})=>function properties_values(e,t){e=e.values;{if(R(e))return valueArray(t,e);if(isSignalRef(e))return e}return}(e,t),zindex:({axis:e,fieldOrDatumDef:t,mark:n})=>{return null!=(e=e.zindex)?e:function defaultZindex(e,t){if("rect"===e&&isDiscrete(t))return 1;return 0}(n,t)}};function normalizeAngleExpr(e){return`(((${e.signal} % 360) + 360) % 360)`}function defaultLabelBaseline(e,t,n,r){if(void 0!==e)return"x"===n?isSignalRef(e)?{signal:`(45 < ${n=normalizeAngleExpr(e)} && ${n} < 135) || (225 < ${n} && ${n} < 315) ? "middle" :`+`(${n} <= 45 || 315 <= ${n}) === ${isSignalRef(t)?`(${t.signal} === "top")`:"top"===t} ? "bottom" : "top"`}:45{if(isScaleFieldDef(e)&&isSortArray(e.sort)){const{field:r,timeUnit:i}=e,o=e.sort;var n=o.map((e,t)=>fieldFilterExpression({field:r,timeUnit:i,equal:e})+` ? ${t} : `).join("")+o.length;a=new calculate_CalculateNode(a,{calculate:n,as:sortArrayIndexField(e,t,{forAs:!0})})}}),a}producedFields(){return new Set([this.transform.as])}dependentFields(){return this._dependentFields}assemble(){return{type:"formula",expr:this.transform.calculate,as:this.transform.as}}hash(){return"Calculate "+hash(this.transform)}}function sortArrayIndexField(e,t,n){return vgField(e,Object.assign({prefix:t,suffix:"sort_index"},null!=n?n:{}))}function getHeaderChannel(e,t){return!util_contains(["top","bottom"],t)&&(util_contains(["left","right"],t)||"row"===e)?"row":"column"}function getHeaderProperty(e,t,n,r){r="row"===r?n.headerRow:"column"===r?n.headerColumn:n.headerFacet;return getFirstDefined((t||{})[e],r[e],n.header[e])}function getHeaderProperties(e,t,n,r){const i={};for(const a of e){var o=getHeaderProperty(a,t||{},n,r);void 0!==o&&(i[a]=o)}return i}const jr=["row","column"],Yr=["header","footer"];function defaultHeaderGuideAlign(e,t,n="middle"){switch(n){case"start":return{align:"left"};case"end":return{align:"right"}}n=defaultLabelAlign(t,"row"===e?"left":"top","row"===e?"y":"x");return n?{align:n}:{}}function defaultHeaderGuideBaseline(e,t){e=defaultLabelBaseline(e,"row"===t?"left":"top","row"===t?"y":"x",!0);return e?{baseline:e}:{}}function assembleHeaderGroups(e,t){var n=e.component.layoutHeaders[t];const r=[];for(const o of Yr)if(n[o])for(const a of n[o]){var i=function assembleHeaderGroup(t,n,r,i,o){if(o){let e=null;var a,s=i["facetFieldDef"],A=t.config||void 0,l=(s&&o.labels&&(l=getHeaderProperties(["labelOrient"],s.header,A,n)["labelOrient"],("row"===n&&!util_contains(["top","bottom"],l)||"column"===n&&!util_contains(["left","right"],l))&&(e=assembleLabelTitle(s,n,A))),isFacetModel(t)&&!isFacetMapping(t.facet)),A=o.axes,c=0<(null==A?void 0:A.length);if(e||c)return a="row"===n?"height":"width",Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:t.getName(n+"_"+r),type:"group",role:n+"-"+r},i.facetFieldDef?{from:{data:t.getName(n+"_domain")},sort:function getSort(e,t){var n;var r=e["sort"];return isSortField(r)?{field:vgField(r,{expr:"datum"}),order:null!=(n=r.order)?n:"ascending"}:R(r)?{field:sortArrayIndexField(e,t,{expr:"datum"}),order:"ascending"}:{field:vgField(e,{expr:"datum"}),order:null!=r?r:"ascending"}}(s,n)}:{}),c&&l?{from:{data:t.getName("facet_domain_"+n)}}:{}),e?{title:e}:{}),o.sizeSignal?{encode:{update:{[a]:o.sizeSignal}}}:{}),c?{axes:A}:{})}return null}(e,t,o,n,a);null!=i&&r.push(i)}return r}function assembleLabelTitle(e,t,n){var{format:r,formatType:i,labelAngle:o,labelAnchor:a,labelOrient:s,labelExpr:A}=getHeaderProperties(["format","formatType","labelAngle","labelAnchor","labelOrient","labelExpr"],e.header,n,t),r=formatSignalRef({fieldOrDatumDef:e,format:r,formatType:i,expr:"parent",config:n}).signal,i=getHeaderChannel(t,s);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:{signal:A?replaceAll(replaceAll(A,"datum.label",r),"datum.value",vgField(e,{expr:"parent"})):r}},"row"===t?{orient:"left"}:{}),{style:"guide-label",frame:"group"}),defaultHeaderGuideBaseline(o,i)),defaultHeaderGuideAlign(i,o,a)),assembleHeaderProperties(n,e,t,In,pn))}const zr={column:{start:0,end:1},row:{start:1,end:0}};function assembleLayoutTitleBand(e,t){const n={};for(const o of me){var r,i=e[o];null!=i&&i.facetFieldDef&&({titleAnchor:i,titleOrient:r}=getHeaderProperties(["titleAnchor","titleOrient"],i.facetFieldDef.header,t,o),void 0!==(r=function getLayoutTitleBand(e,t){return zr[t][e]}(i,i=getHeaderChannel(o,r)))&&(n[i]=r))}return isEmpty(n)?void 0:n}function assembleHeaderProperties(e,t,n,r,i){const o={};for(const s of r){var a;i[s]&&(void 0!==(a=getHeaderProperty(s,null==t?void 0:t.header,e,n))&&(o[i[s]]=a))}return o}function assembleLayoutSignals(e){return[...sizeSignals(e,"width"),...sizeSignals(e,"height"),...sizeSignals(e,"childWidth"),...sizeSignals(e,"childHeight")]}function sizeSignals(e,t){var n="width"===t?"x":"y",r=e.component.layoutSize.get(t);if(!r||"merged"===r)return[];const i=e.getSizeSignalRef(t).signal;if("step"!==r)return"container"==r?(o=`isFinite(${o=(t=i.endsWith("width"))?"containerSize()[0]":"containerSize()[1]"}) ? ${o} : `+getViewConfigContinuousSize(e.config.view,t?"width":"height"),[{name:i,init:o,on:[{update:o,events:"window:resize"}]}]):[{name:i,value:r}];{const a=e.getScaleComponent(n);if(a){var t=a.get("type"),o=a.get("range");if(hasDiscreteDomain(t)&&o.step){r=e.scaleName(n);if(isFacetModel(e.parent))if("independent"===e.parent.component.resolve.scale[n])return[stepSignal(r,o)];return[stepSignal(r,o),{name:i,update:sizeExpr(r,a,`domain('${r}').length`)}]}}throw new Error("layout size is step although width/height is not step.")}}function stepSignal(e,t){return{name:e+"_step",value:t.step}}function sizeExpr(e,t,n){var r=t.get("type"),i=t.get("padding"),o=getFirstDefined(t.get("paddingOuter"),i);let a=t.get("paddingInner");return`bandspace(${n}, ${signalOrStringValue(a="band"===r?void 0!==a?a:i:1)}, ${signalOrStringValue(o)}) * ${e}_step`}function getSizeTypeFromLayoutSizeType(e){return"childWidth"===e?"width":"childHeight"===e?"height":e}function guideEncodeEntry(r,i){return y(r).reduce((e,t)=>{var n=r[t];return Object.assign(Object.assign({},e),wrapCondition(i,n,t,e=>signalOrValueRef(e.value)))},{})}function parseGuideResolve(e,t){var n=e.scale[t],r=isXorY(t)?"axis":"legend";return"independent"===n?("shared"===e[r][t]&&warn(x.independentScaleMeansIndependentGuide(t)),"independent"):e[r][t]||"shared"}e=Object.assign(Object.assign({},yn),{disable:1,labelExpr:1,selections:1,opacity:1,shape:1,stroke:1,fill:1,size:1,strokeWidth:1,strokeDash:1,encode:1});const Jr=y(e);class component_LegendComponent extends split_Split{}const Kr={symbols:function symbols(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i,legendType:o}){if("symbol"!==o)return;var{markDef:o,encoding:a,config:s,mark:A}=n,A=o.filled&&"trail"!==A;let l=Object.assign(Object.assign({},function applyMarkConfig(e,t,n){for(const i of n){var r=getMarkConfig(i,t.markDef,t.config);void 0!==r&&(e[i]=signalOrValueRef(r))}return e}({},n,Pt)),color_color(n,{filled:A}));var c=null!=(c=i.get("symbolOpacity"))?c:s.legend.symbolOpacity,g=null!=(g=i.get("symbolFillColor"))?g:s.legend.symbolFillColor,u=null!=(u=i.get("symbolStrokeColor"))?u:s.legend.symbolStrokeColor,c=void 0===c?null!=(c=getMaxValue(a.opacity))?c:o.opacity:void 0;l.fill&&("fill"===r||A&&r===K?delete l.fill:l.fill.field?g?delete l.fill:(l.fill=signalOrValueRef(null!=(g=s.legend.symbolBaseFillColor)?g:"black"),l.fillOpacity=signalOrValueRef(null!=c?c:1)):R(l.fill)&&(g=null!=(g=null!=(g=getFirstConditionValue(null!=(g=a.fill)?g:a.color))?g:o.fill)?g:A&&o.color)&&(l.fill=signalOrValueRef(g)));l.stroke&&("stroke"===r||!A&&r===K||l.stroke.field||u?delete l.stroke:R(l.stroke)&&(g=getFirstDefined(getFirstConditionValue(a.stroke||a.color),o.stroke,A?o.color:void 0))&&(l.stroke={value:g}));r!==re&&((u=isFieldDef(t)&&selectedCondition(0,i,t))?l.opacity=[Object.assign({test:u},signalOrValueRef(null!=c?c:1)),signalOrValueRef(s.legend.unselectedOpacity)]:c&&(l.opacity=signalOrValueRef(c)));return isEmpty(l=Object.assign(Object.assign({},l),e))?void 0:l},gradient:function gradient(e,{model:t,legendType:n,legendCmpt:r}){if("gradient"!==n)return;var{config:n,markDef:t,encoding:i}=t;let o={};r=null!=(r=r.get("gradientOpacity"))?r:n.legend.gradientOpacity,n=void 0===r?getMaxValue(i.opacity)||t.opacity:void 0;n&&(o.opacity=signalOrValueRef(n));return isEmpty(o=Object.assign(Object.assign({},o),e))?void 0:o},labels:function encode_labels(e,{fieldOrDatumDef:t,model:n,channel:r,legendCmpt:i}){var r=n.legend(r)||{},o=n.config,n=isFieldDef(t)?selectedCondition(0,i,t):void 0,i=n?[{test:n,value:1},{value:o.legend.unselectedOpacity}]:void 0,{format:n,formatType:r}=r,t=isCustomFormatType(r)?formatCustomType({fieldOrDatumDef:t,field:"datum.value",format:n,formatType:r,config:o}):void 0,n=Object.assign(Object.assign(Object.assign({},i?{opacity:i}:{}),t?{text:t}:{}),e);return isEmpty(n)?void 0:n},entries:function encode_entries(e,{legendCmpt:t}){t=t.get("selections");return null!=t&&t.length?Object.assign(Object.assign({},e),{fill:{value:"transparent"}}):e}};function getMaxValue(e){return getConditionValue(e,(e,t)=>Math.max(e,t.value))}function getFirstConditionValue(e){return getConditionValue(e,(e,t)=>getFirstDefined(e,t.value))}function getConditionValue(e,t){return function hasConditionalValueDef(e){return(e=e&&e.condition)&&(R(e)||isValueDef(e))}(e)?array(e.condition).reduce(t,e.value):isValueDef(e)?e.value:void 0}function selectedCondition(e,t,n){const r=t.get("selections");if(null!==r&&void 0!==r&&r.length){const i=$(n.field);return r.map(e=>{return`(!length(data(${$(varName(e)+Er)})) || (${e}[${i}] && indexof(${e}[${i}], datum.value) >= 0))`}).join(" || ")}}const Xr={direction:({direction:e})=>e,format:({fieldOrDatumDef:e,legend:t,config:n})=>{var{format:t,formatType:r}=t;return guideFormat(e,e.type,t,r,n,!1)},formatType:({legend:e,fieldOrDatumDef:t,scaleType:n})=>{e=e.formatType;return guideFormatType(e,t,n)},gradientLength:e=>{var{legend:t,legendConfig:n}=e;return null!=(t=null!=(t=t.gradientLength)?t:n.gradientLength)?t:function defaultGradientLength({legendConfig:e,model:t,direction:n,orient:r,scaleType:i}){var{gradientHorizontalMaxLength:e,gradientHorizontalMinLength:o,gradientVerticalMaxLength:a,gradientVerticalMinLength:s}=e;if(isContinuousToContinuous(i))return"horizontal"===n?"top"===r||"bottom"===r?gradientLengthSignal(t,"width",o,e):o:gradientLengthSignal(t,"height",s,a);return}(e)},labelOverlap:({legend:e,legendConfig:t,scaleType:n})=>{return null!=(e=null!=(e=e.labelOverlap)?e:t.labelOverlap)?e:function properties_defaultLabelOverlap(e){if(util_contains(["quantile","threshold","log","symlog"],e))return"greedy";return}(n)},symbolType:({legend:e,markDef:t,channel:n,encoding:r})=>{return null!=(e=e.symbolType)?e:function defaultSymbolType(e,t,n,r){if("shape"!==t){n=null!=(t=getFirstConditionValue(n))?t:r;if(n)return n}switch(e){case"bar":case"rect":case"image":case"square":return"square";case"line":case"trail":case"rule":return"stroke";case"arc":case"point":case"circle":case"tick":case"geoshape":case"area":case"text":return"circle"}}(t.type,n,r.shape,t.shape)},title:({fieldOrDatumDef:e,config:t})=>channeldef_title(e,t,{allowDisabling:!0}),type:({legendType:e,scaleType:t,channel:n})=>{if(isColorChannel(n)&&isContinuousToContinuous(t)){if("gradient"===e)return}else if("symbol"===e)return;return e},values:({fieldOrDatumDef:e,legend:t})=>function legend_properties_values(e,t){e=e.values;{if(R(e))return valueArray(t,e);if(isSignalRef(e))return e}return}(t,e)};function getLegendType(e){var t=e["legend"];return getFirstDefined(t.type,function properties_defaultType({channel:e,timeUnit:t,scaleType:n}){if(isColorChannel(e)){if(util_contains(["quarter","month","day"],t))return"symbol";if(isContinuousToContinuous(n))return"gradient"}return"symbol"}(e))}function getDirection({legendConfig:e,legendType:t,orient:n,legend:r}){return null!=(r=null!=(r=r.direction)?r:e[t?"gradientDirection":"symbolDirection"])?r:function defaultDirection(e,t){switch(e){case"top":case"bottom":return"horizontal";case"left":case"right":case"none":case void 0:return;default:return"gradient"===t?"horizontal":void 0}}(n,t)}function gradientLengthSignal(e,t,n,r){return{signal:`clamp(${e.getSizeSignalRef(t).signal}, ${n}, ${r})`}}function parseLegend(e){var t=(isUnitModel(e)?function parseUnitLegend(e){const t=e["encoding"],n={};for(const i of[K,...mn]){var r=getFieldOrDatumDef(t[i]);r&&e.getScaleComponent(i)&&(i===ee&&isFieldDef(r)&&r.type===ft||(n[i]=function parseLegendForChannel(e,t){let n=e.legend(t);const{markDef:r,encoding:i,config:o}=e,a=o.legend,s=new component_LegendComponent({},function getLegendDefWithScale(e,t){var n=e.scaleName(t);if("trail"===e.mark){if("color"===t)return{stroke:n};if("size"===t)return{strokeWidth:n}}return"color"!==t?{[t]:n}:e.markDef.filled?{fill:n}:{stroke:n}}(e,t)),A=(function parseInteractiveLegend(e,i,o){var t;const a=null==(t=e.fieldDef(i))?void 0:t.field;forEachSelection(e,e=>{var t;const n=null!=(t=e.project.hasField[a])?t:e.project.hasChannel[i];if(n&&hr.has(e)){const r=null!=(t=o.get("selections"))?t:[];r.push(e.name),o.set("selections",r,!1),n.hasLegend=!0}})}(e,t,s),void 0!==n?!n:a.disable);if(s.set("disable",A,void 0!==n),A)return s;n=n||{};var l=e.getScaleComponent(t).get("type"),c=getFieldOrDatumDef(i[t]),g=!isFieldDef(c)||null==(g=normalizeTimeUnit(c.timeUnit))?void 0:g.unit,u=n.orient||o.legend.orient||"right",d=getLegendType({legend:n,channel:t,timeUnit:g,scaleType:l}),g=getDirection({legend:n,legendType:d,orient:u,legendConfig:a}),h={legend:n,channel:t,model:e,markDef:r,encoding:i,fieldOrDatumDef:c,legendConfig:a,config:o,scaleType:l,orient:u,legendType:d,direction:g};for(const b of Jr){var p,f;"gradient"===d&&b.startsWith("symbol")||"symbol"===d&&b.startsWith("gradient")||(void 0===(p=b in Xr?Xr[b](h):n[b])||!(f=function isExplicit(e,t,n,r){switch(t){case"disable":return void 0!==n;case"values":return!(null==n||!n.values);case"title":if("title"===t&&e===(null==r?void 0:r.title))return!0}return e===(n||{})[t]}(p,b,n,e.fieldDef(t)))&&void 0!==o.legend[b]||s.set(b,p,f))}const I=null!=(l=null===n||void 0===n?void 0:n.encoding)?l:{},C=s.get("selections"),m={},y={fieldOrDatumDef:c,model:e,channel:t,legendCmpt:s,legendType:d};for(const v of["labels","legend","title","symbols","gradient","entries"]){var B=guideEncodeEntry(null!=(B=I[v])?B:{},e),B=v in Kr?Kr[v](B,y):B;void 0===B||isEmpty(B)||(m[v]=Object.assign(Object.assign(Object.assign({},null!=C&&C.length&&isFieldDef(c)?{name:varName(c.field)+"_legend_"+v}:{}),null!=C&&C.length?{interactive:!!C}:{}),{update:B}))}isEmpty(m)||s.set("encode",m,!(null===n||void 0===n||!n.encoding));return s}(e,i)))}return n}:function parseNonUnitLegend(e){const{legends:t,resolve:n}=e.component;for(const r of e.children){parseLegend(r);for(const i of y(r.component.legends))n.legend[i]=parseGuideResolve(e.component.resolve,i),"shared"===n.legend[i]&&(t[i]=mergeLegendComponent(t[i],r.component.legends[i]),t[i]||(n.legend[i]="independent",delete t[i]))}for(const o of y(t))for(const a of e.children)a.component.legends[o]&&"shared"===n.legend[o]&&delete a.component.legends[o];return t})(e);e.component.legends=t}function mergeLegendComponent(e,t){if(!e)return t.clone();var r=e.getWithExplicit("orient"),i=t.getWithExplicit("orient");if(!r.explicit||!i.explicit||r.value===i.value){let n=!1;for(const a of Jr){var o=mergeValuesWithExplicit(e.getWithExplicit(a),t.getWithExplicit(a),a,"legend",(e,t)=>{switch(a){case"symbolType":return function mergeSymbolType(e,t){return"circle"!==t.value?e:t}(e,t);case"title":return mergeTitleComponent(e,t);case"type":return n=!0,makeImplicit("symbol")}return defaultTieBreaker(e,t,a,"legend")});e.setWithExplicit(a,o)}return n&&(null!=(i=null==(r=e.implicit)?void 0:r.encode)&&i.gradient&&deleteNestedProperty(e.implicit,["encode","gradient"]),null!=(i=null==(r=e.explicit)?void 0:r.encode)&&i.gradient&&deleteNestedProperty(e.explicit,["encode","gradient"])),e}}var qr=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);rfunction assembleLegend(t,n){const e=t.combine(),{disable:r,labelExpr:i}=e,o=qr(e,["disable","labelExpr","selections"]);if(r)return;!1===n.aria&&null==o.aria&&(o.aria=!1);if(null!=(t=o.encode)&&t.symbols){const a=o.encode.symbols.update;!a.fill||"transparent"===a.fill.value||a.stroke||o.stroke||(a.stroke={value:"transparent"});for(const s of mn)o[s]&&delete a[s]}o.title||delete o.title;if(void 0!==i){let e=i;null!=(t=null==(n=o.encode)?void 0:n.labels)&&t.update&&isSignalRef(o.encode.labels.update.text)&&(e=replaceAll(i,"datum.label",o.encode.labels.update.text.signal)),!function setLegendEncode(e,t,n,r){var i;e.encode=null!=(i=e.encode)?i:{},e.encode[t]=null!=(i=e.encode[t])?i:{},e.encode[t].update=null!=(i=e.encode[t].update)?i:{},e.encode[t].update[n]=r}(o,"labels","text",{signal:e})}return o}(e,t.config)).filter(e=>void 0!==e)}function assembleProjections(e){return(isLayerModel(e)||isConcatModel(e)?function assembleProjectionsForModelAndChildren(e){return e.children.reduce((e,t)=>e.concat(t.assembleProjections()),assembleProjectionForModel(e))}:assembleProjectionForModel)(e)}function assembleProjectionForModel(n){const e=n.component.projection;if(!e||e.merged)return[];var t=e.combine(),r=t["name"];if(e.data){var i={signal:`[${e.size.map(e=>e.signal).join(", ")}]`};const o=e.data.reduce((e,t)=>{t=isSignalRef(t)?t.signal:`data('${n.lookupDataSource(t)}')`;return util_contains(e,t)||e.push(t),e},[]);if(o.length<=0)throw new Error("Projection's fit didn't find any data sources");return[Object.assign({name:r,size:i,fit:{signal:1{var t,e=e.component.projection;return!e||(n?((t=function mergeIfNoConflict(t,n){var e=every($r,e=>!has(t.explicit,e)&&!has(n.explicit,e)||!(!has(t.explicit,e)||!has(n.explicit,e)||A(t.get(e))!==A(n.get(e)))),r=A(t.size)===A(n.size);if(r){if(e)return t;if(A(t.explicit)===A({}))return n;if(A(n.explicit)===A({}))return t}return null}(n,e))&&(n=t),!!t):(n=e,!0))});if(n&&t){var r=e.projectionName(!0);const o=new component_ProjectionComponent(r,n.specifiedProjection,n.size,g(n.data));for(const a of e.children){const s=a.component.projection;s&&(s.isFit&&o.data.push(...a.component.projection.data),a.renameProjection(s.get("name"),r),s.merged=!0)}return o}return})(e)}var ei=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{var r,i;return isTypedFieldDef(t)&&isBinning(t.bin)&&({key:r,binComponent:i}=createBinComponent(t,t.bin,o),e[r]=Object.assign(Object.assign(Object.assign({},i),e[r]),function rangeFormula(e,t,n,r){var i;return binRequiresRange(t,n)?(e=isUnitModel(e)&&null!=(i=null!=(i=e.axis(n))?i:e.legend(n))?i:{},n=vgField(t,{expr:"datum"}),i=vgField(t,{expr:"datum",binSuffix:"end"}),{formulaAs:vgField(t,{binSuffix:"range",forAs:!0}),formula:binFormatExpression(n,i,e.format,e.formatType,r)}):{}}(o,t,n,o.config))),e},{});return isEmpty(t)?null:new bin_BinNode(e,t)}static makeFromTransform(e,t,n){var{key:t,binComponent:n}=createBinComponent(t,t.bin,n);return new bin_BinNode(e,{[t]:n})}merge(e,t){for(const n of y(e.bins))n in this.bins?(t(e.bins[n].signal,this.bins[n].signal),this.bins[n].as=unique([...this.bins[n].as,...e.bins[n].as],hash)):this.bins[n]=e.bins[n];for(const r of e.children)e.removeChild(r),r.parent=this;e.remove()}producedFields(){return new Set(B(this.bins).map(e=>e.as).flat(2))}dependentFields(){return new Set(B(this.bins).map(e=>e.field))}hash(){return"Bin "+hash(this.bins)}assemble(){return B(this.bins).flatMap(e=>{const t=[];var[n,...r]=e.as,i=e.bin,o=i["extent"],i=ei(i,["extent"]);const a=Object.assign(Object.assign(Object.assign({type:"bin",field:replacePathInField(e.field),as:n,signal:e.signal},isSelectionExtent(o)?{extent:null}:{extent:o}),e.span?{span:{signal:`span(${e.span})`}}:{}),i);!o&&e.extentSignal&&(t.push({type:"extent",field:replacePathInField(e.field),signal:e.extentSignal}),a.extent={signal:e.extentSignal}),t.push(a);for(const s of r)for(let e=0;e<2;e++)t.push({type:"formula",expr:vgField({field:n[e]},{expr:"datum"}),as:s[e]});return e.formula&&t.push({type:"formula",expr:e.formula,as:e.formulaAs}),t})}}function addDimension(e,t,n,r){var i=isUnitModel(r)?r.encoding[getSecondaryRangeChannel(t)]:void 0;isTypedFieldDef(n)&&isUnitModel(r)&&hasBand(t,n,i,r.stack,r.markDef,r.config)?(e.add(vgField(n,{})),e.add(vgField(n,{suffix:"end"})),n.bin&&binRequiresRange(n,t)&&e.add(vgField(n,{binSuffix:"range"}))):!function isGeoPositionChannel(e){return e in Ie}(t)?e.add(vgField(n)):(i=function getPositionChannelFromLatLong(e){switch(e){case j:return"y";case z:return"y2";case Y:return"x";case J:return"x2"}}(t),e.add(r.getName(i)))}class aggregate_AggregateNode extends dataflow_DataFlowNode{constructor(e,t,n){super(e),this.dimensions=t,this.measures=n}clone(){return new aggregate_AggregateNode(null,new Set(this.dimensions),g(this.measures))}get groupBy(){return this.dimensions}static makeFromEncoding(e,s){let t=!1;s.forEachFieldDef(e=>{e.aggregate&&(t=!0)});const A={},l=new Set;return t?(s.forEachFieldDef((e,t)=>{var n,r,i,{aggregate:o,field:a}=e;o?"count"===o?(A["*"]=null!=(r=A["*"])?r:{},A["*"].count=new Set([vgField(e,{forAs:!0})])):(isArgminDef(o)||isArgmaxDef(o)?(i=o[r=isArgminDef(o)?"argmin":"argmax"],A[i]=null!=(n=A[i])?n:{},A[i][r]=new Set([vgField({op:r,field:i},{forAs:!0})])):(A[a]=null!=(n=A[a])?n:{},A[a][o]=new Set([vgField(e,{forAs:!0})])),isScaleChannel(t)&&"unaggregated"===s.scaleDomain(t)&&(A[a]=null!=(r=A[a])?r:{},A[a].min=new Set([vgField({field:a,aggregate:"min"},{forAs:!0})]),A[a].max=new Set([vgField({field:a,aggregate:"max"},{forAs:!0})]))):addDimension(l,t,e,s)}),l.size+y(A).length===0?null:new aggregate_AggregateNode(e,l,A)):null}static makeFromTransform(e,t){var n;const r=new Set,i={};for(const A of t.aggregate){var{op:o,field:a,as:s}=A;o&&("count"===o?(i["*"]=null!=(n=i["*"])?n:{},i["*"].count=new Set([s||vgField(A,{forAs:!0})])):(i[a]=null!=(n=i[a])?n:{},i[a][o]=new Set([s||vgField(A,{forAs:!0})])))}for(const l of null!=(t=t.groupby)?t:[])r.add(l);return r.size+y(i).length===0?null:new aggregate_AggregateNode(e,r,i)}merge(e){return setEqual(this.dimensions,e.dimensions)?(function mergeMeasures(e,t){var n;for(const i of y(t)){var r=t[i];for(const o of y(r))i in e?e[i][o]=new Set([...null!=(n=e[i][o])?n:[],...r[o]]):e[i]={[o]:r[o]}}}(this.measures,e.measures),!0):(function debug(...e){$e.debug(...e)}("different dimensions, cannot merge"),!1)}addDimensions(e){e.forEach(this.dimensions.add,this.dimensions)}dependentFields(){return new Set([...this.dimensions,...y(this.measures)])}producedFields(){const e=new Set;for(const t of y(this.measures))for(const n of y(this.measures[t])){const r=this.measures[t][n];0===r.size?e.add(n+"_"+t):r.forEach(e.add,e)}return e}hash(){return"Aggregate "+hash({dimensions:this.dimensions,measures:this.measures})}assemble(){const e=[],t=[],n=[];for(const r of y(this.measures))for(const i of y(this.measures[r]))for(const o of this.measures[r][i])n.push(o),e.push(i),t.push("*"===r?null:replacePathInField(r));return{type:"aggregate",groupby:[...this.dimensions].map(replacePathInField),ops:e,fields:t,as:n}}}class facet_FacetNode extends dataflow_DataFlowNode{constructor(e,t,n,r){super(e),this.model=t,this.name=n,this.data=r;for(const s of me){var i,o,a=t.facet[s];a&&({bin:i,sort:o}=a,this[s]=Object.assign({name:t.getName(s+"_domain"),fields:[vgField(a),...isBinning(i)?[vgField(a,{binSuffix:"end"})]:[]]},isSortField(o)?{sortField:o}:R(o)?{sortIndexField:sortArrayIndexField(a,s)}:{}))}this.childModel=t.child}hash(){let e="Facet";for(const t of me)this[t]&&(e+=` ${t.charAt(0)}:`+hash(this[t]));return e}get fields(){var e;const t=[];for(const n of me)null!=(e=this[n])&&e.fields&&t.push(...this[n].fields);return t}dependentFields(){const e=new Set(this.fields);for(const t of me)this[t]&&(this[t].sortField&&e.add(this[t].sortField.field),this[t].sortIndexField&&e.add(this[t].sortIndexField));return e}producedFields(){return new Set}getSource(){return this.name}getChildIndependentFieldsWithStep(){const e={};for(const r of Se){const i=this.childModel.component.scales[r];var t,n;i&&!i.merged&&(n=i.get("type"),t=i.get("range"),hasDiscreteDomain(n)&&t.step&&((n=getFieldFromDomain(assembleDomain(this.childModel,r)))?e[r]=n:warn(x.unknownField(r))))}return e}assembleRowColumnHeaderData(e,t,n){var r={row:"y",column:"x"}[e];const i=[],o=[],a=[];n&&n[r]&&(t?(i.push("distinct_"+n[r]),o.push("max")):(i.push(n[r]),o.push("distinct")),a.push("distinct_"+n[r]));var s,A,{sortField:n,sortIndexField:r}=this[e];return n?({op:s=Yt,field:A}=n,i.push(A),o.push(s),a.push(vgField(n,{forAs:!0}))):r&&(i.push(r),o.push("max"),a.push(r)),{name:this[e].name,source:null!=t?t:this.data,transform:[Object.assign({type:"aggregate",groupby:this[e].fields},i.length?{fields:i,ops:o,as:a}:{})]}}assembleFacetHeaderData(e){var t,n,r,i=this.model.layout["columns"],o=this.model.component["layoutHeaders"];const a=[],s={};for(const c of jr){for(const g of Yr)for(const u of null!=(t=o[c]&&o[c][g])?t:[])if(0<(null==(n=u.axes)?void 0:n.length)){s[c]=!0;break}s[c]&&(r=`length(data("${this.facet.name}"))`,r="row"===c?i?{signal:`ceil(${r} / ${i})`}:1:i?{signal:`min(${r}, ${i})`}:{signal:r},a.push({name:this.facet.name+"_"+c,transform:[{type:"sequence",start:0,stop:r}]}))}var{row:A,column:l}=s;return(A||l)&&a.unshift(this.assembleRowColumnHeaderData("facet",null,e)),a}assemble(){const e=[];let t=null;var n=this.getChildIndependentFieldsWithStep(),{column:r,row:i,facet:o}=this;if(r&&i&&(n.x||n.y)){t=`cross_${this.column.name}_`+this.row.name;const a=[].concat(null!=(r=n.x)?r:[],null!=(i=n.y)?i:[]);r=a.map(()=>"distinct");e.push({name:t,source:this.data,transform:[{type:"aggregate",groupby:this.fields,fields:a,ops:r}]})}for(const s of[U,M])this[s]&&e.push(this.assembleRowColumnHeaderData(s,t,n));return o&&(i=this.assembleFacetHeaderData(n))&&e.push(...i),e}}function unquote(e){return"'"===e[0]&&"'"===e[e.length-1]||'"'===e[0]&&'"'===e[e.length-1]?e.slice(1,-1):e}function getImplicitFromFilterTransform(e){const r={};return function forEachLeaf(e,t){if(e.not)forEachLeaf(e.not,t);else if(e.and)for(const n of e.and)forEachLeaf(n,t);else if(e.or)for(const r of e.or)forEachLeaf(r,t);else t(e)}(e.filter,t=>{var n;if(isFieldPredicate(t)){let e=null;isFieldEqualPredicate(t)?e=signalRefOrValue(t.equal):isFieldLTEPredicate(t)?e=signalRefOrValue(t.lte):isFieldLTPredicate(t)?e=signalRefOrValue(t.lt):isFieldGTPredicate(t)?e=signalRefOrValue(t.gt):isFieldGTEPredicate(t)?e=signalRefOrValue(t.gte):isFieldRangePredicate(t)?e=t.range[0]:isFieldOneOfPredicate(t)&&(e=(null!=(n=t.oneOf)?n:t.in)[0]),e&&(isDateTime(e)?r[t.field]="date":isNumber(e)?r[t.field]="number":isString(e)&&(r[t.field]="string")),t.timeUnit&&(r[t.field]="date")}}),r}function getImplicitFromEncoding(n){const t={};function add(e){isFieldOrDatumDefForTimeFormat(e)?t[e.field]="date":"quantitative"===e.type&&function isMinMaxOp(e){return isString(e)&&util_contains(["min","max"],e)}(e.aggregate)?t[e.field]="number":1{isTypedFieldDef(e)?add(e):(t=getMainRangeChannel(t),t=n.fieldDef(t),add(Object.assign(Object.assign({},e),{type:t.type})))}),isUnitModel(n)&&({mark:i,markDef:e,encoding:r}=n,!isPathMark(i)||n.encoding.order||!isFieldDef(i=r["horizontal"===e.orient?"y":"x"])||"quantitative"!==i.type||i.field in t||(t[i.field]="number")),t}class formatparse_ParseNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this._parse=t}clone(){return new formatparse_ParseNode(null,g(this._parse))}hash(){return"Parse "+hash(this._parse)}static makeExplicit(e,t,n){let r={};t=t.data;return!isGenerator(t)&&t&&t.format&&t.format.parse&&(r=t.format.parse),this.makeWithAncestors(e,r,{},n)}static makeWithAncestors(e,t,n,r){for(const l of y(n)){var i=r.getWithExplicit(l);void 0!==i.value&&(i.explicit||i.value===n[l]||"derived"===i.value||"flatten"===n[l]?delete n[l]:warn(x.differentParse(l,n[l],i.value)))}for(const c of y(t)){var o=r.get(c);void 0!==o&&(o===t[c]?delete t[c]:warn(x.differentParse(c,t[c],o)))}const a=new split_Split(t,n),s=(r.copyAll(a),{});for(const g of y(a.combine())){var A=a.get(g);null!==A&&(s[g]=A)}return 0===y(s).length||r.parseNothing?null:new formatparse_ParseNode(e,s)}get parse(){return this._parse}merge(e){this._parse=Object.assign(Object.assign({},this._parse),e.parse),e.remove()}assembleFormatParse(){const e={};for(const n of y(this._parse)){var t=this._parse[n];1===accessPathDepth(n)&&(e[n]=t)}return e}producedFields(){return new Set(y(this._parse))}dependentFields(){return new Set(y(this._parse))}assembleTransforms(t=!1){return y(this._parse).filter(e=>!t||1{var t=function formatparse_parseExpression(e,t){return e=accessPathWithDatum(e),"number"===t?`toNumber(${e})`:"boolean"===t?`toBoolean(${e})`:"string"===t?`toString(${e})`:"date"===t?`toDate(${e})`:"flatten"===t?e:0===t.indexOf("date:")?`timeParse(${e},'${unquote(t.slice(5,t.length))}')`:0===t.indexOf("utc:")?`utcParse(${e},'${unquote(t.slice(4,t.length))}')`:(warn(x.unrecognizedParse(t)),null)}(e,this._parse[e]);return t?{type:"formula",expr:t,as:removePathFromField(e)}:null}).filter(e=>null!==e)}}class identifier_IdentifierNode extends dataflow_DataFlowNode{clone(){return new identifier_IdentifierNode(null)}constructor(e){super(e)}dependentFields(){return new Set}producedFields(){return new Set([bn])}hash(){return"Identifier"}assemble(){return{type:"identifier",as:bn}}}class graticule_GraticuleNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.params=t}clone(){return new graticule_GraticuleNode(null,this.params)}dependentFields(){return new Set}producedFields(){}hash(){return"Graticule "+hash(this.params)}assemble(){return Object.assign({type:"graticule"},!0===this.params?{}:this.params)}}class sequence_SequenceNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.params=t}clone(){return new sequence_SequenceNode(null,this.params)}dependentFields(){return new Set}producedFields(){var e;return new Set([null!=(e=this.params.as)?e:"data"])}hash(){return"Hash "+hash(this.params)}assemble(){return Object.assign({type:"sequence"},this.params)}}class source_SourceNode extends dataflow_DataFlowNode{constructor(t){super(null);let n;if(isGenerator(t=null!=t?t:{name:"source"})||(n=t.format?Object.assign({},omit(t.format,["parse"])):{}),"values"in t)this._data={values:t.values};else if("url"in t){if(this._data={url:t.url},!n.type){let e=/(?:\.([^.]+))?$/.exec(t.url)[1];util_contains(["json","csv","tsv","dsv","topojson"],e)||(e="json"),n.type=e}}else"sphere"in t?this._data={values:[{type:"Sphere"}]}:(isNamedData(t)||isGenerator(t))&&(this._data={});this._generator=isGenerator(t),t.name&&(this._name=t.name),n&&!isEmpty(n)&&(this._data.format=n)}dependentFields(){return new Set}producedFields(){}get data(){return this._data}hasName(){return!!this._name}get isGenerator(){return this._generator}get dataName(){return this._name}set dataName(e){this._name=e}set parent(e){throw new Error("Source nodes have to be roots.")}remove(){throw new Error("Source nodes are roots and cannot be removed.")}hash(){throw new Error("Cannot hash sources")}assemble(){return Object.assign(Object.assign({name:this._name},this._data),{transform:[]})}}var ti,ni=function(e,t,n){if(t.has(e))return t.set(e,n),n;throw new TypeError("attempted to set private field on non-instance")},ri=function(e,t){if(t.has(e))return t.get(e);throw new TypeError("attempted to get private field on non-instance")};function isDataSourceNode(e){return e instanceof source_SourceNode||e instanceof graticule_GraticuleNode||e instanceof sequence_SequenceNode}class Optimizer{constructor(){ti.set(this,void 0),ni(this,ti,!1)}setModified(){ni(this,ti,!0)}get modifiedFlag(){return ri(this,ti)}}ti=new WeakMap;class BottomUpOptimizer extends Optimizer{getNodeDepths(e,t,n){n.set(e,t);for(const r of e.children)this.getNodeDepths(r,t+1,n);return n}optimize(e){const t=this.getNodeDepths(e,0,new Map);for(const n of[...t.entries()].sort((e,t)=>t[1]-e[1]))this.run(n[0]);return this.modifiedFlag}}class TopDownOptimizer extends Optimizer{optimize(e){this.run(e);for(const t of e.children)this.optimize(t);return this.modifiedFlag}}class optimizers_MergeIdenticalNodes extends TopDownOptimizer{mergeNodes(e,t){var n=t.shift();for(const r of t)e.removeChild(r),r.parent=n,r.remove()}run(t){var n=t.children.map(e=>e.hash());const r={};for(let e=0;ee instanceof formatparse_ParseNode);if(1e instanceof timeunit_TimeUnitNode),n=t.pop();for(const r of t)this.setModified(),n.merge(r)}}class optimizers_MergeAggregates extends BottomUpOptimizer{run(e){const t={};for(const r of e.children.filter(e=>e instanceof aggregate_AggregateNode)){var n=hash(r.groupBy);n in t||(t[n]=[]),t[n].push(r)}for(const i of y(t)){const o=t[i];if(1e instanceof dataflow_OutputNode);if(t&&!(n.numChildren()<=1)){const i=[];let t;for(const o of e)if(o instanceof dataflow_OutputNode){let e=o;for(;1===e.numChildren();){var[r]=e.children;if(!(r instanceof dataflow_OutputNode))break;e=r}i.push(...e.children),t?(n.removeChild(o),o.parent=t.parent,t.parent.removeChild(t),t.parent=e,this.setModified()):t=e}else i.push(o);if(i.length){this.setModified();for(const a of i)a.parent.removeChild(a),a.parent=t}}}}class joinaggregate_JoinAggregateTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new joinaggregate_JoinAggregateTransformNode(null,g(this.transform))}addDimensions(e){this.transform.groupby=unique(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e=new Set;return this.transform.groupby&&this.transform.groupby.forEach(e.add,e),this.transform.joinaggregate.map(e=>e.field).filter(e=>void 0!==e).forEach(e.add,e),e}producedFields(){return new Set(this.transform.joinaggregate.map(this.getDefaultName))}getDefaultName(e){var t;return null!=(t=e.as)?t:vgField(e)}hash(){return"JoinAggregateTransform "+hash(this.transform)}assemble(){const e=[],t=[],n=[];for(const i of this.transform.joinaggregate)t.push(i.op),n.push(this.getDefaultName(i)),e.push(void 0===i.field?null:i.field);var r=this.transform.groupby;return Object.assign({type:"joinaggregate",as:n,ops:t,fields:e},void 0!==r?{groupby:r}:{})}}class stack_StackNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this._stack=t}clone(){return new stack_StackNode(null,g(this._stack))}static makeFromTransform(e,t){var{stack:n,groupby:r,as:i,offset:o="zero"}=t;const a=[],s=[];if(void 0!==t.sort)for(const c of t.sort)a.push(c.field),s.push(getFirstDefined(c.order,"ascending"));var A={field:a,order:s};let l;return l=function isValidAsArray(e){return R(e)&&e.every(e=>isString(e))&&1{t=vgField(t.fieldDef);return t&&e.push(t),e},[])}(t);r=t.encoding.order;let c;return c=R(r)||isFieldDef(r)?sortParams(r):l.reduce((e,t)=>(e.field.push(t),e.order.push("y"===o?"descending":"ascending"),e),{field:[],order:[]}),new stack_StackNode(e,{dimensionFieldDef:A,stackField:t.vgField(o),facetby:[],stackby:l,sort:c,offset:a,impute:s,as:[t.vgField(o,{suffix:"start",forAs:!0}),t.vgField(o,{suffix:"end",forAs:!0})]})}get stack(){return this._stack}addDimensions(e){this._stack.facetby.push(...e)}dependentFields(){const e=new Set;return e.add(this._stack.stackField),this.getGroupbyFields().forEach(e.add,e),this._stack.facetby.forEach(e.add,e),this._stack.sort.field.forEach(e.add,e),e}producedFields(){return new Set(this._stack.as)}hash(){return"Stack "+hash(this._stack)}getGroupbyFields(){var{dimensionFieldDef:e,impute:t,groupby:n}=this._stack;return e?e.bin?t?[vgField(e,{binSuffix:"mid"})]:[vgField(e,{}),vgField(e,{binSuffix:"end"})]:[vgField(e)]:null!=n?n:[]}assemble(){const e=[];var t,{facetby:n,dimensionFieldDef:r,stackField:i,stackby:o,sort:a,offset:s,impute:A,as:l}=this._stack;return A&&r&&({band:A=.5,bin:t}=r,t&&e.push({type:"formula",expr:A+"*"+vgField(r,{expr:"datum"})+`+${1-A}*`+vgField(r,{expr:"datum",binSuffix:"end"}),as:vgField(r,{binSuffix:"mid",forAs:!0})}),e.push({type:"impute",field:i,groupby:[...o,...n],key:vgField(r,{binSuffix:"mid"}),method:"value",value:0})),e.push({type:"stack",groupby:[...this.getGroupbyFields(),...n],field:i,sort:a,as:l,offset:s}),e}}class window_WindowTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new window_WindowTransformNode(null,g(this.transform))}addDimensions(e){this.transform.groupby=unique(this.transform.groupby.concat(e),e=>e)}dependentFields(){var e;const t=new Set;return(null!=(e=this.transform.groupby)?e:[]).forEach(t.add,t),(null!=(e=this.transform.sort)?e:[]).forEach(e=>t.add(e.field)),this.transform.window.map(e=>e.field).filter(e=>void 0!==e).forEach(t.add,t),t}producedFields(){return new Set(this.transform.window.map(this.getDefaultName))}getDefaultName(e){var t;return null!=(t=e.as)?t:vgField(e)}hash(){return"WindowTransform "+hash(this.transform)}assemble(){var e;const t=[],n=[],r=[],i=[];for(const g of this.transform.window)n.push(g.op),r.push(this.getDefaultName(g)),i.push(void 0===g.param?null:g.param),t.push(void 0===g.field?null:g.field);var o=this.transform.frame,a=this.transform.groupby;if(o&&null===o[0]&&null===o[1]&&n.every(e=>isAggregateOp(e)))return Object.assign({type:"joinaggregate",as:r,ops:n,fields:t},void 0!==a?{groupby:a}:{});const s=[],A=[];if(void 0!==this.transform.sort)for(const u of this.transform.sort)s.push(u.field),A.push(null!=(e=u.order)?e:"ascending");var l={field:s,order:A},c=this.transform.ignorePeers;return Object.assign(Object.assign(Object.assign({type:"window",params:i,as:r,ops:n,fields:t,sort:l},void 0!==c?{ignorePeers:c}:{}),void 0!==a?{groupby:a}:{}),void 0!==o?{frame:o}:{})}}function cloneSubtree(i){return function clone(e){if(e instanceof facet_FacetNode)return e.children.flatMap(clone);{const n=e.clone();var t;n instanceof dataflow_OutputNode?(t=ii+n.getSource(),n.setSource(t),i.model.component.data.outputNodes[t]=n):(n instanceof aggregate_AggregateNode||n instanceof stack_StackNode||n instanceof window_WindowTransformNode||n instanceof joinaggregate_JoinAggregateTransformNode)&&n.addDimensions(i.fields);for(const r of e.children.flatMap(clone))r.parent=n;return[n]}}}function moveFacetDown(e){if(e instanceof facet_FacetNode)if(1!==e.numChildren()||e.children[0]instanceof dataflow_OutputNode){var t=e.model.component.data.main,n=(!function moveMainDownToFacet(e){if(e instanceof dataflow_OutputNode&&e.type===d.Main&&1===e.numChildren()){const t=e.children[0];t instanceof facet_FacetNode||(t.swapWithParent(),moveMainDownToFacet(e))}}(t),cloneSubtree(e));for(const r of e.children.map(n).flat())r.parent=t}else{const i=e.children[0];(i instanceof aggregate_AggregateNode||i instanceof stack_StackNode||i instanceof window_WindowTransformNode||i instanceof joinaggregate_JoinAggregateTransformNode)&&i.addDimensions(e.fields),i.swapWithParent(),moveFacetDown(e)}else e.children.map(moveFacetDown)}const ii="scale_",oi=5;function checkLinks(e){for(const t of e){for(const n of t.children)if(n.parent!==t)return;if(!checkLinks(t.children))return}return 1}function runOptimizer(e,t){let n=!1;for(const r of t)n=e.optimize(r)||n;return n}function optimizationDataflowHelper(e,t,n){let r=e.sources,i=!1;return i=runOptimizer(new optimizers_RemoveUnnecessaryOutputNodes,r)||i,i=runOptimizer(new optimizers_RemoveUnnecessaryIdentifierNodes(t),r)||i,r=r.filter(e=>00e(t))}}var ai=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{return{signal:`{data: ${valueExpr(e,{timeUnit:n,type:t})}}`}})}(e,t,n):[e]}function parseSingleChannelDomain(e,t,n,r){var i=n["encoding"],i=getFieldOrDatumDef(i[r]),o=i["type"],a=i.timeUnit;if(function isDomainUnionWith(e){return e&&e.unionWith}(t))return s=parseSingleChannelDomain(e,void 0,n,r),A=convertDomainIfItIsDateTime(t.unionWith,o,a),makeExplicit([...s.value,...A]);if(isSignalRef(t))return makeExplicit([t]);if(t&&"unaggregated"!==t&&!isSelectionDomain(t))return makeExplicit(convertDomainIfItIsDateTime(t,o,a));var s=n.stack;if(s&&r===s.fieldChannel){if("normalize"===s.offset)return makeImplicit([[0,1]]);var A=n.requestDataName(d.Main);return makeImplicit([{data:A,field:n.vgField(r,{suffix:"start"})},{data:A,field:n.vgField(r,{suffix:"end"})}])}s=isScaleChannel(r)&&isFieldDef(i)?function domainSort(e,t,n){if(!hasDiscreteDomain(n))return;var n=e.fieldDef(t),r=n.sort;if(isSortArray(r))return{op:"min",field:sortArrayIndexField(n,t),order:"ascending"};const i=e["stack"],o=i?[...i.groupbyField?[i.groupbyField]:[],...i.stackBy.map(e=>e.fieldDef.field)]:void 0;{if(isSortField(r))return n=i&&!util_contains(o,r.field),normalizeSortField(r,n);if(isSortByEncoding(r)){var{encoding:n,order:a}=r,n=e.fieldDef(n),{aggregate:s,field:A}=n,l=i&&!util_contains(o,A);if(isArgminDef(s)||isArgmaxDef(s))return normalizeSortField({field:vgField(n),order:a},l);if(isAggregateOp(s)||!s)return normalizeSortField({op:s,field:A,order:a},l)}else{if("descending"===r)return{op:"min",field:e.vgField(t),order:"descending"};if(util_contains(["ascending",void 0],r))return!0}}return}(n,r,e):void 0;if(isDatumDef(i))return makeImplicit(convertDomainIfItIsDateTime([i.datum],o,a));A=i;if("unaggregated"===t)return o=i["field"],makeImplicit([{data:a=n.requestDataName(d.Main),field:vgField({field:o,aggregate:"min"})},{data:a,field:vgField({field:o,aggregate:"max"})}]);if(isBinning(A.bin)){if(hasDiscreteDomain(e))return makeImplicit("bin-ordinal"===e?[]:[{data:util_isBoolean(s)?n.requestDataName(d.Main):n.requestDataName(d.Raw),field:n.vgField(r,binRequiresRange(A,r)?{binSuffix:"range"}:{}),sort:!0!==s&&isObject(s)?s:{field:n.vgField(r,{}),op:"min"}}]);t=A["bin"];if(isBinning(t)){const l=getBinSignalName(n,A.field,t);return makeImplicit([new SignalRefWrapper(()=>{var e=n.getSignalName(l);return`[${e}.start, ${e}.stop]`})])}return makeImplicit([{data:n.requestDataName(d.Main),field:n.vgField(r,{})}])}return A.timeUnit&&util_contains(["time","utc"],e)&&hasBand(r,A,isUnitModel(n)?n.encoding[getSecondaryRangeChannel(r)]:void 0,n.stack,n.markDef,n.config)?makeImplicit([{data:i=n.requestDataName(d.Main),field:n.vgField(r)},{data:i,field:n.vgField(r,{suffix:"end"})}]):makeImplicit(s?[{data:util_isBoolean(s)?n.requestDataName(d.Main):n.requestDataName(d.Raw),field:n.vgField(r),sort:s}]:[{data:n.requestDataName(d.Main),field:n.vgField(r)}])}function normalizeSortField(e,t){var{op:e,field:n,order:r}=e;return Object.assign(Object.assign({op:null!=e?e:t?"sum":Yt},n?{field:replacePathInField(n)}:{}),r?{order:r}:{})}function canUseUnaggregatedDomain(e,t){var{aggregate:n,type:r}=e;return n?isString(n)&&!T[n]?{valid:!1,reason:x.unaggregateDomainWithNonSharedDomainOp(n)}:"quantitative"===r&&"log"===t?{valid:!1,reason:x.unaggregatedDomainWithLogScale(e)}:{valid:!0}:{valid:!1,reason:x.unaggregateDomainHasNoEffectForRawField(e)}}function domainsTieBreaker(e,t,n,r){return e.explicit&&t.explicit&&warn(x.mergeConflictingDomainProperty(n,r,e.value,t.value)),{explicit:e.explicit,value:[...e.value,...t.value]}}function getFieldFromDomain(t){if(isDataRefDomain(t)&&isString(t.field))return t.field;if(function isDataRefUnionedDomain(e){return!R(e)&&("fields"in e&&!("data"in e))}(t)){let e;for(const n of t.fields)if(isDataRefDomain(n)&&isString(n.field))if(e){if(e!==n.field)return warn(x.FACETED_INDEPENDENT_DIFFERENT_SOURCES),e}else e=n.field;return warn(x.FACETED_INDEPENDENT_SAME_FIELDS_DIFFERENT_SOURCES),e}return function isFieldRefUnionDomain(e){return!R(e)&&("fields"in e&&"data"in e)}(t)?(warn(x.FACETED_INDEPENDENT_SAME_SOURCE),isString(t=t.fields[0])?t:void 0):void 0}function assembleDomain(t,e){const n=t.component.scales[e];return function mergeDomains(t){const n=unique(t.map(e=>{var t;return isDataRefDomain(e)?(t=e["sort"],ai(e,["sort"])):e}),hash),r=unique(t.map(e=>{if(isDataRefDomain(e)){const t=e.sort;return void 0===t||util_isBoolean(t)||("op"in t&&"count"===t.op&&delete t.field,"ascending"===t.order&&delete t.order),t}}).filter(e=>void 0!==e),hash);if(0!==n.length){if(1===n.length){var i=t[0];if(isDataRefDomain(i)&&0util_isBoolean(e)||!("op"in e)||isString(e.op)&&e.op in G?e:(warn(x.domainSortDropped(e)),!0)),hash);let e;1===o.length?e=o[0]:1isDataRefDomain(e)?e.data:null),e=>e);return 1===i.length&&null!==i[0]?Object.assign({data:i[0],fields:n.map(e=>e.field)},e?{sort:e}:{}):Object.assign({fields:n},e?{sort:e}:{})}}(n.get("domains").map(e=>(isDataRefDomain(e)&&(e.data=t.lookupDataSource(e.data)),e)))}var si=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{const n=c.component.scales[t];if(n.merged)return e;var r=n.combine(),{name:i,type:o,selectionExtent:a,reverse:s}=r,A=si(r,["name","type","selectionExtent","domains","range","reverse"]),r=function assembleScaleRange(e,t,n,r){if(isXorY(n)){if(e.step)return{step:{signal:t+"_step"}}}else if(isObject(e)&&isDataRefDomain(e))return Object.assign(Object.assign({},e),{data:r.lookupDataSource(e.data)});return e}(r.range,i,t,c);let l;a&&(l=function assembleSelectionScaleDomain(e,t){var n=t.selection;return{signal:parseSelectionBinExtent(e.getSelectionComponent(n,varName(n)),t)}}(c,a));a=assembleDomain(c,t);return e.push(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({name:i,type:o},a?{domain:a}:{}),l?{domainRaw:l}:{}),{range:r}),void 0!==s?{reverse:s}:{}),A)),e},[])}class component_ScaleComponent extends split_Split{constructor(e,t){super({},{name:e}),this.merged=!1,this.setWithExplicit("type",t)}domainDefinitelyIncludesZero(){return!1!==this.get("zero")||some(this.get("domains"),e=>R(e)&&2===e.length&&e[0]<=0&&0<=e[1])}}const Ai=["range","scheme"];function range_getSizeChannel(e){return"x"===e?"width":"y"===e?"height":void 0}function parseUnitScaleRange(e){var t,n=e.component.scales;for(const r of De){const i=n[r];i&&(t=function parseRangeForChannel(e,r){const t=r.specifiedScales[e],n=r["size"],i=r.getScaleComponent(e),o=i.get("type");for(const g of Ai)if(void 0!==t[g]){var a=scaleTypeSupportProperty(o,g),s=channelScalePropertyIncompatability(e,g);if(a)if(s)warn(s);else switch(g){case"range":{const u=t.range;if(R(u)){if(isXorY(e))return makeExplicit(u.map(e=>{var t,n;return"width"===e||"height"===e?(t=r.getName(e),n=r.getSignalName.bind(r),SignalRefWrapper.fromName(n,t)):e}))}else if(isObject(u))return makeExplicit({data:r.requestDataName(d.Main),field:u.field,sort:{op:"min",field:r.vgField(e)}});return makeExplicit(u)}case"scheme":return makeExplicit(function parseScheme(e){if(function isExtendedScheme(e){return!isString(e)&&e.name}(e))return Object.assign({scheme:e.name},omit(e,["name"]));return{scheme:e}}(t[g]))}else warn(x.scalePropertyNotWorkWithScaleType(o,g,e))}if(e===b||e===h){var A=e===b?"width":"height",l=n[A];if(isStep(l)){if(hasDiscreteDomain(o))return makeExplicit({step:l.step});warn(x.stepDropped(A))}}var{rangeMin:l,rangeMax:A}=t,c=function defaultRange(e,t){const{size:n,config:r,mark:i,encoding:o}=t,a=t.getSignalName.bind(t),s=getFieldOrDatumDef(o[e])["type"],A=t.getScaleComponent(e),l=A.get("type"),{domain:c,domainMid:g}=t.specifiedScales[e];switch(e){case b:case h:if(util_contains(["point","band"],l))if(e!==b||n.width){if(e===h&&!n.height){var u=getViewConfigDiscreteSize(r.view,"height");if(isStep(u))return u}}else{u=getViewConfigDiscreteSize(r.view,"width");if(isStep(u))return u}u=range_getSizeChannel(e),u=t.getName(u);return e===h&&hasContinuousDomain(l)?[SignalRefWrapper.fromName(a,u),0]:[0,SignalRefWrapper.fromName(a,u)];case te:var u=t.component.scales[e].get("zero"),u=function sizeRangeMin(e,t,n){if(t)return isSignalRef(t)?{signal:t.signal+" ? 0 : "+sizeRangeMin(e,!1,n)}:0;switch(e){case"bar":case"tick":return n.scale.minBandSize;case"line":case"trail":case"rule":return n.scale.minStrokeWidth;case"text":return n.scale.minFontSize;case"point":case"square":case"circle":return n.scale.minSize}throw new Error(x.incompatibleChannel("size",e))}(i,u,r),d=function sizeRangeMax(e,t,n,r){var i={x:getBinStepSignal(n,"x"),y:getBinStepSignal(n,"y")};switch(e){case"bar":case"tick":{if(void 0!==r.scale.maxBandSize)return r.scale.maxBandSize;const o=minXYStep(t,i,r.view);return isNumber(o)?o-1:new SignalRefWrapper(()=>o.signal+" - 1")}case"line":case"trail":case"rule":return r.scale.maxStrokeWidth;case"text":return r.scale.maxFontSize;case"point":case"square":case"circle":{if(r.scale.maxSize)return r.scale.maxSize;const a=minXYStep(t,i,r.view);return isNumber(a)?Math.pow(li*a,2):new SignalRefWrapper(()=>`pow(${li} * ${a.signal}, 2)`)}}throw new Error(x.incompatibleChannel("size",e))}(i,n,t,r);return isContinuousToDiscrete(l)?function interpolateRange(r,i,o){var e=()=>{var e=signalOrStringValue(i),t=signalOrStringValue(r),n=`(${e} - ${t}) / (${o} - 1)`;return`sequence(${t}, ${e} + ${n}, ${n})`};return isSignalRef(i)?new SignalRefWrapper(e):{signal:e()}}(u,d,function defaultContinuousToDiscreteCount(e,t,n,r){switch(e){case"quantile":return t.scale.quantileCount;case"quantize":return t.scale.quantizeCount;case"threshold":return void 0!==n&&R(n)?n.length+1:(warn(x.domainRequiredForThresholdScale(r)),3)}}(l,r,c,e)):[u,d];case W:return[0,2*Math.PI];case ne:return[0,360];case V:return[0,new SignalRefWrapper(()=>{return`min(${t.getSignalName("width")},${t.getSignalName("height")})/2`})];case ae:return[r.scale.minStrokeWidth,r.scale.maxStrokeWidth];case se:return[[1,0],[4,2],[2,1],[1,1],[1,2,4,2]];case ee:return"symbol";case K:case X:case q:return"ordinal"===l?"nominal"===s?"category":"ordinal":void 0!==g?"diverging":"rect"===i||"geoshape"===i?"heatmap":"ramp";case re:case ie:case oe:return[r.scale.minOpacity,r.scale.maxOpacity]}throw new Error("Scale range undefined for channel "+e)}(e,r);return void 0===l&&void 0===A||!scaleTypeSupportProperty(o,"rangeMin")||!R(c)||2!==c.length?makeImplicit(c):makeExplicit([null!=l?l:c[0],null!=A?A:c[1]])}(r,e),i.setWithExplicit("range",t))}}function getBinStepSignal(t,e){var n=t.fieldDef(e);if(n&&n.bin&&isBinning(n.bin)){const r=getBinSignalName(t,n.field,n.bin);n=range_getSizeChannel(e);const i=t.getName(n);return new SignalRefWrapper(()=>{var e=t.getSignalName(r),e=`(${e}.stop - ${e}.start) / ${e}.step`;return t.getSignalName(i)+` / (${e})`})}}const li=.95;function minXYStep(e,t,n){const r=isStep(e.width)?e.width.step:getViewConfigDiscreteStep(n,"width"),i=isStep(e.height)?e.height.step:getViewConfigDiscreteStep(n,"height");return t.x||t.y?new SignalRefWrapper(()=>{const e=[t.x?t.x.signal:r,t.y?t.y.signal:i];return`min(${e.join(", ")})`}):Math.min(r,i)}function parseScaleProperty(e,t){(isUnitModel(e)?function parseUnitScaleProperty(e,t){var n=e.component.scales,{config:r,encoding:i,markDef:o,specifiedScales:a}=e;for(const I of y(n)){var s=a[I];const C=n[I],m=e.getScaleComponent(I);var A=getFieldOrDatumDef(i[I]),l=s[t],c=m.get("type"),g=m.get("padding"),u=m.get("paddingInner"),d=scaleTypeSupportProperty(c,t),h=channelScalePropertyIncompatability(I,t);if(void 0!==l&&(d?h&&warn(h):warn(x.scalePropertyNotWorkWithScaleType(c,t,I))),d&&void 0===h)if(void 0!==l){var p=A.timeUnit,f=A.type;switch(t){case"domainMax":case"domainMin":isDateTime(s[t])||"temporal"===f||p?C.set(t,{signal:valueExpr(s[t],{type:f,timeUnit:p})},!0):C.set(t,s[t],!0);break;default:C.copyKeyFromObject(t,s)}}else{d=t in ci?ci[t]({model:e,channel:I,fieldOrDatumDef:A,scaleType:c,scalePadding:g,scalePaddingInner:u,domain:s.domain,markDef:o,config:r}):r.scale[t];void 0!==d&&C.set(t,d,!1)}}}:parseNonUnitScaleProperty)(e,t)}const ci={bins:({model:e,fieldOrDatumDef:t})=>isFieldDef(t)?function properties_bins(e,t){var n=t.bin;{if(isBinning(n)){const r=getBinSignalName(e,t.field,n);return new SignalRefWrapper(()=>e.getSignalName(r))}if(isBinned(n)&&isBinParams(n)&&void 0!==n.step)return{step:n.step}}return}(e,t):void 0,interpolate:({channel:e,fieldOrDatumDef:t})=>function properties_interpolate(e,t){if(util_contains([K,X,q],e)&&"nominal"!==t)return"hcl";return}(e,t.type),nice:({scaleType:e,channel:t,fieldOrDatumDef:n})=>function nice(e,t,n){if(null!=(n=getFieldDef(n))&&n.bin||util_contains([It.TIME,It.UTC],e))return;return t in we||void 0}(e,t,n),padding:({channel:e,scaleType:t,fieldOrDatumDef:n,markDef:r,config:i})=>function properties_padding(e,t,n,r,i,o){if(e in we){if(isContinuousToContinuous(t)){if(void 0!==n.continuousPadding)return n.continuousPadding;var{type:i,orient:a}=i;if("bar"===i&&(!isFieldDef(r)||!r.bin&&!r.timeUnit)&&("vertical"===a&&"x"===e||"horizontal"===a&&"y"===e))return o.continuousBandSize}if(t===It.POINT)return n.pointPadding}return}(e,t,i.scale,n,r,i.bar),paddingInner:({scalePadding:e,channel:t,markDef:n,config:r})=>function properties_paddingInner(e,t,n,r){if(void 0!==e)return;if(t in we)return{bandPaddingInner:e,barBandPaddingInner:t,rectBandPaddingInner:r}=r,getFirstDefined(e,"bar"===n?t:r);return}(e,t,n.type,r.scale),paddingOuter:({scalePadding:e,channel:t,scaleType:n,markDef:r,scalePaddingInner:i,config:o})=>function properties_paddingOuter(e,t,n,r,i,o){if(void 0!==e)return;if(t in we)if(n===It.BAND)return e=o["bandPaddingOuter"],getFirstDefined(e,isSignalRef(i)?{signal:i.signal+"/2"}:i/2);return}(e,t,n,r.type,i,o.scale),reverse:({fieldOrDatumDef:e,scaleType:t,channel:n,config:r})=>{return function properties_reverse(e,t,n,r){if("x"===n&&void 0!==r.xReverse)return hasContinuousDomain(e)&&"descending"===t?isSignalRef(r.xReverse)?{signal:"!"+r.xReverse.signal}:!r.xReverse:r.xReverse;if(hasContinuousDomain(e)&&"descending"===t)return!0;return}(t,isFieldDef(e)?e.sort:void 0,n,r.scale)},zero:({channel:e,fieldOrDatumDef:t,domain:n,markDef:r,scaleType:i})=>function properties_zero(e,t,n,r,i){var o=!!n&&"unaggregated"!==n;if(o&&hasContinuousDomain(i)){if(R(n)){o=n[0],n=n[n.length-1];if(o<=0&&0<=n)return!0}return!1}if("size"===e&&"quantitative"===t.type&&!isContinuousToDiscrete(i))return!0;if(isFieldDef(t)&&t.bin||!util_contains([...Se,...xe],e))return!1;{var{orient:o,type:n}=r;return util_contains(["bar","area","line","trail"],n)&&("horizontal"===o&&"y"===e||"vertical"===o&&"x"===e)?!1:!0}}(e,t,n,r,i)};function parseScaleRange(e){isUnitModel(e)?parseUnitScaleRange(e):parseNonUnitScaleProperty(e,"range")}function parseNonUnitScaleProperty(t,n){const r=t.component.scales;for(const e of t.children)"range"===n?parseScaleRange(e):parseScaleProperty(e,n);for(const o of y(r)){let e;for(const a of t.children){const s=a.component.scales[o];var i;s&&(i=s.getWithExplicit(n),e=mergeValuesWithExplicit(e,i,n,"scale",tieBreakByComparing((e,t)=>"range"===n&&(e.step&&t.step)?e.step-t.step:0)))}r[o].setWithExplicit(n,e)}}function type_scaleType(e,t,n,r){r=function type_defaultType(e,t,n){var r;switch(t.type){case"nominal":case"ordinal":if(isColorChannel(e)||"discrete"===rangeType(e))return"shape"===e&&"ordinal"===t.type&&warn(x.discreteChannelCannotEncode(e,"ordinal")),"ordinal";if(e in we){if(util_contains(["rect","bar","image","rule"],n))return"band"}else if("arc"===n&&e in _e)return"band";return void 0!==t.band||isPositionFieldOrDatumDef(t)&&null!=(r=t.axis)&&r.tickBand?"band":"point";case"temporal":return isColorChannel(e)?"time":"discrete"===rangeType(e)?(warn(x.discreteChannelCannotEncode(e,"temporal")),"ordinal"):isFieldDef(t)&&t.timeUnit&&normalizeTimeUnit(t.timeUnit).utc?"utc":"time";case"quantitative":return isColorChannel(e)?isFieldDef(t)&&isBinning(t.bin)?"bin-ordinal":"linear":"discrete"===rangeType(e)?(warn(x.discreteChannelCannotEncode(e,"quantitative")),"ordinal"):"linear";case"geojson":return}throw new Error(x.invalidFieldType(t.type))}(t,n,r),e=e.type;return isScaleChannel(t)?void 0!==e?function channelSupportScaleType(e,t){if(isScaleChannel(e))switch(e){case b:case h:case W:case V:return isContinuousToContinuous(t)||util_contains(["band","point"],t);case te:case ae:case re:case ie:case oe:case ne:return isContinuousToContinuous(t)||isContinuousToDiscrete(t)||util_contains(["band","point","ordinal"],t);case K:case X:case q:return"band"!==t;case se:return"ordinal"===t||isContinuousToDiscrete(t);case ee:return"ordinal"===t}}(t,e)?isFieldDef(n)&&!function scaleTypeSupportDataType(e,t){return util_contains([dt,pt],t)?void 0===e||hasDiscreteDomain(e):t===ht?util_contains([It.TIME,It.UTC,void 0],e):t!==ut||util_contains([It.LOG,It.POW,It.SQRT,It.SYMLOG,It.QUANTILE,It.QUANTIZE,It.THRESHOLD,It.LINEAR,void 0],e)}(e,n.type)?(warn(x.scaleTypeNotWorkWithFieldDef(e,r)),r):e:(warn(x.scaleTypeNotWorkWithChannel(t,e,r)),r):r:null}function parseScaleCore(e){isUnitModel(e)?e.component.scales=function parseUnitScaleCore(i){const{encoding:o,mark:a}=i;return De.reduce((e,t)=>{var n=getFieldOrDatumDef(o[t]);if(n&&a===Lt&&t===ee&&n.type===ft)return e;let r=n&&n.scale;return n&&null!==r&&!1!==r&&(n=type_scaleType(r=null!==r&&void 0!==r?r:{},t,n,a),e[t]=new component_ScaleComponent(i.scaleName(t+"",!0),{value:n,explicit:r.type===n})),e},{})}(e):e.component.scales=function parseNonUnitScaleCore(e){const t=e.component.scales={},n={},r=e.component.resolve;for(const A of e.children){parseScaleCore(A);for(const l of y(A.component.scales)){var i,o;r.scale[l]=null!=(i=r.scale[l])?i:function defaultScaleResolve(e,t){if(isLayerModel(t)||isFacetModel(t))return"shared";if(isConcatModel(t))return isXorY(e)?"independent":"shared";throw new Error("invalid model type for resolve")}(l,e),"shared"===r.scale[l]&&(i=n[l],o=A.component.scales[l].getWithExplicit("type"),i?!function scaleCompatible(e,t){return e=Ct[e],t=Ct[t],e===t||"ordinal-position"===e&&"time"===t||"ordinal-position"===t&&"time"===e}(i.value,o.value)?(r.scale[l]="independent",delete n[l]):n[l]=mergeValuesWithExplicit(i,o,"type","scale",gi):n[l]=o)}}for(const c of y(n)){var a=e.scaleName(c,!0),s=n[c];t[c]=new component_ScaleComponent(a,s);for(const g of e.children){const u=g.component.scales[c];u&&(g.renameScale(u.get("name"),a),u.merged=!0)}}return t}(e)}const gi=tieBreakByComparing((e,t)=>scaleTypePrecedence(e)-scaleTypePrecedence(t));var ui=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r(e.from&&e.from.data&&(e.from.data=this.lookupDataSource(e.from.data)),e.from&&e.from.facet&&e.from.facet.data&&(e.from.facet.data=this.lookupDataSource(e.from.facet.data)),e),this.parent=n,this.config=i,this.view=replaceExprRefInIndex(a),this.name=null!=(a=e.name)?a:r,this.title=isText(e.title)?{text:e.title}:e.title?this.initTitle(e.title):void 0,this.scaleNameMap=n?n.scaleNameMap:new NameMap,this.projectionNameMap=n?n.projectionNameMap:new NameMap,this.signalNameMap=n?n.signalNameMap:new NameMap,this.data=e.data,this.description=e.description,this.transforms=normalizeTransform(null!=(a=e.transform)?a:[]),this.layout="layer"===t||"unit"===t?{}:function extractCompositionLayout(e,t,n){var r;const i={};var o,{spacing:a,columns:n}=n[t];void 0!==a&&(i.spacing=a),void 0!==n&&("facet"in e&&!isFacetMapping(e.facet)||"concat"in e)&&(i.columns=n),"vconcat"in e&&(i.columns=1);for(const s of En)void 0!==e[s]&&("spacing"===s?(o=e[s],i[s]=isNumber(o)?o:{row:null!=(r=o.row)?r:a,column:null!=(r=o.column)?r:a}):i[s]=e[s]);return i}(e,t,i),this.component={data:{sources:n?n.component.data.sources:[],outputNodes:n?n.component.data.outputNodes:{},outputNodeRefCounts:n?n.component.data.outputNodeRefCounts:{},isFaceted:"facet"in e||n&&n.component.data.isFaceted&&void 0===e.data},layoutSize:new split_Split,layoutHeaders:{row:{},column:{},facet:{}},mark:null,resolve:Object.assign({scale:{},axis:{},legend:{}},o?g(o):{}),selection:null,scales:null,projection:null,axes:{},legends:{}}}initTitle(e){var t=y(e);const n={text:signalRefOrValue(e.text)};for(const r of t)n[r]=signalRefOrValue(e[r]);return n}get width(){return this.getSizeSignalRef("width")}get height(){return this.getSizeSignalRef("height")}parse(){this.parseScale(),this.parseLayoutSize(),this.renameTopLevelLayoutSizeSignal(),this.parseSelections(),this.parseProjection(),this.parseData(),this.parseAxesAndHeaders(),this.parseLegends(),this.parseMarkGroup()}parseScale(){!function parseScales(e,{ignoreRange:t}={}){parseScaleCore(e),parseScaleDomain(e);for(const n of wt)parseScaleProperty(e,n);t||parseScaleRange(e)}(this)}parseProjection(){parseProjection(this)}renameTopLevelLayoutSizeSignal(){"width"!==this.getName("width")&&this.renameSignal(this.getName("width"),"width"),"height"!==this.getName("height")&&this.renameSignal(this.getName("height"),"height")}parseLegends(){parseLegend(this)}assembleGroupStyle(){var e;if("unit"===this.type||"layer"===this.type)return null!=(e=null==(e=this.view)?void 0:e.style)?e:"cell"}assembleEncodeFromView(e){var{}=e,t=ui(e,["style"]);const n={};for(const i of y(t)){var r=t[i];void 0!==r&&(n[i]=signalOrValueRef(r))}return n}assembleGroupEncodeEntry(e){let t={};return this.view&&(t=this.assembleEncodeFromView(this.view)),e||(this.description&&(t.description=signalOrValueRef(this.description)),"unit"!==this.type&&"layer"!==this.type)?isEmpty(t)?void 0:t:Object.assign({width:this.getSizeSignalRef("width"),height:this.getSizeSignalRef("height")},null!==t&&void 0!==t?t:{})}assembleLayout(){var e,t,n,r;if(this.layout)return t=this.layout,{spacing:e}=t,t=ui(t,["spacing"]),{component:r,config:n}=this,r=assembleLayoutTitleBand(r.layoutHeaders,n),Object.assign(Object.assign(Object.assign({padding:e},this.assembleDefaultLayout()),t),r?{titleBand:r}:{})}assembleDefaultLayout(){return{}}assembleHeaderMarks(){var e=this.component["layoutHeaders"];let t=[];for(const n of me)e[n].title&&t.push(function assembleTitleGroup(e,t){var n=e.component.layoutHeaders[t].title,r=e.config||void 0,{titleAnchor:i,titleAngle:o,titleOrient:a}=getHeaderProperties(["titleAnchor","titleAngle","titleOrient"],(e=e.component.layoutHeaders[t].facetFieldDef||void 0).header,r,t),a=getHeaderChannel(t,a),o=normalizeAngle(o);return{name:t+"-title",type:"group",role:a+"-title",title:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({text:n},"row"===t?{orient:"left"}:{}),{style:"guide-title"}),defaultHeaderGuideBaseline(o,a)),defaultHeaderGuideAlign(a,o,i)),assembleHeaderProperties(r,e,t,fn,hn))}}(this,n));for(const r of jr)t=t.concat(assembleHeaderGroups(this,r));return t}assembleAxes(){return function assembleAxes(e,t){const{x:n=[],y:r=[]}=e;return[...n.map(e=>assembleAxis(e,"grid",t)),...r.map(e=>assembleAxis(e,"grid",t)),...n.map(e=>assembleAxis(e,"main",t)),...r.map(e=>assembleAxis(e,"main",t))].filter(e=>e)}(this.component.axes,this.config)}assembleLegends(){return assembleLegends(this)}assembleProjections(){return assembleProjections(this)}assembleTitle(){var e=null!=(e=this.title)?e:{},t=e["encoding"],e=ui(e,["encoding"]);const n=Object.assign(Object.assign(Object.assign({},extractTitleConfig(this.config.title).nonMark),e),t?{encode:{update:t}}:{});if(n.text)return util_contains(["unit","layer"],this.type)?util_contains(["middle",void 0],n.anchor)&&(n.frame=null!=(e=n.frame)?e:"group"):n.anchor=null!=(t=n.anchor)?t:"start",isEmpty(n)?void 0:n}assembleGroup(e=[]){const t={};0<(e=e.concat(this.assembleSignals())).length&&(t.signals=e);e=this.assembleLayout(),e&&(t.layout=e),t.marks=[].concat(this.assembleHeaderMarks(),this.assembleMarks()),e=!this.parent||isFacetModel(this.parent)?function assembleScales(e){return isLayerModel(e)||isConcatModel(e)?e.children.reduce((e,t)=>e.concat(assembleScales(t)),assembleScalesForModel(e)):assembleScalesForModel(e)}(this):[],0e.hasOrientSignalRef()))||(null==(e=this.component.axes.y)?void 0:e.some(e=>e.hasOrientSignalRef()))}}class model_ModelWithField extends model_Model{vgField(e,t={}){e=this.fieldDef(e);if(e)return vgField(e,t)}reduceFieldDef(r,e){return function reduce(r,i,e,o){return r?y(r).reduce((e,n)=>{const t=r[n];return R(t)?t.reduce((e,t)=>i.call(o,e,t,n),e):i.call(o,e,t,n)},e):e}(this.getMapping(),(e,t,n)=>{t=getFieldDef(t);return t?r(e,t,n):e},e)}forEachFieldDef(n,e){forEach(this.getMapping(),(e,t)=>{e=getFieldDef(e);e&&n(e,t)},e)}}var di=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r{const r=isScaleChannel(n)&&i.getScaleComponent(n);return r&&hasContinuousDomain(r.get("type"))&&"count"!==t.aggregate&&!isPathMark(o)&&(e[t.field]=t),e},{});return y(r).length?new filterinvalid_FilterInvalidNode(e,r):null}dependentFields(){return new Set(y(this.filter))}producedFields(){return new Set}hash(){return"FilterInvalid "+hash(this.filter)}assemble(){const e=y(this.filter).reduce((e,t)=>{var t=this.filter[t],n=vgField(t,{expr:"datum"});return null!==t&&("temporal"===t.type?e.push(`(isDate(${n}) || (isValid(${n}) && isFinite(+${n})))`):"quantitative"===t.type&&(e.push(`isValid(${n})`),e.push(`isFinite(+${n})`))),e},[]);return 0{return null!=(t=r[t])?t:e})}clone(){return new flatten_FlattenTransformNode(this.parent,g(this.transform))}dependentFields(){return new Set(this.transform.flatten)}producedFields(){return new Set(this.transform.as)}hash(){return"FlattenTransform "+hash(this.transform)}assemble(){var{flatten:e,as:t}=this.transform;return{type:"flatten",fields:e,as:t}}}class fold_FoldTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t,this.transform=g(t);t=null!=(e=this.transform.as)?e:[void 0,void 0];this.transform.as=[null!=(e=t[0])?e:"key",null!=(e=t[1])?e:"value"]}clone(){return new fold_FoldTransformNode(null,g(this.transform))}dependentFields(){return new Set(this.transform.fold)}producedFields(){return new Set(this.transform.as)}hash(){return"FoldTransform "+hash(this.transform)}assemble(){var{fold:e,as:t}=this.transform;return{type:"fold",fields:e,as:t}}}class geojson_GeoJSONNode extends dataflow_DataFlowNode{constructor(e,t,n,r){super(e),this.fields=t,this.geojson=n,this.signal=r}clone(){return new geojson_GeoJSONNode(null,g(this.fields),this.geojson,this.signal)}static parseAll(e,t){if(t.component.projection&&!t.component.projection.isFit)return e;let n=0;for(const o of[[Y,j],[J,z]]){var r=o.map(e=>{e=getFieldOrDatumDef(t.encoding[e]);return isFieldDef(e)?e.field:isDatumDef(e)?{expr:""+e.datum}:isValueDef(e)?{expr:""+e.value}:void 0});(r[0]||r[1])&&(e=new geojson_GeoJSONNode(e,r,null,t.getName("geojson_"+n++)))}var i;return e=t.channelHasField(ee)&&(i=t.typedFieldDef(ee)).type===ft?new geojson_GeoJSONNode(e,null,i.field,t.getName("geojson_"+n++)):e}dependentFields(){var e=(null!=(e=this.fields)?e:[]).filter(isString);return new Set([...this.geojson?[this.geojson]:[],...e])}producedFields(){return new Set}hash(){return`GeoJSON ${this.geojson} ${this.signal} `+hash(this.fields)}assemble(){return Object.assign(Object.assign(Object.assign({type:"geojson"},this.fields?{fields:this.fields}:{}),this.geojson?{geojson:this.geojson}:{}),{signal:this.signal})}}class geopoint_GeoPointNode extends dataflow_DataFlowNode{constructor(e,t,n,r){super(e),this.projection=t,this.fields=n,this.as=r}clone(){return new geopoint_GeoPointNode(null,this.projection,g(this.fields),g(this.as))}static parseAll(e,t){if(!t.projectionName())return e;for(const i of[[Y,j],[J,z]]){var n=i.map(e=>{e=getFieldOrDatumDef(t.encoding[e]);return isFieldDef(e)?e.field:isDatumDef(e)?{expr:""+e.datum}:isValueDef(e)?{expr:""+e.value}:void 0}),r=i[0]===J?"2":"";(n[0]||n[1])&&(e=new geopoint_GeoPointNode(e,t.projectionName(),n,[t.getName("x"+r),t.getName("y"+r)]))}return e}dependentFields(){return new Set(this.fields.filter(isString))}producedFields(){return new Set(this.as)}hash(){return`Geopoint ${this.projection} ${hash(this.fields)} `+hash(this.as)}assemble(){return{type:"geopoint",projection:this.projection,fields:this.fields,as:this.as}}}class impute_ImputeNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new impute_ImputeNode(null,g(this.transform))}dependentFields(){var e;return new Set([this.transform.impute,this.transform.key,...null!=(e=this.transform.groupby)?e:[]])}producedFields(){return new Set([this.transform.impute])}processSequence(e){const{start:t=0,stop:n,step:r}=e;return{signal:`sequence(${[t,n,...r?[r]:[]].join(",")})`}}static makeFromTransform(e,t){return new impute_ImputeNode(e,t)}static makeFromEncoding(e,t){var n=t.encoding,r=n.x,i=n.y;if(isFieldDef(r)&&isFieldDef(i)){var o=r.impute?r:i.impute?i:void 0;if(void 0===o)return;var i=r.impute?i:i.impute?r:void 0,{method:r,value:a,frame:s,keyvals:A}=o.impute,t=pathGroupingFields(t.mark,n);return new impute_ImputeNode(e,Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({impute:o.field,key:i.field},r?{method:r}:{}),void 0!==a?{value:a}:{}),s?{frame:s}:{}),void 0!==A?{keyvals:A}:{}),t.length?{groupby:t}:{}))}return null}hash(){return"Impute "+hash(this.transform)}assemble(){var{impute:e,key:t,keyvals:n,method:r,groupby:i,value:o,frame:a=[null,null]}=this.transform,t=Object.assign(Object.assign(Object.assign(Object.assign({type:"impute",field:e,key:t},n?{keyvals:function isImputeSequence(e){return void 0!==(null==e?void 0:e.stop)}(n)?this.processSequence(n):n}:{}),{method:"value"}),i?{groupby:i}:{}),{value:r&&"value"!==r?null:o});return r&&"value"!==r?[t,Object.assign({type:"window",as:[`imputed_${e}_value`],ops:[r],fields:[e],frame:a,ignorePeers:!1},i?{groupby:i}:{}),{type:"formula",expr:`datum.${e} === null ? datum.imputed_${e}_value : datum.`+e,as:e}]:[t]}}var hi=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);re)}producedFields(){}dependentFields(){var e;return new Set([this.transform.pivot,this.transform.value,...null!=(e=this.transform.groupby)?e:[]])}hash(){return"PivotTransform "+hash(this.transform)}assemble(){var{pivot:e,value:t,groupby:n,limit:r,op:i}=this.transform;return Object.assign(Object.assign(Object.assign({type:"pivot",field:e,value:t},void 0!==r?{limit:r}:{}),void 0!==i?{op:i}:{}),void 0!==n?{groupby:n}:{})}}class sample_SampleTransformNode extends dataflow_DataFlowNode{constructor(e,t){super(e),this.transform=t}clone(){return new sample_SampleTransformNode(null,g(this.transform))}dependentFields(){return new Set}producedFields(){return new Set}hash(){return"SampleTransform "+hash(this.transform)}assemble(){return{type:"sample",size:this.transform.sample}}}function makeWalkTree(a){let s=0;return function walkTree(t,n){var e;if(t instanceof source_SourceNode&&(t.isGenerator||"url"in t.data||(a.push(n),n={name:null,source:n.name,transform:[]})),t instanceof formatparse_ParseNode&&(t.parent instanceof source_SourceNode&&!n.source?(n.format=Object.assign(Object.assign({},null!=(e=n.format)?e:{}),{parse:t.assembleFormatParse()}),n.transform.push(...t.assembleTransforms(!0))):n.transform.push(...t.assembleTransforms())),t instanceof facet_FacetNode){n.name||(n.name="data_"+s++),!n.source||0this.facetSortFields(e)).flat(),order:me.map(e=>this.facetSortOrder(e)).flat()}}),0{var t=e.name,n=r.getName("lookup_"+t);r.component.data.outputNodes[n]=e.materialized=new dataflow_OutputNode(new filter_FilterNode(i,r,{selection:t}),n,d.Lookup,r.component.data.outputNodeRefCounts)})}(e,A);let l=null;return isFacetModel(e)&&(o=e.getName("facet"),t=null!=(a=function makeJoinAggregateFromFacet(t,n){var r,i,{row:n,column:o}=n;if(n&&o){let e=null;for(const a of[n,o])isSortField(a.sort)&&({field:r,op:i=Yt}=a.sort,t=e=new joinaggregate_JoinAggregateTransformNode(t,{joinaggregate:[{op:i,field:r,as:facetSortFieldName(a,a.sort,{forAs:!0})}],groupby:[vgField(a)]}));return e}return null}(t,e.facet))?a:t,l=new facet_FacetNode(t,e,o,A.getSource()),n[o]=l),Object.assign(Object.assign({},e.component.data),{outputNodes:n,outputNodeRefCounts:r,raw:s,main:A,facetRoot:l,ancestorParse:i})}class concat_ConcatModel extends model_Model{constructor(e,t,n,r){super(e,"concat",t,n,r,e.resolve),"shared"!==(null==(n=null==(t=e.resolve)?void 0:t.axis)?void 0:n.x)&&"shared"!==(null==(n=null==(t=e.resolve)?void 0:t.axis)?void 0:n.y)||warn(x.CONCAT_CANNOT_SHARE_AXIS),this.children=this.getChildren(e).map((e,t)=>buildModel(e,this,this.getName("concat_"+t),void 0,r))}parseData(){this.component.data=parseData(this);for(const e of this.children)e.parseData()}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of y(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){for(const e of this.children)e.parseAxesAndHeaders()}getChildren(e){return"vconcat"in e?e.vconcat:"hconcat"in e?e.hconcat:e.concat}parseLayoutSize(){parseConcatLayoutSize(this)}parseAxisGroup(){return null}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.forEach(e=>e.assembleSignals()),[]}assembleLayoutSignals(){const e=assembleLayoutSignals(this);for(const t of this.children)e.push(...t.assembleLayoutSignals());return e}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleMarks(){return this.children.map(e=>{var t=e.assembleTitle(),n=e.assembleGroupStyle(),r=e.assembleGroupEncodeEntry(!1);return Object.assign(Object.assign(Object.assign(Object.assign({type:"group",name:e.getName("group")},t?{title:t}:{}),n?{style:n}:{}),r?{encode:{update:r}}:{}),e.assembleGroup())})}assembleDefaultLayout(){var e=this.layout.columns;return Object.assign(Object.assign({},null!=e?{columns:e}:{}),{bounds:"full",align:"each"})}}I=Object.assign(Object.assign({disable:1,gridScale:1,scale:1},t),{labelExpr:1,encode:1});const Ci=y(I);class component_AxisComponent extends split_Split{constructor(e={},t={},n=!1){super(),this.explicit=e,this.implicit=t,this.mainExtracted=n}clone(){return new component_AxisComponent(g(this.explicit),g(this.implicit),this.mainExtracted)}hasAxisPart(e){return"axis"===e||("grid"===e||"title"===e?!!this.get(e):!function isFalseOrNull(e){return!1===e||null===e}(this.get(e)))}hasOrientSignalRef(){return isSignalRef(this.explicit.orient)}}function parseUnitAxes(n){return Se.reduce((e,t)=>(n.component.scales[t]&&(e[t]=[function parseAxis(r,i){let e=i.axis(r);const o=new component_AxisComponent,t=getFieldOrDatumDef(i.encoding[r]),{mark:n,config:a}=i,s=(null===e||void 0===e?void 0:e.orient)||(null==(g=a["x"===r?"axisX":"axisY"])?void 0:g.orient)||(null==(g=a.axis)?void 0:g.orient)||function defaultOrient(e){return"x"===e?"bottom":"left"}(r),A=i.getScaleComponent(r).get("type"),l=getAxisConfigs(r,A,s,i.config),c=void 0!==e?!e:getAxisConfig("disable",a.style,null===e||void 0===e?void 0:e.style,l).configValue;if(o.set("disable",c,void 0!==e),c)return o;e=e||{};var g=function getLabelAngle(e,t,n,r,i){var o=null==t?void 0:t.labelAngle;return void 0!==o?isSignalRef(o)?o:normalizeAngle(o):void 0!==(o=getAxisConfig("labelAngle",r,null==t?void 0:t.style,i)["configValue"])?normalizeAngle(o):n!==b||!util_contains([pt,dt],e.type)||isFieldDef(e)&&e.timeUnit?void 0:270}(t,e,r,a.style,l),u={fieldOrDatumDef:t,axis:e,channel:r,model:i,scaleType:A,orient:s,labelAngle:g,mark:n,config:a};for(const B of Ci){var d,h,p,f=B in Hr?Hr[B](u):isAxisProperty(B)?e[B]:void 0,I=void 0!==f,C=function parse_isExplicit(e,t,n,r,i){if("disable"===t)return void 0!==n;switch(n=n||{},t){case"titleAngle":case"labelAngle":return e===(isSignalRef(n.labelAngle)?n.labelAngle:normalizeAngle(n.labelAngle));case"values":return!!n.values;case"encode":return!!n.encoding||!!n.labelAngle;case"title":if(e===getFieldDefTitle(r,i))return!0}return e===n[t]}(f,B,e,i,r);I&&C?o.set(B,f,C):({configValue:d=void 0,configFrom:h=void 0}=isAxisProperty(B)&&"values"!==B?getAxisConfig(B,a.style,e.style,l):{},p=void 0!==d,I&&!p?o.set(B,f,C):("vgAxisConfig"!==h||yi.has(B)&&p||isConditionalAxisValue(d)||isSignalRef(d))&&o.set(B,d,!1))}const m=null!=(g=e.encoding)?g:{},y=w.reduce((e,t)=>{if(!o.hasAxisPart(t))return e;var n=guideEncodeEntry(null!=(n=m[t])?n:{},i),n="labels"===t?function axis_encode_labels(e,t,n){var{encoding:r,config:i}=e,o=null!=(o=getFieldOrDatumDef(r[t]))?o:getFieldOrDatumDef(r[getSecondaryRangeChannel(t)]),{format:r,formatType:e}=e.axis(t)||{};return isCustomFormatType(e)?Object.assign({text:formatCustomType({fieldOrDatumDef:o,field:"datum.value",format:r,formatType:e,config:i})},n):n}(i,r,n):n;return void 0===n||isEmpty(n)||(e[t]={update:n}),e},{});isEmpty(y)||o.set("encode",y,!!e.encoding||void 0!==e.labelAngle);return o}(t,n)]),e),{})}const mi={bottom:"top",top:"bottom",left:"right",right:"left"};function parseLayerAxes(e){var t;const{axes:n,resolve:r}=e.component,i={top:0,bottom:0,right:0,left:0};for(const s of e.children){s.parseAxesAndHeaders();for(const A of y(s.component.axes))r.axis[A]=parseGuideResolve(e.component.resolve,A),"shared"===r.axis[A]&&(n[A]=function mergeAxisComponents(t,n){{if(!t)return n.map(e=>e.clone());if(t.length!==n.length)return;var r=t.length;for(let e=0;e{switch(r){case"title":return mergeTitleComponent(e,t);case"gridScale":return{explicit:e.explicit,value:getFirstDefined(e.value,t.value)}}return defaultTieBreaker(e,t,r,"axis")});e.setWithExplicit(r,n)}return e}(a,s)}}}return t}(n[A],s.component.axes[A]),n[A]||(r.axis[A]="independent",delete n[A]))}for(const l of Se){for(const c of e.children)if(c.component.axes[l]){if("independent"===r.axis[l]){n[l]=(null!=(t=n[l])?t:[]).concat(c.component.axes[l]);for(const g of c.component.axes[l]){var{value:o,explicit:a}=g.getWithExplicit("orient");isSignalRef(o)||(0i[a]&&g.set("orient",a,!1)),i[o]++)}}delete c.component.axes[l]}if("independent"===r.axis[l]&&n[l]&&1Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),rectPosition(e,"radius","arc")),rectPosition(e,"theta","arc"))},area:{vgMark:"area",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"include",size:"ignore",theta:"ignore"})),pointOrRangePosition("x",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"horizontal"===e.markDef.orient})),pointOrRangePosition("y",e,{defaultPos:"zeroOrMin",defaultPos2:"zeroOrMin",range:"vertical"===e.markDef.orient})),defined(e))},bar:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),rectPosition(e,"x","bar")),rectPosition(e,"y","bar"))},circle:{vgMark:"symbol",encodeEntry:e=>point_encodeEntry(e,"circle")},geoshape:{vgMark:"shape",encodeEntry:e=>Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),postEncodingTransform:e=>{var t=e["encoding"],t=t.shape;return[Object.assign({type:"geoshape",projection:e.projectionName()},t&&isFieldDef(t)&&t.type===ft?{field:vgField(t,{expr:"datum"})}:{})]}},image:{vgMark:"image",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"ignore",orient:"ignore",size:"ignore",theta:"ignore"})),rectPosition(e,"x","image")),rectPosition(e,"y","image")),text_text(e,"url"))},line:{vgMark:"line",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"ignore",orient:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),nonPosition("size",e,{vgChannel:"strokeWidth"})),defined(e))},point:{vgMark:"symbol",encodeEntry:e=>point_encodeEntry(e)},rect:{vgMark:"rect",encodeEntry:e=>Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),rectPosition(e,"x","rect")),rectPosition(e,"y","rect"))},rule:{vgMark:"rule",encodeEntry:e=>{var t=e["markDef"],t=t.orient;return e.encoding.x||e.encoding.y||e.encoding.latitude||e.encoding.longitude?Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),pointOrRangePosition("x",e,{defaultPos:"horizontal"===t?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"vertical"!==t})),pointOrRangePosition("y",e,{defaultPos:"vertical"===t?"zeroOrMax":"mid",defaultPos2:"zeroOrMin",range:"horizontal"!==t})),nonPosition("size",e,{vgChannel:"strokeWidth"})):{}}},square:{vgMark:"symbol",encodeEntry:e=>point_encodeEntry(e,"square")},text:{vgMark:"text",encodeEntry:e=>{var t=e["config"];return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"include",baseline:"include",color:"include",size:"ignore",orient:"ignore",theta:"include"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),text_text(e)),nonPosition("size",e,{vgChannel:"fontSize"})),nonPosition("angle",e)),valueIfDefined("align",function text_align(e,t,n){e=getMarkPropOrConfig("align",e,n);if(void 0===e)return"center"}(e.markDef,0,t))),valueIfDefined("baseline",function text_baseline(e,t,n){e=getMarkPropOrConfig("baseline",e,n);if(void 0===e)return"middle"}(e.markDef,0,t))),pointPosition("radius",e,{defaultPos:null,isMidPoint:!0})),pointPosition("theta",e,{defaultPos:null,isMidPoint:!0}))}},tick:{vgMark:"rect",encodeEntry:e=>{var{config:t,markDef:n}=e,r=n.orient,i="horizontal"===r?"width":"height",r="horizontal"===r?"height":"width";return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",orient:"ignore",size:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid",vgChannel:"xc"})),pointPosition("y",e,{defaultPos:"mid",vgChannel:"yc"})),nonPosition("size",e,{defaultValue:function defaultSize(e){const{config:t,markDef:n}=e,r=n["orient"],i="horizontal"===r?"width":"height",o=e.getScaleComponent("horizontal"===r?"x":"y"),a=null!=(e=getMarkPropOrConfig("size",n,t,{vgChannel:i}))?e:t.tick.bandSize;return void 0!==a?a:(e=o?o.get("range"):void 0)&&e.step&&isNumber(e.step)?3*e.step/4:3*getViewConfigDiscreteStep(t.view,i)/4}(e),vgChannel:i})),{[r]:signalOrValueRef(getMarkPropOrConfig("thickness",n,t))})}},trail:{vgMark:"trail",encodeEntry:e=>Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},baseEncodeEntry(e,{align:"ignore",baseline:"ignore",color:"include",size:"include",orient:"ignore",theta:"ignore"})),pointPosition("x",e,{defaultPos:"mid"})),pointPosition("y",e,{defaultPos:"mid"})),nonPosition("size",e)),defined(e))}};function parseMarkGroups(t){if(util_contains([Ft,_t,Mt],t.mark)){var e=pathGroupingFields(t.mark,t.encoding);if(0getMarkPropOrConfig(e,t.markDef,t.config));if(t.stack&&!t.fieldDef("size")&&e)return function getGroupsForStackedBarWithCornerRadius(r){const[i]=getMarkGroup(r,{fromPrefix:vi}),o=r.scaleName(r.stack.fieldChannel),a=(e={})=>r.vgField(r.stack.fieldChannel,e),e=(e,t)=>{const n=[a({prefix:"min",suffix:"start",expr:t}),a({prefix:"max",suffix:"start",expr:t}),a({prefix:"min",suffix:"end",expr:t}),a({prefix:"max",suffix:"end",expr:t})];return`${e}(${n.map(e=>`scale('${o}',${e})`).join(",")})`};let t,n;"x"===r.stack.fieldChannel?(t=Object.assign(Object.assign({},pick(i.encode.update,["y","yc","y2","height",...ct])),{x:{signal:e("min","datum")},x2:{signal:e("max","datum")},clip:{value:!0}}),n={x:{field:{group:"x"},mult:-1},height:{field:{group:"height"}}},i.encode.update=Object.assign(Object.assign({},omit(i.encode.update,["y","yc","y2"])),{height:{field:{group:"height"}}})):(t=Object.assign(Object.assign({},pick(i.encode.update,["x","xc","x2","width"])),{y:{signal:e("min","datum")},y2:{signal:e("max","datum")},clip:{value:!0}}),n={y:{field:{group:"y"},mult:-1},width:{field:{group:"width"}}},i.encode.update=Object.assign(Object.assign({},omit(i.encode.update,["x","xc","x2"])),{width:{field:{group:"width"}}}));for(const c of ct){var s=getMarkConfig(c,r.markDef,r.config);i.encode.update[c]?(t[c]=i.encode.update[c],delete i.encode.update[c]):s&&(t[c]=signalOrValueRef(s)),s&&(i.encode.update[c]={value:0})}const A=r.fieldDef(r.stack.groupbyChannel),l=vgField(A)?[vgField(A)]:[];(null!=A&&A.bin||null!=A&&A.timeUnit)&&l.push(vgField(A,{binSuffix:"end"}));(t=["stroke","strokeWidth","strokeJoin","strokeCap","strokeDash","strokeDashOffset","strokeMiterLimit","strokeOpacity"].reduce((e,t)=>{var n;return i.encode.update[t]?Object.assign(Object.assign({},e),{[t]:i.encode.update[t]}):void 0!==(n=getMarkConfig(t,r.markDef,r.config))?Object.assign(Object.assign({},e),{[t]:signalOrValueRef(n)}):e},t)).stroke&&(t.strokeForeground={value:!0},t.strokeOffset={value:0});return[{type:"group",from:{facet:{data:r.requestDataName(d.Main),name:vi+r.requestDataName(d.Main),groupby:l,aggregate:{fields:[a({suffix:"start"}),a({suffix:"start"}),a({suffix:"end"}),a({suffix:"end"})],ops:["min","max","min","max"]}}},encode:{update:t},marks:[{type:"group",encode:{update:n},marks:[i]}]}]}(t)}return getMarkGroup(t)}const bi="faceted_path_";const vi="stack_group_";function getMarkGroup(e,t={fromPrefix:""}){var{mark:n,markDef:r,encoding:i,config:o}=e,a=getFirstDefined(r.clip,function scaleClip(e){const t=e.getScaleComponent("x"),n=e.getScaleComponent("y");return!!(t&&t.get("selectionExtent")||n&&n.get("selectionExtent"))||void 0}(e),function projectionClip(e){e=e.component.projection;return!(!e||e.isFit)||void 0}(e)),s=getStyles(r),i=i.key,A=function mark_getSort(e){var{encoding:t,stack:n,mark:r,markDef:i,config:o}=e,a=t.order;if(!(!R(a)&&isValueDef(a)&&isNullOrFalse(a.value)||!a&&isNullOrFalse(getMarkPropOrConfig("order",i,o))))return!R(a)&&!isFieldDef(a)||n?isPathMark(r)&&isFieldDef(n=t[o="horizontal"===i.orient?"y":"x"])?(r=n.sort,R(r)?{field:vgField(n,{prefix:o,suffix:"sort_index",expr:"datum"})}:isSortField(r)?{field:vgField({aggregate:encoding_isAggregate(e.encoding)?r.op:void 0,field:r.field},{expr:"datum"})}:isSortByEncoding(r)?{field:vgField(e.fieldDef(r.encoding),{expr:"datum"}),order:r.order}:null===r?void 0:{field:vgField(n,{binSuffix:e.stack&&e.stack.impute?"mid":void 0,expr:"datum"})}):void 0:sortParams(a,{expr:"datum"})}(e),l=function interactiveFlag(e){if(!e.component.selection)return null;var t=y(e.component.selection).length;let n=t,r=e.parent;for(;r&&0===n;)n=y(r.component.selection).length,r=r.parent;return n?{interactive:0isFieldOrDatumDef(t[e]));return e||n}scaleDomain(e){e=this.specifiedScales[e];return e?e.domain:void 0}axis(e){return this.specifiedAxes[e]}legend(e){return this.specifiedLegends[e]}initScales(e,r){return De.reduce((e,t)=>{var n=getFieldOrDatumDef(r[t]);return n&&(e[t]=this.initScale(null!=(t=n.scale)?t:{})),e},{})}initScale(e){const{domain:t,range:n}=e,r=replaceExprRefInIndex(e);return R(t)&&(r.domain=t.map(signalRefOrValue)),R(n)&&(r.range=n.map(signalRefOrValue)),r}initAxes(r){return Se.reduce((e,t)=>{var n=r[t];return(isFieldOrDatumDef(n)||t===b&&isFieldOrDatumDef(r.x2)||t===h&&isFieldOrDatumDef(r.y2))&&(n=isFieldOrDatumDef(n)?n.axis:void 0,e[t]=n&&this.initAxis(Object.assign({},n))),e},{})}initAxis(e){const t={};for(const r of y(e)){var n=e[r];t[r]=(isConditionalAxisValue(n)?signalOrValueRefWithCondition:signalRefOrValue)(n)}return t}initLegends(r){return Re.reduce((e,t)=>{var n=getFieldOrDatumDef(r[t]);return n&&function supportLegend(e){switch(e){case K:case X:case q:case te:case ee:case re:case ae:case se:return 1;case ie:case oe:case ne:return}}(t)&&(n=n.legend,e[t]=n&&replaceExprRefInIndex(n)),e},{})}parseData(){this.component.data=parseData(this)}parseLayoutSize(){parseUnitLayoutSize(this)}parseSelections(){this.component.selection=function parseUnitSelection(t,n){var e;const r={};var i=t.config.selection;for(const s of y(null!=n?n:{})){const A=g(n[s]);var o=i[A.type],{}=o,a=Zr(o,["fields","encodings"]);for(const c in a)"encodings"===c&&A.fields||"fields"===c&&A.encodings||("mark"===c&&(A[c]=Object.assign(Object.assign({},a[c]),A[c])),void 0!==A[c]&&!0!==A[c]||(A[c]=null!=(e=a[c])?e:A[c]));o=varName(s);const l=r[o]=Object.assign(Object.assign({},A),{name:o,events:isString(A.on)?eventSelector(A.on,"scope"):g(A.on)});forEachTransform(l,e=>{e.has(l)&&e.parse&&e.parse(t,l,A,n[s])})}return r}(this,this.selection)}parseMarkGroup(){this.component.mark=parseMarkGroups(this)}parseAxesAndHeaders(){this.component.axes=parseUnitAxes(this)}assembleSelectionTopLevelSignals(e){return function assembleTopLevelSignals(a,s){let A=!1;return forEachSelection(a,(t,e)=>{const n=t.name;var r,i,o=$(n+Er);0===s.filter(e=>e.name===n).length&&(r="global"===t.resolve?"union":t.resolve,i="multi"===t.type?", true)":")",s.push({name:t.name,update:Sr+`(${o}, `+$(r)+i})),A=!0,e.topLevelSignals&&(s=e.topLevelSignals(a,t,s)),forEachTransform(t,e=>{e.topLevelSignals&&(s=e.topLevelSignals(a,t,s))})}),A&&0===s.filter(e=>"unit"===e.name).length&&s.unshift({name:"unit",value:{},on:[{events:"mousemove",update:"isTuple(group()) ? group() : unit"}]}),cleanupEmptyOnArray(s)}(this,e)}assembleSignals(){return[...assembleAxisSignals(this),...function assembleUnitSelectionSignals(i,o){return forEachSelection(i,(t,e)=>{var n=t.name;let r=e.modifyExpr(i,t);o.push(...e.signals(i,t)),forEachTransform(t,e=>{e.signals&&(o=e.signals(i,t,o)),e.modifyExpr&&(r=e.modifyExpr(i,t,r))}),o.push({name:n+"_modify",on:[{events:{signal:t.name+Qr},update:`modify(${$(t.name+Er)}, ${r})`}]})}),cleanupEmptyOnArray(o)}(this,[])]}assembleSelectionData(e){return function assembleUnitSelectionData(i,e){const o=[...e];return forEachSelection(i,t=>{const e={name:t.name+Er};if(t.init){const n=t.project.items.map(e=>{var{}=e;return yr(e,["signals"])}),r=t.init.map(e=>assembleInit(e,!1));e.values="interval"===t.type?[{unit:selection_unitName(i,{escape:!1}),fields:n,values:r}]:r.map(e=>({unit:selection_unitName(i,{escape:!1}),fields:n,values:e}))}o.filter(e=>e.name===t.name+Er).length||o.push(e)}),o}(this,e)}assembleLayout(){return null}assembleLayoutSignals(){return assembleLayoutSignals(this)}assembleMarks(){var e;let t=null!=(e=this.component.mark)?e:[];return(t=this.parent&&isLayerModel(this.parent)?t:assembleUnitSelectionMarks(this,t)).map(this.correctDataNames)}getMapping(){return this.encoding}get mark(){return this.markDef.type}channelHasField(e){return channelHasField(this.encoding,e)}fieldDef(e){return getFieldDef(this.encoding[e])}typedFieldDef(e){e=this.fieldDef(e);return isTypedFieldDef(e)?e:null}}class layer_LayerModel extends model_Model{constructor(e,t,n,r,i){super(e,"layer",t,n,i,e.resolve,e.view);const o=Object.assign(Object.assign(Object.assign({},r),e.width?{width:e.width}:{}),e.height?{height:e.height}:{});this.children=e.layer.map((e,t)=>{if("layer"in e)return new layer_LayerModel(e,this,this.getName("layer_"+t),o,i);if("mark"in e)return new unit_UnitModel(e,this,this.getName("layer_"+t),o,i);throw new Error(x.invalidSpec(e))})}parseData(){this.component.data=parseData(this);for(const e of this.children)e.parseData()}parseLayoutSize(){!function parseLayerLayoutSize(e){parseChildrenLayoutSize(e),parseNonUnitLayoutSizeForChannel(e,"width"),parseNonUnitLayoutSizeForChannel(e,"height")}(this)}parseSelections(){this.component.selection={};for(const e of this.children){e.parseSelections();for(const t of y(e.component.selection))this.component.selection[t]=e.component.selection[t]}}parseMarkGroup(){for(const e of this.children)e.parseMarkGroup()}parseAxesAndHeaders(){parseLayerAxes(this)}assembleSelectionTopLevelSignals(e){return this.children.reduce((e,t)=>t.assembleSelectionTopLevelSignals(e),e)}assembleSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleSignals()),assembleAxisSignals(this))}assembleLayoutSignals(){return this.children.reduce((e,t)=>e.concat(t.assembleLayoutSignals()),assembleLayoutSignals(this))}assembleSelectionData(e){return this.children.reduce((e,t)=>t.assembleSelectionData(e),e)}assembleTitle(){let e=super.assembleTitle();if(e)return e;for(const t of this.children)if(e=t.assembleTitle())return e}assembleLayout(){return null}assembleMarks(){return function assembleLayerSelectionMarks(e,t){for(const n of e.children)isUnitModel(n)&&(t=assembleUnitSelectionMarks(n,t));return t}(this,this.children.flatMap(e=>e.assembleMarks()))}assembleLegends(){return this.children.reduce((e,t)=>e.concat(t.assembleLegends()),assembleLegends(this))}}function buildModel(e,t,n,r,i){if("facet"in e)return new facet_FacetModel(e,t,n,i);if("layer"in e)return new layer_LayerModel(e,t,n,r,i);if("mark"in e)return new unit_UnitModel(e,t,n,r,i);if(function isAnyConcatSpec(e){return"vconcat"in e||"hconcat"in e||"concat"in e}(e))return new concat_ConcatModel(e,t,n,i);throw new Error(x.invalidSpec(e))}var Ei=function(e,t){var n={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,i=Object.getOwnPropertySymbols(e);r"width"!==e.name&&"height"!==e.name||void 0===e.value||(t[e.name]=+e.value,!1));var c=t["params"],g=Ei(t,["params"]);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({$schema:"https://vega.github.io/schema/vega/v5.json"},e.description?{description:e.description}:{}),g),a?{title:a}:{}),s?{style:s}:{}),A?{encode:{update:A}}:{}),{data:n}),0=A?w:Q).text.primary}var e=function augmentColor(e){var t=1(e instanceof r.a||(Object(D.a)("string"!=typeof e,`Shader module use by name is deprecated. Import shader module '${e}' and use it directly.`),Object(D.a)(e.name,"shader module has no name"),(e=new r.a(e)).dependencies=instantiateModules(e.dependencies)),e))}(e))}function getShaderDependencies(e){const t={},n={};return getDependencyGraph({modules:e,level:0,moduleMap:t,moduleDepth:n}),Object.keys(n).sort((e,t)=>n[t]-n[e]).map(e=>t[e])}function getDependencyGraph({modules:e,level:t,moduleMap:n,moduleDepth:r}){if(5<=t)throw new Error("Possible loop in shader dependency graph");for(const i of e)(void 0===r[(n[i.name]=i).name]||r[i.name]{G[e]=e});const o={};function canCompileGLGSExtension(e,t,n={}){var r=i[t];if(Object(D.a)(r,t),!function isOldIE(e={}){var t="undefined"!=typeof window&&window.navigator||{};const n=e.userAgent||t.userAgent||"";return e=-1!==n.indexOf("MSIE "),t=-1!==n.indexOf("Trident/"),e||t}(n))return 1;if(t in o)return o[t];r=`#extension GL_${r[0]} : ${n.behavior||"enable"} +void main(void) {}`,n=e.createShader(35633),e.shaderSource(n,r),e.compileShader(n),r=e.getShaderParameter(n,35713);return e.deleteShader(n),o[t]=r}function getFeature(e,t){var n=i[t],t=(Object(D.a)(n,t),function isWebGL2(e){return"undefined"!=typeof WebGL2RenderingContext&&e instanceof WebGL2RenderingContext||Boolean(e&&2===e._version)}(e)&&n[1]||n[0]),n="string"==typeof t?Boolean(e.getExtension(t)):t;return Object(D.a)(!1===n||!0===n),n}function hasFeatures(t,e){return(e=Array.isArray(e)?e:[e]).every(e=>getFeature(t,e))}var N=n(389);function testVariable(e){return new RegExp(`\\b${e}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}t=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]];const a=[...t,[testVariable("attribute"),"in $1"],[testVariable("varying"),"out $1"]],s=[...t,[testVariable("varying"),"in $1"]];t=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]];const A=[...t,[testVariable("in"),"attribute $1"],[testVariable("out"),"varying $1"]],l=[...t,[testVariable("in"),"varying $1"]],c="gl_FragColor",g=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,u=/void\s+main\s*\([^)]*\)\s*\{\n?/;function transpileShader(e,t,n){switch(t){case 300:return n?convertShader(e,a):function convertFragmentShaderTo300(e){var t=(e=convertShader(e,s)).match(g);if(t){t=t[1];e=e.replace(new RegExp(`\\b${c}\\b`,"g"),t)}else{const n="fragmentColor";e=e.replace(u,e=>`out vec4 ${n}; `+e).replace(new RegExp(`\\b${c}\\b`,"g"),n)}return e}(e);case 100:return n?convertShader(e,A):function convertFragmentShaderTo100(e){var t=(e=convertShader(e,l)).match(g);t&&(t=t[1],e=e.replace(g,"").replace(new RegExp(`\\b${t}\\b`,"g"),c));return e}(e);default:throw new Error("unknown GLSL version "+t)}}function convertShader(e,t){for(var[n,r]of t)e=e.replace(n,r);return e}const k=` ${N.a} @@ -1115,13 +1115,13 @@ ${g?"":M} `:h+` `;o=function normalizeHookFunctions(e){const i={vs:{},fs:{}};return e.forEach(e=>{let t;"string"!=typeof e?e=(t=e).hook:t={};var[n,r]=(e=e.trim()).split(":"),e=e.replace(/\(.+/,"");i[n][e]=Object.assign(t,{signature:r})}),i}(a);const C={},m={},y={};for(const S in s){var B,b="string"==typeof s[S]?{injection:s[S],order:0}:s[S],v=S.match(/^(v|f)s:(#)?([\w-]+)$/);v?(B=v[2],v=v[3],B?"decl"===v?m[S]=[b]:y[S]=[b]:C[S]=[b]):y[S]=[b]}for(const _ of i){c&&_.checkDeprecations(p,c);var E=_.getModuleSource(r,d),Q=(I+=E,_.injections[r]);for(const x in Q){var w=x.match(/^(v|f)s:#([\w-]+)$/);if(w){const R="decl"===w[2]?m:y;R[x]=R[x]||[],R[x].push(Q[x])}else C[x]=C[x]||[],C[x].push(Q[x])}}return I+=k,I=Object(N.c)(I,r,m),I=(I+=function getHookFunctions(e,t){let n="";for(const i in e){var r=e[i];if(n+=`void ${r.signature} { `,r.header&&(n+=" "+r.header),t[i]){const o=t[i];o.sort((e,t)=>e.order-t.order);for(const a of o)n+=` ${a.injection} -`}r.footer&&(n+=" "+r.footer),n+="}\n"}return n}(o[r],C))+p,I=transpileShader(I=Object(N.c)(I,r,y),A?100:d,g)}var C=n(1158);class program_manager_ProgramManager{static getDefaultProgramManager(e){return e.luma=e.luma||{},e.luma.defaultProgramManager=e.luma.defaultProgramManager||new program_manager_ProgramManager(e),e.luma.defaultProgramManager}constructor(e){this.gl=e,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}addDefaultModule(t){this._defaultModules.find(e=>e.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(e=>e.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:n="",defines:r={},inject:i={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:s=!1}=e,A=this._getModuleList(e.modules);var e=this._getHash(t),l=this._getHash(n);const c=A.map(e=>this._getHash(e.name)).sort(),g=o.map(e=>this._getHash(e));var u=Object.keys(r).sort(),d=Object.keys(i).sort();const h=[],p=[];for(const f of u)h.push(this._getHash(f)),h.push(this._getHash(r[f]));for(const I of d)p.push(this._getHash(I)),p.push(this._getHash(i[I]));u=`${e}/${l}D${h.join("/")}M${c.join("/")}I${p.join("/")}V${g.join("/")}H${this.stateHash}B`+a+(s?"T":"");return this._programCache[u]||(d=assembleShaders(this.gl,{vs:t,fs:n,modules:A,inject:i,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:s}),this._programCache[u]=new C.a(this.gl,{hash:u,vs:d.vs,fs:d.fs,varyings:o,bufferMode:a}),this._getUniforms[u]=d.getUniforms||(e=>{}),this._useCounts[u]=0),this._useCounts[u]++,this._programCache[u]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){e=e.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(n=[]){const r=new Array(this._defaultModules.length+n.length),i={};let o=0;for(let e=0,t=this._defaultModules.length;eA.length)throw new h("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=f[t.op].call(t,A,u,e)).test)throw new h("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(c<=l){if(!1===(a=p[t.op].call(t,A,u,e)).test)throw new h("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(A=A[u],n&&le.name===t.name)||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter(e=>e.name!==t),this.stateHash++}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e),this.stateHash++}get(e={}){const{vs:t="",fs:n="",defines:r={},inject:i={},varyings:o=[],bufferMode:a=35981,transpileToGLSL100:s=!1}=e,A=this._getModuleList(e.modules);var e=this._getHash(t),l=this._getHash(n);const c=A.map(e=>this._getHash(e.name)).sort(),g=o.map(e=>this._getHash(e));var u=Object.keys(r).sort(),d=Object.keys(i).sort();const h=[],p=[];for(const f of u)h.push(this._getHash(f)),h.push(this._getHash(r[f]));for(const I of d)p.push(this._getHash(I)),p.push(this._getHash(i[I]));u=`${e}/${l}D${h.join("/")}M${c.join("/")}I${p.join("/")}V${g.join("/")}H${this.stateHash}B`+a+(s?"T":"");return this._programCache[u]||(d=assembleShaders(this.gl,{vs:t,fs:n,modules:A,inject:i,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:s}),this._programCache[u]=new C.a(this.gl,{hash:u,vs:d.vs,fs:d.fs,varyings:o,bufferMode:a}),this._getUniforms[u]=d.getUniforms||(e=>{}),this._useCounts[u]=0),this._useCounts[u]++,this._programCache[u]}getUniforms(e){return this._getUniforms[e.hash]||null}release(e){e=e.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}_getModuleList(n=[]){const r=new Array(this._defaultModules.length+n.length),i={};let o=0;for(let e=0,t=this._defaultModules.length;eA.length)throw new h("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(a=f[t.op].call(t,A,u,e)).test)throw new h("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}}else if(c<=l){if(!1===(a=p[t.op].call(t,A,u,e)).test)throw new h("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return a}if(A=A[u],n&&lisFeatureSupported(t,e))}function getFeatures(e){e.luma=e.luma||{},e.luma.caps=e.luma.caps||{};for(const t in a.b)void 0===e.luma.caps[t]&&(e.luma.caps[t]=isFeatureSupported(e,t));return e.luma.caps}function isFeatureSupported(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function queryFeature(e,t){var n=a.b[t];Object(A.a)(n,t);let r;const i=Object(s.j)(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;for(const o of i)r=r&&Boolean(e.getExtension(o))}else"string"==typeof i?r=Boolean(e.getExtension(i)):"boolean"==typeof i?r=i:Object(A.a)(!1);return r}(e,t)),e.luma.caps[t]||s.k.log(r,`Feature: ${t} not supported`)(),e.luma.caps[t]}},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r,i,o,a=n(472);!function defaultLocale(e){r=Object(a.a)(e),i=r.format,o=r.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]})},,,,,,,,,,,,,,,,,,,,,,,,,function(E,e,t){"use strict"; +var A=new WeakMap,l=function Mirror(e){this.observers=new Map,this.obj=e},c=function ObserverInfo(e,t){this.callback=e,this.observer=t};function unobserve(e,t){t.unobserve()}function observe(e,t){var n,r,i,o,a=function getMirror(e){return A.get(e)}(e);return a?(n=function getObserverFromMirror(e,t){return e.observers.get(t)}(a,t),r=n&&n.observer):(a=new l(e),A.set(e,a)),r||(r={},a.value=_deepClone(e),t&&(r.callback=t,r.next=null,i=function(){generate(r)},o=function(){clearTimeout(r.next),r.next=setTimeout(i)},"undefined"!=typeof window&&(window.addEventListener("mouseup",o),window.addEventListener("keyup",o),window.addEventListener("mousedown",o),window.addEventListener("keydown",o),window.addEventListener("change",o))),r.patches=[],r.object=e,r.unobserve=function(){generate(r),clearTimeout(r.next),function removeObserverFromMirror(e,t){e.observers.delete(t.callback)}(a,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",o),window.removeEventListener("keyup",o),window.removeEventListener("mousedown",o),window.removeEventListener("keydown",o),window.removeEventListener("change",o))},a.observers.set(t,new c(t,r)),r)}function generate(e,t){void 0===t&&(t=!1);var n=A.get(e.object),t=(_generate(n.value,e.object,e.patches,"",t),e.patches.length&&applyPatch(n.value,e.patches),e.patches);return 0isFeatureSupported(t,e))}function getFeatures(e){e.luma=e.luma||{},e.luma.caps=e.luma.caps||{};for(const t in a.b)void 0===e.luma.caps[t]&&(e.luma.caps[t]=isFeatureSupported(e,t));return e.luma.caps}function isFeatureSupported(e,t){return e.luma=e.luma||{},e.luma.caps=e.luma.caps||{},void 0===e.luma.caps[t]&&(e.luma.caps[t]=function queryFeature(e,t){var n=a.b[t];Object(A.a)(n,t);let r;const i=Object(s.j)(e)&&n[1]||n[0];if("function"==typeof i)r=i(e);else if(Array.isArray(i)){r=!0;for(const o of i)r=r&&Boolean(e.getExtension(o))}else"string"==typeof i?r=Boolean(e.getExtension(i)):"boolean"==typeof i?r=i:Object(A.a)(!1);return r}(e,t)),e.luma.caps[t]||s.k.log(r,`Feature: ${t} not supported`)(),e.luma.caps[t]}},function(e,t,n){"use strict";n.d(t,"a",function(){return i}),n.d(t,"b",function(){return o});var r,i,o,a=n(483);!function defaultLocale(e){r=Object(a.a)(e),i=r.format,o=r.formatPrefix}({thousands:",",grouping:[3],currency:["$",""]})},,,,,,,,,,,,,,,,,,,,,,,,,,function(E,e,t){"use strict"; /** @license React v16.14.0 * react.production.min.js * @@ -1129,7 +1129,7 @@ var A=new WeakMap,l=function Mirror(e){this.observers=new Map,this.obj=e},c=func * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var c=t(489),t="function"==typeof Symbol&&Symbol.for,g=t?Symbol.for("react.element"):60103,A=t?Symbol.for("react.portal"):60106,n=t?Symbol.for("react.fragment"):60107,r=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,s=t?Symbol.for("react.forward_ref"):60112,l=t?Symbol.for("react.suspense"):60113,u=t?Symbol.for("react.memo"):60115,d=t?Symbol.for("react.lazy"):60116,h="function"==typeof Symbol&&Symbol.iterator;function C(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n
element.\n color: 'inherit',\n '&::-moz-focus-inner': {\n borderStyle: 'none' // Remove Firefox dotted outline.\n\n },\n '&$disabled': {\n pointerEvents: 'none',\n // Disable link interactions\n cursor: 'default'\n },\n '@media print': {\n colorAdjust: 'exact'\n }\n },\n\n /* Pseudo-class applied to the root element if `disabled={true}`. */\n disabled: {},\n\n /* Pseudo-class applied to the root element if keyboard focused. */\n focusVisible: {}\n};\n/**\n * `ButtonBase` contains as few styles as possible.\n * It aims to be a simple building block for creating a button.\n * It contains a load of style reset and some focus/ripple logic.\n */\n\nvar ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(props, ref) {\n var action = props.action,\n buttonRefProp = props.buttonRef,\n _props$centerRipple = props.centerRipple,\n centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,\n children = props.children,\n classes = props.classes,\n className = props.className,\n _props$component = props.component,\n component = _props$component === void 0 ? 'button' : _props$component,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$disableRipple = props.disableRipple,\n disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,\n _props$disableTouchRi = props.disableTouchRipple,\n disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,\n _props$focusRipple = props.focusRipple,\n focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,\n focusVisibleClassName = props.focusVisibleClassName,\n onBlur = props.onBlur,\n onClick = props.onClick,\n onFocus = props.onFocus,\n onFocusVisible = props.onFocusVisible,\n onKeyDown = props.onKeyDown,\n onKeyUp = props.onKeyUp,\n onMouseDown = props.onMouseDown,\n onMouseLeave = props.onMouseLeave,\n onMouseUp = props.onMouseUp,\n onTouchEnd = props.onTouchEnd,\n onTouchMove = props.onTouchMove,\n onTouchStart = props.onTouchStart,\n onDragLeave = props.onDragLeave,\n _props$tabIndex = props.tabIndex,\n tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,\n TouchRippleProps = props.TouchRippleProps,\n _props$type = props.type,\n type = _props$type === void 0 ? 'button' : _props$type,\n other = _objectWithoutProperties(props, [\"action\", \"buttonRef\", \"centerRipple\", \"children\", \"classes\", \"className\", \"component\", \"disabled\", \"disableRipple\", \"disableTouchRipple\", \"focusRipple\", \"focusVisibleClassName\", \"onBlur\", \"onClick\", \"onFocus\", \"onFocusVisible\", \"onKeyDown\", \"onKeyUp\", \"onMouseDown\", \"onMouseLeave\", \"onMouseUp\", \"onTouchEnd\", \"onTouchMove\", \"onTouchStart\", \"onDragLeave\", \"tabIndex\", \"TouchRippleProps\", \"type\"]);\n\n var buttonRef = React.useRef(null);\n\n function getButtonNode() {\n // #StrictMode ready\n return ReactDOM.findDOMNode(buttonRef.current);\n }\n\n var rippleRef = React.useRef(null);\n\n var _React$useState = React.useState(false),\n focusVisible = _React$useState[0],\n setFocusVisible = _React$useState[1];\n\n if (disabled && focusVisible) {\n setFocusVisible(false);\n }\n\n var _useIsFocusVisible = useIsFocusVisible(),\n isFocusVisible = _useIsFocusVisible.isFocusVisible,\n onBlurVisible = _useIsFocusVisible.onBlurVisible,\n focusVisibleRef = _useIsFocusVisible.ref;\n\n React.useImperativeHandle(action, function () {\n return {\n focusVisible: function focusVisible() {\n setFocusVisible(true);\n buttonRef.current.focus();\n }\n };\n }, []);\n React.useEffect(function () {\n if (focusVisible && focusRipple && !disableRipple) {\n rippleRef.current.pulsate();\n }\n }, [disableRipple, focusRipple, focusVisible]);\n\n function useRippleHandler(rippleAction, eventCallback) {\n var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;\n return useEventCallback(function (event) {\n if (eventCallback) {\n eventCallback(event);\n }\n\n var ignore = skipRippleAction;\n\n if (!ignore && rippleRef.current) {\n rippleRef.current[rippleAction](event);\n }\n\n return true;\n });\n }\n\n var handleMouseDown = useRippleHandler('start', onMouseDown);\n var handleDragLeave = useRippleHandler('stop', onDragLeave);\n var handleMouseUp = useRippleHandler('stop', onMouseUp);\n var handleMouseLeave = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n event.preventDefault();\n }\n\n if (onMouseLeave) {\n onMouseLeave(event);\n }\n });\n var handleTouchStart = useRippleHandler('start', onTouchStart);\n var handleTouchEnd = useRippleHandler('stop', onTouchEnd);\n var handleTouchMove = useRippleHandler('stop', onTouchMove);\n var handleBlur = useRippleHandler('stop', function (event) {\n if (focusVisible) {\n onBlurVisible(event);\n setFocusVisible(false);\n }\n\n if (onBlur) {\n onBlur(event);\n }\n }, false);\n var handleFocus = useEventCallback(function (event) {\n // Fix for https://github.com/facebook/react/issues/7769\n if (!buttonRef.current) {\n buttonRef.current = event.currentTarget;\n }\n\n if (isFocusVisible(event)) {\n setFocusVisible(true);\n\n if (onFocusVisible) {\n onFocusVisible(event);\n }\n }\n\n if (onFocus) {\n onFocus(event);\n }\n });\n\n var isNonNativeButton = function isNonNativeButton() {\n var button = getButtonNode();\n return component && component !== 'button' && !(button.tagName === 'A' && button.href);\n };\n /**\n * IE 11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat\n */\n\n\n var keydownRef = React.useRef(false);\n var handleKeyDown = useEventCallback(function (event) {\n // Check if key is already down to avoid repeats being counted as multiple activations\n if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {\n keydownRef.current = true;\n event.persist();\n rippleRef.current.stop(event, function () {\n rippleRef.current.start(event);\n });\n }\n\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {\n event.preventDefault();\n }\n\n if (onKeyDown) {\n onKeyDown(event);\n } // Keyboard accessibility for non interactive elements\n\n\n if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {\n event.preventDefault();\n\n if (onClick) {\n onClick(event);\n }\n }\n });\n var handleKeyUp = useEventCallback(function (event) {\n // calling preventDefault in keyUp on a