streamlit-nightly 1.43.3.dev20250324__py3-none-any.whl → 1.44.1.dev20250325__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. streamlit/config.py +69 -24
  2. streamlit/elements/exception.py +8 -0
  3. streamlit/elements/markdown.py +35 -21
  4. streamlit/elements/widgets/number_input.py +11 -6
  5. streamlit/elements/widgets/slider.py +17 -5
  6. streamlit/material_icon_names.py +1 -1
  7. streamlit/runtime/context.py +21 -1
  8. streamlit/static/index.html +2 -2
  9. streamlit/static/static/css/{index.BOl9eq08.css → index.DKr_zoDj.css} +1 -1
  10. streamlit/static/static/js/{FileDownload.esm.DIlnitWB.js → FileDownload.esm.B-UWWWdT.js} +1 -1
  11. streamlit/static/static/js/{FileHelper.KvWFUw_P.js → FileHelper.DRtEaIrj.js} +1 -1
  12. streamlit/static/static/js/{FormClearHelper.CyEIoAU7.js → FormClearHelper.B_xJLRtH.js} +1 -1
  13. streamlit/static/static/js/{Hooks.CGlNtuXA.js → Hooks.DtzWH7N2.js} +1 -1
  14. streamlit/static/static/js/{InputInstructions.Gw6d6QM8.js → InputInstructions.CkYMcz8B.js} +1 -1
  15. streamlit/static/static/js/{ProgressBar.CzEGt_ze.js → ProgressBar.Drx8XNKv.js} +1 -1
  16. streamlit/static/static/js/{RenderInPortalIfExists.CuMtThMP.js → RenderInPortalIfExists.BSkIOPqr.js} +1 -1
  17. streamlit/static/static/js/{Toolbar.Bq1OwJ3s.js → Toolbar.2r5jAJur.js} +1 -1
  18. streamlit/static/static/js/{base-input.DIEsEK6k.js → base-input.CV_PJtfn.js} +1 -1
  19. streamlit/static/static/js/{checkbox.DlvrBnOk.js → checkbox.CZjCrRM6.js} +1 -1
  20. streamlit/static/static/js/{createSuper.Ck3SfvAY.js → createSuper.wNbYZKaS.js} +1 -1
  21. streamlit/static/static/js/{data-grid-overlay-editor.DJffL7IE.js → data-grid-overlay-editor.CxDiXQOm.js} +1 -1
  22. streamlit/static/static/js/{downloader.5RyfsT4Q.js → downloader.BKhc9vo-.js} +1 -1
  23. streamlit/static/static/js/{es6.BZLzosaK.js → es6.DMMA5jEp.js} +2 -2
  24. streamlit/static/static/js/{iframeResizer.contentWindow.BObQcmGt.js → iframeResizer.contentWindow.rU5g5dG9.js} +1 -1
  25. streamlit/static/static/js/{index.DZlmDQG1.js → index.60o7QeO8.js} +5 -5
  26. streamlit/static/static/js/{index.F_5_o4iG.js → index.6LeN9cCn.js} +1 -1
  27. streamlit/static/static/js/{index.BqkHlhBZ.js → index.B5181i5i.js} +1 -1
  28. streamlit/static/static/js/{index.BH7umdkZ.js → index.B5pjbkNu.js} +1 -1
  29. streamlit/static/static/js/{index.uOyQEYYB.js → index.BDnhO8N2.js} +1 -1
  30. streamlit/static/static/js/{index.CtoshGgl.js → index.BGHyjPoE.js} +1 -1
  31. streamlit/static/static/js/{index.CJ1b2hLc.js → index.BKHYl8ma.js} +1 -1
  32. streamlit/static/static/js/{index.CeXwOaW3.js → index.BW1ps7Ve.js} +1 -1
  33. streamlit/static/static/js/{index.BGbUzuRh.js → index.B_lGEToe.js} +1 -1
  34. streamlit/static/static/js/{index.BrfxfIQx.js → index.BnFXM4vg.js} +1 -1
  35. streamlit/static/static/js/{index.DCG_M3sj.js → index.BvR3oAAg.js} +1 -1
  36. streamlit/static/static/js/{index.B0a-0dE-.js → index.BxcYwJga.js} +1 -1
  37. streamlit/static/static/js/{index.BpP4PaU6.js → index.C5tuUwoV.js} +1 -1
  38. streamlit/static/static/js/{index.CmWhyYnm.js → index.C5x1XZ52.js} +1 -1
  39. streamlit/static/static/js/{index.Cdhezq0G.js → index.C7Pn7DNY.js} +1 -1
  40. streamlit/static/static/js/{index.DzzKb95t.js → index.C8fLs5OO.js} +1 -1
  41. streamlit/static/static/js/{index.CO0zn1S0.js → index.CEK_kfj1.js} +1 -1
  42. streamlit/static/static/js/{index.CeVyYlbb.js → index.CLpTIY8k.js} +1 -1
  43. streamlit/static/static/js/{index.DnRcoJiQ.js → index.COu5ow_u.js} +1 -1
  44. streamlit/static/static/js/{index.Cmv4rRpV.js → index.CY2a3G5f.js} +1 -1
  45. streamlit/static/static/js/{index.CscliOXE.js → index.CcHn1Jbf.js} +1 -1
  46. streamlit/static/static/js/{index.m03R_C2M.js → index.CdUwInkp.js} +1 -1
  47. streamlit/static/static/js/{index.Bc34Jyud.js → index.Ci8MtnNW.js} +4 -4
  48. streamlit/static/static/js/{index.WkqIK0MD.js → index.Cj6d-zQP.js} +1 -1
  49. streamlit/static/static/js/{index.Pe3uxm8H.js → index.CjiDtsfR.js} +1 -1
  50. streamlit/static/static/js/{index.Dikm-NhC.js → index.DMOnosvH.js} +1 -1
  51. streamlit/static/static/js/{index.BbQCsSu8.js → index.Dh-GaoLL.js} +1 -1
  52. streamlit/static/static/js/{index.CmWpy-_w.js → index.DkHRVwYA.js} +1 -1
  53. streamlit/static/static/js/{index.JOTMsfbe.js → index.DmhhLL_7.js} +1 -1
  54. streamlit/static/static/js/{index.CSzH9XbP.js → index.PUoEdeCj.js} +1 -1
  55. streamlit/static/static/js/{index.DNPMLwqR.js → index.YSxp_z0H.js} +1 -1
  56. streamlit/static/static/js/{index.BGjwwe7S.js → index.aJaKE3aW.js} +1 -1
  57. streamlit/static/static/js/{index.Crthd-_C.js → index.hYp-Io20.js} +1 -1
  58. streamlit/static/static/js/{index.pmLVrqeq.js → index.lLHaP-WG.js} +1 -1
  59. streamlit/static/static/js/{index.Bw9ypWXW.js → index.poiWcDhd.js} +1 -1
  60. streamlit/static/static/js/{index.CnZGzNni.js → index.qaTnk5v5.js} +5 -5
  61. streamlit/static/static/js/{index.EePHpMJs.js → index.wpF1efVn.js} +1 -1
  62. streamlit/static/static/js/{input.D4-snIy8.js → input.hfihv8cy.js} +1 -1
  63. streamlit/static/static/js/{memory.DfGhTK_n.js → memory.CwFUs_rm.js} +1 -1
  64. streamlit/static/static/js/{mergeWith.2UmuQo0t.js → mergeWith.NipycHTn.js} +1 -1
  65. streamlit/static/static/js/{number-overlay-editor.CLSvrmK2.js → number-overlay-editor.BOZydn7S.js} +1 -1
  66. streamlit/static/static/js/{possibleConstructorReturn.j4WjydV3.js → possibleConstructorReturn.BegGyJAz.js} +1 -1
  67. streamlit/static/static/js/{sandbox.dGrV7zVE.js → sandbox.UTLHU4Ul.js} +1 -1
  68. streamlit/static/static/js/{textarea.2ZfcIYmZ.js → textarea.dlySzlub.js} +1 -1
  69. streamlit/static/static/js/{timepicker.BveH-8js.js → timepicker.QFZeHTS5.js} +1 -1
  70. streamlit/static/static/js/{toConsumableArray.CkHCjwX9.js → toConsumableArray.D1_QwNnQ.js} +1 -1
  71. streamlit/static/static/js/{uniqueId.Bnywonrs.js → uniqueId.DrcTmetR.js} +1 -1
  72. streamlit/static/static/js/{useBasicWidgetState.CYjuP8Fb.js → useBasicWidgetState.jMbeuIfG.js} +1 -1
  73. streamlit/static/static/js/{useOnInputChange.BAUMwlPg.js → useOnInputChange.CsqSzHwu.js} +1 -1
  74. streamlit/static/static/js/{withFullScreenWrapper.BltJBw92.js → withFullScreenWrapper.Cnlc3o1n.js} +1 -1
  75. streamlit/static/static/media/MaterialSymbols-Rounded.C21bROXx.woff2 +0 -0
  76. {streamlit_nightly-1.43.3.dev20250324.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/METADATA +1 -1
  77. {streamlit_nightly-1.43.3.dev20250324.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/RECORD +81 -81
  78. {streamlit_nightly-1.43.3.dev20250324.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/WHEEL +1 -1
  79. streamlit/static/static/media/MaterialSymbols-Rounded.BFCIvovZ.woff2 +0 -0
  80. {streamlit_nightly-1.43.3.dev20250324.data → streamlit_nightly-1.44.1.dev20250325.data}/scripts/streamlit.cmd +0 -0
  81. {streamlit_nightly-1.43.3.dev20250324.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/entry_points.txt +0 -0
  82. {streamlit_nightly-1.43.3.dev20250324.dist-info → streamlit_nightly-1.44.1.dev20250325.dist-info}/top_level.txt +0 -0
@@ -1,9 +1,9 @@
1
- var WU=Object.defineProperty;var JU=(r,e,t)=>e in r?WU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>JU(r,typeof e!="symbol"?e+"":e,t);import{r as Bt,at as yr,aS as dt,g as sh,aT as Su,_ as VO,j as Ss,C as Jc,aU as Nv,F as uB,aV as kv,aW as XU,aX as fB,aY as KU,aD as YU,aZ as qU,n as HO,B as jO,U as t2,a_ as hB,aA as ZU,z as QU,a$ as e5,b0 as dB}from"./index.Bc34Jyud.js";import{_ as ls,a as t5,C as r5}from"./toConsumableArray.CkHCjwX9.js";import{a as Xu,b as Ku,_ as Qx,c as AA,d as ew}from"./possibleConstructorReturn.j4WjydV3.js";import{a as n5,T as i5}from"./Toolbar.Bq1OwJ3s.js";import{u as $O,E as WO,w as s5}from"./withFullScreenWrapper.BltJBw92.js";import{u as o5}from"./useBasicWidgetState.CYjuP8Fb.js";import{u as a5,s as c5}from"./threshold.DjX0wlsa.js";import{a as l5}from"./index.t--hEgTQ.js";import"./FormClearHelper.CyEIoAU7.js";import"./value.CgPGBV_l.js";function u5(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const bu={};function jm(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const tw=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),AB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);AB&&parseFloat(AB[1]);const Fu=globalThis,Ta=globalThis.process||{},f5=globalThis.navigator||{};function JO(r){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function il(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||JO()}function h5(r){return il()?JO()?"Electron":(f5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const sy="4.1.0";function d5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let A5=class{constructor(e,t,n="sessionStorage"){this.storage=d5(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function p5(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function g5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var $m;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})($m||($m={}));const m5=10;function pB(r){return typeof r!="string"?r:(r=r.toUpperCase(),$m[r]||$m.WHITE)}function _5(r,e,t){return!il&&typeof r=="string"&&(e&&(r=`\x1B[${pB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${pB(t)+m5}m${r}\x1B[49m`)),r}function y5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const o of n){const s=i[o];typeof s=="function"&&(e.find(c=>o===c)||(i[o]=s.bind(r)))}}function rw(r,e){if(!r)throw new Error("Assertion failed")}function sd(){var e,t,n;let r;if(il()&&Fu.performance)r=(t=(e=Fu==null?void 0:Fu.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Ta){const i=(n=Ta==null?void 0:Ta.hrtime)==null?void 0:n.call(Ta);r=i[0]*1e3+i[1]/1e6}else r=Date.now();return r}const od={debug:il()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},v5={enabled:!0,level:0};function ad(){}const gB={},mB={once:!0};let XO=class{constructor({id:e}={id:""}){this.VERSION=sy,this._startTs=sd(),this._deltaTs=sd(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new A5(`__probe-${this.id}__`,v5),this.timeStamp(`${this.id} started`),y5(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((sd()-this._startTs).toPrecision(10))}getDelta(){return Number((sd()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,od.warn,arguments,mB)}error(e){return this._getLogFunction(0,e,od.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,od.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,od.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,od.debug||od.info,arguments,mB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||ad,n&&[n],{tag:x5(t)}):ad}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||ad)}group(e,t,n={collapsed:!1}){const i=_B({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||ad)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=KO(e)}_getLogFunction(e,t,n,i,o){if(this._shouldLog(e)){o=_B({logLevel:e,message:t,args:i,opts:o}),n=n||o.method,rw(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=sd();const s=o.tag||o.message;if(o.once&&s)if(!gB[s])gB[s]=sd();else return ad;return t=b5(this.id,o.message,o),n.bind(console,t,...o.args)}return ad}};XO.VERSION=sy;function KO(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return rw(Number.isFinite(e)&&e>=0),e}function _B(r){const{logLevel:e,message:t}=r;r.logLevel=KO(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return rw(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function b5(r,e,t){if(typeof e=="string"){const n=t.time?g5(p5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=_5(e,t.color,t.background)}return e}function x5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function w5(r,e){return YO(r||{},e)}function YO(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?n[i]=YO(n[i]||{},e[i],t+1):n[i]=e[i];return n}const C5="latest";function E5(){var r;return(r=globalThis._loadersgl_)!=null&&r.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const T5=E5();function zu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const Wf=typeof process!="object"||String(process)!=="[object process]"||process.browser,B5=typeof window<"u"&&typeof window.orientation<"u",yB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);yB&&parseFloat(yB[1]);let S5=class{constructor(e,t){V(this,"name");V(this,"workerThread");V(this,"isRunning",!0);V(this,"result");V(this,"_resolve",()=>{});V(this,"_reject",()=>{});this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zu(this.isRunning),this.isRunning=!1,this._reject(e)}},Uv=class{terminate(){}};const zv=new Map;function I5(r){zu(r.source&&!r.url||!r.source&&r.url);let e=zv.get(r.source||r.url);return e||(r.url&&(e=M5(r.url),zv.set(r.url,e)),r.source&&(e=qO(r.source),zv.set(r.source,e))),zu(e),e}function M5(r){if(!r.startsWith("http"))return r;const e=P5(r);return qO(e)}function qO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function P5(r){return`try {
1
+ var WU=Object.defineProperty;var JU=(r,e,t)=>e in r?WU(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var V=(r,e,t)=>JU(r,typeof e!="symbol"?e+"":e,t);import{r as Bt,at as yr,aS as dt,g as sh,aT as Su,_ as VO,j as Ss,C as Jc,aU as Nv,F as uB,aV as kv,aW as XU,aX as fB,aY as KU,aD as YU,aZ as qU,n as HO,B as jO,U as t2,a_ as hB,aA as ZU,z as QU,a$ as e5,b0 as dB}from"./index.Ci8MtnNW.js";import{_ as ls,a as t5,C as r5}from"./toConsumableArray.D1_QwNnQ.js";import{a as Xu,b as Ku,_ as Qx,c as AA,d as ew}from"./possibleConstructorReturn.BegGyJAz.js";import{a as n5,T as i5}from"./Toolbar.2r5jAJur.js";import{u as $O,E as WO,w as s5}from"./withFullScreenWrapper.Cnlc3o1n.js";import{u as o5}from"./useBasicWidgetState.jMbeuIfG.js";import{u as a5,s as c5}from"./threshold.DjX0wlsa.js";import{a as l5}from"./index.t--hEgTQ.js";import"./FormClearHelper.B_xJLRtH.js";import"./value.CgPGBV_l.js";function u5(r,e){for(var t=0;t<e.length;t++){const n=e[t];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in r)){const o=Object.getOwnPropertyDescriptor(n,i);o&&Object.defineProperty(r,i,o.get?o:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}const bu={};function jm(r,e){if(!r)throw new Error(e||"loader assertion failed.")}const tw=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),AB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);AB&&parseFloat(AB[1]);const Fu=globalThis,Ta=globalThis.process||{},f5=globalThis.navigator||{};function JO(r){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function il(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||JO()}function h5(r){return il()?JO()?"Electron":(f5.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const sy="4.1.0";function d5(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let A5=class{constructor(e,t,n="sessionStorage"){this.storage=d5(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function p5(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function g5(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var $m;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})($m||($m={}));const m5=10;function pB(r){return typeof r!="string"?r:(r=r.toUpperCase(),$m[r]||$m.WHITE)}function _5(r,e,t){return!il&&typeof r=="string"&&(e&&(r=`\x1B[${pB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${pB(t)+m5}m${r}\x1B[49m`)),r}function y5(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const o of n){const s=i[o];typeof s=="function"&&(e.find(c=>o===c)||(i[o]=s.bind(r)))}}function rw(r,e){if(!r)throw new Error("Assertion failed")}function sd(){var e,t,n;let r;if(il()&&Fu.performance)r=(t=(e=Fu==null?void 0:Fu.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in Ta){const i=(n=Ta==null?void 0:Ta.hrtime)==null?void 0:n.call(Ta);r=i[0]*1e3+i[1]/1e6}else r=Date.now();return r}const od={debug:il()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},v5={enabled:!0,level:0};function ad(){}const gB={},mB={once:!0};let XO=class{constructor({id:e}={id:""}){this.VERSION=sy,this._startTs=sd(),this._deltaTs=sd(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new A5(`__probe-${this.id}__`,v5),this.timeStamp(`${this.id} started`),y5(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((sd()-this._startTs).toPrecision(10))}getDelta(){return Number((sd()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,od.warn,arguments,mB)}error(e){return this._getLogFunction(0,e,od.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,od.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,od.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,od.debug||od.info,arguments,mB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||ad,n&&[n],{tag:x5(t)}):ad}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||ad)}group(e,t,n={collapsed:!1}){const i=_B({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||ad)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=KO(e)}_getLogFunction(e,t,n,i,o){if(this._shouldLog(e)){o=_B({logLevel:e,message:t,args:i,opts:o}),n=n||o.method,rw(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=sd();const s=o.tag||o.message;if(o.once&&s)if(!gB[s])gB[s]=sd();else return ad;return t=b5(this.id,o.message,o),n.bind(console,t,...o.args)}return ad}};XO.VERSION=sy;function KO(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return rw(Number.isFinite(e)&&e>=0),e}function _B(r){const{logLevel:e,message:t}=r;r.logLevel=KO(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return rw(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function b5(r,e,t){if(typeof e=="string"){const n=t.time?g5(p5(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=_5(e,t.color,t.background)}return e}function x5(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}function w5(r,e){return YO(r||{},e)}function YO(r,e,t=0){if(t>3)return e;const n={...r};for(const[i,o]of Object.entries(e))o&&typeof o=="object"&&!Array.isArray(o)?n[i]=YO(n[i]||{},e[i],t+1):n[i]=e[i];return n}const C5="latest";function E5(){var r;return(r=globalThis._loadersgl_)!=null&&r.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.4"),globalThis._loadersgl_.version}const T5=E5();function zu(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}const Wf=typeof process!="object"||String(process)!=="[object process]"||process.browser,B5=typeof window<"u"&&typeof window.orientation<"u",yB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);yB&&parseFloat(yB[1]);let S5=class{constructor(e,t){V(this,"name");V(this,"workerThread");V(this,"isRunning",!0);V(this,"result");V(this,"_resolve",()=>{});V(this,"_reject",()=>{});this.name=e,this.workerThread=t,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){zu(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){zu(this.isRunning),this.isRunning=!1,this._reject(e)}},Uv=class{terminate(){}};const zv=new Map;function I5(r){zu(r.source&&!r.url||!r.source&&r.url);let e=zv.get(r.source||r.url);return e||(r.url&&(e=M5(r.url),zv.set(r.url,e)),r.source&&(e=qO(r.source),zv.set(r.source,e))),zu(e),e}function M5(r){if(!r.startsWith("http"))return r;const e=P5(r);return qO(e)}function qO(r){const e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function P5(r){return`try {
2
2
  importScripts('${r}');
3
3
  } catch (error) {
4
4
  console.error(error);
5
5
  throw error;
6
- }`}function ZO(r,e=!0,t){const n=t||new Set;if(r){if(vB(r))n.add(r);else if(vB(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(const i in r)ZO(r[i],e,n)}}return t===void 0?Array.from(n):[]}function vB(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}const Gv=()=>{};let r2=class{constructor(e){V(this,"name");V(this,"source");V(this,"url");V(this,"terminated",!1);V(this,"worker");V(this,"onMessage");V(this,"onError");V(this,"_loadableURL","");const{name:t,source:n,url:i}=e;zu(n||i),this.name=t,this.source=n,this.url=i,this.onMessage=Gv,this.onError=o=>console.log(o),this.worker=Wf?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Wf||typeof Uv<"u"&&!Wf}destroy(){this.onMessage=Gv,this.onError=Gv,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||ZO(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=I5({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){const n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new Uv(n,{eval:!1})}else if(this.source)e=new Uv(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}},R5=class{constructor(e){V(this,"name","unnamed");V(this,"source");V(this,"url");V(this,"maxConcurrency",1);V(this,"maxMobileConcurrency",1);V(this,"onDebug",()=>{});V(this,"reuseWorkers",!0);V(this,"props",{});V(this,"jobQueue",[]);V(this,"idleQueue",[]);V(this,"count",0);V(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return r2.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(i,o,s)=>i.done(s),n=(i,o)=>i.error(o)){const i=new Promise(o=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:o}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new S5(t.name,e);e.onMessage=i=>t.onMessage(n,i.type,i.payload),e.onError=i=>t.onError(n,i),t.onStart(n);try{await n.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Wf||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new r2({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return B5?this.maxMobileConcurrency:this.maxConcurrency}};const F5={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};var ac;let QO=(ac=class{constructor(e){V(this,"props");V(this,"workerPools",new Map);this.props={...F5},this.setProps(e),this.workerPools=new Map}static isSupported(){return r2.isSupported()}static getWorkerFarm(e={}){return ac._workerFarm=ac._workerFarm||new ac({}),ac._workerFarm.setProps(e),ac._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:n,url:i}=e;let o=this.workerPools.get(t);return o||(o=new R5({name:t,source:n,url:i}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,o)),o}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},V(ac,"_workerFarm"),ac);function O5(r,e={}){const t=e[r.id]||{},n=Wf?`${r.id}-worker.js`:`${r.id}-worker-node.js`;let i=t.workerUrl;if(!i&&r.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(Wf?i=`modules/${r.module}/dist/${n}`:i=`modules/${r.module}/src/workers/${r.id}-worker-node.ts`),!i){let o=r.version;o==="latest"&&(o=C5);const s=o?`@${o}`:"";i=`https://unpkg.com/@loaders.gl/${r.module}${s}/dist/${n}`}return zu(i),i}function D5(r,e=T5){zu(r,"no worker provided");const t=r.version;return!(!e||!t)}function L5(r,e){return!QO.isSupported()||!Wf&&!(e!=null&&e._nodeWorkers)?!1:r.worker&&(e==null?void 0:e.worker)}async function N5(r,e,t,n,i){const o=r.id,s=O5(r,t),f=QO.getWorkerFarm(t).getWorkerPool({name:o,url:s});t=JSON.parse(JSON.stringify(t)),n=JSON.parse(JSON.stringify(n||{}));const y=await f.startJob("process-on-worker",k5.bind(null,i));return y.postMessage("process",{input:e,options:t,context:n}),await(await y.result).result}async function k5(r,e,t,n){switch(t){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":const{id:i,input:o,options:s}=n;try{const c=await r(o,s);e.postMessage("done",{id:i,result:c})}catch(c){const f=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function U5(r,e,t){if(t=t||r.byteLength,r.byteLength<t||e.byteLength<t)return!1;const n=new Uint8Array(r),i=new Uint8Array(e);for(let o=0;o<n.length;++o)if(n[o]!==i[o])return!1;return!0}function z5(...r){return G5(r)}function G5(r){const e=r.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),t=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(t);let i=0;for(const o of e)n.set(o,i),i+=o.byteLength;return n.buffer}async function V5(r){const e=[];for await(const t of r)e.push(t);return z5(...e)}let H5="";const bB={};function j5(r){for(const e in bB)if(r.startsWith(e)){const t=bB[e];r=r.replace(e,t)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`${H5}${r}`),r}function $5(r){return r&&typeof r=="object"&&r.isBuffer}function eD(r){if($5(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){const e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function tD(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(e+1):""}function W5(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}const J5=r=>typeof r=="boolean",Up=r=>typeof r=="function",bg=r=>r!==null&&typeof r=="object",xB=r=>bg(r)&&r.constructor==={}.constructor,X5=r=>!!r&&typeof r[Symbol.iterator]=="function",K5=r=>r&&typeof r[Symbol.asyncIterator]=="function",oh=r=>typeof Response<"u"&&r instanceof Response||r&&r.arrayBuffer&&r.text&&r.json,ah=r=>typeof Blob<"u"&&r instanceof Blob,Y5=r=>r&&typeof r=="object"&&r.isBuffer,q5=r=>typeof ReadableStream<"u"&&r instanceof ReadableStream||bg(r)&&Up(r.tee)&&Up(r.cancel)&&Up(r.getReader),Z5=r=>bg(r)&&Up(r.read)&&Up(r.pipe)&&J5(r.readable),rD=r=>q5(r)||Z5(r);let Q5=class extends Error{constructor(t,n){super(t);V(this,"reason");V(this,"url");V(this,"response");this.reason=n.reason,this.url=n.url,this.response=n.response}};const ez=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tz=/^([-\w.]+\/[-\w.+]+)/;function wB(r,e){return r.toLowerCase()===e.toLowerCase()}function rz(r){const e=tz.exec(r);return e?e[1]:r}function CB(r){const e=ez.exec(r);return e?e[1]:""}const nD=/\?.*/;function nz(r){const e=r.match(nD);return e&&e[0]}function nw(r){return r.replace(nD,"")}function iz(r){if(r.length<50)return r;const e=r.slice(r.length-15);return`${r.substr(0,32)}...${e}`}function oy(r){return oh(r)?r.url:ah(r)?r.name||"":typeof r=="string"?r:""}function iw(r){if(oh(r)){const e=r,t=e.headers.get("content-type")||"",n=nw(e.url);return rz(t)||CB(n)}return ah(r)?r.type||"":typeof r=="string"?CB(r):""}function sz(r){return oh(r)?r.headers["content-length"]||-1:ah(r)?r.size:typeof r=="string"?r.length:r instanceof ArrayBuffer||ArrayBuffer.isView(r)?r.byteLength:-1}async function iD(r){if(oh(r))return r;const e={},t=sz(r);t>=0&&(e["content-length"]=String(t));const n=oy(r),i=iw(r);i&&(e["content-type"]=i);const o=await cz(r);o&&(e["x-first-bytes"]=o),typeof r=="string"&&(r=new TextEncoder().encode(r));const s=new Response(r,{headers:e});return Object.defineProperty(s,"url",{value:n}),s}async function oz(r){if(!r.ok)throw await az(r)}async function az(r){const e=iz(r.url);let t=`Failed to fetch resource (${r.status}) ${r.statusText}: ${e}`;t=t.length>100?`${t.slice(0,100)}...`:t;const n={reason:r.statusText,url:r.url,response:r};try{const i=r.headers.get("Content-Type");n.reason=i!=null&&i.includes("application/json")?await r.json():r.text()}catch{}return new Q5(t,n)}async function cz(r){if(typeof r=="string")return`data:,${r.slice(0,5)}`;if(r instanceof Blob){const t=r.slice(0,5);return await new Promise(n=>{const i=new FileReader;i.onload=o=>{var s;return n((s=o==null?void 0:o.target)==null?void 0:s.result)},i.readAsDataURL(t)})}if(r instanceof ArrayBuffer){const t=r.slice(0,5);return`data:base64,${lz(t)}`}return null}function lz(r){let e="";const t=new Uint8Array(r);for(let n=0;n<t.byteLength;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function uz(r){return!fz(r)&&!hz(r)}function fz(r){return r.startsWith("http:")||r.startsWith("https:")}function hz(r){return r.startsWith("data:")}async function EB(r,e){var t,n;if(typeof r=="string"){const i=j5(r);return uz(i)&&(t=globalThis.loaders)!=null&&t.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,e):await fetch(i,e)}return await iD(r)}const x0=globalThis,cd=globalThis.process||{};function dz(r){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function sw(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||dz()}const sD="4.0.7";function Az(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let pz=class{constructor(e,t,n="sessionStorage"){this.storage=Az(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function gz(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function mz(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var Wm;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Wm||(Wm={}));const _z=10;function TB(r){return typeof r!="string"?r:(r=r.toUpperCase(),Wm[r]||Wm.WHITE)}function yz(r,e,t){return!sw&&typeof r=="string"&&(e&&(r=`\x1B[${TB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${TB(t)+_z}m${r}\x1B[49m`)),r}function vz(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const o of n){const s=i[o];typeof s=="function"&&(e.find(c=>o===c)||(i[o]=s.bind(r)))}}function ow(r,e){if(!r)throw new Error("Assertion failed")}function ld(){var e,t,n;let r;if(sw()&&x0.performance)r=(t=(e=x0==null?void 0:x0.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in cd){const i=(n=cd==null?void 0:cd.hrtime)==null?void 0:n.call(cd);r=i[0]*1e3+i[1]/1e6}else r=Date.now();return r}const ud={debug:sw()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},bz={enabled:!0,level:0};function fd(){}const BB={},SB={once:!0};let aw=class{constructor({id:e}={id:""}){this.VERSION=sD,this._startTs=ld(),this._deltaTs=ld(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new pz(`__probe-${this.id}__`,bz),this.timeStamp(`${this.id} started`),vz(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ld()-this._startTs).toPrecision(10))}getDelta(){return Number((ld()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,ud.warn,arguments,SB)}error(e){return this._getLogFunction(0,e,ud.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,ud.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,ud.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,ud.debug||ud.info,arguments,SB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||fd,n&&[n],{tag:wz(t)}):fd}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||fd)}group(e,t,n={collapsed:!1}){const i=IB({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||fd)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=oD(e)}_getLogFunction(e,t,n,i,o){if(this._shouldLog(e)){o=IB({logLevel:e,message:t,args:i,opts:o}),n=n||o.method,ow(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=ld();const s=o.tag||o.message;if(o.once&&s)if(!BB[s])BB[s]=ld();else return fd;return t=xz(this.id,o.message,o),n.bind(console,t,...o.args)}return fd}};aw.VERSION=sD;function oD(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return ow(Number.isFinite(e)&&e>=0),e}function IB(r){const{logLevel:e,message:t}=r;r.logLevel=oD(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return ow(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function xz(r,e,t){if(typeof e=="string"){const n=t.time?mz(gz(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=yz(e,t.color,t.background)}return e}function wz(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}const MB=new aw({id:"loaders.gl"});let Cz=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Ez=class{constructor(){V(this,"console");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)}};const aD={fetch:null,mimeType:void 0,nothrow:!1,log:new Ez,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:tw,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Tz={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 cD(){globalThis.loaders=globalThis.loaders||{};const{loaders:r}=globalThis;return r._state||(r._state={}),r._state}function lD(){const r=cD();return r.globalOptions=r.globalOptions||{...aD},r.globalOptions}function Bz(r,e,t,n){return t=t||[],t=Array.isArray(t)?t:[t],Sz(r,t),Mz(e,r,n)}function Sz(r,e){PB(r,null,aD,Tz,e);for(const t of e){const n=r&&r[t.id]||{},i=t.options&&t.options[t.id]||{},o=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};PB(n,t.id,i,o,e)}}function PB(r,e,t,n,i){const o=e||"Top level",s=e?`${e}.`:"";for(const c in r){const f=!e&&bg(r[c]),y=c==="baseUri"&&!e,b=c==="workerUrl"&&e;if(!(c in t)&&!y&&!b){if(c in n)MB.warn(`${o} loader option '${s}${c}' no longer supported, use '${n[c]}'`)();else if(!f){const T=Iz(c,i);MB.warn(`${o} loader option '${s}${c}' not recognized. ${T}`)()}}}}function Iz(r,e){const t=r.toLowerCase();let n="";for(const i of e)for(const o in i.options){if(r===o)return`Did you mean '${i.id}.${o}'?`;const s=o.toLowerCase();(t.startsWith(s)||s.startsWith(t))&&(n=n||`Did you mean '${i.id}.${o}'?`)}return n}function Mz(r,e,t){const i={...r.options||{}};return Pz(i,t),i.log===null&&(i.log=new Cz),RB(i,lD()),RB(i,e),i}function RB(r,e){for(const t in e)if(t in e){const n=e[t];xB(n)&&xB(r[t])?r[t]={...r[t],...e[t]}:r[t]=e[t]}}function Pz(r,e){e&&!("baseUri"in r)&&(r.baseUri=e)}function cw(r){return r?(Array.isArray(r)&&(r=r[0]),Array.isArray(r==null?void 0:r.extensions)):!1}function lw(r){jm(r,"null loader"),jm(cw(r),"invalid loader");let e;return Array.isArray(r)&&(e=r[1],r=r[0],r={...r,options:{...r.options,...e}}),(r!=null&&r.parseTextSync||r!=null&&r.parseText)&&(r.text=!0),r.text||(r.binary=!0),r}const uD=()=>{const r=cD();return r.loaderRegistry=r.loaderRegistry||[],r.loaderRegistry};function Rz(r){const e=uD();r=Array.isArray(r)?r:[r];for(const t of r){const n=lw(t);e.find(i=>n===i)||e.unshift(n)}}function Fz(){return uD()}const Oz=new aw({id:"loaders.gl"}),Dz=/\.([^.]+)$/;async function Lz(r,e=[],t,n){if(!fD(r))return null;let i=FB(r,e,{...t,nothrow:!0},n);if(i)return i;if(ah(r)&&(r=await r.slice(0,10).arrayBuffer(),i=FB(r,e,t,n)),!i&&!(t!=null&&t.nothrow))throw new Error(hD(r));return i}function FB(r,e=[],t,n){if(!fD(r))return null;if(e&&!Array.isArray(e))return lw(e);let i=[];e&&(i=i.concat(e)),t!=null&&t.ignoreRegisteredLoaders||i.push(...Fz()),kz(i);const o=Nz(r,i,t,n);if(!o&&!(t!=null&&t.nothrow))throw new Error(hD(r));return o}function Nz(r,e,t,n){const i=oy(r),o=iw(r),s=nw(i)||(n==null?void 0:n.url);let c=null,f="";return t!=null&&t.mimeType&&(c=Vv(e,t==null?void 0:t.mimeType),f=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),c=c||Uz(e,s),f=f||(c?`matched url ${s}`:""),c=c||Vv(e,o),f=f||(c?`matched MIME type ${o}`:""),c=c||Gz(e,r),f=f||(c?`matched initial data ${dD(r)}`:""),t!=null&&t.fallbackMimeType&&(c=c||Vv(e,t==null?void 0:t.fallbackMimeType),f=f||(c?`matched fallback MIME type ${o}`:"")),f&&Oz.log(1,`selectLoader selected ${c==null?void 0:c.name}: ${f}.`),c}function fD(r){return!(r instanceof Response&&r.status===204)}function hD(r){const e=oy(r),t=iw(r);let n="No valid loader found (";n+=e?`${tD(e)}, `:"no url provided, ",n+=`MIME type: ${t?`"${t}"`:"not provided"}, `;const i=r?dD(r):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function kz(r){for(const e of r)lw(e)}function Uz(r,e){const t=e&&Dz.exec(e),n=t&&t[1];return n?zz(r,n):null}function zz(r,e){e=e.toLowerCase();for(const t of r)for(const n of t.extensions)if(n.toLowerCase()===e)return t;return null}function Vv(r,e){var t;for(const n of r)if((t=n.mimeTypes)!=null&&t.some(i=>wB(e,i))||wB(e,`application/x.${n.id}`))return n;return null}function Gz(r,e){if(!e)return null;for(const t of r)if(typeof e=="string"){if(Vz(e,t))return t}else if(ArrayBuffer.isView(e)){if(OB(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&OB(e,0,t))return t;return null}function Vz(r,e){return e.testText?e.testText(r):(Array.isArray(e.tests)?e.tests:[e.tests]).some(n=>r.startsWith(n))}function OB(r,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>Hz(r,e,t,i))}function Hz(r,e,t,n){if(n instanceof ArrayBuffer)return U5(n,r,n.byteLength);switch(typeof n){case"function":return n(r);case"string":const i=n2(r,e,n.length);return n===i;default:return!1}}function dD(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?n2(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?n2(r,0,e):""}function n2(r,e,t){if(r.byteLength<e+t)return"";const n=new DataView(r);let i="";for(let o=0;o<t;o++)i+=String.fromCharCode(n.getUint8(e+o));return i}const jz=256*1024;function*$z(r,e){const t=(e==null?void 0:e.chunkSize)||jz;let n=0;const i=new TextEncoder;for(;n<r.length;){const o=Math.min(r.length-n,t),s=r.slice(n,n+o);n+=o,yield i.encode(s)}}const Wz=256*1024;function*Jz(r,e={}){const{chunkSize:t=Wz}=e;let n=0;for(;n<r.byteLength;){const i=Math.min(r.byteLength-n,t),o=new ArrayBuffer(i),s=new Uint8Array(r,n,i);new Uint8Array(o).set(s),n+=i,yield o}}const Xz=1024*1024;async function*Kz(r,e){const t=(e==null?void 0:e.chunkSize)||Xz;let n=0;for(;n<r.size;){const i=n+t,o=await r.slice(n,i).arrayBuffer();n=i,yield o}}function DB(r,e){return tw?Yz(r,e):qz(r)}async function*Yz(r,e){const t=r.getReader();let n;try{for(;;){const i=n||t.read();e!=null&&e._streamReadAhead&&(n=t.read());const{done:o,value:s}=await i;if(o)return;yield eD(s)}}catch{t.releaseLock()}}async function*qz(r,e){for await(const t of r)yield eD(t)}function Zz(r,e){if(typeof r=="string")return $z(r,e);if(r instanceof ArrayBuffer)return Jz(r,e);if(ah(r))return Kz(r,e);if(rD(r))return DB(r,e);if(oh(r))return DB(r.body,e);throw new Error("makeIterator")}const AD="Cannot convert supplied data type";function Qz(r,e,t){if(e.text&&typeof r=="string")return r;if(Y5(r)&&(r=r.buffer),r instanceof ArrayBuffer){const n=r;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(r)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(r);let n=r.buffer;const i=r.byteLength||r.length;return(r.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(r.byteOffset,r.byteOffset+i)),n}throw new Error(AD)}async function eG(r,e,t){const n=r instanceof ArrayBuffer||ArrayBuffer.isView(r);if(typeof r=="string"||n)return Qz(r,e);if(ah(r)&&(r=await iD(r)),oh(r)){const i=r;return await oz(i),e.binary?await i.arrayBuffer():await i.text()}if(rD(r)&&(r=Zz(r,t)),X5(r)||K5(r))return V5(r);throw new Error(AD)}function pD(r,e){const t=lD(),n=r||t;return typeof n.fetch=="function"?n.fetch:bg(n.fetch)?i=>EB(i,n.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:EB}function tG(r,e,t){if(t)return t;const n={fetch:pD(e,r),...r};if(n.url){const i=nw(n.url);n.baseUrl=i,n.queryString=nz(n.url),n.filename=tD(i),n.baseUrl=W5(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function rG(r,e){if(r&&!Array.isArray(r))return r;let t;if(r&&(t=Array.isArray(r)?r:[r]),e&&e.loaders){const n=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...n]:n}return t&&t.length?t:void 0}async function Jm(r,e,t,n){e&&!Array.isArray(e)&&!cw(e)&&(n=void 0,t=e,e=void 0),r=await r,t=t||{};const i=oy(r),s=rG(e,n),c=await Lz(r,s,t);return c?(t=Bz(t,c,s,i),n=tG({url:i,_parse:Jm,loaders:s},t,n||null),await nG(c,r,t,n)):null}async function nG(r,e,t,n){if(D5(r),t=w5(r.options,t),oh(e)){const o=e,{ok:s,redirected:c,status:f,statusText:y,type:b,url:T}=o,S=Object.fromEntries(o.headers.entries());n.response={headers:S,ok:s,redirected:c,status:f,statusText:y,type:b,url:T}}e=await eG(e,r,t);const i=r;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,t,n);if(L5(r,t))return await N5(r,e,t,n,Jm);if(i.parseText&&typeof e=="string")return await i.parseText(e,t,n);if(i.parse)return await i.parse(e,t,n);throw zu(!i.parseSync),new Error(`${r.id} loader - no parser found and worker is disabled`)}async function i2(r,e,t,n){let i,o;!Array.isArray(e)&&!cw(e)?(i=[],o=e):(i=e,o=t);const s=pD(o);let c=r;return typeof r=="string"&&(c=await s(r)),ah(r)&&(c=await s(r)),Array.isArray(i)?await Jm(c,i,o):await Jm(c,i,o)}const iG="4.2.4";var UO;const sG=(UO=globalThis.loaders)==null?void 0:UO.parseImageNode,s2=typeof Image<"u",o2=typeof ImageBitmap<"u",oG=!!sG,a2=tw?!0:oG;function aG(r){switch(r){case"auto":return o2||s2||a2;case"imagebitmap":return o2;case"image":return s2;case"data":return a2;default:throw new Error(`@loaders.gl/images: image ${r} not supported in this environment`)}}function cG(){if(o2)return"imagebitmap";if(s2)return"image";if(a2)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function lG(r){const e=fG(r);if(!e)throw new Error("Not an image");return e}function uG(r){switch(lG(r)){case"data":return r;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height);default:throw new Error("getImageData")}}function fG(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}const hG=/^data:image\/svg\+xml/,dG=/\.svg((\?|#).*)?$/;function uw(r){return r&&(hG.test(r)||dG.test(r))}function AG(r,e){if(uw(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return gD(r,e)}function gD(r,e){if(uw(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}async function mD(r,e,t){const n=AG(r,t),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await pG(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function pG(r,e){const t=new Image;return t.src=r,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((n,i)=>{try{t.onload=()=>n(t),t.onerror=o=>{const s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}const gG={};let LB=!0;async function mG(r,e,t){let n;uw(t)?n=await mD(r,e,t):n=gD(r,t);const i=e&&e.imagebitmap;return await _G(n,i)}async function _G(r,e=null){if((yG(e)||!LB)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),LB=!1}return await createImageBitmap(r)}function yG(r){for(const e in r||gG)return!1;return!0}function vG(r){return!CG(r,"ftyp",4)||(r[8]&96)===0?null:bG(r)}function bG(r){switch(xG(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function xG(r,e,t){return String.fromCharCode(...r.slice(e,t))}function wG(r){return[...r].map(e=>e.charCodeAt(0))}function CG(r,e,t=0){const n=wG(e);for(let i=0;i<n.length;++i)if(n[i]!==r[i+t])return!1;return!0}const Xc=!1,zp=!0;function _D(r){const e=xg(r);return TG(e)||IG(e)||BG(e)||SG(e)||EG(e)}function EG(r){const e=new Uint8Array(r instanceof DataView?r.buffer:r),t=vG(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function TG(r){const e=xg(r);return e.byteLength>=24&&e.getUint32(0,Xc)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Xc),height:e.getUint32(20,Xc)}:null}function BG(r){const e=xg(r);return e.byteLength>=10&&e.getUint32(0,Xc)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,zp),height:e.getUint16(8,zp)}:null}function SG(r){const e=xg(r);return e.byteLength>=14&&e.getUint16(0,Xc)===16973&&e.getUint32(2,zp)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,zp),height:e.getUint32(22,zp)}:null}function IG(r){const e=xg(r);if(!(e.byteLength>=3&&e.getUint16(0,Xc)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:n,sofMarkers:i}=MG();let o=2;for(;o+9<e.byteLength;){const s=e.getUint16(o,Xc);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Xc),width:e.getUint16(o+7,Xc)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,Xc)}return null}function MG(){const r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function xg(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}async function PG(r,e){var i;const{mimeType:t}=_D(r)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return jm(n),await n(r,t)}async function RG(r,e,t){e=e||{};const i=(e.image||{}).type||"auto",{url:o}=t||{},s=FG(i);let c;switch(s){case"imagebitmap":c=await mG(r,e,o);break;case"image":c=await mD(r,e,o);break;case"data":c=await PG(r);break;default:jm(!1)}return i==="data"&&(c=uG(c)),c}function FG(r){switch(r){case"auto":case"data":return cG();default:return aG(r),r}}const OG=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],DG=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],LG={image:{type:"auto",decode:!0}},NG={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:iG,mimeTypes:DG,extensions:OG,parse:RG,tests:[r=>!!_D(new DataView(r))],options:LG},Jr=new XO({id:"deck"});let c2={};function kG(r){c2=r}function oo(r,e,t,n){Jr.level>0&&c2[r]&&c2[r].call(null,e,t,n)}function UG(r){const e=r[0],t=r[r.length-1];return e==="{"&&t==="}"||e==="["&&t==="]"}const zG={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:UG,parseTextSync:JSON.parse};function GG(){const r="9.1.7",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==r)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${r}`);return e||(Jr.log(1,`deck.gl ${r}`)(),globalThis.deck={...globalThis.deck,VERSION:r,version:r,log:Jr,_registerLoggers:kG},Rz([zG,[NG,{imagebitmap:{premultiplyAlpha:"none"}}]])),r}const VG=GG();function fw(r,e){if(!r)throw new Error(e||"shadertools: assertion failed.")}const Hv={number:{type:"number",validate(r,e){return Number.isFinite(r)&&typeof e=="object"&&(e.max===void 0||r<=e.max)&&(e.min===void 0||r>=e.min)}},array:{type:"array",validate(r,e){return Array.isArray(r)||ArrayBuffer.isView(r)}}};function HG(r){const e={};for(const[t,n]of Object.entries(r))e[t]=jG(n);return e}function jG(r){let e=NB(r);if(e!=="object")return{value:r,...Hv[e],type:e};if(typeof r=="object")return r?r.type!==void 0?{...r,...Hv[r.type],type:r.type}:r.value===void 0?{type:"object",value:r}:(e=NB(r.value),{...r,...Hv[e],type:e}):{type:"object",value:null};throw new Error("props")}function NB(r){return Array.isArray(r)||ArrayBuffer.isView(r)?"array":typeof r}const $G=`#ifdef MODULE_LOGDEPTH
6
+ }`}function ZO(r,e=!0,t){const n=t||new Set;if(r){if(vB(r))n.add(r);else if(vB(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(const i in r)ZO(r[i],e,n)}}return t===void 0?Array.from(n):[]}function vB(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}const Gv=()=>{};let r2=class{constructor(e){V(this,"name");V(this,"source");V(this,"url");V(this,"terminated",!1);V(this,"worker");V(this,"onMessage");V(this,"onError");V(this,"_loadableURL","");const{name:t,source:n,url:i}=e;zu(n||i),this.name=t,this.source=n,this.url=i,this.onMessage=Gv,this.onError=o=>console.log(o),this.worker=Wf?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&Wf||typeof Uv<"u"&&!Wf}destroy(){this.onMessage=Gv,this.onError=Gv,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||ZO(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=I5({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},e.onmessageerror=t=>console.error(t),e}_createNodeWorker(){let e;if(this.url){const n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new Uv(n,{eval:!1})}else if(this.source)e=new Uv(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{this.onMessage(t)}),e.on("error",t=>{this.onError(t)}),e.on("exit",t=>{}),e}},R5=class{constructor(e){V(this,"name","unnamed");V(this,"source");V(this,"url");V(this,"maxConcurrency",1);V(this,"maxMobileConcurrency",1);V(this,"onDebug",()=>{});V(this,"reuseWorkers",!0);V(this,"props",{});V(this,"jobQueue",[]);V(this,"idleQueue",[]);V(this,"count",0);V(this,"isDestroyed",!1);this.source=e.source,this.url=e.url,this.setProps(e)}static isSupported(){return r2.isSupported()}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,t=(i,o,s)=>i.done(s),n=(i,o)=>i.error(o)){const i=new Promise(o=>(this.jobQueue.push({name:e,onMessage:t,onError:n,onStart:o}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:e,backlog:this.jobQueue.length});const n=new S5(t.name,e);e.onMessage=i=>t.onMessage(n,i.type,i.payload),e.onError=i=>t.onError(n,i),t.onStart(n);try{await n.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Wf||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new r2({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return B5?this.maxMobileConcurrency:this.maxConcurrency}};const F5={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};var ac;let QO=(ac=class{constructor(e){V(this,"props");V(this,"workerPools",new Map);this.props={...F5},this.setProps(e),this.workerPools=new Map}static isSupported(){return r2.isSupported()}static getWorkerFarm(e={}){return ac._workerFarm=ac._workerFarm||new ac({}),ac._workerFarm.setProps(e),ac._workerFarm}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:t,source:n,url:i}=e;let o=this.workerPools.get(t);return o||(o=new R5({name:t,source:n,url:i}),o.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,o)),o}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},V(ac,"_workerFarm"),ac);function O5(r,e={}){const t=e[r.id]||{},n=Wf?`${r.id}-worker.js`:`${r.id}-worker-node.js`;let i=t.workerUrl;if(!i&&r.id==="compression"&&(i=e.workerUrl),e._workerType==="test"&&(Wf?i=`modules/${r.module}/dist/${n}`:i=`modules/${r.module}/src/workers/${r.id}-worker-node.ts`),!i){let o=r.version;o==="latest"&&(o=C5);const s=o?`@${o}`:"";i=`https://unpkg.com/@loaders.gl/${r.module}${s}/dist/${n}`}return zu(i),i}function D5(r,e=T5){zu(r,"no worker provided");const t=r.version;return!(!e||!t)}function L5(r,e){return!QO.isSupported()||!Wf&&!(e!=null&&e._nodeWorkers)?!1:r.worker&&(e==null?void 0:e.worker)}async function N5(r,e,t,n,i){const o=r.id,s=O5(r,t),f=QO.getWorkerFarm(t).getWorkerPool({name:o,url:s});t=JSON.parse(JSON.stringify(t)),n=JSON.parse(JSON.stringify(n||{}));const y=await f.startJob("process-on-worker",k5.bind(null,i));return y.postMessage("process",{input:e,options:t,context:n}),await(await y.result).result}async function k5(r,e,t,n){switch(t){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":const{id:i,input:o,options:s}=n;try{const c=await r(o,s);e.postMessage("done",{id:i,result:c})}catch(c){const f=c instanceof Error?c.message:"unknown error";e.postMessage("error",{id:i,error:f})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function U5(r,e,t){if(t=t||r.byteLength,r.byteLength<t||e.byteLength<t)return!1;const n=new Uint8Array(r),i=new Uint8Array(e);for(let o=0;o<n.length;++o)if(n[o]!==i[o])return!1;return!0}function z5(...r){return G5(r)}function G5(r){const e=r.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),t=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(t);let i=0;for(const o of e)n.set(o,i),i+=o.byteLength;return n.buffer}async function V5(r){const e=[];for await(const t of r)e.push(t);return z5(...e)}let H5="";const bB={};function j5(r){for(const e in bB)if(r.startsWith(e)){const t=bB[e];r=r.replace(e,t)}return!r.startsWith("http://")&&!r.startsWith("https://")&&(r=`${H5}${r}`),r}function $5(r){return r&&typeof r=="object"&&r.isBuffer}function eD(r){if($5(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){const e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function tD(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(e+1):""}function W5(r){const e=r?r.lastIndexOf("/"):-1;return e>=0?r.substr(0,e):""}const J5=r=>typeof r=="boolean",Up=r=>typeof r=="function",bg=r=>r!==null&&typeof r=="object",xB=r=>bg(r)&&r.constructor==={}.constructor,X5=r=>!!r&&typeof r[Symbol.iterator]=="function",K5=r=>r&&typeof r[Symbol.asyncIterator]=="function",oh=r=>typeof Response<"u"&&r instanceof Response||r&&r.arrayBuffer&&r.text&&r.json,ah=r=>typeof Blob<"u"&&r instanceof Blob,Y5=r=>r&&typeof r=="object"&&r.isBuffer,q5=r=>typeof ReadableStream<"u"&&r instanceof ReadableStream||bg(r)&&Up(r.tee)&&Up(r.cancel)&&Up(r.getReader),Z5=r=>bg(r)&&Up(r.read)&&Up(r.pipe)&&J5(r.readable),rD=r=>q5(r)||Z5(r);let Q5=class extends Error{constructor(t,n){super(t);V(this,"reason");V(this,"url");V(this,"response");this.reason=n.reason,this.url=n.url,this.response=n.response}};const ez=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tz=/^([-\w.]+\/[-\w.+]+)/;function wB(r,e){return r.toLowerCase()===e.toLowerCase()}function rz(r){const e=tz.exec(r);return e?e[1]:r}function CB(r){const e=ez.exec(r);return e?e[1]:""}const nD=/\?.*/;function nz(r){const e=r.match(nD);return e&&e[0]}function nw(r){return r.replace(nD,"")}function iz(r){if(r.length<50)return r;const e=r.slice(r.length-15);return`${r.substr(0,32)}...${e}`}function oy(r){return oh(r)?r.url:ah(r)?r.name||"":typeof r=="string"?r:""}function iw(r){if(oh(r)){const e=r,t=e.headers.get("content-type")||"",n=nw(e.url);return rz(t)||CB(n)}return ah(r)?r.type||"":typeof r=="string"?CB(r):""}function sz(r){return oh(r)?r.headers["content-length"]||-1:ah(r)?r.size:typeof r=="string"?r.length:r instanceof ArrayBuffer||ArrayBuffer.isView(r)?r.byteLength:-1}async function iD(r){if(oh(r))return r;const e={},t=sz(r);t>=0&&(e["content-length"]=String(t));const n=oy(r),i=iw(r);i&&(e["content-type"]=i);const o=await cz(r);o&&(e["x-first-bytes"]=o),typeof r=="string"&&(r=new TextEncoder().encode(r));const s=new Response(r,{headers:e});return Object.defineProperty(s,"url",{value:n}),s}async function oz(r){if(!r.ok)throw await az(r)}async function az(r){const e=iz(r.url);let t=`Failed to fetch resource (${r.status}) ${r.statusText}: ${e}`;t=t.length>100?`${t.slice(0,100)}...`:t;const n={reason:r.statusText,url:r.url,response:r};try{const i=r.headers.get("Content-Type");n.reason=i!=null&&i.includes("application/json")?await r.json():r.text()}catch{}return new Q5(t,n)}async function cz(r){if(typeof r=="string")return`data:,${r.slice(0,5)}`;if(r instanceof Blob){const t=r.slice(0,5);return await new Promise(n=>{const i=new FileReader;i.onload=o=>{var s;return n((s=o==null?void 0:o.target)==null?void 0:s.result)},i.readAsDataURL(t)})}if(r instanceof ArrayBuffer){const t=r.slice(0,5);return`data:base64,${lz(t)}`}return null}function lz(r){let e="";const t=new Uint8Array(r);for(let n=0;n<t.byteLength;n++)e+=String.fromCharCode(t[n]);return btoa(e)}function uz(r){return!fz(r)&&!hz(r)}function fz(r){return r.startsWith("http:")||r.startsWith("https:")}function hz(r){return r.startsWith("data:")}async function EB(r,e){var t,n;if(typeof r=="string"){const i=j5(r);return uz(i)&&(t=globalThis.loaders)!=null&&t.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,e):await fetch(i,e)}return await iD(r)}const x0=globalThis,cd=globalThis.process||{};function dz(r){var n,i;if(typeof window<"u"&&((n=window.process)==null?void 0:n.type)==="renderer"||typeof process<"u"&&((i=process.versions)!=null&&i.electron))return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function sw(){return!(typeof process=="object"&&String(process)==="[object process]"&&!(process!=null&&process.browser))||dz()}const sD="4.0.7";function Az(r){try{const e=window[r],t="__storage_test__";return e.setItem(t,t),e.removeItem(t),e}catch{return null}}let pz=class{constructor(e,t,n="sessionStorage"){this.storage=Az(n),this.id=e,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let e={};if(this.storage){const t=this.storage.getItem(this.id);e=t?JSON.parse(t):{}}return Object.assign(this.config,e),this}};function gz(r){let e;return r<10?e=`${r.toFixed(2)}ms`:r<100?e=`${r.toFixed(1)}ms`:r<1e3?e=`${r.toFixed(0)}ms`:e=`${(r/1e3).toFixed(2)}s`,e}function mz(r,e=8){const t=Math.max(e-r.length,0);return`${" ".repeat(t)}${r}`}var Wm;(function(r){r[r.BLACK=30]="BLACK",r[r.RED=31]="RED",r[r.GREEN=32]="GREEN",r[r.YELLOW=33]="YELLOW",r[r.BLUE=34]="BLUE",r[r.MAGENTA=35]="MAGENTA",r[r.CYAN=36]="CYAN",r[r.WHITE=37]="WHITE",r[r.BRIGHT_BLACK=90]="BRIGHT_BLACK",r[r.BRIGHT_RED=91]="BRIGHT_RED",r[r.BRIGHT_GREEN=92]="BRIGHT_GREEN",r[r.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",r[r.BRIGHT_BLUE=94]="BRIGHT_BLUE",r[r.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",r[r.BRIGHT_CYAN=96]="BRIGHT_CYAN",r[r.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Wm||(Wm={}));const _z=10;function TB(r){return typeof r!="string"?r:(r=r.toUpperCase(),Wm[r]||Wm.WHITE)}function yz(r,e,t){return!sw&&typeof r=="string"&&(e&&(r=`\x1B[${TB(e)}m${r}\x1B[39m`),t&&(r=`\x1B[${TB(t)+_z}m${r}\x1B[49m`)),r}function vz(r,e=["constructor"]){const t=Object.getPrototypeOf(r),n=Object.getOwnPropertyNames(t),i=r;for(const o of n){const s=i[o];typeof s=="function"&&(e.find(c=>o===c)||(i[o]=s.bind(r)))}}function ow(r,e){if(!r)throw new Error("Assertion failed")}function ld(){var e,t,n;let r;if(sw()&&x0.performance)r=(t=(e=x0==null?void 0:x0.performance)==null?void 0:e.now)==null?void 0:t.call(e);else if("hrtime"in cd){const i=(n=cd==null?void 0:cd.hrtime)==null?void 0:n.call(cd);r=i[0]*1e3+i[1]/1e6}else r=Date.now();return r}const ud={debug:sw()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},bz={enabled:!0,level:0};function fd(){}const BB={},SB={once:!0};let aw=class{constructor({id:e}={id:""}){this.VERSION=sD,this._startTs=ld(),this._deltaTs=ld(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new pz(`__probe-${this.id}__`,bz),this.timeStamp(`${this.id} started`),vz(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((ld()-this._startTs).toPrecision(10))}getDelta(){return Number((ld()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(e=!0){return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,t){this._storage.setConfiguration({[e]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,t){if(!e)throw new Error(t||"Assertion failed")}warn(e){return this._getLogFunction(0,e,ud.warn,arguments,SB)}error(e){return this._getLogFunction(0,e,ud.error,arguments)}deprecated(e,t){return this.warn(`\`${e}\` is deprecated and will be removed in a later version. Use \`${t}\` instead`)}removed(e,t){return this.error(`\`${e}\` has been removed. Use \`${t}\` instead`)}probe(e,t){return this._getLogFunction(e,t,ud.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,ud.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,ud.debug||ud.info,arguments,SB)}table(e,t,n){return t?this._getLogFunction(e,t,console.table||fd,n&&[n],{tag:wz(t)}):fd}time(e,t){return this._getLogFunction(e,t,console.time?console.time:console.info)}timeEnd(e,t){return this._getLogFunction(e,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,t){return this._getLogFunction(e,t,console.timeStamp||fd)}group(e,t,n={collapsed:!1}){const i=IB({logLevel:e,message:t,opts:n}),{collapsed:o}=n;return i.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(e,t,n={}){return this.group(e,t,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||fd)}withGroup(e,t,n){this.group(e,t)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=oD(e)}_getLogFunction(e,t,n,i,o){if(this._shouldLog(e)){o=IB({logLevel:e,message:t,args:i,opts:o}),n=n||o.method,ow(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=ld();const s=o.tag||o.message;if(o.once&&s)if(!BB[s])BB[s]=ld();else return fd;return t=xz(this.id,o.message,o),n.bind(console,t,...o.args)}return fd}};aw.VERSION=sD;function oD(r){if(!r)return 0;let e;switch(typeof r){case"number":e=r;break;case"object":e=r.logLevel||r.priority||0;break;default:return 0}return ow(Number.isFinite(e)&&e>=0),e}function IB(r){const{logLevel:e,message:t}=r;r.logLevel=oD(e);const n=r.args?Array.from(r.args):[];for(;n.length&&n.shift()!==t;);switch(typeof e){case"string":case"function":t!==void 0&&n.unshift(t),r.message=e;break;case"object":Object.assign(r,e);break}typeof r.message=="function"&&(r.message=r.message());const i=typeof r.message;return ow(i==="string"||i==="object"),Object.assign(r,{args:n},r.opts)}function xz(r,e,t){if(typeof e=="string"){const n=t.time?mz(gz(t.total)):"";e=t.time?`${r}: ${n} ${e}`:`${r}: ${e}`,e=yz(e,t.color,t.background)}return e}function wz(r){for(const e in r)for(const t in r[e])return t||"untitled";return"empty"}const MB=new aw({id:"loaders.gl"});let Cz=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Ez=class{constructor(){V(this,"console");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)}};const aD={fetch:null,mimeType:void 0,nothrow:!1,log:new Ez,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:tw,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Tz={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 cD(){globalThis.loaders=globalThis.loaders||{};const{loaders:r}=globalThis;return r._state||(r._state={}),r._state}function lD(){const r=cD();return r.globalOptions=r.globalOptions||{...aD},r.globalOptions}function Bz(r,e,t,n){return t=t||[],t=Array.isArray(t)?t:[t],Sz(r,t),Mz(e,r,n)}function Sz(r,e){PB(r,null,aD,Tz,e);for(const t of e){const n=r&&r[t.id]||{},i=t.options&&t.options[t.id]||{},o=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};PB(n,t.id,i,o,e)}}function PB(r,e,t,n,i){const o=e||"Top level",s=e?`${e}.`:"";for(const c in r){const f=!e&&bg(r[c]),y=c==="baseUri"&&!e,b=c==="workerUrl"&&e;if(!(c in t)&&!y&&!b){if(c in n)MB.warn(`${o} loader option '${s}${c}' no longer supported, use '${n[c]}'`)();else if(!f){const T=Iz(c,i);MB.warn(`${o} loader option '${s}${c}' not recognized. ${T}`)()}}}}function Iz(r,e){const t=r.toLowerCase();let n="";for(const i of e)for(const o in i.options){if(r===o)return`Did you mean '${i.id}.${o}'?`;const s=o.toLowerCase();(t.startsWith(s)||s.startsWith(t))&&(n=n||`Did you mean '${i.id}.${o}'?`)}return n}function Mz(r,e,t){const i={...r.options||{}};return Pz(i,t),i.log===null&&(i.log=new Cz),RB(i,lD()),RB(i,e),i}function RB(r,e){for(const t in e)if(t in e){const n=e[t];xB(n)&&xB(r[t])?r[t]={...r[t],...e[t]}:r[t]=e[t]}}function Pz(r,e){e&&!("baseUri"in r)&&(r.baseUri=e)}function cw(r){return r?(Array.isArray(r)&&(r=r[0]),Array.isArray(r==null?void 0:r.extensions)):!1}function lw(r){jm(r,"null loader"),jm(cw(r),"invalid loader");let e;return Array.isArray(r)&&(e=r[1],r=r[0],r={...r,options:{...r.options,...e}}),(r!=null&&r.parseTextSync||r!=null&&r.parseText)&&(r.text=!0),r.text||(r.binary=!0),r}const uD=()=>{const r=cD();return r.loaderRegistry=r.loaderRegistry||[],r.loaderRegistry};function Rz(r){const e=uD();r=Array.isArray(r)?r:[r];for(const t of r){const n=lw(t);e.find(i=>n===i)||e.unshift(n)}}function Fz(){return uD()}const Oz=new aw({id:"loaders.gl"}),Dz=/\.([^.]+)$/;async function Lz(r,e=[],t,n){if(!fD(r))return null;let i=FB(r,e,{...t,nothrow:!0},n);if(i)return i;if(ah(r)&&(r=await r.slice(0,10).arrayBuffer(),i=FB(r,e,t,n)),!i&&!(t!=null&&t.nothrow))throw new Error(hD(r));return i}function FB(r,e=[],t,n){if(!fD(r))return null;if(e&&!Array.isArray(e))return lw(e);let i=[];e&&(i=i.concat(e)),t!=null&&t.ignoreRegisteredLoaders||i.push(...Fz()),kz(i);const o=Nz(r,i,t,n);if(!o&&!(t!=null&&t.nothrow))throw new Error(hD(r));return o}function Nz(r,e,t,n){const i=oy(r),o=iw(r),s=nw(i)||(n==null?void 0:n.url);let c=null,f="";return t!=null&&t.mimeType&&(c=Vv(e,t==null?void 0:t.mimeType),f=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),c=c||Uz(e,s),f=f||(c?`matched url ${s}`:""),c=c||Vv(e,o),f=f||(c?`matched MIME type ${o}`:""),c=c||Gz(e,r),f=f||(c?`matched initial data ${dD(r)}`:""),t!=null&&t.fallbackMimeType&&(c=c||Vv(e,t==null?void 0:t.fallbackMimeType),f=f||(c?`matched fallback MIME type ${o}`:"")),f&&Oz.log(1,`selectLoader selected ${c==null?void 0:c.name}: ${f}.`),c}function fD(r){return!(r instanceof Response&&r.status===204)}function hD(r){const e=oy(r),t=iw(r);let n="No valid loader found (";n+=e?`${tD(e)}, `:"no url provided, ",n+=`MIME type: ${t?`"${t}"`:"not provided"}, `;const i=r?dD(r):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function kz(r){for(const e of r)lw(e)}function Uz(r,e){const t=e&&Dz.exec(e),n=t&&t[1];return n?zz(r,n):null}function zz(r,e){e=e.toLowerCase();for(const t of r)for(const n of t.extensions)if(n.toLowerCase()===e)return t;return null}function Vv(r,e){var t;for(const n of r)if((t=n.mimeTypes)!=null&&t.some(i=>wB(e,i))||wB(e,`application/x.${n.id}`))return n;return null}function Gz(r,e){if(!e)return null;for(const t of r)if(typeof e=="string"){if(Vz(e,t))return t}else if(ArrayBuffer.isView(e)){if(OB(e.buffer,e.byteOffset,t))return t}else if(e instanceof ArrayBuffer&&OB(e,0,t))return t;return null}function Vz(r,e){return e.testText?e.testText(r):(Array.isArray(e.tests)?e.tests:[e.tests]).some(n=>r.startsWith(n))}function OB(r,e,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>Hz(r,e,t,i))}function Hz(r,e,t,n){if(n instanceof ArrayBuffer)return U5(n,r,n.byteLength);switch(typeof n){case"function":return n(r);case"string":const i=n2(r,e,n.length);return n===i;default:return!1}}function dD(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?n2(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?n2(r,0,e):""}function n2(r,e,t){if(r.byteLength<e+t)return"";const n=new DataView(r);let i="";for(let o=0;o<t;o++)i+=String.fromCharCode(n.getUint8(e+o));return i}const jz=256*1024;function*$z(r,e){const t=(e==null?void 0:e.chunkSize)||jz;let n=0;const i=new TextEncoder;for(;n<r.length;){const o=Math.min(r.length-n,t),s=r.slice(n,n+o);n+=o,yield i.encode(s)}}const Wz=256*1024;function*Jz(r,e={}){const{chunkSize:t=Wz}=e;let n=0;for(;n<r.byteLength;){const i=Math.min(r.byteLength-n,t),o=new ArrayBuffer(i),s=new Uint8Array(r,n,i);new Uint8Array(o).set(s),n+=i,yield o}}const Xz=1024*1024;async function*Kz(r,e){const t=(e==null?void 0:e.chunkSize)||Xz;let n=0;for(;n<r.size;){const i=n+t,o=await r.slice(n,i).arrayBuffer();n=i,yield o}}function DB(r,e){return tw?Yz(r,e):qz(r)}async function*Yz(r,e){const t=r.getReader();let n;try{for(;;){const i=n||t.read();e!=null&&e._streamReadAhead&&(n=t.read());const{done:o,value:s}=await i;if(o)return;yield eD(s)}}catch{t.releaseLock()}}async function*qz(r,e){for await(const t of r)yield eD(t)}function Zz(r,e){if(typeof r=="string")return $z(r,e);if(r instanceof ArrayBuffer)return Jz(r,e);if(ah(r))return Kz(r,e);if(rD(r))return DB(r,e);if(oh(r))return DB(r.body,e);throw new Error("makeIterator")}const AD="Cannot convert supplied data type";function Qz(r,e,t){if(e.text&&typeof r=="string")return r;if(Y5(r)&&(r=r.buffer),r instanceof ArrayBuffer){const n=r;return e.text&&!e.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(r)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(r);let n=r.buffer;const i=r.byteLength||r.length;return(r.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(r.byteOffset,r.byteOffset+i)),n}throw new Error(AD)}async function eG(r,e,t){const n=r instanceof ArrayBuffer||ArrayBuffer.isView(r);if(typeof r=="string"||n)return Qz(r,e);if(ah(r)&&(r=await iD(r)),oh(r)){const i=r;return await oz(i),e.binary?await i.arrayBuffer():await i.text()}if(rD(r)&&(r=Zz(r,t)),X5(r)||K5(r))return V5(r);throw new Error(AD)}function pD(r,e){const t=lD(),n=r||t;return typeof n.fetch=="function"?n.fetch:bg(n.fetch)?i=>EB(i,n.fetch):e!=null&&e.fetch?e==null?void 0:e.fetch:EB}function tG(r,e,t){if(t)return t;const n={fetch:pD(e,r),...r};if(n.url){const i=nw(n.url);n.baseUrl=i,n.queryString=nz(n.url),n.filename=tD(i),n.baseUrl=W5(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function rG(r,e){if(r&&!Array.isArray(r))return r;let t;if(r&&(t=Array.isArray(r)?r:[r]),e&&e.loaders){const n=Array.isArray(e.loaders)?e.loaders:[e.loaders];t=t?[...t,...n]:n}return t&&t.length?t:void 0}async function Jm(r,e,t,n){e&&!Array.isArray(e)&&!cw(e)&&(n=void 0,t=e,e=void 0),r=await r,t=t||{};const i=oy(r),s=rG(e,n),c=await Lz(r,s,t);return c?(t=Bz(t,c,s,i),n=tG({url:i,_parse:Jm,loaders:s},t,n||null),await nG(c,r,t,n)):null}async function nG(r,e,t,n){if(D5(r),t=w5(r.options,t),oh(e)){const o=e,{ok:s,redirected:c,status:f,statusText:y,type:b,url:T}=o,S=Object.fromEntries(o.headers.entries());n.response={headers:S,ok:s,redirected:c,status:f,statusText:y,type:b,url:T}}e=await eG(e,r,t);const i=r;if(i.parseTextSync&&typeof e=="string")return i.parseTextSync(e,t,n);if(L5(r,t))return await N5(r,e,t,n,Jm);if(i.parseText&&typeof e=="string")return await i.parseText(e,t,n);if(i.parse)return await i.parse(e,t,n);throw zu(!i.parseSync),new Error(`${r.id} loader - no parser found and worker is disabled`)}async function i2(r,e,t,n){let i,o;!Array.isArray(e)&&!cw(e)?(i=[],o=e):(i=e,o=t);const s=pD(o);let c=r;return typeof r=="string"&&(c=await s(r)),ah(r)&&(c=await s(r)),Array.isArray(i)?await Jm(c,i,o):await Jm(c,i,o)}const iG="4.2.4";var UO;const sG=(UO=globalThis.loaders)==null?void 0:UO.parseImageNode,s2=typeof Image<"u",o2=typeof ImageBitmap<"u",oG=!!sG,a2=tw?!0:oG;function aG(r){switch(r){case"auto":return o2||s2||a2;case"imagebitmap":return o2;case"image":return s2;case"data":return a2;default:throw new Error(`@loaders.gl/images: image ${r} not supported in this environment`)}}function cG(){if(o2)return"imagebitmap";if(s2)return"image";if(a2)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function lG(r){const e=fG(r);if(!e)throw new Error("Not an image");return e}function uG(r){switch(lG(r)){case"data":return r;case"image":case"imagebitmap":const e=document.createElement("canvas"),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height);default:throw new Error("getImageData")}}function fG(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}const hG=/^data:image\/svg\+xml/,dG=/\.svg((\?|#).*)?$/;function uw(r){return r&&(hG.test(r)||dG.test(r))}function AG(r,e){if(uw(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return gD(r,e)}function gD(r,e){if(uw(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}async function mD(r,e,t){const n=AG(r,t),i=self.URL||self.webkitURL,o=typeof n!="string"&&i.createObjectURL(n);try{return await pG(o||n,e)}finally{o&&i.revokeObjectURL(o)}}async function pG(r,e){const t=new Image;return t.src=r,e.image&&e.image.decode&&t.decode?(await t.decode(),t):await new Promise((n,i)=>{try{t.onload=()=>n(t),t.onerror=o=>{const s=o instanceof Error?o.message:"error";i(new Error(s))}}catch(o){i(o)}})}const gG={};let LB=!0;async function mG(r,e,t){let n;uw(t)?n=await mD(r,e,t):n=gD(r,t);const i=e&&e.imagebitmap;return await _G(n,i)}async function _G(r,e=null){if((yG(e)||!LB)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),LB=!1}return await createImageBitmap(r)}function yG(r){for(const e in r||gG)return!1;return!0}function vG(r){return!CG(r,"ftyp",4)||(r[8]&96)===0?null:bG(r)}function bG(r){switch(xG(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function xG(r,e,t){return String.fromCharCode(...r.slice(e,t))}function wG(r){return[...r].map(e=>e.charCodeAt(0))}function CG(r,e,t=0){const n=wG(e);for(let i=0;i<n.length;++i)if(n[i]!==r[i+t])return!1;return!0}const Xc=!1,zp=!0;function _D(r){const e=xg(r);return TG(e)||IG(e)||BG(e)||SG(e)||EG(e)}function EG(r){const e=new Uint8Array(r instanceof DataView?r.buffer:r),t=vG(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function TG(r){const e=xg(r);return e.byteLength>=24&&e.getUint32(0,Xc)===2303741511?{mimeType:"image/png",width:e.getUint32(16,Xc),height:e.getUint32(20,Xc)}:null}function BG(r){const e=xg(r);return e.byteLength>=10&&e.getUint32(0,Xc)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,zp),height:e.getUint16(8,zp)}:null}function SG(r){const e=xg(r);return e.byteLength>=14&&e.getUint16(0,Xc)===16973&&e.getUint32(2,zp)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,zp),height:e.getUint32(22,zp)}:null}function IG(r){const e=xg(r);if(!(e.byteLength>=3&&e.getUint16(0,Xc)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:n,sofMarkers:i}=MG();let o=2;for(;o+9<e.byteLength;){const s=e.getUint16(o,Xc);if(i.has(s))return{mimeType:"image/jpeg",height:e.getUint16(o+5,Xc),width:e.getUint16(o+7,Xc)};if(!n.has(s))return null;o+=2,o+=e.getUint16(o,Xc)}return null}function MG(){const r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function xg(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}async function PG(r,e){var i;const{mimeType:t}=_D(r)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return jm(n),await n(r,t)}async function RG(r,e,t){e=e||{};const i=(e.image||{}).type||"auto",{url:o}=t||{},s=FG(i);let c;switch(s){case"imagebitmap":c=await mG(r,e,o);break;case"image":c=await mD(r,e,o);break;case"data":c=await PG(r);break;default:jm(!1)}return i==="data"&&(c=uG(c)),c}function FG(r){switch(r){case"auto":case"data":return cG();default:return aG(r),r}}const OG=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],DG=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],LG={image:{type:"auto",decode:!0}},NG={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:iG,mimeTypes:DG,extensions:OG,parse:RG,tests:[r=>!!_D(new DataView(r))],options:LG},Jr=new XO({id:"deck"});let c2={};function kG(r){c2=r}function oo(r,e,t,n){Jr.level>0&&c2[r]&&c2[r].call(null,e,t,n)}function UG(r){const e=r[0],t=r[r.length-1];return e==="{"&&t==="}"||e==="["&&t==="]"}const zG={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:UG,parseTextSync:JSON.parse};function GG(){const r="9.1.8",e=globalThis.deck&&globalThis.deck.VERSION;if(e&&e!==r)throw new Error(`deck.gl - multiple versions detected: ${e} vs ${r}`);return e||(Jr.log(1,`deck.gl ${r}`)(),globalThis.deck={...globalThis.deck,VERSION:r,version:r,log:Jr,_registerLoggers:kG},Rz([zG,[NG,{imagebitmap:{premultiplyAlpha:"none"}}]])),r}const VG=GG();function fw(r,e){if(!r)throw new Error(e||"shadertools: assertion failed.")}const Hv={number:{type:"number",validate(r,e){return Number.isFinite(r)&&typeof e=="object"&&(e.max===void 0||r<=e.max)&&(e.min===void 0||r>=e.min)}},array:{type:"array",validate(r,e){return Array.isArray(r)||ArrayBuffer.isView(r)}}};function HG(r){const e={};for(const[t,n]of Object.entries(r))e[t]=jG(n);return e}function jG(r){let e=NB(r);if(e!=="object")return{value:r,...Hv[e],type:e};if(typeof r=="object")return r?r.type!==void 0?{...r,...Hv[r.type],type:r.type}:r.value===void 0?{type:"object",value:r}:(e=NB(r.value),{...r,...Hv[e],type:e}):{type:"object",value:null};throw new Error("props")}function NB(r){return Array.isArray(r)||ArrayBuffer.isView(r)?"array":typeof r}const $G=`#ifdef MODULE_LOGDEPTH
7
7
  logdepth_adjustPosition(gl_Position);
8
8
  #endif
9
9
  `,WG=`#ifdef MODULE_MATERIAL
@@ -1944,7 +1944,7 @@ ${PW}
1944
1944
 
1945
1945
  // use picking color if rendering to picking FBO.
1946
1946
  color = picking_filterPickingColor(color);
1947
- `}}},GW=[v6],VW=["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)"],HW=[];function jW(r){const e=Ym.getDefaultShaderAssembler();for(const n of GW)e.addDefaultModule(n);const t=r==="glsl"?VW:HW;for(const n of t)e.addShaderHook(n);return e}const $W=[255,255,255],WW=1;let JW=0;class XW{constructor(e={}){this.type="ambient";const{color:t=$W}=e,{intensity:n=WW}=e;this.id=e.id||`ambient-${JW++}`,this.color=t,this.intensity=n}}const KW=[255,255,255],YW=1,qW=[0,0,-1];let ZW=0;class HS{constructor(e={}){this.type="directional";const{color:t=KW}=e,{intensity:n=YW}=e,{direction:i=qW}=e,{_shadow:o=!1}=e;this.id=e.id||`directional-${ZW++}`,this.color=t,this.intensity=n,this.type="directional",this.direction=new ft(i).normalize().toArray(),this.shadow=o}getProjectedLight(e){return this}}class O6{constructor(e,t={id:"pass"}){const{id:n}=t;this.id=n,this.device=e,this.props={...t}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}}class fy extends O6{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){const[t,n]=this.device.canvasContext.getDrawingBufferSize(),i=e.clearCanvas??!0,o=e.clearColor??(i?[0,0,0,0]:!1),s=i?1:!1,c=i?0:!1,f=e.colorMask??15,y={viewport:[0,0,t,n]};e.colorMask&&(y.colorMask=f),e.scissorRect&&(y.scissorRect=e.scissorRect);const b=this.device.beginRenderPass({framebuffer:e.target,parameters:y,clearColor:o,clearDepth:s,clearStencil:c});try{return this._drawLayers(b,e)}finally{b.end(),this.device.submit()}}_drawLayers(e,t){const{target:n,shaderModuleProps:i,viewports:o,views:s,onViewportActive:c,clearStack:f=!0}=t;t.pass=t.pass||"unknown",f&&(this._lastRenderIndex=-1);const y=[];for(const b of o){const T=s&&s[b.id];c==null||c(b);const S=this._getDrawLayerParams(b,t),D=b.subViewports||[b];for(const k of D){const z=this._drawLayersInViewport(e,{target:n,shaderModuleProps:i,viewport:k,view:T,pass:t.pass,layers:t.layers},S);y.push(z)}}return y}_getDrawLayerParams(e,{layers:t,pass:n,isPicking:i=!1,layerFilter:o,cullRect:s,effects:c,shaderModuleProps:f},y=!1){var k;const b=[],T=D6(this._lastRenderIndex+1),S={layer:t[0],viewport:e,isPicking:i,renderPass:n,cullRect:s},D={};for(let z=0;z<t.length;z++){const J=t[z],G=this._shouldDrawLayer(J,S,o,D),j={shouldDrawLayer:G};G&&!y&&(j.shouldDrawLayer=!0,j.layerRenderIndex=T(J,G),j.shaderModuleProps=this._getShaderModuleProps(J,c,n,f),j.layerParameters={...(k=J.context.deck)==null?void 0:k.props.parameters,...this.getLayerParameters(J,z,e)}),b[z]=j}return b}_drawLayersInViewport(e,{layers:t,shaderModuleProps:n,pass:i,target:o,viewport:s,view:c},f){const y=QW(this.device,{shaderModuleProps:n,target:o,viewport:s});if(c&&c.props.clear){const T=c.props.clear===!0?{color:!0,depth:!0}:c.props.clear;this.device.beginRenderPass({framebuffer:o,parameters:{viewport:y,scissorRect:y},clearColor:T.color?[0,0,0,0]:!1,clearDepth:T.depth?1:!1}).end()}const b={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};e.setParameters({viewport:y});for(let T=0;T<t.length;T++){const S=t[T],D=f[T],{shouldDrawLayer:k}=D;if(k&&S.props.pickable&&b.pickableCount++,S.isComposite&&b.compositeCount++,S.isDrawable&&D.shouldDrawLayer){const{layerRenderIndex:z,shaderModuleProps:J,layerParameters:G}=D;b.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,z),J.project&&(J.project.viewport=s),S.context.renderPass=e;try{S._drawLayer({renderPass:e,shaderModuleProps:J,uniforms:{layerIndex:z},parameters:G})}catch(j){S.raiseError(j,`drawing ${S} to ${i}`)}}}return b}shouldDrawLayer(e){return!0}getShaderModuleProps(e,t,n){return null}getLayerParameters(e,t,n){return e.props.parameters}_shouldDrawLayer(e,t,n,i){if(!(e.props.visible&&this.shouldDrawLayer(e)))return!1;t.layer=e;let s=e.parent;for(;s;){if(!s.props.visible||!s.filterSubLayer(t))return!1;t.layer=s,s=s.parent}if(n){const c=t.layer.id;if(c in i||(i[c]=n(t)),!i[c])return!1}return e.activateViewport(t.viewport),!0}_getShaderModuleProps(e,t,n,i){var f,y;const o=this.device.canvasContext.cssToDeviceRatio(),s=((f=e.internalState)==null?void 0:f.propsInTransition)||e.props,c={layer:s,picking:{isActive:!1},project:{viewport:e.context.viewport,devicePixelRatio:o,modelMatrix:s.modelMatrix,coordinateSystem:s.coordinateSystem,coordinateOrigin:s.coordinateOrigin,autoWrapLongitude:e.wrapLongitude}};if(t)for(const b of t)jS(c,(y=b.getShaderModuleProps)==null?void 0:y.call(b,e,c));return jS(c,this.getShaderModuleProps(e,t,c),i)}}function D6(r=0,e={}){const t={},n=(i,o)=>{const s=i.props._offset,c=i.id,f=i.parent&&i.parent.id;let y;if(f&&!(f in e)&&n(i.parent,!1),f in t){const b=t[f]=t[f]||D6(e[f],e);y=b(i,o),t[c]=b}else Number.isFinite(s)?(y=s+(e[f]||0),t[c]=null):y=r;return o&&y>=r&&(r=y+1),e[c]=y,y};return n}function QW(r,{shaderModuleProps:e,target:t,viewport:n}){var f;const i=((f=e==null?void 0:e.project)==null?void 0:f.devicePixelRatio)??r.canvasContext.cssToDeviceRatio(),[,o]=r.canvasContext.getDrawingBufferSize(),s=t?t.height:o,c=n;return[c.x*i,s-(c.y+c.height)*i,c.width*i,c.height*i,0,1]}function jS(r,...e){for(const t of e)if(t)for(const n in t)r[n]?Object.assign(r[n],t[n]):r[n]=t[n];return r}class eJ extends fy{constructor(e,t){super(e,t);const n=e.createTexture({format:"rgba8unorm",width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},mipmaps:!0}),i=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1});this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[n],depthStencilAttachment:i})}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(e){const t=this.fbo,n=this.device.canvasContext.cssToDeviceRatio(),i=e.viewports[0],o=i.width*n,s=i.height*n,c=[1,1,1,1];(o!==t.width||s!==t.height)&&t.resize({width:o,height:s}),super.render({...e,clearColor:c,target:t,pass:"shadow"})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getShaderModuleProps(e,t,n){return{shadow:{project:n.project,drawToShadowMap:!0}}}}const tJ={color:[255,255,255],intensity:1},$S=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],rJ=[0,0,0,200/255];class L6{constructor(e={}){this.id="lighting-effect",this.shadowColor=rJ,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:t,deck:n}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(t),n._addDefaultShaderModule(VS),this.dummyShadowMap=t.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(const t in e){const n=e[t];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:t,viewports:n,onViewportActive:i,views:o}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let s=0;s<this.shadowPasses.length;s++)this.shadowPasses[s].render({layers:e,layerFilter:t,viewports:n,onViewportActive:i,views:o,shaderModuleProps:{shadow:{shadowLightId:s,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}}})}}getShaderModuleProps(e,t){const n=this.shadow?{project:t.project,shadowMaps:this.shadowPasses.map(s=>s.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},i={enabled:!0,ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(s=>s.getProjectedLight({layer:e})),pointLights:this.pointLights.map(s=>s.getProjectedLight({layer:e}))},o=e.props.material;return{shadow:n,lighting:i,phongMaterial:o,gouraudMaterial:o}}cleanup(e){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(VS))}_calculateMatrices(){const e=[];for(const t of this.directionalLights){const n=new dn().lookAt({eye:new ft(t.direction).negate()});e.push(n)}return e}_createShadowPasses(e){for(let t=0;t<this.directionalLights.length;t++){const n=new eJ(e);this.shadowPasses[t]=n}}_applyDefaultLights(){const{ambientLight:e,pointLights:t,directionalLights:n}=this;!e&&t.length===0&&n.length===0&&(this.ambientLight=new XW(tJ),this.directionalLights.push(new HS($S[0]),new HS($S[1])))}}class nJ{constructor(e={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(e)}setOptions(e){Object.assign(this.opts,e)}allocate(e,t,{size:n=1,type:i,padding:o=0,copy:s=!1,initialize:c=!1,maxCount:f}){const y=i||e&&e.constructor||Float32Array,b=t*n+o;if(ArrayBuffer.isView(e)){if(b<=e.length)return e;if(b*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new y(e.buffer,0,b)}let T=1/0;f&&(T=f*n+o);const S=this._allocate(y,b,c,T);return e&&s?S.set(e):c||S.fill(0,0,4),this._release(e),S}release(e){this._release(e)}_allocate(e,t,n,i){let o=Math.max(Math.ceil(t*this.opts.overAlloc),1);o>i&&(o=i);const s=this._pool,c=e.BYTES_PER_ELEMENT*o,f=s.findIndex(y=>y.byteLength>=c);if(f>=0){const y=new e(s.splice(f,1)[0],0,o);return n&&y.fill(0),y}return new e(o)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:n}=e,{byteLength:i}=n,o=t.findIndex(s=>s.byteLength>=i);o<0?t.push(n):(o>0||t.length<this.opts.poolSize)&&t.splice(o,0,n),t.length>this.opts.poolSize&&t.shift()}}const _A=new nJ;function Pp(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function iJ(r){return[r[12],r[13],r[14]]}function sJ(r){return{left:pd(r[3]+r[0],r[7]+r[4],r[11]+r[8],r[15]+r[12]),right:pd(r[3]-r[0],r[7]-r[4],r[11]-r[8],r[15]-r[12]),bottom:pd(r[3]+r[1],r[7]+r[5],r[11]+r[9],r[15]+r[13]),top:pd(r[3]-r[1],r[7]-r[5],r[11]-r[9],r[15]-r[13]),near:pd(r[3]+r[2],r[7]+r[6],r[11]+r[10],r[15]+r[14]),far:pd(r[3]-r[2],r[7]-r[6],r[11]-r[10],r[15]-r[14])}}const WS=new ft;function pd(r,e,t,n){WS.set(r,e,t);const i=WS.len();return{distance:n/i,normal:new ft(-r/i,-e/i,-t/i)}}function oJ(r){return r-Math.fround(r)}let yp;function ob(r,e){const{size:t=1,startIndex:n=0}=e,i=e.endIndex!==void 0?e.endIndex:r.length,o=(i-n)/t;yp=_A.allocate(yp,o,{type:Float32Array,size:t*2});let s=n,c=0;for(;s<i;){for(let f=0;f<t;f++){const y=r[s++];yp[c+f]=y,yp[c+f+t]=oJ(y)}c+=t*2}return yp.subarray(0,o*t*2)}function aJ(r){let e=null,t=!1;for(const n of r)n&&(e?(t||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],t=!0),e[0][0]=Math.min(e[0][0],n[0][0]),e[0][1]=Math.min(e[0][1],n[0][1]),e[1][0]=Math.max(e[1][0],n[1][0]),e[1][1]=Math.max(e[1][1],n[1][1])):e=n);return e}const cJ=Math.PI/180,lJ=Pp(),JS=[0,0,0],uJ={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};function fJ({width:r,height:e,orthographic:t,fovyRadians:n,focalDistance:i,padding:o,near:s,far:c}){const f=r/e,y=t?new dn().orthographic({fovy:n,aspect:f,focalDistance:i,near:s,far:c}):new dn().perspective({fovy:n,aspect:f,near:s,far:c});if(o){const{left:b=0,right:T=0,top:S=0,bottom:D=0}=o,k=Ll((b+r-T)/2,0,r)-r/2,z=Ll((S+e-D)/2,0,e)-e/2;y[8]-=k*2/r,y[9]+=z*2/e}return y}class jl{constructor(e={}){this._frustumPlanes={},this.id=e.id||this.constructor.displayName||"viewport",this.x=e.x||0,this.y=e.y||0,this.width=e.width||1,this.height=e.height||1,this.zoom=e.zoom||0,this.padding=e.padding,this.distanceScales=e.distanceScales||uJ,this.focalDistance=e.focalDistance||1,this.position=e.position||JS,this.modelMatrix=e.modelMatrix||null;const{longitude:t,latitude:n}=e;this.isGeospatial=Number.isFinite(n)&&Number.isFinite(t),this._initProps(e),this._initMatrices(e),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?na.WEB_MERCATOR:na.WEB_MERCATOR_AUTO_OFFSET:na.IDENTITY}equals(e){return e instanceof jl?this===e?!0:e.width===this.width&&e.height===this.height&&e.scale===this.scale&&aa(e.projectionMatrix,this.projectionMatrix)&&aa(e.viewMatrix,this.viewMatrix):!1}project(e,{topLeft:t=!0}={}){const n=this.projectPosition(e),i=R6(n,this.pixelProjectionMatrix),[o,s]=i,c=t?s:this.height-s;return e.length===2?[o,c]:[o,c,i[2]]}unproject(e,{topLeft:t=!0,targetZ:n}={}){const[i,o,s]=e,c=t?o:this.height-o,f=n&&n*this.distanceScales.unitsPerMeter[2],y=Sw([i,c,s],this.pixelUnprojectionMatrix,f),[b,T,S]=this.unprojectPosition(y);return Number.isFinite(s)?[b,T,S]:Number.isFinite(n)?[b,T,n]:[b,T]}projectPosition(e){const[t,n]=this.projectFlat(e),i=(e[2]||0)*this.distanceScales.unitsPerMeter[2];return[t,n,i]}unprojectPosition(e){const[t,n]=this.unprojectFlat(e),i=(e[2]||0)*this.distanceScales.metersPerUnit[2];return[t,n,i]}projectFlat(e){if(this.isGeospatial){const t=Gl(e);return t[1]=Ll(t[1],-318,830),t}return e}unprojectFlat(e){return this.isGeospatial?tl(e):e}getBounds(e={}){const t={targetZ:e.z||0},n=this.unproject([0,0],t),i=this.unproject([this.width,0],t),o=this.unproject([0,this.height],t),s=this.unproject([this.width,this.height],t);return[Math.min(n[0],i[0],o[0],s[0]),Math.min(n[1],i[1],o[1],s[1]),Math.max(n[0],i[0],o[0],s[0]),Math.max(n[1],i[1],o[1],s[1])]}getDistanceScales(e){return e&&this.isGeospatial?F2({longitude:e[0],latitude:e[1],highPrecision:!0}):this.distanceScales}containsPixel({x:e,y:t,width:n=1,height:i=1}){return e<this.x+this.width&&this.x<e+n&&t<this.y+this.height&&this.y<t+i}getFrustumPlanes(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,sJ(this.viewProjectionMatrix)),this._frustumPlanes)}panByPosition(e,t){return null}_initProps(e){const t=e.longitude,n=e.latitude;this.isGeospatial&&(Number.isFinite(e.zoom)||(this.zoom=xW({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=e.distanceScales||F2({latitude:n,longitude:t}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:o,modelMatrix:s}=e;let c=JS;if(o&&(c=s?new dn(s).transformAsVector(o,[]):o),this.isGeospatial){const f=this.projectPosition([t,n,0]);this.center=new ft(c).scale(this.distanceScales.unitsPerMeter).add(f)}else this.center=this.projectPosition(c)}_initMatrices(e){const{viewMatrix:t=lJ,projectionMatrix:n=null,orthographic:i=!1,fovyRadians:o,fovy:s=75,near:c=.1,far:f=1e3,padding:y=null,focalDistance:b=1}=e;this.viewMatrixUncentered=t,this.viewMatrix=new dn().multiplyRight(t).translate(new ft(this.center).negate()),this.projectionMatrix=n||fJ({width:this.width,height:this.height,orthographic:i,fovyRadians:o||s*cJ,focalDistance:b,padding:y,near:c,far:f});const T=Pp();Jf(T,T,this.projectionMatrix),Jf(T,T,this.viewMatrix),this.viewProjectionMatrix=T,this.viewMatrixInverse=w2([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=iJ(this.viewMatrixInverse);const S=Pp(),D=Pp();xw(S,S,[this.width/2,-this.height/2,1]),o_(S,S,[1,-1,0]),Jf(D,S,this.viewProjectionMatrix),this.pixelProjectionMatrix=D,this.pixelUnprojectionMatrix=w2(Pp(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||Jr.warn("Pixel project matrix not invertible")()}}jl.displayName="Viewport";let cg=class O2 extends jl{constructor(e={}){const{latitude:t=0,longitude:n=0,zoom:i=0,pitch:o=0,bearing:s=0,nearZMultiplier:c=.1,farZMultiplier:f=1.01,nearZ:y,farZ:b,orthographic:T=!1,projectionMatrix:S,repeat:D=!1,worldOffset:k=0,position:z,padding:J,legacyMeterSizes:G=!1}=e;let{width:j,height:K,altitude:fe=1.5}=e;const Z=Math.pow(2,i);j=j||1,K=K||1;let oe,Be=null;if(S)fe=S[5]/2,oe=ag(fe);else{e.fovy?(oe=e.fovy,fe=Bw(oe)):oe=ag(fe);let pe;if(J){const{top:we=0,bottom:Ae=0}=J;pe=[0,Ll((we+K-Ae)/2,0,K)-K/2]}Be=CW({width:j,height:K,scale:Z,center:z&&[0,0,z[2]*sb(t)],offset:pe,pitch:o,fovy:oe,nearZMultiplier:c,farZMultiplier:f}),Number.isFinite(y)&&(Be.near=y),Number.isFinite(b)&&(Be.far=b)}let ze=wW({height:K,pitch:o,bearing:s,scale:Z,altitude:fe});k&&(ze=new dn().translate([512*k,0,0]).multiplyLeft(ze)),super({...e,width:j,height:K,viewMatrix:ze,longitude:n,latitude:t,zoom:i,...Be,fovy:oe,focalDistance:fe}),this.latitude=t,this.longitude=n,this.zoom=i,this.pitch=o,this.bearing=s,this.altitude=fe,this.fovy=oe,this.orthographic=T,this._subViewports=D?[]:null,this._pseudoMeters=G,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),t=Math.floor((e[0]+180)/360),n=Math.ceil((e[2]-180)/360);for(let i=t;i<=n;i++){const o=i?new O2({...this,worldOffset:i}):this;this._subViewports.push(o)}}return this._subViewports}projectPosition(e){if(this._pseudoMeters)return super.projectPosition(e);const[t,n]=this.projectFlat(e),i=(e[2]||0)*sb(e[1]);return[t,n,i]}unprojectPosition(e){if(this._pseudoMeters)return super.unprojectPosition(e);const[t,n]=this.unprojectFlat(e),i=(e[2]||0)/sb(n);return[t,n,i]}addMetersToLngLat(e,t){return P6(e,t)}panByPosition(e,t){const n=Sw(t,this.pixelUnprojectionMatrix),i=this.projectFlat(e),o=fS([],i,yH([],n)),s=fS([],this.center,o),[c,f]=this.unprojectFlat(s);return{longitude:c,latitude:f}}getBounds(e={}){const t=BW(this,e.z||0);return[Math.min(t[0][0],t[1][0],t[2][0],t[3][0]),Math.min(t[0][1],t[1][1],t[2][1],t[3][1]),Math.max(t[0][0],t[1][0],t[2][0],t[3][0]),Math.max(t[0][1],t[1][1],t[2][1],t[3][1])]}fitBounds(e,t={}){const{width:n,height:i}=this,{longitude:o,latitude:s,zoom:c}=EW({width:n,height:i,bounds:e,...t});return new O2({width:n,height:i,longitude:o,latitude:s,zoom:c})}};cg.displayName="WebMercatorViewport";const XS=[0,0,0];function ab(r,e,t=!1){const n=e.projectPosition(r);if(t&&e instanceof cg){const[i,o,s=0]=r,c=e.getDistanceScales([i,o]);n[2]=s*c.unitsPerMeter[2]}return n}function hJ(r){const{viewport:e,modelMatrix:t,coordinateOrigin:n}=r;let{coordinateSystem:i,fromCoordinateSystem:o,fromCoordinateOrigin:s}=r;return i===Wr.DEFAULT&&(i=e.isGeospatial?Wr.LNGLAT:Wr.CARTESIAN),o===void 0&&(o=i),s===void 0&&(s=n),{viewport:e,coordinateSystem:i,coordinateOrigin:n,modelMatrix:t,fromCoordinateSystem:o,fromCoordinateOrigin:s}}function N6(r,{viewport:e,modelMatrix:t,coordinateSystem:n,coordinateOrigin:i,offsetMode:o}){let[s,c,f=0]=r;switch(t&&([s,c,f]=RA([],[s,c,f,1],t)),n){case Wr.LNGLAT:return ab([s,c,f],e,o);case Wr.LNGLAT_OFFSETS:return ab([s+i[0],c+i[1],f+(i[2]||0)],e,o);case Wr.METER_OFFSETS:return ab(P6(i,[s,c,f]),e,o);case Wr.CARTESIAN:default:return e.isGeospatial?[s+i[0],c+i[1],f+i[2]]:e.projectPosition([s,c,f])}}function dJ(r,e){const{viewport:t,coordinateSystem:n,coordinateOrigin:i,modelMatrix:o,fromCoordinateSystem:s,fromCoordinateOrigin:c}=hJ(e),{autoOffset:f=!0}=e,{geospatialOrigin:y=XS,shaderCoordinateOrigin:b=XS,offsetMode:T=!1}=f?I6(t,n,i):{},S=N6(r,{viewport:t,modelMatrix:o,coordinateSystem:s,coordinateOrigin:c,offsetMode:T});if(T){const D=t.projectPosition(y||b);o6(S,S,D)}return S}let AJ=1,pJ=1;class k6{constructor(){V(this,"time",0);V(this,"channels",new Map);V(this,"animations",new Map);V(this,"playing",!1);V(this,"lastEngineTime",-1)}addChannel(e){const{delay:t=0,duration:n=Number.POSITIVE_INFINITY,rate:i=1,repeat:o=1}=e,s=AJ++,c={time:0,delay:t,duration:n,rate:i,repeat:o};return this._setChannelTime(c,this.time),this.channels.set(s,c),s}removeChannel(e){this.channels.delete(e);for(const[t,n]of this.animations)n.channel===e&&this.detachAnimation(t)}isFinished(e){const t=this.channels.get(e);return t===void 0?!1:this.time>=t.delay+t.duration*t.repeat}getTime(e){if(e===void 0)return this.time;const t=this.channels.get(e);return t===void 0?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const i of t)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:o,channel:s}=i;o.setTime(this.getTime(s))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const n=pJ++;return this.animations.set(n,{animation:e,channel:t}),e.setTime(this.getTime(t)),n}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const n=t-e.delay,i=e.duration*e.repeat;n>=i?e.time=e.duration*e.rate:(e.time=Math.max(0,n)%e.duration,e.time*=e.rate)}}function gJ(r){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,1e3/60)}function mJ(r){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(r):clearTimeout(r)}function KS(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}let YS=class{constructor(e,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=KS(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(KS()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}},_J=class{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const t of Object.values(this.stats))e(t)}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){const{name:t,type:n}=e;let i=this.stats[t];return i||(e instanceof YS?i=e:i=new YS(t,n),this.stats[t]=i),i}},yJ=0;const vJ={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:r=>console.error(r),stats:f2.stats.get(`animation-loop-${yJ++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class bJ{constructor(e){V(this,"device",null);V(this,"canvas",null);V(this,"props");V(this,"animationProps",null);V(this,"timeline",null);V(this,"stats");V(this,"cpuTime");V(this,"gpuTime");V(this,"frameRate");V(this,"display");V(this,"needsRedraw","initialized");V(this,"_initialized",!1);V(this,"_running",!1);V(this,"_animationFrameId",null);V(this,"_nextFramePromise",null);V(this,"_resolveNextFrame",null);V(this,"_cpuStartTime",0);V(this,"_error",null);if(this.props={...vJ,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:t=!0}=this.props;this.stats=e.stats||new _J({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:t}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setError(e){var n,i;if(this.props.onError(e),this._error=Error(),((i=(n=this.device)==null?void 0:n.canvasContext)==null?void 0:i.canvas)instanceof HTMLCanvasElement){const o=document.createElement("h1");o.innerHTML=e.message,o.style.position="absolute",o.style.top="20%",o.style.left="10px",o.style.color="black",o.style.backgroundColor="red",document.body.appendChild(o)}}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const t=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(t),t}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost||this._error?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=gJ(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(mJ(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){var t;if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),(t=this.device)==null||t.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var t,n;const e=(n=(t=this.device)==null?void 0:t.canvasContext)==null?void 0:n.canvas;if(!this.device||!e)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:e,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:t,aspect:n}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(t);const n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}_getSizeAndAspect(){var o,s,c,f;if(!this.device)return{width:1,height:1,aspect:1};const[e,t]=((s=(o=this.device)==null?void 0:o.canvasContext)==null?void 0:s.getPixelSize())||[1,1];let n=1;const i=(f=(c=this.device)==null?void 0:c.canvasContext)==null?void 0:f.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,t;this.props.autoResizeDrawingBuffer&&((t=(e=this.device)==null?void 0:e.canvasContext)==null||t.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}const cb={};function lh(r="id"){cb[r]=cb[r]||1;const e=cb[r]++;return`${r}-${e}`}class qS{constructor(e){V(this,"id");V(this,"userData",{});V(this,"topology");V(this,"bufferLayout",[]);V(this,"vertexCount");V(this,"indices");V(this,"attributes");if(this.id=e.id||lh("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&!(this.indices.usage&ki.INDEX))throw new Error("Index buffer must have INDEX usage")}destroy(){var e;(e=this.indices)==null||e.destroy();for(const t of Object.values(this.attributes))t.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(e){return e.byteLength/12}}function xJ(r,e){if(e instanceof qS)return e;const t=wJ(r,e),{attributes:n,bufferLayout:i}=CJ(r,e);return new qS({topology:e.topology||"triangle-list",bufferLayout:i,vertexCount:e.vertexCount,indices:t,attributes:n})}function wJ(r,e){if(!e.indices)return;const t=e.indices.value;return r.createBuffer({usage:ki.INDEX,data:t})}function CJ(r,e){const t=[],n={};for(const[o,s]of Object.entries(e.attributes)){let c=o;switch(o){case"POSITION":c="positions";break;case"NORMAL":c="normals";break;case"TEXCOORD_0":c="texCoords";break;case"COLOR_0":c="colors";break}if(s){n[c]=r.createBuffer({data:s.value,id:`${o}-buffer`});const{value:f,size:y,normalized:b}=s;t.push({name:c,format:wV(f,y,b)})}}const i=e._calculateVertexCount(e.attributes,e.indices);return{attributes:n,bufferLayout:t,vertexCount:i}}const ry=class ry{constructor(e){V(this,"device");V(this,"destroyPolicy");V(this,"_hashCounter",0);V(this,"_hashes",{});V(this,"_renderPipelineCache",{});V(this,"_computePipelineCache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new ry(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const t={...pA.defaultProps,...e},n=this._hashRenderPipeline(t);if(!this._renderPipelineCache[n]){const i=this.device.createRenderPipeline({...t,id:t.id?`${t.id}-cached`:void 0});i.hash=n,this._renderPipelineCache[n]={pipeline:i,useCount:0}}return this._renderPipelineCache[n].useCount++,this._renderPipelineCache[n].pipeline}createComputePipeline(e){const t={...r_.defaultProps,...e},n=this._hashComputePipeline(t);if(!this._computePipelineCache[n]){const i=this.device.createComputePipeline({...t,id:t.id?`${t.id}-cached`:void 0});i.hash=n,this._computePipelineCache[n]={pipeline:i,useCount:0}}return this._computePipelineCache[n].useCount++,this._computePipelineCache[n].pipeline}release(e){const t=e.hash,n=e instanceof r_?this._computePipelineCache:this._renderPipelineCache;n[t].useCount--,n[t].useCount===0&&this.destroyPolicy==="unused"&&(n[t].pipeline.destroy(),delete n[t])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const t=e.vs?this._getHash(e.vs.source):0,n=e.fs?this._getHash(e.fs.source):0,i="-",o=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${t}/${n}V${i}BL${o}`;default:const s=this._getHash(JSON.stringify(e.parameters));return`${t}/${n}V${i}T${e.topology}P${s}BL${o}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};V(ry,"defaultProps",{...pA.defaultProps});let D2=ry;const ny=class ny{constructor(e){V(this,"device");V(this,"destroyPolicy");V(this,"_cache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultShaderFactory(e){var t;return(t=e._lumaData).defaultShaderFactory||(t.defaultShaderFactory=new ny(e)),e._lumaData.defaultShaderFactory}createShader(e){const t=this._hashShader(e);let n=this._cache[t];if(!n){const i=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[t]=n={shader:i,useCount:0}}return n.useCount++,n.shader}release(e){const t=this._hashShader(e),n=this._cache[t];n&&(n.useCount--,n.useCount===0&&this.destroyPolicy==="unused"&&(delete this._cache[t],n.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};V(ny,"defaultProps",{...Qm.defaultProps});let L2=ny;function EJ(r,e){var i;const t={},n="Values";if(r.attributes.length===0&&!((i=r.varyings)!=null&&i.length))return{"No attributes or varyings":{[n]:"N/A"}};for(const o of r.attributes)if(o){const s=`${o.location} ${o.name}: ${o.type}`;t[`in ${s}`]={[n]:o.stepMode||"vertex"}}for(const o of r.varyings||[]){const s=`${o.location} ${o.name}`;t[`out ${s}`]={[n]:JSON.stringify(o)}}return t}let Bs=null,If=null;function TJ(r,{id:e,minimap:t,opaque:n,top:i="0",left:o="0",rgbaScale:s=1}){Bs||(Bs=document.createElement("canvas"),Bs.id=e,Bs.title=e,Bs.style.zIndex="100",Bs.style.position="absolute",Bs.style.top=i,Bs.style.left=o,Bs.style.border="blue 5px solid",Bs.style.transform="scaleY(-1)",document.body.appendChild(Bs),If=Bs.getContext("2d")),(Bs.width!==r.width||Bs.height!==r.height)&&(Bs.width=r.width/2,Bs.height=r.height/2,Bs.style.width="400px",Bs.style.height="400px");const c=r.device.readPixelsToArrayWebGL(r),f=If==null?void 0:If.createImageData(r.width,r.height);if(f){for(let b=0;b<c.length;b+=4)f.data[0+b+0]=c[b+0]*s,f.data[0+b+1]=c[b+1]*s,f.data[0+b+2]=c[b+2]*s,f.data[0+b+3]=n?255:c[b+3]*s;If==null||If.putImageData(f,0,0)}}function N2(r,e,t){if(r===e)return!0;if(!t||!r||!e)return!1;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let n=0;n<r.length;n++)if(!N2(r[n],e[n],t-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof r=="object"&&typeof e=="object"){const n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(const o of n)if(!e.hasOwnProperty(o)||!N2(r[o],e[o],t-1))return!1;return!0}return!1}function BJ(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function SJ(r){return Array.isArray(r)?r.length===0||typeof r[0]=="number":!1}function U6(r){return BJ(r)||SJ(r)}function IJ(r){return U6(r)||typeof r=="number"||typeof r=="boolean"}function z6(r){const e={bindings:{},uniforms:{}};return Object.keys(r).forEach(t=>{const n=r[t];IJ(n)?e.uniforms[t]=n:e.bindings[t]=n}),e}class MJ{constructor(e,t){V(this,"options",{disableWarnings:!1});V(this,"modules");V(this,"moduleUniforms");V(this,"moduleBindings");Object.assign(this.options,t);const n=hw(Object.values(e).filter(i=>i.dependencies));for(const i of n)e[i.name]=i;Yt.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[i,o]of Object.entries(e))this._addModule(o),o.name&&i!==o.name&&!this.options.disableWarnings&&Yt.warn(`Module name: ${i} vs ${o.name}`)()}destroy(){}setProps(e){var t;for(const n of Object.keys(e)){const i=n,o=e[i]||{},s=this.modules[i];if(!s){this.options.disableWarnings||Yt.warn(`Module ${n} not found`)();continue}const c=this.moduleUniforms[i],f=this.moduleBindings[i],y=((t=s.getUniforms)==null?void 0:t.call(s,o,c))||o,{uniforms:b,bindings:T}=z6(y);this.moduleUniforms[i]={...c,...b},this.moduleBindings[i]={...f,...T}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){const e={};for(const t of Object.values(this.moduleBindings))Object.assign(e,t);return e}getDebugTable(){var t;const e={};for(const[n,i]of Object.entries(this.moduleUniforms))for(const[o,s]of Object.entries(i))e[`${n}.${o}`]={type:(t=this.modules[n].uniformTypes)==null?void 0:t[o],value:String(s)};return e}_addModule(e){const t=e.name;this.moduleUniforms[t]=e.defaultUniforms||{},this.moduleBindings[t]={}}}let PJ="";async function RJ(r,e){const t=new Image;return t.crossOrigin="anonymous",t.src=r.startsWith("http")?r:PJ+r,await t.decode(),e?await createImageBitmap(t,e):await createImageBitmap(t)}class lb{constructor(e,t){V(this,"device");V(this,"id");V(this,"texture");V(this,"sampler");V(this,"view");V(this,"ready");V(this,"isReady",!1);V(this,"destroyed",!1);V(this,"resolveReady",()=>{});V(this,"rejectReady",()=>{});this.device=e,this.id=t.id||lh("async-texture"),typeof(t==null?void 0:t.data)=="string"&&t.dimension==="2d"&&(t={...t,data:RJ(t.data)}),this.ready=new Promise((n,i)=>{this.resolveReady=()=>{this.isReady=!0,n()},this.rejectReady=i}),this.initAsync(t)}get[Symbol.toStringTag](){return"AsyncTexture"}toString(){return`AsyncTexture:"${this.id}"(${this.isReady?"ready":"loading"})`}async initAsync(e){let t,n;const i=e.data,o=await G6(i).then(t,n);if(this.destroyed)return;const s={...e,data:o};this.texture=this.device.createTexture(s),this.sampler=this.texture.sampler,this.view=this.texture.view,this.isReady=!0}destroy(){this.texture&&(this.texture.destroy(),this.texture=null),this.destroyed=!0}resize(e){if(!this.isReady)throw new Error("Cannot resize texture before it is ready");if(e.width===this.texture.width&&e.height===this.texture.height)return!1;if(this.texture){const t=this.texture;this.texture=t.clone(e),t.destroy()}return!0}}async function G6(r){if(r=await r,Array.isArray(r))return await Promise.all(r.map(G6));if(r&&typeof r=="object"&&r.constructor===Object){const e=r,t=await Promise.all(Object.values(e)),n=Object.keys(e),i={};for(let o=0;o<n.length;o++)i[n[o]]=t[o];return i}return r}const Mf=2,FJ=1e4,iy=class iy{constructor(e,t){V(this,"device");V(this,"id");V(this,"source");V(this,"vs");V(this,"fs");V(this,"pipelineFactory");V(this,"shaderFactory");V(this,"userData",{});V(this,"parameters");V(this,"topology");V(this,"bufferLayout");V(this,"isInstanced");V(this,"instanceCount",0);V(this,"vertexCount");V(this,"indexBuffer",null);V(this,"bufferAttributes",{});V(this,"constantAttributes",{});V(this,"bindings",{});V(this,"uniforms",{});V(this,"vertexArray");V(this,"transformFeedback",null);V(this,"pipeline");V(this,"shaderInputs");V(this,"_uniformStore");V(this,"_attributeInfos",{});V(this,"_gpuGeometry",null);V(this,"_getModuleUniforms");V(this,"props");V(this,"_pipelineNeedsUpdate","newly created");V(this,"_needsRedraw","initializing");V(this,"_destroyed",!1);V(this,"_lastDrawTimestamp",-1);V(this,"_lastLogTime",0);V(this,"_logOpen",!1);V(this,"_drawCount",0);var f,y,b,T;this.props={...iy.defaultProps,...t},t=this.props,this.id=t.id||lh("model"),this.device=e,Object.assign(this.userData,t.userData);const n=Object.fromEntries(((f=this.props.modules)==null?void 0:f.map(S=>[S.name,S]))||[]),i=t.shaderInputs||new MJ(n,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(i);const o=DJ(e),s=(((y=this.props.modules)==null?void 0:y.length)>0?this.props.modules:(b=this.shaderInputs)==null?void 0:b.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){const{source:S,getUniforms:D}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:o,...this.props,modules:s});this.source=S,this._getModuleUniforms=D,(T=this.props).shaderLayout||(T.shaderLayout=oH(this.source))}else{const{vs:S,fs:D,getUniforms:k}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:o,...this.props,modules:s});this.vs=S,this.fs=D,this._getModuleUniforms=k}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,t.geometry&&this.setGeometry(t.geometry),this.pipelineFactory=t.pipelineFactory||D2.getDefaultPipelineFactory(this.device),this.shaderFactory=t.shaderFactory||L2.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in t&&(this.isInstanced=t.isInstanced),t.instanceCount&&this.setInstanceCount(t.instanceCount),t.vertexCount&&this.setVertexCount(t.vertexCount),t.indexBuffer&&this.setIndexBuffer(t.indexBuffer),t.attributes&&this.setAttributes(t.attributes),t.constantAttributes&&this.setConstantAttributes(t.constantAttributes),t.bindings&&this.setBindings(t.bindings),t.uniforms&&this.setUniformsWebGL(t.uniforms),t.moduleSettings&&this.updateModuleSettingsWebGL(t.moduleSettings),t.transformFeedback&&(this.transformFeedback=t.transformFeedback),Object.seal(this)}get[Symbol.toStringTag](){return"Model"}toString(){return`Model(${this.id})`}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){const t=this._areBindingsLoading();if(t)return Yt.info(Mf,`>>> DRAWING ABORTED ${this.id}: ${t} not loaded`)(),!1;try{e.pushDebugGroup(`${this}.predraw(${e})`),this.predraw()}finally{e.popDebugGroup()}let n;try{e.pushDebugGroup(`${this}.draw(${e})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline();const i=this._getBindings();this.pipeline.setBindings(i,{disableWarnings:this.props.disableWarnings}),k2(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:o}=this.vertexArray,s=o?o.byteLength/(o.indexType==="uint32"?4:2):void 0;n=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:s,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{e.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(e),n?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",n}setGeometry(e){var n;(n=this._gpuGeometry)==null||n.destroy();const t=e&&xJ(this.device,e);if(t){this.setTopology(t.topology||"triangle-list");const i=new Yv(this.bufferLayout);this.bufferLayout=i.mergeBufferLayouts(t.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(t)}this._gpuGeometry=t}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){const t=new Yv(this.bufferLayout);this.bufferLayout=this._gpuGeometry?t.mergeBufferLayouts(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){N2(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new xV(this.shaderInputs.modules);for(const[t,n]of Object.entries(this.shaderInputs.modules))if(OJ(n)){const i=this._uniformStore.getManagedUniformBuffer(this.device,t);this.bindings[`${t}Uniforms`]=i}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindingValues()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,t){const n=(t==null?void 0:t.disableWarnings)??this.props.disableWarnings;e.indices&&Yt.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();const i=new Yv(this.bufferLayout);for(const[o,s]of Object.entries(e)){const c=i.getBufferLayout(o);if(!c){n||Yt.warn(`Model(${this.id}): Missing layout for buffer "${o}".`)();continue}const f=i.getAttributeNamesForBuffer(c);let y=!1;for(const b of f){const T=this._attributeInfos[b];T&&(this.vertexArray.setBuffer(T.location,s),y=!0)}!y&&!n&&Yt.warn(`Model(${this.id}): Ignoring buffer "${s.id}" for unknown attribute "${o}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,t){for(const[n,i]of Object.entries(e)){const o=this._attributeInfos[n];o?this.vertexArray.setConstantWebGL(o.location,i):((t==null?void 0:t.disableWarnings)??this.props.disableWarnings)||Yt.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${n}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){this.setUniformsWebGL(e)}setUniformsWebGL(e){k2(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettingsWebGL(e){const{bindings:t,uniforms:n}=z6(this._getModuleUniforms(e));Object.assign(this.bindings,t),Object.assign(this.uniforms,n),this.setNeedsRedraw("moduleSettings")}_areBindingsLoading(){for(const e of Object.values(this.bindings))if(e instanceof lb&&!e.isReady)return e.id;return!1}_getBindings(){const e={};for(const[t,n]of Object.entries(this.bindings))n instanceof lb?n.isReady&&(e[t]=n.texture):e[t]=n;return e}_getBindingsUpdateTimestamp(){let e=0;for(const t of Object.values(this.bindings))t instanceof Zm?e=Math.max(e,t.texture.updateTimestamp):t instanceof ki||t instanceof Ni?e=Math.max(e,t.updateTimestamp):t instanceof lb?e=t.texture?Math.max(e,t.texture.updateTimestamp):1/0:t instanceof e_||(e=Math.max(e,t.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const t={...e.attributes};for(const[n]of Object.entries(t))!this.pipeline.shaderLayout.attributes.find(i=>i.name===n)&&n!=="positions"&&delete t[n];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(t,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,t=null;this.pipeline&&(Yt.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,t=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const n=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debugShaders:this.props.debugShaders});let i=null;this.source?i=n:this.fs&&(i=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindings:this._getBindings(),vs:n,fs:i}),this._attributeInfos=kD(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),t&&this.shaderFactory.release(t)}return this.pipeline}_logDrawCallStart(){const e=Yt.level>3?0:FJ;Yt.level<2||Date.now()-this._lastLogTime<e||(this._lastLogTime=Date.now(),this._logOpen=!0,Yt.group(Mf,`>>> DRAWING MODEL ${this.id}`,{collapsed:Yt.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=EJ(this.pipeline.shaderLayout,this.id);Yt.table(Mf,e)();const t=this.shaderInputs.getDebugTable();for(const[i,o]of Object.entries(this.uniforms))t[i]={value:o};Yt.table(Mf,t)();const n=this._getAttributeDebugTable();Yt.table(Mf,this._attributeInfos)(),Yt.table(Mf,n)(),Yt.groupEnd(Mf)(),this._logOpen=!1}}_logFramebuffer(e){const t=this.device.props.debugFramebuffers;if(this._drawCount++,!t)return;const n=e.props.framebuffer;n&&TJ(n,{id:n.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[t,n]of Object.entries(this._attributeInfos)){const i=this.vertexArray.attributes[n.location];e[n.location]={name:t,type:n.shaderType,values:i?this._getBufferOrConstantValues(i,n.bufferDataType):"null"}}if(this.vertexArray.indexBuffer){const{indexBuffer:t}=this.vertexArray,n=t.indexType==="uint32"?new Uint32Array(t.debugData):new Uint16Array(t.debugData);e.indices={name:"indices",type:t.indexType,values:n.toString()}}return e}_getBufferOrConstantValues(e,t){const n=GD(t);return(e instanceof ki?new n(e.debugData):e).toString()}};V(iy,"defaultProps",{...pA.defaultProps,source:void 0,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:Ym.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let Bi=iy;function OJ(r){return!!(r.uniformTypes&&!k2(r.uniformTypes))}function DJ(r){return{type:r.type,shaderLanguage:r.info.shadingLanguage,shaderLanguageVersion:r.info.shadingLanguageVersion,gpu:r.info.gpu,features:r.features}}function k2(r){for(const e in r)return!1;return!0}const rg=class rg{constructor(e,t=rg.defaultProps){V(this,"device");V(this,"model");V(this,"transformFeedback");if(!rg.isSupported(e))throw new Error("BufferTransform not yet implemented on WebGPU");this.device=e,this.model=new Bi(this.device,{id:t.id||"buffer-transform-model",fs:t.fs||SD(),topology:t.topology||"point-list",varyings:t.outputs||t.varyings,...t}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:t.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var t;return((t=e==null?void 0:e.info)==null?void 0:t.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){e!=null&&e.inputBuffers&&this.model.setAttributes(e.inputBuffers),e!=null&&e.outputBuffers&&this.transformFeedback.setBuffers(e.outputBuffers);const t=this.device.beginRenderPass(e);this.model.draw(t),t.end()}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const t=this.getBuffer(e);if(!t)throw new Error("BufferTransform#getBuffer");if(t instanceof ki)return t.readAsync();const{buffer:n,byteOffset:i=0,byteLength:o=n.byteLength}=t;return n.readAsync(i,o)}};V(rg,"defaultProps",{...Bi.defaultProps,outputs:void 0,feedbackBuffers:void 0});let yA=rg;const LJ="transform_output";class ZS{constructor(e,t){V(this,"device");V(this,"model");V(this,"sampler");V(this,"currentIndex",0);V(this,"samplerTextureMap",null);V(this,"bindings",[]);V(this,"resources",{});this.device=e,this.sampler=e.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"nearest",magFilter:"nearest",mipmapFilter:"nearest"}),this.model=new Bi(this.device,{id:t.id||"texture-transform-model",fs:t.fs||SD({input:t.targetTextureVarying,inputChannels:t.targetTextureChannels,output:LJ}),vertexCount:t.vertexCount,...t}),this._initialize(t),Object.seal(this)}destroy(){var e;this.model.destroy();for(const t of this.bindings)(e=t.framebuffer)==null||e.destroy()}delete(){this.destroy()}run(e){const{framebuffer:t}=this.bindings[this.currentIndex],n=this.device.beginRenderPass({framebuffer:t,...e});this.model.draw(n),n.end()}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}_initialize(e){this._updateBindings(e)}_updateBindings(e){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e)}_updateBinding(e,{sourceBuffers:t,sourceTextures:n,targetTexture:i}){if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,n),Object.assign(e.sourceBuffers,t),i){e.targetTexture=i;const{width:o,height:s}=i;e.framebuffer&&e.framebuffer.destroy(),e.framebuffer=this.device.createFramebuffer({id:"transform-framebuffer",width:o,height:s,colorAttachments:[i]}),e.framebuffer.resize({width:o,height:s})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const n in t)t[n].sampler=this.sampler}}class $s{constructor(e){V(this,"id");V(this,"topology");V(this,"vertexCount");V(this,"indices");V(this,"attributes");V(this,"userData",{});const{attributes:t={},indices:n=null,vertexCount:i=null}=e;this.id=e.id||lh("geometry"),this.topology=e.topology,n&&(this.indices=ArrayBuffer.isView(n)?{value:n,size:1}:n),this.attributes={};for(const[o,s]of Object.entries(t)){const c=ArrayBuffer.isView(s)?{value:s}:s;if(!ArrayBuffer.isView(c.value))throw new Error(`${this._print(o)}: must be typed array or object with value as typed array`);if((o==="POSITION"||o==="positions")&&!c.size&&(c.size=3),o==="indices"){if(this.indices)throw new Error("Multiple indices detected");this.indices=c}else this.attributes[o]=c}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){return this}_calculateVertexCount(e,t){if(t)return t.value.length;let n=1/0;for(const i of Object.values(e)){const{value:o,size:s,constant:c}=i;!c&&o&&s!==void 0&&s>=1&&(n=Math.min(n,o.length/s))}return n}}const NJ=`struct VertexInputs {
1947
+ `}}},GW=[v6],VW=["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)"],HW=[];function jW(r){const e=Ym.getDefaultShaderAssembler();for(const n of GW)e.addDefaultModule(n);const t=r==="glsl"?VW:HW;for(const n of t)e.addShaderHook(n);return e}const $W=[255,255,255],WW=1;let JW=0;class XW{constructor(e={}){this.type="ambient";const{color:t=$W}=e,{intensity:n=WW}=e;this.id=e.id||`ambient-${JW++}`,this.color=t,this.intensity=n}}const KW=[255,255,255],YW=1,qW=[0,0,-1];let ZW=0;class HS{constructor(e={}){this.type="directional";const{color:t=KW}=e,{intensity:n=YW}=e,{direction:i=qW}=e,{_shadow:o=!1}=e;this.id=e.id||`directional-${ZW++}`,this.color=t,this.intensity=n,this.type="directional",this.direction=new ft(i).normalize().toArray(),this.shadow=o}getProjectedLight(e){return this}}class O6{constructor(e,t={id:"pass"}){const{id:n}=t;this.id=n,this.device=e,this.props={...t}}setProps(e){Object.assign(this.props,e)}render(e){}cleanup(){}}class fy extends O6{constructor(){super(...arguments),this._lastRenderIndex=-1}render(e){const[t,n]=this.device.canvasContext.getDrawingBufferSize(),i=e.clearCanvas??!0,o=e.clearColor??(i?[0,0,0,0]:!1),s=i?1:!1,c=i?0:!1,f=e.colorMask??15,y={viewport:[0,0,t,n]};e.colorMask&&(y.colorMask=f),e.scissorRect&&(y.scissorRect=e.scissorRect);const b=this.device.beginRenderPass({framebuffer:e.target,parameters:y,clearColor:o,clearDepth:s,clearStencil:c});try{return this._drawLayers(b,e)}finally{b.end(),this.device.submit()}}_drawLayers(e,t){const{target:n,shaderModuleProps:i,viewports:o,views:s,onViewportActive:c,clearStack:f=!0}=t;t.pass=t.pass||"unknown",f&&(this._lastRenderIndex=-1);const y=[];for(const b of o){const T=s&&s[b.id];c==null||c(b);const S=this._getDrawLayerParams(b,t),D=b.subViewports||[b];for(const k of D){const z=this._drawLayersInViewport(e,{target:n,shaderModuleProps:i,viewport:k,view:T,pass:t.pass,layers:t.layers},S);y.push(z)}}return y}_getDrawLayerParams(e,{layers:t,pass:n,isPicking:i=!1,layerFilter:o,cullRect:s,effects:c,shaderModuleProps:f},y=!1){var k;const b=[],T=D6(this._lastRenderIndex+1),S={layer:t[0],viewport:e,isPicking:i,renderPass:n,cullRect:s},D={};for(let z=0;z<t.length;z++){const J=t[z],G=this._shouldDrawLayer(J,S,o,D),j={shouldDrawLayer:G};G&&!y&&(j.shouldDrawLayer=!0,j.layerRenderIndex=T(J,G),j.shaderModuleProps=this._getShaderModuleProps(J,c,n,f),j.layerParameters={...(k=J.context.deck)==null?void 0:k.props.parameters,...this.getLayerParameters(J,z,e)}),b[z]=j}return b}_drawLayersInViewport(e,{layers:t,shaderModuleProps:n,pass:i,target:o,viewport:s,view:c},f){const y=QW(this.device,{shaderModuleProps:n,target:o,viewport:s});if(c&&c.props.clear){const T=c.props.clear===!0?{color:!0,depth:!0}:c.props.clear;this.device.beginRenderPass({framebuffer:o,parameters:{viewport:y,scissorRect:y},clearColor:T.color?[0,0,0,0]:!1,clearDepth:T.depth?1:!1}).end()}const b={totalCount:t.length,visibleCount:0,compositeCount:0,pickableCount:0};e.setParameters({viewport:y});for(let T=0;T<t.length;T++){const S=t[T],D=f[T],{shouldDrawLayer:k}=D;if(k&&S.props.pickable&&b.pickableCount++,S.isComposite&&b.compositeCount++,S.isDrawable&&D.shouldDrawLayer){const{layerRenderIndex:z,shaderModuleProps:J,layerParameters:G}=D;b.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,z),J.project&&(J.project.viewport=s),S.context.renderPass=e;try{S._drawLayer({renderPass:e,shaderModuleProps:J,uniforms:{layerIndex:z},parameters:G})}catch(j){S.raiseError(j,`drawing ${S} to ${i}`)}}}return b}shouldDrawLayer(e){return!0}getShaderModuleProps(e,t,n){return null}getLayerParameters(e,t,n){return e.props.parameters}_shouldDrawLayer(e,t,n,i){if(!(e.props.visible&&this.shouldDrawLayer(e)))return!1;t.layer=e;let s=e.parent;for(;s;){if(!s.props.visible||!s.filterSubLayer(t))return!1;t.layer=s,s=s.parent}if(n){const c=t.layer.id;if(c in i||(i[c]=n(t)),!i[c])return!1}return e.activateViewport(t.viewport),!0}_getShaderModuleProps(e,t,n,i){var f,y;const o=this.device.canvasContext.cssToDeviceRatio(),s=((f=e.internalState)==null?void 0:f.propsInTransition)||e.props,c={layer:s,picking:{isActive:!1},project:{viewport:e.context.viewport,devicePixelRatio:o,modelMatrix:s.modelMatrix,coordinateSystem:s.coordinateSystem,coordinateOrigin:s.coordinateOrigin,autoWrapLongitude:e.wrapLongitude}};if(t)for(const b of t)jS(c,(y=b.getShaderModuleProps)==null?void 0:y.call(b,e,c));return jS(c,this.getShaderModuleProps(e,t,c),i)}}function D6(r=0,e={}){const t={},n=(i,o)=>{const s=i.props._offset,c=i.id,f=i.parent&&i.parent.id;let y;if(f&&!(f in e)&&n(i.parent,!1),f in t){const b=t[f]=t[f]||D6(e[f],e);y=b(i,o),t[c]=b}else Number.isFinite(s)?(y=s+(e[f]||0),t[c]=null):y=r;return o&&y>=r&&(r=y+1),e[c]=y,y};return n}function QW(r,{shaderModuleProps:e,target:t,viewport:n}){var f;const i=((f=e==null?void 0:e.project)==null?void 0:f.devicePixelRatio)??r.canvasContext.cssToDeviceRatio(),[,o]=r.canvasContext.getDrawingBufferSize(),s=t?t.height:o,c=n;return[c.x*i,s-(c.y+c.height)*i,c.width*i,c.height*i]}function jS(r,...e){for(const t of e)if(t)for(const n in t)r[n]?Object.assign(r[n],t[n]):r[n]=t[n];return r}class eJ extends fy{constructor(e,t){super(e,t);const n=e.createTexture({format:"rgba8unorm",width:1,height:1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"},mipmaps:!0}),i=e.createTexture({format:"depth16unorm",width:1,height:1,mipmaps:!1});this.fbo=e.createFramebuffer({id:"shadowmap",width:1,height:1,colorAttachments:[n],depthStencilAttachment:i})}delete(){this.fbo&&(this.fbo.destroy(),this.fbo=null)}getShadowMap(){return this.fbo.colorAttachments[0].texture}render(e){const t=this.fbo,n=this.device.canvasContext.cssToDeviceRatio(),i=e.viewports[0],o=i.width*n,s=i.height*n,c=[1,1,1,1];(o!==t.width||s!==t.height)&&t.resize({width:o,height:s}),super.render({...e,clearColor:c,target:t,pass:"shadow"})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}shouldDrawLayer(e){return e.props.shadowEnabled!==!1}getShaderModuleProps(e,t,n){return{shadow:{project:n.project,drawToShadowMap:!0}}}}const tJ={color:[255,255,255],intensity:1},$S=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],rJ=[0,0,0,200/255];class L6{constructor(e={}){this.id="lighting-effect",this.shadowColor=rJ,this.shadow=!1,this.directionalLights=[],this.pointLights=[],this.shadowPasses=[],this.dummyShadowMap=null,this.setProps(e)}setup(e){this.context=e;const{device:t,deck:n}=e;this.shadow&&!this.dummyShadowMap&&(this._createShadowPasses(t),n._addDefaultShaderModule(VS),this.dummyShadowMap=t.createTexture({width:1,height:1}))}setProps(e){this.ambientLight=void 0,this.directionalLights=[],this.pointLights=[];for(const t in e){const n=e[t];switch(n.type){case"ambient":this.ambientLight=n;break;case"directional":this.directionalLights.push(n);break;case"point":this.pointLights.push(n);break}}this._applyDefaultLights(),this.shadow=this.directionalLights.some(t=>t.shadow),this.context&&this.setup(this.context),this.props=e}preRender({layers:e,layerFilter:t,viewports:n,onViewportActive:i,views:o}){if(this.shadow){this.shadowMatrices=this._calculateMatrices();for(let s=0;s<this.shadowPasses.length;s++)this.shadowPasses[s].render({layers:e,layerFilter:t,viewports:n,onViewportActive:i,views:o,shaderModuleProps:{shadow:{shadowLightId:s,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}}})}}getShaderModuleProps(e,t){const n=this.shadow?{project:t.project,shadowMaps:this.shadowPasses.map(s=>s.getShadowMap()),dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{},i={enabled:!0,ambientLight:this.ambientLight,directionalLights:this.directionalLights.map(s=>s.getProjectedLight({layer:e})),pointLights:this.pointLights.map(s=>s.getProjectedLight({layer:e}))},o=e.props.material;return{shadow:n,lighting:i,phongMaterial:o,gouraudMaterial:o}}cleanup(e){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.dummyShadowMap&&(this.dummyShadowMap.destroy(),this.dummyShadowMap=null,e.deck._removeDefaultShaderModule(VS))}_calculateMatrices(){const e=[];for(const t of this.directionalLights){const n=new dn().lookAt({eye:new ft(t.direction).negate()});e.push(n)}return e}_createShadowPasses(e){for(let t=0;t<this.directionalLights.length;t++){const n=new eJ(e);this.shadowPasses[t]=n}}_applyDefaultLights(){const{ambientLight:e,pointLights:t,directionalLights:n}=this;!e&&t.length===0&&n.length===0&&(this.ambientLight=new XW(tJ),this.directionalLights.push(new HS($S[0]),new HS($S[1])))}}class nJ{constructor(e={}){this._pool=[],this.opts={overAlloc:2,poolSize:100},this.setOptions(e)}setOptions(e){Object.assign(this.opts,e)}allocate(e,t,{size:n=1,type:i,padding:o=0,copy:s=!1,initialize:c=!1,maxCount:f}){const y=i||e&&e.constructor||Float32Array,b=t*n+o;if(ArrayBuffer.isView(e)){if(b<=e.length)return e;if(b*e.BYTES_PER_ELEMENT<=e.buffer.byteLength)return new y(e.buffer,0,b)}let T=1/0;f&&(T=f*n+o);const S=this._allocate(y,b,c,T);return e&&s?S.set(e):c||S.fill(0,0,4),this._release(e),S}release(e){this._release(e)}_allocate(e,t,n,i){let o=Math.max(Math.ceil(t*this.opts.overAlloc),1);o>i&&(o=i);const s=this._pool,c=e.BYTES_PER_ELEMENT*o,f=s.findIndex(y=>y.byteLength>=c);if(f>=0){const y=new e(s.splice(f,1)[0],0,o);return n&&y.fill(0),y}return new e(o)}_release(e){if(!ArrayBuffer.isView(e))return;const t=this._pool,{buffer:n}=e,{byteLength:i}=n,o=t.findIndex(s=>s.byteLength>=i);o<0?t.push(n):(o>0||t.length<this.opts.poolSize)&&t.splice(o,0,n),t.length>this.opts.poolSize&&t.shift()}}const _A=new nJ;function Pp(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function iJ(r){return[r[12],r[13],r[14]]}function sJ(r){return{left:pd(r[3]+r[0],r[7]+r[4],r[11]+r[8],r[15]+r[12]),right:pd(r[3]-r[0],r[7]-r[4],r[11]-r[8],r[15]-r[12]),bottom:pd(r[3]+r[1],r[7]+r[5],r[11]+r[9],r[15]+r[13]),top:pd(r[3]-r[1],r[7]-r[5],r[11]-r[9],r[15]-r[13]),near:pd(r[3]+r[2],r[7]+r[6],r[11]+r[10],r[15]+r[14]),far:pd(r[3]-r[2],r[7]-r[6],r[11]-r[10],r[15]-r[14])}}const WS=new ft;function pd(r,e,t,n){WS.set(r,e,t);const i=WS.len();return{distance:n/i,normal:new ft(-r/i,-e/i,-t/i)}}function oJ(r){return r-Math.fround(r)}let yp;function ob(r,e){const{size:t=1,startIndex:n=0}=e,i=e.endIndex!==void 0?e.endIndex:r.length,o=(i-n)/t;yp=_A.allocate(yp,o,{type:Float32Array,size:t*2});let s=n,c=0;for(;s<i;){for(let f=0;f<t;f++){const y=r[s++];yp[c+f]=y,yp[c+f+t]=oJ(y)}c+=t*2}return yp.subarray(0,o*t*2)}function aJ(r){let e=null,t=!1;for(const n of r)n&&(e?(t||(e=[[e[0][0],e[0][1]],[e[1][0],e[1][1]]],t=!0),e[0][0]=Math.min(e[0][0],n[0][0]),e[0][1]=Math.min(e[0][1],n[0][1]),e[1][0]=Math.max(e[1][0],n[1][0]),e[1][1]=Math.max(e[1][1],n[1][1])):e=n);return e}const cJ=Math.PI/180,lJ=Pp(),JS=[0,0,0],uJ={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};function fJ({width:r,height:e,orthographic:t,fovyRadians:n,focalDistance:i,padding:o,near:s,far:c}){const f=r/e,y=t?new dn().orthographic({fovy:n,aspect:f,focalDistance:i,near:s,far:c}):new dn().perspective({fovy:n,aspect:f,near:s,far:c});if(o){const{left:b=0,right:T=0,top:S=0,bottom:D=0}=o,k=Ll((b+r-T)/2,0,r)-r/2,z=Ll((S+e-D)/2,0,e)-e/2;y[8]-=k*2/r,y[9]+=z*2/e}return y}class jl{constructor(e={}){this._frustumPlanes={},this.id=e.id||this.constructor.displayName||"viewport",this.x=e.x||0,this.y=e.y||0,this.width=e.width||1,this.height=e.height||1,this.zoom=e.zoom||0,this.padding=e.padding,this.distanceScales=e.distanceScales||uJ,this.focalDistance=e.focalDistance||1,this.position=e.position||JS,this.modelMatrix=e.modelMatrix||null;const{longitude:t,latitude:n}=e;this.isGeospatial=Number.isFinite(n)&&Number.isFinite(t),this._initProps(e),this._initMatrices(e),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get subViewports(){return null}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?na.WEB_MERCATOR:na.WEB_MERCATOR_AUTO_OFFSET:na.IDENTITY}equals(e){return e instanceof jl?this===e?!0:e.width===this.width&&e.height===this.height&&e.scale===this.scale&&aa(e.projectionMatrix,this.projectionMatrix)&&aa(e.viewMatrix,this.viewMatrix):!1}project(e,{topLeft:t=!0}={}){const n=this.projectPosition(e),i=R6(n,this.pixelProjectionMatrix),[o,s]=i,c=t?s:this.height-s;return e.length===2?[o,c]:[o,c,i[2]]}unproject(e,{topLeft:t=!0,targetZ:n}={}){const[i,o,s]=e,c=t?o:this.height-o,f=n&&n*this.distanceScales.unitsPerMeter[2],y=Sw([i,c,s],this.pixelUnprojectionMatrix,f),[b,T,S]=this.unprojectPosition(y);return Number.isFinite(s)?[b,T,S]:Number.isFinite(n)?[b,T,n]:[b,T]}projectPosition(e){const[t,n]=this.projectFlat(e),i=(e[2]||0)*this.distanceScales.unitsPerMeter[2];return[t,n,i]}unprojectPosition(e){const[t,n]=this.unprojectFlat(e),i=(e[2]||0)*this.distanceScales.metersPerUnit[2];return[t,n,i]}projectFlat(e){if(this.isGeospatial){const t=Gl(e);return t[1]=Ll(t[1],-318,830),t}return e}unprojectFlat(e){return this.isGeospatial?tl(e):e}getBounds(e={}){const t={targetZ:e.z||0},n=this.unproject([0,0],t),i=this.unproject([this.width,0],t),o=this.unproject([0,this.height],t),s=this.unproject([this.width,this.height],t);return[Math.min(n[0],i[0],o[0],s[0]),Math.min(n[1],i[1],o[1],s[1]),Math.max(n[0],i[0],o[0],s[0]),Math.max(n[1],i[1],o[1],s[1])]}getDistanceScales(e){return e&&this.isGeospatial?F2({longitude:e[0],latitude:e[1],highPrecision:!0}):this.distanceScales}containsPixel({x:e,y:t,width:n=1,height:i=1}){return e<this.x+this.width&&this.x<e+n&&t<this.y+this.height&&this.y<t+i}getFrustumPlanes(){return this._frustumPlanes.near?this._frustumPlanes:(Object.assign(this._frustumPlanes,sJ(this.viewProjectionMatrix)),this._frustumPlanes)}panByPosition(e,t){return null}_initProps(e){const t=e.longitude,n=e.latitude;this.isGeospatial&&(Number.isFinite(e.zoom)||(this.zoom=xW({latitude:n})+Math.log2(this.focalDistance)),this.distanceScales=e.distanceScales||F2({latitude:n,longitude:t}));const i=Math.pow(2,this.zoom);this.scale=i;const{position:o,modelMatrix:s}=e;let c=JS;if(o&&(c=s?new dn(s).transformAsVector(o,[]):o),this.isGeospatial){const f=this.projectPosition([t,n,0]);this.center=new ft(c).scale(this.distanceScales.unitsPerMeter).add(f)}else this.center=this.projectPosition(c)}_initMatrices(e){const{viewMatrix:t=lJ,projectionMatrix:n=null,orthographic:i=!1,fovyRadians:o,fovy:s=75,near:c=.1,far:f=1e3,padding:y=null,focalDistance:b=1}=e;this.viewMatrixUncentered=t,this.viewMatrix=new dn().multiplyRight(t).translate(new ft(this.center).negate()),this.projectionMatrix=n||fJ({width:this.width,height:this.height,orthographic:i,fovyRadians:o||s*cJ,focalDistance:b,padding:y,near:c,far:f});const T=Pp();Jf(T,T,this.projectionMatrix),Jf(T,T,this.viewMatrix),this.viewProjectionMatrix=T,this.viewMatrixInverse=w2([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=iJ(this.viewMatrixInverse);const S=Pp(),D=Pp();xw(S,S,[this.width/2,-this.height/2,1]),o_(S,S,[1,-1,0]),Jf(D,S,this.viewProjectionMatrix),this.pixelProjectionMatrix=D,this.pixelUnprojectionMatrix=w2(Pp(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||Jr.warn("Pixel project matrix not invertible")()}}jl.displayName="Viewport";let cg=class O2 extends jl{constructor(e={}){const{latitude:t=0,longitude:n=0,zoom:i=0,pitch:o=0,bearing:s=0,nearZMultiplier:c=.1,farZMultiplier:f=1.01,nearZ:y,farZ:b,orthographic:T=!1,projectionMatrix:S,repeat:D=!1,worldOffset:k=0,position:z,padding:J,legacyMeterSizes:G=!1}=e;let{width:j,height:K,altitude:fe=1.5}=e;const Z=Math.pow(2,i);j=j||1,K=K||1;let oe,Be=null;if(S)fe=S[5]/2,oe=ag(fe);else{e.fovy?(oe=e.fovy,fe=Bw(oe)):oe=ag(fe);let pe;if(J){const{top:we=0,bottom:Ae=0}=J;pe=[0,Ll((we+K-Ae)/2,0,K)-K/2]}Be=CW({width:j,height:K,scale:Z,center:z&&[0,0,z[2]*sb(t)],offset:pe,pitch:o,fovy:oe,nearZMultiplier:c,farZMultiplier:f}),Number.isFinite(y)&&(Be.near=y),Number.isFinite(b)&&(Be.far=b)}let ze=wW({height:K,pitch:o,bearing:s,scale:Z,altitude:fe});k&&(ze=new dn().translate([512*k,0,0]).multiplyLeft(ze)),super({...e,width:j,height:K,viewMatrix:ze,longitude:n,latitude:t,zoom:i,...Be,fovy:oe,focalDistance:fe}),this.latitude=t,this.longitude=n,this.zoom=i,this.pitch=o,this.bearing=s,this.altitude=fe,this.fovy=oe,this.orthographic=T,this._subViewports=D?[]:null,this._pseudoMeters=G,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const e=this.getBounds(),t=Math.floor((e[0]+180)/360),n=Math.ceil((e[2]-180)/360);for(let i=t;i<=n;i++){const o=i?new O2({...this,worldOffset:i}):this;this._subViewports.push(o)}}return this._subViewports}projectPosition(e){if(this._pseudoMeters)return super.projectPosition(e);const[t,n]=this.projectFlat(e),i=(e[2]||0)*sb(e[1]);return[t,n,i]}unprojectPosition(e){if(this._pseudoMeters)return super.unprojectPosition(e);const[t,n]=this.unprojectFlat(e),i=(e[2]||0)/sb(n);return[t,n,i]}addMetersToLngLat(e,t){return P6(e,t)}panByPosition(e,t){const n=Sw(t,this.pixelUnprojectionMatrix),i=this.projectFlat(e),o=fS([],i,yH([],n)),s=fS([],this.center,o),[c,f]=this.unprojectFlat(s);return{longitude:c,latitude:f}}getBounds(e={}){const t=BW(this,e.z||0);return[Math.min(t[0][0],t[1][0],t[2][0],t[3][0]),Math.min(t[0][1],t[1][1],t[2][1],t[3][1]),Math.max(t[0][0],t[1][0],t[2][0],t[3][0]),Math.max(t[0][1],t[1][1],t[2][1],t[3][1])]}fitBounds(e,t={}){const{width:n,height:i}=this,{longitude:o,latitude:s,zoom:c}=EW({width:n,height:i,bounds:e,...t});return new O2({width:n,height:i,longitude:o,latitude:s,zoom:c})}};cg.displayName="WebMercatorViewport";const XS=[0,0,0];function ab(r,e,t=!1){const n=e.projectPosition(r);if(t&&e instanceof cg){const[i,o,s=0]=r,c=e.getDistanceScales([i,o]);n[2]=s*c.unitsPerMeter[2]}return n}function hJ(r){const{viewport:e,modelMatrix:t,coordinateOrigin:n}=r;let{coordinateSystem:i,fromCoordinateSystem:o,fromCoordinateOrigin:s}=r;return i===Wr.DEFAULT&&(i=e.isGeospatial?Wr.LNGLAT:Wr.CARTESIAN),o===void 0&&(o=i),s===void 0&&(s=n),{viewport:e,coordinateSystem:i,coordinateOrigin:n,modelMatrix:t,fromCoordinateSystem:o,fromCoordinateOrigin:s}}function N6(r,{viewport:e,modelMatrix:t,coordinateSystem:n,coordinateOrigin:i,offsetMode:o}){let[s,c,f=0]=r;switch(t&&([s,c,f]=RA([],[s,c,f,1],t)),n){case Wr.LNGLAT:return ab([s,c,f],e,o);case Wr.LNGLAT_OFFSETS:return ab([s+i[0],c+i[1],f+(i[2]||0)],e,o);case Wr.METER_OFFSETS:return ab(P6(i,[s,c,f]),e,o);case Wr.CARTESIAN:default:return e.isGeospatial?[s+i[0],c+i[1],f+i[2]]:e.projectPosition([s,c,f])}}function dJ(r,e){const{viewport:t,coordinateSystem:n,coordinateOrigin:i,modelMatrix:o,fromCoordinateSystem:s,fromCoordinateOrigin:c}=hJ(e),{autoOffset:f=!0}=e,{geospatialOrigin:y=XS,shaderCoordinateOrigin:b=XS,offsetMode:T=!1}=f?I6(t,n,i):{},S=N6(r,{viewport:t,modelMatrix:o,coordinateSystem:s,coordinateOrigin:c,offsetMode:T});if(T){const D=t.projectPosition(y||b);o6(S,S,D)}return S}let AJ=1,pJ=1;class k6{constructor(){V(this,"time",0);V(this,"channels",new Map);V(this,"animations",new Map);V(this,"playing",!1);V(this,"lastEngineTime",-1)}addChannel(e){const{delay:t=0,duration:n=Number.POSITIVE_INFINITY,rate:i=1,repeat:o=1}=e,s=AJ++,c={time:0,delay:t,duration:n,rate:i,repeat:o};return this._setChannelTime(c,this.time),this.channels.set(s,c),s}removeChannel(e){this.channels.delete(e);for(const[t,n]of this.animations)n.channel===e&&this.detachAnimation(t)}isFinished(e){const t=this.channels.get(e);return t===void 0?!1:this.time>=t.delay+t.duration*t.repeat}getTime(e){if(e===void 0)return this.time;const t=this.channels.get(e);return t===void 0?-1:t.time}setTime(e){this.time=Math.max(0,e);const t=this.channels.values();for(const i of t)this._setChannelTime(i,this.time);const n=this.animations.values();for(const i of n){const{animation:o,channel:s}=i;o.setTime(this.getTime(s))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(e,t){const n=pJ++;return this.animations.set(n,{animation:e,channel:t}),e.setTime(this.getTime(t)),n}detachAnimation(e){this.animations.delete(e)}update(e){this.playing&&(this.lastEngineTime===-1&&(this.lastEngineTime=e),this.setTime(this.time+(e-this.lastEngineTime)),this.lastEngineTime=e)}_setChannelTime(e,t){const n=t-e.delay,i=e.duration*e.repeat;n>=i?e.time=e.duration*e.rate:(e.time=Math.max(0,n)%e.duration,e.time*=e.rate)}}function gJ(r){return typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame(r):setTimeout(r,1e3/60)}function mJ(r){return typeof window<"u"&&window.cancelAnimationFrame?window.cancelAnimationFrame(r):clearTimeout(r)}function KS(){let r;if(typeof window<"u"&&window.performance)r=window.performance.now();else if(typeof process<"u"&&process.hrtime){const e=process.hrtime();r=e[0]*1e3+e[1]/1e6}else r=Date.now();return r}let YS=class{constructor(e,t){this.sampleSize=1,this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this.name=e,this.type=t,this.reset()}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}setSampleSize(e){return this.sampleSize=e,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(e){return this._count+=e,this._samples++,this._checkSampling(),this}subtractCount(e){return this._count-=e,this._samples++,this._checkSampling(),this}addTime(e){return this._time+=e,this.lastTiming=e,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=KS(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(KS()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}},_J=class{constructor(e){this.stats={},this.id=e.id,this.stats={},this._initializeStats(e.stats),Object.seal(this)}get(e,t="count"){return this._getOrCreate({name:e,type:t})}get size(){return Object.keys(this.stats).length}reset(){for(const e of Object.values(this.stats))e.reset();return this}forEach(e){for(const t of Object.values(this.stats))e(t)}getTable(){const e={};return this.forEach(t=>{e[t.name]={time:t.time||0,count:t.count||0,average:t.getAverageTime()||0,hz:t.getHz()||0}}),e}_initializeStats(e=[]){e.forEach(t=>this._getOrCreate(t))}_getOrCreate(e){const{name:t,type:n}=e;let i=this.stats[t];return i||(e instanceof YS?i=e:i=new YS(t,n),this.stats[t]=i),i}},yJ=0;const vJ={device:null,onAddHTML:()=>"",onInitialize:async()=>null,onRender:()=>{},onFinalize:()=>{},onError:r=>console.error(r),stats:f2.stats.get(`animation-loop-${yJ++}`),useDevicePixels:!0,autoResizeViewport:!1,autoResizeDrawingBuffer:!1};class bJ{constructor(e){V(this,"device",null);V(this,"canvas",null);V(this,"props");V(this,"animationProps",null);V(this,"timeline",null);V(this,"stats");V(this,"cpuTime");V(this,"gpuTime");V(this,"frameRate");V(this,"display");V(this,"needsRedraw","initialized");V(this,"_initialized",!1);V(this,"_running",!1);V(this,"_animationFrameId",null);V(this,"_nextFramePromise",null);V(this,"_resolveNextFrame",null);V(this,"_cpuStartTime",0);V(this,"_error",null);if(this.props={...vJ,...e},e=this.props,!e.device)throw new Error("No device provided");const{useDevicePixels:t=!0}=this.props;this.stats=e.stats||new _J({id:"animation-loop-stats"}),this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this.setProps({autoResizeViewport:e.autoResizeViewport,autoResizeDrawingBuffer:e.autoResizeDrawingBuffer,useDevicePixels:t}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}destroy(){this.stop(),this._setDisplay(null)}delete(){this.destroy()}setError(e){var n,i;if(this.props.onError(e),this._error=Error(),((i=(n=this.device)==null?void 0:n.canvasContext)==null?void 0:i.canvas)instanceof HTMLCanvasElement){const o=document.createElement("h1");o.innerHTML=e.message,o.style.position="absolute",o.style.top="20%",o.style.left="10px",o.style.color="black",o.style.backgroundColor="red",document.body.appendChild(o)}}setNeedsRedraw(e){return this.needsRedraw=this.needsRedraw||e,this}setProps(e){return"autoResizeViewport"in e&&(this.props.autoResizeViewport=e.autoResizeViewport||!1),"autoResizeDrawingBuffer"in e&&(this.props.autoResizeDrawingBuffer=e.autoResizeDrawingBuffer||!1),"useDevicePixels"in e&&(this.props.useDevicePixels=e.useDevicePixels||!1),this}async start(){if(this._running)return this;this._running=!0;try{let e;return this._initialized||(this._initialized=!0,await this._initDevice(),this._initialize(),await this.props.onInitialize(this._getAnimationProps())),this._running?(e!==!1&&(this._cancelAnimationFrame(),this._requestAnimationFrame()),this):null}catch(e){const t=e instanceof Error?e:new Error("Unknown error");throw this.props.onError(t),t}}stop(){return this._running&&(this.animationProps&&!this._error&&this.props.onFinalize(this.animationProps),this._cancelAnimationFrame(),this._nextFramePromise=null,this._resolveNextFrame=null,this._running=!1),this}redraw(){var e;return(e=this.device)!=null&&e.isLost||this._error?this:(this._beginFrameTimers(),this._setupFrame(),this._updateAnimationProps(),this._renderFrame(this._getAnimationProps()),this._clearNeedsRedraw(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endFrameTimers(),this)}attachTimeline(e){return this.timeline=e,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise(e=>{this._resolveNextFrame=e})),this._nextFramePromise}async toDataURL(){if(this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.canvas instanceof HTMLCanvasElement)return this.canvas.toDataURL();throw new Error("OffscreenCanvas")}_initialize(){this._startEventHandling(),this._initializeAnimationProps(),this._updateAnimationProps(),this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_setDisplay(e){this.display&&(this.display.destroy(),this.display.animationLoop=null),e&&(e.animationLoop=this),this.display=e}_requestAnimationFrame(){this._running&&(this._animationFrameId=gJ(this._animationFrame.bind(this)))}_cancelAnimationFrame(){this._animationFrameId!==null&&(mJ(this._animationFrameId),this._animationFrameId=null)}_animationFrame(){this._running&&(this.redraw(),this._requestAnimationFrame())}_renderFrame(e){var t;if(this.display){this.display._renderFrame(e);return}this.props.onRender(this._getAnimationProps()),(t=this.device)==null||t.submit()}_clearNeedsRedraw(){this.needsRedraw=!1}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport()}_initializeAnimationProps(){var t,n;const e=(n=(t=this.device)==null?void 0:t.canvasContext)==null?void 0:n.canvas;if(!this.device||!e)throw new Error("loop");this.animationProps={animationLoop:this,device:this.device,canvas:e,timeline:this.timeline,useDevicePixels:this.props.useDevicePixels,needsRedraw:!1,width:1,height:1,aspect:1,time:0,startTime:Date.now(),engineTime:0,tick:0,tock:0,_mousePosition:null}}_getAnimationProps(){if(!this.animationProps)throw new Error("animationProps");return this.animationProps}_updateAnimationProps(){if(!this.animationProps)return;const{width:e,height:t,aspect:n}=this._getSizeAndAspect();(e!==this.animationProps.width||t!==this.animationProps.height)&&this.setNeedsRedraw("drawing buffer resized"),n!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=e,this.animationProps.height=t,this.animationProps.aspect=n,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime}async _initDevice(){var e;if(this.device=await this.props.device,!this.device)throw new Error("No device provided");this.canvas=((e=this.device.canvasContext)==null?void 0:e.canvas)||null}_createInfoDiv(){if(this.canvas&&this.props.onAddHTML){const e=document.createElement("div");document.body.appendChild(e),e.style.position="relative";const t=document.createElement("div");t.style.position="absolute",t.style.left="10px",t.style.bottom="10px",t.style.width="300px",t.style.background="white",this.canvas instanceof HTMLCanvasElement&&e.appendChild(this.canvas),e.appendChild(t);const n=this.props.onAddHTML(t);n&&(t.innerHTML=n)}}_getSizeAndAspect(){var o,s,c,f;if(!this.device)return{width:1,height:1,aspect:1};const[e,t]=((s=(o=this.device)==null?void 0:o.canvasContext)==null?void 0:s.getPixelSize())||[1,1];let n=1;const i=(f=(c=this.device)==null?void 0:c.canvasContext)==null?void 0:f.canvas;return i&&i.clientHeight?n=i.clientWidth/i.clientHeight:e>0&&t>0&&(n=e/t),{width:e,height:t,aspect:n}}_resizeViewport(){this.props.autoResizeViewport&&this.device.gl&&this.device.gl.viewport(0,0,this.device.gl.drawingBufferWidth,this.device.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){var e,t;this.props.autoResizeDrawingBuffer&&((t=(e=this.device)==null?void 0:e.canvasContext)==null||t.resize({useDevicePixels:this.props.useDevicePixels}))}_beginFrameTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this.cpuTime.timeStart()}_endFrameTimers(){this.cpuTime.timeEnd()}_startEventHandling(){this.canvas&&(this.canvas.addEventListener("mousemove",this._onMousemove.bind(this)),this.canvas.addEventListener("mouseleave",this._onMouseleave.bind(this)))}_onMousemove(e){e instanceof MouseEvent&&(this._getAnimationProps()._mousePosition=[e.offsetX,e.offsetY])}_onMouseleave(e){this._getAnimationProps()._mousePosition=null}}const cb={};function lh(r="id"){cb[r]=cb[r]||1;const e=cb[r]++;return`${r}-${e}`}class qS{constructor(e){V(this,"id");V(this,"userData",{});V(this,"topology");V(this,"bufferLayout",[]);V(this,"vertexCount");V(this,"indices");V(this,"attributes");if(this.id=e.id||lh("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&!(this.indices.usage&ki.INDEX))throw new Error("Index buffer must have INDEX usage")}destroy(){var e;(e=this.indices)==null||e.destroy();for(const t of Object.values(this.attributes))t.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices||null}_calculateVertexCount(e){return e.byteLength/12}}function xJ(r,e){if(e instanceof qS)return e;const t=wJ(r,e),{attributes:n,bufferLayout:i}=CJ(r,e);return new qS({topology:e.topology||"triangle-list",bufferLayout:i,vertexCount:e.vertexCount,indices:t,attributes:n})}function wJ(r,e){if(!e.indices)return;const t=e.indices.value;return r.createBuffer({usage:ki.INDEX,data:t})}function CJ(r,e){const t=[],n={};for(const[o,s]of Object.entries(e.attributes)){let c=o;switch(o){case"POSITION":c="positions";break;case"NORMAL":c="normals";break;case"TEXCOORD_0":c="texCoords";break;case"COLOR_0":c="colors";break}if(s){n[c]=r.createBuffer({data:s.value,id:`${o}-buffer`});const{value:f,size:y,normalized:b}=s;t.push({name:c,format:wV(f,y,b)})}}const i=e._calculateVertexCount(e.attributes,e.indices);return{attributes:n,bufferLayout:t,vertexCount:i}}const ry=class ry{constructor(e){V(this,"device");V(this,"destroyPolicy");V(this,"_hashCounter",0);V(this,"_hashes",{});V(this,"_renderPipelineCache",{});V(this,"_computePipelineCache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new ry(e),e._lumaData.defaultPipelineFactory}createRenderPipeline(e){const t={...pA.defaultProps,...e},n=this._hashRenderPipeline(t);if(!this._renderPipelineCache[n]){const i=this.device.createRenderPipeline({...t,id:t.id?`${t.id}-cached`:void 0});i.hash=n,this._renderPipelineCache[n]={pipeline:i,useCount:0}}return this._renderPipelineCache[n].useCount++,this._renderPipelineCache[n].pipeline}createComputePipeline(e){const t={...r_.defaultProps,...e},n=this._hashComputePipeline(t);if(!this._computePipelineCache[n]){const i=this.device.createComputePipeline({...t,id:t.id?`${t.id}-cached`:void 0});i.hash=n,this._computePipelineCache[n]={pipeline:i,useCount:0}}return this._computePipelineCache[n].useCount++,this._computePipelineCache[n].pipeline}release(e){const t=e.hash,n=e instanceof r_?this._computePipelineCache:this._renderPipelineCache;n[t].useCount--,n[t].useCount===0&&this.destroyPolicy==="unused"&&(n[t].pipeline.destroy(),delete n[t])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const t=e.vs?this._getHash(e.vs.source):0,n=e.fs?this._getHash(e.fs.source):0,i="-",o=this._getHash(JSON.stringify(e.bufferLayout));switch(this.device.type){case"webgl":return`${t}/${n}V${i}BL${o}`;default:const s=this._getHash(JSON.stringify(e.parameters));return`${t}/${n}V${i}T${e.topology}P${s}BL${o}`}}_getHash(e){return this._hashes[e]===void 0&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}};V(ry,"defaultProps",{...pA.defaultProps});let D2=ry;const ny=class ny{constructor(e){V(this,"device");V(this,"destroyPolicy");V(this,"_cache",{});this.device=e,this.destroyPolicy=e.props._factoryDestroyPolicy}static getDefaultShaderFactory(e){var t;return(t=e._lumaData).defaultShaderFactory||(t.defaultShaderFactory=new ny(e)),e._lumaData.defaultShaderFactory}createShader(e){const t=this._hashShader(e);let n=this._cache[t];if(!n){const i=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[t]=n={shader:i,useCount:0}}return n.useCount++,n.shader}release(e){const t=this._hashShader(e),n=this._cache[t];n&&(n.useCount--,n.useCount===0&&this.destroyPolicy==="unused"&&(delete this._cache[t],n.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}};V(ny,"defaultProps",{...Qm.defaultProps});let L2=ny;function EJ(r,e){var i;const t={},n="Values";if(r.attributes.length===0&&!((i=r.varyings)!=null&&i.length))return{"No attributes or varyings":{[n]:"N/A"}};for(const o of r.attributes)if(o){const s=`${o.location} ${o.name}: ${o.type}`;t[`in ${s}`]={[n]:o.stepMode||"vertex"}}for(const o of r.varyings||[]){const s=`${o.location} ${o.name}`;t[`out ${s}`]={[n]:JSON.stringify(o)}}return t}let Bs=null,If=null;function TJ(r,{id:e,minimap:t,opaque:n,top:i="0",left:o="0",rgbaScale:s=1}){Bs||(Bs=document.createElement("canvas"),Bs.id=e,Bs.title=e,Bs.style.zIndex="100",Bs.style.position="absolute",Bs.style.top=i,Bs.style.left=o,Bs.style.border="blue 5px solid",Bs.style.transform="scaleY(-1)",document.body.appendChild(Bs),If=Bs.getContext("2d")),(Bs.width!==r.width||Bs.height!==r.height)&&(Bs.width=r.width/2,Bs.height=r.height/2,Bs.style.width="400px",Bs.style.height="400px");const c=r.device.readPixelsToArrayWebGL(r),f=If==null?void 0:If.createImageData(r.width,r.height);if(f){for(let b=0;b<c.length;b+=4)f.data[0+b+0]=c[b+0]*s,f.data[0+b+1]=c[b+1]*s,f.data[0+b+2]=c[b+2]*s,f.data[0+b+3]=n?255:c[b+3]*s;If==null||If.putImageData(f,0,0)}}function N2(r,e,t){if(r===e)return!0;if(!t||!r||!e)return!1;if(Array.isArray(r)){if(!Array.isArray(e)||r.length!==e.length)return!1;for(let n=0;n<r.length;n++)if(!N2(r[n],e[n],t-1))return!1;return!0}if(Array.isArray(e))return!1;if(typeof r=="object"&&typeof e=="object"){const n=Object.keys(r),i=Object.keys(e);if(n.length!==i.length)return!1;for(const o of n)if(!e.hasOwnProperty(o)||!N2(r[o],e[o],t-1))return!1;return!0}return!1}function BJ(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function SJ(r){return Array.isArray(r)?r.length===0||typeof r[0]=="number":!1}function U6(r){return BJ(r)||SJ(r)}function IJ(r){return U6(r)||typeof r=="number"||typeof r=="boolean"}function z6(r){const e={bindings:{},uniforms:{}};return Object.keys(r).forEach(t=>{const n=r[t];IJ(n)?e.uniforms[t]=n:e.bindings[t]=n}),e}class MJ{constructor(e,t){V(this,"options",{disableWarnings:!1});V(this,"modules");V(this,"moduleUniforms");V(this,"moduleBindings");Object.assign(this.options,t);const n=hw(Object.values(e).filter(i=>i.dependencies));for(const i of n)e[i.name]=i;Yt.log(1,"Creating ShaderInputs with modules",Object.keys(e))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[i,o]of Object.entries(e))this._addModule(o),o.name&&i!==o.name&&!this.options.disableWarnings&&Yt.warn(`Module name: ${i} vs ${o.name}`)()}destroy(){}setProps(e){var t;for(const n of Object.keys(e)){const i=n,o=e[i]||{},s=this.modules[i];if(!s){this.options.disableWarnings||Yt.warn(`Module ${n} not found`)();continue}const c=this.moduleUniforms[i],f=this.moduleBindings[i],y=((t=s.getUniforms)==null?void 0:t.call(s,o,c))||o,{uniforms:b,bindings:T}=z6(y);this.moduleUniforms[i]={...c,...b},this.moduleBindings[i]={...f,...T}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindingValues(){const e={};for(const t of Object.values(this.moduleBindings))Object.assign(e,t);return e}getDebugTable(){var t;const e={};for(const[n,i]of Object.entries(this.moduleUniforms))for(const[o,s]of Object.entries(i))e[`${n}.${o}`]={type:(t=this.modules[n].uniformTypes)==null?void 0:t[o],value:String(s)};return e}_addModule(e){const t=e.name;this.moduleUniforms[t]=e.defaultUniforms||{},this.moduleBindings[t]={}}}let PJ="";async function RJ(r,e){const t=new Image;return t.crossOrigin="anonymous",t.src=r.startsWith("http")?r:PJ+r,await t.decode(),e?await createImageBitmap(t,e):await createImageBitmap(t)}class lb{constructor(e,t){V(this,"device");V(this,"id");V(this,"texture");V(this,"sampler");V(this,"view");V(this,"ready");V(this,"isReady",!1);V(this,"destroyed",!1);V(this,"resolveReady",()=>{});V(this,"rejectReady",()=>{});this.device=e,this.id=t.id||lh("async-texture"),typeof(t==null?void 0:t.data)=="string"&&t.dimension==="2d"&&(t={...t,data:RJ(t.data)}),this.ready=new Promise((n,i)=>{this.resolveReady=()=>{this.isReady=!0,n()},this.rejectReady=i}),this.initAsync(t)}get[Symbol.toStringTag](){return"AsyncTexture"}toString(){return`AsyncTexture:"${this.id}"(${this.isReady?"ready":"loading"})`}async initAsync(e){let t,n;const i=e.data,o=await G6(i).then(t,n);if(this.destroyed)return;const s={...e,data:o};this.texture=this.device.createTexture(s),this.sampler=this.texture.sampler,this.view=this.texture.view,this.isReady=!0}destroy(){this.texture&&(this.texture.destroy(),this.texture=null),this.destroyed=!0}resize(e){if(!this.isReady)throw new Error("Cannot resize texture before it is ready");if(e.width===this.texture.width&&e.height===this.texture.height)return!1;if(this.texture){const t=this.texture;this.texture=t.clone(e),t.destroy()}return!0}}async function G6(r){if(r=await r,Array.isArray(r))return await Promise.all(r.map(G6));if(r&&typeof r=="object"&&r.constructor===Object){const e=r,t=await Promise.all(Object.values(e)),n=Object.keys(e),i={};for(let o=0;o<n.length;o++)i[n[o]]=t[o];return i}return r}const Mf=2,FJ=1e4,iy=class iy{constructor(e,t){V(this,"device");V(this,"id");V(this,"source");V(this,"vs");V(this,"fs");V(this,"pipelineFactory");V(this,"shaderFactory");V(this,"userData",{});V(this,"parameters");V(this,"topology");V(this,"bufferLayout");V(this,"isInstanced");V(this,"instanceCount",0);V(this,"vertexCount");V(this,"indexBuffer",null);V(this,"bufferAttributes",{});V(this,"constantAttributes",{});V(this,"bindings",{});V(this,"uniforms",{});V(this,"vertexArray");V(this,"transformFeedback",null);V(this,"pipeline");V(this,"shaderInputs");V(this,"_uniformStore");V(this,"_attributeInfos",{});V(this,"_gpuGeometry",null);V(this,"_getModuleUniforms");V(this,"props");V(this,"_pipelineNeedsUpdate","newly created");V(this,"_needsRedraw","initializing");V(this,"_destroyed",!1);V(this,"_lastDrawTimestamp",-1);V(this,"_lastLogTime",0);V(this,"_logOpen",!1);V(this,"_drawCount",0);var f,y,b,T;this.props={...iy.defaultProps,...t},t=this.props,this.id=t.id||lh("model"),this.device=e,Object.assign(this.userData,t.userData);const n=Object.fromEntries(((f=this.props.modules)==null?void 0:f.map(S=>[S.name,S]))||[]),i=t.shaderInputs||new MJ(n,{disableWarnings:this.props.disableWarnings});this.setShaderInputs(i);const o=DJ(e),s=(((y=this.props.modules)==null?void 0:y.length)>0?this.props.modules:(b=this.shaderInputs)==null?void 0:b.getModules())||[];if(this.device.type==="webgpu"&&this.props.source){const{source:S,getUniforms:D}=this.props.shaderAssembler.assembleWGSLShader({platformInfo:o,...this.props,modules:s});this.source=S,this._getModuleUniforms=D,(T=this.props).shaderLayout||(T.shaderLayout=oH(this.source))}else{const{vs:S,fs:D,getUniforms:k}=this.props.shaderAssembler.assembleGLSLShaderPair({platformInfo:o,...this.props,modules:s});this.vs=S,this.fs=D,this._getModuleUniforms=k}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,t.geometry&&this.setGeometry(t.geometry),this.pipelineFactory=t.pipelineFactory||D2.getDefaultPipelineFactory(this.device),this.shaderFactory=t.shaderFactory||L2.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),"isInstanced"in t&&(this.isInstanced=t.isInstanced),t.instanceCount&&this.setInstanceCount(t.instanceCount),t.vertexCount&&this.setVertexCount(t.vertexCount),t.indexBuffer&&this.setIndexBuffer(t.indexBuffer),t.attributes&&this.setAttributes(t.attributes),t.constantAttributes&&this.setConstantAttributes(t.constantAttributes),t.bindings&&this.setBindings(t.bindings),t.uniforms&&this.setUniformsWebGL(t.uniforms),t.moduleSettings&&this.updateModuleSettingsWebGL(t.moduleSettings),t.transformFeedback&&(this.transformFeedback=t.transformFeedback),Object.seal(this)}get[Symbol.toStringTag](){return"Model"}toString(){return`Model(${this.id})`}destroy(){var e;this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),(e=this._gpuGeometry)==null||e.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||(this._needsRedraw=e)}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){const t=this._areBindingsLoading();if(t)return Yt.info(Mf,`>>> DRAWING ABORTED ${this.id}: ${t} not loaded`)(),!1;try{e.pushDebugGroup(`${this}.predraw(${e})`),this.predraw()}finally{e.popDebugGroup()}let n;try{e.pushDebugGroup(`${this}.draw(${e})`),this._logDrawCallStart(),this.pipeline=this._updatePipeline();const i=this._getBindings();this.pipeline.setBindings(i,{disableWarnings:this.props.disableWarnings}),k2(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:o}=this.vertexArray,s=o?o.byteLength/(o.indexType==="uint32"?4:2):void 0;n=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,isInstanced:this.isInstanced,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:s,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{e.popDebugGroup(),this._logDrawCallEnd()}return this._logFramebuffer(e),n?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",n}setGeometry(e){var n;(n=this._gpuGeometry)==null||n.destroy();const t=e&&xJ(this.device,e);if(t){this.setTopology(t.topology||"triangle-list");const i=new Yv(this.bufferLayout);this.bufferLayout=i.mergeBufferLayouts(t.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(t)}this._gpuGeometry=t}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){const t=new Yv(this.bufferLayout);this.bufferLayout=this._gpuGeometry?t.mergeBufferLayouts(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){N2(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setInstanceCount(e){this.instanceCount=e,this.isInstanced===void 0&&e>0&&(this.isInstanced=!0),this.setNeedsRedraw("instanceCount")}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new xV(this.shaderInputs.modules);for(const[t,n]of Object.entries(this.shaderInputs.modules))if(OJ(n)){const i=this._uniformStore.getManagedUniformBuffer(this.device,t);this.bindings[`${t}Uniforms`]=i}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setBindings(this.shaderInputs.getBindingValues()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,t){const n=(t==null?void 0:t.disableWarnings)??this.props.disableWarnings;e.indices&&Yt.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();const i=new Yv(this.bufferLayout);for(const[o,s]of Object.entries(e)){const c=i.getBufferLayout(o);if(!c){n||Yt.warn(`Model(${this.id}): Missing layout for buffer "${o}".`)();continue}const f=i.getAttributeNamesForBuffer(c);let y=!1;for(const b of f){const T=this._attributeInfos[b];T&&(this.vertexArray.setBuffer(T.location,s),y=!0)}!y&&!n&&Yt.warn(`Model(${this.id}): Ignoring buffer "${s.id}" for unknown attribute "${o}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,t){for(const[n,i]of Object.entries(e)){const o=this._attributeInfos[n];o?this.vertexArray.setConstantWebGL(o.location,i):((t==null?void 0:t.disableWarnings)??this.props.disableWarnings)||Yt.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${n}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){this.setUniformsWebGL(e)}setUniformsWebGL(e){k2(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettingsWebGL(e){const{bindings:t,uniforms:n}=z6(this._getModuleUniforms(e));Object.assign(this.bindings,t),Object.assign(this.uniforms,n),this.setNeedsRedraw("moduleSettings")}_areBindingsLoading(){for(const e of Object.values(this.bindings))if(e instanceof lb&&!e.isReady)return e.id;return!1}_getBindings(){const e={};for(const[t,n]of Object.entries(this.bindings))n instanceof lb?n.isReady&&(e[t]=n.texture):e[t]=n;return e}_getBindingsUpdateTimestamp(){let e=0;for(const t of Object.values(this.bindings))t instanceof Zm?e=Math.max(e,t.texture.updateTimestamp):t instanceof ki||t instanceof Ni?e=Math.max(e,t.updateTimestamp):t instanceof lb?e=t.texture?Math.max(e,t.texture.updateTimestamp):1/0:t instanceof e_||(e=Math.max(e,t.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const t={...e.attributes};for(const[n]of Object.entries(t))!this.pipeline.shaderLayout.attributes.find(i=>i.name===n)&&n!=="positions"&&delete t[n];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(t,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||(this._pipelineNeedsUpdate=e),this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,t=null;this.pipeline&&(Yt.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,t=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const n=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debugShaders:this.props.debugShaders});let i=null;this.source?i=n:this.fs&&(i=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debugShaders:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,bindings:this._getBindings(),vs:n,fs:i}),this._attributeInfos=kD(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),t&&this.shaderFactory.release(t)}return this.pipeline}_logDrawCallStart(){const e=Yt.level>3?0:FJ;Yt.level<2||Date.now()-this._lastLogTime<e||(this._lastLogTime=Date.now(),this._logOpen=!0,Yt.group(Mf,`>>> DRAWING MODEL ${this.id}`,{collapsed:Yt.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=EJ(this.pipeline.shaderLayout,this.id);Yt.table(Mf,e)();const t=this.shaderInputs.getDebugTable();for(const[i,o]of Object.entries(this.uniforms))t[i]={value:o};Yt.table(Mf,t)();const n=this._getAttributeDebugTable();Yt.table(Mf,this._attributeInfos)(),Yt.table(Mf,n)(),Yt.groupEnd(Mf)(),this._logOpen=!1}}_logFramebuffer(e){const t=this.device.props.debugFramebuffers;if(this._drawCount++,!t)return;const n=e.props.framebuffer;n&&TJ(n,{id:n.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[t,n]of Object.entries(this._attributeInfos)){const i=this.vertexArray.attributes[n.location];e[n.location]={name:t,type:n.shaderType,values:i?this._getBufferOrConstantValues(i,n.bufferDataType):"null"}}if(this.vertexArray.indexBuffer){const{indexBuffer:t}=this.vertexArray,n=t.indexType==="uint32"?new Uint32Array(t.debugData):new Uint16Array(t.debugData);e.indices={name:"indices",type:t.indexType,values:n.toString()}}return e}_getBufferOrConstantValues(e,t){const n=GD(t);return(e instanceof ki?new n(e.debugData):e).toString()}};V(iy,"defaultProps",{...pA.defaultProps,source:void 0,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],isInstanced:void 0,instanceCount:0,vertexCount:0,shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:Ym.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0});let Bi=iy;function OJ(r){return!!(r.uniformTypes&&!k2(r.uniformTypes))}function DJ(r){return{type:r.type,shaderLanguage:r.info.shadingLanguage,shaderLanguageVersion:r.info.shadingLanguageVersion,gpu:r.info.gpu,features:r.features}}function k2(r){for(const e in r)return!1;return!0}const rg=class rg{constructor(e,t=rg.defaultProps){V(this,"device");V(this,"model");V(this,"transformFeedback");if(!rg.isSupported(e))throw new Error("BufferTransform not yet implemented on WebGPU");this.device=e,this.model=new Bi(this.device,{id:t.id||"buffer-transform-model",fs:t.fs||SD(),topology:t.topology||"point-list",varyings:t.outputs||t.varyings,...t}),this.transformFeedback=this.device.createTransformFeedback({layout:this.model.pipeline.shaderLayout,buffers:t.feedbackBuffers}),this.model.setTransformFeedback(this.transformFeedback),Object.seal(this)}static isSupported(e){var t;return((t=e==null?void 0:e.info)==null?void 0:t.type)==="webgl"}destroy(){this.model&&this.model.destroy()}delete(){this.destroy()}run(e){e!=null&&e.inputBuffers&&this.model.setAttributes(e.inputBuffers),e!=null&&e.outputBuffers&&this.transformFeedback.setBuffers(e.outputBuffers);const t=this.device.beginRenderPass(e);this.model.draw(t),t.end()}getBuffer(e){return this.transformFeedback.getBuffer(e)}readAsync(e){const t=this.getBuffer(e);if(!t)throw new Error("BufferTransform#getBuffer");if(t instanceof ki)return t.readAsync();const{buffer:n,byteOffset:i=0,byteLength:o=n.byteLength}=t;return n.readAsync(i,o)}};V(rg,"defaultProps",{...Bi.defaultProps,outputs:void 0,feedbackBuffers:void 0});let yA=rg;const LJ="transform_output";class ZS{constructor(e,t){V(this,"device");V(this,"model");V(this,"sampler");V(this,"currentIndex",0);V(this,"samplerTextureMap",null);V(this,"bindings",[]);V(this,"resources",{});this.device=e,this.sampler=e.createSampler({addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge",minFilter:"nearest",magFilter:"nearest",mipmapFilter:"nearest"}),this.model=new Bi(this.device,{id:t.id||"texture-transform-model",fs:t.fs||SD({input:t.targetTextureVarying,inputChannels:t.targetTextureChannels,output:LJ}),vertexCount:t.vertexCount,...t}),this._initialize(t),Object.seal(this)}destroy(){var e;this.model.destroy();for(const t of this.bindings)(e=t.framebuffer)==null||e.destroy()}delete(){this.destroy()}run(e){const{framebuffer:t}=this.bindings[this.currentIndex],n=this.device.beginRenderPass({framebuffer:t,...e});this.model.draw(n),n.end()}getTargetTexture(){const{targetTexture:e}=this.bindings[this.currentIndex];return e}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}_initialize(e){this._updateBindings(e)}_updateBindings(e){this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],e)}_updateBinding(e,{sourceBuffers:t,sourceTextures:n,targetTexture:i}){if(e||(e={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(e.sourceTextures,n),Object.assign(e.sourceBuffers,t),i){e.targetTexture=i;const{width:o,height:s}=i;e.framebuffer&&e.framebuffer.destroy(),e.framebuffer=this.device.createFramebuffer({id:"transform-framebuffer",width:o,height:s,colorAttachments:[i]}),e.framebuffer.resize({width:o,height:s})}return e}_setSourceTextureParameters(){const e=this.currentIndex,{sourceTextures:t}=this.bindings[e];for(const n in t)t[n].sampler=this.sampler}}class $s{constructor(e){V(this,"id");V(this,"topology");V(this,"vertexCount");V(this,"indices");V(this,"attributes");V(this,"userData",{});const{attributes:t={},indices:n=null,vertexCount:i=null}=e;this.id=e.id||lh("geometry"),this.topology=e.topology,n&&(this.indices=ArrayBuffer.isView(n)?{value:n,size:1}:n),this.attributes={};for(const[o,s]of Object.entries(t)){const c=ArrayBuffer.isView(s)?{value:s}:s;if(!ArrayBuffer.isView(c.value))throw new Error(`${this._print(o)}: must be typed array or object with value as typed array`);if((o==="POSITION"||o==="positions")&&!c.size&&(c.size=3),o==="indices"){if(this.indices)throw new Error("Multiple indices detected");this.indices=c}else this.attributes[o]=c}this.indices&&this.indices.isIndexed!==void 0&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=i||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){return this}_calculateVertexCount(e,t){if(t)return t.value.length;let n=1/0;for(const i of Object.values(e)){const{value:o,size:s,constant:c}=i;!c&&o&&s!==void 0&&s>=1&&(n=Math.min(n,o.length/s))}return n}}const NJ=`struct VertexInputs {
1948
1948
  @location(0) clipSpacePosition: vec2<f32>,
1949
1949
  @location(1) texCoord: vec2<f32>,
1950
1950
  @location(2) coordinate: vec2<f32>
@@ -4657,7 +4657,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) {
4657
4657
  }
4658
4658
  `,"vs:DECKGL_FILTER_COLOR":`
4659
4659
  color.a *= collision_fade;
4660
- `},z1e=r=>{if(!r||!("dummyCollisionMap"in r))return{};const{enabled:e,collisionFBO:t,drawToCollisionMap:n,dummyCollisionMap:i}=r;return{enabled:e&&!n,sort:!!n,collision_texture:!n&&t?t.colorAttachments[0]:i}},G1e={name:"collision",dependencies:[uy],vs:k1e,inject:U1e,getUniforms:z1e,uniformTypes:{sort:"i32",enabled:"i32"}};class V1e extends fy{renderCollisionMap(e,t){const i=[0,0,0,0],o=[1,1,e.width-2*1,e.height-2*1];this.render({...t,clearColor:i,scissorRect:o,target:e,pass:"collision"})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}getShaderModuleProps(){return{collision:{drawToCollisionMap:!0},picking:{isActive:1,isAttribute:!1},lighting:{enabled:!1}}}}const $1=2;class H1e{constructor(){this.id="collision-filter-effect",this.props=null,this.useInPicking=!0,this.order=1,this.channels={},this.collisionFBOs={}}setup(e){this.context=e;const{device:t}=e;this.dummyCollisionMap=t.createTexture({width:1,height:1}),this.collisionFilterPass=new V1e(t,{id:"default-collision-filter"})}preRender({effects:e,layers:t,layerFilter:n,viewports:i,onViewportActive:o,views:s,isPicking:c,preRenderStats:f={}}){var J;const{device:y}=this.context;if(c)return;const b=t.filter(({props:{visible:G,collisionEnabled:j}})=>G&&j);if(b.length===0){this.channels={};return}const T=e==null?void 0:e.filter(G=>G.useInPicking&&f[G.id]),S=(J=f["mask-effect"])==null?void 0:J.didRender,D=this._groupByCollisionGroup(y,b),k=i[0],z=!this.lastViewport||!this.lastViewport.equals(k)||S;for(const G in D){const j=this.collisionFBOs[G],K=D[G],[fe,Z]=y.canvasContext.getPixelSize();j.resize({width:fe/$1,height:Z/$1}),this._render(K,{effects:T,layerFilter:n,onViewportActive:o,views:s,viewport:k,viewportChanged:z})}}_render(e,{effects:t,layerFilter:n,onViewportActive:i,views:o,viewport:s,viewportChanged:c}){const{collisionGroup:f}=e,y=this.channels[f];if(!y)return;const b=c||e===y||!Ki(y.layers,e.layers,1)||e.layerBounds.some((T,S)=>!aa(T,y.layerBounds[S]))||e.allLayersLoaded!==y.allLayersLoaded||e.layers.some(T=>T.props.transitions);if(this.channels[f]=e,b){this.lastViewport=s;const T=this.collisionFBOs[f];this.collisionFilterPass.renderCollisionMap(T,{pass:"collision-filter",isPicking:!0,layers:e.layers,effects:t,layerFilter:n,viewports:s?[s]:[],onViewportActive:i,views:o,shaderModuleProps:{collision:{enabled:!0,dummyCollisionMap:this.dummyCollisionMap},project:{devicePixelRatio:T.device.canvasContext.getDevicePixelRatio()/$1}}})}}_groupByCollisionGroup(e,t){const n={};for(const i of t){const o=i.props.collisionGroup;let s=n[o];s||(s={collisionGroup:o,layers:[],layerBounds:[],allLayersLoaded:!0},n[o]=s),s.layers.push(i),s.layerBounds.push(i.getBounds()),i.isLoaded||(s.allLayersLoaded=!1)}for(const i of Object.keys(n))this.collisionFBOs[i]||this.createFBO(e,i),this.channels[i]||(this.channels[i]=n[i]);for(const i of Object.keys(this.collisionFBOs))n[i]||this.destroyFBO(i);return n}getShaderModuleProps(e){const{collisionGroup:t,collisionEnabled:n}=e.props,{collisionFBOs:i,dummyCollisionMap:o}=this,s=i[t];return{collision:{enabled:n&&!!s,collisionFBO:s,dummyCollisionMap:o}}}cleanup(){this.dummyCollisionMap&&(this.dummyCollisionMap.delete(),this.dummyCollisionMap=void 0),this.channels={};for(const e of Object.keys(this.collisionFBOs))this.destroyFBO(e);this.collisionFBOs={},this.lastViewport=void 0}createFBO(e,t){const{width:n,height:i}=e.gl.canvas,o=e.createTexture({format:"rgba8unorm",width:n,height:i,sampler:{minFilter:"nearest",magFilter:"nearest",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),s=e.createTexture({format:"depth16unorm",width:n,height:i,mipmaps:!1});this.collisionFBOs[t]=e.createFramebuffer({id:`collision-${t}`,width:n,height:i,colorAttachments:[o],depthStencilAttachment:s})}destroyFBO(e){var n,i;const t=this.collisionFBOs[e];(n=t.colorAttachments[0])==null||n.destroy(),(i=t.depthStencilAttachment)==null||i.destroy(),t.destroy(),delete this.collisionFBOs[e]}}const j1e={getCollisionPriority:{type:"accessor",value:0},collisionEnabled:!0,collisionGroup:{type:"string",value:"default"},collisionTestProps:{}};class cE extends gy{getShaders(){return{modules:[G1e]}}draw({shaderModuleProps:e}){var t;(t=e.collision)!=null&&t.drawToCollisionMap&&(this.props=this.clone(this.props.collisionTestProps).props)}initializeState(e,t){var i;if(this.getAttributeManager()===null)return;(i=this.context.deck)==null||i._addDefaultEffect(new H1e),this.getAttributeManager().add({collisionPriorities:{size:1,stepMode:"dynamic",accessor:"getCollisionPriority"}})}getNeedsPickingBuffer(){return this.props.collisionEnabled}}cE.defaultProps=j1e;cE.extensionName="CollisionFilterExtension";function $x(r,e){const t=e==null?void 0:e.globalFeatureId;return t!==void 0?$1e(r,t):W1e(r,e==null?void 0:e.type)}function $1e(r,e){const t=yk(r);for(const n of t){let i=0,o=n.featureIds.value[0];for(let s=0;s<n.featureIds.value.length;s++){const c=n.featureIds.value[s];if(c!==o){if(e===n.globalFeatureIds.value[i])return U_(n,i,s);i=s,o=c}}if(e===n.globalFeatureIds.value[i])return U_(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function W1e(r,e){const t=yk(r);return X1e(t)}function J1e(r,e,t){switch(r.type){case"Point":return Z1e(r,e,t);case"LineString":return q1e(r,e,t);case"Polygon":return vk(r,e,t);default:const n=r;throw new Error(`Unsupported geometry type: ${n==null?void 0:n.type}`)}}function yk(r,e){const t=[];return r.points&&(r.points.type="Point",t.push(r.points)),r.lines&&(r.lines.type="LineString",t.push(r.lines)),r.polygons&&(r.polygons.type="Polygon",t.push(r.polygons)),t}function X1e(r){const e=[];for(const t of r){if(t.featureIds.value.length===0)continue;let n=0,i=t.featureIds.value[0];for(let o=0;o<t.featureIds.value.length;o++){const s=t.featureIds.value[o];s!==i&&(e.push(U_(t,n,o)),n=o,i=s)}e.push(U_(t,n,t.featureIds.value.length))}return e}function U_(r,e,t){const n=J1e(r,e,t),i=Y1e(r,e),o=K1e(r,e);return{type:"Feature",geometry:n,properties:i,...o}}function K1e(r,e=0,t){return r.fields&&r.fields[r.featureIds.value[e]]}function Y1e(r,e=0,t){const n=Object.assign({},r.properties[r.featureIds.value[e]]);for(const i in r.numericProps)n[i]=r.numericProps[i].value[e];return n}function vk(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.polygonIndices.value.filter(f=>f>=e&&f<=t),o=r.primitivePolygonIndices.value.filter(f=>f>=e&&f<=t);if(!(i.length>2)){const f=[];for(let y=0;y<o.length-1;y++){const b=o[y],T=o[y+1],S=z_(n,b,T);f.push(S)}return{type:"Polygon",coordinates:f}}const c=[];for(let f=0;f<i.length-1;f++){const y=i[f],b=i[f+1],T=vk(r,y,b).coordinates;c.push(T)}return{type:"MultiPolygon",coordinates:c}}function q1e(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.pathIndices.value.filter(c=>c>=e&&c<=t);if(!(i.length>2))return{type:"LineString",coordinates:z_(n,i[0],i[1])};const s=[];for(let c=0;c<i.length-1;c++){const f=z_(n,i[c],i[c+1]);s.push(f)}return{type:"MultiLineString",coordinates:s}}function Z1e(r,e,t){const{positions:n}=r,i=z_(n,e,t);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function z_(r,e,t){e=e||0,t=t||r.value.length/r.size;const n=[];for(let i=e;i<t;i++){const o=Array();for(let s=i*r.size;s<(i+1)*r.size;s++)o.push(Number(r.value[s]));n.push(o)}return n}var Am={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var IF;function Q1e(){return IF||(IF=1,Am.read=function(r,e,t,n,i){var o,s,c=i*8-n-1,f=(1<<c)-1,y=f>>1,b=-7,T=t?i-1:0,S=t?-1:1,D=r[e+T];for(T+=S,o=D&(1<<-b)-1,D>>=-b,b+=c;b>0;o=o*256+r[e+T],T+=S,b-=8);for(s=o&(1<<-b)-1,o>>=-b,b+=n;b>0;s=s*256+r[e+T],T+=S,b-=8);if(o===0)o=1-y;else{if(o===f)return s?NaN:(D?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-y}return(D?-1:1)*s*Math.pow(2,o-n)},Am.write=function(r,e,t,n,i,o){var s,c,f,y=o*8-i-1,b=(1<<y)-1,T=b>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=n?0:o-1,k=n?1:-1,z=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=b):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+T>=1?e+=S/f:e+=S*Math.pow(2,1-T),e*f>=2&&(s++,f/=2),s+T>=b?(c=0,s=b):s+T>=1?(c=(e*f-1)*Math.pow(2,i),s=s+T):(c=e*Math.pow(2,T-1)*Math.pow(2,i),s=0));i>=8;r[t+D]=c&255,D+=k,c/=256,i-=8);for(s=s<<i|c,y+=i;y>0;r[t+D]=s&255,D+=k,s/=256,y-=8);r[t+D-k]|=z*128}),Am}var W1,MF;function e2e(){if(MF)return W1;MF=1,W1=e;var r=Q1e();function e(W){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(W)?W:new Uint8Array(W||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var t=65536*65536,n=1/t,i=12,o=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");e.prototype={destroy:function(){this.buf=null},readFields:function(W,ne,Te){for(Te=Te||this.length;this.pos<Te;){var qe=this.readVarint(),Ce=qe>>3,Ne=this.pos;this.type=qe&7,W(Ce,ne,this),this.pos===Ne&&this.skip(qe)}return ne},readMessage:function(W,ne){return this.readFields(W,ne,this.readVarint()+this.pos)},readFixed32:function(){var W=oe(this.buf,this.pos);return this.pos+=4,W},readSFixed32:function(){var W=ze(this.buf,this.pos);return this.pos+=4,W},readFixed64:function(){var W=oe(this.buf,this.pos)+oe(this.buf,this.pos+4)*t;return this.pos+=8,W},readSFixed64:function(){var W=oe(this.buf,this.pos)+ze(this.buf,this.pos+4)*t;return this.pos+=8,W},readFloat:function(){var W=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,W},readDouble:function(){var W=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,W},readVarint:function(W){var ne=this.buf,Te,qe;return qe=ne[this.pos++],Te=qe&127,qe<128||(qe=ne[this.pos++],Te|=(qe&127)<<7,qe<128)||(qe=ne[this.pos++],Te|=(qe&127)<<14,qe<128)||(qe=ne[this.pos++],Te|=(qe&127)<<21,qe<128)?Te:(qe=ne[this.pos],Te|=(qe&15)<<28,s(Te,W,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var W=this.readVarint();return W%2===1?(W+1)/-2:W/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var W=this.readVarint()+this.pos,ne=this.pos;return this.pos=W,W-ne>=i&&o?we(this.buf,ne,W):pe(this.buf,ne,W)},readBytes:function(){var W=this.readVarint()+this.pos,ne=this.buf.subarray(this.pos,W);return this.pos=W,ne},readPackedVarint:function(W,ne){if(this.type!==e.Bytes)return W.push(this.readVarint(ne));var Te=c(this);for(W=W||[];this.pos<Te;)W.push(this.readVarint(ne));return W},readPackedSVarint:function(W){if(this.type!==e.Bytes)return W.push(this.readSVarint());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readSVarint());return W},readPackedBoolean:function(W){if(this.type!==e.Bytes)return W.push(this.readBoolean());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readBoolean());return W},readPackedFloat:function(W){if(this.type!==e.Bytes)return W.push(this.readFloat());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readFloat());return W},readPackedDouble:function(W){if(this.type!==e.Bytes)return W.push(this.readDouble());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readDouble());return W},readPackedFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed32());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readFixed32());return W},readPackedSFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed32());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readSFixed32());return W},readPackedFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed64());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readFixed64());return W},readPackedSFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed64());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readSFixed64());return W},skip:function(W){var ne=W&7;if(ne===e.Varint)for(;this.buf[this.pos++]>127;);else if(ne===e.Bytes)this.pos=this.readVarint()+this.pos;else if(ne===e.Fixed32)this.pos+=4;else if(ne===e.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+ne)},writeTag:function(W,ne){this.writeVarint(W<<3|ne)},realloc:function(W){for(var ne=this.length||16;ne<this.pos+W;)ne*=2;if(ne!==this.length){var Te=new Uint8Array(ne);Te.set(this.buf),this.buf=Te,this.length=ne}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(W){this.realloc(4),Be(this.buf,W,this.pos),this.pos+=4},writeSFixed32:function(W){this.realloc(4),Be(this.buf,W,this.pos),this.pos+=4},writeFixed64:function(W){this.realloc(8),Be(this.buf,W&-1,this.pos),Be(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeSFixed64:function(W){this.realloc(8),Be(this.buf,W&-1,this.pos),Be(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeVarint:function(W){if(W=+W||0,W>268435455||W<0){y(W,this);return}this.realloc(4),this.buf[this.pos++]=W&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=W>>>7&127)))},writeSVarint:function(W){this.writeVarint(W<0?-W*2-1:W*2)},writeBoolean:function(W){this.writeVarint(!!W)},writeString:function(W){W=String(W),this.realloc(W.length*4),this.pos++;var ne=this.pos;this.pos=Ae(this.buf,W,this.pos);var Te=this.pos-ne;Te>=128&&S(ne,Te,this),this.pos=ne-1,this.writeVarint(Te),this.pos+=Te},writeFloat:function(W){this.realloc(4),r.write(this.buf,W,this.pos,!0,23,4),this.pos+=4},writeDouble:function(W){this.realloc(8),r.write(this.buf,W,this.pos,!0,52,8),this.pos+=8},writeBytes:function(W){var ne=W.length;this.writeVarint(ne),this.realloc(ne);for(var Te=0;Te<ne;Te++)this.buf[this.pos++]=W[Te]},writeRawMessage:function(W,ne){this.pos++;var Te=this.pos;W(ne,this);var qe=this.pos-Te;qe>=128&&S(Te,qe,this),this.pos=Te-1,this.writeVarint(qe),this.pos+=qe},writeMessage:function(W,ne,Te){this.writeTag(W,e.Bytes),this.writeRawMessage(ne,Te)},writePackedVarint:function(W,ne){ne.length&&this.writeMessage(W,D,ne)},writePackedSVarint:function(W,ne){ne.length&&this.writeMessage(W,k,ne)},writePackedBoolean:function(W,ne){ne.length&&this.writeMessage(W,G,ne)},writePackedFloat:function(W,ne){ne.length&&this.writeMessage(W,z,ne)},writePackedDouble:function(W,ne){ne.length&&this.writeMessage(W,J,ne)},writePackedFixed32:function(W,ne){ne.length&&this.writeMessage(W,j,ne)},writePackedSFixed32:function(W,ne){ne.length&&this.writeMessage(W,K,ne)},writePackedFixed64:function(W,ne){ne.length&&this.writeMessage(W,fe,ne)},writePackedSFixed64:function(W,ne){ne.length&&this.writeMessage(W,Z,ne)},writeBytesField:function(W,ne){this.writeTag(W,e.Bytes),this.writeBytes(ne)},writeFixed32Field:function(W,ne){this.writeTag(W,e.Fixed32),this.writeFixed32(ne)},writeSFixed32Field:function(W,ne){this.writeTag(W,e.Fixed32),this.writeSFixed32(ne)},writeFixed64Field:function(W,ne){this.writeTag(W,e.Fixed64),this.writeFixed64(ne)},writeSFixed64Field:function(W,ne){this.writeTag(W,e.Fixed64),this.writeSFixed64(ne)},writeVarintField:function(W,ne){this.writeTag(W,e.Varint),this.writeVarint(ne)},writeSVarintField:function(W,ne){this.writeTag(W,e.Varint),this.writeSVarint(ne)},writeStringField:function(W,ne){this.writeTag(W,e.Bytes),this.writeString(ne)},writeFloatField:function(W,ne){this.writeTag(W,e.Fixed32),this.writeFloat(ne)},writeDoubleField:function(W,ne){this.writeTag(W,e.Fixed64),this.writeDouble(ne)},writeBooleanField:function(W,ne){this.writeVarintField(W,!!ne)}};function s(W,ne,Te){var qe=Te.buf,Ce,Ne;if(Ne=qe[Te.pos++],Ce=(Ne&112)>>4,Ne<128||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<3,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<10,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<17,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<24,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&1)<<31,Ne<128))return f(W,Ce,ne);throw new Error("Expected varint not more than 10 bytes")}function c(W){return W.type===e.Bytes?W.readVarint()+W.pos:W.pos+1}function f(W,ne,Te){return Te?ne*4294967296+(W>>>0):(ne>>>0)*4294967296+(W>>>0)}function y(W,ne){var Te,qe;if(W>=0?(Te=W%4294967296|0,qe=W/4294967296|0):(Te=~(-W%4294967296),qe=~(-W/4294967296),Te^4294967295?Te=Te+1|0:(Te=0,qe=qe+1|0)),W>=18446744073709552e3||W<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ne.realloc(10),b(Te,qe,ne),T(qe,ne)}function b(W,ne,Te){Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos]=W&127}function T(W,ne){var Te=(W&7)<<4;ne.buf[ne.pos++]|=Te|((W>>>=3)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127)))))}function S(W,ne,Te){var qe=ne<=16383?1:ne<=2097151?2:ne<=268435455?3:Math.floor(Math.log(ne)/(Math.LN2*7));Te.realloc(qe);for(var Ce=Te.pos-1;Ce>=W;Ce--)Te.buf[Ce+qe]=Te.buf[Ce]}function D(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeVarint(W[Te])}function k(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeSVarint(W[Te])}function z(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeFloat(W[Te])}function J(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeDouble(W[Te])}function G(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeBoolean(W[Te])}function j(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeFixed32(W[Te])}function K(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeSFixed32(W[Te])}function fe(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeFixed64(W[Te])}function Z(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeSFixed64(W[Te])}function oe(W,ne){return(W[ne]|W[ne+1]<<8|W[ne+2]<<16)+W[ne+3]*16777216}function Be(W,ne,Te){W[Te]=ne,W[Te+1]=ne>>>8,W[Te+2]=ne>>>16,W[Te+3]=ne>>>24}function ze(W,ne){return(W[ne]|W[ne+1]<<8|W[ne+2]<<16)+(W[ne+3]<<24)}function pe(W,ne,Te){for(var qe="",Ce=ne;Ce<Te;){var Ne=W[Ce],Ge=null,Qe=Ne>239?4:Ne>223?3:Ne>191?2:1;if(Ce+Qe>Te)break;var rt,tt,lt;Qe===1?Ne<128&&(Ge=Ne):Qe===2?(rt=W[Ce+1],(rt&192)===128&&(Ge=(Ne&31)<<6|rt&63,Ge<=127&&(Ge=null))):Qe===3?(rt=W[Ce+1],tt=W[Ce+2],(rt&192)===128&&(tt&192)===128&&(Ge=(Ne&15)<<12|(rt&63)<<6|tt&63,(Ge<=2047||Ge>=55296&&Ge<=57343)&&(Ge=null))):Qe===4&&(rt=W[Ce+1],tt=W[Ce+2],lt=W[Ce+3],(rt&192)===128&&(tt&192)===128&&(lt&192)===128&&(Ge=(Ne&15)<<18|(rt&63)<<12|(tt&63)<<6|lt&63,(Ge<=65535||Ge>=1114112)&&(Ge=null))),Ge===null?(Ge=65533,Qe=1):Ge>65535&&(Ge-=65536,qe+=String.fromCharCode(Ge>>>10&1023|55296),Ge=56320|Ge&1023),qe+=String.fromCharCode(Ge),Ce+=Qe}return qe}function we(W,ne,Te){return o.decode(W.subarray(ne,Te))}function Ae(W,ne,Te){for(var qe=0,Ce,Ne;qe<ne.length;qe++){if(Ce=ne.charCodeAt(qe),Ce>55295&&Ce<57344)if(Ne)if(Ce<56320){W[Te++]=239,W[Te++]=191,W[Te++]=189,Ne=Ce;continue}else Ce=Ne-55296<<10|Ce-56320|65536,Ne=null;else{Ce>56319||qe+1===ne.length?(W[Te++]=239,W[Te++]=191,W[Te++]=189):Ne=Ce;continue}else Ne&&(W[Te++]=239,W[Te++]=191,W[Te++]=189,Ne=null);Ce<128?W[Te++]=Ce:(Ce<2048?W[Te++]=Ce>>6|192:(Ce<65536?W[Te++]=Ce>>12|224:(W[Te++]=Ce>>18|240,W[Te++]=Ce>>12&63|128),W[Te++]=Ce>>6&63|128),W[Te++]=Ce&63|128)}return Te}return W1}var t2e=e2e();const r2e=sh(t2e),n2e="4.2.4",bk={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:n2e,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};({...bk});const i2e={Point:xk,MultiPoint:s2e,LineString:wk,MultiLineString:o2e,Polygon:Ck,MultiPolygon:a2e};function xk([r,e],[t,n],i){const o=dc(t[0],n[0],r),s=dc(t[1],n[1],e);return i.unprojectFlat([o,s])}function lE(r,e,t){return r.map(n=>xk(n,e,t))}function s2e(r,e,t){return lE(r,e,t)}function wk(r,e,t){return lE(r,e,t)}function o2e(r,e,t){return r.map(n=>wk(n,e,t))}function Ck(r,e,t){return r.map(n=>lE(n,e,t))}function a2e(r,e,t){return r.map(n=>Ck(n,e,t))}function c2e(r,e,t){const n=t.projectFlat([e.west,e.north]),i=t.projectFlat([e.east,e.south]),o=[n,i];return{...r,coordinates:i2e[r.type](r.coordinates,o,t)}}const l2e=["points","lines","polygons"];function u2e(r,e,t,n){for(const i of l2e){const o=r[i]&&f2e(r[i],e,t,n);if(o>=0)return o}return-1}function f2e(r,e,t,n){const i=r.featureIds.value;if(!i.length)return-1;let o=0,s=i[i.length-1]+1;if(n){const f=h2e(r,n);if(f)o=f[0],s=f[1]+1;else return-1}let c=-1;if(e in r.numericProps){const f=r.numericProps[e].value.findIndex((y,b)=>y===t&&i[b]>=o&&i[b]<s);return f>=0?r.globalFeatureIds.value[f]:-1}else e?c=PF(r.properties,f=>f[e]===t,o,s):r.fields&&(c=PF(r.fields,f=>f.id===t,o,s));return c>=0?d2e(r,c):-1}function h2e(r,e){if(!r.__layers){const t={},{properties:n}=r;for(let i=0;i<n.length;i++){const{layerName:o}=n[i];o&&(t[o]?t[o][1]=i:t[o]=[i,i])}r.__layers=t}return r.__layers[e]}function d2e(r,e){if(!r.__ids){const t=[],n=r.featureIds.value,i=r.globalFeatureIds.value;for(let o=0;o<n.length;o++)t[n[o]]=i[o];r.__ids=t}return r.__ids[e]}function PF(r,e,t,n){for(let i=t;i<n;i++)if(e(r[i],i))return i;return-1}const J1=512,A2e={...Wl.defaultProps,data:M_,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[bk],binary:!0};class LA extends Xl{initializeState(){super.initializeState();const e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){var e;return!!((e=this.state)!=null&&e.data&&super.isLoaded)}updateState({props:e,oldProps:t,context:n,changeFlags:i}){var s;i.dataChanged&&this._updateTileData(),(s=this.state)!=null&&s.data&&(super.updateState({props:e,oldProps:t,context:n,changeFlags:i}),this._setWGS84PropertyForTiles());const{highlightColor:o}=e;o!==t.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,t=null;if(typeof e=="string"&&!yde(e)){const{onDataLoad:n,fetch:i}=this.props;this.setState({data:null,tileJSON:null});try{t=await i(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}n&&n(t,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(t=e);t&&(e=t.tiles),this.setState({data:e,tileJSON:t})}_getTilesetOptions(){const e=super._getTilesetOptions(),t=this.state.tileJSON,{minZoom:n,maxZoom:i}=this.props;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>n&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(i)||t.maxzoom<i)&&(e.maxZoom=t.maxzoom)),e}renderLayers(){var e;return(e=this.state)!=null&&e.data?super.renderLayers():null}getTileData(e){const{data:t,binary:n}=this.state,{index:i,signal:o}=e,s=th(t,e);if(!s)return Promise.reject("Invalid URL");let c=this.getLoadOptions();const{fetch:f}=this.props;return c={...c,mimeType:"application/x-protobuf",mvt:{...c==null?void 0:c.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:i},gis:n?{format:"binary"}:{}},f(s,{propName:"data",layer:this,loadOptions:c,signal:o})}renderSubLayers(e){const{x:t,y:n,z:i}=e.tile.index,o=Math.pow(2,i),s=J1/o,c=-s,f=J1*t/o,y=J1*(1-n/o),b=new dn().scale([s,c,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=b,e.coordinateOrigin=[f,y,0],e.coordinateSystem=Wr.CARTESIAN,e.extensions=[...e.extensions||[],new Xy]);const T=super.renderSubLayers(e);return this.state.binary&&!(T instanceof Wl)&&Jr.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),T}_updateAutoHighlight(e){const{uniqueIdProperty:t}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,o=e.object;let s=null,c=null;o&&(s=X1(o,t),c=RF(o));let{highlightColor:f}=this.props;typeof f=="function"&&(f=f(e)),(n!==s||i!==c)&&this.setState({highlightColor:f,hoveredFeatureId:s,hoveredFeatureLayerName:c})}_isWGS84(){return!!this.context.viewport.resolution}getPickingInfo(e){const t=super.getPickingInfo(e);if(this.state.binary&&t.index!==-1){const{data:n}=e.sourceLayer.props;t.object=$x(n,{globalFeatureId:t.index})}return t.object&&!this._isWGS84()&&(t.object=OF(t.object,t.tile.bbox,this.context.viewport)),t}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t,hoveredFeatureLayerName:n,binary:i}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,c=e.content,f=FF(s);if(!(FF(t)||f))return-1;const b=f?s:t;return Array.isArray(c)?c.findIndex(T=>{const S=X1(T,o)===b,D=f||RF(T)===n;return S&&D}):c&&i?u2e(c,o,b,f?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context,i=n.width,o=n.height,s=n.x,c=n.y,f=[this.id];return t.pickObjects({x:s,y:c,width:i,height:o,layerIds:f,maxObjects:e})}getRenderedFeatures(e=null){const t=this._pickObjects(e),n=new Set,i=[];for(const o of t){const s=X1(o.object,this.props.uniqueIdProperty);s===void 0?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}return i}_setWGS84PropertyForTiles(){const e="dataInWGS84";this.state.tileset.selectedTiles.forEach(n=>{n.hasOwnProperty(e)||Object.defineProperty(n,e,{get:()=>{if(!n.content)return null;if(this.state.binary&&Array.isArray(n.content)&&!n.content.length)return[];const{bbox:i}=n;if(n._contentWGS84===void 0&&vde(i)){const o=this.state.binary?$x(n.content):n.content;n._contentWGS84=o.map(s=>OF(s,i,this.context.viewport))}return n._contentWGS84}})})}}LA.layerName="MVTLayer";LA.defaultProps=A2e;function X1(r,e){if(r.properties&&e)return r.properties[e];if("id"in r)return r.id}function RF(r){var e;return((e=r.properties)==null?void 0:e.layerName)||null}function FF(r){return r!=null&&r!==""}function OF(r,e,t){const n={...r,geometry:{type:r.geometry.type}};return Object.defineProperty(n.geometry,"coordinates",{get:()=>c2e(r.geometry,e,t).coordinates}),n}const DF="0123456789bcdefghjkmnpqrstuvwxyz",Ek={};for(let r=0;r<DF.length;r++)Ek[DF.charAt(r)]=r;const p2e=-90,g2e=90,m2e=-180,_2e=180;function y2e(r){let e=!0,t=g2e,n=p2e,i=_2e,o=m2e,s,c=0;for(let f=0,y=r.length;f<y;f++){const b=r[f].toLowerCase();c=Ek[b];for(let T=4;T>=0;T--){const S=c>>T&1;e?(s=(i+o)/2,S===1?o=s:i=s):(s=(t+n)/2,S===1?n=s:t=s),e=!e}}return[n,o,t,i]}function v2e(r){const[e,t,n,i]=y2e(r);return[i,n,i,e,t,e,t,n,i,n]}const b2e={getGeohash:{type:"accessor",value:r=>r.geohash}};class Ky extends tf{indexToBounds(){const{data:e,getGeohash:t}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>v2e(t(n,i))}}}Ky.layerName="GeohashLayer";Ky.defaultProps=b2e;const x2e=Object.freeze(Object.defineProperty({__proto__:null,GeohashLayer:Ky,GreatCircleLayer:bC,H3ClusterLayer:ky,H3HexagonLayer:al,MVTLayer:LA,QuadkeyLayer:Ry,S2Layer:Py,TerrainLayer:aE,Tile3DLayer:oE,TileLayer:Xl,TripsLayer:Dy,_GeoCellLayer:tf,_Tile2DHeader:P8,_Tileset2D:Oy,_WMSLayer:vC,_getURLFromTemplate:th},Symbol.toStringTag,{value:"Module"}));var Sp={},K1,LF;function w2e(){if(LF)return K1;LF=1;var r=Math.PI/180,e=180/Math.PI;function t(j){var K=i(j[0]+1,j[2]),fe=i(j[0],j[2]),Z=o(j[1]+1,j[2]),oe=o(j[1],j[2]);return[fe,Z,K,oe]}function n(j){var K=t(j),fe={type:"Polygon",coordinates:[[[K[0],K[1]],[K[0],K[3]],[K[2],K[3]],[K[2],K[1]],[K[0],K[1]]]]};return fe}function i(j,K){return j/Math.pow(2,K)*360-180}function o(j,K){var fe=Math.PI-2*Math.PI*j/Math.pow(2,K);return e*Math.atan(.5*(Math.exp(fe)-Math.exp(-fe)))}function s(j,K,fe){var Z=G(j,K,fe);return Z[0]=Math.floor(Z[0]),Z[1]=Math.floor(Z[1]),Z}function c(j){return[[j[0]*2,j[1]*2,j[2]+1],[j[0]*2+1,j[1]*2,j[2]+1],[j[0]*2+1,j[1]*2+1,j[2]+1],[j[0]*2,j[1]*2+1,j[2]+1]]}function f(j){return j[0]%2===0&&j[1]%2===0?[j[0]/2,j[1]/2,j[2]-1]:j[0]%2===0&&!j[1]%2===0?[j[0]/2,(j[1]-1)/2,j[2]-1]:!j[0]%2===0&&j[1]%2===0?[(j[0]-1)/2,j[1]/2,j[2]-1]:[(j[0]-1)/2,(j[1]-1)/2,j[2]-1]}function y(j){return c(f(j))}function b(j,K){for(var fe=y(j),Z=0;Z<fe.length;Z++)if(!T(K,fe[Z]))return!1;return!0}function T(j,K){for(var fe=0;fe<j.length;fe++)if(S(j[fe],K))return!0;return!1}function S(j,K){return j[0]===K[0]&&j[1]===K[1]&&j[2]===K[2]}function D(j){for(var K="",fe=j[2];fe>0;fe--){var Z=0,oe=1<<fe-1;(j[0]&oe)!==0&&Z++,(j[1]&oe)!==0&&(Z+=2),K+=Z.toString()}return K}function k(j){for(var K=0,fe=0,Z=j.length,oe=Z;oe>0;oe--){var Be=1<<oe-1;switch(j[Z-oe]){case"0":break;case"1":K|=Be;break;case"2":fe|=Be;break;case"3":K|=Be,fe|=Be;break}}return[K,fe,Z]}function z(j){var K=s(j[0],j[1],32),fe=s(j[2],j[3],32),Z=[K[0],K[1],fe[0],fe[1]],oe=J(Z);if(oe===0)return[0,0,0];var Be=Z[0]>>>32-oe,ze=Z[1]>>>32-oe;return[Be,ze,oe]}function J(j){for(var K=28,fe=0;fe<K;fe++){var Z=1<<32-(fe+1);if((j[0]&Z)!=(j[2]&Z)||(j[1]&Z)!=(j[3]&Z))return fe}return K}function G(j,K,fe){var Z=Math.sin(K*r),oe=Math.pow(2,fe),Be=oe*(j/360+.5),ze=oe*(.5-.25*Math.log((1+Z)/(1-Z))/Math.PI);return[Be,ze,fe]}return K1={tileToGeoJSON:n,tileToBBOX:t,getChildren:c,getParent:f,getSiblings:y,hasTile:T,hasSiblings:b,tilesEqual:S,tileToQuadkey:D,quadkeyToTile:k,pointToTile:s,bboxToTile:z,pointToTileFraction:G},K1}var NF;function C2e(){if(NF)return Sp;NF=1;var r=w2e();Sp.geojson=function(b,T){return{type:"FeatureCollection",features:t(b,T).map(e)}};function e(b){return{type:"Feature",geometry:r.tileToGeoJSON(b),properties:{}}}Sp.tiles=t,Sp.indexes=function(b,T){return t(b,T).map(r.tileToQuadkey)};function t(b,T){var S,D,k=b.coordinates,z=T.max_zoom,J={},G=[];if(b.type==="Point")return[r.pointToTile(k[0],k[1],z)];if(b.type==="MultiPoint")for(S=0;S<k.length;S++)D=r.pointToTile(k[S][0],k[S][1],z),J[f(D[0],D[1],D[2])]=!0;else if(b.type==="LineString")s(J,k,z);else if(b.type==="MultiLineString")for(S=0;S<k.length;S++)s(J,k[S],z);else if(b.type==="Polygon")i(J,G,k,z);else if(b.type==="MultiPolygon")for(S=0;S<k.length;S++)i(J,G,k[S],z);else throw new Error("Geometry type not implemented");if(T.min_zoom!==z){var j=G.length;for(c(J,G),S=0;S<j;S++){var K=G[S];J[f(K[0],K[1],K[2])]=!0}return n(J,G,T)}return c(J,G),G}function n(b,T,S){for(var D=[],k=S.max_zoom;k>S.min_zoom;k--){for(var z={},J=[],G=0;G<T.length;G++){var j=T[G];if(j[0]%2===0&&j[1]%2===0){var K=f(j[0]+1,j[1],k),fe=f(j[0],j[1]+1,k),Z=f(j[0]+1,j[1]+1,k);if(b[K]&&b[fe]&&b[Z]){b[f(j[0],j[1],j[2])]=!1,b[K]=!1,b[fe]=!1,b[Z]=!1;var oe=[j[0]/2,j[1]/2,k-1];k-1===S.min_zoom?D.push(oe):(z[f(j[0]/2,j[1]/2,k-1)]=!0,J.push(oe))}}}for(G=0;G<T.length;G++)j=T[G],b[f(j[0],j[1],j[2])]&&D.push(j);b=z,T=J}return D}function i(b,T,S,D){for(var k=[],z=0;z<S.length;z++){var J=[];s(b,S[z],D,J);for(var G=0,j=J.length,K=j-1;G<j;K=G++){var fe=(G+1)%j,Z=J[G][1];(Z>J[K][1]||Z>J[fe][1])&&(Z<J[K][1]||Z<J[fe][1])&&Z!==J[fe][1]&&k.push(J[G])}}for(k.sort(o),z=0;z<k.length;z+=2){Z=k[z][1];for(var oe=k[z][0]+1;oe<k[z+1][0];oe++){var Be=f(oe,Z,D);b[Be]||T.push([oe,Z,D])}}}function o(b,T){return b[1]-T[1]||b[0]-T[0]}function s(b,T,S,D){for(var k,z,J=0;J<T.length-1;J++){var G=r.pointToTileFraction(T[J][0],T[J][1],S),j=r.pointToTileFraction(T[J+1][0],T[J+1][1],S),K=G[0],fe=G[1],Z=j[0],oe=j[1],Be=Z-K,ze=oe-fe;if(!(ze===0&&Be===0)){var pe=Be>0?1:-1,we=ze>0?1:-1,Ae=Math.floor(K),W=Math.floor(fe),ne=Be===0?1/0:Math.abs(((Be>0?1:0)+Ae-K)/Be),Te=ze===0?1/0:Math.abs(((ze>0?1:0)+W-fe)/ze),qe=Math.abs(pe/Be),Ce=Math.abs(we/ze);for((Ae!==k||W!==z)&&(b[f(Ae,W,S)]=!0,D&&W!==z&&D.push([Ae,W]),k=Ae,z=W);ne<1||Te<1;)ne<Te?(ne+=qe,Ae+=pe):(Te+=Ce,W+=we),b[f(Ae,W,S)]=!0,D&&W!==z&&D.push([Ae,W]),k=Ae,z=W}}D&&W===D[0][1]&&D.pop()}function c(b,T){for(var S=Object.keys(b),D=0;D<S.length;D++)T.push(y(+S[D]))}function f(b,T,S){var D=2*(1<<S);return(D*T+b)*32+S}function y(b){var T=b%32,S=2*(1<<T),D=(b-T)/32,k=D%S,z=(D-k)/S%S;return[k,z,T]}return Sp}C2e();const Tk=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Bk=[0n,1n,2n,4n,8n,16n];function E2e(r){return BigInt(`0x${r}`)}function Wx(r){return r.toString(16)}function T2e(r){if(r.z<0||r.z>26)throw new Error("Wrong zoom");const e=BigInt(r.z);let t=BigInt(r.x)<<32n-e,n=BigInt(r.y)<<32n-e;for(let o=0;o<5;o++){const s=Bk[5-o],c=Tk[4-o];t=(t|t<<s)&c,n=(n|n<<s)&c}return 0x4000000000000000n|1n<<59n|e<<52n|(t|n<<1n)>>12n|0xfffffffffffffn>>e*2n}function Sk(r){const e=r>>59n&7n,t=r>>57n&3n,n=r>>52n&0x1fn,i=(r&0xfffffffffffffn)<<12n;if(e!==1n&&t!==0n)throw new Error("Wrong mode");let o=i,s=i>>1n;for(let c=0;c<6;c++){const f=Bk[c],y=Tk[c];o=(o|o>>f)&y,s=(s|s>>f)&y}return o=o>>32n-n,s=s>>32n-n,{z:Number(n),x:Number(o),y:Number(s)}}function uE(r){return r>>52n&0x1fn}function Ik(r){const e=uE(r)-1n;return r&~(0x1fn<<52n)|e<<52n|0xfffffffffffffn>>e*2n}function B2e(r,e,t,n=[],i,o){var f;if(!r.content)return!1;r.userData||(r.userData={});const s=(f=e.get(t))==null?void 0:f[0];if(s){if(n.every(y=>y.name in s))return!1;e.clear()}const c={};for(const y of r.content){let b=y.id;const T=typeof i=="function"?i(y,{}):i;for(let J=0;J<t-1;J++)b=Ik(b);const S=Number(b);if(!(S in c)){c[S]={id:b,count:0,position:[0,0]};for(const{name:J,aggregation:G}of n)G==="any"?c[S][J]=y.properties[J]:c[S][J]=0}const D=c[S].count;c[S].count+=typeof o=="function"?o(y,{}):o;const k=c[S].count,z=k-D;c[S].position[0]=(D*c[S].position[0]+z*T[0])/k,c[S].position[1]=(D*c[S].position[1]+z*T[1])/k;for(const{name:J,aggregation:G}of n){const j=c[S][J],K=y.properties[J];G==="average"?c[S][J]=(D*j+z*K)/k:G==="count"||G==="sum"?c[S][J]=j+K:G==="max"?c[S][J]=Math.max(j,K):G==="min"&&(c[S][J]=Math.min(j,K))}}return e.set(t,Object.values(c)),!0}function S2e(r){const e=[],t=["any","average","count","min","max","sum"];for(const n of Object.keys(r.content[0].properties)){let i=n.split("_").pop().toLowerCase();t.includes(i)||(Jr.warn(`No valid aggregation present in ${n} property`)(),i="any"),e.push({name:n,aggregation:i})}return e}function I2e(r,e){const t={};for(const{name:n,aggregation:i}of e)if(t[n]={min:1/0,max:-1/0},i!=="any")for(const o of r)t[n].min=Math.min(t[n].min,o[n]),t[n].max=Math.max(t[n].max,o[n]);return t}const eg=new Uint16Array,kF={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:eg,size:1},globalFeatureIds:{value:eg,size:1}};function M2e(r){const e=new Float32Array(r.length*2),t=new Uint16Array(r.length);for(let n=0;n<r.length;n++)e.set(r[n].position,2*n),t[n]=n;return{shape:"binary-feature-collection",points:{type:"Point",positions:{value:e,size:2},properties:r,numericProps:{},featureIds:{value:t,size:1},globalFeatureIds:{value:t,size:1}},lines:{type:"LineString",pathIndices:{value:eg,size:1},...kF},polygons:{type:"Polygon",polygonIndices:{value:eg,size:1},primitivePolygonIndices:{value:eg,size:1},...kF}}}const NA=512;class fE extends Oy{getTileIndices(e){return super.getTileIndices(e).map(T2e).map(t=>({q:t,i:Wx(t)}))}getTileId({q:e,i:t}){return t||Wx(e)}getTileMetadata({q:e}){return super.getTileMetadata(Sk(e))}getTileZoom({q:e}){return Number(uE(e))}getParentIndex({q:e}){return{q:Ik(e)}}}const UF=512;function Mk(r){const{x:e,y:t,z:n}=Sk(r),i=UF/(1<<n);return[e*i,UF-t*i,i]}function P2e(r,e){const[t,n,i]=Mk(r);return[[t,n],[t+e*i,n-e*i]]}function Pk(r,e=1){const[t,n]=P2e(r,e),[i,o]=tl(t),[s,c]=tl(n);return[s,o,s,c,i,c,i,o,s,o]}const pm=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),zF=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);zF&&parseFloat(zF[1]);function R2e(r){var e;globalThis.loaders||(globalThis.loaders={}),(e=globalThis.loaders).modules||(e.modules={}),Object.assign(globalThis.loaders.modules,r)}function F2e(...r){return O2e(r)}function O2e(r){const e=r.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),t=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(t);let i=0;for(const o of e)n.set(o,i),i+=o.byteLength;return n.buffer}async function D2e(r){const e=[];for await(const t of r)e.push(t);return F2e(...e)}function L2e(r){return r&&typeof r=="object"&&r.isBuffer}function gm(r){if(L2e(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){const e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function mm(r){return e=>new Promise((t,n)=>r(e,(i,o)=>i?n(i):t(o)))}class N2e{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){R2e(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,t){return await this.preload(),this.decompressSync(e,t)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,t){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){const t=await this.concatenate(e);yield this.compress(t)}async*decompressBatches(e){const t=await this.concatenate(e);yield this.decompress(t)}concatenate(e){return D2e(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}}class k2e extends N2e{constructor(t={}){super(t);V(this,"name","deflate");V(this,"extensions",[]);V(this,"contentEncodings",["deflate"]);V(this,"isSupported",!0);V(this,"options");V(this,"_chunks",[]);this.options=t}async compress(t){var n,i;if(!pm&&((n=this.options.deflate)!=null&&n.useZlib)){const o=(i=this.options.deflate)!=null&&i.gzip?await mm(bu.gzip)(t):await mm(bu.deflate)(t);return gm(o)}return this.compressSync(t)}async decompress(t){var n,i;if(!pm&&((n=this.options.deflate)!=null&&n.useZlib)){const o=(i=this.options.deflate)!=null&&i.gzip?await mm(bu.gunzip)(t):await mm(bu.inflate)(t);return gm(o)}return this.decompressSync(t)}compressSync(t){var s,c,f,y;if(!pm&&((s=this.options.deflate)!=null&&s.useZlib)){const b=(c=this.options.deflate)!=null&&c.gzip?bu.gzipSync(t):bu.deflateSync(t);return gm(b)}const n=((f=this.options)==null?void 0:f.deflate)||{},i=new Uint8Array(t);return((y=this.options)!=null&&y.raw?Id.deflateRaw:Id.deflate)(i,n).buffer}decompressSync(t){var s,c,f,y;if(!pm&&((s=this.options.deflate)!=null&&s.useZlib)){const b=(c=this.options.deflate)!=null&&c.gzip?bu.gunzipSync(t):bu.inflateSync(t);return gm(b)}const n=((f=this.options)==null?void 0:f.deflate)||{},i=new Uint8Array(t);return((y=this.options)!=null&&y.raw?Id.inflateRaw:Id.inflate)(i,n).buffer}async*compressBatches(t){var o;const n=((o=this.options)==null?void 0:o.deflate)||{},i=new Id.Deflate(n);yield*this.transformBatches(i,t)}async*decompressBatches(t){var o;const n=((o=this.options)==null?void 0:o.deflate)||{},i=new Id.Inflate(n);yield*this.transformBatches(i,t)}async*transformBatches(t,n){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(const s of n){const c=new Uint8Array(s);if(!t.push(c,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}const i=new Uint8Array(0);t.push(i,!0),yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){const t=this._chunks;return this._chunks=[],t}_getError(t=0){const n={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${n[t]}`}}class U2e extends k2e{constructor(t){super({...t,deflate:{...t==null?void 0:t.gzip,gzip:!0}});V(this,"name","gzip");V(this,"extensions",["gz","gzip"]);V(this,"contentEncodings",["gzip","x-gzip"]);V(this,"isSupported",!0)}}function Yy(r,e,t,n){const i=e.type===2?e.readVarint()+e.pos:e.pos+1,o=e.buf.buffer.slice(e.pos,i);if((n==null?void 0:n.compression)==="gzip"){const c=new U2e().decompressSync(o);t.value=new r(c)}else t.value=new r(o);return e.pos=i,t.value}class hE{static read(e,t){return e.readFields(hE._readField,{key:"",value:null},t)}static _readField(e,t,n){e===1?t.key=n.readString():e===2&&(t.value=n.readString())}}class mh{static read(e,t){return e.readFields(mh._readField,{},t)}static _readField(e,t,n){if(e===1){const{key:i,value:o}=hE.read(n,n.readVarint()+n.pos);t[i]=o}}}class zg{static read(e,t){const{value:n,size:i}=e.readFields(zg._readField,{value:[],size:0},t);return{value:n,size:i}}static _readField(e,t,n){e===1?Yy(Float64Array,n,t):e===2&&(t.size=n.readVarint(!0))}}class Ba{static read(e,t){const{value:n,size:i}=e.readFields(Ba._readField,{value:[],size:0},t);return{value:new Uint32Array(n),size:i}}static _readField(e,t,n){e===1?n.readPackedVarint(t.value):e===2&&(t.size=n.readVarint(!0))}}class Gg{static read(e,t){return e.readFields(Gg._readField,{id:0},t)}static _readField(e,t,n){e===1&&(t.id=n.readVarint())}}class dE{static read(e,t){return e.readFields(dE._readField,{value:[]},t)}static _readField(e,t,n){e===1&&Yy(Float64Array,n,t)}}class _h{static read(e,t){return e.readFields(_h._readField,{key:"",value:null},t)}static _readField(e,t,n){e===1?t.key=n.readString():e===2&&(t.value=dE.read(n,n.readVarint()+n.pos))}}class AE{static read(e,t){return e.readFields(AE._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},t)}static _readField(e,t,n){if(e===1)t.positions=zg.read(n,n.readVarint()+n.pos);else if(e===2)t.globalFeatureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===3)t.featureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===4)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===5){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}else e===6&&t.fields.push(Gg.read(n,n.readVarint()+n.pos))}}class pE{static read(e,t){return e.readFields(pE._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},t)}static _readField(e,t,n){if(e===1)t.positions=zg.read(n,n.readVarint()+n.pos);else if(e===2)t.pathIndices=Ba.read(n,n.readVarint()+n.pos);else if(e===3)t.globalFeatureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===4)t.featureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===5)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===6){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}else e===7&&t.fields.push(Gg.read(n,n.readVarint()+n.pos))}}class gE{static read(e,t){return e.readFields(gE._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},t)}static _readField(e,t,n){if(e===1)t.positions=zg.read(n,n.readVarint()+n.pos);else if(e===2)t.polygonIndices=Ba.read(n,n.readVarint()+n.pos);else if(e===3)t.globalFeatureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===4)t.featureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===5)t.primitivePolygonIndices=Ba.read(n,n.readVarint()+n.pos);else if(e===6)t.triangles=Ba.read(n,n.readVarint()+n.pos);else if(e===7)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===8){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}else e===9&&t.fields.push(Gg.read(n,n.readVarint()+n.pos))}}let z2e=class Rk{static read(e,t){return e.readFields(Rk._readField,{points:null,lines:null,polygons:null},t)}static _readField(e,t,n){e===1?t.points=AE.read(n,n.readVarint()+n.pos):e===2?t.lines=pE.read(n,n.readVarint()+n.pos):e===3&&(t.polygons=gE.read(n,n.readVarint()+n.pos))}};class mE{static read(e,t){return e.readFields(mE._readField,{value:[]},t)}static _readField(e,t,n){e===1&&Yy(BigUint64Array,n,t)}}class _E{static read(e,t){return e.readFields(_E._readField,{indices:null,properties:[],numericProps:{}},t)}static _readField(e,t,n){if(e===1)t.indices=mE.read(n,n.readVarint()+n.pos);else if(e===2)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===3){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}}}let G2e=class Fk{static read(e,t){return e.readFields(Fk._readField,{scheme:0,cells:null},t)}static _readField(e,t,n){e===1?t.scheme=n.readVarint():e===2&&(t.cells=_E.read(n,n.readVarint()+n.pos))}};function qy(r,e){const t=new r2e(r);return e.read(t)}function nh(r,e){Jr.assert(r,e)}function V2e(r,e){const{properties:t,numericProps:n}=r;return new Proxy(t[e]||{},{get(i,o){return o in n?n[o].value[e]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function Zy(r,e){return`https://unpkg.com/@deck.gl/carto@${e}/dist/${r}-worker.js`}function H2e(r){const{cells:e,scheme:t}=r,n=e.indices.value.length,i=[];for(let o=0;o<n;o++){const s=t==="h3"?Wx(e.indices.value[o]):e.indices.value[o],c={...e.properties[o]};for(const f of Object.keys(e.numericProps))c[f]=e.numericProps[f].value[o];i.push({id:s,properties:c})}return i}const Ok="9.1.7",Dk="cartoSpatialTile",j2e={cartoSpatialTile:{scheme:"quadbin",workerUrl:Zy(Dk,Ok)}},Lk={name:"CARTO Spatial Tile",version:Ok,id:Dk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(r,e)=>GF(r,e),parseSync:GF,worker:!0,options:j2e};function GF(r,e){var s;if(!r)return null;const t=qy(r,G2e),{cells:n}=t,i=(s=e==null?void 0:e.cartoSpatialTile)==null?void 0:s.scheme;return H2e({cells:n,scheme:i})}function Vg(r,e){var t,n,i;(n=(t=r==null?void 0:r.fetch)==null?void 0:t.headers)!=null&&n.Authorization||(r.fetch={...r.fetch,headers:{...(i=r.fetch)==null?void 0:i.headers,Authorization:`Bearer ${e}`}})}function $2e(r,e){const t={};for(const{geoid:n,...i}of e.properties)n in t?Jr.warn("Duplicate geoid key in boundary mapping, using first occurance")():t[n]=i;for(const n of["points","lines","polygons"]){const i=r[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:y})=>t[y]);const{positions:o,globalFeatureIds:s}=i;let c=null;n==="lines"&&(c=i.pathIndices.value),n==="polygons"&&(c=i.polygonIndices.value);const f=o.value.length/o.size;for(const y in e.numericProps){const b=e.numericProps[y].value,T=b.constructor,S=new T(f);if(i.numericProps[y]={value:S,size:1},c)for(let D=0;D<c.length-1;D++){const k=c[D],z=c[D+1],J=s.value[k];S.fill(b[J],k,z)}else for(let D=0;D<f;D++){const k=s.value[D];S[D]=b[k]}}}return r}const ih={type:"object",value:null,validate:(r,e)=>e.optional&&r===null||typeof r=="object"&&Array.isArray(r.tiles)&&r.tiles.every(t=>typeof t=="string"),equal:(r,e)=>Ki(r,e,2),async:!0};Ig([Lk]);const Nk={data:ih,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:r})=>Pk(r,.5).slice(2,4)},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:NA};class yE extends Xl{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap}renderLayers(){var S;const e=(S=this.state.tileset)==null?void 0:S.tiles.filter(D=>D.isLoaded&&D.content&&this.state.tileset.isTileVisible(D));if(!(e!=null&&e.length))return null;e.sort((D,k)=>k.zoom-D.zoom);const{zoom:t}=this.context.viewport,{clusterLevel:n,getPosition:i,getWeight:o}=this.props,{aggregationCache:s}=this.state,c=S2e(e[0]),f=[];let y=!1;for(const D of e){const k=Math.round(t-D.zoom),z=Math.round(n)-k;let J=s.get(D.content);J||(J=new Map,s.set(D.content,J));const G=B2e(D,J,z,c,i,o);y||(y=G),f.push(...J.get(z))}f.sort((D,k)=>Number(k.count-D.count));const b=f==null?void 0:f.map(D=>D.id);if(y||(y=!Ki(b,this.state.clusterIds,1)),this.setState({clusterIds:b}),y){const D=I2e(f,c),k=M2e(f);k.points.attributes={stats:D},this.setState({data:k})}const T={...this.props,id:"clusters",data:this.state.data,dataComparator:(D,k)=>{var G,j,K,fe;const z=(j=(G=D==null?void 0:D.points)==null?void 0:G.properties)==null?void 0:j.map(Z=>Z.id),J=(fe=(K=k==null?void 0:k.points)==null?void 0:K.properties)==null?void 0:fe.map(Z=>Z.id);return Ki(z,J,1)}};return new Wl(this.getSubLayerProps(T))}getPickingInfo(e){const t=e.info;if(t.index!==-1){const{data:n}=e.sourceLayer.props;t.object=$x(n,{globalFeatureId:t.index})}return t}_updateAutoHighlight(e){for(const t of this.getSubLayers())t.updateAutoHighlight(e)}filterSubLayer(){return!0}}yE.layerName="ClusterGeoJsonLayer";yE.defaultProps=Nk;class vE extends ys{getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e.cartoSpatialTile={...e.cartoSpatialTile,scheme:"quadbin"},e}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t,maxresolution:n}=e;return[new yE(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:t,TilesetClass:fE,maxZoom:n,loadOptions:this.getLoadOptions()})]}}vE.layerName="ClusterTileLayer";vE.defaultProps=Nk;const W2e=85.051128;function J2e({west:r,north:e,east:t,south:n},i){const c=[[e,t],[n,t],[n,r],[e,r]].map(b=>RC(b[0],b[1],i)).map(b=>Math.max(...dAe(b).map(T=>pAe(T,dA.rads)))*180/Math.PI),f=Math.max(...c),y=Math.min(180,f/Math.cos((e+n)/2*Math.PI/180));return{north:Math.min(e+f,W2e),east:t+y,south:Math.max(n-f,-85.051128),west:r-y}}function kk({west:r,north:e,east:t,south:n},i){const o=Math.abs(t-r);if(o>180){const c=Math.ceil(o/180);let f=[];for(let y=0;y<c;y++){const b=r+y*180,T=Math.min(b+179.9999999,t);f=f.concat(kk({west:b,north:e,east:T,south:n},i))}return[...new Set(f)]}return fAe([[e,t],[n,t],[n,r],[e,r],[e,t]],i)}function X2e(r){const e=K8(r),t=e.map(f=>f[0]),n=e.map(f=>f[1]),i=Math.min(...n),o=Math.min(...t),s=Math.max(...n),c=Math.max(...t);return{west:i,south:o,east:s,north:c}}const K2e=2;function Jx(r,e){const t=Math.log2(e/512),n=2/3*(r.zoom-t),i=Math.log(1/Math.cos(Math.PI*r.latitude/180));return Math.max(0,Math.floor(n+i-K2e))}class Y2e extends Oy{getTileIndices({viewport:e,minZoom:t,maxZoom:n}){if(e.latitude===void 0)return[];const[i,o,s,c]=e.getBounds(),{tileSize:f}=this.opts;let y=Jx(e,f),b;if(typeof t=="number"&&Number.isFinite(t)&&y<t)return[];if(typeof n=="number"&&Number.isFinite(n)&&y>n){y=n;const T=RC(e.latitude,e.longitude,n);b=uAe(T,1)}else{const T=J2e({west:i,north:c,east:s,south:o},y);b=kk(T,y)}return b.map(T=>({i:T}))}getTileId({i:e}){return e}getTileMetadata({i:e}){return{bbox:X2e(e)}}getTileZoom({i:e}){return Px(e)}getParentIndex(e){const t=Px(e.i);return{i:lAe(e.i,t-1)}}}Ig([Lk]);function q2e(r){return r!=null&&r!==""}const Z2e={tileSize:NA};class Qy extends Xl{_updateAutoHighlight(e){const{hoveredFeatureId:t}=this.state,n=e.object;let i=null;if(n&&(i=n.id),t!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(e)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t}=this.state,n=e.content;return!q2e(t)||!Array.isArray(n)||!this._featureInTile(e,t)?-1:n.findIndex(o=>o.id===t)}_featureInTile(e,t){const n=this.state.tileset,i=n.getTileZoom(e.index),o=e.index.q?"q":"i";let s={[o]:t},c=n.getTileZoom(s);for(;!(c<=i);)s=n.getParentIndex(s),c=n.getTileZoom(s);return s[o]===e.index[o]}}Qy.layerName="SpatialIndexTileLayer";Qy.defaultProps=Z2e;const Q2e=r=>{const{data:e}=r,{index:t}=r.tile;return!e||!e.length?null:new al(r,{getHexagon:n=>n.id,centerHexagon:t,highPrecision:!0})},exe={data:ih,tileSize:NA};class bE extends ys{initializeState(){al._checkH3Lib()}getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e.cartoSpatialTile={...e.cartoSpatialTile,scheme:"h3"},e}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t}=e;let{minresolution:n,maxresolution:i}=e;this.props.minZoom&&(n=Math.max(n,Jx({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Jx({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));const o=this.getSubLayerClass("spatial-index-tile",Qy);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:t,TilesetClass:Y2e,renderSubLayers:Q2e,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}}bE.layerName="H3TileLayer";bE.defaultProps=exe;const txe=`uniform heatmapUniforms {
4660
+ `},z1e=r=>{if(!r||!("dummyCollisionMap"in r))return{};const{enabled:e,collisionFBO:t,drawToCollisionMap:n,dummyCollisionMap:i}=r;return{enabled:e&&!n,sort:!!n,collision_texture:!n&&t?t.colorAttachments[0]:i}},G1e={name:"collision",dependencies:[uy],vs:k1e,inject:U1e,getUniforms:z1e,uniformTypes:{sort:"i32",enabled:"i32"}};class V1e extends fy{renderCollisionMap(e,t){const i=[0,0,0,0],o=[1,1,e.width-2*1,e.height-2*1];this.render({...t,clearColor:i,scissorRect:o,target:e,pass:"collision"})}getLayerParameters(e,t,n){return{...e.props.parameters,blend:!1,depthWriteEnabled:!0,depthCompare:"less-equal"}}getShaderModuleProps(){return{collision:{drawToCollisionMap:!0},picking:{isActive:1,isAttribute:!1},lighting:{enabled:!1}}}}const $1=2;class H1e{constructor(){this.id="collision-filter-effect",this.props=null,this.useInPicking=!0,this.order=1,this.channels={},this.collisionFBOs={}}setup(e){this.context=e;const{device:t}=e;this.dummyCollisionMap=t.createTexture({width:1,height:1}),this.collisionFilterPass=new V1e(t,{id:"default-collision-filter"})}preRender({effects:e,layers:t,layerFilter:n,viewports:i,onViewportActive:o,views:s,isPicking:c,preRenderStats:f={}}){var J;const{device:y}=this.context;if(c)return;const b=t.filter(({props:{visible:G,collisionEnabled:j}})=>G&&j);if(b.length===0){this.channels={};return}const T=e==null?void 0:e.filter(G=>G.useInPicking&&f[G.id]),S=(J=f["mask-effect"])==null?void 0:J.didRender,D=this._groupByCollisionGroup(y,b),k=i[0],z=!this.lastViewport||!this.lastViewport.equals(k)||S;for(const G in D){const j=this.collisionFBOs[G],K=D[G],[fe,Z]=y.canvasContext.getPixelSize();j.resize({width:fe/$1,height:Z/$1}),this._render(K,{effects:T,layerFilter:n,onViewportActive:o,views:s,viewport:k,viewportChanged:z})}}_render(e,{effects:t,layerFilter:n,onViewportActive:i,views:o,viewport:s,viewportChanged:c}){const{collisionGroup:f}=e,y=this.channels[f];if(!y)return;const b=c||e===y||!Ki(y.layers,e.layers,1)||e.layerBounds.some((T,S)=>!aa(T,y.layerBounds[S]))||e.allLayersLoaded!==y.allLayersLoaded||e.layers.some(T=>T.props.transitions);if(this.channels[f]=e,b){this.lastViewport=s;const T=this.collisionFBOs[f];this.collisionFilterPass.renderCollisionMap(T,{pass:"collision-filter",isPicking:!0,layers:e.layers,effects:t,layerFilter:n,viewports:s?[s]:[],onViewportActive:i,views:o,shaderModuleProps:{collision:{enabled:!0,dummyCollisionMap:this.dummyCollisionMap},project:{devicePixelRatio:T.device.canvasContext.getDevicePixelRatio()/$1}}})}}_groupByCollisionGroup(e,t){const n={};for(const i of t){const o=i.props.collisionGroup;let s=n[o];s||(s={collisionGroup:o,layers:[],layerBounds:[],allLayersLoaded:!0},n[o]=s),s.layers.push(i),s.layerBounds.push(i.getBounds()),i.isLoaded||(s.allLayersLoaded=!1)}for(const i of Object.keys(n))this.collisionFBOs[i]||this.createFBO(e,i),this.channels[i]||(this.channels[i]=n[i]);for(const i of Object.keys(this.collisionFBOs))n[i]||this.destroyFBO(i);return n}getShaderModuleProps(e){const{collisionGroup:t,collisionEnabled:n}=e.props,{collisionFBOs:i,dummyCollisionMap:o}=this,s=i[t];return{collision:{enabled:n&&!!s,collisionFBO:s,dummyCollisionMap:o}}}cleanup(){this.dummyCollisionMap&&(this.dummyCollisionMap.delete(),this.dummyCollisionMap=void 0),this.channels={};for(const e of Object.keys(this.collisionFBOs))this.destroyFBO(e);this.collisionFBOs={},this.lastViewport=void 0}createFBO(e,t){const{width:n,height:i}=e.gl.canvas,o=e.createTexture({format:"rgba8unorm",width:n,height:i,sampler:{minFilter:"nearest",magFilter:"nearest",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}}),s=e.createTexture({format:"depth16unorm",width:n,height:i,mipmaps:!1});this.collisionFBOs[t]=e.createFramebuffer({id:`collision-${t}`,width:n,height:i,colorAttachments:[o],depthStencilAttachment:s})}destroyFBO(e){var n,i;const t=this.collisionFBOs[e];(n=t.colorAttachments[0])==null||n.destroy(),(i=t.depthStencilAttachment)==null||i.destroy(),t.destroy(),delete this.collisionFBOs[e]}}const j1e={getCollisionPriority:{type:"accessor",value:0},collisionEnabled:!0,collisionGroup:{type:"string",value:"default"},collisionTestProps:{}};class cE extends gy{getShaders(){return{modules:[G1e]}}draw({shaderModuleProps:e}){var t;(t=e.collision)!=null&&t.drawToCollisionMap&&(this.props=this.clone(this.props.collisionTestProps).props)}initializeState(e,t){var i;if(this.getAttributeManager()===null)return;(i=this.context.deck)==null||i._addDefaultEffect(new H1e),this.getAttributeManager().add({collisionPriorities:{size:1,stepMode:"dynamic",accessor:"getCollisionPriority"}})}getNeedsPickingBuffer(){return this.props.collisionEnabled}}cE.defaultProps=j1e;cE.extensionName="CollisionFilterExtension";function $x(r,e){const t=e==null?void 0:e.globalFeatureId;return t!==void 0?$1e(r,t):W1e(r,e==null?void 0:e.type)}function $1e(r,e){const t=yk(r);for(const n of t){let i=0,o=n.featureIds.value[0];for(let s=0;s<n.featureIds.value.length;s++){const c=n.featureIds.value[s];if(c!==o){if(e===n.globalFeatureIds.value[i])return U_(n,i,s);i=s,o=c}}if(e===n.globalFeatureIds.value[i])return U_(n,i,n.featureIds.value.length)}throw new Error(`featureId:${e} not found`)}function W1e(r,e){const t=yk(r);return X1e(t)}function J1e(r,e,t){switch(r.type){case"Point":return Z1e(r,e,t);case"LineString":return q1e(r,e,t);case"Polygon":return vk(r,e,t);default:const n=r;throw new Error(`Unsupported geometry type: ${n==null?void 0:n.type}`)}}function yk(r,e){const t=[];return r.points&&(r.points.type="Point",t.push(r.points)),r.lines&&(r.lines.type="LineString",t.push(r.lines)),r.polygons&&(r.polygons.type="Polygon",t.push(r.polygons)),t}function X1e(r){const e=[];for(const t of r){if(t.featureIds.value.length===0)continue;let n=0,i=t.featureIds.value[0];for(let o=0;o<t.featureIds.value.length;o++){const s=t.featureIds.value[o];s!==i&&(e.push(U_(t,n,o)),n=o,i=s)}e.push(U_(t,n,t.featureIds.value.length))}return e}function U_(r,e,t){const n=J1e(r,e,t),i=Y1e(r,e),o=K1e(r,e);return{type:"Feature",geometry:n,properties:i,...o}}function K1e(r,e=0,t){return r.fields&&r.fields[r.featureIds.value[e]]}function Y1e(r,e=0,t){const n=Object.assign({},r.properties[r.featureIds.value[e]]);for(const i in r.numericProps)n[i]=r.numericProps[i].value[e];return n}function vk(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.polygonIndices.value.filter(f=>f>=e&&f<=t),o=r.primitivePolygonIndices.value.filter(f=>f>=e&&f<=t);if(!(i.length>2)){const f=[];for(let y=0;y<o.length-1;y++){const b=o[y],T=o[y+1],S=z_(n,b,T);f.push(S)}return{type:"Polygon",coordinates:f}}const c=[];for(let f=0;f<i.length-1;f++){const y=i[f],b=i[f+1],T=vk(r,y,b).coordinates;c.push(T)}return{type:"MultiPolygon",coordinates:c}}function q1e(r,e=-1/0,t=1/0){const{positions:n}=r,i=r.pathIndices.value.filter(c=>c>=e&&c<=t);if(!(i.length>2))return{type:"LineString",coordinates:z_(n,i[0],i[1])};const s=[];for(let c=0;c<i.length-1;c++){const f=z_(n,i[c],i[c+1]);s.push(f)}return{type:"MultiLineString",coordinates:s}}function Z1e(r,e,t){const{positions:n}=r,i=z_(n,e,t);return i.length>1?{type:"MultiPoint",coordinates:i}:{type:"Point",coordinates:i[0]}}function z_(r,e,t){e=e||0,t=t||r.value.length/r.size;const n=[];for(let i=e;i<t;i++){const o=Array();for(let s=i*r.size;s<(i+1)*r.size;s++)o.push(Number(r.value[s]));n.push(o)}return n}var Am={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var IF;function Q1e(){return IF||(IF=1,Am.read=function(r,e,t,n,i){var o,s,c=i*8-n-1,f=(1<<c)-1,y=f>>1,b=-7,T=t?i-1:0,S=t?-1:1,D=r[e+T];for(T+=S,o=D&(1<<-b)-1,D>>=-b,b+=c;b>0;o=o*256+r[e+T],T+=S,b-=8);for(s=o&(1<<-b)-1,o>>=-b,b+=n;b>0;s=s*256+r[e+T],T+=S,b-=8);if(o===0)o=1-y;else{if(o===f)return s?NaN:(D?-1:1)*(1/0);s=s+Math.pow(2,n),o=o-y}return(D?-1:1)*s*Math.pow(2,o-n)},Am.write=function(r,e,t,n,i,o){var s,c,f,y=o*8-i-1,b=(1<<y)-1,T=b>>1,S=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=n?0:o-1,k=n?1:-1,z=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,s=b):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+T>=1?e+=S/f:e+=S*Math.pow(2,1-T),e*f>=2&&(s++,f/=2),s+T>=b?(c=0,s=b):s+T>=1?(c=(e*f-1)*Math.pow(2,i),s=s+T):(c=e*Math.pow(2,T-1)*Math.pow(2,i),s=0));i>=8;r[t+D]=c&255,D+=k,c/=256,i-=8);for(s=s<<i|c,y+=i;y>0;r[t+D]=s&255,D+=k,s/=256,y-=8);r[t+D-k]|=z*128}),Am}var W1,MF;function e2e(){if(MF)return W1;MF=1,W1=e;var r=Q1e();function e(W){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(W)?W:new Uint8Array(W||0),this.pos=0,this.type=0,this.length=this.buf.length}e.Varint=0,e.Fixed64=1,e.Bytes=2,e.Fixed32=5;var t=65536*65536,n=1/t,i=12,o=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");e.prototype={destroy:function(){this.buf=null},readFields:function(W,ne,Te){for(Te=Te||this.length;this.pos<Te;){var qe=this.readVarint(),Ce=qe>>3,Ne=this.pos;this.type=qe&7,W(Ce,ne,this),this.pos===Ne&&this.skip(qe)}return ne},readMessage:function(W,ne){return this.readFields(W,ne,this.readVarint()+this.pos)},readFixed32:function(){var W=oe(this.buf,this.pos);return this.pos+=4,W},readSFixed32:function(){var W=ze(this.buf,this.pos);return this.pos+=4,W},readFixed64:function(){var W=oe(this.buf,this.pos)+oe(this.buf,this.pos+4)*t;return this.pos+=8,W},readSFixed64:function(){var W=oe(this.buf,this.pos)+ze(this.buf,this.pos+4)*t;return this.pos+=8,W},readFloat:function(){var W=r.read(this.buf,this.pos,!0,23,4);return this.pos+=4,W},readDouble:function(){var W=r.read(this.buf,this.pos,!0,52,8);return this.pos+=8,W},readVarint:function(W){var ne=this.buf,Te,qe;return qe=ne[this.pos++],Te=qe&127,qe<128||(qe=ne[this.pos++],Te|=(qe&127)<<7,qe<128)||(qe=ne[this.pos++],Te|=(qe&127)<<14,qe<128)||(qe=ne[this.pos++],Te|=(qe&127)<<21,qe<128)?Te:(qe=ne[this.pos],Te|=(qe&15)<<28,s(Te,W,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var W=this.readVarint();return W%2===1?(W+1)/-2:W/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var W=this.readVarint()+this.pos,ne=this.pos;return this.pos=W,W-ne>=i&&o?we(this.buf,ne,W):pe(this.buf,ne,W)},readBytes:function(){var W=this.readVarint()+this.pos,ne=this.buf.subarray(this.pos,W);return this.pos=W,ne},readPackedVarint:function(W,ne){if(this.type!==e.Bytes)return W.push(this.readVarint(ne));var Te=c(this);for(W=W||[];this.pos<Te;)W.push(this.readVarint(ne));return W},readPackedSVarint:function(W){if(this.type!==e.Bytes)return W.push(this.readSVarint());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readSVarint());return W},readPackedBoolean:function(W){if(this.type!==e.Bytes)return W.push(this.readBoolean());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readBoolean());return W},readPackedFloat:function(W){if(this.type!==e.Bytes)return W.push(this.readFloat());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readFloat());return W},readPackedDouble:function(W){if(this.type!==e.Bytes)return W.push(this.readDouble());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readDouble());return W},readPackedFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed32());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readFixed32());return W},readPackedSFixed32:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed32());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readSFixed32());return W},readPackedFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readFixed64());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readFixed64());return W},readPackedSFixed64:function(W){if(this.type!==e.Bytes)return W.push(this.readSFixed64());var ne=c(this);for(W=W||[];this.pos<ne;)W.push(this.readSFixed64());return W},skip:function(W){var ne=W&7;if(ne===e.Varint)for(;this.buf[this.pos++]>127;);else if(ne===e.Bytes)this.pos=this.readVarint()+this.pos;else if(ne===e.Fixed32)this.pos+=4;else if(ne===e.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+ne)},writeTag:function(W,ne){this.writeVarint(W<<3|ne)},realloc:function(W){for(var ne=this.length||16;ne<this.pos+W;)ne*=2;if(ne!==this.length){var Te=new Uint8Array(ne);Te.set(this.buf),this.buf=Te,this.length=ne}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(W){this.realloc(4),Be(this.buf,W,this.pos),this.pos+=4},writeSFixed32:function(W){this.realloc(4),Be(this.buf,W,this.pos),this.pos+=4},writeFixed64:function(W){this.realloc(8),Be(this.buf,W&-1,this.pos),Be(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeSFixed64:function(W){this.realloc(8),Be(this.buf,W&-1,this.pos),Be(this.buf,Math.floor(W*n),this.pos+4),this.pos+=8},writeVarint:function(W){if(W=+W||0,W>268435455||W<0){y(W,this);return}this.realloc(4),this.buf[this.pos++]=W&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=(W>>>=7)&127|(W>127?128:0),!(W<=127)&&(this.buf[this.pos++]=W>>>7&127)))},writeSVarint:function(W){this.writeVarint(W<0?-W*2-1:W*2)},writeBoolean:function(W){this.writeVarint(!!W)},writeString:function(W){W=String(W),this.realloc(W.length*4),this.pos++;var ne=this.pos;this.pos=Ae(this.buf,W,this.pos);var Te=this.pos-ne;Te>=128&&S(ne,Te,this),this.pos=ne-1,this.writeVarint(Te),this.pos+=Te},writeFloat:function(W){this.realloc(4),r.write(this.buf,W,this.pos,!0,23,4),this.pos+=4},writeDouble:function(W){this.realloc(8),r.write(this.buf,W,this.pos,!0,52,8),this.pos+=8},writeBytes:function(W){var ne=W.length;this.writeVarint(ne),this.realloc(ne);for(var Te=0;Te<ne;Te++)this.buf[this.pos++]=W[Te]},writeRawMessage:function(W,ne){this.pos++;var Te=this.pos;W(ne,this);var qe=this.pos-Te;qe>=128&&S(Te,qe,this),this.pos=Te-1,this.writeVarint(qe),this.pos+=qe},writeMessage:function(W,ne,Te){this.writeTag(W,e.Bytes),this.writeRawMessage(ne,Te)},writePackedVarint:function(W,ne){ne.length&&this.writeMessage(W,D,ne)},writePackedSVarint:function(W,ne){ne.length&&this.writeMessage(W,k,ne)},writePackedBoolean:function(W,ne){ne.length&&this.writeMessage(W,G,ne)},writePackedFloat:function(W,ne){ne.length&&this.writeMessage(W,z,ne)},writePackedDouble:function(W,ne){ne.length&&this.writeMessage(W,J,ne)},writePackedFixed32:function(W,ne){ne.length&&this.writeMessage(W,j,ne)},writePackedSFixed32:function(W,ne){ne.length&&this.writeMessage(W,K,ne)},writePackedFixed64:function(W,ne){ne.length&&this.writeMessage(W,fe,ne)},writePackedSFixed64:function(W,ne){ne.length&&this.writeMessage(W,Z,ne)},writeBytesField:function(W,ne){this.writeTag(W,e.Bytes),this.writeBytes(ne)},writeFixed32Field:function(W,ne){this.writeTag(W,e.Fixed32),this.writeFixed32(ne)},writeSFixed32Field:function(W,ne){this.writeTag(W,e.Fixed32),this.writeSFixed32(ne)},writeFixed64Field:function(W,ne){this.writeTag(W,e.Fixed64),this.writeFixed64(ne)},writeSFixed64Field:function(W,ne){this.writeTag(W,e.Fixed64),this.writeSFixed64(ne)},writeVarintField:function(W,ne){this.writeTag(W,e.Varint),this.writeVarint(ne)},writeSVarintField:function(W,ne){this.writeTag(W,e.Varint),this.writeSVarint(ne)},writeStringField:function(W,ne){this.writeTag(W,e.Bytes),this.writeString(ne)},writeFloatField:function(W,ne){this.writeTag(W,e.Fixed32),this.writeFloat(ne)},writeDoubleField:function(W,ne){this.writeTag(W,e.Fixed64),this.writeDouble(ne)},writeBooleanField:function(W,ne){this.writeVarintField(W,!!ne)}};function s(W,ne,Te){var qe=Te.buf,Ce,Ne;if(Ne=qe[Te.pos++],Ce=(Ne&112)>>4,Ne<128||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<3,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<10,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<17,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&127)<<24,Ne<128)||(Ne=qe[Te.pos++],Ce|=(Ne&1)<<31,Ne<128))return f(W,Ce,ne);throw new Error("Expected varint not more than 10 bytes")}function c(W){return W.type===e.Bytes?W.readVarint()+W.pos:W.pos+1}function f(W,ne,Te){return Te?ne*4294967296+(W>>>0):(ne>>>0)*4294967296+(W>>>0)}function y(W,ne){var Te,qe;if(W>=0?(Te=W%4294967296|0,qe=W/4294967296|0):(Te=~(-W%4294967296),qe=~(-W/4294967296),Te^4294967295?Te=Te+1|0:(Te=0,qe=qe+1|0)),W>=18446744073709552e3||W<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");ne.realloc(10),b(Te,qe,ne),T(qe,ne)}function b(W,ne,Te){Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos++]=W&127|128,W>>>=7,Te.buf[Te.pos]=W&127}function T(W,ne){var Te=(W&7)<<4;ne.buf[ne.pos++]|=Te|((W>>>=3)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127|((W>>>=7)?128:0),W&&(ne.buf[ne.pos++]=W&127)))))}function S(W,ne,Te){var qe=ne<=16383?1:ne<=2097151?2:ne<=268435455?3:Math.floor(Math.log(ne)/(Math.LN2*7));Te.realloc(qe);for(var Ce=Te.pos-1;Ce>=W;Ce--)Te.buf[Ce+qe]=Te.buf[Ce]}function D(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeVarint(W[Te])}function k(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeSVarint(W[Te])}function z(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeFloat(W[Te])}function J(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeDouble(W[Te])}function G(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeBoolean(W[Te])}function j(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeFixed32(W[Te])}function K(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeSFixed32(W[Te])}function fe(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeFixed64(W[Te])}function Z(W,ne){for(var Te=0;Te<W.length;Te++)ne.writeSFixed64(W[Te])}function oe(W,ne){return(W[ne]|W[ne+1]<<8|W[ne+2]<<16)+W[ne+3]*16777216}function Be(W,ne,Te){W[Te]=ne,W[Te+1]=ne>>>8,W[Te+2]=ne>>>16,W[Te+3]=ne>>>24}function ze(W,ne){return(W[ne]|W[ne+1]<<8|W[ne+2]<<16)+(W[ne+3]<<24)}function pe(W,ne,Te){for(var qe="",Ce=ne;Ce<Te;){var Ne=W[Ce],Ge=null,Qe=Ne>239?4:Ne>223?3:Ne>191?2:1;if(Ce+Qe>Te)break;var rt,tt,lt;Qe===1?Ne<128&&(Ge=Ne):Qe===2?(rt=W[Ce+1],(rt&192)===128&&(Ge=(Ne&31)<<6|rt&63,Ge<=127&&(Ge=null))):Qe===3?(rt=W[Ce+1],tt=W[Ce+2],(rt&192)===128&&(tt&192)===128&&(Ge=(Ne&15)<<12|(rt&63)<<6|tt&63,(Ge<=2047||Ge>=55296&&Ge<=57343)&&(Ge=null))):Qe===4&&(rt=W[Ce+1],tt=W[Ce+2],lt=W[Ce+3],(rt&192)===128&&(tt&192)===128&&(lt&192)===128&&(Ge=(Ne&15)<<18|(rt&63)<<12|(tt&63)<<6|lt&63,(Ge<=65535||Ge>=1114112)&&(Ge=null))),Ge===null?(Ge=65533,Qe=1):Ge>65535&&(Ge-=65536,qe+=String.fromCharCode(Ge>>>10&1023|55296),Ge=56320|Ge&1023),qe+=String.fromCharCode(Ge),Ce+=Qe}return qe}function we(W,ne,Te){return o.decode(W.subarray(ne,Te))}function Ae(W,ne,Te){for(var qe=0,Ce,Ne;qe<ne.length;qe++){if(Ce=ne.charCodeAt(qe),Ce>55295&&Ce<57344)if(Ne)if(Ce<56320){W[Te++]=239,W[Te++]=191,W[Te++]=189,Ne=Ce;continue}else Ce=Ne-55296<<10|Ce-56320|65536,Ne=null;else{Ce>56319||qe+1===ne.length?(W[Te++]=239,W[Te++]=191,W[Te++]=189):Ne=Ce;continue}else Ne&&(W[Te++]=239,W[Te++]=191,W[Te++]=189,Ne=null);Ce<128?W[Te++]=Ce:(Ce<2048?W[Te++]=Ce>>6|192:(Ce<65536?W[Te++]=Ce>>12|224:(W[Te++]=Ce>>18|240,W[Te++]=Ce>>12&63|128),W[Te++]=Ce>>6&63|128),W[Te++]=Ce&63|128)}return Te}return W1}var t2e=e2e();const r2e=sh(t2e),n2e="4.2.4",bk={dataType:null,batchType:null,name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:n2e,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};({...bk});const i2e={Point:xk,MultiPoint:s2e,LineString:wk,MultiLineString:o2e,Polygon:Ck,MultiPolygon:a2e};function xk([r,e],[t,n],i){const o=dc(t[0],n[0],r),s=dc(t[1],n[1],e);return i.unprojectFlat([o,s])}function lE(r,e,t){return r.map(n=>xk(n,e,t))}function s2e(r,e,t){return lE(r,e,t)}function wk(r,e,t){return lE(r,e,t)}function o2e(r,e,t){return r.map(n=>wk(n,e,t))}function Ck(r,e,t){return r.map(n=>lE(n,e,t))}function a2e(r,e,t){return r.map(n=>Ck(n,e,t))}function c2e(r,e,t){const n=t.projectFlat([e.west,e.north]),i=t.projectFlat([e.east,e.south]),o=[n,i];return{...r,coordinates:i2e[r.type](r.coordinates,o,t)}}const l2e=["points","lines","polygons"];function u2e(r,e,t,n){for(const i of l2e){const o=r[i]&&f2e(r[i],e,t,n);if(o>=0)return o}return-1}function f2e(r,e,t,n){const i=r.featureIds.value;if(!i.length)return-1;let o=0,s=i[i.length-1]+1;if(n){const f=h2e(r,n);if(f)o=f[0],s=f[1]+1;else return-1}let c=-1;if(e in r.numericProps){const f=r.numericProps[e].value.findIndex((y,b)=>y===t&&i[b]>=o&&i[b]<s);return f>=0?r.globalFeatureIds.value[f]:-1}else e?c=PF(r.properties,f=>f[e]===t,o,s):r.fields&&(c=PF(r.fields,f=>f.id===t,o,s));return c>=0?d2e(r,c):-1}function h2e(r,e){if(!r.__layers){const t={},{properties:n}=r;for(let i=0;i<n.length;i++){const{layerName:o}=n[i];o&&(t[o]?t[o][1]=i:t[o]=[i,i])}r.__layers=t}return r.__layers[e]}function d2e(r,e){if(!r.__ids){const t=[],n=r.featureIds.value,i=r.globalFeatureIds.value;for(let o=0;o<n.length;o++)t[n[o]]=i[o];r.__ids=t}return r.__ids[e]}function PF(r,e,t,n){for(let i=t;i<n;i++)if(e(r[i],i))return i;return-1}const J1=512,A2e={...Wl.defaultProps,data:M_,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[bk],binary:!0};class LA extends Xl{initializeState(){super.initializeState();const e=this.context.viewport.resolution!==void 0?!1:this.props.binary;this.setState({binary:e,data:null,tileJSON:null,hoveredFeatureId:null,hoveredFeatureLayerName:null})}get isLoaded(){var e;return!!((e=this.state)!=null&&e.data&&super.isLoaded)}updateState({props:e,oldProps:t,context:n,changeFlags:i}){var s;i.dataChanged&&this._updateTileData(),(s=this.state)!=null&&s.data&&(super.updateState({props:e,oldProps:t,context:n,changeFlags:i}),this._setWGS84PropertyForTiles());const{highlightColor:o}=e;o!==t.highlightColor&&Array.isArray(o)&&this.setState({highlightColor:o})}async _updateTileData(){let e=this.props.data,t=null;if(typeof e=="string"&&!yde(e)){const{onDataLoad:n,fetch:i}=this.props;this.setState({data:null,tileJSON:null});try{t=await i(e,{propName:"data",layer:this,loaders:[]})}catch(o){this.raiseError(o,"loading TileJSON"),e=null}n&&n(t,{propName:"data",layer:this})}else e&&typeof e=="object"&&"tilejson"in e&&(t=e);t&&(e=t.tiles),this.setState({data:e,tileJSON:t})}_getTilesetOptions(){const e=super._getTilesetOptions(),t=this.state.tileJSON,{minZoom:n,maxZoom:i}=this.props;return t&&(Number.isFinite(t.minzoom)&&t.minzoom>n&&(e.minZoom=t.minzoom),Number.isFinite(t.maxzoom)&&(!Number.isFinite(i)||t.maxzoom<i)&&(e.maxZoom=t.maxzoom)),e}renderLayers(){var e;return(e=this.state)!=null&&e.data?super.renderLayers():null}getTileData(e){const{data:t,binary:n}=this.state,{index:i,signal:o}=e,s=th(t,e);if(!s)return Promise.reject("Invalid URL");let c=this.getLoadOptions();const{fetch:f}=this.props;return c={...c,mimeType:"application/x-protobuf",mvt:{...c==null?void 0:c.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:i},gis:n?{format:"binary"}:{}},f(s,{propName:"data",layer:this,loadOptions:c,signal:o})}renderSubLayers(e){const{x:t,y:n,z:i}=e.tile.index,o=Math.pow(2,i),s=J1/o,c=-s,f=J1*t/o,y=J1*(1-n/o),b=new dn().scale([s,c,1]);e.autoHighlight=!1,this.context.viewport.resolution||(e.modelMatrix=b,e.coordinateOrigin=[f,y,0],e.coordinateSystem=Wr.CARTESIAN,e.extensions=[...e.extensions||[],new Xy]);const T=super.renderSubLayers(e);return this.state.binary&&!(T instanceof Wl)&&Jr.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),T}_updateAutoHighlight(e){const{uniqueIdProperty:t}=this.props,{hoveredFeatureId:n,hoveredFeatureLayerName:i}=this.state,o=e.object;let s=null,c=null;o&&(s=X1(o,t),c=RF(o));let{highlightColor:f}=this.props;typeof f=="function"&&(f=f(e)),(n!==s||i!==c)&&this.setState({highlightColor:f,hoveredFeatureId:s,hoveredFeatureLayerName:c})}_isWGS84(){return!!this.context.viewport.resolution}getPickingInfo(e){const t=super.getPickingInfo(e);if(this.state.binary&&t.index!==-1){const{data:n}=e.sourceLayer.props;t.object=$x(n,{globalFeatureId:t.index})}return t.object&&!this._isWGS84()&&(t.object=OF(t.object,t.tile.bbox,this.context.viewport)),t}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t,hoveredFeatureLayerName:n,binary:i}=this.state,{uniqueIdProperty:o,highlightedFeatureId:s}=this.props,c=e.content,f=FF(s);if(!(FF(t)||f))return-1;const b=f?s:t;return Array.isArray(c)?c.findIndex(T=>{const S=X1(T,o)===b,D=f||RF(T)===n;return S&&D}):c&&i?u2e(c,o,b,f?"":n):-1}_pickObjects(e){const{deck:t,viewport:n}=this.context,i=n.width,o=n.height,s=n.x,c=n.y,f=[this.id];return t.pickObjects({x:s,y:c,width:i,height:o,layerIds:f,maxObjects:e})}getRenderedFeatures(e=null){const t=this._pickObjects(e),n=new Set,i=[];for(const o of t){const s=X1(o.object,this.props.uniqueIdProperty);s===void 0?i.push(o.object):n.has(s)||(n.add(s),i.push(o.object))}return i}_setWGS84PropertyForTiles(){const e="dataInWGS84";this.state.tileset.selectedTiles.forEach(n=>{n.hasOwnProperty(e)||Object.defineProperty(n,e,{get:()=>{if(!n.content)return null;if(this.state.binary&&Array.isArray(n.content)&&!n.content.length)return[];const{bbox:i}=n;if(n._contentWGS84===void 0&&vde(i)){const o=this.state.binary?$x(n.content):n.content;n._contentWGS84=o.map(s=>OF(s,i,this.context.viewport))}return n._contentWGS84}})})}}LA.layerName="MVTLayer";LA.defaultProps=A2e;function X1(r,e){if(r.properties&&e)return r.properties[e];if("id"in r)return r.id}function RF(r){var e;return((e=r.properties)==null?void 0:e.layerName)||null}function FF(r){return r!=null&&r!==""}function OF(r,e,t){const n={...r,geometry:{type:r.geometry.type}};return Object.defineProperty(n.geometry,"coordinates",{get:()=>c2e(r.geometry,e,t).coordinates}),n}const DF="0123456789bcdefghjkmnpqrstuvwxyz",Ek={};for(let r=0;r<DF.length;r++)Ek[DF.charAt(r)]=r;const p2e=-90,g2e=90,m2e=-180,_2e=180;function y2e(r){let e=!0,t=g2e,n=p2e,i=_2e,o=m2e,s,c=0;for(let f=0,y=r.length;f<y;f++){const b=r[f].toLowerCase();c=Ek[b];for(let T=4;T>=0;T--){const S=c>>T&1;e?(s=(i+o)/2,S===1?o=s:i=s):(s=(t+n)/2,S===1?n=s:t=s),e=!e}}return[n,o,t,i]}function v2e(r){const[e,t,n,i]=y2e(r);return[i,n,i,e,t,e,t,n,i,n]}const b2e={getGeohash:{type:"accessor",value:r=>r.geohash}};class Ky extends tf{indexToBounds(){const{data:e,getGeohash:t}=this.props;return{data:e,_normalize:!1,positionFormat:"XY",getPolygon:(n,i)=>v2e(t(n,i))}}}Ky.layerName="GeohashLayer";Ky.defaultProps=b2e;const x2e=Object.freeze(Object.defineProperty({__proto__:null,GeohashLayer:Ky,GreatCircleLayer:bC,H3ClusterLayer:ky,H3HexagonLayer:al,MVTLayer:LA,QuadkeyLayer:Ry,S2Layer:Py,TerrainLayer:aE,Tile3DLayer:oE,TileLayer:Xl,TripsLayer:Dy,_GeoCellLayer:tf,_Tile2DHeader:P8,_Tileset2D:Oy,_WMSLayer:vC,_getURLFromTemplate:th},Symbol.toStringTag,{value:"Module"}));var Sp={},K1,LF;function w2e(){if(LF)return K1;LF=1;var r=Math.PI/180,e=180/Math.PI;function t(j){var K=i(j[0]+1,j[2]),fe=i(j[0],j[2]),Z=o(j[1]+1,j[2]),oe=o(j[1],j[2]);return[fe,Z,K,oe]}function n(j){var K=t(j),fe={type:"Polygon",coordinates:[[[K[0],K[1]],[K[0],K[3]],[K[2],K[3]],[K[2],K[1]],[K[0],K[1]]]]};return fe}function i(j,K){return j/Math.pow(2,K)*360-180}function o(j,K){var fe=Math.PI-2*Math.PI*j/Math.pow(2,K);return e*Math.atan(.5*(Math.exp(fe)-Math.exp(-fe)))}function s(j,K,fe){var Z=G(j,K,fe);return Z[0]=Math.floor(Z[0]),Z[1]=Math.floor(Z[1]),Z}function c(j){return[[j[0]*2,j[1]*2,j[2]+1],[j[0]*2+1,j[1]*2,j[2]+1],[j[0]*2+1,j[1]*2+1,j[2]+1],[j[0]*2,j[1]*2+1,j[2]+1]]}function f(j){return j[0]%2===0&&j[1]%2===0?[j[0]/2,j[1]/2,j[2]-1]:j[0]%2===0&&!j[1]%2===0?[j[0]/2,(j[1]-1)/2,j[2]-1]:!j[0]%2===0&&j[1]%2===0?[(j[0]-1)/2,j[1]/2,j[2]-1]:[(j[0]-1)/2,(j[1]-1)/2,j[2]-1]}function y(j){return c(f(j))}function b(j,K){for(var fe=y(j),Z=0;Z<fe.length;Z++)if(!T(K,fe[Z]))return!1;return!0}function T(j,K){for(var fe=0;fe<j.length;fe++)if(S(j[fe],K))return!0;return!1}function S(j,K){return j[0]===K[0]&&j[1]===K[1]&&j[2]===K[2]}function D(j){for(var K="",fe=j[2];fe>0;fe--){var Z=0,oe=1<<fe-1;(j[0]&oe)!==0&&Z++,(j[1]&oe)!==0&&(Z+=2),K+=Z.toString()}return K}function k(j){for(var K=0,fe=0,Z=j.length,oe=Z;oe>0;oe--){var Be=1<<oe-1;switch(j[Z-oe]){case"0":break;case"1":K|=Be;break;case"2":fe|=Be;break;case"3":K|=Be,fe|=Be;break}}return[K,fe,Z]}function z(j){var K=s(j[0],j[1],32),fe=s(j[2],j[3],32),Z=[K[0],K[1],fe[0],fe[1]],oe=J(Z);if(oe===0)return[0,0,0];var Be=Z[0]>>>32-oe,ze=Z[1]>>>32-oe;return[Be,ze,oe]}function J(j){for(var K=28,fe=0;fe<K;fe++){var Z=1<<32-(fe+1);if((j[0]&Z)!=(j[2]&Z)||(j[1]&Z)!=(j[3]&Z))return fe}return K}function G(j,K,fe){var Z=Math.sin(K*r),oe=Math.pow(2,fe),Be=oe*(j/360+.5),ze=oe*(.5-.25*Math.log((1+Z)/(1-Z))/Math.PI);return[Be,ze,fe]}return K1={tileToGeoJSON:n,tileToBBOX:t,getChildren:c,getParent:f,getSiblings:y,hasTile:T,hasSiblings:b,tilesEqual:S,tileToQuadkey:D,quadkeyToTile:k,pointToTile:s,bboxToTile:z,pointToTileFraction:G},K1}var NF;function C2e(){if(NF)return Sp;NF=1;var r=w2e();Sp.geojson=function(b,T){return{type:"FeatureCollection",features:t(b,T).map(e)}};function e(b){return{type:"Feature",geometry:r.tileToGeoJSON(b),properties:{}}}Sp.tiles=t,Sp.indexes=function(b,T){return t(b,T).map(r.tileToQuadkey)};function t(b,T){var S,D,k=b.coordinates,z=T.max_zoom,J={},G=[];if(b.type==="Point")return[r.pointToTile(k[0],k[1],z)];if(b.type==="MultiPoint")for(S=0;S<k.length;S++)D=r.pointToTile(k[S][0],k[S][1],z),J[f(D[0],D[1],D[2])]=!0;else if(b.type==="LineString")s(J,k,z);else if(b.type==="MultiLineString")for(S=0;S<k.length;S++)s(J,k[S],z);else if(b.type==="Polygon")i(J,G,k,z);else if(b.type==="MultiPolygon")for(S=0;S<k.length;S++)i(J,G,k[S],z);else throw new Error("Geometry type not implemented");if(T.min_zoom!==z){var j=G.length;for(c(J,G),S=0;S<j;S++){var K=G[S];J[f(K[0],K[1],K[2])]=!0}return n(J,G,T)}return c(J,G),G}function n(b,T,S){for(var D=[],k=S.max_zoom;k>S.min_zoom;k--){for(var z={},J=[],G=0;G<T.length;G++){var j=T[G];if(j[0]%2===0&&j[1]%2===0){var K=f(j[0]+1,j[1],k),fe=f(j[0],j[1]+1,k),Z=f(j[0]+1,j[1]+1,k);if(b[K]&&b[fe]&&b[Z]){b[f(j[0],j[1],j[2])]=!1,b[K]=!1,b[fe]=!1,b[Z]=!1;var oe=[j[0]/2,j[1]/2,k-1];k-1===S.min_zoom?D.push(oe):(z[f(j[0]/2,j[1]/2,k-1)]=!0,J.push(oe))}}}for(G=0;G<T.length;G++)j=T[G],b[f(j[0],j[1],j[2])]&&D.push(j);b=z,T=J}return D}function i(b,T,S,D){for(var k=[],z=0;z<S.length;z++){var J=[];s(b,S[z],D,J);for(var G=0,j=J.length,K=j-1;G<j;K=G++){var fe=(G+1)%j,Z=J[G][1];(Z>J[K][1]||Z>J[fe][1])&&(Z<J[K][1]||Z<J[fe][1])&&Z!==J[fe][1]&&k.push(J[G])}}for(k.sort(o),z=0;z<k.length;z+=2){Z=k[z][1];for(var oe=k[z][0]+1;oe<k[z+1][0];oe++){var Be=f(oe,Z,D);b[Be]||T.push([oe,Z,D])}}}function o(b,T){return b[1]-T[1]||b[0]-T[0]}function s(b,T,S,D){for(var k,z,J=0;J<T.length-1;J++){var G=r.pointToTileFraction(T[J][0],T[J][1],S),j=r.pointToTileFraction(T[J+1][0],T[J+1][1],S),K=G[0],fe=G[1],Z=j[0],oe=j[1],Be=Z-K,ze=oe-fe;if(!(ze===0&&Be===0)){var pe=Be>0?1:-1,we=ze>0?1:-1,Ae=Math.floor(K),W=Math.floor(fe),ne=Be===0?1/0:Math.abs(((Be>0?1:0)+Ae-K)/Be),Te=ze===0?1/0:Math.abs(((ze>0?1:0)+W-fe)/ze),qe=Math.abs(pe/Be),Ce=Math.abs(we/ze);for((Ae!==k||W!==z)&&(b[f(Ae,W,S)]=!0,D&&W!==z&&D.push([Ae,W]),k=Ae,z=W);ne<1||Te<1;)ne<Te?(ne+=qe,Ae+=pe):(Te+=Ce,W+=we),b[f(Ae,W,S)]=!0,D&&W!==z&&D.push([Ae,W]),k=Ae,z=W}}D&&W===D[0][1]&&D.pop()}function c(b,T){for(var S=Object.keys(b),D=0;D<S.length;D++)T.push(y(+S[D]))}function f(b,T,S){var D=2*(1<<S);return(D*T+b)*32+S}function y(b){var T=b%32,S=2*(1<<T),D=(b-T)/32,k=D%S,z=(D-k)/S%S;return[k,z,T]}return Sp}C2e();const Tk=[0x5555555555555555n,0x3333333333333333n,0x0f0f0f0f0f0f0f0fn,0x00ff00ff00ff00ffn,0x0000ffff0000ffffn,0x00000000ffffffffn],Bk=[0n,1n,2n,4n,8n,16n];function E2e(r){return BigInt(`0x${r}`)}function Wx(r){return r.toString(16)}function T2e(r){if(r.z<0||r.z>26)throw new Error("Wrong zoom");const e=BigInt(r.z);let t=BigInt(r.x)<<32n-e,n=BigInt(r.y)<<32n-e;for(let o=0;o<5;o++){const s=Bk[5-o],c=Tk[4-o];t=(t|t<<s)&c,n=(n|n<<s)&c}return 0x4000000000000000n|1n<<59n|e<<52n|(t|n<<1n)>>12n|0xfffffffffffffn>>e*2n}function Sk(r){const e=r>>59n&7n,t=r>>57n&3n,n=r>>52n&0x1fn,i=(r&0xfffffffffffffn)<<12n;if(e!==1n&&t!==0n)throw new Error("Wrong mode");let o=i,s=i>>1n;for(let c=0;c<6;c++){const f=Bk[c],y=Tk[c];o=(o|o>>f)&y,s=(s|s>>f)&y}return o=o>>32n-n,s=s>>32n-n,{z:Number(n),x:Number(o),y:Number(s)}}function uE(r){return r>>52n&0x1fn}function Ik(r){const e=uE(r)-1n;return r&~(0x1fn<<52n)|e<<52n|0xfffffffffffffn>>e*2n}function B2e(r,e,t,n=[],i,o){var f;if(!r.content)return!1;r.userData||(r.userData={});const s=(f=e.get(t))==null?void 0:f[0];if(s){if(n.every(y=>y.name in s))return!1;e.clear()}const c={};for(const y of r.content){let b=y.id;const T=typeof i=="function"?i(y,{}):i;for(let J=0;J<t-1;J++)b=Ik(b);const S=Number(b);if(!(S in c)){c[S]={id:b,count:0,position:[0,0]};for(const{name:J,aggregation:G}of n)G==="any"?c[S][J]=y.properties[J]:c[S][J]=0}const D=c[S].count;c[S].count+=typeof o=="function"?o(y,{}):o;const k=c[S].count,z=k-D;c[S].position[0]=(D*c[S].position[0]+z*T[0])/k,c[S].position[1]=(D*c[S].position[1]+z*T[1])/k;for(const{name:J,aggregation:G}of n){const j=c[S][J],K=y.properties[J];G==="average"?c[S][J]=(D*j+z*K)/k:G==="count"||G==="sum"?c[S][J]=j+K:G==="max"?c[S][J]=Math.max(j,K):G==="min"&&(c[S][J]=Math.min(j,K))}}return e.set(t,Object.values(c)),!0}function S2e(r){const e=[],t=["any","average","count","min","max","sum"];for(const n of Object.keys(r.content[0].properties)){let i=n.split("_").pop().toLowerCase();t.includes(i)||(Jr.warn(`No valid aggregation present in ${n} property`)(),i="any"),e.push({name:n,aggregation:i})}return e}function I2e(r,e){const t={};for(const{name:n,aggregation:i}of e)if(t[n]={min:1/0,max:-1/0},i!=="any")for(const o of r)t[n].min=Math.min(t[n].min,o[n]),t[n].max=Math.max(t[n].max,o[n]);return t}const eg=new Uint16Array,kF={positions:{value:new Float32Array,size:2},properties:[],numericProps:{},featureIds:{value:eg,size:1},globalFeatureIds:{value:eg,size:1}};function M2e(r){const e=new Float32Array(r.length*2),t=new Uint16Array(r.length);for(let n=0;n<r.length;n++)e.set(r[n].position,2*n),t[n]=n;return{shape:"binary-feature-collection",points:{type:"Point",positions:{value:e,size:2},properties:r,numericProps:{},featureIds:{value:t,size:1},globalFeatureIds:{value:t,size:1}},lines:{type:"LineString",pathIndices:{value:eg,size:1},...kF},polygons:{type:"Polygon",polygonIndices:{value:eg,size:1},primitivePolygonIndices:{value:eg,size:1},...kF}}}const NA=512;class fE extends Oy{getTileIndices(e){return super.getTileIndices(e).map(T2e).map(t=>({q:t,i:Wx(t)}))}getTileId({q:e,i:t}){return t||Wx(e)}getTileMetadata({q:e}){return super.getTileMetadata(Sk(e))}getTileZoom({q:e}){return Number(uE(e))}getParentIndex({q:e}){return{q:Ik(e)}}}const UF=512;function Mk(r){const{x:e,y:t,z:n}=Sk(r),i=UF/(1<<n);return[e*i,UF-t*i,i]}function P2e(r,e){const[t,n,i]=Mk(r);return[[t,n],[t+e*i,n-e*i]]}function Pk(r,e=1){const[t,n]=P2e(r,e),[i,o]=tl(t),[s,c]=tl(n);return[s,o,s,c,i,c,i,o,s,o]}const pm=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),zF=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);zF&&parseFloat(zF[1]);function R2e(r){var e;globalThis.loaders||(globalThis.loaders={}),(e=globalThis.loaders).modules||(e.modules={}),Object.assign(globalThis.loaders.modules,r)}function F2e(...r){return O2e(r)}function O2e(r){const e=r.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),t=e.reduce((o,s)=>o+s.byteLength,0),n=new Uint8Array(t);let i=0;for(const o of e)n.set(o,i),i+=o.byteLength;return n.buffer}async function D2e(r){const e=[];for await(const t of r)e.push(t);return F2e(...e)}function L2e(r){return r&&typeof r=="object"&&r.isBuffer}function gm(r){if(L2e(r))return r;if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r))return r.byteOffset===0&&r.byteLength===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);if(typeof r=="string"){const e=r;return new TextEncoder().encode(e).buffer}if(r&&typeof r=="object"&&r._toArrayBuffer)return r._toArrayBuffer();throw new Error("toArrayBuffer")}function mm(r){return e=>new Promise((t,n)=>r(e,(i,o)=>i?n(i):t(o)))}class N2e{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){R2e(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,t){return await this.preload(),this.decompressSync(e,t)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,t){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){const t=await this.concatenate(e);yield this.compress(t)}async*decompressBatches(e){const t=await this.concatenate(e);yield this.decompress(t)}concatenate(e){return D2e(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}}class k2e extends N2e{constructor(t={}){super(t);V(this,"name","deflate");V(this,"extensions",[]);V(this,"contentEncodings",["deflate"]);V(this,"isSupported",!0);V(this,"options");V(this,"_chunks",[]);this.options=t}async compress(t){var n,i;if(!pm&&((n=this.options.deflate)!=null&&n.useZlib)){const o=(i=this.options.deflate)!=null&&i.gzip?await mm(bu.gzip)(t):await mm(bu.deflate)(t);return gm(o)}return this.compressSync(t)}async decompress(t){var n,i;if(!pm&&((n=this.options.deflate)!=null&&n.useZlib)){const o=(i=this.options.deflate)!=null&&i.gzip?await mm(bu.gunzip)(t):await mm(bu.inflate)(t);return gm(o)}return this.decompressSync(t)}compressSync(t){var s,c,f,y;if(!pm&&((s=this.options.deflate)!=null&&s.useZlib)){const b=(c=this.options.deflate)!=null&&c.gzip?bu.gzipSync(t):bu.deflateSync(t);return gm(b)}const n=((f=this.options)==null?void 0:f.deflate)||{},i=new Uint8Array(t);return((y=this.options)!=null&&y.raw?Id.deflateRaw:Id.deflate)(i,n).buffer}decompressSync(t){var s,c,f,y;if(!pm&&((s=this.options.deflate)!=null&&s.useZlib)){const b=(c=this.options.deflate)!=null&&c.gzip?bu.gunzipSync(t):bu.inflateSync(t);return gm(b)}const n=((f=this.options)==null?void 0:f.deflate)||{},i=new Uint8Array(t);return((y=this.options)!=null&&y.raw?Id.inflateRaw:Id.inflate)(i,n).buffer}async*compressBatches(t){var o;const n=((o=this.options)==null?void 0:o.deflate)||{},i=new Id.Deflate(n);yield*this.transformBatches(i,t)}async*decompressBatches(t){var o;const n=((o=this.options)==null?void 0:o.deflate)||{},i=new Id.Inflate(n);yield*this.transformBatches(i,t)}async*transformBatches(t,n){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(const s of n){const c=new Uint8Array(s);if(!t.push(c,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}const i=new Uint8Array(0);t.push(i,!0),yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){const t=this._chunks;return this._chunks=[],t}_getError(t=0){const n={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${n[t]}`}}class U2e extends k2e{constructor(t){super({...t,deflate:{...t==null?void 0:t.gzip,gzip:!0}});V(this,"name","gzip");V(this,"extensions",["gz","gzip"]);V(this,"contentEncodings",["gzip","x-gzip"]);V(this,"isSupported",!0)}}function Yy(r,e,t,n){const i=e.type===2?e.readVarint()+e.pos:e.pos+1,o=e.buf.buffer.slice(e.pos,i);if((n==null?void 0:n.compression)==="gzip"){const c=new U2e().decompressSync(o);t.value=new r(c)}else t.value=new r(o);return e.pos=i,t.value}class hE{static read(e,t){return e.readFields(hE._readField,{key:"",value:null},t)}static _readField(e,t,n){e===1?t.key=n.readString():e===2&&(t.value=n.readString())}}class mh{static read(e,t){return e.readFields(mh._readField,{},t)}static _readField(e,t,n){if(e===1){const{key:i,value:o}=hE.read(n,n.readVarint()+n.pos);t[i]=o}}}class zg{static read(e,t){const{value:n,size:i}=e.readFields(zg._readField,{value:[],size:0},t);return{value:n,size:i}}static _readField(e,t,n){e===1?Yy(Float64Array,n,t):e===2&&(t.size=n.readVarint(!0))}}class Ba{static read(e,t){const{value:n,size:i}=e.readFields(Ba._readField,{value:[],size:0},t);return{value:new Uint32Array(n),size:i}}static _readField(e,t,n){e===1?n.readPackedVarint(t.value):e===2&&(t.size=n.readVarint(!0))}}class Gg{static read(e,t){return e.readFields(Gg._readField,{id:0},t)}static _readField(e,t,n){e===1&&(t.id=n.readVarint())}}class dE{static read(e,t){return e.readFields(dE._readField,{value:[]},t)}static _readField(e,t,n){e===1&&Yy(Float64Array,n,t)}}class _h{static read(e,t){return e.readFields(_h._readField,{key:"",value:null},t)}static _readField(e,t,n){e===1?t.key=n.readString():e===2&&(t.value=dE.read(n,n.readVarint()+n.pos))}}class AE{static read(e,t){return e.readFields(AE._readField,{positions:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},t)}static _readField(e,t,n){if(e===1)t.positions=zg.read(n,n.readVarint()+n.pos);else if(e===2)t.globalFeatureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===3)t.featureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===4)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===5){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}else e===6&&t.fields.push(Gg.read(n,n.readVarint()+n.pos))}}class pE{static read(e,t){return e.readFields(pE._readField,{positions:null,pathIndices:null,globalFeatureIds:null,featureIds:null,properties:[],numericProps:{},fields:[]},t)}static _readField(e,t,n){if(e===1)t.positions=zg.read(n,n.readVarint()+n.pos);else if(e===2)t.pathIndices=Ba.read(n,n.readVarint()+n.pos);else if(e===3)t.globalFeatureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===4)t.featureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===5)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===6){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}else e===7&&t.fields.push(Gg.read(n,n.readVarint()+n.pos))}}class gE{static read(e,t){return e.readFields(gE._readField,{positions:null,polygonIndices:null,globalFeatureIds:null,featureIds:null,primitivePolygonIndices:null,triangles:null,properties:[],numericProps:{},fields:[]},t)}static _readField(e,t,n){if(e===1)t.positions=zg.read(n,n.readVarint()+n.pos);else if(e===2)t.polygonIndices=Ba.read(n,n.readVarint()+n.pos);else if(e===3)t.globalFeatureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===4)t.featureIds=Ba.read(n,n.readVarint()+n.pos);else if(e===5)t.primitivePolygonIndices=Ba.read(n,n.readVarint()+n.pos);else if(e===6)t.triangles=Ba.read(n,n.readVarint()+n.pos);else if(e===7)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===8){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}else e===9&&t.fields.push(Gg.read(n,n.readVarint()+n.pos))}}let z2e=class Rk{static read(e,t){return e.readFields(Rk._readField,{points:null,lines:null,polygons:null},t)}static _readField(e,t,n){e===1?t.points=AE.read(n,n.readVarint()+n.pos):e===2?t.lines=pE.read(n,n.readVarint()+n.pos):e===3&&(t.polygons=gE.read(n,n.readVarint()+n.pos))}};class mE{static read(e,t){return e.readFields(mE._readField,{value:[]},t)}static _readField(e,t,n){e===1&&Yy(BigUint64Array,n,t)}}class _E{static read(e,t){return e.readFields(_E._readField,{indices:null,properties:[],numericProps:{}},t)}static _readField(e,t,n){if(e===1)t.indices=mE.read(n,n.readVarint()+n.pos);else if(e===2)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===3){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}}}let G2e=class Fk{static read(e,t){return e.readFields(Fk._readField,{scheme:0,cells:null},t)}static _readField(e,t,n){e===1?t.scheme=n.readVarint():e===2&&(t.cells=_E.read(n,n.readVarint()+n.pos))}};function qy(r,e){const t=new r2e(r);return e.read(t)}function nh(r,e){Jr.assert(r,e)}function V2e(r,e){const{properties:t,numericProps:n}=r;return new Proxy(t[e]||{},{get(i,o){return o in n?n[o].value[e]:i[o]},has(i,o){return o in n||o in i},ownKeys(i){return[...Object.keys(n),...Reflect.ownKeys(i)]},getOwnPropertyDescriptor(i,o){return{enumerable:!0,configurable:!0}}})}function Zy(r,e){return`https://unpkg.com/@deck.gl/carto@${e}/dist/${r}-worker.js`}function H2e(r){const{cells:e,scheme:t}=r,n=e.indices.value.length,i=[];for(let o=0;o<n;o++){const s=t==="h3"?Wx(e.indices.value[o]):e.indices.value[o],c={...e.properties[o]};for(const f of Object.keys(e.numericProps))c[f]=e.numericProps[f].value[o];i.push({id:s,properties:c})}return i}const Ok="9.1.8",Dk="cartoSpatialTile",j2e={cartoSpatialTile:{scheme:"quadbin",workerUrl:Zy(Dk,Ok)}},Lk={name:"CARTO Spatial Tile",version:Ok,id:Dk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-spatial-tile"],category:"geometry",parse:async(r,e)=>GF(r,e),parseSync:GF,worker:!0,options:j2e};function GF(r,e){var s;if(!r)return null;const t=qy(r,G2e),{cells:n}=t,i=(s=e==null?void 0:e.cartoSpatialTile)==null?void 0:s.scheme;return H2e({cells:n,scheme:i})}function Vg(r,e){var t,n,i;(n=(t=r==null?void 0:r.fetch)==null?void 0:t.headers)!=null&&n.Authorization||(r.fetch={...r.fetch,headers:{...(i=r.fetch)==null?void 0:i.headers,Authorization:`Bearer ${e}`}})}function $2e(r,e){const t={};for(const{geoid:n,...i}of e.properties)n in t?Jr.warn("Duplicate geoid key in boundary mapping, using first occurance")():t[n]=i;for(const n of["points","lines","polygons"]){const i=r[n];if(i.positions.value.length===0)continue;i.properties=i.properties.map(({geoid:y})=>t[y]);const{positions:o,globalFeatureIds:s}=i;let c=null;n==="lines"&&(c=i.pathIndices.value),n==="polygons"&&(c=i.polygonIndices.value);const f=o.value.length/o.size;for(const y in e.numericProps){const b=e.numericProps[y].value,T=b.constructor,S=new T(f);if(i.numericProps[y]={value:S,size:1},c)for(let D=0;D<c.length-1;D++){const k=c[D],z=c[D+1],J=s.value[k];S.fill(b[J],k,z)}else for(let D=0;D<f;D++){const k=s.value[D];S[D]=b[k]}}}return r}const ih={type:"object",value:null,validate:(r,e)=>e.optional&&r===null||typeof r=="object"&&Array.isArray(r.tiles)&&r.tiles.every(t=>typeof t=="string"),equal:(r,e)=>Ki(r,e,2),async:!0};Ig([Lk]);const Nk={data:ih,clusterLevel:{type:"number",value:5,min:1},getPosition:{type:"accessor",value:({id:r})=>Pk(r,.5).slice(2,4)},getWeight:{type:"accessor",value:1},refinementStrategy:"no-overlap",tileSize:NA};class yE extends Xl{initializeState(){super.initializeState(),this.state.aggregationCache=new WeakMap}renderLayers(){var S;const e=(S=this.state.tileset)==null?void 0:S.tiles.filter(D=>D.isLoaded&&D.content&&this.state.tileset.isTileVisible(D));if(!(e!=null&&e.length))return null;e.sort((D,k)=>k.zoom-D.zoom);const{zoom:t}=this.context.viewport,{clusterLevel:n,getPosition:i,getWeight:o}=this.props,{aggregationCache:s}=this.state,c=S2e(e[0]),f=[];let y=!1;for(const D of e){const k=Math.round(t-D.zoom),z=Math.round(n)-k;let J=s.get(D.content);J||(J=new Map,s.set(D.content,J));const G=B2e(D,J,z,c,i,o);y||(y=G),f.push(...J.get(z))}f.sort((D,k)=>Number(k.count-D.count));const b=f==null?void 0:f.map(D=>D.id);if(y||(y=!Ki(b,this.state.clusterIds,1)),this.setState({clusterIds:b}),y){const D=I2e(f,c),k=M2e(f);k.points.attributes={stats:D},this.setState({data:k})}const T={...this.props,id:"clusters",data:this.state.data,dataComparator:(D,k)=>{var G,j,K,fe;const z=(j=(G=D==null?void 0:D.points)==null?void 0:G.properties)==null?void 0:j.map(Z=>Z.id),J=(fe=(K=k==null?void 0:k.points)==null?void 0:K.properties)==null?void 0:fe.map(Z=>Z.id);return Ki(z,J,1)}};return new Wl(this.getSubLayerProps(T))}getPickingInfo(e){const t=e.info;if(t.index!==-1){const{data:n}=e.sourceLayer.props;t.object=$x(n,{globalFeatureId:t.index})}return t}_updateAutoHighlight(e){for(const t of this.getSubLayers())t.updateAutoHighlight(e)}filterSubLayer(){return!0}}yE.layerName="ClusterGeoJsonLayer";yE.defaultProps=Nk;class vE extends ys{getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e.cartoSpatialTile={...e.cartoSpatialTile,scheme:"quadbin"},e}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t,maxresolution:n}=e;return[new yE(this.props,{id:`cluster-geojson-layer-${this.props.id}`,data:t,TilesetClass:fE,maxZoom:n,loadOptions:this.getLoadOptions()})]}}vE.layerName="ClusterTileLayer";vE.defaultProps=Nk;const W2e=85.051128;function J2e({west:r,north:e,east:t,south:n},i){const c=[[e,t],[n,t],[n,r],[e,r]].map(b=>RC(b[0],b[1],i)).map(b=>Math.max(...dAe(b).map(T=>pAe(T,dA.rads)))*180/Math.PI),f=Math.max(...c),y=Math.min(180,f/Math.cos((e+n)/2*Math.PI/180));return{north:Math.min(e+f,W2e),east:t+y,south:Math.max(n-f,-85.051128),west:r-y}}function kk({west:r,north:e,east:t,south:n},i){const o=Math.abs(t-r);if(o>180){const c=Math.ceil(o/180);let f=[];for(let y=0;y<c;y++){const b=r+y*180,T=Math.min(b+179.9999999,t);f=f.concat(kk({west:b,north:e,east:T,south:n},i))}return[...new Set(f)]}return fAe([[e,t],[n,t],[n,r],[e,r],[e,t]],i)}function X2e(r){const e=K8(r),t=e.map(f=>f[0]),n=e.map(f=>f[1]),i=Math.min(...n),o=Math.min(...t),s=Math.max(...n),c=Math.max(...t);return{west:i,south:o,east:s,north:c}}const K2e=2;function Jx(r,e){const t=Math.log2(e/512),n=2/3*(r.zoom-t),i=Math.log(1/Math.cos(Math.PI*r.latitude/180));return Math.max(0,Math.floor(n+i-K2e))}class Y2e extends Oy{getTileIndices({viewport:e,minZoom:t,maxZoom:n}){if(e.latitude===void 0)return[];const[i,o,s,c]=e.getBounds(),{tileSize:f}=this.opts;let y=Jx(e,f),b;if(typeof t=="number"&&Number.isFinite(t)&&y<t)return[];if(typeof n=="number"&&Number.isFinite(n)&&y>n){y=n;const T=RC(e.latitude,e.longitude,n);b=uAe(T,1)}else{const T=J2e({west:i,north:c,east:s,south:o},y);b=kk(T,y)}return b.map(T=>({i:T}))}getTileId({i:e}){return e}getTileMetadata({i:e}){return{bbox:X2e(e)}}getTileZoom({i:e}){return Px(e)}getParentIndex(e){const t=Px(e.i);return{i:lAe(e.i,t-1)}}}Ig([Lk]);function q2e(r){return r!=null&&r!==""}const Z2e={tileSize:NA};class Qy extends Xl{_updateAutoHighlight(e){const{hoveredFeatureId:t}=this.state,n=e.object;let i=null;if(n&&(i=n.id),t!==i){let{highlightColor:o}=this.props;typeof o=="function"&&(o=o(e)),this.setState({highlightColor:o,hoveredFeatureId:i})}}getSubLayerPropsByTile(e){return{highlightedObjectIndex:this.getHighlightedObjectIndex(e),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(e){const{hoveredFeatureId:t}=this.state,n=e.content;return!q2e(t)||!Array.isArray(n)||!this._featureInTile(e,t)?-1:n.findIndex(o=>o.id===t)}_featureInTile(e,t){const n=this.state.tileset,i=n.getTileZoom(e.index),o=e.index.q?"q":"i";let s={[o]:t},c=n.getTileZoom(s);for(;!(c<=i);)s=n.getParentIndex(s),c=n.getTileZoom(s);return s[o]===e.index[o]}}Qy.layerName="SpatialIndexTileLayer";Qy.defaultProps=Z2e;const Q2e=r=>{const{data:e}=r,{index:t}=r.tile;return!e||!e.length?null:new al(r,{getHexagon:n=>n.id,centerHexagon:t,highPrecision:!0})},exe={data:ih,tileSize:NA};class bE extends ys{initializeState(){al._checkH3Lib()}getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e.cartoSpatialTile={...e.cartoSpatialTile,scheme:"h3"},e}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t}=e;let{minresolution:n,maxresolution:i}=e;this.props.minZoom&&(n=Math.max(n,Jx({zoom:this.props.minZoom,latitude:0},this.props.tileSize))),this.props.maxZoom&&(i=Math.min(i,Jx({zoom:this.props.maxZoom,latitude:0},this.props.tileSize)));const o=this.getSubLayerClass("spatial-index-tile",Qy);return new o(this.props,{id:`h3-tile-layer-${this.props.id}`,data:t,TilesetClass:Y2e,renderSubLayers:Q2e,minZoom:n,maxZoom:i,loadOptions:this.getLoadOptions()})}}bE.layerName="H3TileLayer";bE.defaultProps=exe;const txe=`uniform heatmapUniforms {
4661
4661
  vec2 colorDomain;
4662
4662
  vec2 delta;
4663
4663
  float intensity;
@@ -4816,7 +4816,7 @@ vColor = vec4(color.rgb, color.a * layer.opacity);
4816
4816
  }
4817
4817
  DECKGL_FILTER_COLOR(vColor, geometry);
4818
4818
  }
4819
- `,_xe={...ol.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]};class Wk extends zk(ol){getShaders(){const e=super.getShaders(),t=this.props.data,n=t.data.blockSize??Math.sqrt(t.length);return{...e,defines:{...e.defines,BLOCK_WIDTH:n},vs:mxe}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}}Wk.layerName="RasterColumnLayer";function yxe(r,e){return r.data===e.data&&r.length===e.length}class CE extends ys{renderLayers(){const{data:e,getElevation:t,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:s,updateTriggers:c}=this.props;if(!e||!s)return null;const f=e.blockSize??0,[y,b,T]=Mk(s),S=[y,b],D=T/f,k=this.getSubLayerClass("column",Wk),{highlightedObjectIndex:z,highlightColor:J}=this.state;return new k(this.props,this.getSubLayerProps({id:"cell",updateTriggers:c,getElevation:this.getSubLayerAccessor(t),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:e,length:f*f},dataComparator:yxe,offset:S,lineWidthScale:D,highlightedObjectIndex:z,highlightColor:J,parameters:{blendColorSrcFactor:"one",blendAlphaSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaDstFactor:"zero",blendColorOperation:"add",blendAlphaOperation:"add"}})}getSubLayerAccessor(e){return typeof e!="function"?super.getSubLayerAccessor(e):(t,n)=>{const{data:i,index:o}=n,s=i.data,c=V2e(s.cells,o);return e({properties:c},n)}}getPickingInfo(e){const t=super.getPickingInfo(e);return t.index!==-1&&(t.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:t.index})),t}_updateAutoHighlight(e){const{highlightedObjectIndex:t}=this.state;let n=-1;if(e.index!==-1&&(n=e.index),t!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(e)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}}CE.layerName="RasterLayer";CE.defaultProps=_xe;const vxe={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array};class EE{static read(e,t){return e.readFields(EE._readField,{name:"",type:"",data:null},t)}static _readField(e,t,n){if(e===1)t.name=n.readString();else if(e===2)t.type=n.readString();else if(e===3){const i=vxe[t.type];if(!i)throw Error(`Invalid data type: ${t.type}`);t.data={};const{compression:o}=Kx;Yy(i,n,t.data,{compression:o})}}}let Kx=class Jk{static read(e,t){return e.readFields(Jk._readField,{blockSize:0,bands:[]},t)}static _readField(e,t,n){e===1?t.blockSize=n.readVarint():e===2&&t.bands.push(EE.read(n,n.readVarint()+n.pos))}};const Xk="9.1.7",Kk="cartoRasterTile",bxe={cartoRasterTile:{metadata:null,workerUrl:Zy(Kk,Xk)}},xxe={name:"CARTO Raster Tile",version:Xk,id:Kk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(r,e)=>WF(r,e),parseSync:WF,worker:!0,options:bxe};function WF(r,e){var c;const t=(c=e==null?void 0:e.cartoRasterTile)==null?void 0:c.metadata;if(!r||!t)return null;Kx.compression=t.compression;const n=qy(r,Kx),{bands:i,blockSize:o}=n,s={};for(let f=0;f<i.length;f++){const{name:y,data:b}=i[f];s[y]=b}return{blockSize:o,cells:{numericProps:s,properties:[]}}}Ig([xxe]);const wxe=r=>{var t,n;const e=(n=(t=r.tile)==null?void 0:t.index)==null?void 0:n.q;return e?new CE(r,{tileIndex:e}):null},Cxe={data:ih,refinementStrategy:"no-overlap",tileSize:NA};class Exe extends Gk(Xl,sxe){filterSubLayer(e){const{tile:t}=e.layer.props;return t?super.filterSubLayer(e):!0}}class TE extends ys{getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t,minzoom:n,maxzoom:i,raster_metadata:o}=e,s=this.getSubLayerClass("tile",Exe);return new s(this.props,{id:`raster-tile-layer-${this.props.id}`,data:t,TilesetClass:fE,renderSubLayers:wxe,minZoom:n,maxZoom:i,loadOptions:{cartoRasterTile:{metadata:o},...this.getLoadOptions()}})}}TE.layerName="RasterTileLayer";TE.defaultProps=Cxe;class BE{static read(e,t){return e.readFields(BE._readField,{properties:[],numericProps:{}},t)}static _readField(e,t,n){if(e===1)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===2){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}}}const Yk="9.1.7",qk="cartoPropertiesTile",Txe={cartoPropertiesTile:{workerUrl:Zy(qk,Yk)}},Bxe={name:"CARTO Properties Tile",version:Yk,id:qk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(r,e)=>JF(r),parseSync:JF,options:Txe};function JF(r,e){return r?qy(r,BE):null}const Zk="9.1.7",Qk="cartoVectorTile",Sxe={cartoVectorTile:{workerUrl:Zy(Qk,Zk)}},Ixe={name:"CARTO Vector Tile",version:Zk,id:Qk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(r,e)=>XF(r),parseSync:XF,worker:!0,options:Sxe};function Mxe(r,e,{startPosition:t,endPosition:n,indices:i}){const o=r.positions.size,s=t*o,c=n*o,f=r.positions.value.subarray(s,c),y=i.slice(1).map(T=>T-t),b=c8(f,y,o);for(let T=0,S=b.length;T<S;++T)e.push(t+b[T])}function Pxe(r){const{polygonIndices:e,primitivePolygonIndices:t}=r,n=[];let i=0;for(let o=0;o<e.value.length-1;o++){const s=e.value[o],c=e.value[o+1],f=t.value.indexOf(c),y=t.value.subarray(i,f);i=f,Mxe(r,n,{startPosition:s,endPosition:c,indices:y})}r.triangles={value:new Uint32Array(n),size:1}}function XF(r,e){if(!r)return null;const t=qy(r,z2e);return t.polygons&&!t.polygons.triangles&&Pxe(t.polygons),t}Ig([Bxe,Ixe]);const Rxe={...LA.defaultProps,data:ih,dataComparator:ih.equal,tileSize:NA};class SE extends LA{constructor(...e){super(...e)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(e){const{props:t}=e;if(t.data){super.updateState(e);const i=new URL(t.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e.gis={format:"binary"},e}async getTileData(e){const t=this.props.data,{tiles:n,properties_tiles:i}=t,o=th(n,e);if(!o)return Promise.reject("Invalid URL");const s=this.getLoadOptions(),{fetch:c}=this.props,{signal:f}=e,y=c(o,{propName:"data",layer:this,loadOptions:s,signal:f});if(!i)return await y;const b=th(i,e);if(!b)return Promise.reject("Invalid properties URL");const T=c(b,{propName:"data",layer:this,loadOptions:s,signal:f}),[S,D]=await Promise.all([y,T]);return S?D?$2e(S,D):S:null}renderSubLayers(e){var D,k,z;if(e.data===null)return null;if(this.state.mvt)return super.renderSubLayers(e);const t=e.tile.bbox,{west:n,south:i,east:o,north:s}=t,c=[new Xy,...e.extensions||[]],f={clipBounds:[n,i,o,s]},y=J=>{var G,j,K;return{[J]:{...f,...(G=e==null?void 0:e._subLayerProps)==null?void 0:G[J],extensions:[...c,...((K=(j=e==null?void 0:e._subLayerProps)==null?void 0:j[J])==null?void 0:K.extensions)||[]]}}},b={"points-text":{type:tv,...(D=e==null?void 0:e._subLayerProps)==null?void 0:D["points-text"],extensions:[new cE,...e.extensions||[],...((z=(k=e==null?void 0:e._subLayerProps)==null?void 0:k["points-text"])==null?void 0:z.extensions)||[]]}},T={...e,autoHighlight:!1,_subLayerProps:{...e._subLayerProps,...b,...y("polygons-fill"),...y("polygons-stroke"),...y("linestrings")}};return new Wl(T)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}}SE.layerName="VectorTileLayer";SE.defaultProps=Rxe;var Tn={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},Fxe={2:["#ffc6c4","#672044"],3:["#ffc6c4","#cc607d","#672044"],4:["#ffc6c4","#e38191","#ad466c","#672044"],5:["#ffc6c4","#ee919b","#cc607d","#9e3963","#672044"],6:["#ffc6c4","#f29ca3","#da7489","#b95073","#93345d","#672044"],7:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],tags:["quantitative"]},Oxe={2:["#fbe6c5","#70284a"],3:["#fbe6c5","#dc7176","#70284a"],4:["#fbe6c5","#ee8a82","#c8586c","#70284a"],5:["#fbe6c5","#f2a28a","#dc7176","#b24b65","#70284a"],6:["#fbe6c5","#f4b191","#e7807d","#d06270","#a44360","#70284a"],7:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],tags:["quantitative"]},Dxe={2:["#f6d2a9","#b13f64"],3:["#f6d2a9","#ea8171","#b13f64"],4:["#f6d2a9","#f19c7c","#dd686c","#b13f64"],5:["#f6d2a9","#f3aa84","#ea8171","#d55d6a","#b13f64"],6:["#f6d2a9","#f4b28a","#ef9177","#e3726d","#cf5669","#b13f64"],7:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],tags:["quantitative"]},Lxe={2:["#ecda9a","#ee4d5a"],3:["#ecda9a","#f7945d","#ee4d5a"],4:["#ecda9a","#f3ad6a","#f97b57","#ee4d5a"],5:["#ecda9a","#f1b973","#f7945d","#f86f56","#ee4d5a"],6:["#ecda9a","#f0c079","#f5a363","#f98558","#f76856","#ee4d5a"],7:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],tags:["quantitative"]},Nxe={2:["#fde0c5","#eb4a40"],3:["#fde0c5","#f59e72","#eb4a40"],4:["#fde0c5","#f8b58b","#f2855d","#eb4a40"],5:["#fde0c5","#f9c098","#f59e72","#f17854","#eb4a40"],6:["#fde0c5","#fac7a1","#f7ac80","#f38f65","#f0704f","#eb4a40"],7:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],tags:["quantitative"]},kxe={2:["#fef6b5","#e15383"],3:["#fef6b5","#ffa679","#e15383"],4:["#fef6b5","#ffc285","#fa8a76","#e15383"],5:["#fef6b5","#ffd08e","#ffa679","#f67b77","#e15383"],6:["#fef6b5","#ffd795","#ffb77f","#fd9576","#f37378","#e15383"],7:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],tags:["quantitative"]},Uxe={2:["#e4f1e1","#0d585f"],3:["#e4f1e1","#63a6a0","#0d585f"],4:["#e4f1e1","#89c0b6","#448c8a","#0d585f"],5:["#E4F1E1","#9CCDC1","#63A6A0","#337F7F","#0D585F"],6:["#e4f1e1","#abd4c7","#7ab5ad","#509693","#2c7778","#0d585f"],7:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],tags:["quantitative"]},zxe={2:["#c4e6c3","#1d4f60"],3:["#c4e6c3","#4da284","#1d4f60"],4:["#c4e6c3","#6dbc90","#36877a","#1d4f60"],5:["#c4e6c3","#80c799","#4da284","#2d7974","#1d4f60"],6:["#c4e6c3","#8dce9f","#5fb28b","#3e927e","#297071","#1d4f60"],7:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],tags:["quantitative"]},Gxe={2:["#d2fbd4","#123f5a"],3:["#d2fbd4","#559c9e","#123f5a"],4:["#d2fbd4","#7bbcb0","#3a7c89","#123f5a"],5:["#d2fbd4","#8eccb9","#559c9e","#2b6c7f","#123f5a"],6:["#d2fbd4","#9cd5be","#6cafa9","#458892","#266377","#123f5a"],7:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],tags:["quantitative"]},Vxe={2:["#d3f2a3","#074050"],3:["#d3f2a3","#4c9b82","#074050"],4:["#d3f2a3","#6cc08b","#217a79","#074050"],5:["#d3f2a3","#82d091","#4c9b82","#19696f","#074050"],6:["#d3f2a3","#8fda94","#60b187","#35877d","#145f69","#074050"],7:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],tags:["quantitative"]},Hxe={2:["#245668","#EDEF5D"],3:["#245668","#39AB7E","#EDEF5D"],4:["#245668","#0D8F81","#6EC574","#EDEF5D"],5:["#245668","#04817E","#39AB7E","#8BD16D","#EDEF5D"],6:["#245668","#09787C","#1D9A81","#58BB79","#9DD869","#EDEF5D"],7:["#245668","#0F7279","#0D8F81","#39AB7E","#6EC574","#A9DC67","#EDEF5D"],tags:["aggregation"]},jxe={2:["#f7feae","#045275"],3:["#f7feae","#46aea0","#045275"],4:["#f7feae","#7ccba2","#089099","#045275"],5:["#f7feae","#9bd8a4","#46aea0","#058092","#045275"],6:["#f7feae","#ace1a4","#68bfa1","#2a9c9c","#02778e","#045275"],7:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],tags:["quantitative"]},$xe={2:["#d1eeea","#2a5674"],3:["#d1eeea","#68abb8","#2a5674"],4:["#d1eeea","#85c4c9","#4f90a6","#2a5674"],5:["#d1eeea","#96d0d1","#68abb8","#45829b","#2a5674"],6:["#d1eeea","#a1d7d6","#79bbc3","#599bae","#3f7994","#2a5674"],7:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],tags:["quantitative"]},Wxe={2:["#b0f2bc","#257d98"],3:["#b0f2bc","#4cc8a3","#257d98"],4:["#b0f2bc","#67dba5","#38b2a3","#257d98"],5:["#b0f2bc","#77e2a8","#4cc8a3","#31a6a2","#257d98"],6:["#b0f2bc","#82e6aa","#5bd4a4","#3fbba3","#2e9ea1","#257d98"],7:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],tags:["quantitative"]},Jxe={2:["#f3e0f7","#63589f"],3:["#f3e0f7","#b998dd","#63589f"],4:["#f3e0f7","#d1afe8","#9f82ce","#63589f"],5:["#f3e0f7","#dbbaed","#b998dd","#9178c4","#63589f"],6:["#f3e0f7","#e0c2ef","#c8a5e4","#aa8bd4","#8871be","#63589f"],7:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],tags:["quantitative"]},Xxe={2:["#f9ddda","#573b88"],3:["#f9ddda","#ce78b3","#573b88"],4:["#f9ddda","#e597b9","#ad5fad","#573b88"],5:["#f9ddda","#eda8bd","#ce78b3","#9955a8","#573b88"],6:["#f9ddda","#f0b2c1","#dd8ab6","#bb69b0","#8c4fa4","#573b88"],7:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],tags:["quantitative"]},Kxe={2:["#f3e79b","#5c53a5"],3:["#f3e79b","#eb7f86","#5c53a5"],4:["#f3e79b","#f8a07e","#ce6693","#5c53a5"],5:["#f3e79b","#fab27f","#eb7f86","#b95e9a","#5c53a5"],6:["#f3e79b","#fabc82","#f59280","#dc6f8e","#ab5b9e","#5c53a5"],7:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],tags:["quantitative"]},Yxe={2:["#f3cbd3","#6c2167"],3:["#f3cbd3","#ca699d","#6c2167"],4:["#f3cbd3","#dd88ac","#b14d8e","#6c2167"],5:["#f3cbd3","#e498b4","#ca699d","#a24186","#6c2167"],6:["#f3cbd3","#e7a2b9","#d67ba5","#bc5894","#983a81","#6c2167"],7:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],tags:["quantitative"]},qxe={2:["#fcde9c","#7c1d6f"],3:["#fcde9c","#e34f6f","#7c1d6f"],4:["#fcde9c","#f0746e","#dc3977","#7c1d6f"],5:["#fcde9c","#f58670","#e34f6f","#d72d7c","#7c1d6f"],6:["#fcde9c","#f89872","#ec666d","#df4273","#c5287b","#7c1d6f"],7:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],tags:["quantitative"]},Zxe={2:["#4b2991","#edd9a3"],3:["#4b2991","#ea4f88","#edd9a3"],4:["#4b2991","#c0369d","#fa7876","#edd9a3"],5:["#4b2991","#a52fa2","#ea4f88","#fa9074","#edd9a3"],6:["#4b2991","#932da3","#d43f96","#f7667c","#f89f77","#edd9a3"],7:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"],tags:["aggregation"]},Qxe={2:["#ede5cf","#541f3f"],3:["#ede5cf","#c1766f","#541f3f"],4:["#ede5cf","#d39c83","#a65461","#541f3f"],5:["#ede5cf","#daaf91","#c1766f","#95455a","#541f3f"],6:["#ede5cf","#ddba9b","#cd8c7a","#b26166","#8a3c56","#541f3f"],7:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],tags:["quantitative"]},ewe={2:["#929b4f","#db8195"],3:["#a3ad62","#fdfbe4","#df91a3"],4:["#929b4f","#d9dbaf","#f3d1ca","#db8195"],5:["#879043","#c1c68c","#fdfbe4","#ebb4b8","#d8758b"],6:["#7f883b","#b0b874","#e3e4be","#f6ddd1","#e4a0ac","#d66d85"],7:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],tags:["diverging"]},twe={2:["#3d5941","#ca562c"],3:["#3d5941","#f6edbd","#ca562c"],4:["#3d5941","#b5b991","#edbb8a","#ca562c"],5:["#3d5941","#96a07c","#f6edbd","#e6a272","#ca562c"],6:["#3d5941","#839170","#cecea2","#f1cf9e","#e19464","#ca562c"],7:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},rwe={2:["#008080","#ca562c"],3:["#008080","#f6edbd","#ca562c"],4:["#008080","#b4c8a8","#edbb8a","#ca562c"],5:["#008080","#92b69e","#f6edbd","#e6a272","#ca562c"],6:["#008080","#7eab98","#ced7b1","#f1cf9e","#e19464","#ca562c"],7:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},nwe={2:["#009392","#cf597e"],3:["#009392","#e9e29c","#cf597e"],4:["#009392","#9ccb86","#eeb479","#cf597e"],5:["#009392","#71be83","#e9e29c","#ed9c72","#cf597e"],6:["#009392","#52b684","#bcd48c","#edc783","#eb8d71","#cf597e"],7:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],tags:["diverging"]},iwe={2:["#009392","#d0587e"],3:["#009392","#f1eac8","#d0587e"],4:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],5:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],6:["#009392","#72aaa1","#b1c7b3","#e5b9ad","#d98994","#d0587e"],7:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],tags:["diverging"]},swe={2:["#009B9E","#C75DAB"],3:["#009B9E","#F1F1F1","#C75DAB"],4:["#009B9E","#A7D3D4","#E4C1D9","#C75DAB"],5:["#009B9E","#7CC5C6","#F1F1F1","#DDA9CD","#C75DAB"],6:["#009B9E","#5DBCBE","#C6DFDF","#E9D4E2","#D99BC6","#C75DAB"],7:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],tags:["diverging"]},owe={2:["#A16928","#2887a1"],3:["#A16928","#edeac2","#2887a1"],4:["#A16928","#d6bd8d","#b5c8b8","#2887a1"],5:["#A16928","#caa873","#edeac2","#98b7b2","#2887a1"],6:["#A16928","#c29b64","#e0cfa2","#cbd5bc","#85adaf","#2887a1"],7:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"],tags:["diverging"]},awe={2:["#855C75","#D9AF6B","#7C7C7C"],3:["#855C75","#D9AF6B","#AF6458","#7C7C7C"],4:["#855C75","#D9AF6B","#AF6458","#736F4C","#7C7C7C"],5:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#7C7C7C"],6:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#7C7C7C"],7:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#7C7C7C"],8:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#7C7C7C"],9:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#7C7C7C"],10:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#7C7C7C"],11:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#467378","#7C7C7C"],tags:["qualitative"]},cwe={2:["#7F3C8D","#11A579","#A5AA99"],3:["#7F3C8D","#11A579","#3969AC","#A5AA99"],4:["#7F3C8D","#11A579","#3969AC","#F2B701","#A5AA99"],5:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#A5AA99"],6:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#A5AA99"],7:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#A5AA99"],8:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#A5AA99"],9:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#A5AA99"],10:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#A5AA99"],11:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#4b4b8f","#A5AA99"],tags:["qualitative"]},lwe={2:["#66C5CC","#F6CF71","#B3B3B3"],3:["#66C5CC","#F6CF71","#F89C74","#B3B3B3"],4:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#B3B3B3"],5:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#B3B3B3"],6:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#B3B3B3"],7:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#B3B3B3"],8:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#B3B3B3"],9:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B3B3B3"],10:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#B3B3B3"],11:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#D3B484","#B3B3B3"],tags:["qualitative"]},uwe={2:["#5F4690","#1D6996","#666666"],3:["#5F4690","#1D6996","#38A6A5","#666666"],4:["#5F4690","#1D6996","#38A6A5","#0F8554","#666666"],5:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#666666"],6:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#666666"],7:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#666666"],8:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#666666"],9:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#666666"],10:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#666666"],11:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#994E95","#666666"],tags:["qualitative"]},fwe={2:["#88CCEE","#CC6677","#888888"],3:["#88CCEE","#CC6677","#DDCC77","#888888"],4:["#88CCEE","#CC6677","#DDCC77","#117733","#888888"],5:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#888888"],6:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#888888"],7:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#888888"],8:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#888888"],9:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#888888"],10:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#888888"],11:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#6699CC","#888888"],tags:["qualitative","colorblind"]},hwe={2:["#E58606","#5D69B1","#A5AA99"],3:["#E58606","#5D69B1","#52BCA3","#A5AA99"],4:["#E58606","#5D69B1","#52BCA3","#99C945","#A5AA99"],5:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#A5AA99"],6:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#A5AA99"],7:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#A5AA99"],8:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#A5AA99"],9:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#A5AA99"],10:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#A5AA99"],11:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#CC3A8E","#A5AA99"],tags:["qualitative"]},dwe={...Tn.BuGn,tags:["quantitative"]},Awe={...Tn.BuPu,tags:["quantitative"]},pwe={...Tn.GnBu,tags:["quantitative"]},gwe={...Tn.OrRd,tags:["quantitative"]},mwe={...Tn.PuBu,tags:["quantitative"]},_we={...Tn.PuBuGn,tags:["quantitative"]},ywe={...Tn.PuRd,tags:["quantitative"]},vwe={...Tn.RdPu,tags:["quantitative"]},bwe={...Tn.YlGn,tags:["quantitative"]},xwe={...Tn.YlGnBu,tags:["quantitative"]},wwe={...Tn.YlOrBr,tags:["quantitative"]},Cwe={...Tn.YlOrRd,tags:["quantitative"]},Ewe={...Tn.Accent,tags:["qualitative"]},Twe={...Tn.Dark2,tags:["qualitative"]},Bwe={...Tn.Paired,tags:["qualitative"]},Swe={...Tn.Pastel1,tags:["qualitative"]},Iwe={...Tn.Pastel2,tags:["qualitative"]},Mwe={...Tn.Set1,tags:["qualitative"]},Pwe={...Tn.Set2,tags:["qualitative"]},Rwe={...Tn.Set3,tags:["qualitative"]},Fwe={...Tn.Blues,tags:["quantitative"]},Owe={...Tn.Greens,tags:["quantitative"]},Dwe={...Tn.Greys,tags:["quantitative"]},Lwe={...Tn.Oranges,tags:["quantitative"]},Nwe={...Tn.Purples,tags:["quantitative"]},kwe={...Tn.Reds,tags:["quantitative"]},Uwe={...Tn.BrBG,tags:["diverging"]},zwe={...Tn.PiYG,tags:["diverging"]},Gwe={...Tn.PRGn,tags:["diverging"]},Vwe={...Tn.PuOr,tags:["diverging"]},Hwe={...Tn.RdBu,tags:["diverging"]},jwe={...Tn.RdGy,tags:["diverging"]},$we={...Tn.RdYlBu,tags:["diverging"]},Wwe={...Tn.RdYlGn,tags:["diverging"]},Jwe={...Tn.Spectral,tags:["diverging"]};const Xwe=Object.freeze(Object.defineProperty({__proto__:null,Antique:awe,ArmyRose:ewe,BluGrn:zxe,BluYl:jxe,Bold:cwe,BrwnYl:Qxe,Burg:Fxe,BurgYl:Oxe,DarkMint:Gxe,Earth:owe,Emrld:Vxe,Fall:twe,Geyser:rwe,Magenta:Yxe,Mint:Uxe,OrYel:Lxe,Pastel:lwe,Peach:Nxe,PinkYl:kxe,Prism:uwe,Purp:Jxe,PurpOr:Xxe,RedOr:Dxe,Safe:fwe,Sunset:Kxe,SunsetDark:qxe,Teal:$xe,TealGrn:Wxe,TealRose:iwe,Temps:nwe,Tropic:swe,Vivid:hwe,ag_GrnYl:Hxe,ag_Sunset:Zxe,cb_Accent:Ewe,cb_Blues:Fwe,cb_BrBG:Uwe,cb_BuGn:dwe,cb_BuPu:Awe,cb_Dark2:Twe,cb_GnBu:pwe,cb_Greens:Owe,cb_Greys:Dwe,cb_OrRd:gwe,cb_Oranges:Lwe,cb_PRGn:Gwe,cb_Paired:Bwe,cb_Pastel1:Swe,cb_Pastel2:Iwe,cb_PiYG:zwe,cb_PuBu:mwe,cb_PuBuGn:_we,cb_PuOr:Vwe,cb_PuRd:ywe,cb_Purples:Nwe,cb_RdBu:Hwe,cb_RdGy:jwe,cb_RdPu:vwe,cb_RdYlBu:$we,cb_RdYlGn:Wwe,cb_Reds:kwe,cb_Set1:Mwe,cb_Set2:Pwe,cb_Set3:Rwe,cb_Spectral:Jwe,cb_YlGn:bwe,cb_YlGnBu:xwe,cb_YlOrBr:wwe,cb_YlOrRd:Cwe},Symbol.toStringTag,{value:"Module"})),IE="PurpOr",ME=[204,204,204],Kwe=[119,119,119];function PE(r,e){const t=Xwe[r];let n=e;nh(t,`Palette "${r}" not found. Expected a CARTOColors string`);const i=Object.keys(t).filter(f=>f!=="tags").map(Number),o=Math.max(...i),s=Math.min(...i);!Number.isInteger(e)||e>o?n=o:e<s&&(n=s);let c=t[n];return t.tags&&t.tags.includes("qualitative")&&(c=c.slice(0,-1)),c.map(f=>Ywe(f))}function Ywe(r){let e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r);return e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),255]:(e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),255]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),nh(e,`Hexadecimal color "${r}" was not parsed correctly`),[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)])))}const qwe=Object.freeze(["function","string"]);function RE(r,e,t){var n;return nh(typeof e=="object",'Expected "data" to be an object'),nh(qwe.includes(typeof r),'Expected "attr" to be a function or string'),typeof r=="function"?r(e,t):(n=e==null?void 0:e.properties)==null?void 0:n[r]}function Zwe({attr:r,domain:e,colors:t=IE,nullColor:n=ME}){nh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?PE(t,e.length+1):t,o=a5().domain(e).range(i);return(s,c)=>{const f=RE(r,s,c);return typeof f=="number"&&Number.isFinite(f)?o(f):n}}function Qwe({attr:r,domain:e,colors:t=IE,nullColor:n=ME,othersColor:i=Kwe}){nh(Array.isArray(e),'Expected "domain" to be an array of numbers or strings');const o={},s=typeof t=="string"?PE(t,e.length):t;for(const[c,f]of e.entries())o[f]=s[c];return(c,f)=>{const y=RE(r,c,f);return typeof y=="number"&&Number.isFinite(y)||typeof y=="string"?o[y]||i:n}}function eCe({attr:r,domain:e,colors:t=IE,nullColor:n=ME}){nh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?PE(t,e.length):t,o=c5().domain(e).range(i);return(s,c)=>{const f=RE(r,s,c);return typeof f=="number"&&Number.isFinite(f)?o(f):n}}function tCe({pointCount:r,getBinId:e}){const t=new Map;for(let n=0;n<r;n++){const i=e(n);if(i===null)continue;let o=t.get(String(i));o?o.points.push(n):(o={id:i,index:t.size,points:[n]},t.set(String(i),o))}return Array.from(t.values())}function rCe({bins:r,dimensions:e,target:t}){const n=r.length*e;(!t||t.length<n)&&(t=new Float32Array(n));for(let i=0;i<r.length;i++){const{id:o}=r[i];Array.isArray(o)?t.set(o,i*e):t[i]=o}return t}const nCe=r=>r.length,e9=(r,e)=>{let t=0;for(const n of r)t+=e(n);return t},iCe=(r,e)=>r.length===0?NaN:e9(r,e)/r.length,sCe=(r,e)=>{let t=1/0;for(const n of r){const i=e(n);i<t&&(t=i)}return t},oCe=(r,e)=>{let t=-1/0;for(const n of r){const i=e(n);i>t&&(t=i)}return t},aCe={COUNT:nCe,SUM:e9,MEAN:iCe,MIN:sCe,MAX:oCe};function cCe({bins:r,getValue:e,operation:t,target:n}){(!n||n.length<r.length)&&(n=new Float32Array(r.length));let i=1/0,o=-1/0;for(let s=0;s<r.length;s++){const{points:c}=r[s];n[s]=t(c,e),n[s]<i&&(i=n[s]),n[s]>o&&(o=n[s])}return{value:n,domain:[i,o]}}function KF(r,e,t){const n={};for(const o of r.sources||[]){const s=e[o];if(s)n[o]=lCe(s);else throw new Error(`Cannot find attribute ${o}`)}const i={};return o=>{for(const s in n)i[s]=n[s](o);return r.getValue(i,o,t)}}function lCe(r){const e=r.value,{offset:t=0,stride:n,size:i}=r.getAccessor(),o=e.BYTES_PER_ELEMENT,s=t/o,c=n?n/o:i;if(i===1)return r.isConstant?()=>e[0]:y=>{const b=s+c*y;return e[b]};let f;return r.isConstant?(f=Array.from(e),()=>f):(f=new Array(i),y=>{const b=s+c*y;for(let T=0;T<i;T++)f[T]=e[b+T];return f})}class kA{constructor(e){this.bins=[],this.binIds=null,this.results=[],this.dimensions=e.dimensions,this.channelCount=e.getValue.length,this.props={...e,binOptions:{},pointCount:0,operations:[],customOperations:[],attributes:{}},this.needsUpdate=!0,this.setProps(e)}destroy(){}get binCount(){return this.bins.length}setProps(e){const t=this.props;if(e.binOptions&&(Ki(e.binOptions,t.binOptions,2)||this.setNeedsUpdate()),e.operations)for(let n=0;n<this.channelCount;n++)e.operations[n]!==t.operations[n]&&this.setNeedsUpdate(n);if(e.customOperations)for(let n=0;n<this.channelCount;n++)!!e.customOperations[n]!=!!t.customOperations[n]&&this.setNeedsUpdate(n);e.pointCount!==void 0&&e.pointCount!==t.pointCount&&this.setNeedsUpdate(),e.attributes&&(e.attributes={...t.attributes,...e.attributes}),Object.assign(this.props,e)}setNeedsUpdate(e){e===void 0?this.needsUpdate=!0:this.needsUpdate!==!0&&(this.needsUpdate=this.needsUpdate||[],this.needsUpdate[e]=!0)}update(){var e,t,n,i;if(this.needsUpdate===!0){this.bins=tCe({pointCount:this.props.pointCount,getBinId:KF(this.props.getBin,this.props.attributes,this.props.binOptions)});const o=rCe({bins:this.bins,dimensions:this.dimensions,target:(e=this.binIds)==null?void 0:e.value});this.binIds={value:o,type:"float32",size:this.dimensions}}for(let o=0;o<this.channelCount;o++)if(this.needsUpdate===!0||this.needsUpdate[o]){const s=this.props.customOperations[o]||aCe[this.props.operations[o]],{value:c,domain:f}=cCe({bins:this.bins,getValue:KF(this.props.getValue[o],this.props.attributes,void 0),operation:s,target:(t=this.results[o])==null?void 0:t.value});this.results[o]={value:c,domain:f,type:"float32",size:1},(i=(n=this.props).onUpdate)==null||i.call(n,{channel:o})}this.needsUpdate=!1}preDraw(){}getBins(){return this.binIds}getResult(e){return this.results[e]}getResultDomain(e){var t;return((t=this.results[e])==null?void 0:t.domain)??[1/0,-1/0]}getBin(e){const t=this.bins[e];if(!t)return null;const n=new Array(this.channelCount);for(let i=0;i<n.length;i++){const o=this.results[i];n[i]=o==null?void 0:o.value[e]}return{id:t.id,value:n,count:t.points.length,pointIndices:t.points}}}function t9(r,e,t){return r.createFramebuffer({width:e,height:t,colorAttachments:[r.createTexture({width:e,height:t,format:"rgba32float",mipmaps:!1,sampler:{minFilter:"nearest",magFilter:"nearest"}})]})}const uCe=`uniform binSorterUniforms {
4819
+ `,_xe={...ol.defaultProps,extruded:!1,diskResolution:4,vertices:[[-.5,-.5],[.5,-.5],[.5,.5],[-.5,.5]]};class Wk extends zk(ol){getShaders(){const e=super.getShaders(),t=this.props.data,n=t.data.blockSize??Math.sqrt(t.length);return{...e,defines:{...e.defines,BLOCK_WIDTH:n},vs:mxe}}initializeState(){this.getAttributeManager().addInstanced({instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,type:"unorm8",transition:!0,accessor:"getLineColor",defaultValue:[255,255,255,255]}})}}Wk.layerName="RasterColumnLayer";function yxe(r,e){return r.data===e.data&&r.length===e.length}class CE extends ys{renderLayers(){const{data:e,getElevation:t,getFillColor:n,getLineColor:i,getLineWidth:o,tileIndex:s,updateTriggers:c}=this.props;if(!e||!s)return null;const f=e.blockSize??0,[y,b,T]=Mk(s),S=[y,b],D=T/f,k=this.getSubLayerClass("column",Wk),{highlightedObjectIndex:z,highlightColor:J}=this.state;return new k(this.props,this.getSubLayerProps({id:"cell",updateTriggers:c,getElevation:this.getSubLayerAccessor(t),getFillColor:this.getSubLayerAccessor(n),getLineColor:this.getSubLayerAccessor(i),getLineWidth:this.getSubLayerAccessor(o)}),{data:{data:e,length:f*f},dataComparator:yxe,offset:S,lineWidthScale:D,highlightedObjectIndex:z,highlightColor:J,parameters:{blendColorSrcFactor:"one",blendAlphaSrcFactor:"one",blendColorDstFactor:"zero",blendAlphaDstFactor:"zero",blendColorOperation:"add",blendAlphaOperation:"add"}})}getSubLayerAccessor(e){return typeof e!="function"?super.getSubLayerAccessor(e):(t,n)=>{const{data:i,index:o}=n,s=i.data,c=V2e(s.cells,o);return e({properties:c},n)}}getPickingInfo(e){const t=super.getPickingInfo(e);return t.index!==-1&&(t.object=this.getSubLayerAccessor(n=>n)(void 0,{data:this.props,index:t.index})),t}_updateAutoHighlight(e){const{highlightedObjectIndex:t}=this.state;let n=-1;if(e.index!==-1&&(n=e.index),t!==n){let{highlightColor:i}=this.props;typeof i=="function"&&(i=i(e)),this.setState({highlightColor:i,highlightedObjectIndex:n})}}}CE.layerName="RasterLayer";CE.defaultProps=_xe;const vxe={uint8:Uint8Array,uint16:Uint16Array,uint32:Uint32Array,uint64:BigUint64Array,int8:Int8Array,int16:Int16Array,int32:Int32Array,int64:BigInt64Array,float32:Float32Array,float64:Float64Array};class EE{static read(e,t){return e.readFields(EE._readField,{name:"",type:"",data:null},t)}static _readField(e,t,n){if(e===1)t.name=n.readString();else if(e===2)t.type=n.readString();else if(e===3){const i=vxe[t.type];if(!i)throw Error(`Invalid data type: ${t.type}`);t.data={};const{compression:o}=Kx;Yy(i,n,t.data,{compression:o})}}}let Kx=class Jk{static read(e,t){return e.readFields(Jk._readField,{blockSize:0,bands:[]},t)}static _readField(e,t,n){e===1?t.blockSize=n.readVarint():e===2&&t.bands.push(EE.read(n,n.readVarint()+n.pos))}};const Xk="9.1.8",Kk="cartoRasterTile",bxe={cartoRasterTile:{metadata:null,workerUrl:Zy(Kk,Xk)}},xxe={name:"CARTO Raster Tile",version:Xk,id:Kk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-raster-tile"],category:"geometry",parse:async(r,e)=>WF(r,e),parseSync:WF,worker:!0,options:bxe};function WF(r,e){var c;const t=(c=e==null?void 0:e.cartoRasterTile)==null?void 0:c.metadata;if(!r||!t)return null;Kx.compression=t.compression;const n=qy(r,Kx),{bands:i,blockSize:o}=n,s={};for(let f=0;f<i.length;f++){const{name:y,data:b}=i[f];s[y]=b}return{blockSize:o,cells:{numericProps:s,properties:[]}}}Ig([xxe]);const wxe=r=>{var t,n;const e=(n=(t=r.tile)==null?void 0:t.index)==null?void 0:n.q;return e?new CE(r,{tileIndex:e}):null},Cxe={data:ih,refinementStrategy:"no-overlap",tileSize:NA};class Exe extends Gk(Xl,sxe){filterSubLayer(e){const{tile:t}=e.layer.props;return t?super.filterSubLayer(e):!0}}class TE extends ys{getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e}renderLayers(){const e=this.props.data;if(!e)return null;const{tiles:t,minzoom:n,maxzoom:i,raster_metadata:o}=e,s=this.getSubLayerClass("tile",Exe);return new s(this.props,{id:`raster-tile-layer-${this.props.id}`,data:t,TilesetClass:fE,renderSubLayers:wxe,minZoom:n,maxZoom:i,loadOptions:{cartoRasterTile:{metadata:o},...this.getLoadOptions()}})}}TE.layerName="RasterTileLayer";TE.defaultProps=Cxe;class BE{static read(e,t){return e.readFields(BE._readField,{properties:[],numericProps:{}},t)}static _readField(e,t,n){if(e===1)t.properties.push(mh.read(n,n.readVarint()+n.pos));else if(e===2){const i=_h.read(n,n.readVarint()+n.pos);t.numericProps[i.key]=i.value}}}const Yk="9.1.8",qk="cartoPropertiesTile",Txe={cartoPropertiesTile:{workerUrl:Zy(qk,Yk)}},Bxe={name:"CARTO Properties Tile",version:Yk,id:qk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-properties-tile"],category:"geometry",worker:!0,parse:async(r,e)=>JF(r),parseSync:JF,options:Txe};function JF(r,e){return r?qy(r,BE):null}const Zk="9.1.8",Qk="cartoVectorTile",Sxe={cartoVectorTile:{workerUrl:Zy(Qk,Zk)}},Ixe={name:"CARTO Vector Tile",version:Zk,id:Qk,module:"carto",extensions:["pbf"],mimeTypes:["application/vnd.carto-vector-tile"],category:"geometry",parse:async(r,e)=>XF(r),parseSync:XF,worker:!0,options:Sxe};function Mxe(r,e,{startPosition:t,endPosition:n,indices:i}){const o=r.positions.size,s=t*o,c=n*o,f=r.positions.value.subarray(s,c),y=i.slice(1).map(T=>T-t),b=c8(f,y,o);for(let T=0,S=b.length;T<S;++T)e.push(t+b[T])}function Pxe(r){const{polygonIndices:e,primitivePolygonIndices:t}=r,n=[];let i=0;for(let o=0;o<e.value.length-1;o++){const s=e.value[o],c=e.value[o+1],f=t.value.indexOf(c),y=t.value.subarray(i,f);i=f,Mxe(r,n,{startPosition:s,endPosition:c,indices:y})}r.triangles={value:new Uint32Array(n),size:1}}function XF(r,e){if(!r)return null;const t=qy(r,z2e);return t.polygons&&!t.polygons.triangles&&Pxe(t.polygons),t}Ig([Bxe,Ixe]);const Rxe={...LA.defaultProps,data:ih,dataComparator:ih.equal,tileSize:NA};class SE extends LA{constructor(...e){super(...e)}initializeState(){super.initializeState(),this.setState({binary:!0})}updateState(e){const{props:t}=e;if(t.data){super.updateState(e);const i=new URL(t.data.tiles[0]).searchParams.get("formatTiles")==="mvt";this.setState({mvt:i})}}getLoadOptions(){const e=super.getLoadOptions()||{},t=this.props.data;return Vg(e,t.accessToken),e.gis={format:"binary"},e}async getTileData(e){const t=this.props.data,{tiles:n,properties_tiles:i}=t,o=th(n,e);if(!o)return Promise.reject("Invalid URL");const s=this.getLoadOptions(),{fetch:c}=this.props,{signal:f}=e,y=c(o,{propName:"data",layer:this,loadOptions:s,signal:f});if(!i)return await y;const b=th(i,e);if(!b)return Promise.reject("Invalid properties URL");const T=c(b,{propName:"data",layer:this,loadOptions:s,signal:f}),[S,D]=await Promise.all([y,T]);return S?D?$2e(S,D):S:null}renderSubLayers(e){var D,k,z;if(e.data===null)return null;if(this.state.mvt)return super.renderSubLayers(e);const t=e.tile.bbox,{west:n,south:i,east:o,north:s}=t,c=[new Xy,...e.extensions||[]],f={clipBounds:[n,i,o,s]},y=J=>{var G,j,K;return{[J]:{...f,...(G=e==null?void 0:e._subLayerProps)==null?void 0:G[J],extensions:[...c,...((K=(j=e==null?void 0:e._subLayerProps)==null?void 0:j[J])==null?void 0:K.extensions)||[]]}}},b={"points-text":{type:tv,...(D=e==null?void 0:e._subLayerProps)==null?void 0:D["points-text"],extensions:[new cE,...e.extensions||[],...((z=(k=e==null?void 0:e._subLayerProps)==null?void 0:k["points-text"])==null?void 0:z.extensions)||[]]}},T={...e,autoHighlight:!1,_subLayerProps:{...e._subLayerProps,...b,...y("polygons-fill"),...y("polygons-stroke"),...y("linestrings")}};return new Wl(T)}_isWGS84(){return this.state.mvt?super._isWGS84():!0}}SE.layerName="VectorTileLayer";SE.defaultProps=Rxe;var Tn={YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},Fxe={2:["#ffc6c4","#672044"],3:["#ffc6c4","#cc607d","#672044"],4:["#ffc6c4","#e38191","#ad466c","#672044"],5:["#ffc6c4","#ee919b","#cc607d","#9e3963","#672044"],6:["#ffc6c4","#f29ca3","#da7489","#b95073","#93345d","#672044"],7:["#ffc6c4","#f4a3a8","#e38191","#cc607d","#ad466c","#8b3058","#672044"],tags:["quantitative"]},Oxe={2:["#fbe6c5","#70284a"],3:["#fbe6c5","#dc7176","#70284a"],4:["#fbe6c5","#ee8a82","#c8586c","#70284a"],5:["#fbe6c5","#f2a28a","#dc7176","#b24b65","#70284a"],6:["#fbe6c5","#f4b191","#e7807d","#d06270","#a44360","#70284a"],7:["#fbe6c5","#f5ba98","#ee8a82","#dc7176","#c8586c","#9c3f5d","#70284a"],tags:["quantitative"]},Dxe={2:["#f6d2a9","#b13f64"],3:["#f6d2a9","#ea8171","#b13f64"],4:["#f6d2a9","#f19c7c","#dd686c","#b13f64"],5:["#f6d2a9","#f3aa84","#ea8171","#d55d6a","#b13f64"],6:["#f6d2a9","#f4b28a","#ef9177","#e3726d","#cf5669","#b13f64"],7:["#f6d2a9","#f5b78e","#f19c7c","#ea8171","#dd686c","#ca5268","#b13f64"],tags:["quantitative"]},Lxe={2:["#ecda9a","#ee4d5a"],3:["#ecda9a","#f7945d","#ee4d5a"],4:["#ecda9a","#f3ad6a","#f97b57","#ee4d5a"],5:["#ecda9a","#f1b973","#f7945d","#f86f56","#ee4d5a"],6:["#ecda9a","#f0c079","#f5a363","#f98558","#f76856","#ee4d5a"],7:["#ecda9a","#efc47e","#f3ad6a","#f7945d","#f97b57","#f66356","#ee4d5a"],tags:["quantitative"]},Nxe={2:["#fde0c5","#eb4a40"],3:["#fde0c5","#f59e72","#eb4a40"],4:["#fde0c5","#f8b58b","#f2855d","#eb4a40"],5:["#fde0c5","#f9c098","#f59e72","#f17854","#eb4a40"],6:["#fde0c5","#fac7a1","#f7ac80","#f38f65","#f0704f","#eb4a40"],7:["#fde0c5","#facba6","#f8b58b","#f59e72","#f2855d","#ef6a4c","#eb4a40"],tags:["quantitative"]},kxe={2:["#fef6b5","#e15383"],3:["#fef6b5","#ffa679","#e15383"],4:["#fef6b5","#ffc285","#fa8a76","#e15383"],5:["#fef6b5","#ffd08e","#ffa679","#f67b77","#e15383"],6:["#fef6b5","#ffd795","#ffb77f","#fd9576","#f37378","#e15383"],7:["#fef6b5","#ffdd9a","#ffc285","#ffa679","#fa8a76","#f16d7a","#e15383"],tags:["quantitative"]},Uxe={2:["#e4f1e1","#0d585f"],3:["#e4f1e1","#63a6a0","#0d585f"],4:["#e4f1e1","#89c0b6","#448c8a","#0d585f"],5:["#E4F1E1","#9CCDC1","#63A6A0","#337F7F","#0D585F"],6:["#e4f1e1","#abd4c7","#7ab5ad","#509693","#2c7778","#0d585f"],7:["#e4f1e1","#b4d9cc","#89c0b6","#63a6a0","#448c8a","#287274","#0d585f"],tags:["quantitative"]},zxe={2:["#c4e6c3","#1d4f60"],3:["#c4e6c3","#4da284","#1d4f60"],4:["#c4e6c3","#6dbc90","#36877a","#1d4f60"],5:["#c4e6c3","#80c799","#4da284","#2d7974","#1d4f60"],6:["#c4e6c3","#8dce9f","#5fb28b","#3e927e","#297071","#1d4f60"],7:["#c4e6c3","#96d2a4","#6dbc90","#4da284","#36877a","#266b6e","#1d4f60"],tags:["quantitative"]},Gxe={2:["#d2fbd4","#123f5a"],3:["#d2fbd4","#559c9e","#123f5a"],4:["#d2fbd4","#7bbcb0","#3a7c89","#123f5a"],5:["#d2fbd4","#8eccb9","#559c9e","#2b6c7f","#123f5a"],6:["#d2fbd4","#9cd5be","#6cafa9","#458892","#266377","#123f5a"],7:["#d2fbd4","#a5dbc2","#7bbcb0","#559c9e","#3a7c89","#235d72","#123f5a"],tags:["quantitative"]},Vxe={2:["#d3f2a3","#074050"],3:["#d3f2a3","#4c9b82","#074050"],4:["#d3f2a3","#6cc08b","#217a79","#074050"],5:["#d3f2a3","#82d091","#4c9b82","#19696f","#074050"],6:["#d3f2a3","#8fda94","#60b187","#35877d","#145f69","#074050"],7:["#d3f2a3","#97e196","#6cc08b","#4c9b82","#217a79","#105965","#074050"],tags:["quantitative"]},Hxe={2:["#245668","#EDEF5D"],3:["#245668","#39AB7E","#EDEF5D"],4:["#245668","#0D8F81","#6EC574","#EDEF5D"],5:["#245668","#04817E","#39AB7E","#8BD16D","#EDEF5D"],6:["#245668","#09787C","#1D9A81","#58BB79","#9DD869","#EDEF5D"],7:["#245668","#0F7279","#0D8F81","#39AB7E","#6EC574","#A9DC67","#EDEF5D"],tags:["aggregation"]},jxe={2:["#f7feae","#045275"],3:["#f7feae","#46aea0","#045275"],4:["#f7feae","#7ccba2","#089099","#045275"],5:["#f7feae","#9bd8a4","#46aea0","#058092","#045275"],6:["#f7feae","#ace1a4","#68bfa1","#2a9c9c","#02778e","#045275"],7:["#f7feae","#b7e6a5","#7ccba2","#46aea0","#089099","#00718b","#045275"],tags:["quantitative"]},$xe={2:["#d1eeea","#2a5674"],3:["#d1eeea","#68abb8","#2a5674"],4:["#d1eeea","#85c4c9","#4f90a6","#2a5674"],5:["#d1eeea","#96d0d1","#68abb8","#45829b","#2a5674"],6:["#d1eeea","#a1d7d6","#79bbc3","#599bae","#3f7994","#2a5674"],7:["#d1eeea","#a8dbd9","#85c4c9","#68abb8","#4f90a6","#3b738f","#2a5674"],tags:["quantitative"]},Wxe={2:["#b0f2bc","#257d98"],3:["#b0f2bc","#4cc8a3","#257d98"],4:["#b0f2bc","#67dba5","#38b2a3","#257d98"],5:["#b0f2bc","#77e2a8","#4cc8a3","#31a6a2","#257d98"],6:["#b0f2bc","#82e6aa","#5bd4a4","#3fbba3","#2e9ea1","#257d98"],7:["#b0f2bc","#89e8ac","#67dba5","#4cc8a3","#38b2a3","#2c98a0","#257d98"],tags:["quantitative"]},Jxe={2:["#f3e0f7","#63589f"],3:["#f3e0f7","#b998dd","#63589f"],4:["#f3e0f7","#d1afe8","#9f82ce","#63589f"],5:["#f3e0f7","#dbbaed","#b998dd","#9178c4","#63589f"],6:["#f3e0f7","#e0c2ef","#c8a5e4","#aa8bd4","#8871be","#63589f"],7:["#f3e0f7","#e4c7f1","#d1afe8","#b998dd","#9f82ce","#826dba","#63589f"],tags:["quantitative"]},Xxe={2:["#f9ddda","#573b88"],3:["#f9ddda","#ce78b3","#573b88"],4:["#f9ddda","#e597b9","#ad5fad","#573b88"],5:["#f9ddda","#eda8bd","#ce78b3","#9955a8","#573b88"],6:["#f9ddda","#f0b2c1","#dd8ab6","#bb69b0","#8c4fa4","#573b88"],7:["#f9ddda","#f2b9c4","#e597b9","#ce78b3","#ad5fad","#834ba0","#573b88"],tags:["quantitative"]},Kxe={2:["#f3e79b","#5c53a5"],3:["#f3e79b","#eb7f86","#5c53a5"],4:["#f3e79b","#f8a07e","#ce6693","#5c53a5"],5:["#f3e79b","#fab27f","#eb7f86","#b95e9a","#5c53a5"],6:["#f3e79b","#fabc82","#f59280","#dc6f8e","#ab5b9e","#5c53a5"],7:["#f3e79b","#fac484","#f8a07e","#eb7f86","#ce6693","#a059a0","#5c53a5"],tags:["quantitative"]},Yxe={2:["#f3cbd3","#6c2167"],3:["#f3cbd3","#ca699d","#6c2167"],4:["#f3cbd3","#dd88ac","#b14d8e","#6c2167"],5:["#f3cbd3","#e498b4","#ca699d","#a24186","#6c2167"],6:["#f3cbd3","#e7a2b9","#d67ba5","#bc5894","#983a81","#6c2167"],7:["#f3cbd3","#eaa9bd","#dd88ac","#ca699d","#b14d8e","#91357d","#6c2167"],tags:["quantitative"]},qxe={2:["#fcde9c","#7c1d6f"],3:["#fcde9c","#e34f6f","#7c1d6f"],4:["#fcde9c","#f0746e","#dc3977","#7c1d6f"],5:["#fcde9c","#f58670","#e34f6f","#d72d7c","#7c1d6f"],6:["#fcde9c","#f89872","#ec666d","#df4273","#c5287b","#7c1d6f"],7:["#fcde9c","#faa476","#f0746e","#e34f6f","#dc3977","#b9257a","#7c1d6f"],tags:["quantitative"]},Zxe={2:["#4b2991","#edd9a3"],3:["#4b2991","#ea4f88","#edd9a3"],4:["#4b2991","#c0369d","#fa7876","#edd9a3"],5:["#4b2991","#a52fa2","#ea4f88","#fa9074","#edd9a3"],6:["#4b2991","#932da3","#d43f96","#f7667c","#f89f77","#edd9a3"],7:["#4b2991","#872ca2","#c0369d","#ea4f88","#fa7876","#f6a97a","#edd9a3"],tags:["aggregation"]},Qxe={2:["#ede5cf","#541f3f"],3:["#ede5cf","#c1766f","#541f3f"],4:["#ede5cf","#d39c83","#a65461","#541f3f"],5:["#ede5cf","#daaf91","#c1766f","#95455a","#541f3f"],6:["#ede5cf","#ddba9b","#cd8c7a","#b26166","#8a3c56","#541f3f"],7:["#ede5cf","#e0c2a2","#d39c83","#c1766f","#a65461","#813753","#541f3f"],tags:["quantitative"]},ewe={2:["#929b4f","#db8195"],3:["#a3ad62","#fdfbe4","#df91a3"],4:["#929b4f","#d9dbaf","#f3d1ca","#db8195"],5:["#879043","#c1c68c","#fdfbe4","#ebb4b8","#d8758b"],6:["#7f883b","#b0b874","#e3e4be","#f6ddd1","#e4a0ac","#d66d85"],7:["#798234","#a3ad62","#d0d3a2","#fdfbe4","#f0c6c3","#df91a3","#d46780"],tags:["diverging"]},twe={2:["#3d5941","#ca562c"],3:["#3d5941","#f6edbd","#ca562c"],4:["#3d5941","#b5b991","#edbb8a","#ca562c"],5:["#3d5941","#96a07c","#f6edbd","#e6a272","#ca562c"],6:["#3d5941","#839170","#cecea2","#f1cf9e","#e19464","#ca562c"],7:["#3d5941","#778868","#b5b991","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},rwe={2:["#008080","#ca562c"],3:["#008080","#f6edbd","#ca562c"],4:["#008080","#b4c8a8","#edbb8a","#ca562c"],5:["#008080","#92b69e","#f6edbd","#e6a272","#ca562c"],6:["#008080","#7eab98","#ced7b1","#f1cf9e","#e19464","#ca562c"],7:["#008080","#70a494","#b4c8a8","#f6edbd","#edbb8a","#de8a5a","#ca562c"],tags:["diverging"]},nwe={2:["#009392","#cf597e"],3:["#009392","#e9e29c","#cf597e"],4:["#009392","#9ccb86","#eeb479","#cf597e"],5:["#009392","#71be83","#e9e29c","#ed9c72","#cf597e"],6:["#009392","#52b684","#bcd48c","#edc783","#eb8d71","#cf597e"],7:["#009392","#39b185","#9ccb86","#e9e29c","#eeb479","#e88471","#cf597e"],tags:["diverging"]},iwe={2:["#009392","#d0587e"],3:["#009392","#f1eac8","#d0587e"],4:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],5:["#009392","#91b8aa","#f1eac8","#dfa0a0","#d0587e"],6:["#009392","#72aaa1","#b1c7b3","#e5b9ad","#d98994","#d0587e"],7:["#009392","#72aaa1","#b1c7b3","#f1eac8","#e5b9ad","#d98994","#d0587e"],tags:["diverging"]},swe={2:["#009B9E","#C75DAB"],3:["#009B9E","#F1F1F1","#C75DAB"],4:["#009B9E","#A7D3D4","#E4C1D9","#C75DAB"],5:["#009B9E","#7CC5C6","#F1F1F1","#DDA9CD","#C75DAB"],6:["#009B9E","#5DBCBE","#C6DFDF","#E9D4E2","#D99BC6","#C75DAB"],7:["#009B9E","#42B7B9","#A7D3D4","#F1F1F1","#E4C1D9","#D691C1","#C75DAB"],tags:["diverging"]},owe={2:["#A16928","#2887a1"],3:["#A16928","#edeac2","#2887a1"],4:["#A16928","#d6bd8d","#b5c8b8","#2887a1"],5:["#A16928","#caa873","#edeac2","#98b7b2","#2887a1"],6:["#A16928","#c29b64","#e0cfa2","#cbd5bc","#85adaf","#2887a1"],7:["#A16928","#bd925a","#d6bd8d","#edeac2","#b5c8b8","#79a7ac","#2887a1"],tags:["diverging"]},awe={2:["#855C75","#D9AF6B","#7C7C7C"],3:["#855C75","#D9AF6B","#AF6458","#7C7C7C"],4:["#855C75","#D9AF6B","#AF6458","#736F4C","#7C7C7C"],5:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#7C7C7C"],6:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#7C7C7C"],7:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#7C7C7C"],8:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#7C7C7C"],9:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#7C7C7C"],10:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#7C7C7C"],11:["#855C75","#D9AF6B","#AF6458","#736F4C","#526A83","#625377","#68855C","#9C9C5E","#A06177","#8C785D","#467378","#7C7C7C"],tags:["qualitative"]},cwe={2:["#7F3C8D","#11A579","#A5AA99"],3:["#7F3C8D","#11A579","#3969AC","#A5AA99"],4:["#7F3C8D","#11A579","#3969AC","#F2B701","#A5AA99"],5:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#A5AA99"],6:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#A5AA99"],7:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#A5AA99"],8:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#A5AA99"],9:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#A5AA99"],10:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#A5AA99"],11:["#7F3C8D","#11A579","#3969AC","#F2B701","#E73F74","#80BA5A","#E68310","#008695","#CF1C90","#f97b72","#4b4b8f","#A5AA99"],tags:["qualitative"]},lwe={2:["#66C5CC","#F6CF71","#B3B3B3"],3:["#66C5CC","#F6CF71","#F89C74","#B3B3B3"],4:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#B3B3B3"],5:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#B3B3B3"],6:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#B3B3B3"],7:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#B3B3B3"],8:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#B3B3B3"],9:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B3B3B3"],10:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#B3B3B3"],11:["#66C5CC","#F6CF71","#F89C74","#DCB0F2","#87C55F","#9EB9F3","#FE88B1","#C9DB74","#8BE0A4","#B497E7","#D3B484","#B3B3B3"],tags:["qualitative"]},uwe={2:["#5F4690","#1D6996","#666666"],3:["#5F4690","#1D6996","#38A6A5","#666666"],4:["#5F4690","#1D6996","#38A6A5","#0F8554","#666666"],5:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#666666"],6:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#666666"],7:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#666666"],8:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#666666"],9:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#666666"],10:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#666666"],11:["#5F4690","#1D6996","#38A6A5","#0F8554","#73AF48","#EDAD08","#E17C05","#CC503E","#94346E","#6F4070","#994E95","#666666"],tags:["qualitative"]},fwe={2:["#88CCEE","#CC6677","#888888"],3:["#88CCEE","#CC6677","#DDCC77","#888888"],4:["#88CCEE","#CC6677","#DDCC77","#117733","#888888"],5:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#888888"],6:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#888888"],7:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#888888"],8:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#888888"],9:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#888888"],10:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#888888"],11:["#88CCEE","#CC6677","#DDCC77","#117733","#332288","#AA4499","#44AA99","#999933","#882255","#661100","#6699CC","#888888"],tags:["qualitative","colorblind"]},hwe={2:["#E58606","#5D69B1","#A5AA99"],3:["#E58606","#5D69B1","#52BCA3","#A5AA99"],4:["#E58606","#5D69B1","#52BCA3","#99C945","#A5AA99"],5:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#A5AA99"],6:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#A5AA99"],7:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#A5AA99"],8:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#A5AA99"],9:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#A5AA99"],10:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#A5AA99"],11:["#E58606","#5D69B1","#52BCA3","#99C945","#CC61B0","#24796C","#DAA51B","#2F8AC4","#764E9F","#ED645A","#CC3A8E","#A5AA99"],tags:["qualitative"]},dwe={...Tn.BuGn,tags:["quantitative"]},Awe={...Tn.BuPu,tags:["quantitative"]},pwe={...Tn.GnBu,tags:["quantitative"]},gwe={...Tn.OrRd,tags:["quantitative"]},mwe={...Tn.PuBu,tags:["quantitative"]},_we={...Tn.PuBuGn,tags:["quantitative"]},ywe={...Tn.PuRd,tags:["quantitative"]},vwe={...Tn.RdPu,tags:["quantitative"]},bwe={...Tn.YlGn,tags:["quantitative"]},xwe={...Tn.YlGnBu,tags:["quantitative"]},wwe={...Tn.YlOrBr,tags:["quantitative"]},Cwe={...Tn.YlOrRd,tags:["quantitative"]},Ewe={...Tn.Accent,tags:["qualitative"]},Twe={...Tn.Dark2,tags:["qualitative"]},Bwe={...Tn.Paired,tags:["qualitative"]},Swe={...Tn.Pastel1,tags:["qualitative"]},Iwe={...Tn.Pastel2,tags:["qualitative"]},Mwe={...Tn.Set1,tags:["qualitative"]},Pwe={...Tn.Set2,tags:["qualitative"]},Rwe={...Tn.Set3,tags:["qualitative"]},Fwe={...Tn.Blues,tags:["quantitative"]},Owe={...Tn.Greens,tags:["quantitative"]},Dwe={...Tn.Greys,tags:["quantitative"]},Lwe={...Tn.Oranges,tags:["quantitative"]},Nwe={...Tn.Purples,tags:["quantitative"]},kwe={...Tn.Reds,tags:["quantitative"]},Uwe={...Tn.BrBG,tags:["diverging"]},zwe={...Tn.PiYG,tags:["diverging"]},Gwe={...Tn.PRGn,tags:["diverging"]},Vwe={...Tn.PuOr,tags:["diverging"]},Hwe={...Tn.RdBu,tags:["diverging"]},jwe={...Tn.RdGy,tags:["diverging"]},$we={...Tn.RdYlBu,tags:["diverging"]},Wwe={...Tn.RdYlGn,tags:["diverging"]},Jwe={...Tn.Spectral,tags:["diverging"]};const Xwe=Object.freeze(Object.defineProperty({__proto__:null,Antique:awe,ArmyRose:ewe,BluGrn:zxe,BluYl:jxe,Bold:cwe,BrwnYl:Qxe,Burg:Fxe,BurgYl:Oxe,DarkMint:Gxe,Earth:owe,Emrld:Vxe,Fall:twe,Geyser:rwe,Magenta:Yxe,Mint:Uxe,OrYel:Lxe,Pastel:lwe,Peach:Nxe,PinkYl:kxe,Prism:uwe,Purp:Jxe,PurpOr:Xxe,RedOr:Dxe,Safe:fwe,Sunset:Kxe,SunsetDark:qxe,Teal:$xe,TealGrn:Wxe,TealRose:iwe,Temps:nwe,Tropic:swe,Vivid:hwe,ag_GrnYl:Hxe,ag_Sunset:Zxe,cb_Accent:Ewe,cb_Blues:Fwe,cb_BrBG:Uwe,cb_BuGn:dwe,cb_BuPu:Awe,cb_Dark2:Twe,cb_GnBu:pwe,cb_Greens:Owe,cb_Greys:Dwe,cb_OrRd:gwe,cb_Oranges:Lwe,cb_PRGn:Gwe,cb_Paired:Bwe,cb_Pastel1:Swe,cb_Pastel2:Iwe,cb_PiYG:zwe,cb_PuBu:mwe,cb_PuBuGn:_we,cb_PuOr:Vwe,cb_PuRd:ywe,cb_Purples:Nwe,cb_RdBu:Hwe,cb_RdGy:jwe,cb_RdPu:vwe,cb_RdYlBu:$we,cb_RdYlGn:Wwe,cb_Reds:kwe,cb_Set1:Mwe,cb_Set2:Pwe,cb_Set3:Rwe,cb_Spectral:Jwe,cb_YlGn:bwe,cb_YlGnBu:xwe,cb_YlOrBr:wwe,cb_YlOrRd:Cwe},Symbol.toStringTag,{value:"Module"})),IE="PurpOr",ME=[204,204,204],Kwe=[119,119,119];function PE(r,e){const t=Xwe[r];let n=e;nh(t,`Palette "${r}" not found. Expected a CARTOColors string`);const i=Object.keys(t).filter(f=>f!=="tags").map(Number),o=Math.max(...i),s=Math.min(...i);!Number.isInteger(e)||e>o?n=o:e<s&&(n=s);let c=t[n];return t.tags&&t.tags.includes("qualitative")&&(c=c.slice(0,-1)),c.map(f=>Ywe(f))}function Ywe(r){let e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r);return e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),255]:(e=/^#?([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})([a-f\d]{1})$/i.exec(r),e?[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16),parseInt(e[4]+e[4],16)]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),e?[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),255]:(e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),nh(e,`Hexadecimal color "${r}" was not parsed correctly`),[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16)])))}const qwe=Object.freeze(["function","string"]);function RE(r,e,t){var n;return nh(typeof e=="object",'Expected "data" to be an object'),nh(qwe.includes(typeof r),'Expected "attr" to be a function or string'),typeof r=="function"?r(e,t):(n=e==null?void 0:e.properties)==null?void 0:n[r]}function Zwe({attr:r,domain:e,colors:t=IE,nullColor:n=ME}){nh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?PE(t,e.length+1):t,o=a5().domain(e).range(i);return(s,c)=>{const f=RE(r,s,c);return typeof f=="number"&&Number.isFinite(f)?o(f):n}}function Qwe({attr:r,domain:e,colors:t=IE,nullColor:n=ME,othersColor:i=Kwe}){nh(Array.isArray(e),'Expected "domain" to be an array of numbers or strings');const o={},s=typeof t=="string"?PE(t,e.length):t;for(const[c,f]of e.entries())o[f]=s[c];return(c,f)=>{const y=RE(r,c,f);return typeof y=="number"&&Number.isFinite(y)||typeof y=="string"?o[y]||i:n}}function eCe({attr:r,domain:e,colors:t=IE,nullColor:n=ME}){nh(Array.isArray(e),'Expected "domain" to be an array of numbers');const i=typeof t=="string"?PE(t,e.length):t,o=c5().domain(e).range(i);return(s,c)=>{const f=RE(r,s,c);return typeof f=="number"&&Number.isFinite(f)?o(f):n}}function tCe({pointCount:r,getBinId:e}){const t=new Map;for(let n=0;n<r;n++){const i=e(n);if(i===null)continue;let o=t.get(String(i));o?o.points.push(n):(o={id:i,index:t.size,points:[n]},t.set(String(i),o))}return Array.from(t.values())}function rCe({bins:r,dimensions:e,target:t}){const n=r.length*e;(!t||t.length<n)&&(t=new Float32Array(n));for(let i=0;i<r.length;i++){const{id:o}=r[i];Array.isArray(o)?t.set(o,i*e):t[i]=o}return t}const nCe=r=>r.length,e9=(r,e)=>{let t=0;for(const n of r)t+=e(n);return t},iCe=(r,e)=>r.length===0?NaN:e9(r,e)/r.length,sCe=(r,e)=>{let t=1/0;for(const n of r){const i=e(n);i<t&&(t=i)}return t},oCe=(r,e)=>{let t=-1/0;for(const n of r){const i=e(n);i>t&&(t=i)}return t},aCe={COUNT:nCe,SUM:e9,MEAN:iCe,MIN:sCe,MAX:oCe};function cCe({bins:r,getValue:e,operation:t,target:n}){(!n||n.length<r.length)&&(n=new Float32Array(r.length));let i=1/0,o=-1/0;for(let s=0;s<r.length;s++){const{points:c}=r[s];n[s]=t(c,e),n[s]<i&&(i=n[s]),n[s]>o&&(o=n[s])}return{value:n,domain:[i,o]}}function KF(r,e,t){const n={};for(const o of r.sources||[]){const s=e[o];if(s)n[o]=lCe(s);else throw new Error(`Cannot find attribute ${o}`)}const i={};return o=>{for(const s in n)i[s]=n[s](o);return r.getValue(i,o,t)}}function lCe(r){const e=r.value,{offset:t=0,stride:n,size:i}=r.getAccessor(),o=e.BYTES_PER_ELEMENT,s=t/o,c=n?n/o:i;if(i===1)return r.isConstant?()=>e[0]:y=>{const b=s+c*y;return e[b]};let f;return r.isConstant?(f=Array.from(e),()=>f):(f=new Array(i),y=>{const b=s+c*y;for(let T=0;T<i;T++)f[T]=e[b+T];return f})}class kA{constructor(e){this.bins=[],this.binIds=null,this.results=[],this.dimensions=e.dimensions,this.channelCount=e.getValue.length,this.props={...e,binOptions:{},pointCount:0,operations:[],customOperations:[],attributes:{}},this.needsUpdate=!0,this.setProps(e)}destroy(){}get binCount(){return this.bins.length}setProps(e){const t=this.props;if(e.binOptions&&(Ki(e.binOptions,t.binOptions,2)||this.setNeedsUpdate()),e.operations)for(let n=0;n<this.channelCount;n++)e.operations[n]!==t.operations[n]&&this.setNeedsUpdate(n);if(e.customOperations)for(let n=0;n<this.channelCount;n++)!!e.customOperations[n]!=!!t.customOperations[n]&&this.setNeedsUpdate(n);e.pointCount!==void 0&&e.pointCount!==t.pointCount&&this.setNeedsUpdate(),e.attributes&&(e.attributes={...t.attributes,...e.attributes}),Object.assign(this.props,e)}setNeedsUpdate(e){e===void 0?this.needsUpdate=!0:this.needsUpdate!==!0&&(this.needsUpdate=this.needsUpdate||[],this.needsUpdate[e]=!0)}update(){var e,t,n,i;if(this.needsUpdate===!0){this.bins=tCe({pointCount:this.props.pointCount,getBinId:KF(this.props.getBin,this.props.attributes,this.props.binOptions)});const o=rCe({bins:this.bins,dimensions:this.dimensions,target:(e=this.binIds)==null?void 0:e.value});this.binIds={value:o,type:"float32",size:this.dimensions}}for(let o=0;o<this.channelCount;o++)if(this.needsUpdate===!0||this.needsUpdate[o]){const s=this.props.customOperations[o]||aCe[this.props.operations[o]],{value:c,domain:f}=cCe({bins:this.bins,getValue:KF(this.props.getValue[o],this.props.attributes,void 0),operation:s,target:(t=this.results[o])==null?void 0:t.value});this.results[o]={value:c,domain:f,type:"float32",size:1},(i=(n=this.props).onUpdate)==null||i.call(n,{channel:o})}this.needsUpdate=!1}preDraw(){}getBins(){return this.binIds}getResult(e){return this.results[e]}getResultDomain(e){var t;return((t=this.results[e])==null?void 0:t.domain)??[1/0,-1/0]}getBin(e){const t=this.bins[e];if(!t)return null;const n=new Array(this.channelCount);for(let i=0;i<n.length;i++){const o=this.results[i];n[i]=o==null?void 0:o.value[e]}return{id:t.id,value:n,count:t.points.length,pointIndices:t.points}}}function t9(r,e,t){return r.createFramebuffer({width:e,height:t,colorAttachments:[r.createTexture({width:e,height:t,format:"rgba32float",mipmaps:!1,sampler:{minFilter:"nearest",magFilter:"nearest"}})]})}const uCe=`uniform binSorterUniforms {
4820
4820
  ivec4 binIdRange;
4821
4821
  ivec2 targetSize;
4822
4822
  } binSorter;