@loaders.gl/i3s 4.1.1 → 4.1.2

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.
@@ -92,12 +92,12 @@ caused by: `+Wr.fullStack(r):e.stack};Wr.errorFromList=function(e){return Nt.arr
92
92
  `)}),a("--"+t.boundary+"--"),t.request.postambleCRLF&&a(`\r
93
93
  `),i};Ac.prototype.onRequest=function(e){var r=this,t=r.isChunked(e),i=e.data||e;r.setHeaders(t),r.chunked=t,r.body=r.build(i,t)};X6.Multipart=Ac});var e5=D(J6=>{"use strict";var Z6=require("url"),xN=/^https?:/;function vp(e){this.request=e,this.followRedirect=!0,this.followRedirects=!0,this.followAllRedirects=!1,this.followOriginalHttpMethod=!1,this.allowRedirect=function(){return!0},this.maxRedirects=10,this.redirects=[],this.redirectsFollowed=0,this.removeRefererHeader=!1}vp.prototype.onRequest=function(e){var r=this;e.maxRedirects!==void 0&&(r.maxRedirects=e.maxRedirects),typeof e.followRedirect=="function"&&(r.allowRedirect=e.followRedirect),e.followRedirect!==void 0&&(r.followRedirects=!!e.followRedirect),e.followAllRedirects!==void 0&&(r.followAllRedirects=e.followAllRedirects),(r.followRedirects||r.followAllRedirects)&&(r.redirects=r.redirects||[]),e.removeRefererHeader!==void 0&&(r.removeRefererHeader=e.removeRefererHeader),e.followOriginalHttpMethod!==void 0&&(r.followOriginalHttpMethod=e.followOriginalHttpMethod)};vp.prototype.redirectTo=function(e){var r=this,t=r.request,i=null;if(e.statusCode>=300&&e.statusCode<400&&e.caseless.has("location")){var a=e.caseless.get("location");if(t.debug("redirect",a),r.followAllRedirects)i=a;else if(r.followRedirects)switch(t.method){case"PATCH":case"PUT":case"POST":case"DELETE":break;default:i=a;break}}else if(e.statusCode===401){var n=t._auth.onResponse(e);n&&(t.setHeader("authorization",n),i=t.uri)}return i};vp.prototype.onResponse=function(e){var r=this,t=r.request,i=r.redirectTo(e);if(!i||!r.allowRedirect.call(t,e))return!1;if(t.debug("redirect to",i),e.resume&&e.resume(),r.redirectsFollowed>=r.maxRedirects)return t.emit("error",new Error("Exceeded maxRedirects. Probably stuck in a redirect loop "+t.uri.href)),!1;r.redirectsFollowed+=1,xN.test(i)||(i=Z6.resolve(t.uri.href,i));var a=t.uri;return t.uri=Z6.parse(i),t.uri.protocol!==a.protocol&&delete t.agent,r.redirects.push({statusCode:e.statusCode,redirectUri:i}),r.followAllRedirects&&t.method!=="HEAD"&&e.statusCode!==401&&e.statusCode!==307&&(t.method=r.followOriginalHttpMethod?t.method:"GET"),delete t.src,delete t.req,delete t._started,e.statusCode!==401&&e.statusCode!==307&&(delete t.body,delete t._form,t.headers&&(t.removeHeader("host"),t.removeHeader("content-type"),t.removeHeader("content-length"),t.uri.hostname!==t.originalHost.split(":")[0]&&t.removeHeader("authorization"))),r.removeRefererHeader||t.setHeader("referer",a.href),t.emit("redirect"),t.init(),!0};J6.Redirect=vp});var i5=D(ou=>{"use strict";var oJ=require("net"),wN=require("tls"),Lg=require("http"),r5=require("https"),_N=require("events"),kN=require("assert"),SN=require("util"),EN=Rs().Buffer;ou.httpOverHttp=jN;ou.httpsOverHttp=AN;ou.httpOverHttps=TN;ou.httpsOverHttps=PN;function jN(e){var r=new dn(e);return r.request=Lg.request,r}function AN(e){var r=new dn(e);return r.request=Lg.request,r.createSocket=t5,r.defaultPort=443,r}function TN(e){var r=new dn(e);return r.request=r5.request,r}function PN(e){var r=new dn(e);return r.request=r5.request,r.createSocket=t5,r.defaultPort=443,r}function dn(e){var r=this;r.options=e||{},r.proxyOptions=r.options.proxy||{},r.maxSockets=r.options.maxSockets||Lg.Agent.defaultMaxSockets,r.requests=[],r.sockets=[],r.on("free",function(i,a,n){for(var o=0,s=r.requests.length;o<s;++o){var u=r.requests[o];if(u.host===a&&u.port===n){r.requests.splice(o,1),u.request.onSocket(i);return}}i.destroy(),r.removeSocket(i)})}SN.inherits(dn,_N.EventEmitter);dn.prototype.addRequest=function(r,t){var i=this;if(typeof t=="string"&&(t={host:t,port:arguments[2],path:arguments[3]}),i.sockets.length>=this.maxSockets){i.requests.push({host:t.host,port:t.port,request:r});return}i.createConnection({host:t.host,port:t.port,request:r})};dn.prototype.createConnection=function(r){var t=this;t.createSocket(r,function(i){i.on("free",a),i.on("close",n),i.on("agentRemove",n),r.request.onSocket(i);function a(){t.emit("free",i,r.host,r.port)}function n(o){t.removeSocket(i),i.removeListener("free",a),i.removeListener("close",n),i.removeListener("agentRemove",n)}})};dn.prototype.createSocket=function(r,t){var i=this,a={};i.sockets.push(a);var n=a5({},i.proxyOptions,{method:"CONNECT",path:r.host+":"+r.port,agent:!1});n.proxyAuth&&(n.headers=n.headers||{},n.headers["Proxy-Authorization"]="Basic "+EN.from(n.proxyAuth).toString("base64")),Zo("making CONNECT request");var o=i.request(n);o.useChunkedEncodingByDefault=!1,o.once("response",s),o.once("upgrade",u),o.once("connect",l),o.once("error",f),o.end();function s(h){h.upgrade=!0}function u(h,d,m){process.nextTick(function(){l(h,d,m)})}function l(h,d,m){if(o.removeAllListeners(),d.removeAllListeners(),h.statusCode===200)kN.equal(m.length,0),Zo("tunneling connection has established"),i.sockets[i.sockets.indexOf(a)]=d,t(d);else{Zo("tunneling socket could not be established, statusCode=%d",h.statusCode);var y=new Error("tunneling socket could not be established, statusCode="+h.statusCode);y.code="ECONNRESET",r.request.emit("error",y),i.removeSocket(a)}}function f(h){o.removeAllListeners(),Zo(`tunneling socket could not be established, cause=%s
94
94
  `,h.message,h.stack);var d=new Error("tunneling socket could not be established, cause="+h.message);d.code="ECONNRESET",r.request.emit("error",d),i.removeSocket(a)}};dn.prototype.removeSocket=function(r){var t=this.sockets.indexOf(r);if(t!==-1){this.sockets.splice(t,1);var i=this.requests.shift();i&&this.createConnection(i)}};function t5(e,r){var t=this;dn.prototype.createSocket.call(t,e,function(i){var a=wN.connect(0,a5({},t.options,{servername:e.host,socket:i}));t.sockets[t.sockets.indexOf(i)]=a,r(a)})}function a5(e){for(var r=1,t=arguments.length;r<t;++r){var i=arguments[r];if(typeof i=="object")for(var a=Object.keys(i),n=0,o=a.length;n<o;++n){var s=a[n];i[s]!==void 0&&(e[s]=i[s])}}return e}var Zo;process.env.NODE_DEBUG&&/\btunnel\b/.test(process.env.NODE_DEBUG)?Zo=function(){var e=Array.prototype.slice.call(arguments);typeof e[0]=="string"?e[0]="TUNNEL: "+e[0]:e.unshift("TUNNEL:"),console.error.apply(console,e)}:Zo=function(){};ou.debug=Zo});var u5=D(s5=>{"use strict";var RN=require("url"),CN=i5(),n5=["accept","accept-charset","accept-encoding","accept-language","accept-ranges","cache-control","content-encoding","content-language","content-location","content-md5","content-range","content-type","connection","date","expect","max-forwards","pragma","referer","te","user-agent","via"],o5=["proxy-authorization"];function ON(e){var r=e.port,t=e.protocol,i=e.hostname+":";return r?i+=r:t==="https:"?i+="443":i+="80",i}function IN(e,r){var t=r.reduce(function(i,a){return i[a.toLowerCase()]=!0,i},{});return Object.keys(e).filter(function(i){return t[i.toLowerCase()]}).reduce(function(i,a){return i[a]=e[a],i},{})}function BN(e,r){var t=e.proxy,i={proxy:{host:t.hostname,port:+t.port,proxyAuth:t.auth,headers:r},headers:e.headers,ca:e.ca,cert:e.cert,key:e.key,passphrase:e.passphrase,pfx:e.pfx,ciphers:e.ciphers,rejectUnauthorized:e.rejectUnauthorized,secureOptions:e.secureOptions,secureProtocol:e.secureProtocol};return i}function FN(e,r){var t=e.protocol==="https:"?"https":"http",i=r.protocol==="https:"?"Https":"Http";return[t,i].join("Over")}function DN(e){var r=e.uri,t=e.proxy,i=FN(r,t);return CN[i]}function Tc(e){this.request=e,this.proxyHeaderWhiteList=n5,this.proxyHeaderExclusiveList=[],typeof e.tunnel<"u"&&(this.tunnelOverride=e.tunnel)}Tc.prototype.isEnabled=function(){var e=this,r=e.request;return typeof e.tunnelOverride<"u"?e.tunnelOverride:r.uri.protocol==="https:"};Tc.prototype.setup=function(e){var r=this,t=r.request;if(e=e||{},typeof t.proxy=="string"&&(t.proxy=RN.parse(t.proxy)),!t.proxy||!t.tunnel)return!1;e.proxyHeaderWhiteList&&(r.proxyHeaderWhiteList=e.proxyHeaderWhiteList),e.proxyHeaderExclusiveList&&(r.proxyHeaderExclusiveList=e.proxyHeaderExclusiveList);var i=r.proxyHeaderExclusiveList.concat(o5),a=r.proxyHeaderWhiteList.concat(i),n=IN(t.headers,a);n.host=ON(t.uri),i.forEach(t.removeHeader,t);var o=DN(t),s=BN(t,n);return t.agent=o(s),!0};Tc.defaultProxyHeaderWhiteList=n5;Tc.defaultProxyHeaderExclusiveList=o5;s5.Tunnel=Tc});var l5=D((c5,Pc)=>{(function(){var e,r,t,i,a,n;typeof performance<"u"&&performance!==null&&performance.now?Pc.exports=function(){return performance.now()}:typeof process<"u"&&process!==null&&process.hrtime?(Pc.exports=function(){return(e()-a)/1e6},r=process.hrtime,e=function(){var o;return o=r(),o[0]*1e9+o[1]},i=e(),n=process.uptime()*1e9,a=i-n):Date.now?(Pc.exports=function(){return Date.now()-t},t=Date.now()):(Pc.exports=function(){return new Date().getTime()-t},t=new Date().getTime())}).call(c5)});var w5=D((cJ,x5)=>{"use strict";var LN=require("http"),h5=require("https"),Rc=require("url"),Mg=require("util"),yp=require("stream"),bp=require("zlib"),qg=Xw(),qN=o_(),MN=X3(),zN=Gf(),m5=Wf(),f5=nS(),NN=IS(),UN=Ul(),p5=rg(),HN=MS().strict,uu=$l(),GN=pm(),WN=US(),VN=eE().Querystring,$N=T6().Har,KN=L6().Auth,YN=K6().OAuth,XN=Y6(),QN=Q6().Multipart,ZN=e5().Redirect,zg=u5().Tunnel,su=l5(),Cc=Rs().Buffer,d5=uu.safeStringify,JN=uu.isReadStream,eU=uu.toBase64,rU=uu.defer,g5=uu.copy,tU=uu.version,v5=GN.jar(),b5={};function aU(e,r){var t={};for(var i in r){var a=e.indexOf(i)===-1;a&&(t[i]=r[i])}return t}function iU(e,r){var t={};for(var i in r){var a=e.indexOf(i)!==-1,n=typeof r[i]=="function";a&&n||(t[i]=r[i])}return t}function y5(){var e=this;return{uri:e.uri,method:e.method,headers:e.headers}}function nU(){var e=this;return{statusCode:e.statusCode,body:e.body,headers:e.headers,request:y5.call(e.request)}}function Lr(e){var r=this;e.har&&(r._har=new $N(r),e=r._har.options(e)),yp.Stream.call(r);var t=Object.keys(Lr.prototype),i=aU(t,e);UN(r,i),e=iU(t,e),r.readable=!0,r.writable=!0,e.method&&(r.explicitMethod=!0),r._qs=new VN(r),r._auth=new KN(r),r._oauth=new YN(r),r._multipart=new QN(r),r._redirect=new ZN(r),r._tunnel=new zg(r),r.init(e)}Mg.inherits(Lr,yp.Stream);Lr.debug=process.env.NODE_DEBUG&&/\brequest\b/.test(process.env.NODE_DEBUG);function na(){Lr.debug&&console.error("REQUEST %s",Mg.format.apply(Mg,arguments))}Lr.prototype.debug=na;Lr.prototype.init=function(e){var r=this;e||(e={}),r.headers=r.headers?g5(r.headers):{};for(var t in r.headers)typeof r.headers[t]>"u"&&delete r.headers[t];if(m5.httpify(r,r.headers),r.method||(r.method=e.method||"GET"),r.localAddress||(r.localAddress=e.localAddress),r._qs.init(e),na(e),!r.pool&&r.pool!==!1&&(r.pool=b5),r.dests=r.dests||[],r.__isRequestRequest=!0,!r._callback&&r.callback&&(r._callback=r.callback,r.callback=function(){r._callbackCalled||(r._callbackCalled=!0,r._callback.apply(r,arguments))},r.on("error",r.callback.bind()),r.on("complete",r.callback.bind(r,null))),!r.uri&&r.url&&(r.uri=r.url,delete r.url),r.baseUrl){if(typeof r.baseUrl!="string")return r.emit("error",new Error("options.baseUrl must be a string"));if(typeof r.uri!="string")return r.emit("error",new Error("options.uri must be a string when using options.baseUrl"));if(r.uri.indexOf("//")===0||r.uri.indexOf("://")!==-1)return r.emit("error",new Error("options.uri must be a path when using options.baseUrl"));var i=r.baseUrl.lastIndexOf("/")===r.baseUrl.length-1,a=r.uri.indexOf("/")===0;i&&a?r.uri=r.baseUrl+r.uri.slice(1):i||a?r.uri=r.baseUrl+r.uri:r.uri===""?r.uri=r.baseUrl:r.uri=r.baseUrl+"/"+r.uri,delete r.baseUrl}if(!r.uri)return r.emit("error",new Error("options.uri is a required argument"));if(typeof r.uri=="string"&&(r.uri=Rc.parse(r.uri)),r.uri.href||(r.uri.href=Rc.format(r.uri)),r.uri.protocol==="unix:")return r.emit("error",new Error("`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`"));if(r.uri.host==="unix"&&r.enableUnixSocket(),r.strictSSL===!1&&(r.rejectUnauthorized=!1),r.uri.pathname||(r.uri.pathname="/"),!(r.uri.host||r.uri.hostname&&r.uri.port)&&!r.uri.isUnix){var n=Rc.format(r.uri),o='Invalid URI "'+n+'"';return Object.keys(e).length===0&&(o+=". This can be caused by a crappy redirection."),r.abort(),r.emit("error",new Error(o))}if(r.hasOwnProperty("proxy")||(r.proxy=WN(r.uri)),r.tunnel=r._tunnel.isEnabled(),r.proxy&&r._tunnel.setup(e),r._redirect.onRequest(e),r.setHost=!1,!r.hasHeader("host")){var s=r.originalHostHeaderName||"host";r.setHeader(s,r.uri.host),r.uri.port&&(r.uri.port==="80"&&r.uri.protocol==="http:"||r.uri.port==="443"&&r.uri.protocol==="https:")&&r.setHeader(s,r.uri.hostname),r.setHost=!0}if(r.jar(r._jar||e.jar),r.uri.port||(r.uri.protocol==="http:"?r.uri.port=80:r.uri.protocol==="https:"&&(r.uri.port=443)),r.proxy&&!r.tunnel?(r.port=r.proxy.port,r.host=r.proxy.hostname):(r.port=r.uri.port,r.host=r.uri.hostname),e.form&&r.form(e.form),e.formData){var u=e.formData,l=r.form(),f=function(I,F){F&&F.hasOwnProperty("value")&&F.hasOwnProperty("options")?l.append(I,F.value,F.options):l.append(I,F)};for(var h in u)if(u.hasOwnProperty(h)){var d=u[h];if(d instanceof Array)for(var m=0;m<d.length;m++)f(h,d[m]);else f(h,d)}}if(e.qs&&r.qs(e.qs),r.uri.path?r.path=r.uri.path:r.path=r.uri.pathname+(r.uri.search||""),r.path.length===0&&(r.path="/"),e.aws&&r.aws(e.aws),e.hawk&&r.hawk(e.hawk),e.httpSignature&&r.httpSignature(e.httpSignature),e.auth&&(Object.prototype.hasOwnProperty.call(e.auth,"username")&&(e.auth.user=e.auth.username),Object.prototype.hasOwnProperty.call(e.auth,"password")&&(e.auth.pass=e.auth.password),r.auth(e.auth.user,e.auth.pass,e.auth.sendImmediately,e.auth.bearer)),r.gzip&&!r.hasHeader("accept-encoding")&&r.setHeader("accept-encoding","gzip, deflate"),r.uri.auth&&!r.hasHeader("authorization")){var y=r.uri.auth.split(":").map(function(I){return r._qs.unescape(I)});r.auth(y[0],y.slice(1).join(":"),!0)}if(!r.tunnel&&r.proxy&&r.proxy.auth&&!r.hasHeader("proxy-authorization")){var k=r.proxy.auth.split(":").map(function(I){return r._qs.unescape(I)}),x="Basic "+eU(k.join(":"));r.setHeader("proxy-authorization",x)}r.proxy&&!r.tunnel&&(r.path=r.uri.protocol+"//"+r.uri.host+r.path),e.json&&r.json(e.json),e.multipart&&r.multipart(e.multipart),e.time&&(r.timing=!0,r.elapsedTime=r.elapsedTime||0);function A(){if(HN(r.body)&&(r.body=Cc.from(r.body)),!r.hasHeader("content-length")){var I;typeof r.body=="string"?I=Cc.byteLength(r.body):Array.isArray(r.body)?I=r.body.reduce(function(F,H){return F+H.length},0):I=r.body.length,I?r.setHeader("content-length",I):r.emit("error",new Error("Argument error, options.body."))}}r.body&&!p5(r.body)&&A(),e.oauth?r.oauth(e.oauth):r._oauth.params&&r.hasHeader("authorization")&&r.oauth(r._oauth.params);var P=r.proxy&&!r.tunnel?r.proxy.protocol:r.uri.protocol,T={"http:":LN,"https:":h5},B=r.httpModules||{};if(r.httpModule=B[P]||T[P],!r.httpModule)return r.emit("error",new Error("Invalid protocol: "+P));if(e.ca&&(r.ca=e.ca),!r.agent)if(e.agentOptions&&(r.agentOptions=e.agentOptions),e.agentClass)r.agentClass=e.agentClass;else if(e.forever){var C=tU();C.major===0&&C.minor<=10?r.agentClass=P==="http:"?f5:f5.SSL:(r.agentClass=r.httpModule.Agent,r.agentOptions=r.agentOptions||{},r.agentOptions.keepAlive=!0)}else r.agentClass=r.httpModule.Agent;r.pool===!1?r.agent=!1:r.agent=r.agent||r.getNewAgent(),r.on("pipe",function(I){if(r.ntick&&r._started&&r.emit("error",new Error("You cannot pipe to this stream after the outbound request has started.")),r.src=I,JN(I))r.hasHeader("content-type")||r.setHeader("content-type",zN.lookup(I.path));else{if(I.headers)for(var F in I.headers)r.hasHeader(F)||r.setHeader(F,I.headers[F]);r._json&&!r.hasHeader("content-type")&&r.setHeader("content-type","application/json"),I.method&&!r.explicitMethod&&(r.method=I.method)}}),rU(function(){if(!r._aborted){var I=function(){if(r._form&&(r._auth.hasAuth?r._auth.hasAuth&&r._auth.sentAuth&&r._form.pipe(r):r._form.pipe(r)),r._multipart&&r._multipart.chunked&&r._multipart.body.pipe(r),r.body)p5(r.body)?r.body.pipe(r):(A(),Array.isArray(r.body)?r.body.forEach(function(F){r.write(F)}):r.write(r.body),r.end());else if(r.requestBodyStream)console.warn("options.requestBodyStream is deprecated, please pass the request object to stream.pipe."),r.requestBodyStream.pipe(r);else if(!r.src){if(r._auth.hasAuth&&!r._auth.sentAuth){r.end();return}r.method!=="GET"&&typeof r.method<"u"&&r.setHeader("content-length",0),r.end()}};r._form&&!r.hasHeader("content-length")?(r.setHeader(r._form.getHeaders(),!0),r._form.getLength(function(F,H){!F&&!isNaN(H)&&r.setHeader("content-length",H),I()})):I(),r.ntick=!0}})};Lr.prototype.getNewAgent=function(){var e=this,r=e.agentClass,t={};if(e.agentOptions)for(var i in e.agentOptions)t[i]=e.agentOptions[i];e.ca&&(t.ca=e.ca),e.ciphers&&(t.ciphers=e.ciphers),e.secureProtocol&&(t.secureProtocol=e.secureProtocol),e.secureOptions&&(t.secureOptions=e.secureOptions),typeof e.rejectUnauthorized<"u"&&(t.rejectUnauthorized=e.rejectUnauthorized),e.cert&&e.key&&(t.key=e.key,t.cert=e.cert),e.pfx&&(t.pfx=e.pfx),e.passphrase&&(t.passphrase=e.passphrase);var a="";r!==e.httpModule.Agent&&(a+=r.name);var n=e.proxy;typeof n=="string"&&(n=Rc.parse(n));var o=n&&n.protocol==="https:"||this.uri.protocol==="https:";return o&&(t.ca&&(a&&(a+=":"),a+=t.ca),typeof t.rejectUnauthorized<"u"&&(a&&(a+=":"),a+=t.rejectUnauthorized),t.cert&&(a&&(a+=":"),a+=t.cert.toString("ascii")+t.key.toString("ascii")),t.pfx&&(a&&(a+=":"),a+=t.pfx.toString("ascii")),t.ciphers&&(a&&(a+=":"),a+=t.ciphers),t.secureProtocol&&(a&&(a+=":"),a+=t.secureProtocol),t.secureOptions&&(a&&(a+=":"),a+=t.secureOptions)),e.pool===b5&&!a&&Object.keys(t).length===0&&e.httpModule.globalAgent?e.httpModule.globalAgent:(a=e.uri.protocol+a,e.pool[a]||(e.pool[a]=new r(t),e.pool.maxSockets&&(e.pool[a].maxSockets=e.pool.maxSockets)),e.pool[a])};Lr.prototype.start=function(){var e=this;if(e.timing)var r=new Date().getTime(),t=su();if(!e._aborted){e._started=!0,e.method=e.method||"GET",e.href=e.uri.href,e.src&&e.src.stat&&e.src.stat.size&&!e.hasHeader("content-length")&&e.setHeader("content-length",e.src.stat.size),e._aws&&e.aws(e._aws,!0);var i=g5(e);delete i.auth,na("make request",e.uri.href),delete i.timeout;try{e.req=e.httpModule.request(i)}catch(n){e.emit("error",n);return}e.timing&&(e.startTime=r,e.startTimeNow=t,e.timings={});var a;e.timeout&&!e.timeoutTimer&&(e.timeout<0?a=0:typeof e.timeout=="number"&&isFinite(e.timeout)&&(a=e.timeout)),e.req.on("response",e.onRequestResponse.bind(e)),e.req.on("error",e.onRequestError.bind(e)),e.req.on("drain",function(){e.emit("drain")}),e.req.on("socket",function(n){var o=n._connecting||n.connecting;if(e.timing&&(e.timings.socket=su()-e.startTimeNow,o)){var s=function(){e.timings.lookup=su()-e.startTimeNow},u=function(){e.timings.connect=su()-e.startTimeNow};n.once("lookup",s),n.once("connect",u),e.req.once("error",function(){n.removeListener("lookup",s),n.removeListener("connect",u)})}var l=function(){e.req.setTimeout(a,function(){if(e.req){e.abort();var h=new Error("ESOCKETTIMEDOUT");h.code="ESOCKETTIMEDOUT",h.connect=!1,e.emit("error",h)}})};if(a!==void 0)if(o){var f=function(){n.removeListener("connect",f),e.clearTimeout(),l()};n.on("connect",f),e.req.on("error",function(h){n.removeListener("connect",f)}),e.timeoutTimer=setTimeout(function(){n.removeListener("connect",f),e.abort();var h=new Error("ETIMEDOUT");h.code="ETIMEDOUT",h.connect=!0,e.emit("error",h)},a)}else l();e.emit("socket",n)}),e.emit("request",e.req)}};Lr.prototype.onRequestError=function(e){var r=this;if(!r._aborted){if(r.req&&r.req._reusedSocket&&e.code==="ECONNRESET"&&r.agent.addRequestNoreuse){r.agent={addRequest:r.agent.addRequestNoreuse.bind(r.agent)},r.start(),r.req.end();return}r.clearTimeout(),r.emit("error",e)}};Lr.prototype.onRequestResponse=function(e){var r=this;if(r.timing&&(r.timings.response=su()-r.startTimeNow),na("onRequestResponse",r.uri.href,e.statusCode,e.headers),e.on("end",function(){r.timing&&(r.timings.end=su()-r.startTimeNow,e.timingStart=r.startTime,r.timings.socket||(r.timings.socket=0),r.timings.lookup||(r.timings.lookup=r.timings.socket),r.timings.connect||(r.timings.connect=r.timings.lookup),r.timings.response||(r.timings.response=r.timings.connect),na("elapsed time",r.timings.end),r.elapsedTime+=Math.round(r.timings.end),e.elapsedTime=r.elapsedTime,e.timings=r.timings,e.timingPhases={wait:r.timings.socket,dns:r.timings.lookup-r.timings.socket,tcp:r.timings.connect-r.timings.lookup,firstByte:r.timings.response-r.timings.connect,download:r.timings.end-r.timings.response,total:r.timings.end}),na("response end",r.uri.href,e.statusCode,e.headers)}),r._aborted){na("aborted",r.uri.href),e.resume();return}if(r.response=e,e.request=r,e.toJSON=nU,r.httpModule===h5&&r.strictSSL&&(!e.hasOwnProperty("socket")||!e.socket.authorized)){na("strict ssl error",r.uri.href);var t=e.hasOwnProperty("socket")?e.socket.authorizationError:r.uri.href+" does not support SSL";r.emit("error",new Error("SSL Error: "+t));return}r.originalHost=r.getHeader("host"),r.originalHostHeaderName||(r.originalHostHeaderName=r.hasHeader("host")),r.setHost&&r.removeHeader("host"),r.clearTimeout();var i=r._jar&&r._jar.setCookie?r._jar:v5,a=function(f){try{i.setCookie(f,r.uri.href,{ignoreError:!0})}catch(h){r.emit("error",h)}};if(e.caseless=m5(e.headers),e.caseless.has("set-cookie")&&!r._disableCookies){var n=e.caseless.has("set-cookie");Array.isArray(e.headers[n])?e.headers[n].forEach(a):a(e.headers[n])}if(!r._redirect.onResponse(e)){{e.on("close",function(){r._ended||r.response.emit("end")}),e.once("end",function(){r._ended=!0});var o=function(f){return r.method==="HEAD"||f>=100&&f<200||f===204||f===304},s;if(r.gzip&&!o(e.statusCode)){var u=e.headers["content-encoding"]||"identity";u=u.trim().toLowerCase();var l={flush:bp.Z_SYNC_FLUSH,finishFlush:bp.Z_SYNC_FLUSH};u==="gzip"?(s=bp.createGunzip(l),e.pipe(s)):u==="deflate"?(s=bp.createInflate(l),e.pipe(s)):(u!=="identity"&&na("ignoring unrecognized Content-Encoding "+u),s=e)}else s=e;r.encoding&&(r.dests.length!==0?console.error("Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid."):s.setEncoding(r.encoding)),r._paused&&s.pause(),r.responseContent=s,r.emit("response",e),r.dests.forEach(function(f){r.pipeDest(f)}),s.on("data",function(f){r.timing&&!r.responseStarted&&(r.responseStartTime=new Date().getTime(),e.responseStartTime=r.responseStartTime),r._destdata=!0,r.emit("data",f)}),s.once("end",function(f){r.emit("end",f)}),s.on("error",function(f){r.emit("error",f)}),s.on("close",function(){r.emit("close")}),r.callback?r.readResponseBody(e):r.on("end",function(){if(r._aborted){na("aborted",r.uri.href);return}r.emit("complete",e)})}na("finish init function",r.uri.href)}};Lr.prototype.readResponseBody=function(e){var r=this;na("reading response's body");var t=[],i=0,a=[];r.on("data",function(n){Cc.isBuffer(n)?n.length&&(i+=n.length,t.push(n)):a.push(n)}),r.on("end",function(){if(na("end event",r.uri.href),r._aborted){na("aborted",r.uri.href),t=[],i=0;return}if(i?(na("has body",r.uri.href,i),e.body=Cc.concat(t,i),r.encoding!==null&&(e.body=e.body.toString(r.encoding)),t=[],i=0):a.length&&(r.encoding==="utf8"&&a[0].length>0&&a[0][0]==="\uFEFF"&&(a[0]=a[0].substring(1)),e.body=a.join("")),r._json)try{e.body=JSON.parse(e.body,r._jsonReviver)}catch{na("invalid JSON received",r.uri.href)}na("emitting complete",r.uri.href),typeof e.body>"u"&&!r._json&&(e.body=r.encoding===null?Cc.alloc(0):""),r.emit("complete",e,e.body)})};Lr.prototype.abort=function(){var e=this;e._aborted=!0,e.req?e.req.abort():e.response&&e.response.destroy(),e.clearTimeout(),e.emit("abort")};Lr.prototype.pipeDest=function(e){var r=this,t=r.response;if(e.headers&&!e.headersSent){if(t.caseless.has("content-type")){var i=t.caseless.has("content-type");e.setHeader?e.setHeader(i,t.headers[i]):e.headers[i]=t.headers[i]}if(t.caseless.has("content-length")){var a=t.caseless.has("content-length");e.setHeader?e.setHeader(a,t.headers[a]):e.headers[a]=t.headers[a]}}if(e.setHeader&&!e.headersSent){for(var n in t.headers)(!r.gzip||n!=="content-encoding")&&e.setHeader(n,t.headers[n]);e.statusCode=t.statusCode}r.pipefilter&&r.pipefilter(t,e)};Lr.prototype.qs=function(e,r){var t=this,i;!r&&t.uri.query?i=t._qs.parse(t.uri.query):i={};for(var a in e)i[a]=e[a];var n=t._qs.stringify(i);return n===""||(t.uri=Rc.parse(t.uri.href.split("?")[0]+"?"+n),t.url=t.uri,t.path=t.uri.path,t.uri.host==="unix"&&t.enableUnixSocket()),t};Lr.prototype.form=function(e){var r=this;return e?(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))||r.setHeader("content-type","application/x-www-form-urlencoded"),r.body=typeof e=="string"?r._qs.rfc3986(e.toString("utf8")):r._qs.stringify(e).toString("utf8"),r):(r._form=new NN,r._form.on("error",function(t){t.message="form-data: "+t.message,r.emit("error",t),r.abort()}),r._form)};Lr.prototype.multipart=function(e){var r=this;return r._multipart.onRequest(e),r._multipart.chunked||(r.body=r._multipart.body),r};Lr.prototype.json=function(e){var r=this;return r.hasHeader("accept")||r.setHeader("accept","application/json"),typeof r.jsonReplacer=="function"&&(r._jsonReplacer=r.jsonReplacer),r._json=!0,typeof e=="boolean"?r.body!==void 0&&(/^application\/x-www-form-urlencoded\b/.test(r.getHeader("content-type"))?r.body=r._qs.rfc3986(r.body):r.body=d5(r.body,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")):(r.body=d5(e,r._jsonReplacer),r.hasHeader("content-type")||r.setHeader("content-type","application/json")),typeof r.jsonReviver=="function"&&(r._jsonReviver=r.jsonReviver),r};Lr.prototype.getHeader=function(e,r){var t=this,i,a,n;return r||(r=t.headers),Object.keys(r).forEach(function(o){o.length===e.length&&(a=new RegExp(e,"i"),n=o.match(a),n&&(i=r[o]))}),i};Lr.prototype.enableUnixSocket=function(){var e=this.uri.path.split(":"),r=e[0],t=e[1];this.socketPath=r,this.uri.pathname=t,this.uri.path=t,this.uri.host=r,this.uri.hostname=r,this.uri.isUnix=!0};Lr.prototype.auth=function(e,r,t,i){var a=this;return a._auth.onRequest(e,r,t,i),a};Lr.prototype.aws=function(e,r){var t=this;if(!r)return t._aws=e,t;if(e.sign_version===4||e.sign_version==="4"){var i={host:t.uri.host,path:t.uri.path,method:t.method,headers:t.headers,body:t.body};e.service&&(i.service=e.service);var a=qN.sign(i,{accessKeyId:e.key,secretAccessKey:e.secret,sessionToken:e.session});t.setHeader("authorization",a.headers.Authorization),t.setHeader("x-amz-date",a.headers["X-Amz-Date"]),a.headers["X-Amz-Security-Token"]&&t.setHeader("x-amz-security-token",a.headers["X-Amz-Security-Token"])}else{var n=new Date;t.setHeader("date",n.toUTCString());var o={key:e.key,secret:e.secret,verb:t.method.toUpperCase(),date:n,contentType:t.getHeader("content-type")||"",md5:t.getHeader("content-md5")||"",amazonHeaders:qg.canonicalizeHeaders(t.headers)},s=t.uri.path;e.bucket&&s?o.resource="/"+e.bucket+s:e.bucket&&!s?o.resource="/"+e.bucket:!e.bucket&&s?o.resource=s:!e.bucket&&!s&&(o.resource="/"),o.resource=qg.canonicalizeResource(o.resource),t.setHeader("authorization",qg.authorization(o))}return t};Lr.prototype.httpSignature=function(e){var r=this;return MN.signRequest({getHeader:function(t){return r.getHeader(t,r.headers)},setHeader:function(t,i){r.setHeader(t,i)},method:r.method,path:r.path},e),na("httpSignature authorization",r.getHeader("authorization")),r};Lr.prototype.hawk=function(e){var r=this;r.setHeader("Authorization",XN.header(r.uri,r.method,e))};Lr.prototype.oauth=function(e){var r=this;return r._oauth.onRequest(e),r};Lr.prototype.jar=function(e){var r=this,t;if(r._redirect.redirectsFollowed===0&&(r.originalCookieHeader=r.getHeader("cookie")),!e)t=!1,r._disableCookies=!0;else{var i=e.getCookieString?e:v5,a=r.uri.href;i&&(t=i.getCookieString(a))}return t&&t.length&&(r.originalCookieHeader?r.setHeader("cookie",r.originalCookieHeader+"; "+t):r.setHeader("cookie",t)),r._jar=e,r};Lr.prototype.pipe=function(e,r){var t=this;if(t.response)if(t._destdata)t.emit("error",new Error("You cannot pipe after data has been emitted from the response."));else if(t._ended)t.emit("error",new Error("You cannot pipe after the response has been ended."));else return yp.Stream.prototype.pipe.call(t,e,r),t.pipeDest(e),e;else return t.dests.push(e),yp.Stream.prototype.pipe.call(t,e,r),e};Lr.prototype.write=function(){var e=this;if(!e._aborted&&(e._started||e.start(),e.req))return e.req.write.apply(e.req,arguments)};Lr.prototype.end=function(e){var r=this;r._aborted||(e&&r.write(e),r._started||r.start(),r.req&&r.req.end())};Lr.prototype.pause=function(){var e=this;e.responseContent?e.responseContent.pause.apply(e.responseContent,arguments):e._paused=!0};Lr.prototype.resume=function(){var e=this;e.responseContent?e.responseContent.resume.apply(e.responseContent,arguments):e._paused=!1};Lr.prototype.destroy=function(){var e=this;this.clearTimeout(),e._ended?e.response&&e.response.destroy():e.end()};Lr.prototype.clearTimeout=function(){this.timeoutTimer&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)};Lr.defaultProxyHeaderWhiteList=zg.defaultProxyHeaderWhiteList.slice();Lr.defaultProxyHeaderExclusiveList=zg.defaultProxyHeaderExclusiveList.slice();Lr.prototype.toJSON=y5;x5.exports=Lr});var S5=D((lJ,k5)=>{"use strict";var Oc=Ul(),_5=pm(),oU=$l(),sU=oU.paramsHaveRequestBody;function xp(e,r,t){typeof r=="function"&&(t=r);var i={};return r!==null&&typeof r=="object"?Oc(i,r,{uri:e}):typeof e=="string"?Oc(i,{uri:e}):Oc(i,e),i.callback=t||i.callback,i}function It(e,r,t){if(typeof e>"u")throw new Error("undefined is not a valid uri or options object.");var i=xp(e,r,t);if(i.method==="HEAD"&&sU(i))throw new Error("HTTP HEAD requests MUST NOT include a request body.");return new It.Request(i)}function ko(e){var r=e.toUpperCase();return function(t,i,a){var n=xp(t,i,a);return n.method=r,It(n,n.callback)}}It.get=ko("get");It.head=ko("head");It.options=ko("options");It.post=ko("post");It.put=ko("put");It.patch=ko("patch");It.del=ko("delete");It.delete=ko("delete");It.jar=function(e){return _5.jar(e)};It.cookie=function(e){return _5.parse(e)};function Ng(e,r,t,i){return function(a,n,o){var s=xp(a,n,o),u={};return Oc(!0,u,r,s),u.pool=s.pool||r.pool,i&&(u.method=i.toUpperCase()),typeof t=="function"&&(e=t),e(u,u.callback)}}It.defaults=function(e,r){var t=this;e=e||{},typeof e=="function"&&(r=e,e={});var i=Ng(t,e,r),a=["get","head","post","put","patch","del","delete"];return a.forEach(function(n){i[n]=Ng(t[n],e,r,n)}),i.cookie=Ng(t.cookie,e,r),i.jar=t.jar,i.defaults=t.defaults,i};It.forever=function(e,r){var t={};return r&&Oc(t,r),e&&(t.agentOptions=e),t.forever=!0,It.defaults(t)};k5.exports=It;It.Request=w5();It.initParams=xp;Object.defineProperty(It,"debug",{enumerable:!0,get:function(){return It.Request.debug},set:function(e){It.Request.debug=e}})});var j5=D((fJ,E5)=>{E5.exports=uU;function uU(e){if(!/^data\:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");var r=e.indexOf(",");if(r===-1||r<=4)throw new TypeError("malformed data: URI");for(var t=e.substring(5,r).split(";"),i=!1,a="US-ASCII",n=0;n<t.length;n++)t[n]=="base64"?i=!0:t[n].indexOf("charset=")==0&&(a=t[n].substring(8));var o=unescape(e.substring(r+1)),s=i?"base64":"ascii",u=new Buffer(o,s);return u.type=t[0]||"text/plain",u.charset=a,u}});var P5=D((pJ,T5)=>{var cU=j5();function lU(e){return{mimeType:pU(fU(e)),data:cU(e)}}function fU(e){return e.substring(5,e.indexOf(";"))}var A5=/^(\w+\/)+/;function pU(e){e=e.toLowerCase();var r=e.match(A5);return!r||!(r=r[1])?e:e.replace(A5,r)}T5.exports=lU});var C5=D((hJ,R5)=>{"use strict";var Ic=qu(),dJ=require("path"),dU=K2().PNG,hU=yh(),mU=J2(),gU=rw().GifReader,vU=ow(),bU=require("fs"),yU=S5(),xU=Gf(),wU=P5();function _U(e,r){var t=new dU;t.parse(e,function(i,a){if(i){r(i);return}r(null,Ic(new Uint8Array(a.data),[a.width|0,a.height|0,4],[4,4*a.width|0,1],0))})}function kU(e,r){var t;try{t=hU.decode(e)}catch(n){r(n);return}if(!t){r(new Error("Error decoding jpeg"));return}var i=[t.height,t.width,4],a=Ic(t.data,i);r(null,a.transpose(1,0))}function SU(e,r){var t;try{t=new gU(e)}catch(s){r(s);return}if(t.numFrames()>0){var i=[t.numFrames(),t.height,t.width,4];try{var a=new Uint8Array(i[0]*i[1]*i[2]*i[3])}catch(s){r(s);return}var n=Ic(a,i);try{for(var o=0;o<t.numFrames();++o)t.decodeAndBlitFrameRGBA(o,a.subarray(n.index(o,0,0,0),n.index(o+1,0,0,0)))}catch(s){r(s);return}r(null,n.transpose(0,2,1))}else{var i=[t.height,t.width,4],a=new Uint8Array(i[0]*i[1]*i[2]),n=Ic(a,i);try{t.decodeAndBlitFrameRGBA(0,a)}catch(f){r(f);return}r(null,n.transpose(1,0))}}function EU(e,r){var t=new vU(e);try{t.init()}catch(s){r(s);return}var i=t.getData(),a=[i.getHeight(),i.getWidth(),4],n=new Uint8Array(a[0]*a[1]*a[2]),o=Ic(n,a);mU(i,o),r(null,o.transpose(1,0))}function wp(e,r,t){switch(e){case"image/png":_U(r,t);break;case"image/jpg":case"image/jpeg":kU(r,t);break;case"image/gif":SU(r,t);break;case"image/bmp":EU(r,t);break;default:t(new Error("Unsupported file type: "+e))}}R5.exports=function(r,t,i){if(i||(i=t,t=""),Buffer.isBuffer(r)){if(!t){i(new Error("Invalid file type"));return}wp(t,r,i)}else if(r.indexOf("data:")===0)try{var a=wU(r);a?process.nextTick(function(){wp(t||a.mimeType,a.data,i)}):process.nextTick(function(){i(new Error("Error parsing data URI"))})}catch(n){process.nextTick(function(){i(n)})}else r.indexOf("http://")===0||r.indexOf("https://")===0?yU({url:r,encoding:null},function(n,o,s){if(n){i(n);return}if(t=t,t||(o.getHeader!==void 0?t=o.getHeader("content-type"):o.headers!==void 0&&(t=o.headers["content-type"])),!t){i(new Error("Invalid content-type"));return}wp(t,s,i)}):bU.readFile(r,function(n,o){if(n){i(n);return}if(t=t||xU.lookup(r),!t){i(new Error("Invalid file type"));return}wp(t,o,i)})}});var Z5=D((Op,Q5)=>{(function(e,r){typeof Op=="object"&&typeof Q5<"u"?r(Op):typeof define=="function"&&define.amd?define(["exports"],r):(e=typeof globalThis<"u"?globalThis:e||self,r(e.WebStreamsPolyfill={}))})(Op,function(e){"use strict";var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol:function(c){return"Symbol("+c+")"};function t(){}function i(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}var a=i();function n(c){return typeof c=="object"&&c!==null||typeof c=="function"}var o=t,s=Promise,u=Promise.prototype.then,l=Promise.resolve.bind(s),f=Promise.reject.bind(s);function h(c){return new s(c)}function d(c){return l(c)}function m(c){return f(c)}function y(c,g,E){return u.call(c,g,E)}function k(c,g,E){y(y(c,g,E),void 0,o)}function x(c,g){k(c,g)}function A(c,g){k(c,void 0,g)}function P(c,g,E){return y(c,g,E)}function T(c){y(c,void 0,o)}var B=function(){var c=a&&a.queueMicrotask;if(typeof c=="function")return c;var g=d(void 0);return function(E){return y(g,E)}}();function C(c,g,E){if(typeof c!="function")throw new TypeError("Argument is not a function");return Function.prototype.apply.call(c,g,E)}function I(c,g,E){try{return d(C(c,g,E))}catch(L){return m(L)}}var F=16384,H=function(){function c(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}return Object.defineProperty(c.prototype,"length",{get:function(){return this._size},enumerable:!1,configurable:!0}),c.prototype.push=function(g){var E=this._back,L=E;E._elements.length===F-1&&(L={_elements:[],_next:void 0}),E._elements.push(g),L!==E&&(this._back=L,E._next=L),++this._size},c.prototype.shift=function(){var g=this._front,E=g,L=this._cursor,Y=L+1,se=g._elements,xe=se[L];return Y===F&&(E=g._next,Y=0),--this._size,this._cursor=Y,g!==E&&(this._front=E),se[L]=void 0,xe},c.prototype.forEach=function(g){for(var E=this._cursor,L=this._front,Y=L._elements;(E!==Y.length||L._next!==void 0)&&!(E===Y.length&&(L=L._next,Y=L._elements,E=0,Y.length===0));)g(Y[E]),++E},c.prototype.peek=function(){var g=this._front,E=this._cursor;return g._elements[E]},c}();function N(c,g){c._ownerReadableStream=g,g._reader=c,g._state==="readable"?U(c):g._state==="closed"?Z(c):$(c,g._storedError)}function K(c,g){var E=c._ownerReadableStream;return wi(E,g)}function V(c){c._ownerReadableStream._state==="readable"?le(c,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")):ve(c,new TypeError("Reader was released and can no longer be used to monitor the stream's closedness")),c._ownerReadableStream._reader=void 0,c._ownerReadableStream=void 0}function X(c){return new TypeError("Cannot "+c+" a stream using a released reader")}function U(c){c._closedPromise=h(function(g,E){c._closedPromise_resolve=g,c._closedPromise_reject=E})}function $(c,g){U(c),le(c,g)}function Z(c){U(c),fe(c)}function le(c,g){c._closedPromise_reject!==void 0&&(T(c._closedPromise),c._closedPromise_reject(g),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0)}function ve(c,g){$(c,g)}function fe(c){c._closedPromise_resolve!==void 0&&(c._closedPromise_resolve(void 0),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0)}var we=r("[[AbortSteps]]"),ye=r("[[ErrorSteps]]"),Me=r("[[CancelSteps]]"),ze=r("[[PullSteps]]"),Ie=Number.isFinite||function(c){return typeof c=="number"&&isFinite(c)},W=Math.trunc||function(c){return c<0?Math.ceil(c):Math.floor(c)};function ke(c){return typeof c=="object"||typeof c=="function"}function Qe(c,g){if(c!==void 0&&!ke(c))throw new TypeError(g+" is not an object.")}function $e(c,g){if(typeof c!="function")throw new TypeError(g+" is not a function.")}function Ve(c){return typeof c=="object"&&c!==null||typeof c=="function"}function tr(c,g){if(!Ve(c))throw new TypeError(g+" is not an object.")}function Be(c,g,E){if(c===void 0)throw new TypeError("Parameter "+g+" is required in '"+E+"'.")}function de(c,g,E){if(c===void 0)throw new TypeError(g+" is required in '"+E+"'.")}function Se(c){return Number(c)}function nr(c){return c===0?0:c}function Pe(c){return nr(W(c))}function cr(c,g){var E=0,L=Number.MAX_SAFE_INTEGER,Y=Number(c);if(Y=nr(Y),!Ie(Y))throw new TypeError(g+" is not a finite number");if(Y=Pe(Y),Y<E||Y>L)throw new TypeError(g+" is outside the accepted range of "+E+" to "+L+", inclusive");return!Ie(Y)||Y===0?0:Y}function qr(c,g){if(!$n(c))throw new TypeError(g+" is not a ReadableStream.")}function Kr(c){return new Xe(c)}function ee(c,g){c._reader._readRequests.push(g)}function Fe(c,g,E){var L=c._reader,Y=L._readRequests.shift();E?Y._closeSteps():Y._chunkSteps(g)}function Ke(c){return c._reader._readRequests.length}function Ge(c){var g=c._reader;return!(g===void 0||!er(g))}var Xe=function(){function c(g){if(Be(g,1,"ReadableStreamDefaultReader"),qr(g,"First parameter"),Kn(g))throw new TypeError("This stream has already been locked for exclusive reading by another reader");N(this,g),this._readRequests=new H}return Object.defineProperty(c.prototype,"closed",{get:function(){return er(this)?this._closedPromise:m(gr("closed"))},enumerable:!1,configurable:!0}),c.prototype.cancel=function(g){return g===void 0&&(g=void 0),er(this)?this._ownerReadableStream===void 0?m(X("cancel")):K(this,g):m(gr("cancel"))},c.prototype.read=function(){if(!er(this))return m(gr("read"));if(this._ownerReadableStream===void 0)return m(X("read from"));var g,E,L=h(function(se,xe){g=se,E=xe}),Y={_chunkSteps:function(se){return g({value:se,done:!1})},_closeSteps:function(){return g({value:void 0,done:!0})},_errorSteps:function(se){return E(se)}};return or(this,Y),L},c.prototype.releaseLock=function(){if(!er(this))throw gr("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");V(this)}},c}();Object.defineProperties(Xe.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Xe.prototype,r.toStringTag,{value:"ReadableStreamDefaultReader",configurable:!0});function er(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readRequests")?!1:c instanceof Xe}function or(c,g){var E=c._ownerReadableStream;E._disturbed=!0,E._state==="closed"?g._closeSteps():E._state==="errored"?g._errorSteps(E._storedError):E._readableStreamController[ze](g)}function gr(c){return new TypeError("ReadableStreamDefaultReader.prototype."+c+" can only be used on a ReadableStreamDefaultReader")}var Dr,vr;typeof r.asyncIterator=="symbol"&&(vr=(Dr={},Dr[r.asyncIterator]=function(){return this},Dr),Object.defineProperty(vr,r.asyncIterator,{enumerable:!1}));var be=function(){function c(g,E){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=g,this._preventCancel=E}return c.prototype.next=function(){var g=this,E=function(){return g._nextSteps()};return this._ongoingPromise=this._ongoingPromise?P(this._ongoingPromise,E,E):E(),this._ongoingPromise},c.prototype.return=function(g){var E=this,L=function(){return E._returnSteps(g)};return this._ongoingPromise?P(this._ongoingPromise,L,L):L()},c.prototype._nextSteps=function(){var g=this;if(this._isFinished)return Promise.resolve({value:void 0,done:!0});var E=this._reader;if(E._ownerReadableStream===void 0)return m(X("iterate"));var L,Y,se=h(function(Je,Ar){L=Je,Y=Ar}),xe={_chunkSteps:function(Je){g._ongoingPromise=void 0,B(function(){return L({value:Je,done:!1})})},_closeSteps:function(){g._ongoingPromise=void 0,g._isFinished=!0,V(E),L({value:void 0,done:!0})},_errorSteps:function(Je){g._ongoingPromise=void 0,g._isFinished=!0,V(E),Y(Je)}};return or(E,xe),se},c.prototype._returnSteps=function(g){if(this._isFinished)return Promise.resolve({value:g,done:!0});this._isFinished=!0;var E=this._reader;if(E._ownerReadableStream===void 0)return m(X("finish iterating"));if(!this._preventCancel){var L=K(E,g);return V(E),P(L,function(){return{value:g,done:!0}})}return V(E),d({value:g,done:!0})},c}(),Ye={next:function(){return Pr(this)?this._asyncIteratorImpl.next():m(lr("next"))},return:function(c){return Pr(this)?this._asyncIteratorImpl.return(c):m(lr("return"))}};vr!==void 0&&Object.setPrototypeOf(Ye,vr);function pr(c,g){var E=Kr(c),L=new be(E,g),Y=Object.create(Ye);return Y._asyncIteratorImpl=L,Y}function Pr(c){if(!n(c)||!Object.prototype.hasOwnProperty.call(c,"_asyncIteratorImpl"))return!1;try{return c._asyncIteratorImpl instanceof be}catch{return!1}}function lr(c){return new TypeError("ReadableStreamAsyncIterator."+c+" can only be used on a ReadableSteamAsyncIterator")}var br=Number.isNaN||function(c){return c!==c};function _r(c){return c.slice()}function sr(c,g,E,L,Y){new Uint8Array(c).set(new Uint8Array(E,L,Y),g)}function hr(c){return c}function Vr(c){return!1}function Cr(c,g,E){if(c.slice)return c.slice(g,E);var L=E-g,Y=new ArrayBuffer(L);return sr(Y,0,c,g,L),Y}function Et(c){return!(typeof c!="number"||br(c)||c<0)}function Ft(c){var g=Cr(c.buffer,c.byteOffset,c.byteOffset+c.byteLength);return new Uint8Array(g)}function sa(c){var g=c._queue.shift();return c._queueTotalSize-=g.size,c._queueTotalSize<0&&(c._queueTotalSize=0),g.value}function va(c,g,E){if(!Et(E)||E===1/0)throw new RangeError("Size must be a finite, non-NaN, non-negative number.");c._queue.push({value:g,size:E}),c._queueTotalSize+=E}function rt(c){var g=c._queue.peek();return g.value}function ut(c){c._queue=new H,c._queueTotalSize=0}var mt=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"view",{get:function(){if(!ua(this))throw Ne("view");return this._view},enumerable:!1,configurable:!0}),c.prototype.respond=function(g){if(!ua(this))throw Ne("respond");if(Be(g,1,"respond"),g=cr(g,"First parameter"),this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");Vr(this._view.buffer),Ze(this._associatedReadableByteStreamController,g)},c.prototype.respondWithNewView=function(g){if(!ua(this))throw Ne("respondWithNewView");if(Be(g,1,"respondWithNewView"),!ArrayBuffer.isView(g))throw new TypeError("You can only respond with array buffer views");if(this._associatedReadableByteStreamController===void 0)throw new TypeError("This BYOB request has been invalidated");Vr(g.buffer),Re(this._associatedReadableByteStreamController,g)},c}();Object.defineProperties(mt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(mt.prototype,r.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:!0});var Dt=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"byobRequest",{get:function(){if(!gt(this))throw ge("byobRequest");return Oe(this)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!gt(this))throw ge("desiredSize");return ar(this)},enumerable:!1,configurable:!0}),c.prototype.close=function(){if(!gt(this))throw ge("close");if(this._closeRequested)throw new TypeError("The stream has already been closed; do not close it again!");var g=this._controlledReadableByteStream._state;if(g!=="readable")throw new TypeError("The stream (in "+g+" state) is not in the readable state and cannot be closed");De(this)},c.prototype.enqueue=function(g){if(!gt(this))throw ge("enqueue");if(Be(g,1,"enqueue"),!ArrayBuffer.isView(g))throw new TypeError("chunk must be an array buffer view");if(g.byteLength===0)throw new TypeError("chunk must have non-zero byteLength");if(g.buffer.byteLength===0)throw new TypeError("chunk's buffer must have non-zero byteLength");if(this._closeRequested)throw new TypeError("stream is closed or draining");var E=this._controlledReadableByteStream._state;if(E!=="readable")throw new TypeError("The stream (in "+E+" state) is not in the readable state and cannot be enqueued to");je(this,g)},c.prototype.error=function(g){if(g===void 0&&(g=void 0),!gt(this))throw ge("error");Ce(this,g)},c.prototype[Me]=function(g){tt(this),ut(this);var E=this._cancelAlgorithm(g);return He(this),E},c.prototype[ze]=function(g){var E=this._controlledReadableByteStream;if(this._queueTotalSize>0){var L=this._queue.shift();this._queueTotalSize-=L.byteLength,_(this);var Y=new Uint8Array(L.buffer,L.byteOffset,L.byteLength);g._chunkSteps(Y);return}var se=this._autoAllocateChunkSize;if(se!==void 0){var xe=void 0;try{xe=new ArrayBuffer(se)}catch(Ar){g._errorSteps(Ar);return}var Je={buffer:xe,bufferByteLength:se,byteOffset:0,byteLength:se,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(Je)}ee(E,g),Ut(this)},c}();Object.defineProperties(Dt.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Dt.prototype,r.toStringTag,{value:"ReadableByteStreamController",configurable:!0});function gt(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledReadableByteStream")?!1:c instanceof Dt}function ua(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_associatedReadableByteStreamController")?!1:c instanceof mt}function Ut(c){var g=_e(c);if(g){if(c._pulling){c._pullAgain=!0;return}c._pulling=!0;var E=c._pullAlgorithm();k(E,function(){c._pulling=!1,c._pullAgain&&(c._pullAgain=!1,Ut(c))},function(L){Ce(c,L)})}}function tt(c){O(c),c._pendingPullIntos=new H}function Ga(c,g){var E=!1;c._state==="closed"&&(E=!0);var L=w(g);g.readerType==="default"?Fe(c,L,E):pe(c,L,E)}function w(c){var g=c.bytesFilled,E=c.elementSize;return new c.viewConstructor(c.buffer,c.byteOffset,g/E)}function b(c,g,E,L){c._queue.push({buffer:g,byteOffset:E,byteLength:L}),c._queueTotalSize+=L}function v(c,g){var E=g.elementSize,L=g.bytesFilled-g.bytesFilled%E,Y=Math.min(c._queueTotalSize,g.byteLength-g.bytesFilled),se=g.bytesFilled+Y,xe=se-se%E,Je=Y,Ar=!1;xe>L&&(Je=xe-g.bytesFilled,Ar=!0);for(var Br=c._queue;Je>0;){var Mr=Br.peek(),$r=Math.min(Je,Mr.byteLength),Lt=g.byteOffset+g.bytesFilled;sr(g.buffer,Lt,Mr.buffer,Mr.byteOffset,$r),Mr.byteLength===$r?Br.shift():(Mr.byteOffset+=$r,Mr.byteLength-=$r),c._queueTotalSize-=$r,p(c,$r,g),Je-=$r}return Ar}function p(c,g,E){E.bytesFilled+=g}function _(c){c._queueTotalSize===0&&c._closeRequested?(He(c),_u(c._controlledReadableByteStream)):Ut(c)}function O(c){c._byobRequest!==null&&(c._byobRequest._associatedReadableByteStreamController=void 0,c._byobRequest._view=null,c._byobRequest=null)}function z(c){for(;c._pendingPullIntos.length>0;){if(c._queueTotalSize===0)return;var g=c._pendingPullIntos.peek();v(c,g)&&(Ue(c),Ga(c._controlledReadableByteStream,g))}}function Q(c,g,E){var L=c._controlledReadableByteStream,Y=1;g.constructor!==DataView&&(Y=g.constructor.BYTES_PER_ELEMENT);var se=g.constructor,xe=g.buffer,Je={buffer:xe,bufferByteLength:xe.byteLength,byteOffset:g.byteOffset,byteLength:g.byteLength,bytesFilled:0,elementSize:Y,viewConstructor:se,readerType:"byob"};if(c._pendingPullIntos.length>0){c._pendingPullIntos.push(Je),re(L,E);return}if(L._state==="closed"){var Ar=new se(Je.buffer,Je.byteOffset,0);E._closeSteps(Ar);return}if(c._queueTotalSize>0){if(v(c,Je)){var Br=w(Je);_(c),E._chunkSteps(Br);return}if(c._closeRequested){var Mr=new TypeError("Insufficient bytes to fill elements in the given buffer");Ce(c,Mr),E._errorSteps(Mr);return}}c._pendingPullIntos.push(Je),re(L,E),Ut(c)}function ae(c,g){var E=c._controlledReadableByteStream;if(te(E))for(;oe(E)>0;){var L=Ue(c);Ga(E,L)}}function he(c,g,E){if(p(c,g,E),!(E.bytesFilled<E.elementSize)){Ue(c);var L=E.bytesFilled%E.elementSize;if(L>0){var Y=E.byteOffset+E.bytesFilled,se=Cr(E.buffer,Y-L,Y);b(c,se,0,se.byteLength)}E.bytesFilled-=L,Ga(c._controlledReadableByteStream,E),z(c)}}function me(c,g){var E=c._pendingPullIntos.peek();O(c);var L=c._controlledReadableByteStream._state;L==="closed"?ae(c):he(c,g,E),Ut(c)}function Ue(c){var g=c._pendingPullIntos.shift();return g}function _e(c){var g=c._controlledReadableByteStream;if(g._state!=="readable"||c._closeRequested||!c._started)return!1;if(Ge(g)&&Ke(g)>0||te(g)&&oe(g)>0)return!0;var E=ar(c);return E>0}function He(c){c._pullAlgorithm=void 0,c._cancelAlgorithm=void 0}function De(c){var g=c._controlledReadableByteStream;if(!(c._closeRequested||g._state!=="readable")){if(c._queueTotalSize>0){c._closeRequested=!0;return}if(c._pendingPullIntos.length>0){var E=c._pendingPullIntos.peek();if(E.bytesFilled>0){var L=new TypeError("Insufficient bytes to fill elements in the given buffer");throw Ce(c,L),L}}He(c),_u(g)}}function je(c,g){var E=c._controlledReadableByteStream;if(!(c._closeRequested||E._state!=="readable")){var L=g.buffer,Y=g.byteOffset,se=g.byteLength,xe=L;if(c._pendingPullIntos.length>0){var Je=c._pendingPullIntos.peek();Vr(Je.buffer),Je.buffer=Je.buffer}if(O(c),Ge(E))if(Ke(E)===0)b(c,xe,Y,se);else{c._pendingPullIntos.length>0&&Ue(c);var Ar=new Uint8Array(xe,Y,se);Fe(E,Ar,!1)}else te(E)?(b(c,xe,Y,se),z(c)):b(c,xe,Y,se);Ut(c)}}function Ce(c,g){var E=c._controlledReadableByteStream;E._state==="readable"&&(tt(c),ut(c),He(c),B1(E,g))}function Oe(c){if(c._byobRequest===null&&c._pendingPullIntos.length>0){var g=c._pendingPullIntos.peek(),E=new Uint8Array(g.buffer,g.byteOffset+g.bytesFilled,g.byteLength-g.bytesFilled),L=Object.create(mt.prototype);qe(L,c,E),c._byobRequest=L}return c._byobRequest}function ar(c){var g=c._controlledReadableByteStream._state;return g==="errored"?null:g==="closed"?0:c._strategyHWM-c._queueTotalSize}function Ze(c,g){var E=c._pendingPullIntos.peek(),L=c._controlledReadableByteStream._state;if(L==="closed"){if(g!==0)throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}else{if(g===0)throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream");if(E.bytesFilled+g>E.byteLength)throw new RangeError("bytesWritten out of range")}E.buffer=E.buffer,me(c,g)}function Re(c,g){var E=c._pendingPullIntos.peek(),L=c._controlledReadableByteStream._state;if(L==="closed"){if(g.byteLength!==0)throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}else if(g.byteLength===0)throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream");if(E.byteOffset+E.bytesFilled!==g.byteOffset)throw new RangeError("The region specified by view does not match byobRequest");if(E.bufferByteLength!==g.buffer.byteLength)throw new RangeError("The buffer of view has different capacity than byobRequest");if(E.bytesFilled+g.byteLength>E.byteLength)throw new RangeError("The region specified by view is larger than byobRequest");var Y=g.byteLength;E.buffer=g.buffer,me(c,Y)}function Ae(c,g,E,L,Y,se,xe){g._controlledReadableByteStream=c,g._pullAgain=!1,g._pulling=!1,g._byobRequest=null,g._queue=g._queueTotalSize=void 0,ut(g),g._closeRequested=!1,g._started=!1,g._strategyHWM=se,g._pullAlgorithm=L,g._cancelAlgorithm=Y,g._autoAllocateChunkSize=xe,g._pendingPullIntos=new H,c._readableStreamController=g;var Je=E();k(d(Je),function(){g._started=!0,Ut(g)},function(Ar){Ce(g,Ar)})}function Te(c,g,E){var L=Object.create(Dt.prototype),Y=function(){},se=function(){return d(void 0)},xe=function(){return d(void 0)};g.start!==void 0&&(Y=function(){return g.start(L)}),g.pull!==void 0&&(se=function(){return g.pull(L)}),g.cancel!==void 0&&(xe=function(Ar){return g.cancel(Ar)});var Je=g.autoAllocateChunkSize;if(Je===0)throw new TypeError("autoAllocateChunkSize must be greater than 0");Ae(c,L,Y,se,xe,E,Je)}function qe(c,g,E){c._associatedReadableByteStreamController=g,c._view=E}function Ne(c){return new TypeError("ReadableStreamBYOBRequest.prototype."+c+" can only be used on a ReadableStreamBYOBRequest")}function ge(c){return new TypeError("ReadableByteStreamController.prototype."+c+" can only be used on a ReadableByteStreamController")}function J(c){return new ne(c)}function re(c,g){c._reader._readIntoRequests.push(g)}function pe(c,g,E){var L=c._reader,Y=L._readIntoRequests.shift();E?Y._closeSteps(g):Y._chunkSteps(g)}function oe(c){return c._reader._readIntoRequests.length}function te(c){var g=c._reader;return!(g===void 0||!We(g))}var ne=function(){function c(g){if(Be(g,1,"ReadableStreamBYOBReader"),qr(g,"First parameter"),Kn(g))throw new TypeError("This stream has already been locked for exclusive reading by another reader");if(!gt(g._readableStreamController))throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source");N(this,g),this._readIntoRequests=new H}return Object.defineProperty(c.prototype,"closed",{get:function(){return We(this)?this._closedPromise:m(ir("closed"))},enumerable:!1,configurable:!0}),c.prototype.cancel=function(g){return g===void 0&&(g=void 0),We(this)?this._ownerReadableStream===void 0?m(X("cancel")):K(this,g):m(ir("cancel"))},c.prototype.read=function(g){if(!We(this))return m(ir("read"));if(!ArrayBuffer.isView(g))return m(new TypeError("view must be an array buffer view"));if(g.byteLength===0)return m(new TypeError("view must have non-zero byteLength"));if(g.buffer.byteLength===0)return m(new TypeError("view's buffer must have non-zero byteLength"));if(Vr(g.buffer),this._ownerReadableStream===void 0)return m(X("read from"));var E,L,Y=h(function(xe,Je){E=xe,L=Je}),se={_chunkSteps:function(xe){return E({value:xe,done:!1})},_closeSteps:function(xe){return E({value:xe,done:!0})},_errorSteps:function(xe){return L(xe)}};return fr(this,g,se),Y},c.prototype.releaseLock=function(){if(!We(this))throw ir("releaseLock");if(this._ownerReadableStream!==void 0){if(this._readIntoRequests.length>0)throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");V(this)}},c}();Object.defineProperties(ne.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(ne.prototype,r.toStringTag,{value:"ReadableStreamBYOBReader",configurable:!0});function We(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readIntoRequests")?!1:c instanceof ne}function fr(c,g,E){var L=c._ownerReadableStream;L._disturbed=!0,L._state==="errored"?E._errorSteps(L._storedError):Q(L._readableStreamController,g,E)}function ir(c){return new TypeError("ReadableStreamBYOBReader.prototype."+c+" can only be used on a ReadableStreamBYOBReader")}function ur(c,g){var E=c.highWaterMark;if(E===void 0)return g;if(br(E)||E<0)throw new RangeError("Invalid highWaterMark");return E}function M(c){var g=c.size;return g||function(){return 1}}function xr(c,g){Qe(c,g);var E=c==null?void 0:c.highWaterMark,L=c==null?void 0:c.size;return{highWaterMark:E===void 0?void 0:Se(E),size:L===void 0?void 0:Tr(L,g+" has member 'size' that")}}function Tr(c,g){return $e(c,g),function(E){return Se(c(E))}}function kr(c,g){Qe(c,g);var E=c==null?void 0:c.abort,L=c==null?void 0:c.close,Y=c==null?void 0:c.start,se=c==null?void 0:c.type,xe=c==null?void 0:c.write;return{abort:E===void 0?void 0:dr(E,c,g+" has member 'abort' that"),close:L===void 0?void 0:jr(L,c,g+" has member 'close' that"),start:Y===void 0?void 0:Sr(Y,c,g+" has member 'start' that"),write:xe===void 0?void 0:at(xe,c,g+" has member 'write' that"),type:se}}function dr(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function jr(c,g,E){return $e(c,E),function(){return I(c,g,[])}}function Sr(c,g,E){return $e(c,E),function(L){return C(c,g,[L])}}function at(c,g,E){return $e(c,E),function(L,Y){return I(c,g,[L,Y])}}function Rr(c,g){if(!Le(c))throw new TypeError(g+" is not a WritableStream.")}function S(c){if(typeof c!="object"||c===null)return!1;try{return typeof c.aborted=="boolean"}catch{return!1}}var j=typeof AbortController=="function";function R(){if(j)return new AbortController}var G=function(){function c(g,E){g===void 0&&(g={}),E===void 0&&(E={}),g===void 0?g=null:tr(g,"First parameter");var L=xr(E,"Second parameter"),Y=kr(g,"First parameter");Ee(this);var se=Y.type;if(se!==void 0)throw new RangeError("Invalid type is specified");var xe=M(L),Je=ur(L,1);qA(this,Y,Je,xe)}return Object.defineProperty(c.prototype,"locked",{get:function(){if(!Le(this))throw dl("locked");return Or(this)},enumerable:!1,configurable:!0}),c.prototype.abort=function(g){return g===void 0&&(g=void 0),Le(this)?Or(this)?m(new TypeError("Cannot abort a stream that already has a writer")):ct(this,g):m(dl("abort"))},c.prototype.close=function(){return Le(this)?Or(this)?m(new TypeError("Cannot close a stream that already has a writer")):xi(this)?m(new TypeError("Cannot close an already-closing stream")):ca(this):m(dl("close"))},c.prototype.getWriter=function(){if(!Le(this))throw dl("getWriter");return ie(this)},c}();Object.defineProperties(G.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(G.prototype,r.toStringTag,{value:"WritableStream",configurable:!0});function ie(c){return new ps(c)}function ue(c,g,E,L,Y,se){Y===void 0&&(Y=1),se===void 0&&(se=function(){return 1});var xe=Object.create(G.prototype);Ee(xe);var Je=Object.create(Ro.prototype);return w1(xe,Je,c,g,E,L,Y,se),xe}function Ee(c){c._state="writable",c._storedError=void 0,c._writer=void 0,c._writableStreamController=void 0,c._writeRequests=new H,c._inFlightWriteRequest=void 0,c._closeRequest=void 0,c._inFlightCloseRequest=void 0,c._pendingAbortRequest=void 0,c._backpressure=!1}function Le(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_writableStreamController")?!1:c instanceof G}function Or(c){return c._writer!==void 0}function ct(c,g){var E;if(c._state==="closed"||c._state==="errored")return d(void 0);c._writableStreamController._abortReason=g,(E=c._writableStreamController._abortController)===null||E===void 0||E.abort();var L=c._state;if(L==="closed"||L==="errored")return d(void 0);if(c._pendingAbortRequest!==void 0)return c._pendingAbortRequest._promise;var Y=!1;L==="erroring"&&(Y=!0,g=void 0);var se=h(function(xe,Je){c._pendingAbortRequest={_promise:void 0,_resolve:xe,_reject:Je,_reason:g,_wasAlreadyErroring:Y}});return c._pendingAbortRequest._promise=se,Y||yn(c,g),se}function ca(c){var g=c._state;if(g==="closed"||g==="errored")return m(new TypeError("The stream (in "+g+" state) is not in the writable state and cannot be closed"));var E=h(function(Y,se){var xe={_resolve:Y,_reject:se};c._closeRequest=xe}),L=c._writer;return L!==void 0&&c._backpressure&&g==="writable"&&Ad(L),MA(c._writableStreamController),E}function la(c){var g=h(function(E,L){var Y={_resolve:E,_reject:L};c._writeRequests.push(Y)});return g}function Ta(c,g){var E=c._state;if(E==="writable"){yn(c,g);return}ba(c)}function yn(c,g){var E=c._writableStreamController;c._state="erroring",c._storedError=g;var L=c._writer;L!==void 0&&v1(L,g),!CA(c)&&E._started&&ba(c)}function ba(c){c._state="errored",c._writableStreamController[ye]();var g=c._storedError;if(c._writeRequests.forEach(function(Y){Y._reject(g)}),c._writeRequests=new H,c._pendingAbortRequest===void 0){ll(c);return}var E=c._pendingAbortRequest;if(c._pendingAbortRequest=void 0,E._wasAlreadyErroring){E._reject(g),ll(c);return}var L=c._writableStreamController[we](E._reason);k(L,function(){E._resolve(),ll(c)},function(Y){E._reject(Y),ll(c)})}function Fa(c){c._inFlightWriteRequest._resolve(void 0),c._inFlightWriteRequest=void 0}function To(c,g){c._inFlightWriteRequest._reject(g),c._inFlightWriteRequest=void 0,Ta(c,g)}function yi(c){c._inFlightCloseRequest._resolve(void 0),c._inFlightCloseRequest=void 0;var g=c._state;g==="erroring"&&(c._storedError=void 0,c._pendingAbortRequest!==void 0&&(c._pendingAbortRequest._resolve(),c._pendingAbortRequest=void 0)),c._state="closed";var E=c._writer;E!==void 0&&E1(E)}function fs(c,g){c._inFlightCloseRequest._reject(g),c._inFlightCloseRequest=void 0,c._pendingAbortRequest!==void 0&&(c._pendingAbortRequest._reject(g),c._pendingAbortRequest=void 0),Ta(c,g)}function xi(c){return!(c._closeRequest===void 0&&c._inFlightCloseRequest===void 0)}function CA(c){return!(c._inFlightWriteRequest===void 0&&c._inFlightCloseRequest===void 0)}function OA(c){c._inFlightCloseRequest=c._closeRequest,c._closeRequest=void 0}function IA(c){c._inFlightWriteRequest=c._writeRequests.shift()}function ll(c){c._closeRequest!==void 0&&(c._closeRequest._reject(c._storedError),c._closeRequest=void 0);var g=c._writer;g!==void 0&&Ed(g,c._storedError)}function xd(c,g){var E=c._writer;E!==void 0&&g!==c._backpressure&&(g?VA(E):Ad(E)),c._backpressure=g}var ps=function(){function c(g){if(Be(g,1,"WritableStreamDefaultWriter"),Rr(g,"First parameter"),Or(g))throw new TypeError("This stream has already been locked for exclusive writing by another writer");this._ownerWritableStream=g,g._writer=this;var E=g._state;if(E==="writable")!xi(g)&&g._backpressure?ml(this):j1(this),hl(this);else if(E==="erroring")jd(this,g._storedError),hl(this);else if(E==="closed")j1(this),GA(this);else{var L=g._storedError;jd(this,L),S1(this,L)}}return Object.defineProperty(c.prototype,"closed",{get:function(){return Po(this)?this._closedPromise:m(Co("closed"))},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!Po(this))throw Co("desiredSize");if(this._ownerWritableStream===void 0)throw yu("desiredSize");return LA(this)},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"ready",{get:function(){return Po(this)?this._readyPromise:m(Co("ready"))},enumerable:!1,configurable:!0}),c.prototype.abort=function(g){return g===void 0&&(g=void 0),Po(this)?this._ownerWritableStream===void 0?m(yu("abort")):BA(this,g):m(Co("abort"))},c.prototype.close=function(){if(!Po(this))return m(Co("close"));var g=this._ownerWritableStream;return g===void 0?m(yu("close")):xi(g)?m(new TypeError("Cannot close an already-closing stream")):g1(this)},c.prototype.releaseLock=function(){if(!Po(this))throw Co("releaseLock");var g=this._ownerWritableStream;g!==void 0&&b1(this)},c.prototype.write=function(g){return g===void 0&&(g=void 0),Po(this)?this._ownerWritableStream===void 0?m(yu("write to")):y1(this,g):m(Co("write"))},c}();Object.defineProperties(ps.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(ps.prototype,r.toStringTag,{value:"WritableStreamDefaultWriter",configurable:!0});function Po(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_ownerWritableStream")?!1:c instanceof ps}function BA(c,g){var E=c._ownerWritableStream;return ct(E,g)}function g1(c){var g=c._ownerWritableStream;return ca(g)}function FA(c){var g=c._ownerWritableStream,E=g._state;return xi(g)||E==="closed"?d(void 0):E==="errored"?m(g._storedError):g1(c)}function DA(c,g){c._closedPromiseState==="pending"?Ed(c,g):WA(c,g)}function v1(c,g){c._readyPromiseState==="pending"?A1(c,g):$A(c,g)}function LA(c){var g=c._ownerWritableStream,E=g._state;return E==="errored"||E==="erroring"?null:E==="closed"?0:_1(g._writableStreamController)}function b1(c){var g=c._ownerWritableStream,E=new TypeError("Writer was released and can no longer be used to monitor the stream's closedness");v1(c,E),DA(c,E),g._writer=void 0,c._ownerWritableStream=void 0}function y1(c,g){var E=c._ownerWritableStream,L=E._writableStreamController,Y=zA(L,g);if(E!==c._ownerWritableStream)return m(yu("write to"));var se=E._state;if(se==="errored")return m(E._storedError);if(xi(E)||se==="closed")return m(new TypeError("The stream is closing or closed and cannot be written to"));if(se==="erroring")return m(E._storedError);var xe=la(E);return NA(L,g,Y),xe}var x1={},Ro=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"abortReason",{get:function(){if(!wd(this))throw Sd("abortReason");return this._abortReason},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"signal",{get:function(){if(!wd(this))throw Sd("signal");if(this._abortController===void 0)throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported");return this._abortController.signal},enumerable:!1,configurable:!0}),c.prototype.error=function(g){if(g===void 0&&(g=void 0),!wd(this))throw Sd("error");var E=this._controlledWritableStream._state;E==="writable"&&k1(this,g)},c.prototype[we]=function(g){var E=this._abortAlgorithm(g);return fl(this),E},c.prototype[ye]=function(){ut(this)},c}();Object.defineProperties(Ro.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Ro.prototype,r.toStringTag,{value:"WritableStreamDefaultController",configurable:!0});function wd(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledWritableStream")?!1:c instanceof Ro}function w1(c,g,E,L,Y,se,xe,Je){g._controlledWritableStream=c,c._writableStreamController=g,g._queue=void 0,g._queueTotalSize=void 0,ut(g),g._abortReason=void 0,g._abortController=R(),g._started=!1,g._strategySizeAlgorithm=Je,g._strategyHWM=xe,g._writeAlgorithm=L,g._closeAlgorithm=Y,g._abortAlgorithm=se;var Ar=kd(g);xd(c,Ar);var Br=E(),Mr=d(Br);k(Mr,function(){g._started=!0,pl(g)},function($r){g._started=!0,Ta(c,$r)})}function qA(c,g,E,L){var Y=Object.create(Ro.prototype),se=function(){},xe=function(){return d(void 0)},Je=function(){return d(void 0)},Ar=function(){return d(void 0)};g.start!==void 0&&(se=function(){return g.start(Y)}),g.write!==void 0&&(xe=function(Br){return g.write(Br,Y)}),g.close!==void 0&&(Je=function(){return g.close()}),g.abort!==void 0&&(Ar=function(Br){return g.abort(Br)}),w1(c,Y,se,xe,Je,Ar,E,L)}function fl(c){c._writeAlgorithm=void 0,c._closeAlgorithm=void 0,c._abortAlgorithm=void 0,c._strategySizeAlgorithm=void 0}function MA(c){va(c,x1,0),pl(c)}function zA(c,g){try{return c._strategySizeAlgorithm(g)}catch(E){return _d(c,E),1}}function _1(c){return c._strategyHWM-c._queueTotalSize}function NA(c,g,E){try{va(c,g,E)}catch(se){_d(c,se);return}var L=c._controlledWritableStream;if(!xi(L)&&L._state==="writable"){var Y=kd(c);xd(L,Y)}pl(c)}function pl(c){var g=c._controlledWritableStream;if(c._started&&g._inFlightWriteRequest===void 0){var E=g._state;if(E==="erroring"){ba(g);return}if(c._queue.length!==0){var L=rt(c);L===x1?UA(c):HA(c,L)}}}function _d(c,g){c._controlledWritableStream._state==="writable"&&k1(c,g)}function UA(c){var g=c._controlledWritableStream;OA(g),sa(c);var E=c._closeAlgorithm();fl(c),k(E,function(){yi(g)},function(L){fs(g,L)})}function HA(c,g){var E=c._controlledWritableStream;IA(E);var L=c._writeAlgorithm(g);k(L,function(){Fa(E);var Y=E._state;if(sa(c),!xi(E)&&Y==="writable"){var se=kd(c);xd(E,se)}pl(c)},function(Y){E._state==="writable"&&fl(c),To(E,Y)})}function kd(c){var g=_1(c);return g<=0}function k1(c,g){var E=c._controlledWritableStream;fl(c),yn(E,g)}function dl(c){return new TypeError("WritableStream.prototype."+c+" can only be used on a WritableStream")}function Sd(c){return new TypeError("WritableStreamDefaultController.prototype."+c+" can only be used on a WritableStreamDefaultController")}function Co(c){return new TypeError("WritableStreamDefaultWriter.prototype."+c+" can only be used on a WritableStreamDefaultWriter")}function yu(c){return new TypeError("Cannot "+c+" a stream using a released writer")}function hl(c){c._closedPromise=h(function(g,E){c._closedPromise_resolve=g,c._closedPromise_reject=E,c._closedPromiseState="pending"})}function S1(c,g){hl(c),Ed(c,g)}function GA(c){hl(c),E1(c)}function Ed(c,g){c._closedPromise_reject!==void 0&&(T(c._closedPromise),c._closedPromise_reject(g),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0,c._closedPromiseState="rejected")}function WA(c,g){S1(c,g)}function E1(c){c._closedPromise_resolve!==void 0&&(c._closedPromise_resolve(void 0),c._closedPromise_resolve=void 0,c._closedPromise_reject=void 0,c._closedPromiseState="resolved")}function ml(c){c._readyPromise=h(function(g,E){c._readyPromise_resolve=g,c._readyPromise_reject=E}),c._readyPromiseState="pending"}function jd(c,g){ml(c),A1(c,g)}function j1(c){ml(c),Ad(c)}function A1(c,g){c._readyPromise_reject!==void 0&&(T(c._readyPromise),c._readyPromise_reject(g),c._readyPromise_resolve=void 0,c._readyPromise_reject=void 0,c._readyPromiseState="rejected")}function VA(c){ml(c)}function $A(c,g){jd(c,g)}function Ad(c){c._readyPromise_resolve!==void 0&&(c._readyPromise_resolve(void 0),c._readyPromise_resolve=void 0,c._readyPromise_reject=void 0,c._readyPromiseState="fulfilled")}var T1=typeof DOMException<"u"?DOMException:void 0;function KA(c){if(!(typeof c=="function"||typeof c=="object"))return!1;try{return new c,!0}catch{return!1}}function YA(){var c=function(E,L){this.message=E||"",this.name=L||"Error",Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return c.prototype=Object.create(Error.prototype),Object.defineProperty(c.prototype,"constructor",{value:c,writable:!0,configurable:!0}),c}var XA=KA(T1)?T1:YA();function P1(c,g,E,L,Y,se){var xe=Kr(c),Je=ie(g);c._disturbed=!0;var Ar=!1,Br=d(void 0);return h(function(Mr,$r){var Lt;if(se!==void 0){if(Lt=function(){var wr=new XA("Aborted","AbortError"),Yr=[];L||Yr.push(function(){return g._state==="writable"?ct(g,wr):d(void 0)}),Y||Yr.push(function(){return c._state==="readable"?wi(c,wr):d(void 0)}),Wa(function(){return Promise.all(Yr.map(function(bt){return bt()}))},!0,wr)},se.aborted){Lt();return}se.addEventListener("abort",Lt)}function _i(){return h(function(wr,Yr){function bt($i){$i?wr():y(ms(),bt,Yr)}bt(!1)})}function ms(){return Ar?d(!0):y(Je._readyPromise,function(){return h(function(wr,Yr){or(xe,{_chunkSteps:function(bt){Br=y(y1(Je,bt),void 0,t),wr(!1)},_closeSteps:function(){return wr(!0)},_errorSteps:Yr})})})}if(fa(c,xe._closedPromise,function(wr){L?wn(!0,wr):Wa(function(){return ct(g,wr)},!0,wr)}),fa(g,Je._closedPromise,function(wr){Y?wn(!0,wr):Wa(function(){return wi(c,wr)},!0,wr)}),Vi(c,xe._closedPromise,function(){E?wn():Wa(function(){return FA(Je)})}),xi(g)||g._state==="closed"){var Yn=new TypeError("the destination writable stream closed before all data could be piped to it");Y?wn(!0,Yn):Wa(function(){return wi(c,Yn)},!0,Yn)}T(_i());function Wi(){var wr=Br;return y(Br,function(){return wr!==Br?Wi():void 0})}function fa(wr,Yr,bt){wr._state==="errored"?bt(wr._storedError):A(Yr,bt)}function Vi(wr,Yr,bt){wr._state==="closed"?bt():x(Yr,bt)}function Wa(wr,Yr,bt){if(Ar)return;Ar=!0,g._state==="writable"&&!xi(g)?x(Wi(),$i):$i();function $i(){k(wr(),function(){return vt(Yr,bt)},function(Xn){return vt(!0,Xn)})}}function wn(wr,Yr){Ar||(Ar=!0,g._state==="writable"&&!xi(g)?x(Wi(),function(){return vt(wr,Yr)}):vt(wr,Yr))}function vt(wr,Yr){b1(Je),V(xe),se!==void 0&&se.removeEventListener("abort",Lt),wr?$r(Yr):Mr(void 0)}})}var Oo=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!gl(this))throw yl("desiredSize");return Td(this)},enumerable:!1,configurable:!0}),c.prototype.close=function(){if(!gl(this))throw yl("close");if(!ds(this))throw new TypeError("The stream is not in a state that permits close");wu(this)},c.prototype.enqueue=function(g){if(g===void 0&&(g=void 0),!gl(this))throw yl("enqueue");if(!ds(this))throw new TypeError("The stream is not in a state that permits enqueue");return bl(this,g)},c.prototype.error=function(g){if(g===void 0&&(g=void 0),!gl(this))throw yl("error");Vn(this,g)},c.prototype[Me]=function(g){ut(this);var E=this._cancelAlgorithm(g);return vl(this),E},c.prototype[ze]=function(g){var E=this._controlledReadableStream;if(this._queue.length>0){var L=sa(this);this._closeRequested&&this._queue.length===0?(vl(this),_u(E)):xu(this),g._chunkSteps(L)}else ee(E,g),xu(this)},c}();Object.defineProperties(Oo.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Oo.prototype,r.toStringTag,{value:"ReadableStreamDefaultController",configurable:!0});function gl(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledReadableStream")?!1:c instanceof Oo}function xu(c){var g=R1(c);if(g){if(c._pulling){c._pullAgain=!0;return}c._pulling=!0;var E=c._pullAlgorithm();k(E,function(){c._pulling=!1,c._pullAgain&&(c._pullAgain=!1,xu(c))},function(L){Vn(c,L)})}}function R1(c){var g=c._controlledReadableStream;if(!ds(c)||!c._started)return!1;if(Kn(g)&&Ke(g)>0)return!0;var E=Td(c);return E>0}function vl(c){c._pullAlgorithm=void 0,c._cancelAlgorithm=void 0,c._strategySizeAlgorithm=void 0}function wu(c){if(ds(c)){var g=c._controlledReadableStream;c._closeRequested=!0,c._queue.length===0&&(vl(c),_u(g))}}function bl(c,g){if(ds(c)){var E=c._controlledReadableStream;if(Kn(E)&&Ke(E)>0)Fe(E,g,!1);else{var L=void 0;try{L=c._strategySizeAlgorithm(g)}catch(Y){throw Vn(c,Y),Y}try{va(c,g,L)}catch(Y){throw Vn(c,Y),Y}}xu(c)}}function Vn(c,g){var E=c._controlledReadableStream;E._state==="readable"&&(ut(c),vl(c),B1(E,g))}function Td(c){var g=c._controlledReadableStream._state;return g==="errored"?null:g==="closed"?0:c._strategyHWM-c._queueTotalSize}function QA(c){return!R1(c)}function ds(c){var g=c._controlledReadableStream._state;return!c._closeRequested&&g==="readable"}function C1(c,g,E,L,Y,se,xe){g._controlledReadableStream=c,g._queue=void 0,g._queueTotalSize=void 0,ut(g),g._started=!1,g._closeRequested=!1,g._pullAgain=!1,g._pulling=!1,g._strategySizeAlgorithm=xe,g._strategyHWM=se,g._pullAlgorithm=L,g._cancelAlgorithm=Y,c._readableStreamController=g;var Je=E();k(d(Je),function(){g._started=!0,xu(g)},function(Ar){Vn(g,Ar)})}function ZA(c,g,E,L){var Y=Object.create(Oo.prototype),se=function(){},xe=function(){return d(void 0)},Je=function(){return d(void 0)};g.start!==void 0&&(se=function(){return g.start(Y)}),g.pull!==void 0&&(xe=function(){return g.pull(Y)}),g.cancel!==void 0&&(Je=function(Ar){return g.cancel(Ar)}),C1(c,Y,se,xe,Je,E,L)}function yl(c){return new TypeError("ReadableStreamDefaultController.prototype."+c+" can only be used on a ReadableStreamDefaultController")}function JA(c,g){return gt(c._readableStreamController)?rT(c):eT(c)}function eT(c,g){var E=Kr(c),L=!1,Y=!1,se=!1,xe=!1,Je,Ar,Br,Mr,$r,Lt=h(function(fa){$r=fa});function _i(){if(L)return Y=!0,d(void 0);L=!0;var fa={_chunkSteps:function(Vi){B(function(){Y=!1;var Wa=Vi,wn=Vi;se||bl(Br._readableStreamController,Wa),xe||bl(Mr._readableStreamController,wn),L=!1,Y&&_i()})},_closeSteps:function(){L=!1,se||wu(Br._readableStreamController),xe||wu(Mr._readableStreamController),(!se||!xe)&&$r(void 0)},_errorSteps:function(){L=!1}};return or(E,fa),d(void 0)}function ms(fa){if(se=!0,Je=fa,xe){var Vi=_r([Je,Ar]),Wa=wi(c,Vi);$r(Wa)}return Lt}function Yn(fa){if(xe=!0,Ar=fa,se){var Vi=_r([Je,Ar]),Wa=wi(c,Vi);$r(Wa)}return Lt}function Wi(){}return Br=Pd(Wi,_i,ms),Mr=Pd(Wi,_i,Yn),A(E._closedPromise,function(fa){Vn(Br._readableStreamController,fa),Vn(Mr._readableStreamController,fa),(!se||!xe)&&$r(void 0)}),[Br,Mr]}function rT(c){var g=Kr(c),E=!1,L=!1,Y=!1,se=!1,xe=!1,Je,Ar,Br,Mr,$r,Lt=h(function(vt){$r=vt});function _i(vt){A(vt._closedPromise,function(wr){vt===g&&(Ce(Br._readableStreamController,wr),Ce(Mr._readableStreamController,wr),(!se||!xe)&&$r(void 0))})}function ms(){We(g)&&(V(g),g=Kr(c),_i(g));var vt={_chunkSteps:function(wr){B(function(){L=!1,Y=!1;var Yr=wr,bt=wr;if(!se&&!xe)try{bt=Ft(wr)}catch($i){Ce(Br._readableStreamController,$i),Ce(Mr._readableStreamController,$i),$r(wi(c,$i));return}se||je(Br._readableStreamController,Yr),xe||je(Mr._readableStreamController,bt),E=!1,L?Wi():Y&&fa()})},_closeSteps:function(){E=!1,se||De(Br._readableStreamController),xe||De(Mr._readableStreamController),Br._readableStreamController._pendingPullIntos.length>0&&Ze(Br._readableStreamController,0),Mr._readableStreamController._pendingPullIntos.length>0&&Ze(Mr._readableStreamController,0),(!se||!xe)&&$r(void 0)},_errorSteps:function(){E=!1}};or(g,vt)}function Yn(vt,wr){er(g)&&(V(g),g=J(c),_i(g));var Yr=wr?Mr:Br,bt=wr?Br:Mr,$i={_chunkSteps:function(Xn){B(function(){L=!1,Y=!1;var gs=wr?xe:se,ju=wr?se:xe;if(ju)gs||Re(Yr._readableStreamController,Xn);else{var $1=void 0;try{$1=Ft(Xn)}catch(Id){Ce(Yr._readableStreamController,Id),Ce(bt._readableStreamController,Id),$r(wi(c,Id));return}gs||Re(Yr._readableStreamController,Xn),je(bt._readableStreamController,$1)}E=!1,L?Wi():Y&&fa()})},_closeSteps:function(Xn){E=!1;var gs=wr?xe:se,ju=wr?se:xe;gs||De(Yr._readableStreamController),ju||De(bt._readableStreamController),Xn!==void 0&&(gs||Re(Yr._readableStreamController,Xn),!ju&&bt._readableStreamController._pendingPullIntos.length>0&&Ze(bt._readableStreamController,0)),(!gs||!ju)&&$r(void 0)},_errorSteps:function(){E=!1}};fr(g,vt,$i)}function Wi(){if(E)return L=!0,d(void 0);E=!0;var vt=Oe(Br._readableStreamController);return vt===null?ms():Yn(vt._view,!1),d(void 0)}function fa(){if(E)return Y=!0,d(void 0);E=!0;var vt=Oe(Mr._readableStreamController);return vt===null?ms():Yn(vt._view,!0),d(void 0)}function Vi(vt){if(se=!0,Je=vt,xe){var wr=_r([Je,Ar]),Yr=wi(c,wr);$r(Yr)}return Lt}function Wa(vt){if(xe=!0,Ar=vt,se){var wr=_r([Je,Ar]),Yr=wi(c,wr);$r(Yr)}return Lt}function wn(){}return Br=I1(wn,Wi,Vi),Mr=I1(wn,fa,Wa),_i(g),[Br,Mr]}function tT(c,g){Qe(c,g);var E=c,L=E==null?void 0:E.autoAllocateChunkSize,Y=E==null?void 0:E.cancel,se=E==null?void 0:E.pull,xe=E==null?void 0:E.start,Je=E==null?void 0:E.type;return{autoAllocateChunkSize:L===void 0?void 0:cr(L,g+" has member 'autoAllocateChunkSize' that"),cancel:Y===void 0?void 0:aT(Y,E,g+" has member 'cancel' that"),pull:se===void 0?void 0:iT(se,E,g+" has member 'pull' that"),start:xe===void 0?void 0:nT(xe,E,g+" has member 'start' that"),type:Je===void 0?void 0:oT(Je,g+" has member 'type' that")}}function aT(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function iT(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function nT(c,g,E){return $e(c,E),function(L){return C(c,g,[L])}}function oT(c,g){if(c=""+c,c!=="bytes")throw new TypeError(g+" '"+c+"' is not a valid enumeration value for ReadableStreamType");return c}function sT(c,g){Qe(c,g);var E=c==null?void 0:c.mode;return{mode:E===void 0?void 0:uT(E,g+" has member 'mode' that")}}function uT(c,g){if(c=""+c,c!=="byob")throw new TypeError(g+" '"+c+"' is not a valid enumeration value for ReadableStreamReaderMode");return c}function cT(c,g){Qe(c,g);var E=c==null?void 0:c.preventCancel;return{preventCancel:Boolean(E)}}function O1(c,g){Qe(c,g);var E=c==null?void 0:c.preventAbort,L=c==null?void 0:c.preventCancel,Y=c==null?void 0:c.preventClose,se=c==null?void 0:c.signal;return se!==void 0&&lT(se,g+" has member 'signal' that"),{preventAbort:Boolean(E),preventCancel:Boolean(L),preventClose:Boolean(Y),signal:se}}function lT(c,g){if(!S(c))throw new TypeError(g+" is not an AbortSignal.")}function fT(c,g){Qe(c,g);var E=c==null?void 0:c.readable;de(E,"readable","ReadableWritablePair"),qr(E,g+" has member 'readable' that");var L=c==null?void 0:c.writable;return de(L,"writable","ReadableWritablePair"),Rr(L,g+" has member 'writable' that"),{readable:E,writable:L}}var xn=function(){function c(g,E){g===void 0&&(g={}),E===void 0&&(E={}),g===void 0?g=null:tr(g,"First parameter");var L=xr(E,"Second parameter"),Y=tT(g,"First parameter");if(Rd(this),Y.type==="bytes"){if(L.size!==void 0)throw new RangeError("The strategy for a byte stream cannot have a size function");var se=ur(L,0);Te(this,Y,se)}else{var xe=M(L),se=ur(L,1);ZA(this,Y,se,xe)}}return Object.defineProperty(c.prototype,"locked",{get:function(){if(!$n(this))throw Io("locked");return Kn(this)},enumerable:!1,configurable:!0}),c.prototype.cancel=function(g){return g===void 0&&(g=void 0),$n(this)?Kn(this)?m(new TypeError("Cannot cancel a stream that already has a reader")):wi(this,g):m(Io("cancel"))},c.prototype.getReader=function(g){if(g===void 0&&(g=void 0),!$n(this))throw Io("getReader");var E=sT(g,"First parameter");return E.mode===void 0?Kr(this):J(this)},c.prototype.pipeThrough=function(g,E){if(E===void 0&&(E={}),!$n(this))throw Io("pipeThrough");Be(g,1,"pipeThrough");var L=fT(g,"First parameter"),Y=O1(E,"Second parameter");if(Kn(this))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream");if(Or(L.writable))throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream");var se=P1(this,L.writable,Y.preventClose,Y.preventAbort,Y.preventCancel,Y.signal);return T(se),L.readable},c.prototype.pipeTo=function(g,E){if(E===void 0&&(E={}),!$n(this))return m(Io("pipeTo"));if(g===void 0)return m("Parameter 1 is required in 'pipeTo'.");if(!Le(g))return m(new TypeError("ReadableStream.prototype.pipeTo's first argument must be a WritableStream"));var L;try{L=O1(E,"Second parameter")}catch(Y){return m(Y)}return Kn(this)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream")):Or(g)?m(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream")):P1(this,g,L.preventClose,L.preventAbort,L.preventCancel,L.signal)},c.prototype.tee=function(){if(!$n(this))throw Io("tee");var g=JA(this);return _r(g)},c.prototype.values=function(g){if(g===void 0&&(g=void 0),!$n(this))throw Io("values");var E=cT(g,"First parameter");return pr(this,E.preventCancel)},c}();Object.defineProperties(xn.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(xn.prototype,r.toStringTag,{value:"ReadableStream",configurable:!0}),typeof r.asyncIterator=="symbol"&&Object.defineProperty(xn.prototype,r.asyncIterator,{value:xn.prototype.values,writable:!0,configurable:!0});function Pd(c,g,E,L,Y){L===void 0&&(L=1),Y===void 0&&(Y=function(){return 1});var se=Object.create(xn.prototype);Rd(se);var xe=Object.create(Oo.prototype);return C1(se,xe,c,g,E,L,Y),se}function I1(c,g,E){var L=Object.create(xn.prototype);Rd(L);var Y=Object.create(Dt.prototype);return Ae(L,Y,c,g,E,0,void 0),L}function Rd(c){c._state="readable",c._reader=void 0,c._storedError=void 0,c._disturbed=!1}function $n(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_readableStreamController")?!1:c instanceof xn}function Kn(c){return c._reader!==void 0}function wi(c,g){if(c._disturbed=!0,c._state==="closed")return d(void 0);if(c._state==="errored")return m(c._storedError);_u(c);var E=c._reader;E!==void 0&&We(E)&&(E._readIntoRequests.forEach(function(Y){Y._closeSteps(void 0)}),E._readIntoRequests=new H);var L=c._readableStreamController[Me](g);return P(L,t)}function _u(c){c._state="closed";var g=c._reader;g!==void 0&&(fe(g),er(g)&&(g._readRequests.forEach(function(E){E._closeSteps()}),g._readRequests=new H))}function B1(c,g){c._state="errored",c._storedError=g;var E=c._reader;E!==void 0&&(le(E,g),er(E)?(E._readRequests.forEach(function(L){L._errorSteps(g)}),E._readRequests=new H):(E._readIntoRequests.forEach(function(L){L._errorSteps(g)}),E._readIntoRequests=new H))}function Io(c){return new TypeError("ReadableStream.prototype."+c+" can only be used on a ReadableStream")}function F1(c,g){Qe(c,g);var E=c==null?void 0:c.highWaterMark;return de(E,"highWaterMark","QueuingStrategyInit"),{highWaterMark:Se(E)}}var D1=function(c){return c.byteLength};try{Object.defineProperty(D1,"name",{value:"size",configurable:!0})}catch{}var ku=function(){function c(g){Be(g,1,"ByteLengthQueuingStrategy"),g=F1(g,"First parameter"),this._byteLengthQueuingStrategyHighWaterMark=g.highWaterMark}return Object.defineProperty(c.prototype,"highWaterMark",{get:function(){if(!q1(this))throw L1("highWaterMark");return this._byteLengthQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"size",{get:function(){if(!q1(this))throw L1("size");return D1},enumerable:!1,configurable:!0}),c}();Object.defineProperties(ku.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(ku.prototype,r.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:!0});function L1(c){return new TypeError("ByteLengthQueuingStrategy.prototype."+c+" can only be used on a ByteLengthQueuingStrategy")}function q1(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_byteLengthQueuingStrategyHighWaterMark")?!1:c instanceof ku}var M1=function(){return 1};try{Object.defineProperty(M1,"name",{value:"size",configurable:!0})}catch{}var Su=function(){function c(g){Be(g,1,"CountQueuingStrategy"),g=F1(g,"First parameter"),this._countQueuingStrategyHighWaterMark=g.highWaterMark}return Object.defineProperty(c.prototype,"highWaterMark",{get:function(){if(!N1(this))throw z1("highWaterMark");return this._countQueuingStrategyHighWaterMark},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"size",{get:function(){if(!N1(this))throw z1("size");return M1},enumerable:!1,configurable:!0}),c}();Object.defineProperties(Su.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Su.prototype,r.toStringTag,{value:"CountQueuingStrategy",configurable:!0});function z1(c){return new TypeError("CountQueuingStrategy.prototype."+c+" can only be used on a CountQueuingStrategy")}function N1(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_countQueuingStrategyHighWaterMark")?!1:c instanceof Su}function pT(c,g){Qe(c,g);var E=c==null?void 0:c.flush,L=c==null?void 0:c.readableType,Y=c==null?void 0:c.start,se=c==null?void 0:c.transform,xe=c==null?void 0:c.writableType;return{flush:E===void 0?void 0:dT(E,c,g+" has member 'flush' that"),readableType:L,start:Y===void 0?void 0:hT(Y,c,g+" has member 'start' that"),transform:se===void 0?void 0:mT(se,c,g+" has member 'transform' that"),writableType:xe}}function dT(c,g,E){return $e(c,E),function(L){return I(c,g,[L])}}function hT(c,g,E){return $e(c,E),function(L){return C(c,g,[L])}}function mT(c,g,E){return $e(c,E),function(L,Y){return I(c,g,[L,Y])}}var Eu=function(){function c(g,E,L){g===void 0&&(g={}),E===void 0&&(E={}),L===void 0&&(L={}),g===void 0&&(g=null);var Y=xr(E,"Second parameter"),se=xr(L,"Third parameter"),xe=pT(g,"First parameter");if(xe.readableType!==void 0)throw new RangeError("Invalid readableType specified");if(xe.writableType!==void 0)throw new RangeError("Invalid writableType specified");var Je=ur(se,0),Ar=M(se),Br=ur(Y,1),Mr=M(Y),$r,Lt=h(function(_i){$r=_i});gT(this,Lt,Br,Mr,Je,Ar),bT(this,xe),xe.start!==void 0?$r(xe.start(this._transformStreamController)):$r(void 0)}return Object.defineProperty(c.prototype,"readable",{get:function(){if(!U1(this))throw V1("readable");return this._readable},enumerable:!1,configurable:!0}),Object.defineProperty(c.prototype,"writable",{get:function(){if(!U1(this))throw V1("writable");return this._writable},enumerable:!1,configurable:!0}),c}();Object.defineProperties(Eu.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(Eu.prototype,r.toStringTag,{value:"TransformStream",configurable:!0});function gT(c,g,E,L,Y,se){function xe(){return g}function Je(Lt){return wT(c,Lt)}function Ar(Lt){return _T(c,Lt)}function Br(){return kT(c)}c._writable=ue(xe,Je,Br,Ar,E,L);function Mr(){return ST(c)}function $r(Lt){return wl(c,Lt),d(void 0)}c._readable=Pd(xe,Mr,$r,Y,se),c._backpressure=void 0,c._backpressureChangePromise=void 0,c._backpressureChangePromise_resolve=void 0,_l(c,!0),c._transformStreamController=void 0}function U1(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_transformStreamController")?!1:c instanceof Eu}function xl(c,g){Vn(c._readable._readableStreamController,g),wl(c,g)}function wl(c,g){H1(c._transformStreamController),_d(c._writable._writableStreamController,g),c._backpressure&&_l(c,!1)}function _l(c,g){c._backpressureChangePromise!==void 0&&c._backpressureChangePromise_resolve(),c._backpressureChangePromise=h(function(E){c._backpressureChangePromise_resolve=E}),c._backpressure=g}var hs=function(){function c(){throw new TypeError("Illegal constructor")}return Object.defineProperty(c.prototype,"desiredSize",{get:function(){if(!kl(this))throw Sl("desiredSize");var g=this._controlledTransformStream._readable._readableStreamController;return Td(g)},enumerable:!1,configurable:!0}),c.prototype.enqueue=function(g){if(g===void 0&&(g=void 0),!kl(this))throw Sl("enqueue");G1(this,g)},c.prototype.error=function(g){if(g===void 0&&(g=void 0),!kl(this))throw Sl("error");yT(this,g)},c.prototype.terminate=function(){if(!kl(this))throw Sl("terminate");xT(this)},c}();Object.defineProperties(hs.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),typeof r.toStringTag=="symbol"&&Object.defineProperty(hs.prototype,r.toStringTag,{value:"TransformStreamDefaultController",configurable:!0});function kl(c){return!n(c)||!Object.prototype.hasOwnProperty.call(c,"_controlledTransformStream")?!1:c instanceof hs}function vT(c,g,E,L){g._controlledTransformStream=c,c._transformStreamController=g,g._transformAlgorithm=E,g._flushAlgorithm=L}function bT(c,g){var E=Object.create(hs.prototype),L=function(se){try{return G1(E,se),d(void 0)}catch(xe){return m(xe)}},Y=function(){return d(void 0)};g.transform!==void 0&&(L=function(se){return g.transform(se,E)}),g.flush!==void 0&&(Y=function(){return g.flush(E)}),vT(c,E,L,Y)}function H1(c){c._transformAlgorithm=void 0,c._flushAlgorithm=void 0}function G1(c,g){var E=c._controlledTransformStream,L=E._readable._readableStreamController;if(!ds(L))throw new TypeError("Readable side is not in a state that permits enqueue");try{bl(L,g)}catch(se){throw wl(E,se),E._readable._storedError}var Y=QA(L);Y!==E._backpressure&&_l(E,!0)}function yT(c,g){xl(c._controlledTransformStream,g)}function W1(c,g){var E=c._transformAlgorithm(g);return P(E,void 0,function(L){throw xl(c._controlledTransformStream,L),L})}function xT(c){var g=c._controlledTransformStream,E=g._readable._readableStreamController;wu(E);var L=new TypeError("TransformStream terminated");wl(g,L)}function wT(c,g){var E=c._transformStreamController;if(c._backpressure){var L=c._backpressureChangePromise;return P(L,function(){var Y=c._writable,se=Y._state;if(se==="erroring")throw Y._storedError;return W1(E,g)})}return W1(E,g)}function _T(c,g){return xl(c,g),d(void 0)}function kT(c){var g=c._readable,E=c._transformStreamController,L=E._flushAlgorithm();return H1(E),P(L,function(){if(g._state==="errored")throw g._storedError;wu(g._readableStreamController)},function(Y){throw xl(c,Y),g._storedError})}function ST(c){return _l(c,!1),c._backpressureChangePromise}function Sl(c){return new TypeError("TransformStreamDefaultController.prototype."+c+" can only be used on a TransformStreamDefaultController")}function V1(c){return new TypeError("TransformStream.prototype."+c+" can only be used on a TransformStream")}var Cd={ReadableStream:xn,ReadableStreamDefaultController:Oo,ReadableByteStreamController:Dt,ReadableStreamBYOBRequest:mt,ReadableStreamDefaultReader:Xe,ReadableStreamBYOBReader:ne,WritableStream:G,WritableStreamDefaultController:Ro,WritableStreamDefaultWriter:ps,ByteLengthQueuingStrategy:ku,CountQueuingStrategy:Su,TransformStream:Eu,TransformStreamDefaultController:hs};if(typeof a<"u")for(var Od in Cd)Object.prototype.hasOwnProperty.call(Cd,Od)&&Object.defineProperty(a,Od,{value:Cd[Od],writable:!0,configurable:!0});e.ByteLengthQueuingStrategy=ku,e.CountQueuingStrategy=Su,e.ReadableByteStreamController=Dt,e.ReadableStream=xn,e.ReadableStreamBYOBReader=ne,e.ReadableStreamBYOBRequest=mt,e.ReadableStreamDefaultController=Oo,e.ReadableStreamDefaultReader=Xe,e.TransformStream=Eu,e.TransformStreamDefaultController=hs,e.WritableStream=G,e.WritableStreamDefaultController=Ro,e.WritableStreamDefaultWriter=ps,Object.defineProperty(e,"__esModule",{value:!0})})});var uA=D(dd=>{var l1,hd,f1,md,Jj,p1,eA,rA,tA=new Uint8Array([0]),ga=[171,75,84,88,32,50,48,187,13,10,26,10];(function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"})(l1||(l1={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(hd||(hd={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(f1||(f1={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(md||(md={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Jj||(Jj={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(p1||(p1={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(eA||(eA={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(rA||(rA={}));var aA=function(){this.vkFormat=0,this.typeSize=1,this.pixelWidth=0,this.pixelHeight=0,this.pixelDepth=0,this.layerCount=0,this.faceCount=1,this.supercompressionScheme=l1.NONE,this.levels=[],this.dataFormatDescriptor=[{vendorId:0,descriptorType:hd.BASICFORMAT,versionNumber:2,descriptorBlockSize:40,colorModel:f1.UNSPECIFIED,colorPrimaries:md.SRGB,transferFunction:md.SRGB,flags:p1.ALPHA_STRAIGHT,texelBlockDimension:{x:4,y:4,z:1,w:1},bytesPlane:[],samples:[]}],this.keyValue={},this.globalData=null},nl=function(){function e(t,i,a,n){this._dataView=new DataView(t.buffer,t.byteOffset+i,a),this._littleEndian=n,this._offset=0}var r=e.prototype;return r._nextUint8=function(){var t=this._dataView.getUint8(this._offset);return this._offset+=1,t},r._nextUint16=function(){var t=this._dataView.getUint16(this._offset,this._littleEndian);return this._offset+=2,t},r._nextUint32=function(){var t=this._dataView.getUint32(this._offset,this._littleEndian);return this._offset+=4,t},r._nextUint64=function(){var t=this._dataView.getUint32(this._offset,this._littleEndian),i=this._dataView.getUint32(this._offset+4,this._littleEndian),a=t+Math.pow(2,32)*i;return this._offset+=8,a},r._skip=function(t){return this._offset+=t,this},r._scan=function(t,i){i===void 0&&(i=0);for(var a=this._offset,n=0;this._dataView.getUint8(this._offset)!==i&&n<t;)n++,this._offset++;return n<t&&this._offset++,new Uint8Array(this._dataView.buffer,this._dataView.byteOffset+a,n)},e}();function d1(){return(d1=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e}).apply(this,arguments)}function iA(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,i=new Array(r);t<r;t++)i[t]=e[t];return i}function nA(e,r){var t;if(typeof Symbol>"u"||e[Symbol.iterator]==null){if(Array.isArray(e)||(t=function(a,n){if(a){if(typeof a=="string")return iA(a,void 0);var o=Object.prototype.toString.call(a).slice(8,-1);return o==="Object"&&a.constructor&&(o=a.constructor.name),o==="Map"||o==="Set"?Array.from(a):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?iA(a,void 0):void 0}}(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
95
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(t=e[Symbol.iterator]()).next.bind(t)}function oA(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}function sA(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}function pd(e){for(var r,t=0,i=nA(e);!(r=i()).done;)t+=r.value.byteLength;for(var a,n=new Uint8Array(t),o=0,s=nA(e);!(a=s()).done;){var u=a.value;n.set(new Uint8Array(u),o),o+=u.byteLength}return n}var PV={keepWriter:!1};dd.KTX2Container=aA,dd.read=function(e){var r=new Uint8Array(e.buffer,e.byteOffset,ga.length);if(r[0]!==ga[0]||r[1]!==ga[1]||r[2]!==ga[2]||r[3]!==ga[3]||r[4]!==ga[4]||r[5]!==ga[5]||r[6]!==ga[6]||r[7]!==ga[7]||r[8]!==ga[8]||r[9]!==ga[9]||r[10]!==ga[10]||r[11]!==ga[11])throw new Error("Missing KTX 2.0 identifier.");var t=new aA,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new nl(e,ga.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();var n=a._nextUint32();t.supercompressionScheme=a._nextUint32();for(var o=a._nextUint32(),s=a._nextUint32(),u=a._nextUint32(),l=a._nextUint32(),f=a._nextUint64(),h=a._nextUint64(),d=new nl(e,ga.length+i,3*n*8,!0),m=0;m<n;m++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});for(var y=new nl(e,o,s,!0),k={vendorId:y._skip(4)._nextUint16(),descriptorType:y._nextUint16(),versionNumber:y._nextUint16(),descriptorBlockSize:y._nextUint16(),colorModel:y._nextUint8(),colorPrimaries:y._nextUint8(),transferFunction:y._nextUint8(),flags:y._nextUint8(),texelBlockDimension:{x:y._nextUint8()+1,y:y._nextUint8()+1,z:y._nextUint8()+1,w:y._nextUint8()+1},bytesPlane:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],samples:[]},x=(k.descriptorBlockSize/4-6)/4,A=0;A<x;A++)k.samples[A]={bitOffset:y._nextUint16(),bitLength:y._nextUint8(),channelID:y._nextUint8(),samplePosition:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],sampleLower:y._nextUint32(),sampleUpper:y._nextUint32()};t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(k);for(var P=new nl(e,u,l,!0);P._offset<l;){var T=P._nextUint32(),B=P._scan(T),C=sA(B),I=P._scan(T-B.byteLength);t.keyValue[C]=C.match(/^ktx/i)?sA(I):I,T%4&&P._skip(4-T%4)}if(h<=0)return t;for(var F=new nl(e,f,h,!0),H=F._nextUint16(),N=F._nextUint16(),K=F._nextUint32(),V=F._nextUint32(),X=F._nextUint32(),U=F._nextUint32(),$=[],Z=0;Z<n;Z++)$.push({imageFlags:F._nextUint32(),rgbSliceByteOffset:F._nextUint32(),rgbSliceByteLength:F._nextUint32(),alphaSliceByteOffset:F._nextUint32(),alphaSliceByteLength:F._nextUint32()});var le=f+F._offset,ve=le+K,fe=ve+V,we=fe+X,ye=new Uint8Array(e.buffer,e.byteOffset+le,K),Me=new Uint8Array(e.buffer,e.byteOffset+ve,V),ze=new Uint8Array(e.buffer,e.byteOffset+fe,X),Ie=new Uint8Array(e.buffer,e.byteOffset+we,U);return t.globalData={endpointCount:H,selectorCount:N,imageDescs:$,endpointsData:ye,selectorsData:Me,tablesData:ze,extendedData:Ie},t},dd.write=function(e,r){r===void 0&&(r={}),r=d1({},PV,r);var t=new ArrayBuffer(0);if(e.globalData){var i=new ArrayBuffer(20+5*e.globalData.imageDescs.length*4),a=new DataView(i);a.setUint16(0,e.globalData.endpointCount,!0),a.setUint16(2,e.globalData.selectorCount,!0),a.setUint32(4,e.globalData.endpointsData.byteLength,!0),a.setUint32(8,e.globalData.selectorsData.byteLength,!0),a.setUint32(12,e.globalData.tablesData.byteLength,!0),a.setUint32(16,e.globalData.extendedData.byteLength,!0);for(var n=0;n<e.globalData.imageDescs.length;n++){var o=e.globalData.imageDescs[n];a.setUint32(20+5*n*4+0,o.imageFlags,!0),a.setUint32(20+5*n*4+4,o.rgbSliceByteOffset,!0),a.setUint32(20+5*n*4+8,o.rgbSliceByteLength,!0),a.setUint32(20+5*n*4+12,o.alphaSliceByteOffset,!0),a.setUint32(20+5*n*4+16,o.alphaSliceByteLength,!0)}t=pd([i,e.globalData.endpointsData,e.globalData.selectorsData,e.globalData.tablesData,e.globalData.extendedData])}var s=[],u=e.keyValue;for(var l in r.keepWriter||(u=d1({},e.keyValue,{KTXwriter:"KTX-Parse v0.0.4"})),u){var f=u[l],h=oA(l),d=typeof f=="string"?oA(f):f,m=h.byteLength+1+d.byteLength+1,y=m%4?4-m%4:0;s.push(pd([new Uint32Array([m]),h,tA,d,tA,new Uint8Array(y).fill(0)]))}var k=pd(s),x=new ArrayBuffer(44),A=new DataView(x);if(e.dataFormatDescriptor.length!==1||e.dataFormatDescriptor[0].descriptorType!==hd.BASICFORMAT)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");var P=e.dataFormatDescriptor[0];A.setUint32(0,44,!0),A.setUint16(4,P.vendorId,!0),A.setUint16(6,P.descriptorType,!0),A.setUint16(8,P.versionNumber,!0),A.setUint16(10,P.descriptorBlockSize,!0),A.setUint8(12,P.colorModel),A.setUint8(13,P.colorPrimaries),A.setUint8(14,P.transferFunction),A.setUint8(15,P.flags),A.setUint8(16,P.texelBlockDimension.x-1),A.setUint8(17,P.texelBlockDimension.y-1),A.setUint8(18,P.texelBlockDimension.z-1),A.setUint8(19,P.texelBlockDimension.w-1);for(var T=0;T<8;T++)A.setUint8(20+T,P.bytesPlane[T]);for(var B=0;B<P.samples.length;B++){var C=P.samples[B],I=28+16*B;A.setUint16(I+0,C.bitOffset,!0),A.setUint8(I+2,C.bitLength),A.setUint8(I+3,C.channelID),A.setUint8(I+4,C.samplePosition[0]),A.setUint8(I+5,C.samplePosition[1]),A.setUint8(I+6,C.samplePosition[2]),A.setUint8(I+7,C.samplePosition[3]),A.setUint32(I+8,C.sampleLower,!0),A.setUint32(I+12,C.sampleUpper,!0)}var F=ga.length+68+3*e.levels.length*8,H=F+x.byteLength,N=H+k.byteLength;N%8&&(N+=8-N%8);for(var K=[],V=new DataView(new ArrayBuffer(3*e.levels.length*8)),X=N+t.byteLength,U=0;U<e.levels.length;U++){var $=e.levels[U];K.push($.levelData),V.setBigUint64(24*U+0,BigInt(X),!0),V.setBigUint64(24*U+8,BigInt($.levelData.byteLength),!0),V.setBigUint64(24*U+16,BigInt($.uncompressedByteLength),!0),X+=$.levelData.byteLength}var Z=new ArrayBuffer(68),le=new DataView(Z);return le.setUint32(0,e.vkFormat,!0),le.setUint32(4,e.typeSize,!0),le.setUint32(8,e.pixelWidth,!0),le.setUint32(12,e.pixelHeight,!0),le.setUint32(16,e.pixelDepth,!0),le.setUint32(20,e.layerCount,!0),le.setUint32(24,e.faceCount,!0),le.setUint32(28,e.levels.length,!0),le.setUint32(32,e.supercompressionScheme,!0),le.setUint32(36,F,!0),le.setUint32(40,x.byteLength,!0),le.setUint32(44,H,!0),le.setUint32(48,k.byteLength,!0),le.setBigUint64(52,BigInt(N),!0),le.setBigUint64(60,BigInt(t.byteLength),!0),new Uint8Array(pd([new Uint8Array(ga).buffer,Z,V.buffer,x,k,new ArrayBuffer(N-(H+k.byteLength)),t].concat(K)))}});var K1=typeof process!="object"||String(process)!=="[object process]"||process.browser;var Y1={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=Y1||{};function Er(e,r,t){return r<=e&&e<=t}function RT(e,r){return e.indexOf(r)!==-1}var _n=Math.floor;function jl(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function CT(e){for(var r=String(e),t=r.length,i=0,a=[];i<t;){var n=r.charCodeAt(i);if(n<55296||n>57343)a.push(n);else if(56320<=n&&n<=57343)a.push(65533);else if(55296<=n&&n<=56319)if(i===t-1)a.push(65533);else{var o=r.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=n&1023,u=o&1023;a.push(65536+(s<<10)+u),i+=1}else a.push(65533)}i+=1}return a}function OT(e){for(var r="",t=0;t<e.length;++t){var i=e[t];i<=65535?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return r}function ti(e){return 0<=e&&e<=127}var ri=ti,Nr=-1;function zd(e){this.tokens=[].slice.call(e),this.tokens.reverse()}zd.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Nr},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.shift());else this.tokens.unshift(e)}};var it=-1;function zr(e,r){if(e)throw TypeError("Decoder error");return r||65533}function ki(e){throw TypeError("The code point "+e+" could not be encoded.")}function IT(){}IT.prototype={handler:function(e,r){}};function BT(){}BT.prototype={handler:function(e,r){}};function qd(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Md,e)?Md[e]:null}var X1=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Md={};X1.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){Md[t]=r})})});var Da={},La={};function vs(e,r){return r&&r[e]||null}function bs(e,r){var t=r.indexOf(e);return t===-1?null:t}function Pa(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function FT(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=Pa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[0]<=e)r=n[0],t=n[1];else break}return t+e-r}function DT(e){if(e===59335)return 7457;var r=0,t=0,i=Pa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[1]<=e)r=n[1],t=n[0];else break}return t+e-r}function LT(e){Dd=Dd||Pa("jis0208").map(function(t,i){return Er(i,8272,8835)?null:t});var r=Dd;return r.indexOf(e)}var Dd;function qT(e){Ld=Ld||Pa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Ld;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):bs(e,r)}var Ld,Q1="utf-8";function Bo(e,r){if(!(this instanceof Bo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):Q1,r=jl(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=qd(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!La[t.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=t,Boolean(r.fatal)&&(i._error_mode="fatal"),Boolean(r.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(Bo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Bo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Bo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Bo.prototype.decode=function(r,t){var i;typeof r=="object"&&r instanceof ArrayBuffer?i=new Uint8Array(r):typeof r=="object"&&"buffer"in r&&r.buffer instanceof ArrayBuffer?i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):i=new Uint8Array(0),t=jl(t),this._do_not_flush||(this._decoder=La[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new zd(i),n=[],o;;){var s=a.read();if(s===Nr||(o=this._decoder.handler(a,s),o===it))break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(a,a.read()),o===it)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function u(l){return RT(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),OT(l)}return u.call(this,n)};function Pu(e,r){if(!(this instanceof Pu))throw TypeError("Called as a function. Did you forget 'new'?");r=jl(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var t=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):Q1;var i=qd(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Da[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=qd("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=t._encoding.name.toLowerCase()),t}Object.defineProperty&&Object.defineProperty(Pu.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Pu.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=jl(t),this._do_not_flush||(this._encoder=Da[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new zd(CT(r)),a=[],n;;){var o=i.read();if(o===Nr||(n=this._encoder.handler(i,o),n===it))break;Array.isArray(n)?a.push.apply(a,n):a.push(n)}if(!this._do_not_flush){for(;n=this._encoder.handler(i,i.read()),n!==it;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function MT(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,u){if(u===Nr&&a!==0)return a=0,zr(r);if(u===Nr)return it;if(a===0){if(Er(u,0,127))return u;if(Er(u,194,223))a=1,t=u&31;else if(Er(u,224,239))u===224&&(n=160),u===237&&(o=159),a=2,t=u&15;else if(Er(u,240,244))u===240&&(n=144),u===244&&(o=143),a=3,t=u&7;else return zr(r);return null}if(!Er(u,n,o))return t=a=i=0,n=128,o=191,s.prepend(u),zr(r);if(n=128,o=191,t=t<<6|u&63,i+=1,i!==a)return null;var l=t;return t=a=i=0,l}}function zT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a,n;Er(i,128,2047)?(a=1,n=192):Er(i,2048,65535)?(a=2,n=224):Er(i,65536,1114111)&&(a=3,n=240);for(var o=[(i>>6*a)+n];a>0;){var s=i>>6*(a-1);o.push(128|s&63),a-=1}return o}}Da["UTF-8"]=function(e){return new zT(e)};La["UTF-8"]=function(e){return new MT(e)};function NT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ti(a))return a;var n=e[a-128];return n===null?zr(t):n}}function UT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;var n=bs(a,e);return n===null&&ki(a),n+128}}(function(){"encoding-indexes"in globalThis&&X1.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=Pa(t.toLowerCase());La[t]=function(a){return new NT(i,a)},Da[t]=function(a){return new UT(i,a)}})})})();La.GBK=function(e){return new Z1(e)};Da.GBK=function(e){return new J1(e,!0)};function Z1(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===Nr&&t===0&&i===0&&a===0)return it;o===Nr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,zr(r));var s;if(a!==0){s=null,Er(o,48,57)&&(s=FT((((t-129)*10+i-48)*126+a-129)*10+o-48));var u=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(u),zr(r)):s}if(i!==0)return Er(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,zr(r));if(t!==0){if(Er(o,48,57))return i=o,null;var l=t,f=null;t=0;var h=o<127?64:65;return(Er(o,64,126)||Er(o,128,254))&&(f=(l-129)*190+(o-h)),s=f===null?null:vs(f,Pa("gb18030")),s===null&&ti(o)&&n.prepend(o),s===null?zr(r):s}return ti(o)?o:o===128?8364:Er(o,129,254)?(t=o,null):zr(r)}}function J1(e,r){var t=e.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;if(a===58853)return ki(a);if(r&&a===8364)return 128;var n=bs(a,Pa("gb18030"));if(n!==null){var o=_n(n/190)+129,s=n%190,u=s<63?64:65;return[o,s+u]}if(r)return ki(a);n=DT(a);var l=_n(n/10/126/10);n=n-l*10*126*10;var f=_n(n/10/126);n=n-f*10*126;var h=_n(n/10),d=n-h*10;return[l+129,f+48,h+129,d+48]}}Da.gb18030=function(e){return new J1(e)};La.gb18030=function(e){return new Z1(e)};function HT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((Er(a,64,126)||Er(a,161,254))&&(o=(n-129)*157+(a-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var u=o===null?null:vs(o,Pa("big5"));return u===null&&ti(a)&&i.prepend(a),u===null?zr(r):u}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function GT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=qT(i);if(a===null)return ki(i);var n=_n(a/157)+129;if(n<161)return ki(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}Da.Big5=function(e){return new GT(e)};La.Big5=function(e){return new HT(e)};function WT(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===Nr&&i!==0)return i=0,zr(r);if(n===Nr&&i===0)return it;if(i===142&&Er(n,161,223))return i=0,65377-161+n;if(i===143&&Er(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return Er(o,161,254)&&Er(n,161,254)&&(s=vs((o-161)*94+(n-161),Pa(t?"jis0212":"jis0208"))),t=!1,Er(n,161,254)||a.prepend(n),s===null?zr(r):s}return ti(n)?n:n===142||n===143||Er(n,161,254)?(i=n,null):zr(r)}}function VT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=bs(i,Pa("jis0208"));if(a===null)return ki(i);var n=_n(a/94)+161,o=a%94+161;return[n,o]}}Da["EUC-JP"]=function(e){return new VT(e)};La["EUC-JP"]=function(e){return new WT(e)};function $T(e){var r=e.fatal,t={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=t.ASCII,a=t.ASCII,n=0,o=!1;this.handler=function(s,u){switch(i){default:case t.ASCII:return u===27?(i=t.EscapeStart,null):Er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Roman:return u===27?(i=t.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):Er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Katakana:return u===27?(i=t.EscapeStart,null):Er(u,33,95)?(o=!1,65377-33+u):u===Nr?it:(o=!1,zr(r));case t.LeadByte:return u===27?(i=t.EscapeStart,null):Er(u,33,126)?(o=!1,n=u,i=t.TrailByte,null):u===Nr?it:(o=!1,zr(r));case t.TrailByte:if(u===27)return i=t.EscapeStart,zr(r);if(Er(u,33,126)){i=t.LeadByte;var l=(n-33)*94+u-33,f=vs(l,Pa("jis0208"));return f===null?zr(r):f}return u===Nr?(i=t.LeadByte,s.prepend(u),zr(r)):(i=t.LeadByte,zr(r));case t.EscapeStart:return u===36||u===40?(n=u,i=t.Escape,null):(s.prepend(u),o=!1,i=a,zr(r));case t.Escape:var h=n;n=0;var d=null;if(h===40&&u===66&&(d=t.ASCII),h===40&&u===74&&(d=t.Roman),h===40&&u===73&&(d=t.Katakana),h===36&&(u===64||u===66)&&(d=t.LeadByte),d!==null){i=i=d;var m=o;return o=!0,m?zr(r):null}return s.prepend([h,u]),o=!1,i=a,zr(r)}}}function KT(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===Nr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===Nr&&i===t.ASCII)return it;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return ki(65533);if(i===t.ASCII&&ri(n))return n;if(i===t.Roman&&(ri(n)&&n!==92&&n!==126||n==165||n==8254)){if(ri(n))return n;if(n===165)return 92;if(n===8254)return 126}if(ri(n)&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if((n===165||n===8254)&&i!==t.Roman)return a.prepend(n),i=t.Roman,[27,40,74];n===8722&&(n=65293);var o=bs(n,Pa("jis0208"));if(o===null)return ki(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=_n(o/94)+33,u=o%94+33;return[s,u]}}Da["ISO-2022-JP"]=function(e){return new KT(e)};La["ISO-2022-JP"]=function(e){return new $T(e)};function YT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,u=n<160?129:193;if((Er(a,64,126)||Er(a,128,252))&&(o=(n-u)*188+a-s),Er(o,8836,10715))return 57344-8836+o;var l=o===null?null:vs(o,Pa("jis0208"));return l===null&&ti(a)&&i.prepend(a),l===null?zr(r):l}return ti(a)||a===128?a:Er(a,161,223)?65377-161+a:Er(a,129,159)||Er(a,224,252)?(t=a,null):zr(r)}}function XT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=LT(i);if(a===null)return ki(i);var n=_n(a/188),o=n<31?129:193,s=a%188,u=s<63?64:65;return[n+o,s+u]}}Da.Shift_JIS=function(e){return new XT(e)};La.Shift_JIS=function(e){return new YT(e)};function QT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0,Er(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:vs(o,Pa("euc-kr"));return o===null&&ti(a)&&i.prepend(a),s===null?zr(r):s}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function ZT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=bs(i,Pa("euc-kr"));if(a===null)return ki(i);var n=_n(a/190)+129,o=a%190+65;return[n,o]}}Da["EUC-KR"]=function(e){return new ZT(e)};La["EUC-KR"]=function(e){return new QT(e)};function El(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function eb(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===Nr&&(i!==null||a!==null))return zr(t);if(o===Nr&&i===null&&a===null)return it;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var u=a;return a=null,Er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(n.prepend(El(s,e)),zr(t))}return Er(s,55296,56319)?(a=s,null):Er(s,56320,57343)?zr(t):s}}function rb(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(Er(a,0,65535))return El(a,e);var n=El((a-65536>>10)+55296,e),o=El((a-65536&1023)+56320,e);return n.concat(o)}}Da["UTF-16BE"]=function(e){return new rb(!0,e)};La["UTF-16BE"]=function(e){return new eb(!0,e)};Da["UTF-16LE"]=function(e){return new rb(!1,e)};La["UTF-16LE"]=function(e){return new eb(!1,e)};function JT(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ti(i)?i:63360+i-128}}function eP(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ri(i)?i:Er(i,63360,63487)?i-63360+128:ki(i)}}Da["x-user-defined"]=function(e){return new eP(e)};La["x-user-defined"]=function(e){return new JT(e)};function Ru(e){return Buffer.from(e).toString("base64")}function Nd(e){return Buffer.from(e,"base64").toString("ascii")}var Qx=Pt(Yx(),1),Zx=Pt(qu(),1);function Xx(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function hC(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,Zx.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,Qx.default)(i,t,r)}function Jx(e,r){let t=hC(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(Xx(n))})})}var O5=Pt(C5(),1),Ug=["image/png","image/jpeg","image/gif"];async function Hg(e,r){if(!r)throw new Error("MIMEType is required to parse image under Node.js");let t=e instanceof Buffer?e:Buffer.from(e);return await jU(t,r)}function jU(e,r){return new Promise(t=>(0,O5.default)(e,r,(i,a)=>{if(i)throw i;let n=[...a.shape],o=a.shape.length===4?a.shape.shift():1,s=a.data instanceof Buffer?new Uint8Array(a.data):a.data;t({shape:n,data:s,width:a.shape[0],height:a.shape[1],components:a.shape[2],layers:o?[o]:[]})}))}async function Gg(e,r,t,i){return i._parse(e,r,t,i)}function zi(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var hn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},AU=hn.self||hn.window||hn.global||{},TU=hn.window||hn.self||hn.global||{},PU=hn.global||hn.self||hn.window||{},RU=hn.document||{};var Jo=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var I5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),CU=I5&&parseFloat(I5[1])||0;function Wg(e,r){return B5(e||{},r)}function B5(e,r,t=0){if(t>3)return r;let i={...e};for(let[a,n]of Object.entries(r))n&&typeof n=="object"&&!Array.isArray(n)?i[a]=B5(i[a]||{},r[a],t+1):i[a]=r[a];return i}var F5="latest";function OU(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.1.1"),globalThis._loadersgl_.version}var Bc=OU();function ma(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var mn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},_J=mn.self||mn.window||mn.global||{},kJ=mn.window||mn.self||mn.global||{},SJ=mn.global||mn.self||mn.window||{},EJ=mn.document||{};var oa=typeof process!="object"||String(process)!=="[object process]"||process.browser,Fc=typeof importScripts=="function",L5=typeof window<"u"&&typeof window.orientation<"u",D5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),jJ=D5&&parseFloat(D5[1])||0;var Dc=class{constructor(r,t){this.isRunning=!0;this._resolve=()=>{};this._reject=()=>{};this.name=r,this.workerThread=t,this.result=new Promise((i,a)=>{this._resolve=i,this._reject=a})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){ma(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){ma(this.isRunning),this.isRunning=!1,this._reject(r)}};var So={};Au(So,{NodeWorker:()=>qc,parentPort:()=>Vg});var Lc=Pt(require("worker_threads"),1);Tu(So,require("worker_threads"));var Vg=Lc==null?void 0:Lc.parentPort,qc=Lc.Worker;var $g=new Map;function q5(e){ma(e.source&&!e.url||!e.source&&e.url);let r=$g.get(e.source||e.url);return r||(e.url&&(r=IU(e.url),$g.set(e.url,r)),e.source&&(r=M5(e.source),$g.set(e.source,r))),ma(r),r}function IU(e){if(!e.startsWith("http"))return e;let r=BU(e);return M5(r)}function M5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function BU(e){return`try {
95
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return(t=e[Symbol.iterator]()).next.bind(t)}function oA(e){return typeof TextEncoder<"u"?new TextEncoder().encode(e):Buffer.from(e)}function sA(e){return typeof TextDecoder<"u"?new TextDecoder().decode(e):Buffer.from(e).toString("utf8")}function pd(e){for(var r,t=0,i=nA(e);!(r=i()).done;)t+=r.value.byteLength;for(var a,n=new Uint8Array(t),o=0,s=nA(e);!(a=s()).done;){var u=a.value;n.set(new Uint8Array(u),o),o+=u.byteLength}return n}var PV={keepWriter:!1};dd.KTX2Container=aA,dd.read=function(e){var r=new Uint8Array(e.buffer,e.byteOffset,ga.length);if(r[0]!==ga[0]||r[1]!==ga[1]||r[2]!==ga[2]||r[3]!==ga[3]||r[4]!==ga[4]||r[5]!==ga[5]||r[6]!==ga[6]||r[7]!==ga[7]||r[8]!==ga[8]||r[9]!==ga[9]||r[10]!==ga[10]||r[11]!==ga[11])throw new Error("Missing KTX 2.0 identifier.");var t=new aA,i=17*Uint32Array.BYTES_PER_ELEMENT,a=new nl(e,ga.length,i,!0);t.vkFormat=a._nextUint32(),t.typeSize=a._nextUint32(),t.pixelWidth=a._nextUint32(),t.pixelHeight=a._nextUint32(),t.pixelDepth=a._nextUint32(),t.layerCount=a._nextUint32(),t.faceCount=a._nextUint32();var n=a._nextUint32();t.supercompressionScheme=a._nextUint32();for(var o=a._nextUint32(),s=a._nextUint32(),u=a._nextUint32(),l=a._nextUint32(),f=a._nextUint64(),h=a._nextUint64(),d=new nl(e,ga.length+i,3*n*8,!0),m=0;m<n;m++)t.levels.push({levelData:new Uint8Array(e.buffer,e.byteOffset+d._nextUint64(),d._nextUint64()),uncompressedByteLength:d._nextUint64()});for(var y=new nl(e,o,s,!0),k={vendorId:y._skip(4)._nextUint16(),descriptorType:y._nextUint16(),versionNumber:y._nextUint16(),descriptorBlockSize:y._nextUint16(),colorModel:y._nextUint8(),colorPrimaries:y._nextUint8(),transferFunction:y._nextUint8(),flags:y._nextUint8(),texelBlockDimension:{x:y._nextUint8()+1,y:y._nextUint8()+1,z:y._nextUint8()+1,w:y._nextUint8()+1},bytesPlane:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],samples:[]},x=(k.descriptorBlockSize/4-6)/4,A=0;A<x;A++)k.samples[A]={bitOffset:y._nextUint16(),bitLength:y._nextUint8(),channelID:y._nextUint8(),samplePosition:[y._nextUint8(),y._nextUint8(),y._nextUint8(),y._nextUint8()],sampleLower:y._nextUint32(),sampleUpper:y._nextUint32()};t.dataFormatDescriptor.length=0,t.dataFormatDescriptor.push(k);for(var P=new nl(e,u,l,!0);P._offset<l;){var T=P._nextUint32(),B=P._scan(T),C=sA(B),I=P._scan(T-B.byteLength);t.keyValue[C]=C.match(/^ktx/i)?sA(I):I,T%4&&P._skip(4-T%4)}if(h<=0)return t;for(var F=new nl(e,f,h,!0),H=F._nextUint16(),N=F._nextUint16(),K=F._nextUint32(),V=F._nextUint32(),X=F._nextUint32(),U=F._nextUint32(),$=[],Z=0;Z<n;Z++)$.push({imageFlags:F._nextUint32(),rgbSliceByteOffset:F._nextUint32(),rgbSliceByteLength:F._nextUint32(),alphaSliceByteOffset:F._nextUint32(),alphaSliceByteLength:F._nextUint32()});var le=f+F._offset,ve=le+K,fe=ve+V,we=fe+X,ye=new Uint8Array(e.buffer,e.byteOffset+le,K),Me=new Uint8Array(e.buffer,e.byteOffset+ve,V),ze=new Uint8Array(e.buffer,e.byteOffset+fe,X),Ie=new Uint8Array(e.buffer,e.byteOffset+we,U);return t.globalData={endpointCount:H,selectorCount:N,imageDescs:$,endpointsData:ye,selectorsData:Me,tablesData:ze,extendedData:Ie},t},dd.write=function(e,r){r===void 0&&(r={}),r=d1({},PV,r);var t=new ArrayBuffer(0);if(e.globalData){var i=new ArrayBuffer(20+5*e.globalData.imageDescs.length*4),a=new DataView(i);a.setUint16(0,e.globalData.endpointCount,!0),a.setUint16(2,e.globalData.selectorCount,!0),a.setUint32(4,e.globalData.endpointsData.byteLength,!0),a.setUint32(8,e.globalData.selectorsData.byteLength,!0),a.setUint32(12,e.globalData.tablesData.byteLength,!0),a.setUint32(16,e.globalData.extendedData.byteLength,!0);for(var n=0;n<e.globalData.imageDescs.length;n++){var o=e.globalData.imageDescs[n];a.setUint32(20+5*n*4+0,o.imageFlags,!0),a.setUint32(20+5*n*4+4,o.rgbSliceByteOffset,!0),a.setUint32(20+5*n*4+8,o.rgbSliceByteLength,!0),a.setUint32(20+5*n*4+12,o.alphaSliceByteOffset,!0),a.setUint32(20+5*n*4+16,o.alphaSliceByteLength,!0)}t=pd([i,e.globalData.endpointsData,e.globalData.selectorsData,e.globalData.tablesData,e.globalData.extendedData])}var s=[],u=e.keyValue;for(var l in r.keepWriter||(u=d1({},e.keyValue,{KTXwriter:"KTX-Parse v0.0.4"})),u){var f=u[l],h=oA(l),d=typeof f=="string"?oA(f):f,m=h.byteLength+1+d.byteLength+1,y=m%4?4-m%4:0;s.push(pd([new Uint32Array([m]),h,tA,d,tA,new Uint8Array(y).fill(0)]))}var k=pd(s),x=new ArrayBuffer(44),A=new DataView(x);if(e.dataFormatDescriptor.length!==1||e.dataFormatDescriptor[0].descriptorType!==hd.BASICFORMAT)throw new Error("Only BASICFORMAT Data Format Descriptor output supported.");var P=e.dataFormatDescriptor[0];A.setUint32(0,44,!0),A.setUint16(4,P.vendorId,!0),A.setUint16(6,P.descriptorType,!0),A.setUint16(8,P.versionNumber,!0),A.setUint16(10,P.descriptorBlockSize,!0),A.setUint8(12,P.colorModel),A.setUint8(13,P.colorPrimaries),A.setUint8(14,P.transferFunction),A.setUint8(15,P.flags),A.setUint8(16,P.texelBlockDimension.x-1),A.setUint8(17,P.texelBlockDimension.y-1),A.setUint8(18,P.texelBlockDimension.z-1),A.setUint8(19,P.texelBlockDimension.w-1);for(var T=0;T<8;T++)A.setUint8(20+T,P.bytesPlane[T]);for(var B=0;B<P.samples.length;B++){var C=P.samples[B],I=28+16*B;A.setUint16(I+0,C.bitOffset,!0),A.setUint8(I+2,C.bitLength),A.setUint8(I+3,C.channelID),A.setUint8(I+4,C.samplePosition[0]),A.setUint8(I+5,C.samplePosition[1]),A.setUint8(I+6,C.samplePosition[2]),A.setUint8(I+7,C.samplePosition[3]),A.setUint32(I+8,C.sampleLower,!0),A.setUint32(I+12,C.sampleUpper,!0)}var F=ga.length+68+3*e.levels.length*8,H=F+x.byteLength,N=H+k.byteLength;N%8&&(N+=8-N%8);for(var K=[],V=new DataView(new ArrayBuffer(3*e.levels.length*8)),X=N+t.byteLength,U=0;U<e.levels.length;U++){var $=e.levels[U];K.push($.levelData),V.setBigUint64(24*U+0,BigInt(X),!0),V.setBigUint64(24*U+8,BigInt($.levelData.byteLength),!0),V.setBigUint64(24*U+16,BigInt($.uncompressedByteLength),!0),X+=$.levelData.byteLength}var Z=new ArrayBuffer(68),le=new DataView(Z);return le.setUint32(0,e.vkFormat,!0),le.setUint32(4,e.typeSize,!0),le.setUint32(8,e.pixelWidth,!0),le.setUint32(12,e.pixelHeight,!0),le.setUint32(16,e.pixelDepth,!0),le.setUint32(20,e.layerCount,!0),le.setUint32(24,e.faceCount,!0),le.setUint32(28,e.levels.length,!0),le.setUint32(32,e.supercompressionScheme,!0),le.setUint32(36,F,!0),le.setUint32(40,x.byteLength,!0),le.setUint32(44,H,!0),le.setUint32(48,k.byteLength,!0),le.setBigUint64(52,BigInt(N),!0),le.setBigUint64(60,BigInt(t.byteLength),!0),new Uint8Array(pd([new Uint8Array(ga).buffer,Z,V.buffer,x,k,new ArrayBuffer(N-(H+k.byteLength)),t].concat(K)))}});var K1=typeof process!="object"||String(process)!=="[object process]"||process.browser;var Y1={ibm866:[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,9617,9618,9619,9474,9508,9569,9570,9558,9557,9571,9553,9559,9565,9564,9563,9488,9492,9524,9516,9500,9472,9532,9566,9567,9562,9556,9577,9574,9568,9552,9580,9575,9576,9572,9573,9561,9560,9554,9555,9579,9578,9496,9484,9608,9604,9612,9616,9600,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1025,1105,1028,1108,1031,1111,1038,1118,176,8729,183,8730,8470,164,9632,160],"iso-8859-2":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,728,321,164,317,346,167,168,352,350,356,377,173,381,379,176,261,731,322,180,318,347,711,184,353,351,357,378,733,382,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"iso-8859-3":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,294,728,163,164,null,292,167,168,304,350,286,308,173,null,379,176,295,178,179,180,181,293,183,184,305,351,287,309,189,null,380,192,193,194,null,196,266,264,199,200,201,202,203,204,205,206,207,null,209,210,211,212,288,214,215,284,217,218,219,220,364,348,223,224,225,226,null,228,267,265,231,232,233,234,235,236,237,238,239,null,241,242,243,244,289,246,247,285,249,250,251,252,365,349,729],"iso-8859-4":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,312,342,164,296,315,167,168,352,274,290,358,173,381,175,176,261,731,343,180,297,316,711,184,353,275,291,359,330,382,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,298,272,325,332,310,212,213,214,215,216,370,218,219,220,360,362,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,299,273,326,333,311,244,245,246,247,248,371,250,251,252,361,363,729],"iso-8859-5":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,173,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,8470,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,167,1118,1119],"iso-8859-6":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,null,null,164,null,null,null,null,null,null,null,1548,173,null,null,null,null,null,null,null,null,null,null,null,null,null,1563,null,null,null,1567,null,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,1591,1592,1593,1594,null,null,null,null,null,1600,1601,1602,1603,1604,1605,1606,1607,1608,1609,1610,1611,1612,1613,1614,1615,1616,1617,1618,null,null,null,null,null,null,null,null,null,null,null,null,null],"iso-8859-7":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8216,8217,163,8364,8367,166,167,168,169,890,171,172,173,null,8213,176,177,178,179,900,901,902,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"iso-8859-8":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,null,162,163,164,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,8215,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"iso-8859-10":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,274,290,298,296,310,167,315,272,352,358,381,173,362,330,176,261,275,291,299,297,311,183,316,273,353,359,382,8213,363,331,256,193,194,195,196,197,198,302,268,201,280,203,278,205,206,207,208,325,332,211,212,213,214,360,216,370,218,219,220,221,222,223,257,225,226,227,228,229,230,303,269,233,281,235,279,237,238,239,240,326,333,243,244,245,246,361,248,371,250,251,252,253,254,312],"iso-8859-13":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,8221,162,163,164,8222,166,167,216,169,342,171,172,173,174,198,176,177,178,179,8220,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,8217],"iso-8859-14":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,7682,7683,163,266,267,7690,167,7808,169,7810,7691,7922,173,174,376,7710,7711,288,289,7744,7745,182,7766,7809,7767,7811,7776,7923,7812,7813,7777,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,372,209,210,211,212,213,214,7786,216,217,218,219,220,221,374,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,373,241,242,243,244,245,246,7787,248,249,250,251,252,253,375,255],"iso-8859-15":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,8364,165,352,167,353,169,170,171,172,173,174,175,176,177,178,179,381,181,182,183,382,185,186,187,338,339,376,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"iso-8859-16":[128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,260,261,321,8364,8222,352,167,353,169,536,171,377,173,378,379,176,177,268,322,381,8221,182,183,382,269,537,187,338,339,376,380,192,193,194,258,196,262,198,199,200,201,202,203,204,205,206,207,272,323,210,211,212,336,214,346,368,217,218,219,220,280,538,223,224,225,226,259,228,263,230,231,232,233,234,235,236,237,238,239,273,324,242,243,244,337,246,347,369,249,250,251,252,281,539,255],"koi8-r":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,9555,9556,9557,9558,9559,9560,9561,9562,9563,9564,9565,9566,9567,9568,9569,1025,9570,9571,9572,9573,9574,9575,9576,9577,9578,9579,9580,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],"koi8-u":[9472,9474,9484,9488,9492,9496,9500,9508,9516,9524,9532,9600,9604,9608,9612,9616,9617,9618,9619,8992,9632,8729,8730,8776,8804,8805,160,8993,176,178,183,247,9552,9553,9554,1105,1108,9556,1110,1111,9559,9560,9561,9562,9563,1169,1118,9566,9567,9568,9569,1025,1028,9571,1030,1031,9574,9575,9576,9577,9578,1168,1038,169,1102,1072,1073,1094,1076,1077,1092,1075,1093,1080,1081,1082,1083,1084,1085,1086,1087,1103,1088,1089,1090,1091,1078,1074,1100,1099,1079,1096,1101,1097,1095,1098,1070,1040,1041,1062,1044,1045,1060,1043,1061,1048,1049,1050,1051,1052,1053,1054,1055,1071,1056,1057,1058,1059,1046,1042,1068,1067,1047,1064,1069,1065,1063,1066],macintosh:[196,197,199,201,209,214,220,225,224,226,228,227,229,231,233,232,234,235,237,236,238,239,241,243,242,244,246,245,250,249,251,252,8224,176,162,163,167,8226,182,223,174,169,8482,180,168,8800,198,216,8734,177,8804,8805,165,181,8706,8721,8719,960,8747,170,186,937,230,248,191,161,172,8730,402,8776,8710,171,187,8230,160,192,195,213,338,339,8211,8212,8220,8221,8216,8217,247,9674,255,376,8260,8364,8249,8250,64257,64258,8225,183,8218,8222,8240,194,202,193,203,200,205,206,207,204,211,212,63743,210,218,219,217,305,710,732,175,728,729,730,184,733,731,711],"windows-874":[8364,129,130,131,132,8230,134,135,136,137,138,139,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,153,154,155,156,157,158,159,160,3585,3586,3587,3588,3589,3590,3591,3592,3593,3594,3595,3596,3597,3598,3599,3600,3601,3602,3603,3604,3605,3606,3607,3608,3609,3610,3611,3612,3613,3614,3615,3616,3617,3618,3619,3620,3621,3622,3623,3624,3625,3626,3627,3628,3629,3630,3631,3632,3633,3634,3635,3636,3637,3638,3639,3640,3641,3642,null,null,null,null,3647,3648,3649,3650,3651,3652,3653,3654,3655,3656,3657,3658,3659,3660,3661,3662,3663,3664,3665,3666,3667,3668,3669,3670,3671,3672,3673,3674,3675,null,null,null,null],"windows-1250":[8364,129,8218,131,8222,8230,8224,8225,136,8240,352,8249,346,356,381,377,144,8216,8217,8220,8221,8226,8211,8212,152,8482,353,8250,347,357,382,378,160,711,728,321,164,260,166,167,168,169,350,171,172,173,174,379,176,177,731,322,180,181,182,183,184,261,351,187,317,733,318,380,340,193,194,258,196,313,262,199,268,201,280,203,282,205,206,270,272,323,327,211,212,336,214,215,344,366,218,368,220,221,354,223,341,225,226,259,228,314,263,231,269,233,281,235,283,237,238,271,273,324,328,243,244,337,246,247,345,367,250,369,252,253,355,729],"windows-1251":[1026,1027,8218,1107,8222,8230,8224,8225,8364,8240,1033,8249,1034,1036,1035,1039,1106,8216,8217,8220,8221,8226,8211,8212,152,8482,1113,8250,1114,1116,1115,1119,160,1038,1118,1032,164,1168,166,167,1025,169,1028,171,172,173,174,1031,176,177,1030,1110,1169,181,182,183,1105,8470,1108,187,1112,1029,1109,1111,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103],"windows-1252":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255],"windows-1253":[8364,129,8218,402,8222,8230,8224,8225,136,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,157,158,159,160,901,902,163,164,165,166,167,168,169,null,171,172,173,174,8213,176,177,178,179,900,181,182,183,904,905,906,187,908,189,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,null,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,null],"windows-1254":[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,286,209,210,211,212,213,214,215,216,217,218,219,220,304,350,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,287,241,242,243,244,245,246,247,248,249,250,251,252,305,351,255],"windows-1255":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,140,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,156,157,158,159,160,161,162,163,8362,165,166,167,168,169,215,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,247,187,188,189,190,191,1456,1457,1458,1459,1460,1461,1462,1463,1464,1465,1466,1467,1468,1469,1470,1471,1472,1473,1474,1475,1520,1521,1522,1523,1524,null,null,null,null,null,null,null,1488,1489,1490,1491,1492,1493,1494,1495,1496,1497,1498,1499,1500,1501,1502,1503,1504,1505,1506,1507,1508,1509,1510,1511,1512,1513,1514,null,null,8206,8207,null],"windows-1256":[8364,1662,8218,402,8222,8230,8224,8225,710,8240,1657,8249,338,1670,1688,1672,1711,8216,8217,8220,8221,8226,8211,8212,1705,8482,1681,8250,339,8204,8205,1722,160,1548,162,163,164,165,166,167,168,169,1726,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,1563,187,188,189,190,1567,1729,1569,1570,1571,1572,1573,1574,1575,1576,1577,1578,1579,1580,1581,1582,1583,1584,1585,1586,1587,1588,1589,1590,215,1591,1592,1593,1594,1600,1601,1602,1603,224,1604,226,1605,1606,1607,1608,231,232,233,234,235,1609,1610,238,239,1611,1612,1613,1614,244,1615,1616,247,1617,249,1618,251,252,8206,8207,1746],"windows-1257":[8364,129,8218,131,8222,8230,8224,8225,136,8240,138,8249,140,168,711,184,144,8216,8217,8220,8221,8226,8211,8212,152,8482,154,8250,156,175,731,159,160,null,162,163,164,null,166,167,216,169,342,171,172,173,174,198,176,177,178,179,180,181,182,183,248,185,343,187,188,189,190,230,260,302,256,262,196,197,280,274,268,201,377,278,290,310,298,315,352,323,325,211,332,213,214,215,370,321,346,362,220,379,381,223,261,303,257,263,228,229,281,275,269,233,378,279,291,311,299,316,353,324,326,243,333,245,246,247,371,322,347,363,252,380,382,729],"windows-1258":[8364,129,8218,402,8222,8230,8224,8225,710,8240,138,8249,338,141,142,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,154,8250,339,157,158,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,258,196,197,198,199,200,201,202,203,768,205,206,207,272,209,777,211,212,416,214,215,216,217,218,219,220,431,771,223,224,225,226,259,228,229,230,231,232,233,234,235,769,237,238,239,273,241,803,243,244,417,246,247,248,249,250,251,252,432,8363,255],"x-mac-cyrillic":[1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,8224,176,1168,163,167,8226,182,1030,174,169,8482,1026,1106,8800,1027,1107,8734,177,8804,8805,1110,181,1169,1032,1028,1108,1031,1111,1033,1113,1034,1114,1112,1029,172,8730,402,8776,8710,171,187,8230,160,1035,1115,1036,1116,1109,8211,8212,8220,8221,8216,8217,247,8222,1038,1118,1039,1119,8470,1025,1105,1103,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,8364]};globalThis["encoding-indexes"]=Y1||{};function Er(e,r,t){return r<=e&&e<=t}function RT(e,r){return e.indexOf(r)!==-1}var _n=Math.floor;function jl(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function CT(e){for(var r=String(e),t=r.length,i=0,a=[];i<t;){var n=r.charCodeAt(i);if(n<55296||n>57343)a.push(n);else if(56320<=n&&n<=57343)a.push(65533);else if(55296<=n&&n<=56319)if(i===t-1)a.push(65533);else{var o=r.charCodeAt(i+1);if(56320<=o&&o<=57343){var s=n&1023,u=o&1023;a.push(65536+(s<<10)+u),i+=1}else a.push(65533)}i+=1}return a}function OT(e){for(var r="",t=0;t<e.length;++t){var i=e[t];i<=65535?r+=String.fromCharCode(i):(i-=65536,r+=String.fromCharCode((i>>10)+55296,(i&1023)+56320))}return r}function ti(e){return 0<=e&&e<=127}var ri=ti,Nr=-1;function zd(e){this.tokens=[].slice.call(e),this.tokens.reverse()}zd.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Nr},prepend:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.push(r.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var r=e;r.length;)this.tokens.unshift(r.shift());else this.tokens.unshift(e)}};var it=-1;function zr(e,r){if(e)throw TypeError("Decoder error");return r||65533}function ki(e){throw TypeError("The code point "+e+" could not be encoded.")}function IT(){}IT.prototype={handler:function(e,r){}};function BT(){}BT.prototype={handler:function(e,r){}};function qd(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Md,e)?Md[e]:null}var X1=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Md={};X1.forEach(function(e){e.encodings.forEach(function(r){r.labels.forEach(function(t){Md[t]=r})})});var Da={},La={};function vs(e,r){return r&&r[e]||null}function bs(e,r){var t=r.indexOf(e);return t===-1?null:t}function Pa(e){if(!("encoding-indexes"in globalThis))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return globalThis["encoding-indexes"][e]}function FT(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var r=0,t=0,i=Pa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[0]<=e)r=n[0],t=n[1];else break}return t+e-r}function DT(e){if(e===59335)return 7457;var r=0,t=0,i=Pa("gb18030-ranges"),a;for(a=0;a<i.length;++a){var n=i[a];if(n[1]<=e)r=n[1],t=n[0];else break}return t+e-r}function LT(e){Dd=Dd||Pa("jis0208").map(function(t,i){return Er(i,8272,8835)?null:t});var r=Dd;return r.indexOf(e)}var Dd;function qT(e){Ld=Ld||Pa("big5").map(function(t,i){return i<(161-129)*157?null:t});var r=Ld;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?r.lastIndexOf(e):bs(e,r)}var Ld,Q1="utf-8";function Bo(e,r){if(!(this instanceof Bo))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):Q1,r=jl(r),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var t=qd(e);if(t===null||t.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!La[t.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var i=this;return i._encoding=t,Boolean(r.fatal)&&(i._error_mode="fatal"),Boolean(r.ignoreBOM)&&(i._ignoreBOM=!0),Object.defineProperty||(this.encoding=i._encoding.name.toLowerCase(),this.fatal=i._error_mode==="fatal",this.ignoreBOM=i._ignoreBOM),i}Object.defineProperty&&(Object.defineProperty(Bo.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Bo.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Bo.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Bo.prototype.decode=function(r,t){var i;typeof r=="object"&&r instanceof ArrayBuffer?i=new Uint8Array(r):typeof r=="object"&&"buffer"in r&&r.buffer instanceof ArrayBuffer?i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength):i=new Uint8Array(0),t=jl(t),this._do_not_flush||(this._decoder=La[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(t.stream);for(var a=new zd(i),n=[],o;;){var s=a.read();if(s===Nr||(o=this._decoder.handler(a,s),o===it))break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(a,a.read()),o===it)break;o!==null&&(Array.isArray(o)?n.push.apply(n,o):n.push(o))}while(!a.endOfStream());this._decoder=null}function u(l){return RT(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(l.length>0&&l[0]===65279?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),OT(l)}return u.call(this,n)};function Pu(e,r){if(!(this instanceof Pu))throw TypeError("Called as a function. Did you forget 'new'?");r=jl(r),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(r.fatal)?"fatal":"replacement";var t=this;if(Boolean(r.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):Q1;var i=qd(e);if(i===null||i.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!Da[i.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");t._encoding=i}else t._encoding=qd("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=t._encoding.name.toLowerCase()),t}Object.defineProperty&&Object.defineProperty(Pu.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Pu.prototype.encode=function(r,t){r=r===void 0?"":String(r),t=jl(t),this._do_not_flush||(this._encoder=Da[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(t.stream);for(var i=new zd(CT(r)),a=[],n;;){var o=i.read();if(o===Nr||(n=this._encoder.handler(i,o),n===it))break;Array.isArray(n)?a.push.apply(a,n):a.push(n)}if(!this._do_not_flush){for(;n=this._encoder.handler(i,i.read()),n!==it;)Array.isArray(n)?a.push.apply(a,n):a.push(n);this._encoder=null}return new Uint8Array(a)};function MT(e){var r=e.fatal,t=0,i=0,a=0,n=128,o=191;this.handler=function(s,u){if(u===Nr&&a!==0)return a=0,zr(r);if(u===Nr)return it;if(a===0){if(Er(u,0,127))return u;if(Er(u,194,223))a=1,t=u&31;else if(Er(u,224,239))u===224&&(n=160),u===237&&(o=159),a=2,t=u&15;else if(Er(u,240,244))u===240&&(n=144),u===244&&(o=143),a=3,t=u&7;else return zr(r);return null}if(!Er(u,n,o))return t=a=i=0,n=128,o=191,s.prepend(u),zr(r);if(n=128,o=191,t=t<<6|u&63,i+=1,i!==a)return null;var l=t;return t=a=i=0,l}}function zT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a,n;Er(i,128,2047)?(a=1,n=192):Er(i,2048,65535)?(a=2,n=224):Er(i,65536,1114111)&&(a=3,n=240);for(var o=[(i>>6*a)+n];a>0;){var s=i>>6*(a-1);o.push(128|s&63),a-=1}return o}}Da["UTF-8"]=function(e){return new zT(e)};La["UTF-8"]=function(e){return new MT(e)};function NT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ti(a))return a;var n=e[a-128];return n===null?zr(t):n}}function UT(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;var n=bs(a,e);return n===null&&ki(a),n+128}}(function(){"encoding-indexes"in globalThis&&X1.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(r){var t=r.name,i=Pa(t.toLowerCase());La[t]=function(a){return new NT(i,a)},Da[t]=function(a){return new UT(i,a)}})})})();La.GBK=function(e){return new Z1(e)};Da.GBK=function(e){return new J1(e,!0)};function Z1(e){var r=e.fatal,t=0,i=0,a=0;this.handler=function(n,o){if(o===Nr&&t===0&&i===0&&a===0)return it;o===Nr&&(t!==0||i!==0||a!==0)&&(t=0,i=0,a=0,zr(r));var s;if(a!==0){s=null,Er(o,48,57)&&(s=FT((((t-129)*10+i-48)*126+a-129)*10+o-48));var u=[i,a,o];return t=0,i=0,a=0,s===null?(n.prepend(u),zr(r)):s}if(i!==0)return Er(o,129,254)?(a=o,null):(n.prepend([i,o]),t=0,i=0,zr(r));if(t!==0){if(Er(o,48,57))return i=o,null;var l=t,f=null;t=0;var h=o<127?64:65;return(Er(o,64,126)||Er(o,128,254))&&(f=(l-129)*190+(o-h)),s=f===null?null:vs(f,Pa("gb18030")),s===null&&ti(o)&&n.prepend(o),s===null?zr(r):s}return ti(o)?o:o===128?8364:Er(o,129,254)?(t=o,null):zr(r)}}function J1(e,r){var t=e.fatal;this.handler=function(i,a){if(a===Nr)return it;if(ri(a))return a;if(a===58853)return ki(a);if(r&&a===8364)return 128;var n=bs(a,Pa("gb18030"));if(n!==null){var o=_n(n/190)+129,s=n%190,u=s<63?64:65;return[o,s+u]}if(r)return ki(a);n=DT(a);var l=_n(n/10/126/10);n=n-l*10*126*10;var f=_n(n/10/126);n=n-f*10*126;var h=_n(n/10),d=n-h*10;return[l+129,f+48,h+129,d+48]}}Da.gb18030=function(e){return new J1(e)};La.gb18030=function(e){return new Z1(e)};function HT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:98;switch((Er(a,64,126)||Er(a,161,254))&&(o=(n-129)*157+(a-s)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var u=o===null?null:vs(o,Pa("big5"));return u===null&&ti(a)&&i.prepend(a),u===null?zr(r):u}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function GT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=qT(i);if(a===null)return ki(i);var n=_n(a/157)+129;if(n<161)return ki(i);var o=a%157,s=o<63?64:98;return[n,o+s]}}Da.Big5=function(e){return new GT(e)};La.Big5=function(e){return new HT(e)};function WT(e){var r=e.fatal,t=!1,i=0;this.handler=function(a,n){if(n===Nr&&i!==0)return i=0,zr(r);if(n===Nr&&i===0)return it;if(i===142&&Er(n,161,223))return i=0,65377-161+n;if(i===143&&Er(n,161,254))return t=!0,i=n,null;if(i!==0){var o=i;i=0;var s=null;return Er(o,161,254)&&Er(n,161,254)&&(s=vs((o-161)*94+(n-161),Pa(t?"jis0212":"jis0208"))),t=!1,Er(n,161,254)||a.prepend(n),s===null?zr(r):s}return ti(n)?n:n===142||n===143||Er(n,161,254)?(i=n,null):zr(r)}}function VT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return[142,i-65377+161];i===8722&&(i=65293);var a=bs(i,Pa("jis0208"));if(a===null)return ki(i);var n=_n(a/94)+161,o=a%94+161;return[n,o]}}Da["EUC-JP"]=function(e){return new VT(e)};La["EUC-JP"]=function(e){return new WT(e)};function $T(e){var r=e.fatal,t={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},i=t.ASCII,a=t.ASCII,n=0,o=!1;this.handler=function(s,u){switch(i){default:case t.ASCII:return u===27?(i=t.EscapeStart,null):Er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Roman:return u===27?(i=t.EscapeStart,null):u===92?(o=!1,165):u===126?(o=!1,8254):Er(u,0,127)&&u!==14&&u!==15&&u!==27&&u!==92&&u!==126?(o=!1,u):u===Nr?it:(o=!1,zr(r));case t.Katakana:return u===27?(i=t.EscapeStart,null):Er(u,33,95)?(o=!1,65377-33+u):u===Nr?it:(o=!1,zr(r));case t.LeadByte:return u===27?(i=t.EscapeStart,null):Er(u,33,126)?(o=!1,n=u,i=t.TrailByte,null):u===Nr?it:(o=!1,zr(r));case t.TrailByte:if(u===27)return i=t.EscapeStart,zr(r);if(Er(u,33,126)){i=t.LeadByte;var l=(n-33)*94+u-33,f=vs(l,Pa("jis0208"));return f===null?zr(r):f}return u===Nr?(i=t.LeadByte,s.prepend(u),zr(r)):(i=t.LeadByte,zr(r));case t.EscapeStart:return u===36||u===40?(n=u,i=t.Escape,null):(s.prepend(u),o=!1,i=a,zr(r));case t.Escape:var h=n;n=0;var d=null;if(h===40&&u===66&&(d=t.ASCII),h===40&&u===74&&(d=t.Roman),h===40&&u===73&&(d=t.Katakana),h===36&&(u===64||u===66)&&(d=t.LeadByte),d!==null){i=i=d;var m=o;return o=!0,m?zr(r):null}return s.prepend([h,u]),o=!1,i=a,zr(r)}}}function KT(e){var r=e.fatal,t={ASCII:0,Roman:1,jis0208:2},i=t.ASCII;this.handler=function(a,n){if(n===Nr&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if(n===Nr&&i===t.ASCII)return it;if((i===t.ASCII||i===t.Roman)&&(n===14||n===15||n===27))return ki(65533);if(i===t.ASCII&&ri(n))return n;if(i===t.Roman&&(ri(n)&&n!==92&&n!==126||n==165||n==8254)){if(ri(n))return n;if(n===165)return 92;if(n===8254)return 126}if(ri(n)&&i!==t.ASCII)return a.prepend(n),i=t.ASCII,[27,40,66];if((n===165||n===8254)&&i!==t.Roman)return a.prepend(n),i=t.Roman,[27,40,74];n===8722&&(n=65293);var o=bs(n,Pa("jis0208"));if(o===null)return ki(n);if(i!==t.jis0208)return a.prepend(n),i=t.jis0208,[27,36,66];var s=_n(o/94)+33,u=o%94+33;return[s,u]}}Da["ISO-2022-JP"]=function(e){return new KT(e)};La["ISO-2022-JP"]=function(e){return new $T(e)};function YT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0;var s=a<127?64:65,u=n<160?129:193;if((Er(a,64,126)||Er(a,128,252))&&(o=(n-u)*188+a-s),Er(o,8836,10715))return 57344-8836+o;var l=o===null?null:vs(o,Pa("jis0208"));return l===null&&ti(a)&&i.prepend(a),l===null?zr(r):l}return ti(a)||a===128?a:Er(a,161,223)?65377-161+a:Er(a,129,159)||Er(a,224,252)?(t=a,null):zr(r)}}function XT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i)||i===128)return i;if(i===165)return 92;if(i===8254)return 126;if(Er(i,65377,65439))return i-65377+161;i===8722&&(i=65293);var a=LT(i);if(a===null)return ki(i);var n=_n(a/188),o=n<31?129:193,s=a%188,u=s<63?64:65;return[n+o,s+u]}}Da.Shift_JIS=function(e){return new XT(e)};La.Shift_JIS=function(e){return new YT(e)};function QT(e){var r=e.fatal,t=0;this.handler=function(i,a){if(a===Nr&&t!==0)return t=0,zr(r);if(a===Nr&&t===0)return it;if(t!==0){var n=t,o=null;t=0,Er(a,65,254)&&(o=(n-129)*190+(a-65));var s=o===null?null:vs(o,Pa("euc-kr"));return o===null&&ti(a)&&i.prepend(a),s===null?zr(r):s}return ti(a)?a:Er(a,129,254)?(t=a,null):zr(r)}}function ZT(e){var r=e.fatal;this.handler=function(t,i){if(i===Nr)return it;if(ri(i))return i;var a=bs(i,Pa("euc-kr"));if(a===null)return ki(i);var n=_n(a/190)+129,o=a%190+65;return[n,o]}}Da["EUC-KR"]=function(e){return new ZT(e)};La["EUC-KR"]=function(e){return new QT(e)};function El(e,r){var t=e>>8,i=e&255;return r?[t,i]:[i,t]}function eb(e,r){var t=r.fatal,i=null,a=null;this.handler=function(n,o){if(o===Nr&&(i!==null||a!==null))return zr(t);if(o===Nr&&i===null&&a===null)return it;if(i===null)return i=o,null;var s;if(e?s=(i<<8)+o:s=(o<<8)+i,i=null,a!==null){var u=a;return a=null,Er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(n.prepend(El(s,e)),zr(t))}return Er(s,55296,56319)?(a=s,null):Er(s,56320,57343)?zr(t):s}}function rb(e,r){var t=r.fatal;this.handler=function(i,a){if(a===Nr)return it;if(Er(a,0,65535))return El(a,e);var n=El((a-65536>>10)+55296,e),o=El((a-65536&1023)+56320,e);return n.concat(o)}}Da["UTF-16BE"]=function(e){return new rb(!0,e)};La["UTF-16BE"]=function(e){return new eb(!0,e)};Da["UTF-16LE"]=function(e){return new rb(!1,e)};La["UTF-16LE"]=function(e){return new eb(!1,e)};function JT(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ti(i)?i:63360+i-128}}function eP(e){var r=e.fatal;this.handler=function(t,i){return i===Nr?it:ri(i)?i:Er(i,63360,63487)?i-63360+128:ki(i)}}Da["x-user-defined"]=function(e){return new eP(e)};La["x-user-defined"]=function(e){return new JT(e)};function Ru(e){return Buffer.from(e).toString("base64")}function Nd(e){return Buffer.from(e,"base64").toString("ascii")}var Qx=Pt(Yx(),1),Zx=Pt(qu(),1);function Xx(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function hC(e,r){let t=r.type?r.type.replace("image/",""):"jpeg",i=(0,Zx.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,Qx.default)(i,t,r)}function Jx(e,r){let t=hC(e,r);return new Promise(i=>{let a=[];t.on("data",n=>a.push(n)),t.on("end",()=>{let n=Buffer.concat(a);i(Xx(n))})})}var O5=Pt(C5(),1),Ug=["image/png","image/jpeg","image/gif"];async function Hg(e,r){if(!r)throw new Error("MIMEType is required to parse image under Node.js");let t=e instanceof Buffer?e:Buffer.from(e);return await jU(t,r)}function jU(e,r){return new Promise(t=>(0,O5.default)(e,r,(i,a)=>{if(i)throw i;let n=[...a.shape],o=a.shape.length===4?a.shape.shift():1,s=a.data instanceof Buffer?new Uint8Array(a.data):a.data;t({shape:n,data:s,width:a.shape[0],height:a.shape[1],components:a.shape[2],layers:o?[o]:[]})}))}async function Gg(e,r,t,i){return i._parse(e,r,t,i)}function zi(e,r){if(!e)throw new Error(r||"loader assertion failed.")}var hn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},AU=hn.self||hn.window||hn.global||{},TU=hn.window||hn.self||hn.global||{},PU=hn.global||hn.self||hn.window||{},RU=hn.document||{};var Jo=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var I5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),CU=I5&&parseFloat(I5[1])||0;function Wg(e,r){return B5(e||{},r)}function B5(e,r,t=0){if(t>3)return r;let i={...e};for(let[a,n]of Object.entries(r))n&&typeof n=="object"&&!Array.isArray(n)?i[a]=B5(i[a]||{},r[a],t+1):i[a]=r[a];return i}var F5="latest";function OU(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.1.2"),globalThis._loadersgl_.version}var Bc=OU();function ma(e,r){if(!e)throw new Error(r||"loaders.gl assertion failed.")}var mn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},_J=mn.self||mn.window||mn.global||{},kJ=mn.window||mn.self||mn.global||{},SJ=mn.global||mn.self||mn.window||{},EJ=mn.document||{};var oa=typeof process!="object"||String(process)!=="[object process]"||process.browser,Fc=typeof importScripts=="function",L5=typeof window<"u"&&typeof window.orientation<"u",D5=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),jJ=D5&&parseFloat(D5[1])||0;var Dc=class{constructor(r,t){this.isRunning=!0;this._resolve=()=>{};this._reject=()=>{};this.name=r,this.workerThread=t,this.result=new Promise((i,a)=>{this._resolve=i,this._reject=a})}postMessage(r,t){this.workerThread.postMessage({source:"loaders.gl",type:r,payload:t})}done(r){ma(this.isRunning),this.isRunning=!1,this._resolve(r)}error(r){ma(this.isRunning),this.isRunning=!1,this._reject(r)}};var So={};Au(So,{NodeWorker:()=>qc,parentPort:()=>Vg});var Lc=Pt(require("worker_threads"),1);Tu(So,require("worker_threads"));var Vg=Lc==null?void 0:Lc.parentPort,qc=Lc.Worker;var $g=new Map;function q5(e){ma(e.source&&!e.url||!e.source&&e.url);let r=$g.get(e.source||e.url);return r||(e.url&&(r=IU(e.url),$g.set(e.url,r)),e.source&&(r=M5(e.source),$g.set(e.source,r))),ma(r),r}function IU(e){if(!e.startsWith("http"))return e;let r=BU(e);return M5(r)}function M5(e){let r=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(r)}function BU(e){return`try {
96
96
  importScripts('${e}');
97
97
  } catch (error) {
98
98
  console.error(error);
99
99
  throw error;
100
- }`}function Mc(e,r=!0,t){let i=t||new Set;if(e){if(z5(e))i.add(e);else if(z5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Mc(e[a],r,i)}}return t===void 0?Array.from(i):[]}function z5(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}var Kg=()=>{},Eo=class{constructor(r){this.terminated=!1;this._loadableURL="";let{name:t,source:i,url:a}=r;ma(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=Kg,this.onError=n=>console.log(n),this.worker=oa?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&oa||typeof qc<"u"&&!oa}destroy(){this.onMessage=Kg,this.onError=Kg,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Mc(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=q5({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;r=new qc(i,{eval:!1})}else if(this.source)r=new qc(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var zc=class{constructor(r){this.name="unnamed";this.maxConcurrency=1;this.maxMobileConcurrency=1;this.onDebug=()=>{};this.reuseWorkers=!0;this.props={};this.jobQueue=[];this.idleQueue=[];this.count=0;this.isDestroyed=!1;this.source=r.source,this.url=r.url,this.setProps(r)}static isSupported(){return Eo.isSupported()}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(a,n,o)=>a.done(o),i=(a,n)=>a.error(n)){let a=new Promise(n=>(this.jobQueue.push({name:r,onMessage:t,onError:i,onStart:n}),this));return this._startQueuedJob(),await a}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let i=new Dc(t.name,r);r.onMessage=a=>t.onMessage(i,a.type,a.payload),r.onError=a=>t.onError(i,a),t.onStart(i);try{await i.result}catch(a){console.error(`Worker exception: ${a}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!oa||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Eo({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return L5?this.maxMobileConcurrency:this.maxConcurrency}};var FU={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Qa=class{constructor(r){this.workerPools=new Map;this.props={...FU},this.setProps(r),this.workerPools=new Map}static isSupported(){return Eo.isSupported()}static getWorkerFarm(r={}){return Qa._workerFarm=Qa._workerFarm||new Qa({}),Qa._workerFarm.setProps(r),Qa._workerFarm}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:i,url:a}=r,n=this.workerPools.get(t);return n||(n=new zc({name:t,source:i,url:a}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};async function es(){return Vg}var Yg=new Map,Za=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await es())}static set onmessage(r){async function t(i){let a=await es(),{type:n,payload:o}=a?i:i.data;r(n,o)}es().then(i=>{i?(i.on("message",t),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=Yg.get(r);t||(t=async a=>{if(!DU(a))return;let n=await es(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await es()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=Yg.get(r);Yg.delete(r),await es()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Mc(t),n=await es();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function DU(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function Xg(e,r={}){let t=r[e.id]||{},i=oa?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(oa?a=`modules/${e.module}/dist/${i}`:a=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!a){let n=e.version;n==="latest"&&(n=F5);let o=n?`@${n}`:"";a=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return ma(a),a}function Qg(e,r=Bc){ma(e,"no worker provided");let t=e.version;return!(!r||!t)}var Jg={};Au(Jg,{readFileAsArrayBuffer:()=>_p,readFileAsText:()=>kp,requireFromFile:()=>Sp,requireFromString:()=>cu});var Zg=Pt(require("module"),1),N5=Pt(require("path"),1),Nc=Pt(require("fs"),1);async function _p(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Nc.readFileSync(e).buffer}async function kp(e){return e.startsWith("http")?await(await fetch(e)).text():Nc.readFileSync(e,"utf8")}async function Sp(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return cu(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await Nc.promises.readFile(e,"utf8");return cu(r)}function cu(e,r="",t){if(typeof r=="object"&&(t=r,r=""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=Zg.default._nodeModulePaths(N5.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new Zg.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var ev={};async function gn(e,r=null,t={},i=null){return r&&(e=U5(e,r,t,i)),ev[e]=ev[e]||LU(e),await ev[e]}function U5(e,r,t={},i=null){if(!t.useLocalLibraries&&e.startsWith("http"))return e;i=i||e;let a=t.modules||{};return a[i]?a[i]:oa?t.CDN?(ma(t.CDN.startsWith("http")),`${t.CDN}/${r}@${Bc}/dist/libs/${i}`):Fc?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function LU(e){if(e.endsWith("wasm"))return await MU(e);if(!oa)try{return Jg&&Sp&&await Sp(e)}catch(t){return console.error(t),null}if(Fc)return importScripts(e);let r=await zU(e);return qU(r,e)}function qU(e,r){if(!oa)return cu&&cu(e,r);if(Fc)return eval.call(globalThis,e),null;let t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}async function MU(e){return oa||!_p||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await _p(e)}async function zU(e){return oa||!kp||e.startsWith("http")?await(await fetch(e)).text():await kp(e)}var NU=0;async function rv(e){await Za.inWorkerThread()&&(Za.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await HU({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:UU}});Za.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Za.postMessage("error",{error:a})}break;default:}})}function UU(e,r,t,i){return new Promise((a,n)=>{let o=NU++,s=(l,f)=>{if(f.id===o)switch(l){case"done":Za.removeEventListener(s),a(f.result);break;case"error":Za.removeEventListener(s),n(f.error);break;default:}};Za.addEventListener(s);let u={id:o,input:e,options:t};Za.postMessage("process",u)})}async function HU({loader:e,arrayBuffer:r,options:t,context:i}){let a,n;if(e.parseSync||e.parse)a=r,n=e.parseSync||e.parse;else if(e.parseTextSync)a=new TextDecoder().decode(r),n=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return t={...t,modules:e&&e.options&&e.options.modules||{},worker:!1},await n(a,{...t},i,e)}function tv(e,r){return!Qa.isSupported()||!oa&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function av(e,r,t,i,a){let n=e.id,o=Xg(e,t),u=Qa.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let l=await u.startJob("process-on-worker",GU.bind(null,a));return l.postMessage("process",{input:r,options:t,context:i}),await(await l.result).result}async function GU(e,r,t,i){switch(t){case"done":r.done(i);break;case"error":r.error(new Error(i.error));break;case"process":let{id:a,input:n,options:o}=i;try{let s=await e(n,o);r.postMessage("done",{id:a,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:u})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function iv(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let i=new Uint8Array(e),a=new Uint8Array(r);for(let n=0;n<i.length;++n)if(i[n]!==a[n])return!1;return!0}function nv(...e){return H5(e)}function H5(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}async function Uc(e){let r=[];for await(let t of e)r.push(t);return nv(...r)}function jo(e){return jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},jo(e)}function ov(e,r){if(jo(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var i=t.call(e,r||"default");if(jo(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function sv(e){var r=ov(e,"string");return jo(r)==="symbol"?r:String(r)}function ht(e,r,t){return r=sv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var WU="",G5={};function rs(e){for(let r in G5)if(e.startsWith(r)){let t=G5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${WU}${e}`),e}function W5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function V5(e){return e&&typeof e=="object"&&e.isBuffer}function Ep(e){if(V5(e))return W5(e);if(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"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var ts={};Au(ts,{dirname:()=>KU,filename:()=>$U,join:()=>YU,resolve:()=>XU});function $5(){var r;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(r=window.location)==null?void 0:r.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function $U(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function KU(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function YU(...e){let r="/";return e=e.map((t,i)=>(i&&(t=t.replace(new RegExp(`^${r}`),"")),i!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function XU(...e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n];let t="",i=!1,a;for(let n=r.length-1;n>=-1&&!i;n--){let o;n>=0?o=r[n]:(a===void 0&&(a=$5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Hc)}return t=QU(t,!i),i?`/${t}`:t.length>0?t:"."}var Hc=47,uv=46;function QU(e,r){let t="",i=-1,a=0,n,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===Hc)break;n=Hc}if(n===Hc){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==uv||t.charCodeAt(t.length-2)!==uv){if(t.length>2){let u=t.length-1,l=u;for(;l>=0&&t.charCodeAt(l)!==Hc;--l);if(l!==u){t=l===-1?"":t.slice(0,l),i=s,a=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",i=s,a=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{let u=e.slice(i+1,s);t.length>0?t+=`/${u}`:t=u,o=!1}i=s,a=0}else n===uv&&a!==-1?++a:a=-1}return t}var Mn=Pt(require("fs"),1),as=class{constructor(r,t,i){r=rs(r),this.handle=Mn.default.openSync(r,t,i);let a=Mn.default.fstatSync(this.handle,{bigint:!0});this.size=Number(a.size),this.bigsize=a.size,this.url=r}async close(){return new Promise((r,t)=>{Mn.default.close(this.handle,i=>i?t(i):r())})}async truncate(r){return new Promise((t,i)=>{Mn.default.ftruncate(this.handle,r,a=>{a?i(a):(this.bigsize=BigInt(r),this.size=Number(this.bigsize),t())})})}async append(r){return new Promise((t,i)=>{Mn.default.appendFile(this.handle,r,a=>{a?i(a):(this.bigsize=this.bigsize+BigInt(r.length),this.size=Number(this.bigsize),t())})})}async stat(){return await new Promise((r,t)=>Mn.default.fstat(this.handle,{bigint:!0},(i,a)=>{let n={size:Number(a.size),bigsize:a.size,isDirectory:a.isDirectory()};i?t(i):r(n)}))}async read(r,t){let i=new ArrayBuffer(t),a=BigInt(r),n=0,o=new Uint8Array(i),s;for(;t>0;){let u=await ZU(this.handle,o,0,t,a);if(u===0)break;n+=u,a+=BigInt(u),t-=u,s!==void 0&&(s+=u)}return n<t?i.slice(0,n):i}async write(r,t=0,i=r.byteLength){return new Promise((a,n)=>{let o=Number(t),s=new Uint8Array(r,Number(t),i);Mn.default.write(this.handle,s,0,i,o,(u,l)=>u?n(u):a(l))})}};async function ZU(e,r,t,i,a){return await new Promise((n,o)=>Mn.default.read(e,r,t,i,a,(s,u)=>s?o(s):n(u)))}var Pp=Pt(require("fs/promises"),1);var lv=Pt(require("fs"),1),cv=require("stream");var jp=Pt(require("zlib"),1),JU=e=>e&&e instanceof ArrayBuffer,eH=e=>e&&e instanceof Buffer;function Ap(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(jp.default.createBrotliDecompress());case"gzip":return e.pipe(jp.default.createGunzip());case"deflate":return e.pipe(jp.default.createDeflate());default:return e}}async function K5(e){let r=[];return await new Promise((t,i)=>{e.on("error",a=>i(a)),e.on("readable",()=>e.read()),e.on("data",a=>{typeof a=="string"&&i(new Error("Read stream not binary")),r.push(tH(a))}),e.on("end",()=>{let a=rH(r);t(a)})})}function rH(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}function tH(e){if(JU(e))return e;if(eH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var aH=e=>typeof e=="boolean",Y5=e=>typeof e=="function",iH=e=>e!==null&&typeof e=="object",nH=e=>iH(e)&&Y5(e.read)&&Y5(e.pipe)&&aH(e.readable);async function Tp(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=rs(i);let a=new Headers;e.endsWith(".gz")&&(a["content-encoding"]="gzip"),e.endsWith(".br")&&(a["content-encoding"]="br");try{let n=await new Promise((h,d)=>{let m=lv.default.createReadStream(i,{encoding:null});m.once("readable",()=>h(m)),m.on("error",y=>d(y))}),o=n;nH(n)?o=Ap(n,a):typeof n=="string"?o=cv.Readable.from([new TextEncoder().encode(n)]):o=cv.Readable.from([n||new ArrayBuffer(0)]);let s=200,u="OK",l=oH(i),f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}catch(n){let o=n.message,s=400,u=o,l={},f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}}function oH(e){let r={};if(!r["content-length"]){let t=lv.default.statSync(e);r["content-length"]=t.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip"),new Headers(r)}var Rp=class{constructor(){this.readable=!0;this.writable=!0}async readdir(r=".",t){return await Pp.default.readdir(r,t)}async stat(r){let t=await Pp.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Pp.default.unlink(r)}async fetch(r,t){return await Tp(r,t)}async openReadableFile(r,t="r"){return new as(r,t)}async openWritableFile(r,t="w",i){return new as(r,t,i)}};var Gc=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let u of r)i.push(u),yield u;let a=await this.concatenate(i),n=await this.hash(a,t);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:n})}async concatenate(r){return await Uc(r)}};var Wc=Pt(require("crypto"),1),Cp=class extends Gc{constructor(t){var i,a;super();this.name="crypto-node";if(this.options=t,!((a=(i=this.options)==null?void 0:i.crypto)!=null&&a.algorithm))throw new Error(this.name)}async hash(t,i){var n,o,s,u;let a=(s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!Wc.createHash)throw new Error("crypto.createHash not available");let l=(u=Wc.createHash)==null?void 0:u(a),f=new Uint8Array(t);return l.update(f).digest("base64")}catch(l){throw Error(`${a} hash not available. ${l}`)}}async*hashBatches(t,i="base64"){var o,s,u,l,f,h,d;if(!Wc.createHash)throw new Error("crypto.createHash not available");let a=(l=Wc.createHash)==null?void 0:l((u=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:u.toLowerCase());for await(let m of t){let y=new Uint8Array(m);a.update(y),yield m}let n=a.digest(i);(d=(h=(f=this.options)==null?void 0:f.crypto)==null?void 0:h.onEnd)==null||d.call(h,{hash:n})}};var l4=require("node:process");var X5=Pt(require("stream"),1),fv=class{},sH=X5.Readable||fv;function dv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new pv(t,r)}var pv=class extends sH{constructor(t,i){super(i);this._iterator=t,this._pulling=!1,this._bytesMode=!i||!i.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,i){var a,n,o,s;this._iterator&&(t?await((n=(a=this._iterator)==null?void 0:a.throw)==null?void 0:n.call(a,t)):await((s=(o=this._iterator)==null?void 0:o.return)==null?void 0:s.call(o,t)),i==null||i(null))}async _pull(t,i){var o;let a=this._bytesMode,n=null;for(;this.readable&&!(n=await i.next()).done&&(t!==null&&(t-=a&&ArrayBuffer.isView(n.value)?n.value.byteLength:1),!(!this.push(new Uint8Array(n.value))||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null)||!0)&&((o=i==null?void 0:i.return)==null||o.call(i)),!this.readable}};var J5=Pt(Z5(),1);delete globalThis.ReadableStream;var Ip=class extends J5.ReadableStream{};var Bp=class{constructor(r){this.isWorking=!1;this.isCancelled=!1;this.chunks=r}start(r){this.work(r)}async work(r){let{chunks:t}=this;for(this.isWorking=!0;!this.isCancelled&&(r.desiredSize||0)>0;){let i;try{i=t.next()}catch(a){r.error(a);break}i&&(!i.done&&!this.isCancelled?r.enqueue(i.value):r.close())}this.isWorking=!1}pull(r){this.isWorking||this.work(r)}cancel(){this.isCancelled=!0}};var Fp=class extends Ip{constructor(t){super(new Bp(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let i=this.getReader();yield*this._chunks,i.releaseLock()}};var is=class{constructor(r=[],t={}){this.parts=[],this.size=0;for(let i of r)if(typeof i=="string"){let a=new TextEncoder().encode(i);this.parts.push(a),this.size+=a.byteLength}else if(i instanceof is)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:a,byteOffset:n,byteLength:o}=i;this.parts.push(new Uint8Array(a,n,o)),this.size+=o}else{let a=new TextEncoder().encode(String(i));this.parts.push(a),this.size+=a.byteLength}this.type=uH(t.type)}slice(r=0,t=this.size,i=""){let{size:a,parts:n}=this,o=r<0?Math.max(a+r,0):Math.min(r,a),s=t<0?Math.max(a+t,0):Math.min(t,a),u=Math.max(s-o,0),l=new is([],{type:i});if(u===0)return l;let f=0,h=[];for(let d of n){let{byteLength:m}=d;if(o>0&&m<=o)o-=m,s-=m;else{let y=d.subarray(o,Math.min(m,s));if(h.push(y),f+=y.byteLength,o=0,f>=u)break}}return l.parts=h,l.size=f,l}async arrayBuffer(){return this._toArrayBuffer()}async text(){let r=new TextDecoder,t="";for(let i of this.parts)t+=r.decode(i);return t}stream(){return new Fp(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let r=new ArrayBuffer(this.size),t=new Uint8Array(r),i=0;for(let a of this.parts)t.set(a,i),i+=a.byteLength;return r}};function uH(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function cH(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=is),globalThis.Blob}var lH=cH();var Dp=class{constructor(){this.onload=null}abort(){}async readAsArrayBuffer(r){let t=await r.arrayBuffer();this.onload&&this.onload({target:{result:t}})}async readAsBinaryString(r){throw Error("Not implemented")}async readAsDataURL(r){let t=await r.text(),i=`data://;base64,${Ru(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var Lp=class extends globalThis.Blob{constructor(t,i,a={}){super(t,a);this.name="";this.webkitRelativePath="";this.name=String(i).replace(/\//g,":"),this.lastModified=(a==null?void 0:a.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function e4(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Dp),typeof File>"u"&&!globalThis.File&&(globalThis.File=Lp),global}var fH=e4();var hv=Pt(require("module"),1),r4=Pt(require("path"),1),Mp=Pt(require("fs"),1);async function t4(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Mp.default.readFileSync(e).buffer}async function a4(e){return e.startsWith("http")?await(await fetch(e)).text():Mp.default.readFileSync(e,"utf8")}async function i4(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return qp(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await Mp.default.readFileSync(e,"utf8");return qp(r)}function qp(e,r="",t){if(typeof r=="object"&&(t=r,r=""),r=r.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=hv.default._nodeModulePaths(r4.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new hv.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var Ni=class{constructor(r){this.map={},r instanceof Ni?r.forEach((t,i)=>this.append(i,t)):Array.isArray(r)?r.forEach(t=>this.append(t[0],t[1])):r&&Object.getOwnPropertyNames(r).forEach(t=>this.append(t,r[t]))}append(r,t){r=Vc(r),t=n4(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[Vc(r)]}get(r){return r=Vc(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(Vc(r))}set(r,t){this.map[Vc(r)]=n4(t)}forEach(r,t=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(t?r.call(t,this.map[i],i,this):r(this.map[i],i,this))}keys(){let r=[];return this.forEach(function(t,i){r.push(i)}),mv(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),mv(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),mv(r)}*[Symbol.iterator](){yield*this.entries()}};function Vc(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||e==="")throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n4(e){return typeof e!="string"&&(e=String(e)),e}function mv(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function gv(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var bv=Pt(require("stream"),1),pH=e=>typeof e=="boolean",o4=e=>typeof e=="function",dH=e=>e!==null&&typeof e=="object",vv=e=>dH(e)&&o4(e.read)&&o4(e.pipe)&&pH(e.readable),zn=class{constructor(r,t){this.bodyUsed=!1;let{headers:i,status:a=200,statusText:n="OK",url:o}=t||{};this.url=o,this.ok=a===200,this.status=a,this.statusText=n,this.headers=new Ni((t==null?void 0:t.headers)||{}),vv(r)?this._body=Ap(r,i):typeof r=="string"?this._body=bv.Readable.from([new TextEncoder().encode(r)]):this._body=bv.Readable.from([r||new ArrayBuffer(0)])}get body(){return gv(!this.bodyUsed),gv(vv(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return vv(this._body)?await K5(this._body):this._body||new ArrayBuffer(0)}async text(){let r=await this.arrayBuffer();return new TextDecoder().decode(r)}async json(){let r=await this.text();return JSON.parse(r)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var u4=Pt(require("http"),1),c4=Pt(require("https"),1);var hH=e=>e&&e instanceof ArrayBuffer,mH=e=>e&&e instanceof Buffer;function s4(e){let r=e.indexOf(","),t,i;return e.slice(r-7,r)===";base64"?(t=Buffer.from(e.slice(r+1),"base64"),i=e.slice(5,r-7).trim()):(t=Buffer.from(decodeURIComponent(e.slice(r+1))),i=e.slice(5,r).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:gH(t),mimeType:i}}function gH(e){if(hH(e))return e;if(mH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var yv=e=>e.startsWith("data:"),vH=e=>e.startsWith("http:")||e.startsWith("https:");async function $c(e,r){try{if(globalThis.fetch!==$c&&(vH(e)||yv(e)))return await fetch(e,r);if(yv(e)){let{arrayBuffer:l,mimeType:f}=s4(e);return new zn(l,{headers:{"content-type":f},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await bH(i,r),n=_H(e,a,t),{status:o,statusText:s}=wH(a),u=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&u){let l=yH(e,n.get("location"));return await $c(l,r)}return new zn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new zn(null,{status:400,statusText:String(t),url:e})}}async function bH(e,r){return await new Promise((t,i)=>{let a=xH(e,r),n=e.startsWith("https:")?c4.default.request(a,o=>t(o)):u4.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function yH(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function xH(e,r){let t=(r==null?void 0:r.headers)||{},i={};for(let n of Object.keys(t))i[n.toLowerCase()]=t[n];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let a=new URL(e);return{hostname:a.hostname,path:a.pathname,method:"GET",...r,...r==null?void 0:r.fetch,headers:i,port:a.port}}function wH(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function _H(e,r,t={}){let i={};if(r&&r.headers){let a=r.headers;for(let n in a){let o=a[n];i[n.toLowerCase()]=String(o)}}if(!i["content-length"]){let a=kH(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ni(i)}function kH(e){return yv(e)?e.length-5:null}var SH=parseInt(l4.versions.node.split(".")[0]);K1&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=dv;globalThis.loaders.NodeFile=as;globalThis.loaders.NodeFileSystem=Rp;globalThis.loaders.fetchNode=Tp;globalThis.loaders.NodeHash=Cp;globalThis.TextEncoder||(globalThis.TextEncoder=Pu);globalThis.TextDecoder||(globalThis.TextDecoder=Bo);!("atob"in globalThis)&&Ru&&(globalThis.atob=Ru);!("btoa"in globalThis)&&Nd&&(globalThis.btoa=Nd);globalThis.loaders.encodeImageNode=Jx;globalThis.loaders.parseImageNode=Hg;globalThis.loaders.imageFormatsNode=Ug;globalThis._parseImageNode=Hg;globalThis._imageFormatsNode=Ug;globalThis.loaders.readFileAsArrayBuffer=t4;globalThis.loaders.readFileAsText=a4;globalThis.loaders.requireFromFile=i4;globalThis.loaders.requireFromString=qp;SH<18&&(!("Headers"in globalThis)&&Ni&&(globalThis.Headers=Ni),!("Response"in globalThis)&&zn&&(globalThis.Response=zn),!("fetch"in globalThis)&&$c&&(globalThis.fetch=$c));var EH=e=>typeof e=="boolean",Kc=e=>typeof e=="function",ns=e=>e!==null&&typeof e=="object",xv=e=>ns(e)&&e.constructor==={}.constructor;var f4=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",p4=e=>e&&typeof e[Symbol.asyncIterator]=="function";var di=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var hi=e=>typeof Blob<"u"&&e instanceof Blob,d4=e=>e&&typeof e=="object"&&e.isBuffer;var jH=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||ns(e)&&Kc(e.tee)&&Kc(e.cancel)&&Kc(e.getReader);var AH=e=>ns(e)&&Kc(e.read)&&Kc(e.pipe)&&EH(e.readable),zp=e=>jH(e)||AH(e);var TH=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,PH=/^([-\w.]+\/[-\w.+]+)/;function h4(e){let r=PH.exec(e);return r?r[1]:e}function wv(e){let r=TH.exec(e);return r?r[1]:""}var m4=/\?.*/;function g4(e){let r=e.match(m4);return r&&r[0]}function lu(e){return e.replace(m4,"")}function os(e){return di(e)?e.url:hi(e)?e.name||"":typeof e=="string"?e:""}function Yc(e){if(di(e)){let r=e,t=r.headers.get("content-type")||"",i=lu(r.url);return h4(t)||wv(i)}return hi(e)?e.type||"":typeof e=="string"?wv(e):""}function v4(e){return di(e)?e.headers["content-length"]||-1:hi(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Np(e){if(di(e))return e;let r={},t=v4(e);t>=0&&(r["content-length"]=String(t));let i=os(e),a=Yc(e);a&&(r["content-type"]=a);let n=await CH(e);n&&(r["x-first-bytes"]=n),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:r});return Object.defineProperty(o,"url",{value:i}),o}async function b4(e){if(!e.ok){let r=await RH(e);throw new Error(r)}}async function RH(e){let r=`Failed to fetch resource ${e.url} (${e.status}): `;try{let t=e.headers.get("Content-Type"),i=e.statusText;t!=null&&t.includes("application/json")&&(i+=` ${await e.text()}`),r+=i,r=r.length>60?`${r.slice(0,60)}...`:r}catch{}return r}async function CH(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(i=>{let a=new FileReader;a.onload=n=>{var o;return i((o=n==null?void 0:n.target)==null?void 0:o.result)},a.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${OH(t)}`}return null}function OH(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function IH(e){return!BH(e)&&!FH(e)}function BH(e){return e.startsWith("http:")||e.startsWith("https:")}function FH(e){return e.startsWith("data:")}async function _v(e,r){var t,i;if(typeof e=="string"){let a=rs(e);return IH(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await Np(e)}function kv(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let r=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function Ui(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||kv()}var DH=globalThis.self||globalThis.window||globalThis.global,fu=globalThis.window||globalThis.self||globalThis.global,LH=globalThis.document||{},ss=globalThis.process||{},qH=globalThis.console,Cte=globalThis.navigator||{};var Up="4.1.1",Bte=Ui();function MH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var Hp=class{constructor(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";ht(this,"storage",void 0),ht(this,"id",void 0),ht(this,"config",void 0),this.storage=MH(i),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function y4(e){let r;return e<10?r="".concat(e.toFixed(2),"ms"):e<100?r="".concat(e.toFixed(1),"ms"):e<1e3?r="".concat(e.toFixed(0),"ms"):r="".concat((e/1e3).toFixed(2),"s"),r}function x4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,t=Math.max(r-e.length,0);return"".concat(" ".repeat(t)).concat(e)}function Gp(e,r,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,a=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(t=Math.min(t,i/e.width));let n=e.width*t,o=e.height*t,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(n/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(a,");"),"background-size:".concat(n,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var Wp;(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"})(Wp||(Wp={}));var zH=10;function w4(e){return typeof e!="string"?e:(e=e.toUpperCase(),Wp[e]||Wp.WHITE)}function _4(e,r,t){if(!Ui&&typeof e=="string"){if(r){let i=w4(r);e="\x1B[".concat(i,"m").concat(e,"\x1B[39m")}if(t){let i=w4(t);e="\x1B[".concat(i+zH,"m").concat(e,"\x1B[49m")}}return e}function k4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],t=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(t),a=e;for(let n of i){let o=a[n];typeof o=="function"&&(r.find(s=>n===s)||(a[n]=o.bind(e)))}}function pu(e,r){if(!e)throw new Error(r||"Assertion failed")}function us(){let e;if(Ui()&&fu.performance){var r,t;e=fu===null||fu===void 0||(r=fu.performance)===null||r===void 0||(t=r.now)===null||t===void 0?void 0:t.call(r)}else if("hrtime"in ss){var i;let a=ss===null||ss===void 0||(i=ss.hrtime)===null||i===void 0?void 0:i.call(ss);e=a[0]*1e3+a[1]/1e6}else e=Date.now();return e}var du={debug:Ui()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},NH={enabled:!0,level:0};function mi(){}var S4={},E4={once:!0},vn=class{constructor(){let{id:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};ht(this,"id",void 0),ht(this,"VERSION",Up),ht(this,"_startTs",us()),ht(this,"_deltaTs",us()),ht(this,"_storage",void 0),ht(this,"userData",{}),ht(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this.userData={},this._storage=new Hp("__probe-".concat(this.id,"__"),NH),this.timeStamp("".concat(this.id," started")),k4(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((us()-this._startTs).toPrecision(10))}getDelta(){return Number((us()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,t){this._storage.setConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){pu(r,t)}warn(r){return this._getLogFunction(0,r,du.warn,arguments,E4)}error(r){return this._getLogFunction(0,r,du.error,arguments)}deprecated(r,t){return this.warn("`".concat(r,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(r,t){return this.error("`".concat(r,"` has been removed. Use `").concat(t,"` instead"))}probe(r,t){return this._getLogFunction(r,t,du.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,du.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,du.debug||du.info,arguments,E4)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||mi,i&&[i],{tag:WH(t)}):mi}image(r){let{logLevel:t,priority:i,image:a,message:n="",scale:o=1}=r;return this._shouldLog(t||i)?Ui()?GH({image:a,message:n,scale:o}):HH({image:a,message:n,scale:o}):mi}time(r,t){return this._getLogFunction(r,t,console.time?console.time:console.info)}timeEnd(r,t){return this._getLogFunction(r,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,t){return this._getLogFunction(r,t,console.timeStamp||mi)}group(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},a=j4({logLevel:r,message:t,opts:i}),{collapsed:n}=i;return a.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}groupCollapsed(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||mi)}withGroup(r,t,i){this.group(r,t)();try{i()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=A4(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=j4({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,pu(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=us();let o=n.tag||n.message;if(n.once&&o)if(!S4[o])S4[o]=us();else return mi;return t=UH(this.id,n.message,n),i.bind(console,t,...n.args)}return mi}};ht(vn,"VERSION",Up);function A4(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return pu(Number.isFinite(r)&&r>=0),r}function j4(e){let{logLevel:r,message:t}=e;e.logLevel=A4(r);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&i.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let a=typeof e.message;return pu(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function UH(e,r,t){if(typeof r=="string"){let i=t.time?x4(y4(t.total)):"";r=t.time?"".concat(e,": ").concat(i," ").concat(r):"".concat(e,": ").concat(r),r=_4(r,t.color,t.background)}return r}function HH(e){let{image:r,message:t="",scale:i=1}=e;return console.warn("removed"),mi}function GH(e){let{image:r,message:t="",scale:i=1}=e;if(typeof r=="string"){let n=new Image;return n.onload=()=>{let o=Gp(n,t,i);console.log(...o)},n.src=r,mi}let a=r.nodeName||"";if(a.toLowerCase()==="img")return console.log(...Gp(r,t,i)),mi;if(a.toLowerCase()==="canvas"){let n=new Image;return n.onload=()=>console.log(...Gp(n,t,i)),n.src=r.toDataURL(),mi}return mi}function WH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}var sae=new vn({id:"@probe.gl/log"});var Sv=new vn({id:"loaders.gl"}),Vp=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},$p=class{constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var Ev={fetch:null,mimeType:void 0,nothrow:!1,log:new $p,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Jo,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},T4={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 jv(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function Av(){let e=jv();return e.globalOptions=e.globalOptions||{...Ev},e.globalOptions}function C4(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],VH(e,t),KH(r,e,i)}function VH(e,r){P4(e,null,Ev,T4,r);for(let t of r){let i=e&&e[t.id]||{},a=t.options&&t.options[t.id]||{},n=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};P4(i,t.id,a,n,r)}}function P4(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let u=!r&&ns(e[s]),l=s==="baseUri"&&!r,f=s==="workerUrl"&&r;if(!(s in t)&&!l&&!f){if(s in i)Sv.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let h=$H(s,a);Sv.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function $H(e,r){let t=e.toLowerCase(),i="";for(let a of r)for(let n in a.options){if(e===n)return`Did you mean '${a.id}.${n}'?`;let o=n.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${a.id}.${n}'?`)}return i}function KH(e,r,t){let a={...e.options||{}};return YH(a,t),a.log===null&&(a.log=new Vp),R4(a,Av()),R4(a,r),a}function R4(e,r){for(let t in r)if(t in r){let i=r[t];xv(i)&&xv(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function YH(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function Xc(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function Tv(e){zi(e,"null loader"),zi(Xc(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var XH=()=>{let e=jv();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function O4(){return XH()}var I4=new vn({id:"loaders.gl"});var QH=/\.([^.]+)$/;async function D4(e,r=[],t,i){if(!L4(e))return null;let a=B4(e,r,{...t,nothrow:!0},i);if(a)return a;if(hi(e)&&(e=await e.slice(0,10).arrayBuffer(),a=B4(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(q4(e));return a}function B4(e,r=[],t,i){if(!L4(e))return null;if(r&&!Array.isArray(r))return Tv(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...O4()),JH(a);let n=ZH(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(q4(e));return n}function ZH(e,r,t,i){let a=os(e),n=Yc(e),o=lu(a)||(i==null?void 0:i.url),s=null,u="";return t!=null&&t.mimeType&&(s=Pv(r,t==null?void 0:t.mimeType),u=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||eG(r,o),u=u||(s?`matched url ${o}`:""),s=s||Pv(r,n),u=u||(s?`matched MIME type ${n}`:""),s=s||tG(r,e),u=u||(s?`matched initial data ${M4(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||Pv(r,t==null?void 0:t.fallbackMimeType),u=u||(s?`matched fallback MIME type ${n}`:"")),u&&I4.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function L4(e){return!(e instanceof Response&&e.status===204)}function q4(e){let r=os(e),t=Yc(e),i="No valid loader found (";i+=r?`${ts.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?M4(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function JH(e){for(let r of e)Tv(r)}function eG(e,r){let t=r&&QH.exec(r),i=t&&t[1];return i?rG(e,i):null}function rG(e,r){r=r.toLowerCase();for(let t of e)for(let i of t.extensions)if(i.toLowerCase()===r)return t;return null}function Pv(e,r){for(let t of e)if(t.mimeTypes&&t.mimeTypes.includes(r)||r===`application/x.${t.id}`)return t;return null}function tG(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(aG(r,t))return t}else if(ArrayBuffer.isView(r)){if(F4(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&F4(r,0,t))return t;return null}function aG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function F4(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>iG(e,r,t,a))}function iG(e,r,t,i){if(i instanceof ArrayBuffer)return iv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=Rv(e,r,i.length);return i===a;default:return!1}}function M4(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?Rv(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?Rv(e,0,r):""}function Rv(e,r,t){if(e.byteLength<r+t)return"";let i=new DataView(e),a="";for(let n=0;n<t;n++)a+=String.fromCharCode(i.getUint8(r+n));return a}function*z4(e,r){let t=(r==null?void 0:r.chunkSize)||262144,i=0,a=new TextEncoder;for(;i<e.length;){let n=Math.min(e.length-i,t),o=e.slice(i,i+n);i+=n,yield a.encode(o)}}function*N4(e,r={}){let{chunkSize:t=262144}=r,i=0;for(;i<e.byteLength;){let a=Math.min(e.byteLength-i,t),n=new ArrayBuffer(a),o=new Uint8Array(e,i,a);new Uint8Array(n).set(o),i+=a,yield n}}async function*U4(e,r){let t=(r==null?void 0:r.chunkSize)||1048576,i=0;for(;i<e.size;){let a=i+t,n=await e.slice(i,a).arrayBuffer();i=a,yield n}}function Cv(e,r){return Jo?nG(e,r):oG(e,r)}async function*nG(e,r){let t=e.getReader(),i;try{for(;;){let a=i||t.read();r!=null&&r._streamReadAhead&&(i=t.read());let{done:n,value:o}=await a;if(n)return;yield Ep(o)}}catch{t.releaseLock()}}async function*oG(e,r){for await(let t of e)yield Ep(t)}function H4(e,r){if(typeof e=="string")return z4(e,r);if(e instanceof ArrayBuffer)return N4(e,r);if(hi(e))return U4(e,r);if(zp(e))return Cv(e,r);if(di(e))return Cv(e.body,r);throw new Error("makeIterator")}var G4="Cannot convert supplied data type";function sG(e,r,t){if(r.text&&typeof e=="string")return e;if(d4(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return r.text&&!r.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(r.text&&!r.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,a=e.byteLength||e.length;return(e.byteOffset!==0||a!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+a)),i}throw new Error(G4)}async function W4(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return sG(e,r,t);if(hi(e)&&(e=await Np(e)),di(e)){let a=e;return await b4(a),r.binary?await a.arrayBuffer():await a.text()}if(zp(e)&&(e=H4(e,t)),f4(e)||p4(e))return Uc(e);throw new Error(G4)}function Kp(e,r){let t=Av(),i=e||t;return typeof i.fetch=="function"?i.fetch:ns(i.fetch)?a=>_v(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:_v}function V4(e,r,t){if(t)return t;let i={fetch:Kp(r,e),...e};if(i.url){let a=lu(i.url);i.baseUrl=a,i.queryString=g4(i.url),i.filename=ts.filename(a),i.baseUrl=ts.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function $4(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let i=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...i]:i}return t&&t.length?t:void 0}async function Nn(e,r,t,i){r&&!Array.isArray(r)&&!Xc(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=os(e),o=$4(r,i),s=await D4(e,o,t);return s?(t=C4(t,s,o,a),i=V4({url:a,_parse:Nn,loaders:o},t,i||null),await uG(s,e,t,i)):null}async function uG(e,r,t,i){if(Qg(e),t=Wg(e.options,t),di(r)){let n=r,{ok:o,redirected:s,status:u,statusText:l,type:f,url:h}=n,d=Object.fromEntries(n.headers.entries());i.response={headers:d,ok:o,redirected:s,status:u,statusText:l,type:f,url:h}}r=await W4(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(tv(e,t))return await av(e,r,t,i,Nn);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw ma(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function K4(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Ov(e){let r=1/0,t=1/0,i=1/0,a=-1/0,n=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let l=0;l<u;l+=3){let f=s[l],h=s[l+1],d=s[l+2];r=f<r?f:r,t=h<t?h:t,i=d<i?d:i,a=f>a?f:a,n=h>n?h:n,o=d>o?d:o}return[[r,t,i],[a,n,o]]}function Iv(e,r,t){let i=K4(r.value),a=t||Y4(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function Y4(e){let r={};return"byteOffset"in e&&(r.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(r.byteStride=e.byteStride.toString(10)),"normalized"in e&&(r.normalized=e.normalized.toString()),r}async function Bv(e,r,t,i){let a,n;!Array.isArray(r)&&!Xc(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=Kp(n),s=e;return typeof e=="string"&&(s=await o(e)),hi(e)&&(s=await o(e)),Array.isArray(a)?await Nn(s,a,n):await Nn(s,a,n)}var cG=1/Math.PI*180,lG=1/180*Math.PI,fG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...fG}};var Bt=globalThis.mathgl.config;function Fv(e,{precision:r=Bt.precision}={}){return e=pG(e),"".concat(parseFloat(e.toPrecision(r)))}function Ao(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Dv(e){return X4(e)}function Lv(e){return Q4(e)}function X4(e,r){return Z4(e,t=>t*lG,r)}function Q4(e,r){return Z4(e,t=>t*cG,r)}function Un(e,r,t){let i=Bt.EPSILON;t&&(Bt.EPSILON=t);try{if(e===r)return!0;if(Ao(e)&&Ao(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Un(e[a],r[a]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=Bt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{Bt.EPSILON=i}}function pG(e){return Math.round(e/Bt.EPSILON)*Bt.EPSILON}function dG(e){return e.clone?e.clone():new Array(e.length)}function Z4(e,r,t){if(Ao(e)){let i=e;t=t||dG(i);for(let a=0;a<t.length&&a<i.length;++a){let n=typeof e=="number"?e:e[a];t[a]=r(n,a,t)}return t}return r(e)}function hG(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var hu=class extends hG(Array){clone(){return new this.constructor().copy(this)}fromArray(r,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=r[i+t];return this.check()}toArray(r=[],t=0){for(let i=0;i<this.ELEMENTS;++i)r[t+i]=this[i];return r}toObject(r){return r}from(r){return Array.isArray(r)?this.copy(r):this.fromObject(r)}to(r){return r===this?this:Ao(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Bt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+Fv(this[i],r);return"".concat(r.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Un(this[t],r[t]))return!1;return!0}exactEquals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==r[t])return!1;return!0}negate(){for(let r=0;r<this.ELEMENTS;++r)this[r]=-this[r];return this.check()}lerp(r,t,i){if(i===void 0)return this.lerp(this,r,t);for(let a=0;a<this.ELEMENTS;++a){let n=r[a],o=typeof t=="number"?t:t[a];this[a]=n+i*(o-n)}return this.check()}min(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(r[t],this[t]);return this.check()}max(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(r[t],this[t]);return this.check()}clamp(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r[i]),t[i]);return this.check()}add(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]+=t[i];return this.check()}subtract(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]-=t[i];return this.check()}scale(r){if(typeof r=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;else for(let t=0;t<this.ELEMENTS&&t<r.length;++t)this[t]*=r[t];return this.check()}multiplyByScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}check(){if(Bt.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let r=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)r=r&&Number.isFinite(this[t]);return r}sub(r){return this.subtract(r)}setScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=r;return this.check()}addScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]+=r;return this.check()}subScalar(r){return this.addScalar(-r)}multiplyScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}divideScalar(r){return this.multiplyByScalar(1/r)}clampScalar(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r),t);return this.check()}get elements(){return this}};function mG(e,r){if(e.length!==r)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function Aa(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Yp(e,r,t=""){if(Bt.debug&&!mG(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}function gi(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}var Xp=class extends hu{get x(){return this[0]}set x(r){this[0]=Aa(r)}get y(){return this[1]}set y(r){this[1]=Aa(r)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let r=0;for(let t=0;t<this.ELEMENTS;++t)r+=this[t]*this[t];return r}magnitudeSquared(){return this.lengthSquared()}distance(r){return Math.sqrt(this.distanceSquared(r))}distanceSquared(r){let t=0;for(let i=0;i<this.ELEMENTS;++i){let a=this[i]-r[i];t+=a*a}return Aa(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return Aa(t)}normalize(){let r=this.magnitude();if(r!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=r;return this.check()}multiply(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]*=t[i];return this.check()}divide(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]/=t[i];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(r){return this.distance(r)}distanceToSquared(r){return this.distanceSquared(r)}getComponent(r){return gi(r>=0&&r<this.ELEMENTS,"index is out of range"),Aa(this[r])}setComponent(r,t){return gi(r>=0&&r<this.ELEMENTS,"index is out of range"),this[r]=t,this.check()}addVectors(r,t){return this.copy(r).add(t)}subVectors(r,t){return this.copy(r).subtract(t)}multiplyVectors(r,t){return this.copy(r).multiply(t)}addScaledVector(r,t){return this.add(new this.constructor(r).multiplyScalar(t))}};var Hi=typeof Float32Array<"u"?Float32Array:Array,Qc=Math.random;function mu(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Uie=Math.PI/180;function gG(){let e=new Hi(2);return Hi!=Float32Array&&(e[0]=0,e[1]=0),e}function J4(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[4]*a+t[12],e[1]=t[1]*i+t[5]*a+t[13],e}var Hie=function(){let e=gG();return function(r,t,i,a,n,o){let s,u;for(t||(t=2),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],n(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function ej(e,r,t){let i=r[0],a=r[1],n=t[3]*i+t[7]*a||1;return e[0]=(t[0]*i+t[4]*a)/n,e[1]=(t[1]*i+t[5]*a)/n,e}function Qp(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n||1;return e[0]=(t[0]*i+t[4]*a+t[8]*n)/o,e[1]=(t[1]*i+t[5]*a+t[9]*n)/o,e[2]=(t[2]*i+t[6]*a+t[10]*n)/o,e}function rj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[2]*a,e[1]=t[1]*i+t[3]*a,e[2]=r[2],e}var Jc={};Au(Jc,{add:()=>wG,angle:()=>Vv,bezier:()=>FG,ceil:()=>_G,clone:()=>vG,copy:()=>yG,create:()=>tj,cross:()=>zv,dist:()=>GG,distance:()=>sj,div:()=>HG,divide:()=>oj,dot:()=>Mv,equals:()=>zG,exactEquals:()=>MG,floor:()=>kG,forEach:()=>KG,fromValues:()=>bG,hermite:()=>BG,inverse:()=>RG,len:()=>VG,length:()=>aj,lerp:()=>OG,max:()=>EG,min:()=>SG,mul:()=>UG,multiply:()=>nj,negate:()=>PG,normalize:()=>CG,random:()=>DG,rotateX:()=>Hv,rotateY:()=>Gv,rotateZ:()=>Wv,round:()=>jG,scale:()=>AG,scaleAndAdd:()=>TG,set:()=>xG,slerp:()=>IG,sqrDist:()=>WG,sqrLen:()=>$G,squaredDistance:()=>uj,squaredLength:()=>cj,str:()=>qG,sub:()=>NG,subtract:()=>ij,transformMat3:()=>Nv,transformMat4:()=>Zc,transformQuat:()=>Uv,zero:()=>LG});function tj(){let e=new Hi(3);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function vG(e){let r=new Hi(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function aj(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function bG(e,r,t){let i=new Hi(3);return i[0]=e,i[1]=r,i[2]=t,i}function yG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function xG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function wG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function ij(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function nj(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function oj(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function _G(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function kG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function SG(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function EG(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function jG(e,r){return e[0]=mu(r[0]),e[1]=mu(r[1]),e[2]=mu(r[2]),e}function AG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function TG(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function sj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function uj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return t*t+i*i+a*a}function cj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function PG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function RG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function CG(e,r){let t=r[0],i=r[1],a=r[2],n=t*t+i*i+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e}function Mv(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function zv(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],u=t[2];return e[0]=a*u-n*s,e[1]=n*o-i*u,e[2]=i*s-a*o,e}function OG(e,r,t,i){let a=r[0],n=r[1],o=r[2];return e[0]=a+i*(t[0]-a),e[1]=n+i*(t[1]-n),e[2]=o+i*(t[2]-o),e}function IG(e,r,t,i){let a=Math.acos(Math.min(Math.max(Mv(r,t),-1),1)),n=Math.sin(a),o=Math.sin((1-i)*a)/n,s=Math.sin(i*a)/n;return e[0]=o*r[0]+s*t[0],e[1]=o*r[1]+s*t[1],e[2]=o*r[2]+s*t[2],e}function BG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,u=o*(n-2)+n,l=o*(n-1),f=o*(3-2*n);return e[0]=r[0]*s+t[0]*u+i[0]*l+a[0]*f,e[1]=r[1]*s+t[1]*u+i[1]*l+a[1]*f,e[2]=r[2]*s+t[2]*u+i[2]*l+a[2]*f,e}function FG(e,r,t,i,a,n){let o=1-n,s=o*o,u=n*n,l=s*o,f=3*n*s,h=3*u*o,d=u*n;return e[0]=r[0]*l+t[0]*f+i[0]*h+a[0]*d,e[1]=r[1]*l+t[1]*f+i[1]*h+a[1]*d,e[2]=r[2]*l+t[2]*f+i[2]*h+a[2]*d,e}function DG(e,r){r=r===void 0?1:r;let t=Qc()*2*Math.PI,i=Qc()*2-1,a=Math.sqrt(1-i*i)*r;return e[0]=Math.cos(t)*a,e[1]=Math.sin(t)*a,e[2]=i*r,e}function Zc(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n+t[15];return o=o||1,e[0]=(t[0]*i+t[4]*a+t[8]*n+t[12])/o,e[1]=(t[1]*i+t[5]*a+t[9]*n+t[13])/o,e[2]=(t[2]*i+t[6]*a+t[10]*n+t[14])/o,e}function Nv(e,r,t){let i=r[0],a=r[1],n=r[2];return e[0]=i*t[0]+a*t[3]+n*t[6],e[1]=i*t[1]+a*t[4]+n*t[7],e[2]=i*t[2]+a*t[5]+n*t[8],e}function Uv(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],u=r[1],l=r[2],f=a*l-n*u,h=n*s-i*l,d=i*u-a*s,m=a*d-n*h,y=n*f-i*d,k=i*h-a*f,x=o*2;return f*=x,h*=x,d*=x,m*=2,y*=2,k*=2,e[0]=s+f+m,e[1]=u+h+y,e[2]=l+d+k,e}function Hv(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0],n[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),n[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function Gv(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),n[1]=a[1],n[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function Wv(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),n[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),n[2]=a[2],e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function Vv(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],u=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),l=u&&Mv(e,r)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function LG(e){return e[0]=0,e[1]=0,e[2]=0,e}function qG(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function MG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function zG(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2];return Math.abs(t-n)<=1e-6*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-s)<=1e-6*Math.max(1,Math.abs(a),Math.abs(s))}var NG=ij,UG=nj,HG=oj,GG=sj,WG=uj,VG=aj,$G=cj,KG=function(){let e=tj();return function(r,t,i,a,n,o){let s,u;for(t||(t=3),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();var $v=[0,0,0],Zp,Ir=class extends Xp{static get ZERO(){return Zp||(Zp=new Ir(0,0,0),Object.freeze(Zp)),Zp}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&Ao(r)?this.copy(r):(Bt.debug&&(Aa(r),Aa(t),Aa(i)),this[0]=r,this[1]=t,this[2]=i)}set(r,t,i){return this[0]=r,this[1]=t,this[2]=i,this.check()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this.check()}fromObject(r){return Bt.debug&&(Aa(r.x),Aa(r.y),Aa(r.z)),this[0]=r.x,this[1]=r.y,this[2]=r.z,this.check()}toObject(r){return r.x=this[0],r.y=this[1],r.z=this[2],r}get ELEMENTS(){return 3}get z(){return this[2]}set z(r){this[2]=Aa(r)}angle(r){return Vv(this,r)}cross(r){return zv(this,this,r),this.check()}rotateX({radians:r,origin:t=$v}){return Hv(this,this,t,r),this.check()}rotateY({radians:r,origin:t=$v}){return Gv(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=$v}){return Wv(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return Zc(this,this,r),this.check()}transformAsVector(r){return Qp(this,this,r),this.check()}transformByMatrix3(r){return Nv(this,this,r),this.check()}transformByMatrix2(r){return rj(this,this,r),this.check()}transformByQuaternion(r){return Uv(this,this,r),this.check()}};var Jp=class extends hu{toString(){let r="[";if(Bt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=" ".concat(this[i*this.RANK+t])}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=" ".concat(this[t])}return r+="]",r}getElementIndex(r,t){return t*this.RANK+r}getElement(r,t){return this[t*this.RANK+r]}setElement(r,t,i){return this[t*this.RANK+r]=Aa(i),this}getColumn(r,t=new Array(this.RANK).fill(-0)){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)t[a]=this[i+a];return t}setColumn(r,t){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)this[i+a]=t[a];return this}};function YG(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function lj(e,r){if(e===r){let t=r[1],i=r[2],a=r[3],n=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=i,e[9]=n,e[11]=r[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function fj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],h=r[9],d=r[10],m=r[11],y=r[12],k=r[13],x=r[14],A=r[15],P=t*s-i*o,T=t*u-a*o,B=t*l-n*o,C=i*u-a*s,I=i*l-n*s,F=a*l-n*u,H=f*k-h*y,N=f*x-d*y,K=f*A-m*y,V=h*x-d*k,X=h*A-m*k,U=d*A-m*x,$=P*U-T*X+B*V+C*K-I*N+F*H;return $?($=1/$,e[0]=(s*U-u*X+l*V)*$,e[1]=(a*X-i*U-n*V)*$,e[2]=(k*F-x*I+A*C)*$,e[3]=(d*I-h*F-m*C)*$,e[4]=(u*K-o*U-l*N)*$,e[5]=(t*U-a*K+n*N)*$,e[6]=(x*B-y*F-A*T)*$,e[7]=(f*F-d*B+m*T)*$,e[8]=(o*X-s*K+l*H)*$,e[9]=(i*K-t*X-n*H)*$,e[10]=(y*I-k*B+A*P)*$,e[11]=(h*B-f*I-m*P)*$,e[12]=(s*N-o*V-u*H)*$,e[13]=(t*V-i*N+a*H)*$,e[14]=(k*T-y*C-x*P)*$,e[15]=(f*C-h*T+d*P)*$,e):null}function pj(e){let r=e[0],t=e[1],i=e[2],a=e[3],n=e[4],o=e[5],s=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],m=e[12],y=e[13],k=e[14],x=e[15],A=r*o-t*n,P=r*s-i*n,T=t*s-i*o,B=l*y-f*m,C=l*k-h*m,I=f*k-h*y,F=r*I-t*C+i*B,H=n*I-o*C+s*B,N=l*T-f*P+h*A,K=m*T-y*P+k*A;return u*F-a*H+x*N-d*K}function Kv(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],h=r[8],d=r[9],m=r[10],y=r[11],k=r[12],x=r[13],A=r[14],P=r[15],T=t[0],B=t[1],C=t[2],I=t[3];return e[0]=T*i+B*s+C*h+I*k,e[1]=T*a+B*u+C*d+I*x,e[2]=T*n+B*l+C*m+I*A,e[3]=T*o+B*f+C*y+I*P,T=t[4],B=t[5],C=t[6],I=t[7],e[4]=T*i+B*s+C*h+I*k,e[5]=T*a+B*u+C*d+I*x,e[6]=T*n+B*l+C*m+I*A,e[7]=T*o+B*f+C*y+I*P,T=t[8],B=t[9],C=t[10],I=t[11],e[8]=T*i+B*s+C*h+I*k,e[9]=T*a+B*u+C*d+I*x,e[10]=T*n+B*l+C*m+I*A,e[11]=T*o+B*f+C*y+I*P,T=t[12],B=t[13],C=t[14],I=t[15],e[12]=T*i+B*s+C*h+I*k,e[13]=T*a+B*u+C*d+I*x,e[14]=T*n+B*l+C*m+I*A,e[15]=T*o+B*f+C*y+I*P,e}function dj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,u,l,f,h,d,m,y,k,x,A;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*n+r[12],e[13]=r[1]*i+r[5]*a+r[9]*n+r[13],e[14]=r[2]*i+r[6]*a+r[10]*n+r[14],e[15]=r[3]*i+r[7]*a+r[11]*n+r[15]):(o=r[0],s=r[1],u=r[2],l=r[3],f=r[4],h=r[5],d=r[6],m=r[7],y=r[8],k=r[9],x=r[10],A=r[11],e[0]=o,e[1]=s,e[2]=u,e[3]=l,e[4]=f,e[5]=h,e[6]=d,e[7]=m,e[8]=y,e[9]=k,e[10]=x,e[11]=A,e[12]=o*i+f*a+y*n+r[12],e[13]=s*i+h*a+k*n+r[13],e[14]=u*i+d*a+x*n+r[14],e[15]=l*i+m*a+A*n+r[15]),e}function hj(e,r,t){let i=t[0],a=t[1],n=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=r[11]*n,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function mj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),u,l,f,h,d,m,y,k,x,A,P,T,B,C,I,F,H,N,K,V,X,U,$,Z;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,l=Math.sin(t),u=Math.cos(t),f=1-u,h=r[0],d=r[1],m=r[2],y=r[3],k=r[4],x=r[5],A=r[6],P=r[7],T=r[8],B=r[9],C=r[10],I=r[11],F=a*a*f+u,H=n*a*f+o*l,N=o*a*f-n*l,K=a*n*f-o*l,V=n*n*f+u,X=o*n*f+a*l,U=a*o*f+n*l,$=n*o*f-a*l,Z=o*o*f+u,e[0]=h*F+k*H+T*N,e[1]=d*F+x*H+B*N,e[2]=m*F+A*H+C*N,e[3]=y*F+P*H+I*N,e[4]=h*K+k*V+T*X,e[5]=d*K+x*V+B*X,e[6]=m*K+A*V+C*X,e[7]=y*K+P*V+I*X,e[8]=h*U+k*$+T*Z,e[9]=d*U+x*$+B*Z,e[10]=m*U+A*$+C*Z,e[11]=y*U+P*$+I*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function gj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=n*a+l*i,e[5]=o*a+f*i,e[6]=s*a+h*i,e[7]=u*a+d*i,e[8]=l*a-n*i,e[9]=f*a-o*i,e[10]=h*a-s*i,e[11]=d*a-u*i,e}function vj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[8],f=r[9],h=r[10],d=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a-l*i,e[1]=o*a-f*i,e[2]=s*a-h*i,e[3]=u*a-d*i,e[8]=n*i+l*a,e[9]=o*i+f*a,e[10]=s*i+h*a,e[11]=u*i+d*a,e}function bj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[4],f=r[5],h=r[6],d=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a+l*i,e[1]=o*a+f*i,e[2]=s*a+h*i,e[3]=u*a+d*i,e[4]=l*a-n*i,e[5]=f*a-o*i,e[6]=h*a-s*i,e[7]=d*a-u*i,e}function yj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,u=a+a,l=t*o,f=i*o,h=i*s,d=a*o,m=a*s,y=a*u,k=n*o,x=n*s,A=n*u;return e[0]=1-h-y,e[1]=f+A,e[2]=d-x,e[3]=0,e[4]=f-A,e[5]=1-l-y,e[6]=m+k,e[7]=0,e[8]=d+x,e[9]=m-k,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function xj(e,r,t,i,a,n,o){let s=1/(t-r),u=1/(a-i),l=1/(n-o);return e[0]=n*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n*2*u,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*u,e[10]=(o+n)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*l,e[15]=0,e}function XG(e,r,t,i,a){let n=1/Math.tan(r/2);if(e[0]=n/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let o=1/(i-a);e[10]=(a+i)*o,e[14]=2*a*i*o}else e[10]=-1,e[14]=-2*i;return e}var wj=XG;function QG(e,r,t,i,a,n,o){let s=1/(r-t),u=1/(i-a),l=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*u,e[14]=(o+n)*l,e[15]=1,e}var _j=QG;function kj(e,r,t,i){let a,n,o,s,u,l,f,h,d,m,y=r[0],k=r[1],x=r[2],A=i[0],P=i[1],T=i[2],B=t[0],C=t[1],I=t[2];return Math.abs(y-B)<1e-6&&Math.abs(k-C)<1e-6&&Math.abs(x-I)<1e-6?YG(e):(h=y-B,d=k-C,m=x-I,a=1/Math.sqrt(h*h+d*d+m*m),h*=a,d*=a,m*=a,n=P*m-T*d,o=T*h-A*m,s=A*d-P*h,a=Math.sqrt(n*n+o*o+s*s),a?(a=1/a,n*=a,o*=a,s*=a):(n=0,o=0,s=0),u=d*s-m*o,l=m*n-h*s,f=h*o-d*n,a=Math.sqrt(u*u+l*l+f*f),a?(a=1/a,u*=a,l*=a,f*=a):(u=0,l=0,f=0),e[0]=n,e[1]=u,e[2]=h,e[3]=0,e[4]=o,e[5]=l,e[6]=d,e[7]=0,e[8]=s,e[9]=f,e[10]=m,e[11]=0,e[12]=-(n*y+o*k+s*x),e[13]=-(u*y+l*k+f*x),e[14]=-(h*y+d*k+m*x),e[15]=1,e)}function ZG(){let e=new Hi(4);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Sj(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*n+t[12]*o,e[1]=t[1]*i+t[5]*a+t[9]*n+t[13]*o,e[2]=t[2]*i+t[6]*a+t[10]*n+t[14]*o,e[3]=t[3]*i+t[7]*a+t[11]*n+t[15]*o,e}var ane=function(){let e=ZG();return function(r,t,i,a,n,o){let s,u;for(t||(t=4),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();var Qv;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Qv||(Qv={}));var JG=45*Math.PI/180,eW=1,Yv=.1,Xv=500,rW=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),vi=class extends Jp{static get IDENTITY(){return aW()}static get ZERO(){return tW()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Qv}constructor(r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(r)?this.copy(r):this.identity()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this[3]=r[3],this[4]=r[4],this[5]=r[5],this[6]=r[6],this[7]=r[7],this[8]=r[8],this[9]=r[9],this[10]=r[10],this[11]=r[11],this[12]=r[12],this[13]=r[13],this[14]=r[14],this[15]=r[15],this.check()}set(r,t,i,a,n,o,s,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=u,this[8]=l,this[9]=f,this[10]=h,this[11]=d,this[12]=m,this[13]=y,this[14]=k,this[15]=x,this.check()}setRowMajor(r,t,i,a,n,o,s,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=n,this[2]=l,this[3]=m,this[4]=t,this[5]=o,this[6]=f,this[7]=y,this[8]=i,this[9]=s,this[10]=h,this[11]=k,this[12]=a,this[13]=u,this[14]=d,this[15]=x,this.check()}toRowMajor(r){return r[0]=this[0],r[1]=this[4],r[2]=this[8],r[3]=this[12],r[4]=this[1],r[5]=this[5],r[6]=this[9],r[7]=this[13],r[8]=this[2],r[9]=this[6],r[10]=this[10],r[11]=this[14],r[12]=this[3],r[13]=this[7],r[14]=this[11],r[15]=this[15],r}identity(){return this.copy(rW)}fromObject(r){return this.check()}fromQuaternion(r){return yj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=Yv,far:s=Xv}=r;return s===1/0?iW(this,t,i,a,n,o):xj(this,t,i,a,n,o,s),this.check()}lookAt(r){let{eye:t,center:i=[0,0,0],up:a=[0,1,0]}=r;return kj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=Yv,far:s=Xv}=r;return _j(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=JG,aspect:i=eW,focalDistance:a=1,near:n=Yv,far:o=Xv}=r;Ej(t);let s=t/2,u=a*Math.tan(s),l=u*i;return this.ortho({left:-l,right:l,bottom:-u,top:u,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return Ej(t),wj(this,t,i,a,n),this.check()}determinant(){return pj(this)}getScale(r=[-0,-0,-0]){return r[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),r[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),r[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),r}getTranslation(r=[-0,-0,-0]){return r[0]=this[12],r[1]=this[13],r[2]=this[14],r}getRotation(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=0,r[4]=this[4]*a,r[5]=this[5]*n,r[6]=this[6]*o,r[7]=0,r[8]=this[8]*a,r[9]=this[9]*n,r[10]=this[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}getRotationMatrix3(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=this[4]*a,r[4]=this[5]*n,r[5]=this[6]*o,r[6]=this[8]*a,r[7]=this[9]*n,r[8]=this[10]*o,r}transpose(){return lj(this,this),this.check()}invert(){return fj(this,this),this.check()}multiplyLeft(r){return Kv(this,r,this),this.check()}multiplyRight(r){return Kv(this,this,r),this.check()}rotateX(r){return gj(this,this,r),this.check()}rotateY(r){return vj(this,this,r),this.check()}rotateZ(r){return bj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return mj(this,this,r,t),this.check()}scale(r){return hj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return dj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=Sj(t||[-0,-0,-0,-0],r,this),Yp(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=J4(t||[-0,-0],r,this);break;case 3:a=Zc(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Yp(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=ej(t||[-0,-0],r,this);break;case 3:i=Qp(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Yp(i,r.length),i}transformPoint(r,t){return this.transformAsPoint(r,t)}transformVector(r,t){return this.transformAsPoint(r,t)}transformDirection(r,t){return this.transformAsVector(r,t)}makeRotationX(r){return this.identity().rotateX(r)}makeTranslation(r,t,i){return this.identity().translate([r,t,i])}},ed,rd;function tW(){return ed||(ed=new vi([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(ed)),ed}function aW(){return rd||(rd=new vi,Object.freeze(rd)),rd}function Ej(e){if(e>Math.PI*2)throw Error("expected radians")}function iW(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),u=(t+r)/(t-r),l=(a+i)/(a-i),f=-1,h=-1,d=-2*n;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=l,e[10]=f,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var cs={};Au(cs,{EPSILON1:()=>nW,EPSILON10:()=>hW,EPSILON11:()=>mW,EPSILON12:()=>gW,EPSILON13:()=>vW,EPSILON14:()=>bW,EPSILON15:()=>yW,EPSILON16:()=>xW,EPSILON17:()=>wW,EPSILON18:()=>_W,EPSILON19:()=>kW,EPSILON2:()=>oW,EPSILON20:()=>SW,EPSILON3:()=>sW,EPSILON4:()=>uW,EPSILON5:()=>cW,EPSILON6:()=>lW,EPSILON7:()=>fW,EPSILON8:()=>pW,EPSILON9:()=>dW,PI_OVER_FOUR:()=>jW,PI_OVER_SIX:()=>AW,PI_OVER_TWO:()=>EW,TWO_PI:()=>TW});var nW=.1,oW=.01,sW=.001,uW=1e-4,cW=1e-5,lW=1e-6,fW=1e-7,pW=1e-8,dW=1e-9,hW=1e-10,mW=1e-11,gW=1e-12,vW=1e-13,bW=1e-14,yW=1e-15,xW=1e-16,wW=1e-17,_W=1e-18,kW=1e-19,SW=1e-20,EW=Math.PI/2,jW=Math.PI/4,AW=Math.PI/6,TW=Math.PI*2;var Gn=6356752314245179e-9,PW={radii:[6378137,6378137,Gn],radiiSquared:[6378137*6378137,6378137*6378137,Gn*Gn],oneOverRadii:[1/6378137,1/6378137,1/Gn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Gn*Gn)],maximumRadius:Math.max(6378137,6378137,Gn),centerToleranceSquared:.1};function td(e){return e}var Ine=new Ir;function RW(e,r=[],t=td){return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function jj(e,r=[]){return RW(e,r,Bt._cartographicRadians?td:Dv)}function CW(e,r,t=td){return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Aj(e,r){return CW(e,r,Bt._cartographicRadians?td:Lv)}var Tj=1e-14,OW=new Ir,Pj={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Zv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},el={east:new Ir,north:new Ir,up:new Ir,west:new Ir,south:new Ir,down:new Ir},IW=new Ir,BW=new Ir,FW=new Ir;function Jv(e,r,t,i,a,n){let o=Pj[r]&&Pj[r][t];gi(o&&(!i||i===o));let s,u,l,f=OW.copy(a);if(Un(f.x,0,Tj)&&Un(f.y,0,Tj)){let d=Math.sign(f.z);s=IW.fromArray(Zv[r]),r!=="east"&&r!=="west"&&s.scale(d),u=BW.fromArray(Zv[t]),t!=="east"&&t!=="west"&&u.scale(d),l=FW.fromArray(Zv[i]),i!=="east"&&i!=="west"&&l.scale(d)}else{let{up:d,east:m,north:y}=el;m.set(-f.y,f.x,0).normalize(),e.geodeticSurfaceNormal(f,d),y.copy(d).cross(m);let{down:k,west:x,south:A}=el;k.copy(d).scale(-1),x.copy(m).scale(-1),A.copy(y).scale(-1),s=el[r],u=el[t],l=el[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=l.x,n[9]=l.y,n[10]=l.z,n[11]=0,n[12]=f.x,n[13]=f.y,n[14]=f.z,n[15]=1,n}var gu=new Ir,DW=new Ir,LW=new Ir;function Rj(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;gu.from(e);let o=gu.x,s=gu.y,u=gu.z,l=i.x,f=i.y,h=i.z,d=o*o*l*l,m=s*s*f*f,y=u*u*h*h,k=d+m+y,x=Math.sqrt(1/k);if(!Number.isFinite(x))return;let A=DW;if(A.copy(e).scale(x),k<n)return A.to(t);let P=a.x,T=a.y,B=a.z,C=LW;C.set(A.x*P*2,A.y*T*2,A.z*B*2);let I=(1-x)*gu.len()/(.5*C.len()),F=0,H,N,K,V;do{I-=F,H=1/(1+I*P),N=1/(1+I*T),K=1/(1+I*B);let X=H*H,U=N*N,$=K*K,Z=X*H,le=U*N,ve=$*K;V=d*X+m*U+y*$-1;let we=-2*(d*Z*P+m*le*T+y*ve*B);F=V/we}while(Math.abs(V)>cs.EPSILON12);return gu.scale([H,N,K]).to(t)}var ad=new Ir,Cj=new Ir,zW=new Ir,Gi=new Ir,NW=new Ir,id=new Ir,Wn=class{constructor(r=0,t=0,i=0){ht(this,"radii",void 0),ht(this,"radiiSquared",void 0),ht(this,"radiiToTheFourth",void 0),ht(this,"oneOverRadii",void 0),ht(this,"oneOverRadiiSquared",void 0),ht(this,"minimumRadius",void 0),ht(this,"maximumRadius",void 0),ht(this,"centerToleranceSquared",cs.EPSILON1),ht(this,"squaredXOverSquaredZ",void 0),gi(r>=0),gi(t>=0),gi(i>=0),this.radii=new Ir(r,t,i),this.radiiSquared=new Ir(r*r,t*t,i*i),this.radiiToTheFourth=new Ir(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new Ir(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new Ir(r===0?0:1/(r*r),t===0?0:1/(t*t),i===0?0:1/(i*i)),this.minimumRadius=Math.min(r,t,i),this.maximumRadius=Math.max(r,t,i),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(r){return this===r||Boolean(r&&this.radii.equals(r.radii))}toString(){return this.radii.toString()}cartographicToCartesian(r,t=[0,0,0]){let i=Cj,a=zW,[,,n]=r;this.geodeticSurfaceNormalCartographic(r,i),a.copy(this.radiiSquared).scale(i);let o=Math.sqrt(i.dot(a));return a.scale(1/o),i.scale(n),a.add(i),a.to(t)}cartesianToCartographic(r,t=[0,0,0]){id.from(r);let i=this.scaleToGeodeticSurface(id,Gi);if(!i)return;let a=this.geodeticSurfaceNormal(i,Cj),n=NW;n.copy(id).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),u=Math.sign(Jc.dot(n,id))*Jc.length(n);return Aj([o,s,u],t)}eastNorthUpToFixedFrame(r,t=new vi){return Jv(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new vi){return Jv(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return ad.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=jj(r),a=i[0],n=i[1],o=Math.cos(n);return ad.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),ad.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return ad.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return Rj(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Gi.from(r);let i=Gi.x,a=Gi.y,n=Gi.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Gi.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){gi(Un(this.radii.x,this.radii.y,cs.EPSILON15)),gi(this.radii.z>0),Gi.from(r);let a=Gi.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Gi.set(0,0,a).to(i)}};ht(Wn,"WGS84",new Wn(6378137,6378137,Gn));var Oj="4.1.1";var Ij,UW=(Ij=globalThis.loaders)==null?void 0:Ij.parseImageNode,e1=typeof Image<"u",r1=typeof ImageBitmap<"u",HW=Boolean(UW),t1=Jo?!0:HW;function Bj(e){switch(e){case"auto":return r1||e1||t1;case"imagebitmap":return r1;case"image":return e1;case"data":return t1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function Fj(){if(r1)return"imagebitmap";if(e1)return"image";if(t1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function GW(e){let r=WW(e);if(!r)throw new Error("Not an image");return r}function Dj(e){switch(GW(e)){case"data":return e;case"image":case"imagebitmap":let r=document.createElement("canvas"),t=r.getContext("2d");if(!t)throw new Error("getImageData");return r.width=e.width,r.height=e.height,t.drawImage(e,0,0),t.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function WW(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}var VW=/^data:image\/svg\+xml/,$W=/\.svg((\?|#).*)?$/;function nd(e){return e&&(VW.test(e)||$W.test(e))}function Lj(e,r){if(nd(r)){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 a1(e,r)}function a1(e,r){if(nd(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function od(e,r,t){let i=Lj(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await KW(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function KW(e,r){let t=new Image;return t.src=e,r.image&&r.image.decode&&t.decode?(await t.decode(),t):await new Promise((i,a)=>{try{t.onload=()=>i(t),t.onerror=n=>{let o=n instanceof Error?n.message:"error";a(new Error(o))}}catch(n){a(n)}})}var YW={},qj=!0;async function Mj(e,r,t){let i;nd(t)?i=await od(e,r,t):i=a1(e,t);let a=r&&r.imagebitmap;return await XW(i,a)}async function XW(e,r=null){if((QW(r)||!qj)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),qj=!1}return await createImageBitmap(e)}function QW(e){for(let r in e||YW)return!1;return!0}function zj(e){return!rV(e,"ftyp",4)||!(e[8]&96)?null:ZW(e)}function ZW(e){switch(JW(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function JW(e,r,t){return String.fromCharCode(...e.slice(r,t))}function eV(e){return[...e].map(r=>r.charCodeAt(0))}function rV(e,r,t=0){let i=eV(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var bn=!1,rl=!0;function sd(e){let r=tl(e);return aV(r)||oV(r)||iV(r)||nV(r)||tV(r)}function tV(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=zj(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function aV(e){let r=tl(e);return r.byteLength>=24&&r.getUint32(0,bn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,bn),height:r.getUint32(20,bn)}:null}function iV(e){let r=tl(e);return r.byteLength>=10&&r.getUint32(0,bn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,rl),height:r.getUint16(8,rl)}:null}function nV(e){let r=tl(e);return r.byteLength>=14&&r.getUint16(0,bn)===16973&&r.getUint32(2,rl)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,rl),height:r.getUint32(22,rl)}:null}function oV(e){let r=tl(e);if(!(r.byteLength>=3&&r.getUint16(0,bn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=sV(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,bn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,bn),width:r.getUint16(n+7,bn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,bn)}return null}function sV(){let 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 tl(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 Nj(e,r){var a;let{mimeType:t}=sd(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return zi(i),await i(e,t)}async function Uj(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=uV(a),s;switch(o){case"imagebitmap":s=await Mj(e,r,n);break;case"image":s=await od(e,r,n);break;case"data":s=await Nj(e,r);break;default:zi(!1)}return a==="data"&&(s=Dj(s)),s}function uV(e){switch(e){case"auto":case"data":return Fj();default:return Bj(e),e}}var cV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],lV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],fV={image:{type:"auto",decode:!0}},ud={id:"image",module:"images",name:"Images",version:Oj,mimeTypes:lV,extensions:cV,parse:Uj,tests:[e=>Boolean(sd(new DataView(e)))],options:fV};var Hj="4.1.1";var Gj={name:"Draco",id:"draco",module:"draco",version:Hj,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function Vj(e,r,t){let i=$j(r.metadata),a=[],n=pV(r.attributes);for(let o in e){let s=e[o],u=Wj(o,s,n[o]);a.push(u)}if(t){let o=Wj("indices",t);a.push(o)}return{fields:a,metadata:i}}function pV(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function Wj(e,r,t){let i=t?$j(t.metadata):void 0;return Iv(e,r,i)}function $j(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var Kj={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},dV={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},hV=4,al=class{constructor(r){this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(r,t={}){let i=new this.draco.DecoderBuffer;i.Init(new Int8Array(r),r.byteLength),this._disableAttributeTransforms(t);let a=this.decoder.GetEncodedGeometryType(i),n=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(a){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(n,a,t),u=this._getMeshData(n,s,t),l=Ov(u.attributes),f=Vj(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:l},...u,schema:f}}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}_getDracoLoaderData(r,t,i){let a=this._getTopLevelMetadata(r),n=this._getDracoAttributes(r,i);return{geometry_type:t,num_attributes:r.num_attributes(),num_points:r.num_points(),num_faces:r instanceof this.draco.Mesh?r.num_faces():0,metadata:a,attributes:n}}_getDracoAttributes(r,t){let i={};for(let a=0;a<r.num_attributes();a++){let n=this.decoder.GetAttribute(r,a),o=this._getAttributeMetadata(r,a);i[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:a,metadata:o};let s=this._getQuantizationTransform(n,t);s&&(i[n.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(n,t);u&&(i[n.unique_id()].octahedron_transform=u)}return i}_getMeshData(r,t,i){let a=this._getMeshAttributes(t,r,i);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(r instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(r),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(r),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(r,t,i){let a={};for(let n of Object.values(r.attributes)){let o=this._deduceAttributeName(n,i);n.name=o;let{value:s,size:u}=this._getAttributeValues(t,n);a[o]={value:s,size:u,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}return a}_getTriangleListIndices(r){let i=r.num_faces()*3,a=i*hV,n=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(r,a,n),new Uint32Array(this.draco.HEAPF32.buffer,n,i).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(r){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(r,t),vV(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=dV[t.data_type],a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,u=mV(this.draco,i),l,f=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,u,s,f),l=new i(this.draco.HEAPF32.buffer,f,o).slice()}finally{this.draco._free(f)}return{value:l,size:a}}_deduceAttributeName(r,t){let i=r.unique_id;for(let[o,s]of Object.entries(t.extraAttributes||{}))if(s===i)return o;let a=r.attribute_type;for(let o in Kj)if(this.draco[o]===a)return Kj[o];let n=t.attributeNameEntry||"name";return r.metadata[n]?r.metadata[n].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(r){let t=this.decoder.GetMetadata(r);return this._getDracoMetadata(t)}_getAttributeMetadata(r,t){let i=this.decoder.GetAttributeMetadata(r,t);return this._getDracoMetadata(i)}_getDracoMetadata(r){if(!r||!r.ptr)return{};let t={},i=this.metadataQuerier.NumEntries(r);for(let a=0;a<i;a++){let n=this.metadataQuerier.GetEntryName(r,a);t[n]=this._getDracoMetadataField(r,n)}return t}_getDracoMetadataField(r,t){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(r,t,i);let a=gV(i);return{int:this.metadataQuerier.GetIntEntry(r,t),string:this.metadataQuerier.GetStringEntry(r,t),double:this.metadataQuerier.GetDoubleEntry(r,t),intArray:a}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(r){let{quantizedAttributes:t=[],octahedronAttributes:i=[]}=r,a=[...t,...i];for(let n of a)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(r,t){let{quantizedAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(s=>o.min_value(s))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(r,t){let{octahedronAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function mV(e,r){switch(r){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function gV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function vV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var bV="1.5.6",yV="1.4.1",i1=`https://www.gstatic.com/draco/versioned/decoders/${bV}`,Ha={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},n1={[Ha.DECODER]:`${i1}/${Ha.DECODER}`,[Ha.DECODER_WASM]:`${i1}/${Ha.DECODER_WASM}`,[Ha.FALLBACK_DECODER]:`${i1}/${Ha.FALLBACK_DECODER}`,[Ha.ENCODER]:`https://raw.githubusercontent.com/google/draco/${yV}/javascript/${Ha.ENCODER}`},il;async function Yj(e){let r=e.modules||{};return r.draco3d?il=il||r.draco3d.createDecoderModule({}).then(t=>({draco:t})):il=il||xV(e),await il}async function xV(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await gn(n1[Ha.FALLBACK_DECODER],"draco",e,Ha.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await gn(n1[Ha.DECODER],"draco",e,Ha.DECODER),await gn(n1[Ha.DECODER_WASM],"draco",e,Ha.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await wV(r,t)}function wV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var Xj={...Gj,parse:_V};async function _V(e,r){let{draco:t}=await Yj(r),i=new al(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var cd="4.1.1";var ld={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},o1;async function u1(e){let r=e.modules||{};return r.basis?r.basis:(o1=o1||kV(e),await o1)}async function kV(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(ld.TRANSCODER,"textures",e),await gn(ld.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await SV(r,t)}function SV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,initializeBasis:o}=a;o(),i({BasisFile:n})})})}var s1;async function c1(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(s1=s1||EV(e),await s1)}async function EV(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(ld.ENCODER,"textures",e),await gn(ld.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await jV(r,t)}function jV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:u}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:u})})})}var ce={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var AV=["","WEBKIT_","MOZ_"],Qj={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},fd=null;function Zj(e){if(!fd){e=e||TV()||void 0,fd=new Set;for(let r of AV)for(let t in Qj)if(e&&e.getExtension(`${r}${t}`)){let i=Qj[t];fd.add(i)}}return fd}function TV(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var lA=Pt(uA(),1);function vu(e,r){let t=new Array(r.mipMapLevels),i=r.width,a=r.height,n=0;for(let o=0;o<r.mipMapLevels;++o){let s=CV(r,i,a,e,o),u=RV(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:u,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function RV(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function CV(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var OV={131:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ce.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ce.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ce.COMPRESSED_RED_RGTC1_EXT,140:ce.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ce.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ce.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ce.COMPRESSED_RGB8_ETC2,148:ce.COMPRESSED_SRGB8_ETC2,149:ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ce.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ce.COMPRESSED_RGBA8_ETC2_EAC,152:ce.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ce.COMPRESSED_R11_EAC,154:ce.COMPRESSED_SIGNED_R11_EAC,155:ce.COMPRESSED_RG11_EAC,156:ce.COMPRESSED_SIGNED_RG11_EAC,157:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ce.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ce.COMPRESSED_RGBA_ASTC_12x12_KHR};function cA(e){return OV[e]}var Ja=[171,75,84,88,32,50,48,187,13,10,26,10];function gd(e){let r=new Uint8Array(e);return!(r.byteLength<Ja.length||r[0]!==Ja[0]||r[1]!==Ja[1]||r[2]!==Ja[2]||r[3]!==Ja[3]||r[4]!==Ja[4]||r[5]!==Ja[5]||r[6]!==Ja[6]||r[7]!==Ja[7]||r[8]!==Ja[8]||r[9]!==Ja[9]||r[10]!==Ja[10]||r[11]!==Ja[11])}function fA(e){let r=new Uint8Array(e),t=(0,lA.read)(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=cA(t.vkFormat);return vu(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var IV={etc1:{basisFormat:0,compressed:!0,format:ce.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ce.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ce.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function ol(e,r){if(r.basis.containerFormat==="auto"){if(gd(e)){let i=await c1(r);return pA(i.KTX2File,e,r)}let{BasisFile:t}=await u1(r);return h1(t,e,r)}switch(r.basis.module){case"encoder":let t=await c1(r);switch(r.basis.containerFormat){case"ktx2":return pA(t.KTX2File,e,r);case"basis":default:return h1(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await u1(r);return h1(i,e,r)}}function h1(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let a=i.getNumImages(),n=[];for(let o=0;o<a;o++){let s=i.getNumLevels(o),u=[];for(let l=0;l<s;l++)u.push(BV(i,o,l,t));n.push(u)}return n}finally{i.close(),i.delete()}}function BV(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=dA(i,o),f=e.getImageTranscodedSizeInBytes(r,t,l),h=new Uint8Array(f);if(!e.transcodeImage(h,r,t,l,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:u,hasAlpha:o}}function pA(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let a=i.getLevels(),n=[];for(let o=0;o<a;o++){n.push(FV(i,o,t));break}return[n]}finally{i.close(),i.delete()}}function FV(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:u}=dA(t,i),l=e.getImageTranscodedSizeInBytes(r,0,0,u),f=new Uint8Array(l);if(!e.transcodeImage(f,r,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:f,compressed:o,levelSize:l,hasAlpha:i,format:s}}function dA(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=DV()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),IV[t]}function DV(){let e=Zj();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var hA={name:"Basis",id:"basis",module:"textures",version:cd,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},sl={...hA,parse:ol};var ei={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},LV={DXT1:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ce.COMPRESSED_RGB_ATC_WEBGL,ATCA:ce.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ce.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},qV=vA,MV=vd,zV=vd,NV={DXT1:vA,DXT3:vd,DXT5:vd,"ATC ":qV,ATCA:MV,ATCI:zV};function mA(e){return new Uint32Array(e,0,ei.HEADER_LENGTH)[ei.MAGIC_NUMBER_INDEX]===ei.MAGIC_NUMBER}function gA(e){let r=new Int32Array(e,0,ei.HEADER_LENGTH),t=r[ei.HEADER_PF_FOURCC_INDEX];zi(Boolean(r[ei.HEADER_PF_FLAGS_INDEX]&ei.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=UV(t),a=LV[i],n=NV[i];zi(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[ei.HEADER_FLAGS_INDEX]&ei.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[ei.MIPMAPCOUNT_INDEX]));let s=r[ei.HEADER_WIDTH_INDEX],u=r[ei.HEADER_HEIGHT_INDEX],l=r[ei.HEADER_SIZE_INDEX]+4,f=new Uint8Array(e,l);return vu(f,{mipMapLevels:o,width:s,height:u,sizeFunction:n,internalFormat:a})}function vA(e,r){return(e+3>>2)*(r+3>>2)*8}function vd(e,r){return(e+3>>2)*(r+3>>2)*16}function UV(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bi={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},HV={0:[ce.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ce.COMPRESSED_RGB_ETC1_WEBGL],7:[ce.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ce.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ce.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ce.COMPRESSED_RGB8_ETC2],23:[ce.COMPRESSED_RGBA8_ETC2_EAC],24:[ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ce.COMPRESSED_R11_EAC],26:[ce.COMPRESSED_RG11_EAC],27:[ce.COMPRESSED_RGBA_ASTC_4X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ce.COMPRESSED_RGBA_ASTC_5X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ce.COMPRESSED_RGBA_ASTC_5X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ce.COMPRESSED_RGBA_ASTC_6X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ce.COMPRESSED_RGBA_ASTC_6X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ce.COMPRESSED_RGBA_ASTC_8X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ce.COMPRESSED_RGBA_ASTC_8X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ce.COMPRESSED_RGBA_ASTC_8X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ce.COMPRESSED_RGBA_ASTC_10X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ce.COMPRESSED_RGBA_ASTC_10X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ce.COMPRESSED_RGBA_ASTC_10X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ce.COMPRESSED_RGBA_ASTC_10X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ce.COMPRESSED_RGBA_ASTC_12X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ce.COMPRESSED_RGBA_ASTC_12X12_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},GV={0:bA,1:bA,2:yA,3:yA,6:ul,7:ul,9:cl,11:cl,22:ul,23:cl,24:ul,25:ul,26:cl,27:cl,28:WV,29:VV,30:$V,31:KV,32:YV,33:XV,34:QV,35:ZV,36:JV,37:e$,38:r$,39:t$,40:a$};function xA(e){let t=new Uint32Array(e,0,bi.HEADER_LENGTH)[bi.MAGIC_NUMBER_INDEX];return t===bi.MAGIC_NUMBER||t===bi.MAGIC_NUMBER_EXTRA}function wA(e){let r=new Uint32Array(e,0,bi.HEADER_LENGTH),t=r[bi.PIXEL_FORMAT_INDEX],i=r[bi.COLOUR_SPACE_INDEX],a=HV[t]||[],n=a.length>1&&i?a[1]:a[0],o=GV[t],s=r[bi.MIPMAPCOUNT_INDEX],u=r[bi.WIDTH_INDEX],l=r[bi.HEIGHT_INDEX],f=bi.HEADER_SIZE+r[bi.METADATA_SIZE_INDEX],h=new Uint8Array(e,f);return vu(h,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:n})}function bA(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function yA(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function ul(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function cl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function WV(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function VV(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function $V(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function KV(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function YV(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function XV(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function QV(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function ZV(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function JV(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function e$(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function r$(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function t$(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function a$(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function _A(e){if(gd(e))return fA(e);if(mA(e))return gA(e);if(xA(e))return wA(e);throw new Error("Texture container format not recognized")}var kA={name:"Texture Containers",id:"compressed-texture",module:"textures",version:cd,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},bd={...kA,parse:async(e,r)=>{var t;return(t=r==null?void 0:r["compressed-texture"])!=null&&t.useBasis?(r.basis={format:{alpha:"BC3",noAlpha:"BC1"},...r.basis,containerFormat:"ktx2",module:"encoder"},(await ol(e,r))[0]):_A(e)}};function SA(e,r=null){return r?`${e}?token=${r}`:e}var i$={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n$={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ls={...i$,...n$};function m1(e){switch(e){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var EA={UInt8:ls.UNSIGNED_BYTE,UInt16:ls.UNSIGNED_SHORT,Float32:ls.FLOAT,UInt32:ls.UNSIGNED_INT,UInt64:ls.DOUBLE};function bu(e){switch(e){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var yd=new Ir([0,0,0]);function o$(e){switch(e){case"ktx-etc2":case"dds":return bd;case"ktx2":return sl;case"jpg":case"png":default:return ud}}var s$="i3s-attribute-type";async function PA(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new vi,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=SA(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=o$(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(u===ud){let d={...r.textureLoaderOptions,image:{type:"data"}};try{let m=await Gg(h,[],d,a);n.texture=m}catch{let y=await Nn(h,u,d,a);n.texture=y}}else if(u===bd||u===sl){let d=await Bv(h,u,r.textureLoaderOptions);u===sl&&(d=d[0]),n.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else n.texture=h}return n.material=g$(r.materialDefinition,n.texture),n.material&&(n.texture=null),await u$(e,n,r,t,i)}async function u$(e,r,t,i,a){var h,d;let n=e.byteLength,o,s,u=0,l=0,f;if(t.isDracoGeometry){let m=await Nn(e,Xj,{draco:{attributeNameEntry:s$}});s=m.header.vertexCount,f=(h=m.indices)==null?void 0:h.value;let{POSITION:y,NORMAL:k,COLOR_0:x,TEXCOORD_0:A,["feature-index"]:P,["uv-region"]:T}=m.attributes;o={position:y,normal:k,color:x,uv0:A,uvRegion:T,id:P},c$(o,m);let B=x$(P);B&&y$(o,B)}else{let{vertexAttributes:m,ordering:y,featureAttributes:k,featureAttributeOrder:x}=i.store.defaultGeometrySchema,A=f$(e,i);u=A.byteOffset,s=A.vertexCount,l=A.featureCount;let{attributes:P,byteOffset:T}=AA(e,u,m,s,y),{attributes:B}=AA(e,T,k,l,x);b$(B),o=l$(P,B)}if(!((d=a==null?void 0:a.i3s)!=null&&d.coordinateSystem)||a.i3s.coordinateSystem===2){let m=d$(o.position,t);r.modelMatrix=m.invert(),r.coordinateSystem=2}else r.modelMatrix=m$(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:jA(o.color),texCoords:o.uv0,uvRegions:jA(o.uvRegion||o.region)},r.indices=f||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let m in r.attributes)r.attributes[m]||delete r.attributes[m];return r.vertexCount=s,r.byteLength=n,r}function c$(e,r){for(let t in r.loaderData.attributes){let i=r.loaderData.attributes[t];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function l$(e,r){return{...e,...r}}function jA(e){return e&&(e.normalized=!0,e)}function f$(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=m1(o);switch(n){case"vertexCount":i=new s(e,0,4)[0],t+=bu(o);break;case"featureCount":a=new s(e,4,4)[0],t+=bu(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function AA(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:u}=t[o];if(r+i*u*bu(s)<=e.byteLength){let l=e.slice(r),f;if(s==="UInt64")f=p$(l,i*u,bu(s));else{let h=m1(s);f=new h(l,0,i*u)}switch(n[o]={value:f,type:EA[s],size:u},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*u*bu(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function p$(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),u=a.getUint32(n+4,!0),l=s+2**32*u;i.push(l),n+=t}return new Uint32Array(i)}function d$(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new vi,o=new Ir(t[0],t[1],t[2]),s=new Ir;return Wn.WGS84.cartographicToCartesian(o,s),Wn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=h$(i,a,o),n}function h$(e,r={},t){let i=new Float64Array(e.length),a=r["i3s-scale_x"]&&r["i3s-scale_x"].double||1,n=r["i3s-scale_y"]&&r["i3s-scale_y"].double||1;for(let o=0;o<i.length;o+=3)i[o]=e[o]*a+t.x,i[o+1]=e[o+1]*n+t.y,i[o+2]=e[o+2]+t.z;for(let o=0;o<i.length;o+=3)Wn.WGS84.cartographicToCartesian(i.subarray(o,o+3),yd),i[o]=yd.x,i[o+1]=yd.y,i[o+2]=yd.z;return i}function m$(e){var n,o;let r=e.metadata,t=((n=r==null?void 0:r["i3s-scale_x"])==null?void 0:n.double)||1,i=((o=r==null?void 0:r["i3s-scale_y"])==null?void 0:o.double)||1,a=new vi;return a[0]=t,a[5]=i,a}function g$(e,r){let t;return e?t={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(t={pbrMetallicRoughness:{}},r?t.pbrMetallicRoughness.baseColorTexture={texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),t.alphaCutoff=t.alphaCutoff||.25,t.alphaMode&&(t.alphaMode=t.alphaMode.toUpperCase()),t.emissiveFactor&&(t.emissiveFactor=TA(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=TA(t.pbrMetallicRoughness.baseColorFactor)),r&&v$(t,r),t}function TA(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function v$(e,r){let t={source:{image:r}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:t}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:t}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:t}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:t}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:t})}function b$(e){let{id:r,faceRange:t}=e;if(!r||!t)return;let i=r.value,a=t.value,n=a[a.length-1]+1,o=new Uint32Array(n*3),s=0,u=0;for(let l=1;l<a.length;l+=2){let f=Number(i[s]),h=a[l],d=a[l-1],m=h-d+1,y=u+m*3;o.fill(f,u,y),s++,u=y}e.id.value=o}function y$(e,r){let t=e.id.value,i=new Float32Array(t.length);for(let a=0;a<t.length;a++)i[a]=r[t[a]];e.id.value=i}function x$(e){var r,t;return(t=(r=e==null?void 0:e.metadata)==null?void 0:r["i3s-feature-ids"])==null?void 0:t.intArray}var w$="4.1.1",RA={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:w$,mimeTypes:["application/octet-stream"],parse:_$,extensions:["bin"],options:{"i3s-content":{}}};async function _$(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,u=o||n;return!s||!u?null:await PA(e,s,u,r,t)}rv(RA);
100
+ }`}function Mc(e,r=!0,t){let i=t||new Set;if(e){if(z5(e))i.add(e);else if(z5(e.buffer))i.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(r&&typeof e=="object")for(let a in e)Mc(e[a],r,i)}}return t===void 0?Array.from(i):[]}function z5(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}var Kg=()=>{},Eo=class{constructor(r){this.terminated=!1;this._loadableURL="";let{name:t,source:i,url:a}=r;ma(i||a),this.name=t,this.source=i,this.url=a,this.onMessage=Kg,this.onError=n=>console.log(n),this.worker=oa?this._createBrowserWorker():this._createNodeWorker()}static isSupported(){return typeof Worker<"u"&&oa||typeof qc<"u"&&!oa}destroy(){this.onMessage=Kg,this.onError=Kg,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(r,t){t=t||Mc(r),this.worker.postMessage(r,t)}_getErrorFromErrorEvent(r){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url}. `,r.message&&(t+=`${r.message} in `),r.lineno&&(t+=`:${r.lineno}:${r.colno}`),new Error(t)}_createBrowserWorker(){this._loadableURL=q5({source:this.source,url:this.url});let r=new Worker(this._loadableURL,{name:this.name});return r.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},r.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},r.onmessageerror=t=>console.error(t),r}_createNodeWorker(){let r;if(this.url){let i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;r=new qc(i,{eval:!1})}else if(this.source)r=new qc(this.source,{eval:!0});else throw new Error("no worker");return r.on("message",t=>{this.onMessage(t)}),r.on("error",t=>{this.onError(t)}),r.on("exit",t=>{}),r}};var zc=class{constructor(r){this.name="unnamed";this.maxConcurrency=1;this.maxMobileConcurrency=1;this.onDebug=()=>{};this.reuseWorkers=!0;this.props={};this.jobQueue=[];this.idleQueue=[];this.count=0;this.isDestroyed=!1;this.source=r.source,this.url=r.url,this.setProps(r)}static isSupported(){return Eo.isSupported()}destroy(){this.idleQueue.forEach(r=>r.destroy()),this.isDestroyed=!0}setProps(r){this.props={...this.props,...r},r.name!==void 0&&(this.name=r.name),r.maxConcurrency!==void 0&&(this.maxConcurrency=r.maxConcurrency),r.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=r.maxMobileConcurrency),r.reuseWorkers!==void 0&&(this.reuseWorkers=r.reuseWorkers),r.onDebug!==void 0&&(this.onDebug=r.onDebug)}async startJob(r,t=(a,n,o)=>a.done(o),i=(a,n)=>a.error(n)){let a=new Promise(n=>(this.jobQueue.push({name:r,onMessage:t,onError:i,onStart:n}),this));return this._startQueuedJob(),await a}async _startQueuedJob(){if(!this.jobQueue.length)return;let r=this._getAvailableWorker();if(!r)return;let t=this.jobQueue.shift();if(t){this.onDebug({message:"Starting job",name:t.name,workerThread:r,backlog:this.jobQueue.length});let i=new Dc(t.name,r);r.onMessage=a=>t.onMessage(i,a.type,a.payload),r.onError=a=>t.onError(i,a),t.onStart(i);try{await i.result}catch(a){console.error(`Worker exception: ${a}`)}finally{this.returnWorkerToQueue(r)}}}returnWorkerToQueue(r){!oa||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(r.destroy(),this.count--):this.idleQueue.push(r),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let r=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new Eo({name:r,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return L5?this.maxMobileConcurrency:this.maxConcurrency}};var FU={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Qa=class{constructor(r){this.workerPools=new Map;this.props={...FU},this.setProps(r),this.workerPools=new Map}static isSupported(){return Eo.isSupported()}static getWorkerFarm(r={}){return Qa._workerFarm=Qa._workerFarm||new Qa({}),Qa._workerFarm.setProps(r),Qa._workerFarm}destroy(){for(let r of this.workerPools.values())r.destroy();this.workerPools=new Map}setProps(r){this.props={...this.props,...r};for(let t of this.workerPools.values())t.setProps(this._getWorkerPoolProps())}getWorkerPool(r){let{name:t,source:i,url:a}=r,n=this.workerPools.get(t);return n||(n=new zc({name:t,source:i,url:a}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(t,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};async function es(){return Vg}var Yg=new Map,Za=class{static async inWorkerThread(){return typeof self<"u"||Boolean(await es())}static set onmessage(r){async function t(i){let a=await es(),{type:n,payload:o}=a?i:i.data;r(n,o)}es().then(i=>{i?(i.on("message",t),i.on("exit",()=>console.debug("Node worker closing"))):globalThis.onmessage=t})}static async addEventListener(r){let t=Yg.get(r);t||(t=async a=>{if(!DU(a))return;let n=await es(),{type:o,payload:s}=n?a:a.data;r(o,s)}),await es()?console.error("not implemented"):globalThis.addEventListener("message",t)}static async removeEventListener(r){let t=Yg.get(r);Yg.delete(r),await es()?console.error("not implemented"):globalThis.removeEventListener("message",t)}static async postMessage(r,t){let i={source:"loaders.gl",type:r,payload:t},a=Mc(t),n=await es();n?n.postMessage(i,a):globalThis.postMessage(i,a)}};function DU(e){let{type:r,data:t}=e;return r==="message"&&t&&typeof t.source=="string"&&t.source.startsWith("loaders.gl")}function Xg(e,r={}){let t=r[e.id]||{},i=oa?`${e.id}-worker.js`:`${e.id}-worker-node.js`,a=t.workerUrl;if(!a&&e.id==="compression"&&(a=r.workerUrl),r._workerType==="test"&&(oa?a=`modules/${e.module}/dist/${i}`:a=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!a){let n=e.version;n==="latest"&&(n=F5);let o=n?`@${n}`:"";a=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${i}`}return ma(a),a}function Qg(e,r=Bc){ma(e,"no worker provided");let t=e.version;return!(!r||!t)}var Jg={};Au(Jg,{readFileAsArrayBuffer:()=>_p,readFileAsText:()=>kp,requireFromFile:()=>Sp,requireFromString:()=>cu});var Zg=Pt(require("module"),1),N5=Pt(require("path"),1),Nc=Pt(require("fs"),1);async function _p(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Nc.readFileSync(e).buffer}async function kp(e){return e.startsWith("http")?await(await fetch(e)).text():Nc.readFileSync(e,"utf8")}async function Sp(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return cu(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await Nc.promises.readFile(e,"utf8");return cu(r)}function cu(e,r="",t){if(typeof r=="object"&&(t=r,r=""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=Zg.default._nodeModulePaths(N5.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new Zg.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var ev={};async function gn(e,r=null,t={},i=null){return r&&(e=U5(e,r,t,i)),ev[e]=ev[e]||LU(e),await ev[e]}function U5(e,r,t={},i=null){if(!t.useLocalLibraries&&e.startsWith("http"))return e;i=i||e;let a=t.modules||{};return a[i]?a[i]:oa?t.CDN?(ma(t.CDN.startsWith("http")),`${t.CDN}/${r}@${Bc}/dist/libs/${i}`):Fc?`../src/libs/${i}`:`modules/${r}/src/libs/${i}`:`modules/${r}/dist/libs/${i}`}async function LU(e){if(e.endsWith("wasm"))return await MU(e);if(!oa)try{return Jg&&Sp&&await Sp(e)}catch(t){return console.error(t),null}if(Fc)return importScripts(e);let r=await zU(e);return qU(r,e)}function qU(e,r){if(!oa)return cu&&cu(e,r);if(Fc)return eval.call(globalThis,e),null;let t=document.createElement("script");t.id=r;try{t.appendChild(document.createTextNode(e))}catch{t.text=e}return document.body.appendChild(t),null}async function MU(e){return oa||!_p||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await _p(e)}async function zU(e){return oa||!kp||e.startsWith("http")?await(await fetch(e)).text():await kp(e)}var NU=0;async function rv(e){await Za.inWorkerThread()&&(Za.onmessage=async(r,t)=>{switch(r){case"process":try{let{input:i,options:a={},context:n={}}=t,o=await HU({loader:e,arrayBuffer:i,options:a,context:{...n,_parse:UU}});Za.postMessage("done",{result:o})}catch(i){let a=i instanceof Error?i.message:"";Za.postMessage("error",{error:a})}break;default:}})}function UU(e,r,t,i){return new Promise((a,n)=>{let o=NU++,s=(l,f)=>{if(f.id===o)switch(l){case"done":Za.removeEventListener(s),a(f.result);break;case"error":Za.removeEventListener(s),n(f.error);break;default:}};Za.addEventListener(s);let u={id:o,input:e,options:t};Za.postMessage("process",u)})}async function HU({loader:e,arrayBuffer:r,options:t,context:i}){let a,n;if(e.parseSync||e.parse)a=r,n=e.parseSync||e.parse;else if(e.parseTextSync)a=new TextDecoder().decode(r),n=e.parseTextSync;else throw new Error(`Could not load data with ${e.name} loader`);return t={...t,modules:e&&e.options&&e.options.modules||{},worker:!1},await n(a,{...t},i,e)}function tv(e,r){return!Qa.isSupported()||!oa&&!(r!=null&&r._nodeWorkers)?!1:e.worker&&(r==null?void 0:r.worker)}async function av(e,r,t,i,a){let n=e.id,o=Xg(e,t),u=Qa.getWorkerFarm(t).getWorkerPool({name:n,url:o});t=JSON.parse(JSON.stringify(t)),i=JSON.parse(JSON.stringify(i||{}));let l=await u.startJob("process-on-worker",GU.bind(null,a));return l.postMessage("process",{input:r,options:t,context:i}),await(await l.result).result}async function GU(e,r,t,i){switch(t){case"done":r.done(i);break;case"error":r.error(new Error(i.error));break;case"process":let{id:a,input:n,options:o}=i;try{let s=await e(n,o);r.postMessage("done",{id:a,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";r.postMessage("error",{id:a,error:u})}break;default:console.warn(`parse-with-worker unknown message ${t}`)}}function iv(e,r,t){if(t=t||e.byteLength,e.byteLength<t||r.byteLength<t)return!1;let i=new Uint8Array(e),a=new Uint8Array(r);for(let n=0;n<i.length;++n)if(i[n]!==a[n])return!1;return!0}function nv(...e){return H5(e)}function H5(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}async function Uc(e){let r=[];for await(let t of e)r.push(t);return nv(...r)}function jo(e){return jo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},jo(e)}function ov(e,r){if(jo(e)!=="object"||e===null)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var i=t.call(e,r||"default");if(jo(i)!=="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function sv(e){var r=ov(e,"string");return jo(r)==="symbol"?r:String(r)}function ht(e,r,t){return r=sv(r),r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var WU="",G5={};function rs(e){for(let r in G5)if(e.startsWith(r)){let t=G5[r];e=e.replace(r,t)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${WU}${e}`),e}function W5(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function V5(e){return e&&typeof e=="object"&&e.isBuffer}function Ep(e){if(V5(e))return W5(e);if(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"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}var ts={};Au(ts,{dirname:()=>KU,filename:()=>$U,join:()=>YU,resolve:()=>XU});function $5(){var r;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(r=window.location)==null?void 0:r.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function $U(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(r+1):""}function KU(e){let r=e?e.lastIndexOf("/"):-1;return r>=0?e.substr(0,r):""}function YU(...e){let r="/";return e=e.map((t,i)=>(i&&(t=t.replace(new RegExp(`^${r}`),"")),i!==e.length-1&&(t=t.replace(new RegExp(`${r}$`),"")),t)),e.join(r)}function XU(...e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n];let t="",i=!1,a;for(let n=r.length-1;n>=-1&&!i;n--){let o;n>=0?o=r[n]:(a===void 0&&(a=$5()),o=a),o.length!==0&&(t=`${o}/${t}`,i=o.charCodeAt(0)===Hc)}return t=QU(t,!i),i?`/${t}`:t.length>0?t:"."}var Hc=47,uv=46;function QU(e,r){let t="",i=-1,a=0,n,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)n=e.charCodeAt(s);else{if(n===Hc)break;n=Hc}if(n===Hc){if(!(i===s-1||a===1))if(i!==s-1&&a===2){if(t.length<2||!o||t.charCodeAt(t.length-1)!==uv||t.charCodeAt(t.length-2)!==uv){if(t.length>2){let u=t.length-1,l=u;for(;l>=0&&t.charCodeAt(l)!==Hc;--l);if(l!==u){t=l===-1?"":t.slice(0,l),i=s,a=0,o=!1;continue}}else if(t.length===2||t.length===1){t="",i=s,a=0,o=!1;continue}}r&&(t.length>0?t+="/..":t="..",o=!0)}else{let u=e.slice(i+1,s);t.length>0?t+=`/${u}`:t=u,o=!1}i=s,a=0}else n===uv&&a!==-1?++a:a=-1}return t}var Mn=Pt(require("fs"),1),as=class{constructor(r,t,i){r=rs(r),this.handle=Mn.default.openSync(r,t,i);let a=Mn.default.fstatSync(this.handle,{bigint:!0});this.size=Number(a.size),this.bigsize=a.size,this.url=r}async close(){return new Promise((r,t)=>{Mn.default.close(this.handle,i=>i?t(i):r())})}async truncate(r){return new Promise((t,i)=>{Mn.default.ftruncate(this.handle,r,a=>{a?i(a):(this.bigsize=BigInt(r),this.size=Number(this.bigsize),t())})})}async append(r){return new Promise((t,i)=>{Mn.default.appendFile(this.handle,r,a=>{a?i(a):(this.bigsize=this.bigsize+BigInt(r.length),this.size=Number(this.bigsize),t())})})}async stat(){return await new Promise((r,t)=>Mn.default.fstat(this.handle,{bigint:!0},(i,a)=>{let n={size:Number(a.size),bigsize:a.size,isDirectory:a.isDirectory()};i?t(i):r(n)}))}async read(r,t){let i=new ArrayBuffer(t),a=BigInt(r),n=0,o=new Uint8Array(i),s;for(;t>0;){let u=await ZU(this.handle,o,0,t,a);if(u===0)break;n+=u,a+=BigInt(u),t-=u,s!==void 0&&(s+=u)}return n<t?i.slice(0,n):i}async write(r,t=0,i=r.byteLength){return new Promise((a,n)=>{let o=Number(t),s=new Uint8Array(r,Number(t),i);Mn.default.write(this.handle,s,0,i,o,(u,l)=>u?n(u):a(l))})}};async function ZU(e,r,t,i,a){return await new Promise((n,o)=>Mn.default.read(e,r,t,i,a,(s,u)=>s?o(s):n(u)))}var Pp=Pt(require("fs/promises"),1);var lv=Pt(require("fs"),1),cv=require("stream");var jp=Pt(require("zlib"),1),JU=e=>e&&e instanceof ArrayBuffer,eH=e=>e&&e instanceof Buffer;function Ap(e,r){switch(r==null?void 0:r.get("content-encoding")){case"br":return e.pipe(jp.default.createBrotliDecompress());case"gzip":return e.pipe(jp.default.createGunzip());case"deflate":return e.pipe(jp.default.createDeflate());default:return e}}async function K5(e){let r=[];return await new Promise((t,i)=>{e.on("error",a=>i(a)),e.on("readable",()=>e.read()),e.on("data",a=>{typeof a=="string"&&i(new Error("Read stream not binary")),r.push(tH(a))}),e.on("end",()=>{let a=rH(r);t(a)})})}function rH(e){let r=e.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),t=r.reduce((n,o)=>n+o.byteLength,0),i=new Uint8Array(t),a=0;for(let n of r)i.set(n,a),a+=n.byteLength;return i.buffer}function tH(e){if(JU(e))return e;if(eH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var aH=e=>typeof e=="boolean",Y5=e=>typeof e=="function",iH=e=>e!==null&&typeof e=="object",nH=e=>iH(e)&&Y5(e.read)&&Y5(e.pipe)&&aH(e.readable);async function Tp(e,r){let t=/^file:\/\//;e.replace(t,"/");let i=e.split("?")[0];i=rs(i);let a=new Headers;e.endsWith(".gz")&&(a["content-encoding"]="gzip"),e.endsWith(".br")&&(a["content-encoding"]="br");try{let n=await new Promise((h,d)=>{let m=lv.default.createReadStream(i,{encoding:null});m.once("readable",()=>h(m)),m.on("error",y=>d(y))}),o=n;nH(n)?o=Ap(n,a):typeof n=="string"?o=cv.Readable.from([new TextEncoder().encode(n)]):o=cv.Readable.from([n||new ArrayBuffer(0)]);let s=200,u="OK",l=oH(i),f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}catch(n){let o=n.message,s=400,u=o,l={},f=new Response(o,{headers:l,status:s,statusText:u});return Object.defineProperty(f,"url",{value:e}),f}}function oH(e){let r={};if(!r["content-length"]){let t=lv.default.statSync(e);r["content-length"]=t.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip"),new Headers(r)}var Rp=class{constructor(){this.readable=!0;this.writable=!0}async readdir(r=".",t){return await Pp.default.readdir(r,t)}async stat(r){let t=await Pp.default.stat(r,{bigint:!0});return{size:Number(t.size),bigsize:t.size,isDirectory:t.isDirectory()}}async unlink(r){return await Pp.default.unlink(r)}async fetch(r,t){return await Tp(r,t)}async openReadableFile(r,t="r"){return new as(r,t)}async openWritableFile(r,t="w",i){return new as(r,t,i)}};var Gc=class{constructor(r={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(r,t="base64"){var o,s;let i=[];for await(let u of r)i.push(u),yield u;let a=await this.concatenate(i),n=await this.hash(a,t);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:n})}async concatenate(r){return await Uc(r)}};var Wc=Pt(require("crypto"),1),Cp=class extends Gc{constructor(t){var i,a;super();this.name="crypto-node";if(this.options=t,!((a=(i=this.options)==null?void 0:i.crypto)!=null&&a.algorithm))throw new Error(this.name)}async hash(t,i){var n,o,s,u;let a=(s=(o=(n=this.options)==null?void 0:n.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase();try{if(!Wc.createHash)throw new Error("crypto.createHash not available");let l=(u=Wc.createHash)==null?void 0:u(a),f=new Uint8Array(t);return l.update(f).digest("base64")}catch(l){throw Error(`${a} hash not available. ${l}`)}}async*hashBatches(t,i="base64"){var o,s,u,l,f,h,d;if(!Wc.createHash)throw new Error("crypto.createHash not available");let a=(l=Wc.createHash)==null?void 0:l((u=(s=(o=this.options)==null?void 0:o.crypto)==null?void 0:s.algorithm)==null?void 0:u.toLowerCase());for await(let m of t){let y=new Uint8Array(m);a.update(y),yield m}let n=a.digest(i);(d=(h=(f=this.options)==null?void 0:f.crypto)==null?void 0:h.onEnd)==null||d.call(h,{hash:n})}};var l4=require("node:process");var X5=Pt(require("stream"),1),fv=class{},sH=X5.Readable||fv;function dv(e,r){let t=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new pv(t,r)}var pv=class extends sH{constructor(t,i){super(i);this._iterator=t,this._pulling=!1,this._bytesMode=!i||!i.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,i){var a,n,o,s;this._iterator&&(t?await((n=(a=this._iterator)==null?void 0:a.throw)==null?void 0:n.call(a,t)):await((s=(o=this._iterator)==null?void 0:o.return)==null?void 0:s.call(o,t)),i==null||i(null))}async _pull(t,i){var o;let a=this._bytesMode,n=null;for(;this.readable&&!(n=await i.next()).done&&(t!==null&&(t-=a&&ArrayBuffer.isView(n.value)?n.value.byteLength:1),!(!this.push(new Uint8Array(n.value))||t<=0)););return(n!=null&&n.done||!this.readable)&&(this.push(null)||!0)&&((o=i==null?void 0:i.return)==null||o.call(i)),!this.readable}};var J5=Pt(Z5(),1);delete globalThis.ReadableStream;var Ip=class extends J5.ReadableStream{};var Bp=class{constructor(r){this.isWorking=!1;this.isCancelled=!1;this.chunks=r}start(r){this.work(r)}async work(r){let{chunks:t}=this;for(this.isWorking=!0;!this.isCancelled&&(r.desiredSize||0)>0;){let i;try{i=t.next()}catch(a){r.error(a);break}i&&(!i.done&&!this.isCancelled?r.enqueue(i.value):r.close())}this.isWorking=!1}pull(r){this.isWorking||this.work(r)}cancel(){this.isCancelled=!0}};var Fp=class extends Ip{constructor(t){super(new Bp(t.values()),{type:"bytes"});this._chunks=t}async*[Symbol.asyncIterator](t){let i=this.getReader();yield*this._chunks,i.releaseLock()}};var is=class{constructor(r=[],t={}){this.parts=[],this.size=0;for(let i of r)if(typeof i=="string"){let a=new TextEncoder().encode(i);this.parts.push(a),this.size+=a.byteLength}else if(i instanceof is)this.size+=i.size,this.parts.push(...i.parts);else if(i instanceof ArrayBuffer)this.parts.push(new Uint8Array(i)),this.size+=i.byteLength;else if(i instanceof Uint8Array)this.parts.push(i),this.size+=i.byteLength;else if(ArrayBuffer.isView(i)){let{buffer:a,byteOffset:n,byteLength:o}=i;this.parts.push(new Uint8Array(a,n,o)),this.size+=o}else{let a=new TextEncoder().encode(String(i));this.parts.push(a),this.size+=a.byteLength}this.type=uH(t.type)}slice(r=0,t=this.size,i=""){let{size:a,parts:n}=this,o=r<0?Math.max(a+r,0):Math.min(r,a),s=t<0?Math.max(a+t,0):Math.min(t,a),u=Math.max(s-o,0),l=new is([],{type:i});if(u===0)return l;let f=0,h=[];for(let d of n){let{byteLength:m}=d;if(o>0&&m<=o)o-=m,s-=m;else{let y=d.subarray(o,Math.min(m,s));if(h.push(y),f+=y.byteLength,o=0,f>=u)break}}return l.parts=h,l.size=f,l}async arrayBuffer(){return this._toArrayBuffer()}async text(){let r=new TextDecoder,t="";for(let i of this.parts)t+=r.decode(i);return t}stream(){return new Fp(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let r=new ArrayBuffer(this.size),t=new Uint8Array(r),i=0;for(let a of this.parts)t.set(a,i),i+=a.byteLength;return r}};function uH(e=""){let r=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(r)?"":r}function cH(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=is),globalThis.Blob}var lH=cH();var Dp=class{constructor(){this.onload=null}abort(){}async readAsArrayBuffer(r){let t=await r.arrayBuffer();this.onload&&this.onload({target:{result:t}})}async readAsBinaryString(r){throw Error("Not implemented")}async readAsDataURL(r){let t=await r.text(),i=`data://;base64,${Ru(t)}`;this.onload&&this.onload({target:{result:i}})}async readAsText(r){let t=await r.text();this.onload&&this.onload({target:{result:t}})}};var Lp=class extends globalThis.Blob{constructor(t,i,a={}){super(t,a);this.name="";this.webkitRelativePath="";this.name=String(i).replace(/\//g,":"),this.lastModified=(a==null?void 0:a.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function e4(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=Dp),typeof File>"u"&&!globalThis.File&&(globalThis.File=Lp),global}var fH=e4();var hv=Pt(require("module"),1),r4=Pt(require("path"),1),Mp=Pt(require("fs"),1);async function t4(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Mp.default.readFileSync(e).buffer}async function a4(e){return e.startsWith("http")?await(await fetch(e)).text():Mp.default.readFileSync(e,"utf8")}async function i4(e){if(e.startsWith("http")){let i=await(await fetch(e)).text();return qp(i)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let r=await Mp.default.readFileSync(e,"utf8");return qp(r)}function qp(e,r="",t){if(typeof r=="object"&&(t=r,r=""),r=r.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let i=hv.default._nodeModulePaths(r4.default.dirname(r)),a=typeof module<"u"&&(module==null?void 0:module.parent),n=new hv.default(r,a);return n.filename=r,n.paths=[].concat((t==null?void 0:t.prependPaths)||[]).concat(i).concat((t==null?void 0:t.appendPaths)||[]),n._compile(e,r),a&&a.children&&a.children.splice(a.children.indexOf(n),1),n.exports}var Ni=class{constructor(r){this.map={},r instanceof Ni?r.forEach((t,i)=>this.append(i,t)):Array.isArray(r)?r.forEach(t=>this.append(t[0],t[1])):r&&Object.getOwnPropertyNames(r).forEach(t=>this.append(t,r[t]))}append(r,t){r=Vc(r),t=n4(t);let i=this.map[r];this.map[r]=i?`${i}, ${t}`:t}delete(r){delete this.map[Vc(r)]}get(r){return r=Vc(r),this.has(r)?this.map[r]:null}has(r){return this.map.hasOwnProperty(Vc(r))}set(r,t){this.map[Vc(r)]=n4(t)}forEach(r,t=null){for(let i in this.map)this.map.hasOwnProperty(i)&&(t?r.call(t,this.map[i],i,this):r(this.map[i],i,this))}keys(){let r=[];return this.forEach(function(t,i){r.push(i)}),mv(r)}values(){let r=[];return this.forEach(function(t){r.push(t)}),mv(r)}entries(){let r=[];return this.forEach(function(t,i){r.push([i,t])}),mv(r)}*[Symbol.iterator](){yield*this.entries()}};function Vc(e){if(typeof e!="string"&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e)||e==="")throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function n4(e){return typeof e!="string"&&(e=String(e)),e}function mv(e){let r={next(){let t=e.shift();return{done:t===void 0,value:t}}};return r[Symbol.iterator]=function(){return r},r}function gv(e,r){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${r}`)}var bv=Pt(require("stream"),1),pH=e=>typeof e=="boolean",o4=e=>typeof e=="function",dH=e=>e!==null&&typeof e=="object",vv=e=>dH(e)&&o4(e.read)&&o4(e.pipe)&&pH(e.readable),zn=class{constructor(r,t){this.bodyUsed=!1;let{headers:i,status:a=200,statusText:n="OK",url:o}=t||{};this.url=o,this.ok=a===200,this.status=a,this.statusText=n,this.headers=new Ni((t==null?void 0:t.headers)||{}),vv(r)?this._body=Ap(r,i):typeof r=="string"?this._body=bv.Readable.from([new TextEncoder().encode(r)]):this._body=bv.Readable.from([r||new ArrayBuffer(0)])}get body(){return gv(!this.bodyUsed),gv(vv(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return vv(this._body)?await K5(this._body):this._body||new ArrayBuffer(0)}async text(){let r=await this.arrayBuffer();return new TextDecoder().decode(r)}async json(){let r=await this.text();return JSON.parse(r)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var u4=Pt(require("http"),1),c4=Pt(require("https"),1);var hH=e=>e&&e instanceof ArrayBuffer,mH=e=>e&&e instanceof Buffer;function s4(e){let r=e.indexOf(","),t,i;return e.slice(r-7,r)===";base64"?(t=Buffer.from(e.slice(r+1),"base64"),i=e.slice(5,r-7).trim()):(t=Buffer.from(decodeURIComponent(e.slice(r+1))),i=e.slice(5,r).trim()),i?i.startsWith(";")&&(i=`text/plain${i}`):i="text/plain;charset=US-ASCII",{arrayBuffer:gH(t),mimeType:i}}function gH(e){if(hH(e))return e;if(mH(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let r=e;return new TextEncoder().encode(r).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var yv=e=>e.startsWith("data:"),vH=e=>e.startsWith("http:")||e.startsWith("https:");async function $c(e,r){try{if(globalThis.fetch!==$c&&(vH(e)||yv(e)))return await fetch(e,r);if(yv(e)){let{arrayBuffer:l,mimeType:f}=s4(e);return new zn(l,{headers:{"content-type":f},url:e})}let t={},i=e;e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip");let a=await bH(i,r),n=_H(e,a,t),{status:o,statusText:s}=wH(a),u=!r||r.followRedirect||r.followRedirect===void 0;if(o>=300&&o<400&&n.has("location")&&u){let l=yH(e,n.get("location"));return await $c(l,r)}return new zn(a,{headers:n,status:o,statusText:s,url:e})}catch(t){return new zn(null,{status:400,statusText:String(t),url:e})}}async function bH(e,r){return await new Promise((t,i)=>{let a=xH(e,r),n=e.startsWith("https:")?c4.default.request(a,o=>t(o)):u4.default.request(a,o=>t(o));n.on("error",o=>i(o)),n.end()})}function yH(e,r){if(r.startsWith("http"))return r;let t=new URL(e);return t.pathname=r,t.href}function xH(e,r){let t=(r==null?void 0:r.headers)||{},i={};for(let n of Object.keys(t))i[n.toLowerCase()]=t[n];i["accept-encoding"]=i["accept-encoding"]||"gzip,br,deflate";let a=new URL(e);return{hostname:a.hostname,path:a.pathname,method:"GET",...r,...r==null?void 0:r.fetch,headers:i,port:a.port}}function wH(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function _H(e,r,t={}){let i={};if(r&&r.headers){let a=r.headers;for(let n in a){let o=a[n];i[n.toLowerCase()]=String(o)}}if(!i["content-length"]){let a=kH(e);Number.isFinite(a)&&(i["content-length"]=a)}return Object.assign(i,t),new Ni(i)}function kH(e){return yv(e)?e.length-5:null}var SH=parseInt(l4.versions.node.split(".")[0]);K1&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=dv;globalThis.loaders.NodeFile=as;globalThis.loaders.NodeFileSystem=Rp;globalThis.loaders.fetchNode=Tp;globalThis.loaders.NodeHash=Cp;globalThis.TextEncoder||(globalThis.TextEncoder=Pu);globalThis.TextDecoder||(globalThis.TextDecoder=Bo);!("atob"in globalThis)&&Ru&&(globalThis.atob=Ru);!("btoa"in globalThis)&&Nd&&(globalThis.btoa=Nd);globalThis.loaders.encodeImageNode=Jx;globalThis.loaders.parseImageNode=Hg;globalThis.loaders.imageFormatsNode=Ug;globalThis._parseImageNode=Hg;globalThis._imageFormatsNode=Ug;globalThis.loaders.readFileAsArrayBuffer=t4;globalThis.loaders.readFileAsText=a4;globalThis.loaders.requireFromFile=i4;globalThis.loaders.requireFromString=qp;SH<18&&(!("Headers"in globalThis)&&Ni&&(globalThis.Headers=Ni),!("Response"in globalThis)&&zn&&(globalThis.Response=zn),!("fetch"in globalThis)&&$c&&(globalThis.fetch=$c));var EH=e=>typeof e=="boolean",Kc=e=>typeof e=="function",ns=e=>e!==null&&typeof e=="object",xv=e=>ns(e)&&e.constructor==={}.constructor;var f4=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",p4=e=>e&&typeof e[Symbol.asyncIterator]=="function";var di=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var hi=e=>typeof Blob<"u"&&e instanceof Blob,d4=e=>e&&typeof e=="object"&&e.isBuffer;var jH=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||ns(e)&&Kc(e.tee)&&Kc(e.cancel)&&Kc(e.getReader);var AH=e=>ns(e)&&Kc(e.read)&&Kc(e.pipe)&&EH(e.readable),zp=e=>jH(e)||AH(e);var TH=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,PH=/^([-\w.]+\/[-\w.+]+)/;function h4(e){let r=PH.exec(e);return r?r[1]:e}function wv(e){let r=TH.exec(e);return r?r[1]:""}var m4=/\?.*/;function g4(e){let r=e.match(m4);return r&&r[0]}function lu(e){return e.replace(m4,"")}function os(e){return di(e)?e.url:hi(e)?e.name||"":typeof e=="string"?e:""}function Yc(e){if(di(e)){let r=e,t=r.headers.get("content-type")||"",i=lu(r.url);return h4(t)||wv(i)}return hi(e)?e.type||"":typeof e=="string"?wv(e):""}function v4(e){return di(e)?e.headers["content-length"]||-1:hi(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function Np(e){if(di(e))return e;let r={},t=v4(e);t>=0&&(r["content-length"]=String(t));let i=os(e),a=Yc(e);a&&(r["content-type"]=a);let n=await CH(e);n&&(r["x-first-bytes"]=n),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:r});return Object.defineProperty(o,"url",{value:i}),o}async function b4(e){if(!e.ok){let r=await RH(e);throw new Error(r)}}async function RH(e){let r=`Failed to fetch resource ${e.url} (${e.status}): `;try{let t=e.headers.get("Content-Type"),i=e.statusText;t!=null&&t.includes("application/json")&&(i+=` ${await e.text()}`),r+=i,r=r.length>60?`${r.slice(0,60)}...`:r}catch{}return r}async function CH(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let t=e.slice(0,5);return await new Promise(i=>{let a=new FileReader;a.onload=n=>{var o;return i((o=n==null?void 0:n.target)==null?void 0:o.result)},a.readAsDataURL(t)})}if(e instanceof ArrayBuffer){let t=e.slice(0,5);return`data:base64,${OH(t)}`}return null}function OH(e){let r="",t=new Uint8Array(e);for(let i=0;i<t.byteLength;i++)r+=String.fromCharCode(t[i]);return btoa(r)}function IH(e){return!BH(e)&&!FH(e)}function BH(e){return e.startsWith("http:")||e.startsWith("https:")}function FH(e){return e.startsWith("data:")}async function _v(e,r){var t,i;if(typeof e=="string"){let a=rs(e);return IH(a)&&(t=globalThis.loaders)!=null&&t.fetchNode?(i=globalThis.loaders)==null?void 0:i.fetchNode(a,r):await fetch(a,r)}return await Np(e)}function kv(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let r=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,t=e||r;return!!(t&&t.indexOf("Electron")>=0)}function Ui(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||kv()}var DH=globalThis.self||globalThis.window||globalThis.global,fu=globalThis.window||globalThis.self||globalThis.global,LH=globalThis.document||{},ss=globalThis.process||{},qH=globalThis.console,Cte=globalThis.navigator||{};var Up="4.1.2",Bte=Ui();function MH(e){try{let r=window[e],t="__storage_test__";return r.setItem(t,t),r.removeItem(t),r}catch{return null}}var Hp=class{constructor(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";ht(this,"storage",void 0),ht(this,"id",void 0),ht(this,"config",void 0),this.storage=MH(i),this.id=r,this.config=t,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(r){if(Object.assign(this.config,r),this.storage){let t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let r={};if(this.storage){let t=this.storage.getItem(this.id);r=t?JSON.parse(t):{}}return Object.assign(this.config,r),this}};function y4(e){let r;return e<10?r="".concat(e.toFixed(2),"ms"):e<100?r="".concat(e.toFixed(1),"ms"):e<1e3?r="".concat(e.toFixed(0),"ms"):r="".concat((e/1e3).toFixed(2),"s"),r}function x4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,t=Math.max(r-e.length,0);return"".concat(" ".repeat(t)).concat(e)}function Gp(e,r,t){let i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,a=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>i&&(t=Math.min(t,i/e.width));let n=e.width*t,o=e.height*t,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(n/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(a,");"),"background-size:".concat(n,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(r," %c+"),s]}var Wp;(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"})(Wp||(Wp={}));var zH=10;function w4(e){return typeof e!="string"?e:(e=e.toUpperCase(),Wp[e]||Wp.WHITE)}function _4(e,r,t){if(!Ui&&typeof e=="string"){if(r){let i=w4(r);e="\x1B[".concat(i,"m").concat(e,"\x1B[39m")}if(t){let i=w4(t);e="\x1B[".concat(i+zH,"m").concat(e,"\x1B[49m")}}return e}function k4(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],t=Object.getPrototypeOf(e),i=Object.getOwnPropertyNames(t),a=e;for(let n of i){let o=a[n];typeof o=="function"&&(r.find(s=>n===s)||(a[n]=o.bind(e)))}}function pu(e,r){if(!e)throw new Error(r||"Assertion failed")}function us(){let e;if(Ui()&&fu.performance){var r,t;e=fu===null||fu===void 0||(r=fu.performance)===null||r===void 0||(t=r.now)===null||t===void 0?void 0:t.call(r)}else if("hrtime"in ss){var i;let a=ss===null||ss===void 0||(i=ss.hrtime)===null||i===void 0?void 0:i.call(ss);e=a[0]*1e3+a[1]/1e6}else e=Date.now();return e}var du={debug:Ui()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},NH={enabled:!0,level:0};function mi(){}var S4={},E4={once:!0},vn=class{constructor(){let{id:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};ht(this,"id",void 0),ht(this,"VERSION",Up),ht(this,"_startTs",us()),ht(this,"_deltaTs",us()),ht(this,"_storage",void 0),ht(this,"userData",{}),ht(this,"LOG_THROTTLE_TIMEOUT",0),this.id=r,this.userData={},this._storage=new Hp("__probe-".concat(this.id,"__"),NH),this.timeStamp("".concat(this.id," started")),k4(this),Object.seal(this)}set level(r){this.setLevel(r)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((us()-this._startTs).toPrecision(10))}getDelta(){return Number((us()-this._deltaTs).toPrecision(10))}set priority(r){this.level=r}get priority(){return this.level}getPriority(){return this.level}enable(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:r}),this}setLevel(r){return this._storage.setConfiguration({level:r}),this}get(r){return this._storage.config[r]}set(r,t){this._storage.setConfiguration({[r]:t})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(r,t){pu(r,t)}warn(r){return this._getLogFunction(0,r,du.warn,arguments,E4)}error(r){return this._getLogFunction(0,r,du.error,arguments)}deprecated(r,t){return this.warn("`".concat(r,"` is deprecated and will be removed in a later version. Use `").concat(t,"` instead"))}removed(r,t){return this.error("`".concat(r,"` has been removed. Use `").concat(t,"` instead"))}probe(r,t){return this._getLogFunction(r,t,du.log,arguments,{time:!0,once:!0})}log(r,t){return this._getLogFunction(r,t,du.debug,arguments)}info(r,t){return this._getLogFunction(r,t,console.info,arguments)}once(r,t){return this._getLogFunction(r,t,du.debug||du.info,arguments,E4)}table(r,t,i){return t?this._getLogFunction(r,t,console.table||mi,i&&[i],{tag:WH(t)}):mi}image(r){let{logLevel:t,priority:i,image:a,message:n="",scale:o=1}=r;return this._shouldLog(t||i)?Ui()?GH({image:a,message:n,scale:o}):HH({image:a,message:n,scale:o}):mi}time(r,t){return this._getLogFunction(r,t,console.time?console.time:console.info)}timeEnd(r,t){return this._getLogFunction(r,t,console.timeEnd?console.timeEnd:console.info)}timeStamp(r,t){return this._getLogFunction(r,t,console.timeStamp||mi)}group(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},a=j4({logLevel:r,message:t,opts:i}),{collapsed:n}=i;return a.method=(n?console.groupCollapsed:console.group)||console.info,this._getLogFunction(a)}groupCollapsed(r,t){let i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(r,t,Object.assign({},i,{collapsed:!0}))}groupEnd(r){return this._getLogFunction(r,"",console.groupEnd||mi)}withGroup(r,t,i){this.group(r,t)();try{i()}finally{this.groupEnd(r)()}}trace(){console.trace&&console.trace()}_shouldLog(r){return this.isEnabled()&&this.getLevel()>=A4(r)}_getLogFunction(r,t,i,a,n){if(this._shouldLog(r)){n=j4({logLevel:r,message:t,args:a,opts:n}),i=i||n.method,pu(i),n.total=this.getTotal(),n.delta=this.getDelta(),this._deltaTs=us();let o=n.tag||n.message;if(n.once&&o)if(!S4[o])S4[o]=us();else return mi;return t=UH(this.id,n.message,n),i.bind(console,t,...n.args)}return mi}};ht(vn,"VERSION",Up);function A4(e){if(!e)return 0;let r;switch(typeof e){case"number":r=e;break;case"object":r=e.logLevel||e.priority||0;break;default:return 0}return pu(Number.isFinite(r)&&r>=0),r}function j4(e){let{logLevel:r,message:t}=e;e.logLevel=A4(r);let i=e.args?Array.from(e.args):[];for(;i.length&&i.shift()!==t;);switch(typeof r){case"string":case"function":t!==void 0&&i.unshift(t),e.message=r;break;case"object":Object.assign(e,r);break;default:}typeof e.message=="function"&&(e.message=e.message());let a=typeof e.message;return pu(a==="string"||a==="object"),Object.assign(e,{args:i},e.opts)}function UH(e,r,t){if(typeof r=="string"){let i=t.time?x4(y4(t.total)):"";r=t.time?"".concat(e,": ").concat(i," ").concat(r):"".concat(e,": ").concat(r),r=_4(r,t.color,t.background)}return r}function HH(e){let{image:r,message:t="",scale:i=1}=e;return console.warn("removed"),mi}function GH(e){let{image:r,message:t="",scale:i=1}=e;if(typeof r=="string"){let n=new Image;return n.onload=()=>{let o=Gp(n,t,i);console.log(...o)},n.src=r,mi}let a=r.nodeName||"";if(a.toLowerCase()==="img")return console.log(...Gp(r,t,i)),mi;if(a.toLowerCase()==="canvas"){let n=new Image;return n.onload=()=>console.log(...Gp(n,t,i)),n.src=r.toDataURL(),mi}return mi}function WH(e){for(let r in e)for(let t in e[r])return t||"untitled";return"empty"}var sae=new vn({id:"@probe.gl/log"});var Sv=new vn({id:"loaders.gl"}),Vp=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},$p=class{constructor(){this.console=console}log(...r){return this.console.log.bind(this.console,...r)}info(...r){return this.console.info.bind(this.console,...r)}warn(...r){return this.console.warn.bind(this.console,...r)}error(...r){return this.console.error.bind(this.console,...r)}};var Ev={fetch:null,mimeType:void 0,nothrow:!1,log:new $p,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:Jo,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},T4={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 jv(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function Av(){let e=jv();return e.globalOptions=e.globalOptions||{...Ev},e.globalOptions}function C4(e,r,t,i){return t=t||[],t=Array.isArray(t)?t:[t],VH(e,t),KH(r,e,i)}function VH(e,r){P4(e,null,Ev,T4,r);for(let t of r){let i=e&&e[t.id]||{},a=t.options&&t.options[t.id]||{},n=t.deprecatedOptions&&t.deprecatedOptions[t.id]||{};P4(i,t.id,a,n,r)}}function P4(e,r,t,i,a){let n=r||"Top level",o=r?`${r}.`:"";for(let s in e){let u=!r&&ns(e[s]),l=s==="baseUri"&&!r,f=s==="workerUrl"&&r;if(!(s in t)&&!l&&!f){if(s in i)Sv.warn(`${n} loader option '${o}${s}' no longer supported, use '${i[s]}'`)();else if(!u){let h=$H(s,a);Sv.warn(`${n} loader option '${o}${s}' not recognized. ${h}`)()}}}}function $H(e,r){let t=e.toLowerCase(),i="";for(let a of r)for(let n in a.options){if(e===n)return`Did you mean '${a.id}.${n}'?`;let o=n.toLowerCase();(t.startsWith(o)||o.startsWith(t))&&(i=i||`Did you mean '${a.id}.${n}'?`)}return i}function KH(e,r,t){let a={...e.options||{}};return YH(a,t),a.log===null&&(a.log=new Vp),R4(a,Av()),R4(a,r),a}function R4(e,r){for(let t in r)if(t in r){let i=r[t];xv(i)&&xv(e[t])?e[t]={...e[t],...r[t]}:e[t]=r[t]}}function YH(e,r){r&&!("baseUri"in e)&&(e.baseUri=r)}function Xc(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function Tv(e){zi(e,"null loader"),zi(Xc(e),"invalid loader");let r;return Array.isArray(e)&&(r=e[1],e=e[0],e={...e,options:{...e.options,...r}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var XH=()=>{let e=jv();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function O4(){return XH()}var I4=new vn({id:"loaders.gl"});var QH=/\.([^.]+)$/;async function D4(e,r=[],t,i){if(!L4(e))return null;let a=B4(e,r,{...t,nothrow:!0},i);if(a)return a;if(hi(e)&&(e=await e.slice(0,10).arrayBuffer(),a=B4(e,r,t,i)),!a&&!(t!=null&&t.nothrow))throw new Error(q4(e));return a}function B4(e,r=[],t,i){if(!L4(e))return null;if(r&&!Array.isArray(r))return Tv(r);let a=[];r&&(a=a.concat(r)),t!=null&&t.ignoreRegisteredLoaders||a.push(...O4()),JH(a);let n=ZH(e,a,t,i);if(!n&&!(t!=null&&t.nothrow))throw new Error(q4(e));return n}function ZH(e,r,t,i){let a=os(e),n=Yc(e),o=lu(a)||(i==null?void 0:i.url),s=null,u="";return t!=null&&t.mimeType&&(s=Pv(r,t==null?void 0:t.mimeType),u=`match forced by supplied MIME type ${t==null?void 0:t.mimeType}`),s=s||eG(r,o),u=u||(s?`matched url ${o}`:""),s=s||Pv(r,n),u=u||(s?`matched MIME type ${n}`:""),s=s||tG(r,e),u=u||(s?`matched initial data ${M4(e)}`:""),t!=null&&t.fallbackMimeType&&(s=s||Pv(r,t==null?void 0:t.fallbackMimeType),u=u||(s?`matched fallback MIME type ${n}`:"")),u&&I4.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function L4(e){return!(e instanceof Response&&e.status===204)}function q4(e){let r=os(e),t=Yc(e),i="No valid loader found (";i+=r?`${ts.filename(r)}, `:"no url provided, ",i+=`MIME type: ${t?`"${t}"`:"not provided"}, `;let a=e?M4(e):"";return i+=a?` first bytes: "${a}"`:"first bytes: not available",i+=")",i}function JH(e){for(let r of e)Tv(r)}function eG(e,r){let t=r&&QH.exec(r),i=t&&t[1];return i?rG(e,i):null}function rG(e,r){r=r.toLowerCase();for(let t of e)for(let i of t.extensions)if(i.toLowerCase()===r)return t;return null}function Pv(e,r){for(let t of e)if(t.mimeTypes&&t.mimeTypes.includes(r)||r===`application/x.${t.id}`)return t;return null}function tG(e,r){if(!r)return null;for(let t of e)if(typeof r=="string"){if(aG(r,t))return t}else if(ArrayBuffer.isView(r)){if(F4(r.buffer,r.byteOffset,t))return t}else if(r instanceof ArrayBuffer&&F4(r,0,t))return t;return null}function aG(e,r){return r.testText?r.testText(e):(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>e.startsWith(i))}function F4(e,r,t){return(Array.isArray(t.tests)?t.tests:[t.tests]).some(a=>iG(e,r,t,a))}function iG(e,r,t,i){if(i instanceof ArrayBuffer)return iv(i,e,i.byteLength);switch(typeof i){case"function":return i(e);case"string":let a=Rv(e,r,i.length);return i===a;default:return!1}}function M4(e,r=5){return typeof e=="string"?e.slice(0,r):ArrayBuffer.isView(e)?Rv(e.buffer,e.byteOffset,r):e instanceof ArrayBuffer?Rv(e,0,r):""}function Rv(e,r,t){if(e.byteLength<r+t)return"";let i=new DataView(e),a="";for(let n=0;n<t;n++)a+=String.fromCharCode(i.getUint8(r+n));return a}function*z4(e,r){let t=(r==null?void 0:r.chunkSize)||262144,i=0,a=new TextEncoder;for(;i<e.length;){let n=Math.min(e.length-i,t),o=e.slice(i,i+n);i+=n,yield a.encode(o)}}function*N4(e,r={}){let{chunkSize:t=262144}=r,i=0;for(;i<e.byteLength;){let a=Math.min(e.byteLength-i,t),n=new ArrayBuffer(a),o=new Uint8Array(e,i,a);new Uint8Array(n).set(o),i+=a,yield n}}async function*U4(e,r){let t=(r==null?void 0:r.chunkSize)||1048576,i=0;for(;i<e.size;){let a=i+t,n=await e.slice(i,a).arrayBuffer();i=a,yield n}}function Cv(e,r){return Jo?nG(e,r):oG(e,r)}async function*nG(e,r){let t=e.getReader(),i;try{for(;;){let a=i||t.read();r!=null&&r._streamReadAhead&&(i=t.read());let{done:n,value:o}=await a;if(n)return;yield Ep(o)}}catch{t.releaseLock()}}async function*oG(e,r){for await(let t of e)yield Ep(t)}function H4(e,r){if(typeof e=="string")return z4(e,r);if(e instanceof ArrayBuffer)return N4(e,r);if(hi(e))return U4(e,r);if(zp(e))return Cv(e,r);if(di(e))return Cv(e.body,r);throw new Error("makeIterator")}var G4="Cannot convert supplied data type";function sG(e,r,t){if(r.text&&typeof e=="string")return e;if(d4(e)&&(e=e.buffer),e instanceof ArrayBuffer){let i=e;return r.text&&!r.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(e)){if(r.text&&!r.binary)return new TextDecoder("utf8").decode(e);let i=e.buffer,a=e.byteLength||e.length;return(e.byteOffset!==0||a!==i.byteLength)&&(i=i.slice(e.byteOffset,e.byteOffset+a)),i}throw new Error(G4)}async function W4(e,r,t){let i=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||i)return sG(e,r,t);if(hi(e)&&(e=await Np(e)),di(e)){let a=e;return await b4(a),r.binary?await a.arrayBuffer():await a.text()}if(zp(e)&&(e=H4(e,t)),f4(e)||p4(e))return Uc(e);throw new Error(G4)}function Kp(e,r){let t=Av(),i=e||t;return typeof i.fetch=="function"?i.fetch:ns(i.fetch)?a=>_v(a,i.fetch):r!=null&&r.fetch?r==null?void 0:r.fetch:_v}function V4(e,r,t){if(t)return t;let i={fetch:Kp(r,e),...e};if(i.url){let a=lu(i.url);i.baseUrl=a,i.queryString=g4(i.url),i.filename=ts.filename(a),i.baseUrl=ts.dirname(a)}return Array.isArray(i.loaders)||(i.loaders=null),i}function $4(e,r){if(e&&!Array.isArray(e))return e;let t;if(e&&(t=Array.isArray(e)?e:[e]),r&&r.loaders){let i=Array.isArray(r.loaders)?r.loaders:[r.loaders];t=t?[...t,...i]:i}return t&&t.length?t:void 0}async function Nn(e,r,t,i){r&&!Array.isArray(r)&&!Xc(r)&&(i=void 0,t=r,r=void 0),e=await e,t=t||{};let a=os(e),o=$4(r,i),s=await D4(e,o,t);return s?(t=C4(t,s,o,a),i=V4({url:a,_parse:Nn,loaders:o},t,i||null),await uG(s,e,t,i)):null}async function uG(e,r,t,i){if(Qg(e),t=Wg(e.options,t),di(r)){let n=r,{ok:o,redirected:s,status:u,statusText:l,type:f,url:h}=n,d=Object.fromEntries(n.headers.entries());i.response={headers:d,ok:o,redirected:s,status:u,statusText:l,type:f,url:h}}r=await W4(r,e,t);let a=e;if(a.parseTextSync&&typeof r=="string")return a.parseTextSync(r,t,i);if(tv(e,t))return await av(e,r,t,i,Nn);if(a.parseText&&typeof r=="string")return await a.parseText(r,t,i);if(a.parse)return await a.parse(r,t,i);throw ma(!a.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function K4(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Ov(e){let r=1/0,t=1/0,i=1/0,a=-1/0,n=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let l=0;l<u;l+=3){let f=s[l],h=s[l+1],d=s[l+2];r=f<r?f:r,t=h<t?h:t,i=d<i?d:i,a=f>a?f:a,n=h>n?h:n,o=d>o?d:o}return[[r,t,i],[a,n,o]]}function Iv(e,r,t){let i=K4(r.value),a=t||Y4(r);return{name:e,type:{type:"fixed-size-list",listSize:r.size,children:[{name:"value",type:i}]},nullable:!1,metadata:a}}function Y4(e){let r={};return"byteOffset"in e&&(r.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(r.byteStride=e.byteStride.toString(10)),"normalized"in e&&(r.normalized=e.normalized.toString()),r}async function Bv(e,r,t,i){let a,n;!Array.isArray(r)&&!Xc(r)?(a=[],n=r,i=void 0):(a=r,n=t);let o=Kp(n),s=e;return typeof e=="string"&&(s=await o(e)),hi(e)&&(s=await o(e)),Array.isArray(a)?await Nn(s,a,n):await Nn(s,a,n)}var cG=1/Math.PI*180,lG=1/180*Math.PI,fG={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...fG}};var Bt=globalThis.mathgl.config;function Fv(e,{precision:r=Bt.precision}={}){return e=pG(e),"".concat(parseFloat(e.toPrecision(r)))}function Ao(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Dv(e){return X4(e)}function Lv(e){return Q4(e)}function X4(e,r){return Z4(e,t=>t*lG,r)}function Q4(e,r){return Z4(e,t=>t*cG,r)}function Un(e,r,t){let i=Bt.EPSILON;t&&(Bt.EPSILON=t);try{if(e===r)return!0;if(Ao(e)&&Ao(r)){if(e.length!==r.length)return!1;for(let a=0;a<e.length;++a)if(!Un(e[a],r[a]))return!1;return!0}return e&&e.equals?e.equals(r):r&&r.equals?r.equals(e):typeof e=="number"&&typeof r=="number"?Math.abs(e-r)<=Bt.EPSILON*Math.max(1,Math.abs(e),Math.abs(r)):!1}finally{Bt.EPSILON=i}}function pG(e){return Math.round(e/Bt.EPSILON)*Bt.EPSILON}function dG(e){return e.clone?e.clone():new Array(e.length)}function Z4(e,r,t){if(Ao(e)){let i=e;t=t||dG(i);for(let a=0;a<t.length&&a<i.length;++a){let n=typeof e=="number"?e:e[a];t[a]=r(n,a,t)}return t}return r(e)}function hG(e){function r(){var t=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(t,Object.getPrototypeOf(this)),t}return r.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(r,e):r.__proto__=e,r}var hu=class extends hG(Array){clone(){return new this.constructor().copy(this)}fromArray(r,t=0){for(let i=0;i<this.ELEMENTS;++i)this[i]=r[i+t];return this.check()}toArray(r=[],t=0){for(let i=0;i<this.ELEMENTS;++i)r[t+i]=this[i];return r}toObject(r){return r}from(r){return Array.isArray(r)?this.copy(r):this.fromObject(r)}to(r){return r===this?this:Ao(r)?this.toArray(r):this.toObject(r)}toTarget(r){return r?this.to(r):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Bt)}formatString(r){let t="";for(let i=0;i<this.ELEMENTS;++i)t+=(i>0?", ":"")+Fv(this[i],r);return"".concat(r.printTypes?this.constructor.name:"","[").concat(t,"]")}equals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!Un(this[t],r[t]))return!1;return!0}exactEquals(r){if(!r||this.length!==r.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==r[t])return!1;return!0}negate(){for(let r=0;r<this.ELEMENTS;++r)this[r]=-this[r];return this.check()}lerp(r,t,i){if(i===void 0)return this.lerp(this,r,t);for(let a=0;a<this.ELEMENTS;++a){let n=r[a],o=typeof t=="number"?t:t[a];this[a]=n+i*(o-n)}return this.check()}min(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(r[t],this[t]);return this.check()}max(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(r[t],this[t]);return this.check()}clamp(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r[i]),t[i]);return this.check()}add(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]+=t[i];return this.check()}subtract(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]-=t[i];return this.check()}scale(r){if(typeof r=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;else for(let t=0;t<this.ELEMENTS&&t<r.length;++t)this[t]*=r[t];return this.check()}multiplyByScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}check(){if(Bt.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let r=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)r=r&&Number.isFinite(this[t]);return r}sub(r){return this.subtract(r)}setScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]=r;return this.check()}addScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]+=r;return this.check()}subScalar(r){return this.addScalar(-r)}multiplyScalar(r){for(let t=0;t<this.ELEMENTS;++t)this[t]*=r;return this.check()}divideScalar(r){return this.multiplyByScalar(1/r)}clampScalar(r,t){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],r),t);return this.check()}get elements(){return this}};function mG(e,r){if(e.length!==r)return!1;for(let t=0;t<e.length;++t)if(!Number.isFinite(e[t]))return!1;return!0}function Aa(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Yp(e,r,t=""){if(Bt.debug&&!mG(e,r))throw new Error("math.gl: ".concat(t," some fields set to invalid numbers'"));return e}function gi(e,r){if(!e)throw new Error("math.gl assertion ".concat(r))}var Xp=class extends hu{get x(){return this[0]}set x(r){this[0]=Aa(r)}get y(){return this[1]}set y(r){this[1]=Aa(r)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let r=0;for(let t=0;t<this.ELEMENTS;++t)r+=this[t]*this[t];return r}magnitudeSquared(){return this.lengthSquared()}distance(r){return Math.sqrt(this.distanceSquared(r))}distanceSquared(r){let t=0;for(let i=0;i<this.ELEMENTS;++i){let a=this[i]-r[i];t+=a*a}return Aa(t)}dot(r){let t=0;for(let i=0;i<this.ELEMENTS;++i)t+=this[i]*r[i];return Aa(t)}normalize(){let r=this.magnitude();if(r!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=r;return this.check()}multiply(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]*=t[i];return this.check()}divide(...r){for(let t of r)for(let i=0;i<this.ELEMENTS;++i)this[i]/=t[i];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(r){return this.distance(r)}distanceToSquared(r){return this.distanceSquared(r)}getComponent(r){return gi(r>=0&&r<this.ELEMENTS,"index is out of range"),Aa(this[r])}setComponent(r,t){return gi(r>=0&&r<this.ELEMENTS,"index is out of range"),this[r]=t,this.check()}addVectors(r,t){return this.copy(r).add(t)}subVectors(r,t){return this.copy(r).subtract(t)}multiplyVectors(r,t){return this.copy(r).multiply(t)}addScaledVector(r,t){return this.add(new this.constructor(r).multiplyScalar(t))}};var Hi=typeof Float32Array<"u"?Float32Array:Array,Qc=Math.random;function mu(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Uie=Math.PI/180;function gG(){let e=new Hi(2);return Hi!=Float32Array&&(e[0]=0,e[1]=0),e}function J4(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[4]*a+t[12],e[1]=t[1]*i+t[5]*a+t[13],e}var Hie=function(){let e=gG();return function(r,t,i,a,n,o){let s,u;for(t||(t=2),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],n(e,e,o),r[s]=e[0],r[s+1]=e[1];return r}}();function ej(e,r,t){let i=r[0],a=r[1],n=t[3]*i+t[7]*a||1;return e[0]=(t[0]*i+t[4]*a)/n,e[1]=(t[1]*i+t[5]*a)/n,e}function Qp(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n||1;return e[0]=(t[0]*i+t[4]*a+t[8]*n)/o,e[1]=(t[1]*i+t[5]*a+t[9]*n)/o,e[2]=(t[2]*i+t[6]*a+t[10]*n)/o,e}function rj(e,r,t){let i=r[0],a=r[1];return e[0]=t[0]*i+t[2]*a,e[1]=t[1]*i+t[3]*a,e[2]=r[2],e}var Jc={};Au(Jc,{add:()=>wG,angle:()=>Vv,bezier:()=>FG,ceil:()=>_G,clone:()=>vG,copy:()=>yG,create:()=>tj,cross:()=>zv,dist:()=>GG,distance:()=>sj,div:()=>HG,divide:()=>oj,dot:()=>Mv,equals:()=>zG,exactEquals:()=>MG,floor:()=>kG,forEach:()=>KG,fromValues:()=>bG,hermite:()=>BG,inverse:()=>RG,len:()=>VG,length:()=>aj,lerp:()=>OG,max:()=>EG,min:()=>SG,mul:()=>UG,multiply:()=>nj,negate:()=>PG,normalize:()=>CG,random:()=>DG,rotateX:()=>Hv,rotateY:()=>Gv,rotateZ:()=>Wv,round:()=>jG,scale:()=>AG,scaleAndAdd:()=>TG,set:()=>xG,slerp:()=>IG,sqrDist:()=>WG,sqrLen:()=>$G,squaredDistance:()=>uj,squaredLength:()=>cj,str:()=>qG,sub:()=>NG,subtract:()=>ij,transformMat3:()=>Nv,transformMat4:()=>Zc,transformQuat:()=>Uv,zero:()=>LG});function tj(){let e=new Hi(3);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function vG(e){let r=new Hi(3);return r[0]=e[0],r[1]=e[1],r[2]=e[2],r}function aj(e){let r=e[0],t=e[1],i=e[2];return Math.sqrt(r*r+t*t+i*i)}function bG(e,r,t){let i=new Hi(3);return i[0]=e,i[1]=r,i[2]=t,i}function yG(e,r){return e[0]=r[0],e[1]=r[1],e[2]=r[2],e}function xG(e,r,t,i){return e[0]=r,e[1]=t,e[2]=i,e}function wG(e,r,t){return e[0]=r[0]+t[0],e[1]=r[1]+t[1],e[2]=r[2]+t[2],e}function ij(e,r,t){return e[0]=r[0]-t[0],e[1]=r[1]-t[1],e[2]=r[2]-t[2],e}function nj(e,r,t){return e[0]=r[0]*t[0],e[1]=r[1]*t[1],e[2]=r[2]*t[2],e}function oj(e,r,t){return e[0]=r[0]/t[0],e[1]=r[1]/t[1],e[2]=r[2]/t[2],e}function _G(e,r){return e[0]=Math.ceil(r[0]),e[1]=Math.ceil(r[1]),e[2]=Math.ceil(r[2]),e}function kG(e,r){return e[0]=Math.floor(r[0]),e[1]=Math.floor(r[1]),e[2]=Math.floor(r[2]),e}function SG(e,r,t){return e[0]=Math.min(r[0],t[0]),e[1]=Math.min(r[1],t[1]),e[2]=Math.min(r[2],t[2]),e}function EG(e,r,t){return e[0]=Math.max(r[0],t[0]),e[1]=Math.max(r[1],t[1]),e[2]=Math.max(r[2],t[2]),e}function jG(e,r){return e[0]=mu(r[0]),e[1]=mu(r[1]),e[2]=mu(r[2]),e}function AG(e,r,t){return e[0]=r[0]*t,e[1]=r[1]*t,e[2]=r[2]*t,e}function TG(e,r,t,i){return e[0]=r[0]+t[0]*i,e[1]=r[1]+t[1]*i,e[2]=r[2]+t[2]*i,e}function sj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return Math.sqrt(t*t+i*i+a*a)}function uj(e,r){let t=r[0]-e[0],i=r[1]-e[1],a=r[2]-e[2];return t*t+i*i+a*a}function cj(e){let r=e[0],t=e[1],i=e[2];return r*r+t*t+i*i}function PG(e,r){return e[0]=-r[0],e[1]=-r[1],e[2]=-r[2],e}function RG(e,r){return e[0]=1/r[0],e[1]=1/r[1],e[2]=1/r[2],e}function CG(e,r){let t=r[0],i=r[1],a=r[2],n=t*t+i*i+a*a;return n>0&&(n=1/Math.sqrt(n)),e[0]=r[0]*n,e[1]=r[1]*n,e[2]=r[2]*n,e}function Mv(e,r){return e[0]*r[0]+e[1]*r[1]+e[2]*r[2]}function zv(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[0],s=t[1],u=t[2];return e[0]=a*u-n*s,e[1]=n*o-i*u,e[2]=i*s-a*o,e}function OG(e,r,t,i){let a=r[0],n=r[1],o=r[2];return e[0]=a+i*(t[0]-a),e[1]=n+i*(t[1]-n),e[2]=o+i*(t[2]-o),e}function IG(e,r,t,i){let a=Math.acos(Math.min(Math.max(Mv(r,t),-1),1)),n=Math.sin(a),o=Math.sin((1-i)*a)/n,s=Math.sin(i*a)/n;return e[0]=o*r[0]+s*t[0],e[1]=o*r[1]+s*t[1],e[2]=o*r[2]+s*t[2],e}function BG(e,r,t,i,a,n){let o=n*n,s=o*(2*n-3)+1,u=o*(n-2)+n,l=o*(n-1),f=o*(3-2*n);return e[0]=r[0]*s+t[0]*u+i[0]*l+a[0]*f,e[1]=r[1]*s+t[1]*u+i[1]*l+a[1]*f,e[2]=r[2]*s+t[2]*u+i[2]*l+a[2]*f,e}function FG(e,r,t,i,a,n){let o=1-n,s=o*o,u=n*n,l=s*o,f=3*n*s,h=3*u*o,d=u*n;return e[0]=r[0]*l+t[0]*f+i[0]*h+a[0]*d,e[1]=r[1]*l+t[1]*f+i[1]*h+a[1]*d,e[2]=r[2]*l+t[2]*f+i[2]*h+a[2]*d,e}function DG(e,r){r=r===void 0?1:r;let t=Qc()*2*Math.PI,i=Qc()*2-1,a=Math.sqrt(1-i*i)*r;return e[0]=Math.cos(t)*a,e[1]=Math.sin(t)*a,e[2]=i*r,e}function Zc(e,r,t){let i=r[0],a=r[1],n=r[2],o=t[3]*i+t[7]*a+t[11]*n+t[15];return o=o||1,e[0]=(t[0]*i+t[4]*a+t[8]*n+t[12])/o,e[1]=(t[1]*i+t[5]*a+t[9]*n+t[13])/o,e[2]=(t[2]*i+t[6]*a+t[10]*n+t[14])/o,e}function Nv(e,r,t){let i=r[0],a=r[1],n=r[2];return e[0]=i*t[0]+a*t[3]+n*t[6],e[1]=i*t[1]+a*t[4]+n*t[7],e[2]=i*t[2]+a*t[5]+n*t[8],e}function Uv(e,r,t){let i=t[0],a=t[1],n=t[2],o=t[3],s=r[0],u=r[1],l=r[2],f=a*l-n*u,h=n*s-i*l,d=i*u-a*s,m=a*d-n*h,y=n*f-i*d,k=i*h-a*f,x=o*2;return f*=x,h*=x,d*=x,m*=2,y*=2,k*=2,e[0]=s+f+m,e[1]=u+h+y,e[2]=l+d+k,e}function Hv(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0],n[1]=a[1]*Math.cos(i)-a[2]*Math.sin(i),n[2]=a[1]*Math.sin(i)+a[2]*Math.cos(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function Gv(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[2]*Math.sin(i)+a[0]*Math.cos(i),n[1]=a[1],n[2]=a[2]*Math.cos(i)-a[0]*Math.sin(i),e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function Wv(e,r,t,i){let a=[],n=[];return a[0]=r[0]-t[0],a[1]=r[1]-t[1],a[2]=r[2]-t[2],n[0]=a[0]*Math.cos(i)-a[1]*Math.sin(i),n[1]=a[0]*Math.sin(i)+a[1]*Math.cos(i),n[2]=a[2],e[0]=n[0]+t[0],e[1]=n[1]+t[1],e[2]=n[2]+t[2],e}function Vv(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2],u=Math.sqrt((t*t+i*i+a*a)*(n*n+o*o+s*s)),l=u&&Mv(e,r)/u;return Math.acos(Math.min(Math.max(l,-1),1))}function LG(e){return e[0]=0,e[1]=0,e[2]=0,e}function qG(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function MG(e,r){return e[0]===r[0]&&e[1]===r[1]&&e[2]===r[2]}function zG(e,r){let t=e[0],i=e[1],a=e[2],n=r[0],o=r[1],s=r[2];return Math.abs(t-n)<=1e-6*Math.max(1,Math.abs(t),Math.abs(n))&&Math.abs(i-o)<=1e-6*Math.max(1,Math.abs(i),Math.abs(o))&&Math.abs(a-s)<=1e-6*Math.max(1,Math.abs(a),Math.abs(s))}var NG=ij,UG=nj,HG=oj,GG=sj,WG=uj,VG=aj,$G=cj,KG=function(){let e=tj();return function(r,t,i,a,n,o){let s,u;for(t||(t=3),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2];return r}}();var $v=[0,0,0],Zp,Ir=class extends Xp{static get ZERO(){return Zp||(Zp=new Ir(0,0,0),Object.freeze(Zp)),Zp}constructor(r=0,t=0,i=0){super(-0,-0,-0),arguments.length===1&&Ao(r)?this.copy(r):(Bt.debug&&(Aa(r),Aa(t),Aa(i)),this[0]=r,this[1]=t,this[2]=i)}set(r,t,i){return this[0]=r,this[1]=t,this[2]=i,this.check()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this.check()}fromObject(r){return Bt.debug&&(Aa(r.x),Aa(r.y),Aa(r.z)),this[0]=r.x,this[1]=r.y,this[2]=r.z,this.check()}toObject(r){return r.x=this[0],r.y=this[1],r.z=this[2],r}get ELEMENTS(){return 3}get z(){return this[2]}set z(r){this[2]=Aa(r)}angle(r){return Vv(this,r)}cross(r){return zv(this,this,r),this.check()}rotateX({radians:r,origin:t=$v}){return Hv(this,this,t,r),this.check()}rotateY({radians:r,origin:t=$v}){return Gv(this,this,t,r),this.check()}rotateZ({radians:r,origin:t=$v}){return Wv(this,this,t,r),this.check()}transform(r){return this.transformAsPoint(r)}transformAsPoint(r){return Zc(this,this,r),this.check()}transformAsVector(r){return Qp(this,this,r),this.check()}transformByMatrix3(r){return Nv(this,this,r),this.check()}transformByMatrix2(r){return rj(this,this,r),this.check()}transformByQuaternion(r){return Uv(this,this,r),this.check()}};var Jp=class extends hu{toString(){let r="[";if(Bt.printRowMajor){r+="row-major:";for(let t=0;t<this.RANK;++t)for(let i=0;i<this.RANK;++i)r+=" ".concat(this[i*this.RANK+t])}else{r+="column-major:";for(let t=0;t<this.ELEMENTS;++t)r+=" ".concat(this[t])}return r+="]",r}getElementIndex(r,t){return t*this.RANK+r}getElement(r,t){return this[t*this.RANK+r]}setElement(r,t,i){return this[t*this.RANK+r]=Aa(i),this}getColumn(r,t=new Array(this.RANK).fill(-0)){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)t[a]=this[i+a];return t}setColumn(r,t){let i=r*this.RANK;for(let a=0;a<this.RANK;++a)this[i+a]=t[a];return this}};function YG(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function lj(e,r){if(e===r){let t=r[1],i=r[2],a=r[3],n=r[6],o=r[7],s=r[11];e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=t,e[6]=r[9],e[7]=r[13],e[8]=i,e[9]=n,e[11]=r[14],e[12]=a,e[13]=o,e[14]=s}else e[0]=r[0],e[1]=r[4],e[2]=r[8],e[3]=r[12],e[4]=r[1],e[5]=r[5],e[6]=r[9],e[7]=r[13],e[8]=r[2],e[9]=r[6],e[10]=r[10],e[11]=r[14],e[12]=r[3],e[13]=r[7],e[14]=r[11],e[15]=r[15];return e}function fj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=r[4],s=r[5],u=r[6],l=r[7],f=r[8],h=r[9],d=r[10],m=r[11],y=r[12],k=r[13],x=r[14],A=r[15],P=t*s-i*o,T=t*u-a*o,B=t*l-n*o,C=i*u-a*s,I=i*l-n*s,F=a*l-n*u,H=f*k-h*y,N=f*x-d*y,K=f*A-m*y,V=h*x-d*k,X=h*A-m*k,U=d*A-m*x,$=P*U-T*X+B*V+C*K-I*N+F*H;return $?($=1/$,e[0]=(s*U-u*X+l*V)*$,e[1]=(a*X-i*U-n*V)*$,e[2]=(k*F-x*I+A*C)*$,e[3]=(d*I-h*F-m*C)*$,e[4]=(u*K-o*U-l*N)*$,e[5]=(t*U-a*K+n*N)*$,e[6]=(x*B-y*F-A*T)*$,e[7]=(f*F-d*B+m*T)*$,e[8]=(o*X-s*K+l*H)*$,e[9]=(i*K-t*X-n*H)*$,e[10]=(y*I-k*B+A*P)*$,e[11]=(h*B-f*I-m*P)*$,e[12]=(s*N-o*V-u*H)*$,e[13]=(t*V-i*N+a*H)*$,e[14]=(k*T-y*C-x*P)*$,e[15]=(f*C-h*T+d*P)*$,e):null}function pj(e){let r=e[0],t=e[1],i=e[2],a=e[3],n=e[4],o=e[5],s=e[6],u=e[7],l=e[8],f=e[9],h=e[10],d=e[11],m=e[12],y=e[13],k=e[14],x=e[15],A=r*o-t*n,P=r*s-i*n,T=t*s-i*o,B=l*y-f*m,C=l*k-h*m,I=f*k-h*y,F=r*I-t*C+i*B,H=n*I-o*C+s*B,N=l*T-f*P+h*A,K=m*T-y*P+k*A;return u*F-a*H+x*N-d*K}function Kv(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3],s=r[4],u=r[5],l=r[6],f=r[7],h=r[8],d=r[9],m=r[10],y=r[11],k=r[12],x=r[13],A=r[14],P=r[15],T=t[0],B=t[1],C=t[2],I=t[3];return e[0]=T*i+B*s+C*h+I*k,e[1]=T*a+B*u+C*d+I*x,e[2]=T*n+B*l+C*m+I*A,e[3]=T*o+B*f+C*y+I*P,T=t[4],B=t[5],C=t[6],I=t[7],e[4]=T*i+B*s+C*h+I*k,e[5]=T*a+B*u+C*d+I*x,e[6]=T*n+B*l+C*m+I*A,e[7]=T*o+B*f+C*y+I*P,T=t[8],B=t[9],C=t[10],I=t[11],e[8]=T*i+B*s+C*h+I*k,e[9]=T*a+B*u+C*d+I*x,e[10]=T*n+B*l+C*m+I*A,e[11]=T*o+B*f+C*y+I*P,T=t[12],B=t[13],C=t[14],I=t[15],e[12]=T*i+B*s+C*h+I*k,e[13]=T*a+B*u+C*d+I*x,e[14]=T*n+B*l+C*m+I*A,e[15]=T*o+B*f+C*y+I*P,e}function dj(e,r,t){let i=t[0],a=t[1],n=t[2],o,s,u,l,f,h,d,m,y,k,x,A;return r===e?(e[12]=r[0]*i+r[4]*a+r[8]*n+r[12],e[13]=r[1]*i+r[5]*a+r[9]*n+r[13],e[14]=r[2]*i+r[6]*a+r[10]*n+r[14],e[15]=r[3]*i+r[7]*a+r[11]*n+r[15]):(o=r[0],s=r[1],u=r[2],l=r[3],f=r[4],h=r[5],d=r[6],m=r[7],y=r[8],k=r[9],x=r[10],A=r[11],e[0]=o,e[1]=s,e[2]=u,e[3]=l,e[4]=f,e[5]=h,e[6]=d,e[7]=m,e[8]=y,e[9]=k,e[10]=x,e[11]=A,e[12]=o*i+f*a+y*n+r[12],e[13]=s*i+h*a+k*n+r[13],e[14]=u*i+d*a+x*n+r[14],e[15]=l*i+m*a+A*n+r[15]),e}function hj(e,r,t){let i=t[0],a=t[1],n=t[2];return e[0]=r[0]*i,e[1]=r[1]*i,e[2]=r[2]*i,e[3]=r[3]*i,e[4]=r[4]*a,e[5]=r[5]*a,e[6]=r[6]*a,e[7]=r[7]*a,e[8]=r[8]*n,e[9]=r[9]*n,e[10]=r[10]*n,e[11]=r[11]*n,e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15],e}function mj(e,r,t,i){let a=i[0],n=i[1],o=i[2],s=Math.sqrt(a*a+n*n+o*o),u,l,f,h,d,m,y,k,x,A,P,T,B,C,I,F,H,N,K,V,X,U,$,Z;return s<1e-6?null:(s=1/s,a*=s,n*=s,o*=s,l=Math.sin(t),u=Math.cos(t),f=1-u,h=r[0],d=r[1],m=r[2],y=r[3],k=r[4],x=r[5],A=r[6],P=r[7],T=r[8],B=r[9],C=r[10],I=r[11],F=a*a*f+u,H=n*a*f+o*l,N=o*a*f-n*l,K=a*n*f-o*l,V=n*n*f+u,X=o*n*f+a*l,U=a*o*f+n*l,$=n*o*f-a*l,Z=o*o*f+u,e[0]=h*F+k*H+T*N,e[1]=d*F+x*H+B*N,e[2]=m*F+A*H+C*N,e[3]=y*F+P*H+I*N,e[4]=h*K+k*V+T*X,e[5]=d*K+x*V+B*X,e[6]=m*K+A*V+C*X,e[7]=y*K+P*V+I*X,e[8]=h*U+k*$+T*Z,e[9]=d*U+x*$+B*Z,e[10]=m*U+A*$+C*Z,e[11]=y*U+P*$+I*Z,r!==e&&(e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e)}function gj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[4],o=r[5],s=r[6],u=r[7],l=r[8],f=r[9],h=r[10],d=r[11];return r!==e&&(e[0]=r[0],e[1]=r[1],e[2]=r[2],e[3]=r[3],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[4]=n*a+l*i,e[5]=o*a+f*i,e[6]=s*a+h*i,e[7]=u*a+d*i,e[8]=l*a-n*i,e[9]=f*a-o*i,e[10]=h*a-s*i,e[11]=d*a-u*i,e}function vj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[8],f=r[9],h=r[10],d=r[11];return r!==e&&(e[4]=r[4],e[5]=r[5],e[6]=r[6],e[7]=r[7],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a-l*i,e[1]=o*a-f*i,e[2]=s*a-h*i,e[3]=u*a-d*i,e[8]=n*i+l*a,e[9]=o*i+f*a,e[10]=s*i+h*a,e[11]=u*i+d*a,e}function bj(e,r,t){let i=Math.sin(t),a=Math.cos(t),n=r[0],o=r[1],s=r[2],u=r[3],l=r[4],f=r[5],h=r[6],d=r[7];return r!==e&&(e[8]=r[8],e[9]=r[9],e[10]=r[10],e[11]=r[11],e[12]=r[12],e[13]=r[13],e[14]=r[14],e[15]=r[15]),e[0]=n*a+l*i,e[1]=o*a+f*i,e[2]=s*a+h*i,e[3]=u*a+d*i,e[4]=l*a-n*i,e[5]=f*a-o*i,e[6]=h*a-s*i,e[7]=d*a-u*i,e}function yj(e,r){let t=r[0],i=r[1],a=r[2],n=r[3],o=t+t,s=i+i,u=a+a,l=t*o,f=i*o,h=i*s,d=a*o,m=a*s,y=a*u,k=n*o,x=n*s,A=n*u;return e[0]=1-h-y,e[1]=f+A,e[2]=d-x,e[3]=0,e[4]=f-A,e[5]=1-l-y,e[6]=m+k,e[7]=0,e[8]=d+x,e[9]=m-k,e[10]=1-l-h,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function xj(e,r,t,i,a,n,o){let s=1/(t-r),u=1/(a-i),l=1/(n-o);return e[0]=n*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n*2*u,e[6]=0,e[7]=0,e[8]=(t+r)*s,e[9]=(a+i)*u,e[10]=(o+n)*l,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*l,e[15]=0,e}function XG(e,r,t,i,a){let n=1/Math.tan(r/2);if(e[0]=n/t,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,a!=null&&a!==1/0){let o=1/(i-a);e[10]=(a+i)*o,e[14]=2*a*i*o}else e[10]=-1,e[14]=-2*i;return e}var wj=XG;function QG(e,r,t,i,a,n,o){let s=1/(r-t),u=1/(i-a),l=1/(n-o);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*u,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*l,e[11]=0,e[12]=(r+t)*s,e[13]=(a+i)*u,e[14]=(o+n)*l,e[15]=1,e}var _j=QG;function kj(e,r,t,i){let a,n,o,s,u,l,f,h,d,m,y=r[0],k=r[1],x=r[2],A=i[0],P=i[1],T=i[2],B=t[0],C=t[1],I=t[2];return Math.abs(y-B)<1e-6&&Math.abs(k-C)<1e-6&&Math.abs(x-I)<1e-6?YG(e):(h=y-B,d=k-C,m=x-I,a=1/Math.sqrt(h*h+d*d+m*m),h*=a,d*=a,m*=a,n=P*m-T*d,o=T*h-A*m,s=A*d-P*h,a=Math.sqrt(n*n+o*o+s*s),a?(a=1/a,n*=a,o*=a,s*=a):(n=0,o=0,s=0),u=d*s-m*o,l=m*n-h*s,f=h*o-d*n,a=Math.sqrt(u*u+l*l+f*f),a?(a=1/a,u*=a,l*=a,f*=a):(u=0,l=0,f=0),e[0]=n,e[1]=u,e[2]=h,e[3]=0,e[4]=o,e[5]=l,e[6]=d,e[7]=0,e[8]=s,e[9]=f,e[10]=m,e[11]=0,e[12]=-(n*y+o*k+s*x),e[13]=-(u*y+l*k+f*x),e[14]=-(h*y+d*k+m*x),e[15]=1,e)}function ZG(){let e=new Hi(4);return Hi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Sj(e,r,t){let i=r[0],a=r[1],n=r[2],o=r[3];return e[0]=t[0]*i+t[4]*a+t[8]*n+t[12]*o,e[1]=t[1]*i+t[5]*a+t[9]*n+t[13]*o,e[2]=t[2]*i+t[6]*a+t[10]*n+t[14]*o,e[3]=t[3]*i+t[7]*a+t[11]*n+t[15]*o,e}var ane=function(){let e=ZG();return function(r,t,i,a,n,o){let s,u;for(t||(t=4),i||(i=0),a?u=Math.min(a*t+i,r.length):u=r.length,s=i;s<u;s+=t)e[0]=r[s],e[1]=r[s+1],e[2]=r[s+2],e[3]=r[s+3],n(e,e,o),r[s]=e[0],r[s+1]=e[1],r[s+2]=e[2],r[s+3]=e[3];return r}}();var Qv;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(Qv||(Qv={}));var JG=45*Math.PI/180,eW=1,Yv=.1,Xv=500,rW=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),vi=class extends Jp{static get IDENTITY(){return aW()}static get ZERO(){return tW()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Qv}constructor(r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(r)?this.copy(r):this.identity()}copy(r){return this[0]=r[0],this[1]=r[1],this[2]=r[2],this[3]=r[3],this[4]=r[4],this[5]=r[5],this[6]=r[6],this[7]=r[7],this[8]=r[8],this[9]=r[9],this[10]=r[10],this[11]=r[11],this[12]=r[12],this[13]=r[13],this[14]=r[14],this[15]=r[15],this.check()}set(r,t,i,a,n,o,s,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=t,this[2]=i,this[3]=a,this[4]=n,this[5]=o,this[6]=s,this[7]=u,this[8]=l,this[9]=f,this[10]=h,this[11]=d,this[12]=m,this[13]=y,this[14]=k,this[15]=x,this.check()}setRowMajor(r,t,i,a,n,o,s,u,l,f,h,d,m,y,k,x){return this[0]=r,this[1]=n,this[2]=l,this[3]=m,this[4]=t,this[5]=o,this[6]=f,this[7]=y,this[8]=i,this[9]=s,this[10]=h,this[11]=k,this[12]=a,this[13]=u,this[14]=d,this[15]=x,this.check()}toRowMajor(r){return r[0]=this[0],r[1]=this[4],r[2]=this[8],r[3]=this[12],r[4]=this[1],r[5]=this[5],r[6]=this[9],r[7]=this[13],r[8]=this[2],r[9]=this[6],r[10]=this[10],r[11]=this[14],r[12]=this[3],r[13]=this[7],r[14]=this[11],r[15]=this[15],r}identity(){return this.copy(rW)}fromObject(r){return this.check()}fromQuaternion(r){return yj(this,r),this.check()}frustum(r){let{left:t,right:i,bottom:a,top:n,near:o=Yv,far:s=Xv}=r;return s===1/0?iW(this,t,i,a,n,o):xj(this,t,i,a,n,o,s),this.check()}lookAt(r){let{eye:t,center:i=[0,0,0],up:a=[0,1,0]}=r;return kj(this,t,i,a),this.check()}ortho(r){let{left:t,right:i,bottom:a,top:n,near:o=Yv,far:s=Xv}=r;return _j(this,t,i,a,n,o,s),this.check()}orthographic(r){let{fovy:t=JG,aspect:i=eW,focalDistance:a=1,near:n=Yv,far:o=Xv}=r;Ej(t);let s=t/2,u=a*Math.tan(s),l=u*i;return this.ortho({left:-l,right:l,bottom:-u,top:u,near:n,far:o})}perspective(r){let{fovy:t=45*Math.PI/180,aspect:i=1,near:a=.1,far:n=500}=r;return Ej(t),wj(this,t,i,a,n),this.check()}determinant(){return pj(this)}getScale(r=[-0,-0,-0]){return r[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),r[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),r[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),r}getTranslation(r=[-0,-0,-0]){return r[0]=this[12],r[1]=this[13],r[2]=this[14],r}getRotation(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=0,r[4]=this[4]*a,r[5]=this[5]*n,r[6]=this[6]*o,r[7]=0,r[8]=this[8]*a,r[9]=this[9]*n,r[10]=this[10]*o,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}getRotationMatrix3(r,t){r=r||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let i=this.getScale(t),a=1/i[0],n=1/i[1],o=1/i[2];return r[0]=this[0]*a,r[1]=this[1]*n,r[2]=this[2]*o,r[3]=this[4]*a,r[4]=this[5]*n,r[5]=this[6]*o,r[6]=this[8]*a,r[7]=this[9]*n,r[8]=this[10]*o,r}transpose(){return lj(this,this),this.check()}invert(){return fj(this,this),this.check()}multiplyLeft(r){return Kv(this,r,this),this.check()}multiplyRight(r){return Kv(this,this,r),this.check()}rotateX(r){return gj(this,this,r),this.check()}rotateY(r){return vj(this,this,r),this.check()}rotateZ(r){return bj(this,this,r),this.check()}rotateXYZ(r){return this.rotateX(r[0]).rotateY(r[1]).rotateZ(r[2])}rotateAxis(r,t){return mj(this,this,r,t),this.check()}scale(r){return hj(this,this,Array.isArray(r)?r:[r,r,r]),this.check()}translate(r){return dj(this,this,r),this.check()}transform(r,t){return r.length===4?(t=Sj(t||[-0,-0,-0,-0],r,this),Yp(t,4),t):this.transformAsPoint(r,t)}transformAsPoint(r,t){let{length:i}=r,a;switch(i){case 2:a=J4(t||[-0,-0],r,this);break;case 3:a=Zc(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Yp(a,r.length),a}transformAsVector(r,t){let i;switch(r.length){case 2:i=ej(t||[-0,-0],r,this);break;case 3:i=Qp(t||[-0,-0,-0],r,this);break;default:throw new Error("Illegal vector")}return Yp(i,r.length),i}transformPoint(r,t){return this.transformAsPoint(r,t)}transformVector(r,t){return this.transformAsPoint(r,t)}transformDirection(r,t){return this.transformAsVector(r,t)}makeRotationX(r){return this.identity().rotateX(r)}makeTranslation(r,t,i){return this.identity().translate([r,t,i])}},ed,rd;function tW(){return ed||(ed=new vi([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(ed)),ed}function aW(){return rd||(rd=new vi,Object.freeze(rd)),rd}function Ej(e){if(e>Math.PI*2)throw Error("expected radians")}function iW(e,r,t,i,a,n){let o=2*n/(t-r),s=2*n/(a-i),u=(t+r)/(t-r),l=(a+i)/(a-i),f=-1,h=-1,d=-2*n;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=l,e[10]=f,e[11]=h,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}var cs={};Au(cs,{EPSILON1:()=>nW,EPSILON10:()=>hW,EPSILON11:()=>mW,EPSILON12:()=>gW,EPSILON13:()=>vW,EPSILON14:()=>bW,EPSILON15:()=>yW,EPSILON16:()=>xW,EPSILON17:()=>wW,EPSILON18:()=>_W,EPSILON19:()=>kW,EPSILON2:()=>oW,EPSILON20:()=>SW,EPSILON3:()=>sW,EPSILON4:()=>uW,EPSILON5:()=>cW,EPSILON6:()=>lW,EPSILON7:()=>fW,EPSILON8:()=>pW,EPSILON9:()=>dW,PI_OVER_FOUR:()=>jW,PI_OVER_SIX:()=>AW,PI_OVER_TWO:()=>EW,TWO_PI:()=>TW});var nW=.1,oW=.01,sW=.001,uW=1e-4,cW=1e-5,lW=1e-6,fW=1e-7,pW=1e-8,dW=1e-9,hW=1e-10,mW=1e-11,gW=1e-12,vW=1e-13,bW=1e-14,yW=1e-15,xW=1e-16,wW=1e-17,_W=1e-18,kW=1e-19,SW=1e-20,EW=Math.PI/2,jW=Math.PI/4,AW=Math.PI/6,TW=Math.PI*2;var Gn=6356752314245179e-9,PW={radii:[6378137,6378137,Gn],radiiSquared:[6378137*6378137,6378137*6378137,Gn*Gn],oneOverRadii:[1/6378137,1/6378137,1/Gn],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Gn*Gn)],maximumRadius:Math.max(6378137,6378137,Gn),centerToleranceSquared:.1};function td(e){return e}var Ine=new Ir;function RW(e,r=[],t=td){return"longitude"in e?(r[0]=t(e.longitude),r[1]=t(e.latitude),r[2]=e.height):"x"in e?(r[0]=t(e.x),r[1]=t(e.y),r[2]=e.z):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function jj(e,r=[]){return RW(e,r,Bt._cartographicRadians?td:Dv)}function CW(e,r,t=td){return"longitude"in r?(r.longitude=t(e[0]),r.latitude=t(e[1]),r.height=e[2]):"x"in r?(r.x=t(e[0]),r.y=t(e[1]),r.z=e[2]):(r[0]=t(e[0]),r[1]=t(e[1]),r[2]=e[2]),r}function Aj(e,r){return CW(e,r,Bt._cartographicRadians?td:Lv)}var Tj=1e-14,OW=new Ir,Pj={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Zv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},el={east:new Ir,north:new Ir,up:new Ir,west:new Ir,south:new Ir,down:new Ir},IW=new Ir,BW=new Ir,FW=new Ir;function Jv(e,r,t,i,a,n){let o=Pj[r]&&Pj[r][t];gi(o&&(!i||i===o));let s,u,l,f=OW.copy(a);if(Un(f.x,0,Tj)&&Un(f.y,0,Tj)){let d=Math.sign(f.z);s=IW.fromArray(Zv[r]),r!=="east"&&r!=="west"&&s.scale(d),u=BW.fromArray(Zv[t]),t!=="east"&&t!=="west"&&u.scale(d),l=FW.fromArray(Zv[i]),i!=="east"&&i!=="west"&&l.scale(d)}else{let{up:d,east:m,north:y}=el;m.set(-f.y,f.x,0).normalize(),e.geodeticSurfaceNormal(f,d),y.copy(d).cross(m);let{down:k,west:x,south:A}=el;k.copy(d).scale(-1),x.copy(m).scale(-1),A.copy(y).scale(-1),s=el[r],u=el[t],l=el[i]}return n[0]=s.x,n[1]=s.y,n[2]=s.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=l.x,n[9]=l.y,n[10]=l.z,n[11]=0,n[12]=f.x,n[13]=f.y,n[14]=f.z,n[15]=1,n}var gu=new Ir,DW=new Ir,LW=new Ir;function Rj(e,r,t=[]){let{oneOverRadii:i,oneOverRadiiSquared:a,centerToleranceSquared:n}=r;gu.from(e);let o=gu.x,s=gu.y,u=gu.z,l=i.x,f=i.y,h=i.z,d=o*o*l*l,m=s*s*f*f,y=u*u*h*h,k=d+m+y,x=Math.sqrt(1/k);if(!Number.isFinite(x))return;let A=DW;if(A.copy(e).scale(x),k<n)return A.to(t);let P=a.x,T=a.y,B=a.z,C=LW;C.set(A.x*P*2,A.y*T*2,A.z*B*2);let I=(1-x)*gu.len()/(.5*C.len()),F=0,H,N,K,V;do{I-=F,H=1/(1+I*P),N=1/(1+I*T),K=1/(1+I*B);let X=H*H,U=N*N,$=K*K,Z=X*H,le=U*N,ve=$*K;V=d*X+m*U+y*$-1;let we=-2*(d*Z*P+m*le*T+y*ve*B);F=V/we}while(Math.abs(V)>cs.EPSILON12);return gu.scale([H,N,K]).to(t)}var ad=new Ir,Cj=new Ir,zW=new Ir,Gi=new Ir,NW=new Ir,id=new Ir,Wn=class{constructor(r=0,t=0,i=0){ht(this,"radii",void 0),ht(this,"radiiSquared",void 0),ht(this,"radiiToTheFourth",void 0),ht(this,"oneOverRadii",void 0),ht(this,"oneOverRadiiSquared",void 0),ht(this,"minimumRadius",void 0),ht(this,"maximumRadius",void 0),ht(this,"centerToleranceSquared",cs.EPSILON1),ht(this,"squaredXOverSquaredZ",void 0),gi(r>=0),gi(t>=0),gi(i>=0),this.radii=new Ir(r,t,i),this.radiiSquared=new Ir(r*r,t*t,i*i),this.radiiToTheFourth=new Ir(r*r*r*r,t*t*t*t,i*i*i*i),this.oneOverRadii=new Ir(r===0?0:1/r,t===0?0:1/t,i===0?0:1/i),this.oneOverRadiiSquared=new Ir(r===0?0:1/(r*r),t===0?0:1/(t*t),i===0?0:1/(i*i)),this.minimumRadius=Math.min(r,t,i),this.maximumRadius=Math.max(r,t,i),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(r){return this===r||Boolean(r&&this.radii.equals(r.radii))}toString(){return this.radii.toString()}cartographicToCartesian(r,t=[0,0,0]){let i=Cj,a=zW,[,,n]=r;this.geodeticSurfaceNormalCartographic(r,i),a.copy(this.radiiSquared).scale(i);let o=Math.sqrt(i.dot(a));return a.scale(1/o),i.scale(n),a.add(i),a.to(t)}cartesianToCartographic(r,t=[0,0,0]){id.from(r);let i=this.scaleToGeodeticSurface(id,Gi);if(!i)return;let a=this.geodeticSurfaceNormal(i,Cj),n=NW;n.copy(id).subtract(i);let o=Math.atan2(a.y,a.x),s=Math.asin(a.z),u=Math.sign(Jc.dot(n,id))*Jc.length(n);return Aj([o,s,u],t)}eastNorthUpToFixedFrame(r,t=new vi){return Jv(this,"east","north","up",r,t)}localFrameToFixedFrame(r,t,i,a,n=new vi){return Jv(this,r,t,i,a,n)}geocentricSurfaceNormal(r,t=[0,0,0]){return ad.from(r).normalize().to(t)}geodeticSurfaceNormalCartographic(r,t=[0,0,0]){let i=jj(r),a=i[0],n=i[1],o=Math.cos(n);return ad.set(o*Math.cos(a),o*Math.sin(a),Math.sin(n)).normalize(),ad.to(t)}geodeticSurfaceNormal(r,t=[0,0,0]){return ad.from(r).scale(this.oneOverRadiiSquared).normalize().to(t)}scaleToGeodeticSurface(r,t){return Rj(r,this,t)}scaleToGeocentricSurface(r,t=[0,0,0]){Gi.from(r);let i=Gi.x,a=Gi.y,n=Gi.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+a*a*o.y+n*n*o.z);return Gi.multiplyScalar(s).to(t)}transformPositionToScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.oneOverRadii).to(t)}transformPositionFromScaledSpace(r,t=[0,0,0]){return Gi.from(r).scale(this.radii).to(t)}getSurfaceNormalIntersectionWithZAxis(r,t=0,i=[0,0,0]){gi(Un(this.radii.x,this.radii.y,cs.EPSILON15)),gi(this.radii.z>0),Gi.from(r);let a=Gi.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(a)>=this.radii.z-t))return Gi.set(0,0,a).to(i)}};ht(Wn,"WGS84",new Wn(6378137,6378137,Gn));var Oj="4.1.2";var Ij,UW=(Ij=globalThis.loaders)==null?void 0:Ij.parseImageNode,e1=typeof Image<"u",r1=typeof ImageBitmap<"u",HW=Boolean(UW),t1=Jo?!0:HW;function Bj(e){switch(e){case"auto":return r1||e1||t1;case"imagebitmap":return r1;case"image":return e1;case"data":return t1;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function Fj(){if(r1)return"imagebitmap";if(e1)return"image";if(t1)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function GW(e){let r=WW(e);if(!r)throw new Error("Not an image");return r}function Dj(e){switch(GW(e)){case"data":return e;case"image":case"imagebitmap":let r=document.createElement("canvas"),t=r.getContext("2d");if(!t)throw new Error("getImageData");return r.width=e.width,r.height=e.height,t.drawImage(e,0,0),t.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function WW(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}var VW=/^data:image\/svg\+xml/,$W=/\.svg((\?|#).*)?$/;function nd(e){return e&&(VW.test(e)||$W.test(e))}function Lj(e,r){if(nd(r)){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 a1(e,r)}function a1(e,r){if(nd(r))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function od(e,r,t){let i=Lj(e,t),a=self.URL||self.webkitURL,n=typeof i!="string"&&a.createObjectURL(i);try{return await KW(n||i,r)}finally{n&&a.revokeObjectURL(n)}}async function KW(e,r){let t=new Image;return t.src=e,r.image&&r.image.decode&&t.decode?(await t.decode(),t):await new Promise((i,a)=>{try{t.onload=()=>i(t),t.onerror=n=>{let o=n instanceof Error?n.message:"error";a(new Error(o))}}catch(n){a(n)}})}var YW={},qj=!0;async function Mj(e,r,t){let i;nd(t)?i=await od(e,r,t):i=a1(e,t);let a=r&&r.imagebitmap;return await XW(i,a)}async function XW(e,r=null){if((QW(r)||!qj)&&(r=null),r)try{return await createImageBitmap(e,r)}catch(t){console.warn(t),qj=!1}return await createImageBitmap(e)}function QW(e){for(let r in e||YW)return!1;return!0}function zj(e){return!rV(e,"ftyp",4)||!(e[8]&96)?null:ZW(e)}function ZW(e){switch(JW(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function JW(e,r,t){return String.fromCharCode(...e.slice(r,t))}function eV(e){return[...e].map(r=>r.charCodeAt(0))}function rV(e,r,t=0){let i=eV(r);for(let a=0;a<i.length;++a)if(i[a]!==e[a+t])return!1;return!0}var bn=!1,rl=!0;function sd(e){let r=tl(e);return aV(r)||oV(r)||iV(r)||nV(r)||tV(r)}function tV(e){let r=new Uint8Array(e instanceof DataView?e.buffer:e),t=zj(r);return t?{mimeType:t.mimeType,width:0,height:0}:null}function aV(e){let r=tl(e);return r.byteLength>=24&&r.getUint32(0,bn)===2303741511?{mimeType:"image/png",width:r.getUint32(16,bn),height:r.getUint32(20,bn)}:null}function iV(e){let r=tl(e);return r.byteLength>=10&&r.getUint32(0,bn)===1195984440?{mimeType:"image/gif",width:r.getUint16(6,rl),height:r.getUint16(8,rl)}:null}function nV(e){let r=tl(e);return r.byteLength>=14&&r.getUint16(0,bn)===16973&&r.getUint32(2,rl)===r.byteLength?{mimeType:"image/bmp",width:r.getUint32(18,rl),height:r.getUint32(22,rl)}:null}function oV(e){let r=tl(e);if(!(r.byteLength>=3&&r.getUint16(0,bn)===65496&&r.getUint8(2)===255))return null;let{tableMarkers:i,sofMarkers:a}=sV(),n=2;for(;n+9<r.byteLength;){let o=r.getUint16(n,bn);if(a.has(o))return{mimeType:"image/jpeg",height:r.getUint16(n+5,bn),width:r.getUint16(n+7,bn)};if(!i.has(o))return null;n+=2,n+=r.getUint16(n,bn)}return null}function sV(){let 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 tl(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 Nj(e,r){var a;let{mimeType:t}=sd(e)||{},i=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return zi(i),await i(e,t)}async function Uj(e,r,t){r=r||{};let a=(r.image||{}).type||"auto",{url:n}=t||{},o=uV(a),s;switch(o){case"imagebitmap":s=await Mj(e,r,n);break;case"image":s=await od(e,r,n);break;case"data":s=await Nj(e,r);break;default:zi(!1)}return a==="data"&&(s=Dj(s)),s}function uV(e){switch(e){case"auto":case"data":return Fj();default:return Bj(e),e}}var cV=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],lV=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],fV={image:{type:"auto",decode:!0}},ud={id:"image",module:"images",name:"Images",version:Oj,mimeTypes:lV,extensions:cV,parse:Uj,tests:[e=>Boolean(sd(new DataView(e)))],options:fV};var Hj="4.1.2";var Gj={name:"Draco",id:"draco",module:"draco",version:Hj,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function Vj(e,r,t){let i=$j(r.metadata),a=[],n=pV(r.attributes);for(let o in e){let s=e[o],u=Wj(o,s,n[o]);a.push(u)}if(t){let o=Wj("indices",t);a.push(o)}return{fields:a,metadata:i}}function pV(e){let r={};for(let t in e){let i=e[t];r[i.name||"undefined"]=i}return r}function Wj(e,r,t){let i=t?$j(t.metadata):void 0;return Iv(e,r,i)}function $j(e){Object.entries(e);let r={};for(let t in e)r[`${t}.string`]=JSON.stringify(e[t]);return r}var Kj={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},dV={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},hV=4,al=class{constructor(r){this.draco=r,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(r,t={}){let i=new this.draco.DecoderBuffer;i.Init(new Int8Array(r),r.byteLength),this._disableAttributeTransforms(t);let a=this.decoder.GetEncodedGeometryType(i),n=a===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(a){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(i,n);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(i,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!n.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(n,a,t),u=this._getMeshData(n,s,t),l=Ov(u.attributes),f=Vj(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:n.num_points(),boundingBox:l},...u,schema:f}}finally{this.draco.destroy(i),n&&this.draco.destroy(n)}}_getDracoLoaderData(r,t,i){let a=this._getTopLevelMetadata(r),n=this._getDracoAttributes(r,i);return{geometry_type:t,num_attributes:r.num_attributes(),num_points:r.num_points(),num_faces:r instanceof this.draco.Mesh?r.num_faces():0,metadata:a,attributes:n}}_getDracoAttributes(r,t){let i={};for(let a=0;a<r.num_attributes();a++){let n=this.decoder.GetAttribute(r,a),o=this._getAttributeMetadata(r,a);i[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:a,metadata:o};let s=this._getQuantizationTransform(n,t);s&&(i[n.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(n,t);u&&(i[n.unique_id()].octahedron_transform=u)}return i}_getMeshData(r,t,i){let a=this._getMeshAttributes(t,r,i);if(!a.POSITION)throw new Error("DRACO: No position attribute found.");if(r instanceof this.draco.Mesh)switch(i.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:a,indices:{value:this._getTriangleStripIndices(r),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:a,indices:{value:this._getTriangleListIndices(r),size:1}}}return{topology:"point-list",mode:0,attributes:a}}_getMeshAttributes(r,t,i){let a={};for(let n of Object.values(r.attributes)){let o=this._deduceAttributeName(n,i);n.name=o;let{value:s,size:u}=this._getAttributeValues(t,n);a[o]={value:s,size:u,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}return a}_getTriangleListIndices(r){let i=r.num_faces()*3,a=i*hV,n=this.draco._malloc(a);try{return this.decoder.GetTrianglesUInt32Array(r,a,n),new Uint32Array(this.draco.HEAPF32.buffer,n,i).slice()}finally{this.draco._free(n)}}_getTriangleStripIndices(r){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(r,t),vV(t)}finally{this.draco.destroy(t)}}_getAttributeValues(r,t){let i=dV[t.data_type],a=t.num_components,o=r.num_points()*a,s=o*i.BYTES_PER_ELEMENT,u=mV(this.draco,i),l,f=this.draco._malloc(s);try{let h=this.decoder.GetAttribute(r,t.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(r,h,u,s,f),l=new i(this.draco.HEAPF32.buffer,f,o).slice()}finally{this.draco._free(f)}return{value:l,size:a}}_deduceAttributeName(r,t){let i=r.unique_id;for(let[o,s]of Object.entries(t.extraAttributes||{}))if(s===i)return o;let a=r.attribute_type;for(let o in Kj)if(this.draco[o]===a)return Kj[o];let n=t.attributeNameEntry||"name";return r.metadata[n]?r.metadata[n].string:`CUSTOM_ATTRIBUTE_${i}`}_getTopLevelMetadata(r){let t=this.decoder.GetMetadata(r);return this._getDracoMetadata(t)}_getAttributeMetadata(r,t){let i=this.decoder.GetAttributeMetadata(r,t);return this._getDracoMetadata(i)}_getDracoMetadata(r){if(!r||!r.ptr)return{};let t={},i=this.metadataQuerier.NumEntries(r);for(let a=0;a<i;a++){let n=this.metadataQuerier.GetEntryName(r,a);t[n]=this._getDracoMetadataField(r,n)}return t}_getDracoMetadataField(r,t){let i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(r,t,i);let a=gV(i);return{int:this.metadataQuerier.GetIntEntry(r,t),string:this.metadataQuerier.GetStringEntry(r,t),double:this.metadataQuerier.GetDoubleEntry(r,t),intArray:a}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(r){let{quantizedAttributes:t=[],octahedronAttributes:i=[]}=r,a=[...t,...i];for(let n of a)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(r,t){let{quantizedAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:new Float32Array([1,2,3]).map(s=>o.min_value(s))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(r,t){let{octahedronAttributes:i=[]}=t,a=r.attribute_type();if(i.map(o=>this.decoder[o]).includes(a)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(r))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function mV(e,r){switch(r){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function gV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}function vV(e){let r=e.size(),t=new Int32Array(r);for(let i=0;i<r;i++)t[i]=e.GetValue(i);return t}var bV="1.5.6",yV="1.4.1",i1=`https://www.gstatic.com/draco/versioned/decoders/${bV}`,Ha={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},n1={[Ha.DECODER]:`${i1}/${Ha.DECODER}`,[Ha.DECODER_WASM]:`${i1}/${Ha.DECODER_WASM}`,[Ha.FALLBACK_DECODER]:`${i1}/${Ha.FALLBACK_DECODER}`,[Ha.ENCODER]:`https://raw.githubusercontent.com/google/draco/${yV}/javascript/${Ha.ENCODER}`},il;async function Yj(e){let r=e.modules||{};return r.draco3d?il=il||r.draco3d.createDecoderModule({}).then(t=>({draco:t})):il=il||xV(e),await il}async function xV(e){let r,t;switch(e.draco&&e.draco.decoderType){case"js":r=await gn(n1[Ha.FALLBACK_DECODER],"draco",e,Ha.FALLBACK_DECODER);break;case"wasm":default:[r,t]=await Promise.all([await gn(n1[Ha.DECODER],"draco",e,Ha.DECODER),await gn(n1[Ha.DECODER_WASM],"draco",e,Ha.DECODER_WASM)])}return r=r||globalThis.DracoDecoderModule,await wV(r,t)}function wV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e({...t,onModuleLoaded:a=>i({draco:a})})})}var Xj={...Gj,parse:_V};async function _V(e,r){let{draco:t}=await Yj(r),i=new al(t);try{return i.parseSync(e,r==null?void 0:r.draco)}finally{i.destroy()}}var cd="4.1.2";var ld={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},o1;async function u1(e){let r=e.modules||{};return r.basis?r.basis:(o1=o1||kV(e),await o1)}async function kV(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(ld.TRANSCODER,"textures",e),await gn(ld.TRANSCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await SV(r,t)}function SV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,initializeBasis:o}=a;o(),i({BasisFile:n})})})}var s1;async function c1(e){let r=e.modules||{};return r.basisEncoder?r.basisEncoder:(s1=s1||EV(e),await s1)}async function EV(e){let r=null,t=null;return[r,t]=await Promise.all([await gn(ld.ENCODER,"textures",e),await gn(ld.ENCODER_WASM,"textures",e)]),r=r||globalThis.BASIS,await jV(r,t)}function jV(e,r){let t={};return r&&(t.wasmBinary=r),new Promise(i=>{e(t).then(a=>{let{BasisFile:n,KTX2File:o,initializeBasis:s,BasisEncoder:u}=a;s(),i({BasisFile:n,KTX2File:o,BasisEncoder:u})})})}var ce={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var AV=["","WEBKIT_","MOZ_"],Qj={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},fd=null;function Zj(e){if(!fd){e=e||TV()||void 0,fd=new Set;for(let r of AV)for(let t in Qj)if(e&&e.getExtension(`${r}${t}`)){let i=Qj[t];fd.add(i)}}return fd}function TV(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var lA=Pt(uA(),1);function vu(e,r){let t=new Array(r.mipMapLevels),i=r.width,a=r.height,n=0;for(let o=0;o<r.mipMapLevels;++o){let s=CV(r,i,a,e,o),u=RV(e,o,n,s);t[o]={compressed:!0,format:r.internalFormat,data:u,width:i,height:a,levelSize:s},i=Math.max(1,i>>1),a=Math.max(1,a>>1),n+=s}return t}function RV(e,r,t,i){return Array.isArray(e)?e[r].levelData:new Uint8Array(e.buffer,e.byteOffset+t,i)}function CV(e,r,t,i,a){return Array.isArray(i)?e.sizeFunction(i[a]):e.sizeFunction(r,t)}var OV={131:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ce.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ce.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ce.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ce.COMPRESSED_RED_RGTC1_EXT,140:ce.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ce.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ce.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ce.COMPRESSED_RGB8_ETC2,148:ce.COMPRESSED_SRGB8_ETC2,149:ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ce.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ce.COMPRESSED_RGBA8_ETC2_EAC,152:ce.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ce.COMPRESSED_R11_EAC,154:ce.COMPRESSED_SIGNED_R11_EAC,155:ce.COMPRESSED_RG11_EAC,156:ce.COMPRESSED_SIGNED_RG11_EAC,157:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ce.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ce.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ce.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ce.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ce.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ce.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ce.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ce.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ce.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ce.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ce.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ce.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ce.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ce.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ce.COMPRESSED_RGBA_ASTC_12x12_KHR};function cA(e){return OV[e]}var Ja=[171,75,84,88,32,50,48,187,13,10,26,10];function gd(e){let r=new Uint8Array(e);return!(r.byteLength<Ja.length||r[0]!==Ja[0]||r[1]!==Ja[1]||r[2]!==Ja[2]||r[3]!==Ja[3]||r[4]!==Ja[4]||r[5]!==Ja[5]||r[6]!==Ja[6]||r[7]!==Ja[7]||r[8]!==Ja[8]||r[9]!==Ja[9]||r[10]!==Ja[10]||r[11]!==Ja[11])}function fA(e){let r=new Uint8Array(e),t=(0,lA.read)(r),i=Math.max(1,t.levels.length),a=t.pixelWidth,n=t.pixelHeight,o=cA(t.vkFormat);return vu(t.levels,{mipMapLevels:i,width:a,height:n,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var IV={etc1:{basisFormat:0,compressed:!0,format:ce.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ce.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ce.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function ol(e,r){if(r.basis.containerFormat==="auto"){if(gd(e)){let i=await c1(r);return pA(i.KTX2File,e,r)}let{BasisFile:t}=await u1(r);return h1(t,e,r)}switch(r.basis.module){case"encoder":let t=await c1(r);switch(r.basis.containerFormat){case"ktx2":return pA(t.KTX2File,e,r);case"basis":default:return h1(t.BasisFile,e,r)}case"transcoder":default:let{BasisFile:i}=await u1(r);return h1(i,e,r)}}function h1(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("Failed to start basis transcoding");let a=i.getNumImages(),n=[];for(let o=0;o<a;o++){let s=i.getNumLevels(o),u=[];for(let l=0;l<s;l++)u.push(BV(i,o,l,t));n.push(u)}return n}finally{i.close(),i.delete()}}function BV(e,r,t,i){let a=e.getImageWidth(r,t),n=e.getImageHeight(r,t),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:l}=dA(i,o),f=e.getImageTranscodedSizeInBytes(r,t,l),h=new Uint8Array(f);if(!e.transcodeImage(h,r,t,l,0,0))throw new Error("failed to start Basis transcoding");return{width:a,height:n,data:h,compressed:s,format:u,hasAlpha:o}}function pA(e,r,t){let i=new e(new Uint8Array(r));try{if(!i.startTranscoding())throw new Error("failed to start KTX2 transcoding");let a=i.getLevels(),n=[];for(let o=0;o<a;o++){n.push(FV(i,o,t));break}return[n]}finally{i.close(),i.delete()}}function FV(e,r,t){let{alphaFlag:i,height:a,width:n}=e.getImageLevelInfo(r,0,0),{compressed:o,format:s,basisFormat:u}=dA(t,i),l=e.getImageTranscodedSizeInBytes(r,0,0,u),f=new Uint8Array(l);if(!e.transcodeImage(f,r,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:a,data:f,compressed:o,levelSize:l,hasAlpha:i,format:s}}function dA(e,r){let t=e&&e.basis&&e.basis.format;return t==="auto"&&(t=DV()),typeof t=="object"&&(t=r?t.alpha:t.noAlpha),t=t.toLowerCase(),IV[t]}function DV(){let e=Zj();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var hA={name:"Basis",id:"basis",module:"textures",version:cd,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},sl={...hA,parse:ol};var ei={MAGIC_NUMBER:542327876,HEADER_LENGTH:31,MAGIC_NUMBER_INDEX:0,HEADER_SIZE_INDEX:1,HEADER_FLAGS_INDEX:2,HEADER_HEIGHT_INDEX:3,HEADER_WIDTH_INDEX:4,MIPMAPCOUNT_INDEX:7,HEADER_PF_FLAGS_INDEX:20,HEADER_PF_FOURCC_INDEX:21,DDSD_MIPMAPCOUNT:131072,DDPF_FOURCC:4},LV={DXT1:ce.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ce.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ce.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ce.COMPRESSED_RGB_ATC_WEBGL,ATCA:ce.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ce.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},qV=vA,MV=vd,zV=vd,NV={DXT1:vA,DXT3:vd,DXT5:vd,"ATC ":qV,ATCA:MV,ATCI:zV};function mA(e){return new Uint32Array(e,0,ei.HEADER_LENGTH)[ei.MAGIC_NUMBER_INDEX]===ei.MAGIC_NUMBER}function gA(e){let r=new Int32Array(e,0,ei.HEADER_LENGTH),t=r[ei.HEADER_PF_FOURCC_INDEX];zi(Boolean(r[ei.HEADER_PF_FLAGS_INDEX]&ei.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let i=UV(t),a=LV[i],n=NV[i];zi(a&&n,`DDS: Unknown pixel format ${t}`);let o=1;r[ei.HEADER_FLAGS_INDEX]&ei.DDSD_MIPMAPCOUNT&&(o=Math.max(1,r[ei.MIPMAPCOUNT_INDEX]));let s=r[ei.HEADER_WIDTH_INDEX],u=r[ei.HEADER_HEIGHT_INDEX],l=r[ei.HEADER_SIZE_INDEX]+4,f=new Uint8Array(e,l);return vu(f,{mipMapLevels:o,width:s,height:u,sizeFunction:n,internalFormat:a})}function vA(e,r){return(e+3>>2)*(r+3>>2)*8}function vd(e,r){return(e+3>>2)*(r+3>>2)*16}function UV(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bi={MAGIC_NUMBER:55727696,MAGIC_NUMBER_EXTRA:1347834371,HEADER_LENGTH:13,HEADER_SIZE:52,MAGIC_NUMBER_INDEX:0,PIXEL_FORMAT_INDEX:2,COLOUR_SPACE_INDEX:4,HEIGHT_INDEX:6,WIDTH_INDEX:7,MIPMAPCOUNT_INDEX:11,METADATA_SIZE_INDEX:12},HV={0:[ce.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ce.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ce.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ce.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ce.COMPRESSED_RGB_ETC1_WEBGL],7:[ce.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ce.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ce.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ce.COMPRESSED_RGB8_ETC2],23:[ce.COMPRESSED_RGBA8_ETC2_EAC],24:[ce.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ce.COMPRESSED_R11_EAC],26:[ce.COMPRESSED_RG11_EAC],27:[ce.COMPRESSED_RGBA_ASTC_4X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ce.COMPRESSED_RGBA_ASTC_5X4_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ce.COMPRESSED_RGBA_ASTC_5X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ce.COMPRESSED_RGBA_ASTC_6X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ce.COMPRESSED_RGBA_ASTC_6X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ce.COMPRESSED_RGBA_ASTC_8X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ce.COMPRESSED_RGBA_ASTC_8X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ce.COMPRESSED_RGBA_ASTC_8X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ce.COMPRESSED_RGBA_ASTC_10X5_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ce.COMPRESSED_RGBA_ASTC_10X6_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ce.COMPRESSED_RGBA_ASTC_10X8_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ce.COMPRESSED_RGBA_ASTC_10X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ce.COMPRESSED_RGBA_ASTC_12X10_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ce.COMPRESSED_RGBA_ASTC_12X12_KHR,ce.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},GV={0:bA,1:bA,2:yA,3:yA,6:ul,7:ul,9:cl,11:cl,22:ul,23:cl,24:ul,25:ul,26:cl,27:cl,28:WV,29:VV,30:$V,31:KV,32:YV,33:XV,34:QV,35:ZV,36:JV,37:e$,38:r$,39:t$,40:a$};function xA(e){let t=new Uint32Array(e,0,bi.HEADER_LENGTH)[bi.MAGIC_NUMBER_INDEX];return t===bi.MAGIC_NUMBER||t===bi.MAGIC_NUMBER_EXTRA}function wA(e){let r=new Uint32Array(e,0,bi.HEADER_LENGTH),t=r[bi.PIXEL_FORMAT_INDEX],i=r[bi.COLOUR_SPACE_INDEX],a=HV[t]||[],n=a.length>1&&i?a[1]:a[0],o=GV[t],s=r[bi.MIPMAPCOUNT_INDEX],u=r[bi.WIDTH_INDEX],l=r[bi.HEIGHT_INDEX],f=bi.HEADER_SIZE+r[bi.METADATA_SIZE_INDEX],h=new Uint8Array(e,f);return vu(h,{mipMapLevels:s,width:u,height:l,sizeFunction:o,internalFormat:n})}function bA(e,r){return e=Math.max(e,16),r=Math.max(r,8),e*r/4}function yA(e,r){return e=Math.max(e,8),r=Math.max(r,8),e*r/2}function ul(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*8}function cl(e,r){return Math.floor((e+3)/4)*Math.floor((r+3)/4)*16}function WV(e,r){return Math.floor((e+4)/5)*Math.floor((r+3)/4)*16}function VV(e,r){return Math.floor((e+4)/5)*Math.floor((r+4)/5)*16}function $V(e,r){return Math.floor((e+5)/6)*Math.floor((r+4)/5)*16}function KV(e,r){return Math.floor((e+5)/6)*Math.floor((r+5)/6)*16}function YV(e,r){return Math.floor((e+7)/8)*Math.floor((r+4)/5)*16}function XV(e,r){return Math.floor((e+7)/8)*Math.floor((r+5)/6)*16}function QV(e,r){return Math.floor((e+7)/8)*Math.floor((r+7)/8)*16}function ZV(e,r){return Math.floor((e+9)/10)*Math.floor((r+4)/5)*16}function JV(e,r){return Math.floor((e+9)/10)*Math.floor((r+5)/6)*16}function e$(e,r){return Math.floor((e+9)/10)*Math.floor((r+7)/8)*16}function r$(e,r){return Math.floor((e+9)/10)*Math.floor((r+9)/10)*16}function t$(e,r){return Math.floor((e+11)/12)*Math.floor((r+9)/10)*16}function a$(e,r){return Math.floor((e+11)/12)*Math.floor((r+11)/12)*16}function _A(e){if(gd(e))return fA(e);if(mA(e))return gA(e);if(xA(e))return wA(e);throw new Error("Texture container format not recognized")}var kA={name:"Texture Containers",id:"compressed-texture",module:"textures",version:cd,worker:!0,extensions:["ktx","ktx2","dds","pvr"],mimeTypes:["image/ktx2","image/ktx","image/vnd-ms.dds","image/x-dds","application/octet-stream"],binary:!0,options:{"compressed-texture":{libraryPath:"libs/",useBasis:!1}}},bd={...kA,parse:async(e,r)=>{var t;return(t=r==null?void 0:r["compressed-texture"])!=null&&t.useBasis?(r.basis={format:{alpha:"BC3",noAlpha:"BC1"},...r.basis,containerFormat:"ktx2",module:"encoder"},(await ol(e,r))[0]):_A(e)}};function SA(e,r=null){return r?`${e}?token=${r}`:e}var i$={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},n$={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},ls={...i$,...n$};function m1(e){switch(e){case"UInt8":return Uint8Array;case"UInt16":return Uint16Array;case"UInt32":return Uint32Array;case"Float32":return Float32Array;case"UInt64":return Float64Array;default:throw new Error(`parse i3s tile content: unknown type of data: ${e}`)}}var EA={UInt8:ls.UNSIGNED_BYTE,UInt16:ls.UNSIGNED_SHORT,Float32:ls.FLOAT,UInt32:ls.UNSIGNED_INT,UInt64:ls.DOUBLE};function bu(e){switch(e){case"UInt8":return 1;case"UInt16":case"Int16":return 2;case"UInt32":case"Int32":case"Float32":return 4;case"UInt64":case"Int64":case"Float64":return 8;default:throw new Error(`parse i3s tile content: unknown size of data: ${e}`)}}var yd=new Ir([0,0,0]);function o$(e){switch(e){case"ktx-etc2":case"dds":return bd;case"ktx2":return sl;case"jpg":case"png":default:return ud}}var s$="i3s-attribute-type";async function PA(e,r,t,i,a){var o;let n={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new vi,coordinateSystem:0,byteLength:0,texture:null};if(r.textureUrl){let s=SA(r.textureUrl,(o=i==null?void 0:i.i3s)==null?void 0:o.token),u=o$(r.textureFormat),h=await(await((a==null?void 0:a.fetch)||fetch)(s)).arrayBuffer();if(i!=null&&i.i3s.decodeTextures){if(u===ud){let d={...r.textureLoaderOptions,image:{type:"data"}};try{let m=await Gg(h,[],d,a);n.texture=m}catch{let y=await Nn(h,u,d,a);n.texture=y}}else if(u===bd||u===sl){let d=await Bv(h,u,r.textureLoaderOptions);u===sl&&(d=d[0]),n.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else n.texture=h}return n.material=g$(r.materialDefinition,n.texture),n.material&&(n.texture=null),await u$(e,n,r,t,i)}async function u$(e,r,t,i,a){var h,d;let n=e.byteLength,o,s,u=0,l=0,f;if(t.isDracoGeometry){let m=await Nn(e,Xj,{draco:{attributeNameEntry:s$}});s=m.header.vertexCount,f=(h=m.indices)==null?void 0:h.value;let{POSITION:y,NORMAL:k,COLOR_0:x,TEXCOORD_0:A,["feature-index"]:P,["uv-region"]:T}=m.attributes;o={position:y,normal:k,color:x,uv0:A,uvRegion:T,id:P},c$(o,m);let B=x$(P);B&&y$(o,B)}else{let{vertexAttributes:m,ordering:y,featureAttributes:k,featureAttributeOrder:x}=i.store.defaultGeometrySchema,A=f$(e,i);u=A.byteOffset,s=A.vertexCount,l=A.featureCount;let{attributes:P,byteOffset:T}=AA(e,u,m,s,y),{attributes:B}=AA(e,T,k,l,x);b$(B),o=l$(P,B)}if(!((d=a==null?void 0:a.i3s)!=null&&d.coordinateSystem)||a.i3s.coordinateSystem===2){let m=d$(o.position,t);r.modelMatrix=m.invert(),r.coordinateSystem=2}else r.modelMatrix=m$(o.position),r.coordinateSystem=3;r.attributes={positions:o.position,normals:o.normal,colors:jA(o.color),texCoords:o.uv0,uvRegions:jA(o.uvRegion||o.region)},r.indices=f||null,o.id&&o.id.value&&(r.featureIds=o.id.value);for(let m in r.attributes)r.attributes[m]||delete r.attributes[m];return r.vertexCount=s,r.byteLength=n,r}function c$(e,r){for(let t in r.loaderData.attributes){let i=r.loaderData.attributes[t];switch(i.name){case"POSITION":e.position.metadata=i.metadata;break;case"feature-index":e.id.metadata=i.metadata;break;default:break}}}function l$(e,r){return{...e,...r}}function jA(e){return e&&(e.normalized=!0,e)}function f$(e,r){let t=0,i=0,a=0;for(let{property:n,type:o}of r.store.defaultGeometrySchema.header){let s=m1(o);switch(n){case"vertexCount":i=new s(e,0,4)[0],t+=bu(o);break;case"featureCount":a=new s(e,4,4)[0],t+=bu(o);break;default:break}}return{vertexCount:i,featureCount:a,byteOffset:t}}function AA(e,r,t,i,a){let n={};for(let o of a)if(t[o]){let{valueType:s,valuesPerElement:u}=t[o];if(r+i*u*bu(s)<=e.byteLength){let l=e.slice(r),f;if(s==="UInt64")f=p$(l,i*u,bu(s));else{let h=m1(s);f=new h(l,0,i*u)}switch(n[o]={value:f,type:EA[s],size:u},o){case"color":n.color.normalized=!0;break;case"position":case"region":case"normal":default:}r=r+i*u*bu(s)}else if(o!=="uv0")break}return{attributes:n,byteOffset:r}}function p$(e,r,t){let i=[],a=new DataView(e),n=0;for(let o=0;o<r;o++){let s=a.getUint32(n,!0),u=a.getUint32(n+4,!0),l=s+2**32*u;i.push(l),n+=t}return new Uint32Array(i)}function d$(e,r){let t=r.mbs,i=e.value,a=e.metadata,n=new vi,o=new Ir(t[0],t[1],t[2]),s=new Ir;return Wn.WGS84.cartographicToCartesian(o,s),Wn.WGS84.eastNorthUpToFixedFrame(s,n),e.value=h$(i,a,o),n}function h$(e,r={},t){let i=new Float64Array(e.length),a=r["i3s-scale_x"]&&r["i3s-scale_x"].double||1,n=r["i3s-scale_y"]&&r["i3s-scale_y"].double||1;for(let o=0;o<i.length;o+=3)i[o]=e[o]*a+t.x,i[o+1]=e[o+1]*n+t.y,i[o+2]=e[o+2]+t.z;for(let o=0;o<i.length;o+=3)Wn.WGS84.cartographicToCartesian(i.subarray(o,o+3),yd),i[o]=yd.x,i[o+1]=yd.y,i[o+2]=yd.z;return i}function m$(e){var n,o;let r=e.metadata,t=((n=r==null?void 0:r["i3s-scale_x"])==null?void 0:n.double)||1,i=((o=r==null?void 0:r["i3s-scale_y"])==null?void 0:o.double)||1,a=new vi;return a[0]=t,a[5]=i,a}function g$(e,r){let t;return e?t={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(t={pbrMetallicRoughness:{}},r?t.pbrMetallicRoughness.baseColorTexture={texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),t.alphaCutoff=t.alphaCutoff||.25,t.alphaMode&&(t.alphaMode=t.alphaMode.toUpperCase()),t.emissiveFactor&&(t.emissiveFactor=TA(t.emissiveFactor)),t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorFactor&&(t.pbrMetallicRoughness.baseColorFactor=TA(t.pbrMetallicRoughness.baseColorFactor)),r&&v$(t,r),t}function TA(e){let r=[...e];for(let t=0;t<e.length;t++)r[t]=e[t]/255;return r}function v$(e,r){let t={source:{image:r}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:t}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:t}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:t}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:t}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:t})}function b$(e){let{id:r,faceRange:t}=e;if(!r||!t)return;let i=r.value,a=t.value,n=a[a.length-1]+1,o=new Uint32Array(n*3),s=0,u=0;for(let l=1;l<a.length;l+=2){let f=Number(i[s]),h=a[l],d=a[l-1],m=h-d+1,y=u+m*3;o.fill(f,u,y),s++,u=y}e.id.value=o}function y$(e,r){let t=e.id.value,i=new Float32Array(t.length);for(let a=0;a<t.length;a++)i[a]=r[t[a]];e.id.value=i}function x$(e){var r,t;return(t=(r=e==null?void 0:e.metadata)==null?void 0:r["i3s-feature-ids"])==null?void 0:t.intArray}var w$="4.1.2",RA={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:w$,mimeTypes:["application/octet-stream"],parse:_$,extensions:["bin"],options:{"i3s-content":{}}};async function _$(e,r,t){let{tile:i,_tileOptions:a,tileset:n,_tilesetOptions:o}=(r==null?void 0:r.i3s)||{},s=a||i,u=o||n;return!s||!u?null:await PA(e,s,u,r,t)}rv(RA);
101
101
  /*! Bundled license information:
102
102
 
103
103
  is-buffer/index.js: