@iqmo/browser
Version:
Browser Stlite
31 lines (27 loc) • 2.71 MB
JavaScript
import{r as Te,ar as Ci,bs as Ae,g as zh,bt as sU,bu as Ou,_ as AB,a$ as aU,j as Yc,c as gB,b7 as mB,bc as yB,J as G_,bv as vB,b3 as cU,L as lU,ao as uU,bw as hU,bx as _B}from"./index-0xtYjrTa.js";import{_ as ho,C as fU}from"./slicedToArray-jp0S0lag.js";import{a as Lu,b as Fu,_ as j_,c as gd,d as V_}from"./inherits-BtEWVlTb.js";import{E as bB,w as dU}from"./withFullScreenWrapper-tZtkO1Wh.js";import{T as pU,a as AU}from"./Toolbar-F9eB7347.js";import{u as gU}from"./useBasicWidgetState-0Cg3lNvA.js";import{u as mU,s as yU}from"./threshold-CT01Jj2z.js";function vU(e,t){for(var i=0;i<t.length;i++){const n=t[i];if(typeof n!="string"&&!Array.isArray(n)){for(const r in n)if(r!=="default"&&!(r in e)){const s=Object.getOwnPropertyDescriptor(n,r);s&&Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:()=>n[r]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}function Um(e,t){if(!e)throw new Error(t||"loader assertion failed.")}const H_=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),xB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);xB&&parseFloat(xB[1]);const wB=globalThis,CB=globalThis.process||{};function _U(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function W_(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||_U()}const EB="4.0.7";function bU(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch{return null}}let xU=class{constructor(e,t,i="sessionStorage"){this.storage=bU(i),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 wU(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function CU(e,t=8){const i=Math.max(t-e.length,0);return`${" ".repeat(i)}${e}`}var zm;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(zm||(zm={}));const EU=10;function BB(e){return typeof e!="string"?e:(e=e.toUpperCase(),zm[e]||zm.WHITE)}function BU(e,t,i){return!W_&&typeof e=="string"&&(t&&(e=`\x1B[${BB(t)}m${e}\x1B[39m`),i&&(e=`\x1B[${BB(i)+EU}m${e}\x1B[49m`)),e}function TU(e,t=["constructor"]){const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),r=e;for(const s of n){const o=r[s];typeof o=="function"&&(t.find(c=>s===c)||(r[s]=o.bind(e)))}}function J_(e,t){if(!e)throw new Error("Assertion failed")}function md(){let e;if(W_()&&wB.performance)e=wB?.performance?.now?.();else if("hrtime"in CB){const t=CB?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}const yd={debug:W_()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},SU={enabled:!0,level:0};function vd(){}const TB={},SB={once:!0};let IB=class{constructor({id:e}={id:""}){this.VERSION=EB,this._startTs=md(),this._deltaTs=md(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new xU(`__probe-${this.id}__`,SU),this.timeStamp(`${this.id} started`),TU(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((md()-this._startTs).toPrecision(10))}getDelta(){return Number((md()-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,yd.warn,arguments,SB)}error(e){return this._getLogFunction(0,e,yd.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,yd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,yd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,yd.debug||yd.info,arguments,SB)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||vd,i&&[i],{tag:MU(t)}):vd}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||vd)}group(e,t,i={collapsed:!1}){const n=PB({logLevel:e,message:t,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||vd)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=MB(e)}_getLogFunction(e,t,i,n,r){if(this._shouldLog(e)){r=PB({logLevel:e,message:t,args:n,opts:r}),i=i||r.method,J_(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=md();const s=r.tag||r.message;if(r.once&&s)if(!TB[s])TB[s]=md();else return vd;return t=IU(this.id,r.message,r),i.bind(console,t,...r.args)}return vd}};IB.VERSION=EB;function MB(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return J_(Number.isFinite(t)&&t>=0),t}function PB(e){const{logLevel:t,message:i}=e;e.logLevel=MB(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":i!==void 0&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t);break}typeof e.message=="function"&&(e.message=e.message());const r=typeof e.message;return J_(r==="string"||r==="object"),Object.assign(e,{args:n},e.opts)}function IU(e,t,i){if(typeof t=="string"){const n=i.time?CU(wU(i.total)):"";t=i.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=BU(t,i.color,i.background)}return t}function MU(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}const X_="4.3.1",PU=X_[0]>="0"&&X_[0]<="9"?`v${X_}`:"";function RU(){const e=new IB({id:"loaders.gl"});return globalThis.loaders=globalThis.loaders||{},globalThis.loaders.log=e,globalThis.loaders.version=PU,globalThis.probe=globalThis.probe||{},globalThis.probe.loaders=e,e}const DU=RU();function OU(e,t){return RB(e||{},t)}function RB(e,t,i=0){if(i>3)return t;const n={...e};for(const[r,s]of Object.entries(t))s&&typeof s=="object"&&!Array.isArray(s)?n[r]=RB(n[r]||{},t[r],i+1):n[r]=t[r];return n}const LU="latest";function FU(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.1"),globalThis._loadersgl_.version}const kU=FU();function ku(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}const Gh=typeof process!="object"||String(process)!=="[object process]"||process.browser,NU=typeof window<"u"&&typeof window.orientation<"u",DB=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version);DB&&parseFloat(DB[1]);let UU=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(e,t){this.name=e,this.workerThread=t,this.result=new Promise((i,n)=>{this._resolve=i,this._reject=n})}postMessage(e,t){this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t})}done(e){ku(this.isRunning),this.isRunning=!1,this._resolve(e)}error(e){ku(this.isRunning),this.isRunning=!1,this._reject(e)}},Q_=class{terminate(){}};const K_=new Map;function zU(e){ku(e.source&&!e.url||!e.source&&e.url);let t=K_.get(e.source||e.url);return t||(e.url&&(t=GU(e.url),K_.set(e.url,t)),e.source&&(t=OB(e.source),K_.set(e.source,t))),ku(t),t}function GU(e){if(!e.startsWith("http"))return e;const t=jU(e);return OB(t)}function OB(e){const t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function jU(e){return`try {
importScripts('${e}');
} catch (error) {
console.error(error);
throw error;
}`}function LB(e,t=!0,i){const n=i||new Set;if(e){if(FB(e))n.add(e);else if(FB(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)&&t&&typeof e=="object")for(const r in e)LB(e[r],t,n)}return i===void 0?Array.from(n):[]}function FB(e){return e?e instanceof ArrayBuffer||typeof MessagePort<"u"&&e instanceof MessagePort||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas:!1}const q_=()=>{};let Z_=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Gh||typeof Q_<"u"&&!Gh}constructor(e){const{name:t,source:i,url:n}=e;ku(i||n),this.name=t,this.source=i,this.url=n,this.onMessage=q_,this.onError=r=>console.log(r),this.worker=Gh?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=q_,this.onError=q_,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||LB(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=zU({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 t=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new Q_(t,{eval:!1})}else if(this.source)e=new Q_(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}},VU=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Z_.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},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=(n,r,s)=>n.done(s),i=(n,r)=>n.error(r)){const n=new Promise(r=>(this.jobQueue.push({name:e,onMessage:t,onError:i,onStart:r}),this));return this._startQueuedJob(),await n}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 i=new UU(t.name,e);e.onMessage=n=>t.onMessage(i,n.type,n.payload),e.onError=n=>t.onError(i,n),t.onStart(i);try{await i.result}catch(n){console.error(`Worker exception: ${n}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Gh||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 Z_({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return NU?this.maxMobileConcurrency:this.maxConcurrency}};const HU={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};let kB=class tA{props;workerPools=new Map;static _workerFarm;static isSupported(){return Z_.isSupported()}static getWorkerFarm(t={}){return tA._workerFarm=tA._workerFarm||new tA({}),tA._workerFarm.setProps(t),tA._workerFarm}constructor(t){this.props={...HU},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const i of this.workerPools.values())i.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:i,source:n,url:r}=t;let s=this.workerPools.get(i);return s||(s=new VU({name:i,source:n,url:r}),s.setProps(this._getWorkerPoolProps()),this.workerPools.set(i,s)),s}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};function WU(e,t={}){const i=t[e.id]||{},n=Gh?`${e.id}-worker.js`:`${e.id}-worker-node.js`;let r=i.workerUrl;if(!r&&e.id==="compression"&&(r=t.workerUrl),t._workerType==="test"&&(Gh?r=`modules/${e.module}/dist/${n}`:r=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!r){let s=e.version;s==="latest"&&(s=LU);const o=s?`@${s}`:"";r=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return ku(r),r}function JU(e,t=kU){ku(e,"no worker provided");const i=e.version;return!(!t||!i)}const Nu={};function XU(e,t){return!kB.isSupported()||!Gh&&!t?._nodeWorkers?!1:e.worker&&t?.worker}async function QU(e,t,i,n,r){const s=e.id,o=WU(e,i),c=kB.getWorkerFarm(i).getWorkerPool({name:s,url:o});i=JSON.parse(JSON.stringify(i)),n=JSON.parse(JSON.stringify(n||{}));const h=await c.startJob("process-on-worker",KU.bind(null,r));return h.postMessage("process",{input:t,options:i,context:n}),await(await h.result).result}async function KU(e,t,i,n){switch(i){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":const{id:r,input:s,options:o}=n;try{const c=await e(s,o);t.postMessage("done",{id:r,result:c})}catch(c){const h=c instanceof Error?c.message:"unknown error";t.postMessage("error",{id:r,error:h})}break;default:console.warn(`parse-with-worker unknown message ${i}`)}}function qU(e,t,i){if(i=i||e.byteLength,e.byteLength<i||t.byteLength<i)return!1;const n=new Uint8Array(e),r=new Uint8Array(t);for(let s=0;s<n.length;++s)if(n[s]!==r[s])return!1;return!0}function ZU(...e){return YU(e)}function YU(e){const t=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),i=t.reduce((s,o)=>s+o.byteLength,0),n=new Uint8Array(i);let r=0;for(const s of t)n.set(s,r),r+=s.byteLength;return n.buffer}async function $U(e){const t=[];for await(const i of e)t.push(i);return ZU(...t)}let tz="";const NB={};function ez(e){for(const t in NB)if(e.startsWith(t)){const i=NB[t];e=e.replace(t,i)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${tz}${e}`),e}function iz(e){return e&&typeof e=="object"&&e.isBuffer}function UB(e){if(iz(e)||e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){const t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function zB(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function nz(e){const t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}const rz=e=>typeof e=="boolean",kA=e=>typeof e=="function",NA=e=>e!==null&&typeof e=="object",GB=e=>NA(e)&&e.constructor==={}.constructor,oz=e=>!!e&&typeof e[Symbol.iterator]=="function",sz=e=>e&&typeof e[Symbol.asyncIterator]=="function",jh=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json,Vh=e=>typeof Blob<"u"&&e instanceof Blob,az=e=>e&&typeof e=="object"&&e.isBuffer,cz=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||NA(e)&&kA(e.tee)&&kA(e.cancel)&&kA(e.getReader),lz=e=>NA(e)&&kA(e.read)&&kA(e.pipe)&&rz(e.readable),jB=e=>cz(e)||lz(e);let uz=class extends Error{constructor(e,t){super(e),this.reason=t.reason,this.url=t.url,this.response=t.response}reason;url;response};const hz=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,fz=/^([-\w.]+\/[-\w.+]+)/;function VB(e,t){return e.toLowerCase()===t.toLowerCase()}function dz(e){const t=fz.exec(e);return t?t[1]:e}function HB(e){const t=hz.exec(e);return t?t[1]:""}const WB=/\?.*/;function pz(e){const t=e.match(WB);return t&&t[0]}function Y_(e){return e.replace(WB,"")}function Az(e){if(e.length<50)return e;const t=e.slice(e.length-15);return`${e.substr(0,32)}...${t}`}function Gm(e){return jh(e)?e.url:Vh(e)?e.name||"":typeof e=="string"?e:""}function $_(e){if(jh(e)){const t=e,i=t.headers.get("content-type")||"",n=Y_(t.url);return dz(i)||HB(n)}return Vh(e)?e.type||"":typeof e=="string"?HB(e):""}function gz(e){return jh(e)?e.headers["content-length"]||-1:Vh(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function JB(e){if(jh(e))return e;const t={},i=gz(e);i>=0&&(t["content-length"]=String(i));const n=Gm(e),r=$_(e);r&&(t["content-type"]=r);const s=await vz(e);s&&(t["x-first-bytes"]=s),typeof e=="string"&&(e=new TextEncoder().encode(e));const o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function mz(e){if(!e.ok)throw await yz(e)}async function yz(e){const t=Az(e.url);let i=`Failed to fetch resource (${e.status}) ${e.statusText}: ${t}`;i=i.length>100?`${i.slice(0,100)}...`:i;const n={reason:e.statusText,url:e.url,response:e};try{const r=e.headers.get("Content-Type");n.reason=!e.bodyUsed&&r?.includes("application/json")?await e.json():await e.text()}catch{}return new uz(i,n)}async function vz(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){const t=e.slice(0,5);return await new Promise(i=>{const n=new FileReader;n.onload=r=>i(r?.target?.result),n.readAsDataURL(t)})}if(e instanceof ArrayBuffer){const t=e.slice(0,5);return`data:base64,${_z(t)}`}return null}function _z(e){let t="";const i=new Uint8Array(e);for(let n=0;n<i.byteLength;n++)t+=String.fromCharCode(i[n]);return btoa(t)}function bz(e){return!xz(e)&&!wz(e)}function xz(e){return e.startsWith("http:")||e.startsWith("https:")}function wz(e){return e.startsWith("data:")}async function XB(e,t){if(typeof e=="string"){const i=ez(e);return bz(i)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(i,t):await fetch(i,t)}return await JB(e)}const QB=globalThis,KB=globalThis.process||{};function Cz(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function t1(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||Cz()}const qB="4.0.7";function Ez(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch{return null}}let Bz=class{constructor(e,t,i="sessionStorage"){this.storage=Ez(i),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 Tz(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function Sz(e,t=8){const i=Math.max(t-e.length,0);return`${" ".repeat(i)}${e}`}var jm;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(jm||(jm={}));const Iz=10;function ZB(e){return typeof e!="string"?e:(e=e.toUpperCase(),jm[e]||jm.WHITE)}function Mz(e,t,i){return!t1&&typeof e=="string"&&(t&&(e=`\x1B[${ZB(t)}m${e}\x1B[39m`),i&&(e=`\x1B[${ZB(i)+Iz}m${e}\x1B[49m`)),e}function Pz(e,t=["constructor"]){const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),r=e;for(const s of n){const o=r[s];typeof o=="function"&&(t.find(c=>s===c)||(r[s]=o.bind(e)))}}function e1(e,t){if(!e)throw new Error("Assertion failed")}function _d(){let e;if(t1()&&QB.performance)e=QB?.performance?.now?.();else if("hrtime"in KB){const t=KB?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}const bd={debug:t1()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},Rz={enabled:!0,level:0};function xd(){}const YB={},$B={once:!0};let tT=class{constructor({id:e}={id:""}){this.VERSION=qB,this._startTs=_d(),this._deltaTs=_d(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new Bz(`__probe-${this.id}__`,Rz),this.timeStamp(`${this.id} started`),Pz(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((_d()-this._startTs).toPrecision(10))}getDelta(){return Number((_d()-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,bd.warn,arguments,$B)}error(e){return this._getLogFunction(0,e,bd.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,bd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,bd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,bd.debug||bd.info,arguments,$B)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||xd,i&&[i],{tag:Oz(t)}):xd}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||xd)}group(e,t,i={collapsed:!1}){const n=iT({logLevel:e,message:t,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||xd)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=eT(e)}_getLogFunction(e,t,i,n,r){if(this._shouldLog(e)){r=iT({logLevel:e,message:t,args:n,opts:r}),i=i||r.method,e1(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=_d();const s=r.tag||r.message;if(r.once&&s)if(!YB[s])YB[s]=_d();else return xd;return t=Dz(this.id,r.message,r),i.bind(console,t,...r.args)}return xd}};tT.VERSION=qB;function eT(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return e1(Number.isFinite(t)&&t>=0),t}function iT(e){const{logLevel:t,message:i}=e;e.logLevel=eT(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":i!==void 0&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t);break}typeof e.message=="function"&&(e.message=e.message());const r=typeof e.message;return e1(r==="string"||r==="object"),Object.assign(e,{args:n},e.opts)}function Dz(e,t,i){if(typeof t=="string"){const n=i.time?Sz(Tz(i.total)):"";t=i.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=Mz(t,i.color,i.background)}return t}function Oz(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}const nT=new tT({id:"loaders.gl"});let Lz=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},Fz=class{console;constructor(){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 rT={fetch:null,mimeType:void 0,nothrow:!1,log:new Fz,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:H_,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},kz={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 oT(){globalThis.loaders=globalThis.loaders||{};const{loaders:e}=globalThis;return e._state||(e._state={}),e._state}function sT(){const e=oT();return e.globalOptions=e.globalOptions||{...rT},e.globalOptions}function Nz(e,t,i,n){return i=i||[],i=Array.isArray(i)?i:[i],Uz(e,i),Gz(t,e,n)}function Uz(e,t){aT(e,null,rT,kz,t);for(const i of t){const n=e&&e[i.id]||{},r=i.options&&i.options[i.id]||{},s=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};aT(n,i.id,r,s,t)}}function aT(e,t,i,n,r){const s=t||"Top level",o=t?`${t}.`:"";for(const c in e){const h=!t&&NA(e[c]),A=c==="baseUri"&&!t,_=c==="workerUrl"&&t;if(!(c in i)&&!A&&!_){if(c in n)nT.warn(`${s} loader option '${o}${c}' no longer supported, use '${n[c]}'`)();else if(!h){const C=zz(c,r);nT.warn(`${s} loader option '${o}${c}' not recognized. ${C}`)()}}}}function zz(e,t){const i=e.toLowerCase();let n="";for(const r of t)for(const s in r.options){if(e===s)return`Did you mean '${r.id}.${s}'?`;const o=s.toLowerCase();(i.startsWith(o)||o.startsWith(i))&&(n=n||`Did you mean '${r.id}.${s}'?`)}return n}function Gz(e,t,i){const n={...e.options||{}};return jz(n,i),n.log===null&&(n.log=new Lz),cT(n,sT()),cT(n,t),n}function cT(e,t){for(const i in t)if(i in t){const n=t[i];GB(n)&&GB(e[i])?e[i]={...e[i],...t[i]}:e[i]=t[i]}}function jz(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function i1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e?.extensions)):!1}function n1(e){Um(e,"null loader"),Um(i1(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e?.parseTextSync||e?.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}const lT=()=>{const e=oT();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Vz(e){const t=lT();e=Array.isArray(e)?e:[e];for(const i of e){const n=n1(i);t.find(r=>n===r)||t.unshift(n)}}function Hz(){return lT()}const Wz=/\.([^.]+)$/;async function Jz(e,t=[],i,n){if(!hT(e))return null;let r=uT(e,t,{...i,nothrow:!0},n);if(r)return r;if(Vh(e)&&(e=await e.slice(0,10).arrayBuffer(),r=uT(e,t,i,n)),!r&&!i?.nothrow)throw new Error(fT(e));return r}function uT(e,t=[],i,n){if(!hT(e))return null;if(t&&!Array.isArray(t))return n1(t);let r=[];t&&(r=r.concat(t)),i?.ignoreRegisteredLoaders||r.push(...Hz()),Qz(r);const s=Xz(e,r,i,n);if(!s&&!i?.nothrow)throw new Error(fT(e));return s}function Xz(e,t,i,n){const r=Gm(e),s=$_(e),o=Y_(r)||n?.url;let c=null,h="";return i?.mimeType&&(c=r1(t,i?.mimeType),h=`match forced by supplied MIME type ${i?.mimeType}`),c=c||Kz(t,o),h=h||(c?`matched url ${o}`:""),c=c||r1(t,s),h=h||(c?`matched MIME type ${s}`:""),c=c||Zz(t,e),h=h||(c?`matched initial data ${pT(e)}`:""),i?.fallbackMimeType&&(c=c||r1(t,i?.fallbackMimeType),h=h||(c?`matched fallback MIME type ${s}`:"")),h&&DU.log(1,`selectLoader selected ${c?.name}: ${h}.`),c}function hT(e){return!(e instanceof Response&&e.status===204)}function fT(e){const t=Gm(e),i=$_(e);let n="No valid loader found (";n+=t?`${zB(t)}, `:"no url provided, ",n+=`MIME type: ${i?`"${i}"`:"not provided"}, `;const r=e?pT(e):"";return n+=r?` first bytes: "${r}"`:"first bytes: not available",n+=")",n}function Qz(e){for(const t of e)n1(t)}function Kz(e,t){const i=t&&Wz.exec(t),n=i&&i[1];return n?qz(e,n):null}function qz(e,t){t=t.toLowerCase();for(const i of e)for(const n of i.extensions)if(n.toLowerCase()===t)return i;return null}function r1(e,t){for(const i of e)if(i.mimeTypes?.some(n=>VB(t,n))||VB(t,`application/x.${i.id}`))return i;return null}function Zz(e,t){if(!t)return null;for(const i of e)if(typeof t=="string"){if(Yz(t,i))return i}else if(ArrayBuffer.isView(t)){if(dT(t.buffer,t.byteOffset,i))return i}else if(t instanceof ArrayBuffer&&dT(t,0,i))return i;return null}function Yz(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(i=>e.startsWith(i))}function dT(e,t,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some(n=>$z(e,t,i,n))}function $z(e,t,i,n){if(n instanceof ArrayBuffer)return qU(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":const r=o1(e,t,n.length);return n===r;default:return!1}}function pT(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?o1(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?o1(e,0,t):""}function o1(e,t,i){if(e.byteLength<t+i)return"";const n=new DataView(e);let r="";for(let s=0;s<i;s++)r+=String.fromCharCode(n.getUint8(t+s));return r}const tG=256*1024;function*eG(e,t){const i=t?.chunkSize||tG;let n=0;const r=new TextEncoder;for(;n<e.length;){const s=Math.min(e.length-n,i),o=e.slice(n,n+s);n+=s,yield r.encode(o)}}const iG=256*1024;function*nG(e,t={}){const{chunkSize:i=iG}=t;let n=0;for(;n<e.byteLength;){const r=Math.min(e.byteLength-n,i),s=new ArrayBuffer(r),o=new Uint8Array(e,n,r);new Uint8Array(s).set(o),n+=r,yield s}}const rG=1024*1024;async function*oG(e,t){const i=t?.chunkSize||rG;let n=0;for(;n<e.size;){const r=n+i,s=await e.slice(n,r).arrayBuffer();n=r,yield s}}function AT(e,t){return H_?sG(e,t):aG(e)}async function*sG(e,t){const i=e.getReader();let n;try{for(;;){const r=n||i.read();t?._streamReadAhead&&(n=i.read());const{done:s,value:o}=await r;if(s)return;yield UB(o)}}catch{i.releaseLock()}}async function*aG(e,t){for await(const i of e)yield UB(i)}function cG(e,t){if(typeof e=="string")return eG(e,t);if(e instanceof ArrayBuffer)return nG(e,t);if(Vh(e))return oG(e,t);if(jB(e))return AT(e,t);if(jh(e))return AT(e.body,t);throw new Error("makeIterator")}const gT="Cannot convert supplied data type";function lG(e,t,i){if(t.text&&typeof e=="string")return e;if(az(e)&&(e=e.buffer),e instanceof ArrayBuffer){const n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer;const r=e.byteLength||e.length;return(e.byteOffset!==0||r!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+r)),n}throw new Error(gT)}async function uG(e,t,i){const n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return lG(e,t);if(Vh(e)&&(e=await JB(e)),jh(e)){const r=e;return await mz(r),t.binary?await r.arrayBuffer():await r.text()}if(jB(e)&&(e=cG(e,i)),oz(e)||sz(e))return $U(e);throw new Error(gT)}function mT(e,t){const i=sT(),n=e||i;return typeof n.fetch=="function"?n.fetch:NA(n.fetch)?r=>XB(r,n.fetch):t?.fetch?t?.fetch:XB}function hG(e,t,i){if(i)return i;const n={fetch:mT(t,e),...e};if(n.url){const r=Y_(n.url);n.baseUrl=r,n.queryString=pz(n.url),n.filename=zB(r),n.baseUrl=nz(r)}return Array.isArray(n.loaders)||(n.loaders=null),n}function fG(e,t){if(e&&!Array.isArray(e))return e;let i;if(e&&(i=Array.isArray(e)?e:[e]),t&&t.loaders){const n=Array.isArray(t.loaders)?t.loaders:[t.loaders];i=i?[...i,...n]:n}return i&&i.length?i:void 0}async function Vm(e,t,i,n){t&&!Array.isArray(t)&&!i1(t)&&(n=void 0,i=t,t=void 0),e=await e,i=i||{};const r=Gm(e),s=fG(t,n),o=await Jz(e,s,i);return o?(i=Nz(i,o,s,r),n=hG({url:r,_parse:Vm,loaders:s},i,n||null),await dG(o,e,i,n)):null}async function dG(e,t,i,n){if(JU(e),i=OU(e.options,i),jh(t)){const s=t,{ok:o,redirected:c,status:h,statusText:A,type:_,url:C}=s,S=Object.fromEntries(s.headers.entries());n.response={headers:S,ok:o,redirected:c,status:h,statusText:A,type:_,url:C}}t=await uG(t,e,i);const r=e;if(r.parseTextSync&&typeof t=="string")return r.parseTextSync(t,i,n);if(XU(e,i))return await QU(e,t,i,n,Vm);if(r.parseText&&typeof t=="string")return await r.parseText(t,i,n);if(r.parse)return await r.parse(t,i,n);throw ku(!r.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function s1(e,t,i,n){let r,s;!Array.isArray(t)&&!i1(t)?(r=[],s=t):(r=t,s=i);const o=mT(s);let c=e;return typeof e=="string"&&(c=await o(e)),Vh(e)&&(c=await o(e)),Array.isArray(r)?await Vm(c,r,s):await Vm(c,r,s)}const pG="4.3.1",AG=globalThis.loaders?.parseImageNode,a1=typeof Image<"u",c1=typeof ImageBitmap<"u",gG=!!AG,l1=H_?!0:gG;function mG(e){switch(e){case"auto":return c1||a1||l1;case"imagebitmap":return c1;case"image":return a1;case"data":return l1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function yG(){if(c1)return"imagebitmap";if(a1)return"image";if(l1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function vG(e){const t=bG(e);if(!t)throw new Error("Not an image");return t}function _G(e){switch(vG(e)){case"data":return e;case"image":case"imagebitmap":const t=document.createElement("canvas"),i=t.getContext("2d");if(!i)throw new Error("getImageData");return t.width=e.width,t.height=e.height,i.drawImage(e,0,0),i.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function bG(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}const xG=/^data:image\/svg\+xml/,wG=/\.svg((\?|#).*)?$/;function u1(e){return e&&(xG.test(e)||wG.test(e))}function CG(e,t){if(u1(t)){let i=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(n){throw new Error(n.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return yT(e,t)}function yT(e,t){if(u1(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function vT(e,t,i){const n=CG(e,i),r=self.URL||self.webkitURL,s=typeof n!="string"&&r.createObjectURL(n);try{return await EG(s||n,t)}finally{s&&r.revokeObjectURL(s)}}async function EG(e,t){const i=new Image;return i.src=e,t.image&&t.image.decode&&i.decode?(await i.decode(),i):await new Promise((n,r)=>{try{i.onload=()=>n(i),i.onerror=s=>{const o=s instanceof Error?s.message:"error";r(new Error(o))}}catch(s){r(s)}})}const BG={};let _T=!0;async function TG(e,t,i){let n;u1(i)?n=await vT(e,t,i):n=yT(e,i);const r=t&&t.imagebitmap;return await SG(n,r)}async function SG(e,t=null){if((IG(t)||!_T)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(i){console.warn(i),_T=!1}return await createImageBitmap(e)}function IG(e){for(const t in e||BG)return!1;return!0}function MG(e){return!OG(e,"ftyp",4)||(e[8]&96)===0?null:PG(e)}function PG(e){switch(RG(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function RG(e,t,i){return String.fromCharCode(...e.slice(t,i))}function DG(e){return[...e].map(t=>t.charCodeAt(0))}function OG(e,t,i=0){const n=DG(t);for(let r=0;r<n.length;++r)if(n[r]!==e[r+i])return!1;return!0}const $c=!1,UA=!0;function bT(e){const t=zA(e);return FG(t)||UG(t)||kG(t)||NG(t)||LG(t)}function LG(e){const t=new Uint8Array(e instanceof DataView?e.buffer:e),i=MG(t);return i?{mimeType:i.mimeType,width:0,height:0}:null}function FG(e){const t=zA(e);return t.byteLength>=24&&t.getUint32(0,$c)===2303741511?{mimeType:"image/png",width:t.getUint32(16,$c),height:t.getUint32(20,$c)}:null}function kG(e){const t=zA(e);return t.byteLength>=10&&t.getUint32(0,$c)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,UA),height:t.getUint16(8,UA)}:null}function NG(e){const t=zA(e);return t.byteLength>=14&&t.getUint16(0,$c)===16973&&t.getUint32(2,UA)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,UA),height:t.getUint32(22,UA)}:null}function UG(e){const t=zA(e);if(!(t.byteLength>=3&&t.getUint16(0,$c)===65496&&t.getUint8(2)===255))return null;const{tableMarkers:i,sofMarkers:n}=zG();let r=2;for(;r+9<t.byteLength;){const s=t.getUint16(r,$c);if(n.has(s))return{mimeType:"image/jpeg",height:t.getUint16(r+5,$c),width:t.getUint16(r+7,$c)};if(!i.has(s))return null;r+=2,r+=t.getUint16(r,$c)}return null}function zG(){const e=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)e.add(t);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function zA(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function GG(e,t){const{mimeType:i}=bT(e)||{},n=globalThis.loaders?.parseImageNode;return Um(n),await n(e,i)}async function jG(e,t,i){t=t||{};const n=(t.image||{}).type||"auto",{url:r}=i||{},s=VG(n);let o;switch(s){case"imagebitmap":o=await TG(e,t,r);break;case"image":o=await vT(e,t,r);break;case"data":o=await GG(e);break;default:Um(!1)}return n==="data"&&(o=_G(o)),o}function VG(e){switch(e){case"auto":case"data":return yG();default:return mG(e),e}}const HG=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],WG=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],JG={image:{type:"auto",decode:!0}},XG={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:pG,mimeTypes:WG,extensions:HG,parse:jG,tests:[e=>!!bT(new DataView(e))],options:JG},Hm=globalThis,Wm=globalThis.process||{},QG=globalThis.navigator||{};function xT(e){if(typeof window<"u"&&window.process?.type==="renderer"||typeof process<"u"&&process.versions?.electron)return!0;const t=typeof navigator<"u"&&navigator.userAgent;return!!(t&&t.indexOf("Electron")>=0)}function tl(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process?.browser)||xT()}function KG(e){return tl()?xT()?"Electron":(QG.userAgent||"").indexOf("Edge")>-1?"Edge":globalThis.chrome?"Chrome":globalThis.safari?"Safari":globalThis.mozInnerScreenX?"Firefox":"Unknown":"Node"}const Jm="4.1.0";function qG(e){try{const t=window[e],i="__storage_test__";return t.setItem(i,i),t.removeItem(i),t}catch{return null}}let ZG=class{constructor(e,t,i="sessionStorage"){this.storage=qG(i),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 YG(e){let t;return e<10?t=`${e.toFixed(2)}ms`:e<100?t=`${e.toFixed(1)}ms`:e<1e3?t=`${e.toFixed(0)}ms`:t=`${(e/1e3).toFixed(2)}s`,t}function $G(e,t=8){const i=Math.max(t-e.length,0);return`${" ".repeat(i)}${e}`}var Xm;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Xm||(Xm={}));const t7=10;function wT(e){return typeof e!="string"?e:(e=e.toUpperCase(),Xm[e]||Xm.WHITE)}function e7(e,t,i){return!tl&&typeof e=="string"&&(t&&(e=`\x1B[${wT(t)}m${e}\x1B[39m`),i&&(e=`\x1B[${wT(i)+t7}m${e}\x1B[49m`)),e}function i7(e,t=["constructor"]){const i=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(i),r=e;for(const s of n){const o=r[s];typeof o=="function"&&(t.find(c=>s===c)||(r[s]=o.bind(e)))}}function h1(e,t){if(!e)throw new Error("Assertion failed")}function wd(){let e;if(tl()&&Hm.performance)e=Hm?.performance?.now?.();else if("hrtime"in Wm){const t=Wm?.hrtime?.();e=t[0]*1e3+t[1]/1e6}else e=Date.now();return e}const Cd={debug:tl()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},n7={enabled:!0,level:0};function Ed(){}const CT={},ET={once:!0};let BT=class{constructor({id:e}={id:""}){this.VERSION=Jm,this._startTs=wd(),this._deltaTs=wd(),this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new ZG(`__probe-${this.id}__`,n7),this.timeStamp(`${this.id} started`),i7(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((wd()-this._startTs).toPrecision(10))}getDelta(){return Number((wd()-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,Cd.warn,arguments,ET)}error(e){return this._getLogFunction(0,e,Cd.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,Cd.log,arguments,{time:!0,once:!0})}log(e,t){return this._getLogFunction(e,t,Cd.debug,arguments)}info(e,t){return this._getLogFunction(e,t,console.info,arguments)}once(e,t){return this._getLogFunction(e,t,Cd.debug||Cd.info,arguments,ET)}table(e,t,i){return t?this._getLogFunction(e,t,console.table||Ed,i&&[i],{tag:o7(t)}):Ed}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||Ed)}group(e,t,i={collapsed:!1}){const n=ST({logLevel:e,message:t,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(e,t,i={}){return this.group(e,t,Object.assign({},i,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Ed)}withGroup(e,t,i){this.group(e,t)();try{i()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=TT(e)}_getLogFunction(e,t,i,n,r){if(this._shouldLog(e)){r=ST({logLevel:e,message:t,args:n,opts:r}),i=i||r.method,h1(i),r.total=this.getTotal(),r.delta=this.getDelta(),this._deltaTs=wd();const s=r.tag||r.message;if(r.once&&s)if(!CT[s])CT[s]=wd();else return Ed;return t=r7(this.id,r.message,r),i.bind(console,t,...r.args)}return Ed}};BT.VERSION=Jm;function TT(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return h1(Number.isFinite(t)&&t>=0),t}function ST(e){const{logLevel:t,message:i}=e;e.logLevel=TT(t);const n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==i;);switch(typeof t){case"string":case"function":i!==void 0&&n.unshift(i),e.message=t;break;case"object":Object.assign(e,t);break}typeof e.message=="function"&&(e.message=e.message());const r=typeof e.message;return h1(r==="string"||r==="object"),Object.assign(e,{args:n},e.opts)}function r7(e,t,i){if(typeof t=="string"){const n=i.time?$G(YG(i.total)):"";t=i.time?`${e}: ${n} ${t}`:`${e}: ${t}`,t=e7(t,i.color,i.background)}return t}function o7(e){for(const t in e)for(const i in e[t])return i||"untitled";return"empty"}const Zi=new BT({id:"deck"});let f1={};function s7(e){f1=e}function fs(e,t,i,n){Zi.level>0&&f1[e]&&f1[e].call(null,t,i,n)}function a7(e){const t=e[0],i=e[e.length-1];return t==="{"&&i==="}"||t==="["&&i==="]"}const c7={dataType:null,batchType:null,id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:a7,parseTextSync:JSON.parse};function l7(){const e="9.1.14",t=globalThis.deck&&globalThis.deck.VERSION;if(t&&t!==e)throw new Error(`deck.gl - multiple versions detected: ${t} vs ${e}`);return t||(Zi.log(1,`deck.gl ${e}`)(),globalThis.deck={...globalThis.deck,VERSION:e,version:e,log:Zi,_registerLoggers:s7},Vz([c7,[XG,{imagebitmap:{premultiplyAlpha:"none"}}]])),e}const u7=l7();function d1(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}const p1={number:{type:"number",validate(e,t){return Number.isFinite(e)&&typeof t=="object"&&(t.max===void 0||e<=t.max)&&(t.min===void 0||e>=t.min)}},array:{type:"array",validate(e,t){return Array.isArray(e)||ArrayBuffer.isView(e)}}};function h7(e){const t={};for(const[i,n]of Object.entries(e))t[i]=f7(n);return t}function f7(e){let t=IT(e);if(t!=="object")return{value:e,...p1[t],type:t};if(typeof e=="object")return e?e.type!==void 0?{...e,...p1[e.type],type:e.type}:e.value===void 0?{type:"object",value:e}:(t=IT(e.value),{...e,...p1[t],type:t}):{type:"object",value:null};throw new Error("props")}function IT(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}const d7=`#ifdef MODULE_LOGDEPTH
logdepth_adjustPosition(gl_Position);
#endif
`,p7=`#ifdef MODULE_MATERIAL
fragColor = material_filterColor(fragColor);
#endif
#ifdef MODULE_LIGHTING
fragColor = lighting_filterColor(fragColor);
#endif
#ifdef MODULE_FOG
fragColor = fog_filterColor(fragColor);
#endif
#ifdef MODULE_PICKING
fragColor = picking_filterHighlightColor(fragColor);
fragColor = picking_filterPickingColor(fragColor);
#endif
#ifdef MODULE_LOGDEPTH
logdepth_setFragDepth();
#endif
`,A7={vertex:d7,fragment:p7},MT=/void\s+main\s*\([^)]*\)\s*\{\n?/,PT=/}\n?[^{}]*$/,A1=[],Qm="__LUMA_INJECT_DECLARATIONS__";function g7(e){const t={vertex:{},fragment:{}};for(const i in e){let n=e[i];const r=m7(i);typeof n=="string"&&(n={order:0,injection:n}),t[r][i]=n}return t}function m7(e){const t=e.slice(0,2);switch(t){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(t)}}function Km(e,t,i,n=!1){const r=t==="vertex";for(const s in i){const o=i[s];o.sort((h,A)=>h.order-A.order),A1.length=o.length;for(let h=0,A=o.length;h<A;++h)A1[h]=o[h].injection;const c=`${A1.join(`
`)}
`;switch(s){case"vs:#decl":r&&(e=e.replace(Qm,c));break;case"vs:#main-start":r&&(e=e.replace(MT,h=>h+c));break;case"vs:#main-end":r&&(e=e.replace(PT,h=>c+h));break;case"fs:#decl":r||(e=e.replace(Qm,c));break;case"fs:#main-start":r||(e=e.replace(MT,h=>h+c));break;case"fs:#main-end":r||(e=e.replace(PT,h=>c+h));break;default:e=e.replace(s,h=>h+c)}}return e=e.replace(Qm,""),n&&(e=e.replace(/\}\s*$/,s=>s+A7[t])),e}function qm(e){e.map(t=>RT(t))}function RT(e){if(e.instance)return;qm(e.dependencies||[]);const{propTypes:t={},deprecations:i=[],inject:n={}}=e,r={normalizedInjections:g7(n),parsedDeprecations:y7(i)};t&&(r.propValidators=h7(t)),e.instance=r;let s={};t&&(s=Object.entries(t).reduce((o,[c,h])=>{const A=h?.value;return A&&(o[c]=A),o},{})),e.defaultUniforms={...e.defaultUniforms,...s}}function DT(e,t,i){e.deprecations?.forEach(n=>{n.regex?.test(t)&&(n.deprecated?i.deprecated(n.old,n.new)():i.removed(n.old,n.new)())})}function y7(e){return e.forEach(t=>{switch(t.type){case"function":t.regex=new RegExp(`\\b${t.old}\\(`);break;default:t.regex=new RegExp(`${t.type} ${t.old};`)}}),e}function g1(e){qm(e);const t={},i={};OT({modules:e,level:0,moduleMap:t,moduleDepth:i});const n=Object.keys(i).sort((r,s)=>i[s]-i[r]).map(r=>t[r]);return qm(n),n}function OT(e){const{modules:t,level:i,moduleMap:n,moduleDepth:r}=e;if(i>=5)t