@loaders.gl/tile-converter 4.1.0-alpha.6 → 4.1.0-alpha.7
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.
package/dist/converter.min.cjs
CHANGED
|
@@ -170,13 +170,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);return new Hi(e,t).found}f
|
|
|
170
170
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Hi))return new Hi(e,t);if(yMt(this,e,t),this.noprocess)return this;var r=this.minimatch.set.length;this.matches=new Array(r);for(var n=0;n<r;n++)this._process(this.minimatch.set[n],n,!1);this._finish()}Hi.prototype._finish=function(){if(o8e.ok(this instanceof Hi),this.realpath){var e=this;this.matches.forEach(function(t,r){var n=e.matches[r]=Object.create(null);for(var i in t)try{i=e._makeAbs(i);var a=bMt.realpathSync(i,e.realpathCache);n[a]=!0}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=!0;else throw o}})}l0.finish(this)};Hi.prototype._process=function(e,t,r){o8e.ok(this instanceof Hi);for(var n=0;typeof e[n]=="string";)n++;var i;switch(n){case e.length:this._processSimple(e.join("/"),t);return;case 0:i=null;break;default:i=e.slice(0,n).join("/");break}var a=e.slice(n),o;i===null?o=".":((H4(i)||H4(e.map(function(c){return typeof c=="string"?c:"[*]"}).join("/")))&&(!i||!H4(i))&&(i="/"+i),o=i);var s=this._makeAbs(o);if(!xMt(this,o)){var u=a[0]===a8e.GLOBSTAR;u?this._processGlobStar(i,o,s,a,t,r):this._processReaddir(i,o,s,a,t,r)}};Hi.prototype._processReaddir=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){for(var s=n[0],u=!!this.minimatch.negate,c=s._glob,l=this.dot||c.charAt(0)===".",f=[],d=0;d<o.length;d++){var p=o[d];if(p.charAt(0)!=="."||l){var h;u&&!e?h=!p.match(s):h=p.match(s),h&&f.push(p)}}var b=f.length;if(b!==0){if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var d=0;d<b;d++){var p=f[d];e&&(e.slice(-1)!=="/"?p=e+"/"+p:p=e+p),p.charAt(0)==="/"&&!this.nomount&&(p=sz.join(this.root,p)),this._emitMatch(i,p)}return}n.shift();for(var d=0;d<b;d++){var p=f[d],g;e?g=[e,p]:g=[p],this._process(g.concat(n),i,a)}}}};Hi.prototype._emitMatch=function(e,t){if(!_Mt(this,t)){var r=this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=!0,this.stat&&this._stat(t)}}};Hi.prototype._readdirInGlobStar=function(e){if(this.follow)return this._readdir(e,!1);var t,r,n;try{r=this.fs.lstatSync(e)}catch(a){if(a.code==="ENOENT")return null}var i=r&&r.isSymbolicLink();return this.symlinks[e]=i,!i&&r&&!r.isDirectory()?this.cache[e]="FILE":t=this._readdir(e,!1),t};Hi.prototype._readdir=function(e,t){var r;if(t&&!uz(this.symlinks,e))return this._readdirInGlobStar(e);if(uz(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return null;if(Array.isArray(n))return n}try{return this._readdirEntries(e,this.fs.readdirSync(e))}catch(i){return this._readdirError(e,i),null}};Hi.prototype._readdirEntries=function(e,t){if(!this.mark&&!this.stat)for(var r=0;r<t.length;r++){var n=t[r];e==="/"?n=e+n:n=e+"/"+n,this.cache[n]=!0}return this.cache[e]=t,t};Hi.prototype._readdirError=function(e,t){switch(t.code){case"ENOTSUP":case"ENOTDIR":var r=this._makeAbs(e);if(this.cache[r]="FILE",r===this.cwdAbs){var n=new Error(t.code+" invalid cwd "+this.cwd);throw n.path=this.cwd,n.code=t.code,n}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:if(this.cache[this._makeAbs(e)]=!1,this.strict)throw t;this.silent||console.error("glob error",t);break}};Hi.prototype._processGlobStar=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){var s=n.slice(1),u=e?[e]:[],c=u.concat(s);this._process(c,i,!1);var l=o.length,f=this.symlinks[r];if(!(f&&a))for(var d=0;d<l;d++){var p=o[d];if(!(p.charAt(0)==="."&&!this.dot)){var h=u.concat(o[d],s);this._process(h,i,!0);var b=u.concat(o[d],n);this._process(b,i,!0)}}}};Hi.prototype._processSimple=function(e,t){var r=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),!!r){if(e&&H4(e)&&!this.nomount){var n=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=sz.join(this.root,e):(e=sz.resolve(this.root,e),n&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}};Hi.prototype._stat=function(e){var t=this._makeAbs(e),r=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&uz(this.cache,t)){var o=this.cache[t];if(Array.isArray(o)&&(o="DIR"),!r||o==="DIR")return o;if(r&&o==="FILE")return!1}var n,i=this.statCache[t];if(!i){var a;try{a=this.fs.lstatSync(t)}catch(s){if(s&&(s.code==="ENOENT"||s.code==="ENOTDIR"))return this.statCache[t]=!1,!1}if(a&&a.isSymbolicLink())try{i=this.fs.statSync(t)}catch{i=a}else i=a}this.statCache[t]=i;var o=!0;return i&&(o=i.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,r&&o==="FILE"?!1:o};Hi.prototype._mark=function(e){return l0.mark(this,e)};Hi.prototype._makeAbs=function(e){return l0.makeAbs(this,e)}});var lz=v((Z3r,f8e)=>{f8e.exports=l8e;function l8e(e,t){if(e&&t)return l8e(e)(t);if(typeof e!="function")throw new TypeError("need wrapper function");return Object.keys(e).forEach(function(n){r[n]=e[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var a=e.apply(this,n),o=n[n.length-1];return typeof a=="function"&&a!==o&&Object.keys(o).forEach(function(s){a[s]=o[s]}),a}}});var V4=v((e8r,fz)=>{var d8e=lz();fz.exports=d8e(W4);fz.exports.strict=d8e(p8e);W4.proto=W4(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return W4(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return p8e(this)},configurable:!0})});function W4(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function p8e(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}});var m8e=v((t8r,h8e)=>{var wMt=lz(),C2=Object.create(null),EMt=V4();h8e.exports=wMt(AMt);function AMt(e,t){return C2[e]?(C2[e].push(t),null):(C2[e]=[t],SMt(e))}function SMt(e){return EMt(function t(){var r=C2[e],n=r.length,i=TMt(arguments);try{for(var a=0;a<n;a++)r[a].apply(null,i)}finally{r.length>n?(r.splice(0,n),process.nextTick(function(){t.apply(null,i)})):delete C2[e]}})}function TMt(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}});var cz=v((i8r,v8e)=>{v8e.exports=f0;var CMt=ZG(),g8e=U4(),r8r=g8e.Minimatch,DMt=tr(),FMt=require("events").EventEmitter,dz=require("path"),pz=require("assert"),D2=z4(),mz=c8e(),d0=oz(),kMt=d0.setopts,hz=d0.ownProp,gz=m8e(),n8r=require("util"),BMt=d0.childrenIgnored,OMt=d0.isIgnored,IMt=V4();function f0(e,t,r){if(typeof t=="function"&&(r=t,t={}),t||(t={}),t.sync){if(r)throw new TypeError("callback provided to sync glob");return mz(e,t)}return new on(e,t,r)}f0.sync=mz;var PMt=f0.GlobSync=mz.GlobSync;f0.glob=f0;function RMt(e,t){if(t===null||typeof t!="object")return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}f0.hasMagic=function(e,t){var r=RMt({},t);r.noprocess=!0;var n=new on(e,r),i=n.minimatch.set;if(!e)return!1;if(i.length>1)return!0;for(var a=0;a<i[0].length;a++)if(typeof i[0][a]!="string")return!0;return!1};f0.Glob=on;DMt(on,FMt);function on(e,t,r){if(typeof t=="function"&&(r=t,t=null),t&&t.sync){if(r)throw new TypeError("callback provided to sync glob");return new PMt(e,t)}if(!(this instanceof on))return new on(e,t,r);kMt(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),typeof r=="function"&&(r=IMt(r),this.on("error",r),this.on("end",function(u){r(null,u)}));var i=this;if(this._processing=0,this._emitQueue=[],this._processQueue=[],this.paused=!1,this.noprocess)return this;if(n===0)return s();for(var a=!0,o=0;o<n;o++)this._process(this.minimatch.set[o],o,!1,s);a=!1;function s(){--i._processing,i._processing<=0&&(a?process.nextTick(function(){i._finish()}):i._finish())}}on.prototype._finish=function(){if(pz(this instanceof on),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();d0.finish(this),this.emit("end",this.found)}};on.prototype._realpath=function(){if(this._didRealpath)return;this._didRealpath=!0;var e=this.matches.length;if(e===0)return this._finish();for(var t=this,r=0;r<this.matches.length;r++)this._realpathSet(r,n);function n(){--e===0&&t._finish()}};on.prototype._realpathSet=function(e,t){var r=this.matches[e];if(!r)return t();var n=Object.keys(r),i=this,a=n.length;if(a===0)return t();var o=this.matches[e]=Object.create(null);n.forEach(function(s,u){s=i._makeAbs(s),CMt.realpath(s,i.realpathCache,function(c,l){c?c.syscall==="stat"?o[s]=!0:i.emit("error",c):o[l]=!0,--a===0&&(i.matches[e]=o,t())})})};on.prototype._mark=function(e){return d0.mark(this,e)};on.prototype._makeAbs=function(e){return d0.makeAbs(this,e)};on.prototype.abort=function(){this.aborted=!0,this.emit("abort")};on.prototype.pause=function(){this.paused||(this.paused=!0,this.emit("pause"))};on.prototype.resume=function(){if(this.paused){if(this.emit("resume"),this.paused=!1,this._emitQueue.length){var e=this._emitQueue.slice(0);this._emitQueue.length=0;for(var t=0;t<e.length;t++){var r=e[t];this._emitMatch(r[0],r[1])}}if(this._processQueue.length){var n=this._processQueue.slice(0);this._processQueue.length=0;for(var t=0;t<n.length;t++){var i=n[t];this._processing--,this._process(i[0],i[1],i[2],i[3])}}}};on.prototype._process=function(e,t,r,n){if(pz(this instanceof on),pz(typeof n=="function"),!this.aborted){if(this._processing++,this.paused){this._processQueue.push([e,t,r,n]);return}for(var i=0;typeof e[i]=="string";)i++;var a;switch(i){case e.length:this._processSimple(e.join("/"),t,n);return;case 0:a=null;break;default:a=e.slice(0,i).join("/");break}var o=e.slice(i),s;a===null?s=".":((D2(a)||D2(e.map(function(l){return typeof l=="string"?l:"[*]"}).join("/")))&&(!a||!D2(a))&&(a="/"+a),s=a);var u=this._makeAbs(s);if(BMt(this,s))return n();var c=o[0]===g8e.GLOBSTAR;c?this._processGlobStar(a,s,u,o,t,r,n):this._processReaddir(a,s,u,o,t,r,n)}};on.prototype._processReaddir=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){return s._processReaddir2(e,t,r,n,i,a,c,o)})};on.prototype._processReaddir2=function(e,t,r,n,i,a,o,s){if(!o)return s();for(var u=n[0],c=!!this.minimatch.negate,l=u._glob,f=this.dot||l.charAt(0)===".",d=[],p=0;p<o.length;p++){var h=o[p];if(h.charAt(0)!=="."||f){var b;c&&!e?b=!h.match(u):b=h.match(u),b&&d.push(h)}}var g=d.length;if(g===0)return s();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var p=0;p<g;p++){var h=d[p];e&&(e!=="/"?h=e+"/"+h:h=e+h),h.charAt(0)==="/"&&!this.nomount&&(h=dz.join(this.root,h)),this._emitMatch(i,h)}return s()}n.shift();for(var p=0;p<g;p++){var h=d[p],x;e&&(e!=="/"?h=e+"/"+h:h=e+h),this._process([h].concat(n),i,a,s)}s()};on.prototype._emitMatch=function(e,t){if(!this.aborted&&!OMt(this,t)){if(this.paused){this._emitQueue.push([e,t]);return}var r=D2(t)?t:this._makeAbs(t);if(this.mark&&(t=this._mark(t)),this.absolute&&(t=r),!this.matches[e][t]){if(this.nodir){var n=this.cache[r];if(n==="DIR"||Array.isArray(n))return}this.matches[e][t]=!0;var i=this.statCache[r];i&&this.emit("stat",t,i),this.emit("match",t)}}};on.prototype._readdirInGlobStar=function(e,t){if(this.aborted)return;if(this.follow)return this._readdir(e,!1,t);var r="lstat\0"+e,n=this,i=gz(r,a);i&&n.fs.lstat(e,i);function a(o,s){if(o&&o.code==="ENOENT")return t();var u=s&&s.isSymbolicLink();n.symlinks[e]=u,!u&&s&&!s.isDirectory()?(n.cache[e]="FILE",t()):n._readdir(e,!1,t)}};on.prototype._readdir=function(e,t,r){if(!this.aborted&&(r=gz("readdir\0"+e+"\0"+t,r),!!r)){if(t&&!hz(this.symlinks,e))return this._readdirInGlobStar(e,r);if(hz(this.cache,e)){var n=this.cache[e];if(!n||n==="FILE")return r();if(Array.isArray(n))return r(null,n)}var i=this;i.fs.readdir(e,jMt(this,e,r))}};function jMt(e,t,r){return function(n,i){n?e._readdirError(t,n,r):e._readdirEntries(t,i,r)}}on.prototype._readdirEntries=function(e,t,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var i=t[n];e==="/"?i=e+i:i=e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,r(null,t)}};on.prototype._readdirError=function(e,t,r){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t);break}return r()}};on.prototype._processGlobStar=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){s._processGlobStar2(e,t,r,n,i,a,c,o)})};on.prototype._processGlobStar2=function(e,t,r,n,i,a,o,s){if(!o)return s();var u=n.slice(1),c=e?[e]:[],l=c.concat(u);this._process(l,i,!1,s);var f=this.symlinks[r],d=o.length;if(f&&a)return s();for(var p=0;p<d;p++){var h=o[p];if(!(h.charAt(0)==="."&&!this.dot)){var b=c.concat(o[p],u);this._process(b,i,!0,s);var g=c.concat(o[p],n);this._process(g,i,!0,s)}}s()};on.prototype._processSimple=function(e,t,r){var n=this;this._stat(e,function(i,a){n._processSimple2(e,t,i,a,r)})};on.prototype._processSimple2=function(e,t,r,n,i){if(this.matches[t]||(this.matches[t]=Object.create(null)),!n)return i();if(e&&D2(e)&&!this.nomount){var a=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=dz.join(this.root,e):(e=dz.resolve(this.root,e),a&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e),i()};on.prototype._stat=function(e,t){var r=this._makeAbs(e),n=e.slice(-1)==="/";if(e.length>this.maxLength)return t();if(!this.stat&&hz(this.cache,r)){var i=this.cache[r];if(Array.isArray(i)&&(i="DIR"),!n||i==="DIR")return t(null,i);if(n&&i==="FILE")return t()}var a,o=this.statCache[r];if(o!==void 0){if(o===!1)return t(null,o);var s=o.isDirectory()?"DIR":"FILE";return n&&s==="FILE"?t():t(null,s,o)}var u=this,c=gz("stat\0"+r,l);c&&u.fs.lstat(r,c);function l(f,d){if(d&&d.isSymbolicLink())return u.fs.stat(r,function(p,h){p?u._stat2(e,r,null,d,t):u._stat2(e,r,p,h,t)});u._stat2(e,r,f,d,t)}};on.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return this.statCache[t]=!1,i();var a=e.slice(-1)==="/";if(this.statCache[t]=n,t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,a&&o==="FILE"?i():i(null,o,n)}});var _8e=v((a8r,x8e)=>{var y8e=IG(),kb=require("path"),vz=i3e(),LMt=g3e(),MMt=F3e(),qMt=I3e(),NMt=cz(),p0=x8e.exports={},b8e=/[\/\\]/g,UMt=function(e,t){var r=[];return vz(e).forEach(function(n){var i=n.indexOf("!")===0;i&&(n=n.slice(1));var a=t(n);i?r=LMt(r,a):r=MMt(r,a)}),r};p0.exists=function(){var e=kb.join.apply(kb,arguments);return y8e.existsSync(e)};p0.expand=function(...e){var t=qMt(e[0])?e.shift():{},r=Array.isArray(e[0])?e[0]:e;if(r.length===0)return[];var n=UMt(r,function(i){return NMt.sync(i,t)});return t.filter&&(n=n.filter(function(i){i=kb.join(t.cwd||"",i);try{return typeof t.filter=="function"?t.filter(i):y8e.statSync(i)[t.filter]()}catch{return!1}})),n};p0.expandMapping=function(e,t,r){r=Object.assign({rename:function(a,o){return kb.join(a||"",o)}},r);var n=[],i={};return p0.expand(r,e).forEach(function(a){var o=a;r.flatten&&(o=kb.basename(o)),r.ext&&(o=o.replace(/(\.[^\/]*)?$/,r.ext));var s=r.rename(t,o,r);r.cwd&&(a=kb.join(r.cwd,a)),s=s.replace(b8e,"/"),a=a.replace(b8e,"/"),i[s]?i[s].src.push(a):(n.push({src:[a],dest:s}),i[s]=n[n.length-1])}),n};p0.normalizeFilesArray=function(e){var t=[];return e.forEach(function(r){var n;("src"in r||"dest"in r)&&t.push(r)}),t.length===0?[]:(t=_(t).chain().forEach(function(r){!("src"in r)||!r.src||(Array.isArray(r.src)?r.src=vz(r.src):r.src=[r.src])}).map(function(r){var n=Object.assign({},r);if(delete n.src,delete n.dest,r.expand)return p0.expandMapping(r.src,r.dest,n).map(function(a){var o=Object.assign({},r);return o.orig=Object.assign({},r),o.src=a.src,o.dest=a.dest,["expand","cwd","flatten","rename","ext"].forEach(function(s){delete o[s]}),o});var i=Object.assign({},r);return i.orig=Object.assign({},r),"src"in i&&Object.defineProperty(i,"src",{enumerable:!0,get:function a(){var o;return"result"in a||(o=r.src,o=Array.isArray(o)?vz(o):[o],a.result=p0.expand(n,o)),a.result}}),"dest"in i&&(i.dest=r.dest),i}).flatten().value(),t)}});var Bb=v((s8r,A8e)=>{var bz=IG(),w8e=require("path"),o8r=require("util"),GMt=z6e(),E8e=PG(),zMt=Q6e(),HMt=require("stream").Stream,WMt=j_().PassThrough,Go=A8e.exports={};Go.file=_8e();Go.collectStream=function(e,t){var r=[],n=0;e.on("error",t),e.on("data",function(i){r.push(i),n+=i.length}),e.on("end",function(){var i=new Buffer(n),a=0;r.forEach(function(o){o.copy(i,a),a+=o.length}),t(null,i)})};Go.dateify=function(e){return e=e||new Date,e instanceof Date?e=e:typeof e=="string"?e=new Date(e):e=new Date,e};Go.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},zMt(...n)};Go.isStream=function(e){return e instanceof HMt};Go.lazyReadStream=function(e){return new GMt.Readable(function(){return bz.createReadStream(e)})};Go.normalizeInputSource=function(e){if(e===null)return new Buffer(0);if(typeof e=="string")return new Buffer(e);if(Go.isStream(e)&&!e._readableState){var t=new WMt;return e.pipe(t),t}return e};Go.sanitizePath=function(e){return E8e(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};Go.trailingSlashIt=function(e){return e.slice(-1)!=="/"?e+"/":e};Go.unixifyPath=function(e){return E8e(e,!1).replace(/^\w+:/,"")};Go.walkdir=function(e,t,r){var n=[];typeof t=="function"&&(r=t,t=e),bz.readdir(e,function(i,a){var o=0,s,u;if(i)return r(i);(function c(){if(s=a[o++],!s)return r(null,n);u=w8e.join(e,s),bz.stat(u,function(l,f){n.push({path:u,relative:w8e.relative(t,u).replace(/\\/g,"/"),stats:f}),f&&f.isDirectory()?Go.walkdir(u,t,function(d,p){p.forEach(function(h){n.push(h)}),c()}):c()})})()})}});var D8e=v((T8e,C8e)=>{var VMt=require("util"),KMt={ABORTED:"archive was aborted",DIRECTORYDIRPATHREQUIRED:"diretory dirpath argument must be a non-empty string value",DIRECTORYFUNCTIONINVALIDDATA:"invalid data returned by directory custom data function",ENTRYNAMEREQUIRED:"entry name must be a non-empty string value",FILEFILEPATHREQUIRED:"file filepath argument must be a non-empty string value",FINALIZING:"archive already finalizing",QUEUECLOSED:"queue closed",NOENDMETHOD:"no suitable finalize/end method defined by module",DIRECTORYNOTSUPPORTED:"support for directory entries not defined by module",FORMATSET:"archive format already set",INPUTSTEAMBUFFERREQUIRED:"input source must be valid Stream or Buffer instance",MODULESET:"module already set",SYMLINKNOTSUPPORTED:"support for symlink entries not defined by module",SYMLINKFILEPATHREQUIRED:"symlink filepath argument must be a non-empty string value",SYMLINKTARGETREQUIRED:"symlink target argument must be a non-empty string value",ENTRYNOTSUPPORTED:"entry not supported"};function S8e(e,t){Error.captureStackTrace(this,this.constructor),this.message=KMt[e]||e,this.code=e,this.data=t}VMt.inherits(S8e,Error);T8e=C8e.exports=S8e});var yz=v((u8r,F8e)=>{F8e.exports=require("stream")});var R8e=v((c8r,P8e)=>{"use strict";function k8e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function B8e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k8e(Object(r),!0).forEach(function(n){$Mt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k8e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $Mt(e,t,r){return t=I8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YMt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O8e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,I8e(n.key),n)}}function JMt(e,t,r){return t&&O8e(e.prototype,t),r&&O8e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function I8e(e){var t=XMt(e,"string");return typeof t=="symbol"?t:String(t)}function XMt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var QMt=require("buffer"),K4=QMt.Buffer,ZMt=require("util"),xz=ZMt.inspect,e7t=xz&&xz.custom||"inspect";function t7t(e,t,r){K4.prototype.copy.call(e,t,r)}P8e.exports=function(){function e(){YMt(this,e),this.head=null,this.tail=null,this.length=0}return JMt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return K4.alloc(0);for(var n=K4.allocUnsafe(r>>>0),i=this.head,a=0;i;)t7t(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=K4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:e7t,value:function(r,n){return xz(this,B8e(B8e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var wz=v((l8r,L8e)=>{"use strict";function r7t(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(_z,this,e)):process.nextTick(_z,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick($4,r):(r._writableState.errorEmitted=!0,process.nextTick(j8e,r,a)):process.nextTick(j8e,r,a):t?(process.nextTick($4,r),t(a)):process.nextTick($4,r)}),this)}function j8e(e,t){_z(e,t),$4(e)}function $4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function n7t(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function _z(e,t){e.emit("error",t)}function i7t(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}L8e.exports={destroy:r7t,undestroy:n7t,errorOrDestroy:i7t}});var Jd=v((f8r,N8e)=>{"use strict";var q8e={};function Fs(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,q8e[e]=i}function M8e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function a7t(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o7t(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function s7t(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Fs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Fs("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&a7t(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(o7t(e," argument"))i=`The ${e} ${n} ${M8e(t,"type")}`;else{let a=s7t(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${M8e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Fs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Fs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Fs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Fs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Fs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Fs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Fs("ERR_STREAM_WRITE_AFTER_END","write after end");Fs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Fs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Fs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");N8e.exports.codes=q8e});var Ez=v((d8r,U8e)=>{"use strict";var u7t=Jd().codes.ERR_INVALID_OPT_VALUE;function c7t(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function l7t(e,t,r,n){var i=c7t(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new u7t(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}U8e.exports={getHighWaterMark:l7t}});var Tz=v((p8r,K8e)=>{"use strict";K8e.exports=oi;function z8e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){L7t(t,e)}}var Ob;oi.WritableState=k2;var f7t={deprecate:mh()},H8e=yz(),J4=require("buffer").Buffer,d7t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function p7t(e){return J4.from(e)}function h7t(e){return J4.isBuffer(e)||e instanceof d7t}var Sz=wz(),m7t=Ez(),g7t=m7t.getHighWaterMark,Xd=Jd().codes,v7t=Xd.ERR_INVALID_ARG_TYPE,b7t=Xd.ERR_METHOD_NOT_IMPLEMENTED,y7t=Xd.ERR_MULTIPLE_CALLBACK,x7t=Xd.ERR_STREAM_CANNOT_PIPE,_7t=Xd.ERR_STREAM_DESTROYED,w7t=Xd.ERR_STREAM_NULL_VALUES,E7t=Xd.ERR_STREAM_WRITE_AFTER_END,A7t=Xd.ERR_UNKNOWN_ENCODING,Ib=Sz.errorOrDestroy;tr()(oi,H8e);function S7t(){}function k2(e,t,r){Ob=Ob||h0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Ob),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=g7t(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){O7t(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new z8e(this)}k2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(k2.prototype,"buffer",{get:f7t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Y4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Y4=Function.prototype[Symbol.hasInstance],Object.defineProperty(oi,Symbol.hasInstance,{value:function(t){return Y4.call(this,t)?!0:this!==oi?!1:t&&t._writableState instanceof k2}})):Y4=function(t){return t instanceof this};function oi(e){Ob=Ob||h0();var t=this instanceof Ob;if(!t&&!Y4.call(oi,this))return new oi(e);this._writableState=new k2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),H8e.call(this)}oi.prototype.pipe=function(){Ib(this,new x7t)};function T7t(e,t){var r=new E7t;Ib(e,r),process.nextTick(t,r)}function C7t(e,t,r,n){var i;return r===null?i=new w7t:typeof r!="string"&&!t.objectMode&&(i=new v7t("chunk",["string","Buffer"],r)),i?(Ib(e,i),process.nextTick(n,i),!1):!0}oi.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&h7t(e);return a&&!J4.isBuffer(e)&&(e=p7t(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=S7t),n.ending?T7t(this,r):(a||C7t(this,n,e,r))&&(n.pendingcb++,i=F7t(this,n,a,e,t,r)),i};oi.prototype.cork=function(){this._writableState.corked++};oi.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&W8e(this,e))};oi.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new A7t(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(oi.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function D7t(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=J4.from(t,r)),t}Object.defineProperty(oi.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function F7t(e,t,r,n,i,a){if(!r){var o=D7t(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else Az(e,t,!1,s,n,i,a);return u}function Az(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _7t("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function k7t(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(F2,e,t),e._writableState.errorEmitted=!0,Ib(e,n)):(i(n),e._writableState.errorEmitted=!0,Ib(e,n),F2(e,t))}function B7t(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function O7t(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new y7t;if(B7t(r),t)k7t(e,r,n,t,i);else{var a=V8e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&W8e(e,r),n?process.nextTick(G8e,e,r,a,i):G8e(e,r,a,i)}}function G8e(e,t,r,n){r||I7t(e,t),t.pendingcb--,n(),F2(e,t)}function I7t(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function W8e(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,Az(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new z8e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(Az(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}oi.prototype._write=function(e,t,r){r(new b7t("_write()"))};oi.prototype._writev=null;oi.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||j7t(this,n,r),this};Object.defineProperty(oi.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function V8e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function P7t(e,t){e._final(function(r){t.pendingcb--,r&&Ib(e,r),t.prefinished=!0,e.emit("prefinish"),F2(e,t)})}function R7t(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(P7t,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function F2(e,t){var r=V8e(t);if(r&&(R7t(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function j7t(e,t,r){t.ending=!0,F2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function L7t(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(oi.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});oi.prototype.destroy=Sz.destroy;oi.prototype._undestroy=Sz.undestroy;oi.prototype._destroy=function(e,t){t(e)}});var h0=v((h8r,Y8e)=>{"use strict";var M7t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};Y8e.exports=jc;var $8e=Fz(),Dz=Tz();tr()(jc,$8e);for(Cz=M7t(Dz.prototype),X4=0;X4<Cz.length;X4++)Q4=Cz[X4],jc.prototype[Q4]||(jc.prototype[Q4]=Dz.prototype[Q4]);var Cz,Q4,X4;function jc(e){if(!(this instanceof jc))return new jc(e);$8e.call(this,e),Dz.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",q7t)))}Object.defineProperty(jc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(jc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(jc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function q7t(){this._writableState.ended||process.nextTick(N7t,this)}function N7t(e){e.end()}Object.defineProperty(jc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var Oz=v(X8e=>{"use strict";var Bz=Hs().Buffer,J8e=Bz.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function U7t(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function G7t(e){var t=U7t(e);if(typeof t!="string"&&(Bz.isEncoding===J8e||!J8e(e)))throw new Error("Unknown encoding: "+e);return t||e}X8e.StringDecoder=B2;function B2(e){this.encoding=G7t(e);var t;switch(this.encoding){case"utf16le":this.text=$7t,this.end=Y7t,t=4;break;case"utf8":this.fillLast=W7t,t=4;break;case"base64":this.text=J7t,this.end=X7t,t=3;break;default:this.write=Q7t,this.end=Z7t;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bz.allocUnsafe(t)}B2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};B2.prototype.end=K7t;B2.prototype.text=V7t;B2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function kz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function z7t(e,t,r){var n=t.length-1;if(n<r)return 0;var i=kz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=kz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=kz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function H7t(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function W7t(e){var t=this.lastTotal-this.lastNeed,r=H7t(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function V7t(e,t){var r=z7t(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function K7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function $7t(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function Y7t(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function J7t(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function X7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function Q7t(e){return e.toString(this.encoding)}function Z7t(e){return e&&e.length?this.write(e):""}});var Z4=v((g8r,eCe)=>{"use strict";var Q8e=Jd().codes.ERR_STREAM_PREMATURE_CLOSE;function eqt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function tqt(){}function rqt(e){return e.setHeader&&typeof e.abort=="function"}function Z8e(e,t,r){if(typeof t=="function")return Z8e(e,null,t);t||(t={}),r=eqt(r||tqt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(h){r.call(e,h)},f=function(){var h;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(h=new Q8e),r.call(e,h);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(h=new Q8e),r.call(e,h)},d=function(){e.req.on("finish",s)};return rqt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}eCe.exports=Z8e});var rCe=v((v8r,tCe)=>{"use strict";var eF;function Qd(e,t,r){return t=nqt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nqt(e){var t=iqt(e,"string");return typeof t=="symbol"?t:String(t)}function iqt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var aqt=Z4(),Zd=Symbol("lastResolve"),m0=Symbol("lastReject"),O2=Symbol("error"),tF=Symbol("ended"),g0=Symbol("lastPromise"),Iz=Symbol("handlePromise"),v0=Symbol("stream");function ep(e,t){return{value:e,done:t}}function oqt(e){var t=e[Zd];if(t!==null){var r=e[v0].read();r!==null&&(e[g0]=null,e[Zd]=null,e[m0]=null,t(ep(r,!1)))}}function sqt(e){process.nextTick(oqt,e)}function uqt(e,t){return function(r,n){e.then(function(){if(t[tF]){r(ep(void 0,!0));return}t[Iz](r,n)},n)}}var cqt=Object.getPrototypeOf(function(){}),lqt=Object.setPrototypeOf((eF={get stream(){return this[v0]},next:function(){var t=this,r=this[O2];if(r!==null)return Promise.reject(r);if(this[tF])return Promise.resolve(ep(void 0,!0));if(this[v0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[O2]?s(t[O2]):o(ep(void 0,!0))})});var n=this[g0],i;if(n)i=new Promise(uqt(n,this));else{var a=this[v0].read();if(a!==null)return Promise.resolve(ep(a,!1));i=new Promise(this[Iz])}return this[g0]=i,i}},Qd(eF,Symbol.asyncIterator,function(){return this}),Qd(eF,"return",function(){var t=this;return new Promise(function(r,n){t[v0].destroy(null,function(i){if(i){n(i);return}r(ep(void 0,!0))})})}),eF),cqt),fqt=function(t){var r,n=Object.create(lqt,(r={},Qd(r,v0,{value:t,writable:!0}),Qd(r,Zd,{value:null,writable:!0}),Qd(r,m0,{value:null,writable:!0}),Qd(r,O2,{value:null,writable:!0}),Qd(r,tF,{value:t._readableState.endEmitted,writable:!0}),Qd(r,Iz,{value:function(a,o){var s=n[v0].read();s?(n[g0]=null,n[Zd]=null,n[m0]=null,a(ep(s,!1))):(n[Zd]=a,n[m0]=o)},writable:!0}),r));return n[g0]=null,aqt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[m0];a!==null&&(n[g0]=null,n[Zd]=null,n[m0]=null,a(i)),n[O2]=i;return}var o=n[Zd];o!==null&&(n[g0]=null,n[Zd]=null,n[m0]=null,o(ep(void 0,!0))),n[tF]=!0}),t.on("readable",sqt.bind(null,n)),n};tCe.exports=fqt});var oCe=v((b8r,aCe)=>{"use strict";function nCe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function dqt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){nCe(a,n,i,o,s,"next",u)}function s(u){nCe(a,n,i,o,s,"throw",u)}o(void 0)})}}function iCe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function pqt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?iCe(Object(r),!0).forEach(function(n){hqt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):iCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hqt(e,t,r){return t=mqt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mqt(e){var t=gqt(e,"string");return typeof t=="symbol"?t:String(t)}function gqt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vqt=Jd().codes.ERR_INVALID_ARG_TYPE;function bqt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new vqt("iterable",["Iterable"],t);var i=new e(pqt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=dqt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}aCe.exports=bqt});var Fz=v((x8r,gCe)=>{"use strict";gCe.exports=Nr;var Pb;Nr.ReadableState=lCe;var y8r=require("events").EventEmitter,cCe=function(t,r){return t.listeners(r).length},P2=yz(),rF=require("buffer").Buffer,yqt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function xqt(e){return rF.from(e)}function _qt(e){return rF.isBuffer(e)||e instanceof yqt}var Pz=require("util"),gr;Pz&&Pz.debuglog?gr=Pz.debuglog("stream"):gr=function(){};var wqt=R8e(),Uz=wz(),Eqt=Ez(),Aqt=Eqt.getHighWaterMark,nF=Jd().codes,Sqt=nF.ERR_INVALID_ARG_TYPE,Tqt=nF.ERR_STREAM_PUSH_AFTER_EOF,Cqt=nF.ERR_METHOD_NOT_IMPLEMENTED,Dqt=nF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Rb,Rz,jz;tr()(Nr,P2);var I2=Uz.errorOrDestroy,Lz=["error","close","destroy","pause","resume"];function Fqt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function lCe(e,t,r){Pb=Pb||h0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Pb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Aqt(this,e,"readableHighWaterMark",r),this.buffer=new wqt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Rb||(Rb=Oz().StringDecoder),this.decoder=new Rb(e.encoding),this.encoding=e.encoding)}function Nr(e){if(Pb=Pb||h0(),!(this instanceof Nr))return new Nr(e);var t=this instanceof Pb;this._readableState=new lCe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),P2.call(this)}Object.defineProperty(Nr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Nr.prototype.destroy=Uz.destroy;Nr.prototype._undestroy=Uz.undestroy;Nr.prototype._destroy=function(e,t){t(e)};Nr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=rF.from(e,t),t=""),n=!0),fCe(this,e,t,!1,n)};Nr.prototype.unshift=function(e){return fCe(this,e,null,!0,!1)};function fCe(e,t,r,n,i){gr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Oqt(e,a);else{var o;if(i||(o=kqt(a,t)),o)I2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==rF.prototype&&(t=xqt(t)),n)a.endEmitted?I2(e,new Dqt):Mz(e,a,t,!0);else if(a.ended)I2(e,new Tqt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Mz(e,a,t,!1):Nz(e,a)):Mz(e,a,t,!1)}else n||(a.reading=!1,Nz(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Mz(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&iF(e)),Nz(e,t)}function kqt(e,t){var r;return!_qt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Sqt("chunk",["string","Buffer","Uint8Array"],t)),r}Nr.prototype.isPaused=function(){return this._readableState.flowing===!1};Nr.prototype.setEncoding=function(e){Rb||(Rb=Oz().StringDecoder);var t=new Rb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var sCe=1073741824;function Bqt(e){return e>=sCe?e=sCe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function uCe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Bqt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Nr.prototype.read=function(e){gr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return gr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?qz(this):iF(this),null;if(e=uCe(e,t),e===0&&t.ended)return t.length===0&&qz(this),null;var n=t.needReadable;gr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,gr("length less than watermark",n)),t.ended||t.reading?(n=!1,gr("reading or ended",n)):n&&(gr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=uCe(r,t)));var i;return e>0?i=hCe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&qz(this)),i!==null&&this.emit("data",i),i};function Oqt(e,t){if(gr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?iF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,dCe(e)))}}function iF(e){var t=e._readableState;gr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(gr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(dCe,e))}function dCe(e){var t=e._readableState;gr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Gz(e)}function Nz(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Iqt,e,t))}function Iqt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(gr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Nr.prototype._read=function(e){I2(this,new Cqt("_read()"))};Nr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,gr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){gr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){gr("onend"),e.end()}var u=Pqt(r);e.on("drain",u);var c=!1;function l(){gr("cleanup"),e.removeListener("close",p),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){gr("ondata");var x=e.write(g);gr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&mCe(n.pipes,e)!==-1)&&!c&&(gr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){gr("onerror",g),b(),e.removeListener("error",d),cCe(e,"error")===0&&I2(e,g)}Fqt(e,"error",d);function p(){e.removeListener("finish",h),b()}e.once("close",p);function h(){gr("onfinish"),e.removeListener("close",p),b()}e.once("finish",h);function b(){gr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(gr("pipe resume"),r.resume()),e};function Pqt(e){return function(){var r=e._readableState;gr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&cCe(e,"data")&&(r.flowing=!0,Gz(e))}}Nr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=mCe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Nr.prototype.on=function(e,t){var r=P2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,gr("on readable",n.length,n.reading),n.length?iF(this):n.reading||process.nextTick(Rqt,this)),r};Nr.prototype.addListener=Nr.prototype.on;Nr.prototype.removeListener=function(e,t){var r=P2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(pCe,this),r};Nr.prototype.removeAllListeners=function(e){var t=P2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(pCe,this),t};function pCe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function Rqt(e){gr("readable nexttick read 0"),e.read(0)}Nr.prototype.resume=function(){var e=this._readableState;return e.flowing||(gr("resume"),e.flowing=!e.readableListening,jqt(this,e)),e.paused=!1,this};function jqt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Lqt,e,t))}function Lqt(e,t){gr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Gz(e),t.flowing&&!t.reading&&e.read(0)}Nr.prototype.pause=function(){return gr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(gr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Gz(e){var t=e._readableState;for(gr("flow",t.flowing);t.flowing&&e.read()!==null;);}Nr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(gr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(gr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<Lz.length;a++)e.on(Lz[a],this.emit.bind(this,Lz[a]));return this._read=function(o){gr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Nr.prototype[Symbol.asyncIterator]=function(){return Rz===void 0&&(Rz=rCe()),Rz(this)});Object.defineProperty(Nr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Nr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Nr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Nr._fromList=hCe;Object.defineProperty(Nr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function hCe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function qz(e){var t=e._readableState;gr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Mqt,t,e))}function Mqt(e,t){if(gr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Nr.from=function(e,t){return jz===void 0&&(jz=oCe()),jz(Nr,e,t)});function mCe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var zz=v((_8r,bCe)=>{"use strict";bCe.exports=Xl;var aF=Jd().codes,qqt=aF.ERR_METHOD_NOT_IMPLEMENTED,Nqt=aF.ERR_MULTIPLE_CALLBACK,Uqt=aF.ERR_TRANSFORM_ALREADY_TRANSFORMING,Gqt=aF.ERR_TRANSFORM_WITH_LENGTH_0,oF=h0();tr()(Xl,oF);function zqt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Nqt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Xl(e){if(!(this instanceof Xl))return new Xl(e);oF.call(this,e),this._transformState={afterTransform:zqt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Hqt)}function Hqt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){vCe(e,t,r)}):vCe(this,null,null)}Xl.prototype.push=function(e,t){return this._transformState.needTransform=!1,oF.prototype.push.call(this,e,t)};Xl.prototype._transform=function(e,t,r){r(new qqt("_transform()"))};Xl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Xl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Xl.prototype._destroy=function(e,t){oF.prototype._destroy.call(this,e,function(r){t(r)})};function vCe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Gqt;if(e._transformState.transforming)throw new Uqt;return e.push(null)}});var _Ce=v((w8r,xCe)=>{"use strict";xCe.exports=R2;var yCe=zz();tr()(R2,yCe);function R2(e){if(!(this instanceof R2))return new R2(e);yCe.call(this,e)}R2.prototype._transform=function(e,t,r){r(null,e)}});var TCe=v((E8r,SCe)=>{"use strict";var Hz;function Wqt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var ACe=Jd().codes,Vqt=ACe.ERR_MISSING_ARGS,Kqt=ACe.ERR_STREAM_DESTROYED;function wCe(e){if(e)throw e}function $qt(e){return e.setHeader&&typeof e.abort=="function"}function Yqt(e,t,r,n){n=Wqt(n);var i=!1;e.on("close",function(){i=!0}),Hz===void 0&&(Hz=Z4()),Hz(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,$qt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Kqt("pipe"))}}}function ECe(e){e()}function Jqt(e,t){return e.pipe(t)}function Xqt(e){return!e.length||typeof e[e.length-1]!="function"?wCe:e.pop()}function Qqt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Xqt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Vqt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return Yqt(o,u,c,function(l){i||(i=l),l&&a.forEach(ECe),!u&&(a.forEach(ECe),n(i))})});return t.reduce(Jqt)}SCe.exports=Qqt});var Wz=v((ks,L2)=>{var j2=require("stream");process.env.READABLE_STREAM==="disable"&&j2?(L2.exports=j2.Readable,Object.assign(L2.exports,j2),L2.exports.Stream=j2):(ks=L2.exports=Fz(),ks.Stream=j2||ks,ks.Readable=ks,ks.Writable=Tz(),ks.Duplex=h0(),ks.Transform=zz(),ks.PassThrough=_Ce(),ks.finished=Z4(),ks.pipeline=TCe())});var BCe=v((A8r,kCe)=>{var $z=require("fs"),DCe=S6e(),CCe=C6e(),Vz=require("path"),Lc=Bb(),Zqt=require("util").inherits,si=D8e(),FCe=Wz().Transform,Kz=process.platform==="win32",Jr=function(e,t){if(!(this instanceof Jr))return new Jr(e,t);typeof e!="string"&&(t=e,e="zip"),t=this.options=Lc.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),FCe.call(this,t),this._format=!1,this._module=!1,this._pending=0,this._pointer=0,this._entriesCount=0,this._entriesProcessedCount=0,this._fsEntriesTotalBytes=0,this._fsEntriesProcessedBytes=0,this._queue=CCe.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=CCe.queue(this._onStatQueueTask.bind(this),t.statConcurrency),this._statQueue.drain(this._onQueueDrain.bind(this)),this._state={aborted:!1,finalize:!1,finalizing:!1,finalized:!1,modulePiped:!1},this._streams=[]};Zqt(Jr,FCe);Jr.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()};Jr.prototype._append=function(e,t){t=t||{};var r={source:null,filepath:e};t.name||(t.name=e),t.sourcePath=e,r.data=t,this._entriesCount++,t.stats&&t.stats instanceof $z.Stats?(r=this._updateQueueTaskWithStats(r,t.stats),r&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r))):this._statQueue.push(r)};Jr.prototype._finalize=function(){this._state.finalizing||this._state.finalized||this._state.aborted||(this._state.finalizing=!0,this._moduleFinalize(),this._state.finalizing=!1,this._state.finalized=!0)};Jr.prototype._maybeFinalize=function(){return this._state.finalizing||this._state.finalized||this._state.aborted?!1:this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()?(this._finalize(),!0):!1};Jr.prototype._moduleAppend=function(e,t,r){if(this._state.aborted){r();return}this._module.append(e,t,function(n){if(this._task=null,this._state.aborted){this._shutdown();return}if(n){this.emit("error",n),setImmediate(r);return}this.emit("entry",t),this._entriesProcessedCount++,t.stats&&t.stats.size&&(this._fsEntriesProcessedBytes+=t.stats.size),this.emit("progress",{entries:{total:this._entriesCount,processed:this._entriesProcessedCount},fs:{totalBytes:this._fsEntriesTotalBytes,processedBytes:this._fsEntriesProcessedBytes}}),setImmediate(r)}.bind(this))};Jr.prototype._moduleFinalize=function(){typeof this._module.finalize=="function"?this._module.finalize():typeof this._module.end=="function"?this._module.end():this.emit("error",new si("NOENDMETHOD"))};Jr.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0};Jr.prototype._moduleSupports=function(e){return!this._module.supports||!this._module.supports[e]?!1:this._module.supports[e]};Jr.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1};Jr.prototype._normalizeEntryData=function(e,t){e=Lc.defaults(e,{type:"file",name:null,date:null,mode:null,prefix:null,sourcePath:null,stats:!1}),t&&e.stats===!1&&(e.stats=t);var r=e.type==="directory";return e.name&&(typeof e.prefix=="string"&&e.prefix!==""&&(e.name=e.prefix+"/"+e.name,e.prefix=null),e.name=Lc.sanitizePath(e.name),e.type!=="symlink"&&e.name.slice(-1)==="/"?(r=!0,e.type="directory"):r&&(e.name+="/")),typeof e.mode=="number"?Kz?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(Kz?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,Kz&&r&&(e.mode=493)):e.mode===null&&(e.mode=r?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=Lc.dateify(e.date),e};Jr.prototype._onModuleError=function(e){this.emit("error",e)};Jr.prototype._onQueueDrain=function(){this._state.finalizing||this._state.finalized||this._state.aborted||this._state.finalize&&this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize()};Jr.prototype._onQueueTask=function(e,t){var r=()=>{e.data.callback&&e.data.callback(),t()};if(this._state.finalizing||this._state.finalized||this._state.aborted){r();return}this._task=e,this._moduleAppend(e.source,e.data,r)};Jr.prototype._onStatQueueTask=function(e,t){if(this._state.finalizing||this._state.finalized||this._state.aborted){t();return}$z.lstat(e.filepath,function(r,n){if(this._state.aborted){setImmediate(t);return}if(r){this._entriesCount--,this.emit("warning",r),setImmediate(t);return}e=this._updateQueueTaskWithStats(e,n),e&&(n.size&&(this._fsEntriesTotalBytes+=n.size),this._queue.push(e)),setImmediate(t)}.bind(this))};Jr.prototype._shutdown=function(){this._moduleUnpipe(),this.end()};Jr.prototype._transform=function(e,t,r){e&&(this._pointer+=e.length),r(null,e)};Jr.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type="file",e.data.sourceType="stream",e.source=Lc.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports("directory"))e.data.name=Lc.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=Lc.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports("symlink")){var r=$z.readlinkSync(e.filepath),n=Vz.dirname(e.filepath);e.data.type="symlink",e.data.linkname=Vz.relative(n,Vz.resolve(n,r)),e.data.sourceType="buffer",e.source=Buffer.concat([])}else return t.isDirectory()?this.emit("warning",new si("DIRECTORYNOTSUPPORTED",e.data)):t.isSymbolicLink()?this.emit("warning",new si("SYMLINKNOTSUPPORTED",e.data)):this.emit("warning",new si("ENTRYNOTSUPPORTED",e.data)),null;return e.data=this._normalizeEntryData(e.data,t),e};Jr.prototype.abort=function(){return this._state.aborted||this._state.finalized?this:(this._abort(),this)};Jr.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit("error",new si("QUEUECLOSED")),this;if(t=this._normalizeEntryData(t),typeof t.name!="string"||t.name.length===0)return this.emit("error",new si("ENTRYNAMEREQUIRED")),this;if(t.type==="directory"&&!this._moduleSupports("directory"))return this.emit("error",new si("DIRECTORYNOTSUPPORTED",{name:t.name})),this;if(e=Lc.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType="buffer";else if(Lc.isStream(e))t.sourceType="stream";else return this.emit("error",new si("INPUTSTEAMBUFFERREQUIRED",{name:t.name})),this;return this._entriesCount++,this._queue.push({data:t,source:e}),this};Jr.prototype.directory=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new si("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new si("DIRECTORYDIRPATHREQUIRED")),this;this._pending++,t===!1?t="":typeof t!="string"&&(t=e);var n=!1;typeof r=="function"?(n=r,r={}):typeof r!="object"&&(r={});var i={stat:!0,dot:!0};function a(){this._pending--,this._maybeFinalize()}function o(c){this.emit("error",c)}function s(c){u.pause();var l=!1,f=Object.assign({},r);f.name=c.relative,f.prefix=t,f.stats=c.stat,f.callback=u.resume.bind(u);try{if(n){if(f=n(f),f===!1)l=!0;else if(typeof f!="object")throw new si("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:e})}}catch(d){this.emit("error",d);return}if(l){u.resume();return}this._append(c.absolute,f)}var u=DCe(e,i);return u.on("error",o.bind(this)),u.on("match",s.bind(this)),u.on("end",a.bind(this)),this};Jr.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit("error",new si("QUEUECLOSED")),this):typeof e!="string"||e.length===0?(this.emit("error",new si("FILEFILEPATHREQUIRED")),this):(this._append(e,t),this)};Jr.prototype.glob=function(e,t,r){this._pending++,t=Lc.defaults(t,{stat:!0,pattern:e});function n(){this._pending--,this._maybeFinalize()}function i(s){this.emit("error",s)}function a(s){o.pause();var u=Object.assign({},r);u.callback=o.resume.bind(o),u.stats=s.stat,u.name=s.relative,this._append(s.absolute,u)}var o=DCe(t.cwd||".",t);return o.on("error",i.bind(this)),o.on("match",a.bind(this)),o.on("end",n.bind(this)),this};Jr.prototype.finalize=function(){if(this._state.aborted){var e=new si("ABORTED");return this.emit("error",e),Promise.reject(e)}if(this._state.finalize){var t=new si("FINALIZING");return this.emit("error",t),Promise.reject(t)}this._state.finalize=!0,this._pending===0&&this._queue.idle()&&this._statQueue.idle()&&this._finalize();var r=this;return new Promise(function(n,i){var a;r._module.on("end",function(){a||n()}),r._module.on("error",function(o){a=!0,i(o)})})};Jr.prototype.setFormat=function(e){return this._format?(this.emit("error",new si("FORMATSET")),this):(this._format=e,this)};Jr.prototype.setModule=function(e){return this._state.aborted?(this.emit("error",new si("ABORTED")),this):this._state.module?(this.emit("error",new si("MODULESET")),this):(this._module=e,this._modulePipe(),this)};Jr.prototype.symlink=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new si("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new si("SYMLINKFILEPATHREQUIRED")),this;if(typeof t!="string"||t.length===0)return this.emit("error",new si("SYMLINKTARGETREQUIRED",{filepath:e})),this;if(!this._moduleSupports("symlink"))return this.emit("error",new si("SYMLINKNOTSUPPORTED",{filepath:e})),this;var n={};return n.type="symlink",n.name=e.replace(/\\/g,"/"),n.linkname=t.replace(/\\/g,"/"),n.sourceType="buffer",typeof r=="number"&&(n.mode=r),this._entriesCount++,this._queue.push({data:n,source:Buffer.concat([])}),this};Jr.prototype.pointer=function(){return this._pointer};Jr.prototype.use=function(e){return this._streams.push(e),this};kCe.exports=Jr});var uF=v((S8r,OCe)=>{var sF=OCe.exports=function(){};sF.prototype.getName=function(){};sF.prototype.getSize=function(){};sF.prototype.getLastModifiedDate=function(){};sF.prototype.isDirectory=function(){}});var cF=v((T8r,ICe)=>{var Bs=ICe.exports={};Bs.dateToDos=function(e,t){t=t||!1;var r=t?e.getFullYear():e.getUTCFullYear();if(r<1980)return 2162688;if(r>=2044)return 2141175677;var n={year:r,month:t?e.getMonth():e.getUTCMonth(),date:t?e.getDate():e.getUTCDate(),hours:t?e.getHours():e.getUTCHours(),minutes:t?e.getMinutes():e.getUTCMinutes(),seconds:t?e.getSeconds():e.getUTCSeconds()};return n.year-1980<<25|n.month+1<<21|n.date<<16|n.hours<<11|n.minutes<<5|n.seconds/2};Bs.dosToDate=function(e){return new Date((e>>25&127)+1980,(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(e&31)<<1)};Bs.fromDosTime=function(e){return Bs.dosToDate(e.readUInt32LE(0))};Bs.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t};Bs.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t};Bs.getShortBytesValue=function(e,t){return e.readUInt16LE(t)};Bs.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t};Bs.getLongBytesValue=function(e,t){return e.readUInt32LE(t)};Bs.toDosTime=function(e){return Bs.getLongBytes(Bs.dateToDos(e))}});var Yz=v((C8r,qCe)=>{var PCe=cF(),RCe=1<<3,jCe=1<<0,eNt=1<<2,tNt=1<<1,LCe=1<<6,MCe=1<<11,Da=qCe.exports=function(){return this instanceof Da?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new Da};Da.prototype.encode=function(){return PCe.getShortBytes((this.descriptor?RCe:0)|(this.utf8?MCe:0)|(this.encryption?jCe:0)|(this.strongEncryption?LCe:0))};Da.prototype.parse=function(e,t){var r=PCe.getShortBytesValue(e,t),n=new Da;return n.useDataDescriptor((r&RCe)!==0),n.useUTF8ForNames((r&MCe)!==0),n.useStrongEncryption((r&LCe)!==0),n.useEncryption((r&jCe)!==0),n.setSlidingDictionarySize(r&tNt?8192:4096),n.setNumberOfShannonFanoTrees(r&eNt?3:2),n};Da.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e};Da.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};Da.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e};Da.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};Da.prototype.useDataDescriptor=function(e){this.descriptor=e};Da.prototype.usesDataDescriptor=function(){return this.descriptor};Da.prototype.useEncryption=function(e){this.encryption=e};Da.prototype.usesEncryption=function(){return this.encryption};Da.prototype.useStrongEncryption=function(e){this.strongEncryption=e};Da.prototype.usesStrongEncryption=function(){return this.strongEncryption};Da.prototype.useUTF8ForNames=function(e){this.utf8=e};Da.prototype.usesUTF8ForNames=function(){return this.utf8}});var UCe=v((D8r,NCe)=>{NCe.exports={PERM_MASK:4095,FILE_TYPE_FLAG:61440,LINK_FLAG:40960,FILE_FLAG:32768,DIR_FLAG:16384,DEFAULT_LINK_PERM:511,DEFAULT_DIR_PERM:493,DEFAULT_FILE_PERM:420}});var Jz=v((F8r,GCe)=>{GCe.exports={WORD:4,DWORD:8,EMPTY:Buffer.alloc(0),SHORT:2,SHORT_MASK:65535,SHORT_SHIFT:16,SHORT_ZERO:Buffer.from(Array(2)),LONG:4,LONG_ZERO:Buffer.from(Array(4)),MIN_VERSION_INITIAL:10,MIN_VERSION_DATA_DESCRIPTOR:20,MIN_VERSION_ZIP64:45,VERSION_MADEBY:45,METHOD_STORED:0,METHOD_DEFLATED:8,PLATFORM_UNIX:3,PLATFORM_FAT:0,SIG_LFH:67324752,SIG_DD:134695760,SIG_CFH:33639248,SIG_EOCD:101010256,SIG_ZIP64_EOCD:101075792,SIG_ZIP64_EOCD_LOC:117853008,ZIP64_MAGIC_SHORT:65535,ZIP64_MAGIC:4294967295,ZIP64_EXTRA_ID:1,ZLIB_NO_COMPRESSION:0,ZLIB_BEST_SPEED:1,ZLIB_BEST_COMPRESSION:9,ZLIB_DEFAULT_COMPRESSION:-1,MODE_MASK:4095,DEFAULT_FILE_MODE:33188,DEFAULT_DIR_MODE:16877,EXT_FILE_ATTR_DIR:1106051088,EXT_FILE_ATTR_FILE:2175008800,S_IFMT:61440,S_IFIFO:4096,S_IFCHR:8192,S_IFDIR:16384,S_IFBLK:24576,S_IFREG:32768,S_IFLNK:40960,S_IFSOCK:49152,S_DOS_A:32,S_DOS_D:16,S_DOS_V:8,S_DOS_S:4,S_DOS_H:2,S_DOS_R:1}});var Xz=v((k8r,KCe)=>{var rNt=require("util").inherits,nNt=PG(),HCe=uF(),WCe=Yz(),zCe=UCe(),eo=Jz(),VCe=cF(),vr=KCe.exports=function(e){if(!(this instanceof vr))return new vr(e);HCe.call(this),this.platform=eo.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new WCe,this.crc=0,this.time=-1,this.minver=eo.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};rNt(vr,HCe);vr.prototype.getCentralDirectoryExtra=function(){return this.getExtra()};vr.prototype.getComment=function(){return this.comment!==null?this.comment:""};vr.prototype.getCompressedSize=function(){return this.csize};vr.prototype.getCrc=function(){return this.crc};vr.prototype.getExternalAttributes=function(){return this.exattr};vr.prototype.getExtra=function(){return this.extra!==null?this.extra:eo.EMPTY};vr.prototype.getGeneralPurposeBit=function(){return this.gpb};vr.prototype.getInternalAttributes=function(){return this.inattr};vr.prototype.getLastModifiedDate=function(){return this.getTime()};vr.prototype.getLocalFileDataExtra=function(){return this.getExtra()};vr.prototype.getMethod=function(){return this.method};vr.prototype.getName=function(){return this.name};vr.prototype.getPlatform=function(){return this.platform};vr.prototype.getSize=function(){return this.size};vr.prototype.getTime=function(){return this.time!==-1?VCe.dosToDate(this.time):-1};vr.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};vr.prototype.getUnixMode=function(){return this.platform!==eo.PLATFORM_UNIX?0:this.getExternalAttributes()>>eo.SHORT_SHIFT&eo.SHORT_MASK};vr.prototype.getVersionNeededToExtract=function(){return this.minver};vr.prototype.setComment=function(e){Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.comment=e};vr.prototype.setCompressedSize=function(e){if(e<0)throw new Error("invalid entry compressed size");this.csize=e};vr.prototype.setCrc=function(e){if(e<0)throw new Error("invalid entry crc32");this.crc=e};vr.prototype.setExternalAttributes=function(e){this.exattr=e>>>0};vr.prototype.setExtra=function(e){this.extra=e};vr.prototype.setGeneralPurposeBit=function(e){if(!(e instanceof WCe))throw new Error("invalid entry GeneralPurposeBit");this.gpb=e};vr.prototype.setInternalAttributes=function(e){this.inattr=e};vr.prototype.setMethod=function(e){if(e<0)throw new Error("invalid entry compression method");this.method=e};vr.prototype.setName=function(e,t=!1){e=nNt(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,""),t&&(e=`/${e}`),Buffer.byteLength(e)!==e.length&&this.getGeneralPurposeBit().useUTF8ForNames(!0),this.name=e};vr.prototype.setPlatform=function(e){this.platform=e};vr.prototype.setSize=function(e){if(e<0)throw new Error("invalid entry size");this.size=e};vr.prototype.setTime=function(e,t){if(!(e instanceof Date))throw new Error("invalid entry time");this.time=VCe.dateToDos(e,t)};vr.prototype.setUnixMode=function(e){e|=this.isDirectory()?eo.S_IFDIR:eo.S_IFREG;var t=0;t|=e<<eo.SHORT_SHIFT|(this.isDirectory()?eo.S_DOS_D:eo.S_DOS_A),this.setExternalAttributes(t),this.mode=e&eo.MODE_MASK,this.platform=eo.PLATFORM_UNIX};vr.prototype.setVersionNeededToExtract=function(e){this.minver=e};vr.prototype.isDirectory=function(){return this.getName().slice(-1)==="/"};vr.prototype.isUnixSymlink=function(){return(this.getUnixMode()&zCe.FILE_TYPE_FLAG)===zCe.LINK_FLAG};vr.prototype.isZip64=function(){return this.csize>eo.ZIP64_MAGIC||this.size>eo.ZIP64_MAGIC}});var Qz=v((B8r,$Ce)=>{$Ce.exports=require("stream")});var eDe=v((O8r,ZCe)=>{"use strict";function YCe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function JCe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?YCe(Object(r),!0).forEach(function(n){iNt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):YCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function iNt(e,t,r){return t=QCe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function aNt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function XCe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,QCe(n.key),n)}}function oNt(e,t,r){return t&&XCe(e.prototype,t),r&&XCe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function QCe(e){var t=sNt(e,"string");return typeof t=="symbol"?t:String(t)}function sNt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var uNt=require("buffer"),lF=uNt.Buffer,cNt=require("util"),Zz=cNt.inspect,lNt=Zz&&Zz.custom||"inspect";function fNt(e,t,r){lF.prototype.copy.call(e,t,r)}ZCe.exports=function(){function e(){aNt(this,e),this.head=null,this.tail=null,this.length=0}return oNt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return lF.alloc(0);for(var n=lF.allocUnsafe(r>>>0),i=this.head,a=0;i;)fNt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=lF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:lNt,value:function(r,n){return Zz(this,JCe(JCe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var tH=v((I8r,rDe)=>{"use strict";function dNt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(eH,this,e)):process.nextTick(eH,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(fF,r):(r._writableState.errorEmitted=!0,process.nextTick(tDe,r,a)):process.nextTick(tDe,r,a):t?(process.nextTick(fF,r),t(a)):process.nextTick(fF,r)}),this)}function tDe(e,t){eH(e,t),fF(e)}function fF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function pNt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function eH(e,t){e.emit("error",t)}function hNt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}rDe.exports={destroy:dNt,undestroy:pNt,errorOrDestroy:hNt}});var tp=v((P8r,aDe)=>{"use strict";var iDe={};function Os(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,iDe[e]=i}function nDe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function mNt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function gNt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function vNt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Os("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Os("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&mNt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(gNt(e," argument"))i=`The ${e} ${n} ${nDe(t,"type")}`;else{let a=vNt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${nDe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Os("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Os("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Os("ERR_STREAM_PREMATURE_CLOSE","Premature close");Os("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Os("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Os("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Os("ERR_STREAM_WRITE_AFTER_END","write after end");Os("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Os("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Os("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");aDe.exports.codes=iDe});var rH=v((R8r,oDe)=>{"use strict";var bNt=tp().codes.ERR_INVALID_OPT_VALUE;function yNt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function xNt(e,t,r,n){var i=yNt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new bNt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}oDe.exports={getHighWaterMark:xNt}});var aH=v((j8r,dDe)=>{"use strict";dDe.exports=ui;function uDe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){KNt(t,e)}}var jb;ui.WritableState=q2;var _Nt={deprecate:mh()},cDe=Qz(),pF=require("buffer").Buffer,wNt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ENt(e){return pF.from(e)}function ANt(e){return pF.isBuffer(e)||e instanceof wNt}var iH=tH(),SNt=rH(),TNt=SNt.getHighWaterMark,rp=tp().codes,CNt=rp.ERR_INVALID_ARG_TYPE,DNt=rp.ERR_METHOD_NOT_IMPLEMENTED,FNt=rp.ERR_MULTIPLE_CALLBACK,kNt=rp.ERR_STREAM_CANNOT_PIPE,BNt=rp.ERR_STREAM_DESTROYED,ONt=rp.ERR_STREAM_NULL_VALUES,INt=rp.ERR_STREAM_WRITE_AFTER_END,PNt=rp.ERR_UNKNOWN_ENCODING,Lb=iH.errorOrDestroy;tr()(ui,cDe);function RNt(){}function q2(e,t,r){jb=jb||b0(),e=e||{},typeof r!="boolean"&&(r=t instanceof jb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=TNt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){GNt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new uDe(this)}q2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(q2.prototype,"buffer",{get:_Nt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var dF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(dF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ui,Symbol.hasInstance,{value:function(t){return dF.call(this,t)?!0:this!==ui?!1:t&&t._writableState instanceof q2}})):dF=function(t){return t instanceof this};function ui(e){jb=jb||b0();var t=this instanceof jb;if(!t&&!dF.call(ui,this))return new ui(e);this._writableState=new q2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),cDe.call(this)}ui.prototype.pipe=function(){Lb(this,new kNt)};function jNt(e,t){var r=new INt;Lb(e,r),process.nextTick(t,r)}function LNt(e,t,r,n){var i;return r===null?i=new ONt:typeof r!="string"&&!t.objectMode&&(i=new CNt("chunk",["string","Buffer"],r)),i?(Lb(e,i),process.nextTick(n,i),!1):!0}ui.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&ANt(e);return a&&!pF.isBuffer(e)&&(e=ENt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=RNt),n.ending?jNt(this,r):(a||LNt(this,n,e,r))&&(n.pendingcb++,i=qNt(this,n,a,e,t,r)),i};ui.prototype.cork=function(){this._writableState.corked++};ui.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&lDe(this,e))};ui.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new PNt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ui.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function MNt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=pF.from(t,r)),t}Object.defineProperty(ui.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function qNt(e,t,r,n,i,a){if(!r){var o=MNt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else nH(e,t,!1,s,n,i,a);return u}function nH(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new BNt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function NNt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(M2,e,t),e._writableState.errorEmitted=!0,Lb(e,n)):(i(n),e._writableState.errorEmitted=!0,Lb(e,n),M2(e,t))}function UNt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function GNt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new FNt;if(UNt(r),t)NNt(e,r,n,t,i);else{var a=fDe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&lDe(e,r),n?process.nextTick(sDe,e,r,a,i):sDe(e,r,a,i)}}function sDe(e,t,r,n){r||zNt(e,t),t.pendingcb--,n(),M2(e,t)}function zNt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function lDe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,nH(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new uDe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(nH(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ui.prototype._write=function(e,t,r){r(new DNt("_write()"))};ui.prototype._writev=null;ui.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||VNt(this,n,r),this};Object.defineProperty(ui.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fDe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function HNt(e,t){e._final(function(r){t.pendingcb--,r&&Lb(e,r),t.prefinished=!0,e.emit("prefinish"),M2(e,t)})}function WNt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(HNt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function M2(e,t){var r=fDe(t);if(r&&(WNt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function VNt(e,t,r){t.ending=!0,M2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function KNt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ui.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ui.prototype.destroy=iH.destroy;ui.prototype._undestroy=iH.undestroy;ui.prototype._destroy=function(e,t){t(e)}});var b0=v((L8r,hDe)=>{"use strict";var $Nt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};hDe.exports=Mc;var pDe=uH(),sH=aH();tr()(Mc,pDe);for(oH=$Nt(sH.prototype),hF=0;hF<oH.length;hF++)mF=oH[hF],Mc.prototype[mF]||(Mc.prototype[mF]=sH.prototype[mF]);var oH,mF,hF;function Mc(e){if(!(this instanceof Mc))return new Mc(e);pDe.call(this,e),sH.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",YNt)))}Object.defineProperty(Mc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Mc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Mc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function YNt(){this._writableState.ended||process.nextTick(JNt,this)}function JNt(e){e.end()}Object.defineProperty(Mc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var fH=v(gDe=>{"use strict";var lH=Hs().Buffer,mDe=lH.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function XNt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function QNt(e){var t=XNt(e);if(typeof t!="string"&&(lH.isEncoding===mDe||!mDe(e)))throw new Error("Unknown encoding: "+e);return t||e}gDe.StringDecoder=N2;function N2(e){this.encoding=QNt(e);var t;switch(this.encoding){case"utf16le":this.text=iUt,this.end=aUt,t=4;break;case"utf8":this.fillLast=tUt,t=4;break;case"base64":this.text=oUt,this.end=sUt,t=3;break;default:this.write=uUt,this.end=cUt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lH.allocUnsafe(t)}N2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};N2.prototype.end=nUt;N2.prototype.text=rUt;N2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function cH(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function ZNt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=cH(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=cH(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=cH(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function eUt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function tUt(e){var t=this.lastTotal-this.lastNeed,r=eUt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function rUt(e,t){var r=ZNt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function nUt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function iUt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function aUt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function oUt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function sUt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function uUt(e){return e.toString(this.encoding)}function cUt(e){return e&&e.length?this.write(e):""}});var gF=v((q8r,yDe)=>{"use strict";var vDe=tp().codes.ERR_STREAM_PREMATURE_CLOSE;function lUt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function fUt(){}function dUt(e){return e.setHeader&&typeof e.abort=="function"}function bDe(e,t,r){if(typeof t=="function")return bDe(e,null,t);t||(t={}),r=lUt(r||fUt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(h){r.call(e,h)},f=function(){var h;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(h=new vDe),r.call(e,h);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(h=new vDe),r.call(e,h)},d=function(){e.req.on("finish",s)};return dUt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}yDe.exports=bDe});var _De=v((N8r,xDe)=>{"use strict";var vF;function np(e,t,r){return t=pUt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pUt(e){var t=hUt(e,"string");return typeof t=="symbol"?t:String(t)}function hUt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mUt=gF(),ip=Symbol("lastResolve"),y0=Symbol("lastReject"),U2=Symbol("error"),bF=Symbol("ended"),x0=Symbol("lastPromise"),dH=Symbol("handlePromise"),_0=Symbol("stream");function ap(e,t){return{value:e,done:t}}function gUt(e){var t=e[ip];if(t!==null){var r=e[_0].read();r!==null&&(e[x0]=null,e[ip]=null,e[y0]=null,t(ap(r,!1)))}}function vUt(e){process.nextTick(gUt,e)}function bUt(e,t){return function(r,n){e.then(function(){if(t[bF]){r(ap(void 0,!0));return}t[dH](r,n)},n)}}var yUt=Object.getPrototypeOf(function(){}),xUt=Object.setPrototypeOf((vF={get stream(){return this[_0]},next:function(){var t=this,r=this[U2];if(r!==null)return Promise.reject(r);if(this[bF])return Promise.resolve(ap(void 0,!0));if(this[_0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[U2]?s(t[U2]):o(ap(void 0,!0))})});var n=this[x0],i;if(n)i=new Promise(bUt(n,this));else{var a=this[_0].read();if(a!==null)return Promise.resolve(ap(a,!1));i=new Promise(this[dH])}return this[x0]=i,i}},np(vF,Symbol.asyncIterator,function(){return this}),np(vF,"return",function(){var t=this;return new Promise(function(r,n){t[_0].destroy(null,function(i){if(i){n(i);return}r(ap(void 0,!0))})})}),vF),yUt),_Ut=function(t){var r,n=Object.create(xUt,(r={},np(r,_0,{value:t,writable:!0}),np(r,ip,{value:null,writable:!0}),np(r,y0,{value:null,writable:!0}),np(r,U2,{value:null,writable:!0}),np(r,bF,{value:t._readableState.endEmitted,writable:!0}),np(r,dH,{value:function(a,o){var s=n[_0].read();s?(n[x0]=null,n[ip]=null,n[y0]=null,a(ap(s,!1))):(n[ip]=a,n[y0]=o)},writable:!0}),r));return n[x0]=null,mUt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[y0];a!==null&&(n[x0]=null,n[ip]=null,n[y0]=null,a(i)),n[U2]=i;return}var o=n[ip];o!==null&&(n[x0]=null,n[ip]=null,n[y0]=null,o(ap(void 0,!0))),n[bF]=!0}),t.on("readable",vUt.bind(null,n)),n};xDe.exports=_Ut});var SDe=v((U8r,ADe)=>{"use strict";function wDe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function wUt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){wDe(a,n,i,o,s,"next",u)}function s(u){wDe(a,n,i,o,s,"throw",u)}o(void 0)})}}function EDe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function EUt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EDe(Object(r),!0).forEach(function(n){AUt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EDe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function AUt(e,t,r){return t=SUt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function SUt(e){var t=TUt(e,"string");return typeof t=="symbol"?t:String(t)}function TUt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var CUt=tp().codes.ERR_INVALID_ARG_TYPE;function DUt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new CUt("iterable",["Iterable"],t);var i=new e(EUt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=wUt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}ADe.exports=DUt});var uH=v((z8r,RDe)=>{"use strict";RDe.exports=Ur;var Mb;Ur.ReadableState=FDe;var G8r=require("events").EventEmitter,DDe=function(t,r){return t.listeners(r).length},z2=Qz(),yF=require("buffer").Buffer,FUt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function kUt(e){return yF.from(e)}function BUt(e){return yF.isBuffer(e)||e instanceof FUt}var pH=require("util"),br;pH&&pH.debuglog?br=pH.debuglog("stream"):br=function(){};var OUt=eDe(),xH=tH(),IUt=rH(),PUt=IUt.getHighWaterMark,xF=tp().codes,RUt=xF.ERR_INVALID_ARG_TYPE,jUt=xF.ERR_STREAM_PUSH_AFTER_EOF,LUt=xF.ERR_METHOD_NOT_IMPLEMENTED,MUt=xF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,qb,hH,mH;tr()(Ur,z2);var G2=xH.errorOrDestroy,gH=["error","close","destroy","pause","resume"];function qUt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function FDe(e,t,r){Mb=Mb||b0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Mb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=PUt(this,e,"readableHighWaterMark",r),this.buffer=new OUt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(qb||(qb=fH().StringDecoder),this.decoder=new qb(e.encoding),this.encoding=e.encoding)}function Ur(e){if(Mb=Mb||b0(),!(this instanceof Ur))return new Ur(e);var t=this instanceof Mb;this._readableState=new FDe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),z2.call(this)}Object.defineProperty(Ur.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Ur.prototype.destroy=xH.destroy;Ur.prototype._undestroy=xH.undestroy;Ur.prototype._destroy=function(e,t){t(e)};Ur.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=yF.from(e,t),t=""),n=!0),kDe(this,e,t,!1,n)};Ur.prototype.unshift=function(e){return kDe(this,e,null,!0,!1)};function kDe(e,t,r,n,i){br("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,GUt(e,a);else{var o;if(i||(o=NUt(a,t)),o)G2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==yF.prototype&&(t=kUt(t)),n)a.endEmitted?G2(e,new MUt):vH(e,a,t,!0);else if(a.ended)G2(e,new jUt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?vH(e,a,t,!1):yH(e,a)):vH(e,a,t,!1)}else n||(a.reading=!1,yH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function vH(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&_F(e)),yH(e,t)}function NUt(e,t){var r;return!BUt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new RUt("chunk",["string","Buffer","Uint8Array"],t)),r}Ur.prototype.isPaused=function(){return this._readableState.flowing===!1};Ur.prototype.setEncoding=function(e){qb||(qb=fH().StringDecoder);var t=new qb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var TDe=1073741824;function UUt(e){return e>=TDe?e=TDe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function CDe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=UUt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Ur.prototype.read=function(e){br("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return br("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?bH(this):_F(this),null;if(e=CDe(e,t),e===0&&t.ended)return t.length===0&&bH(this),null;var n=t.needReadable;br("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,br("length less than watermark",n)),t.ended||t.reading?(n=!1,br("reading or ended",n)):n&&(br("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=CDe(r,t)));var i;return e>0?i=IDe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&bH(this)),i!==null&&this.emit("data",i),i};function GUt(e,t){if(br("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?_F(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,BDe(e)))}}function _F(e){var t=e._readableState;br("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(br("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(BDe,e))}function BDe(e){var t=e._readableState;br("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,_H(e)}function yH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(zUt,e,t))}function zUt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(br("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Ur.prototype._read=function(e){G2(this,new LUt("_read()"))};Ur.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,br("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){br("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){br("onend"),e.end()}var u=HUt(r);e.on("drain",u);var c=!1;function l(){br("cleanup"),e.removeListener("close",p),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){br("ondata");var x=e.write(g);br("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&PDe(n.pipes,e)!==-1)&&!c&&(br("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){br("onerror",g),b(),e.removeListener("error",d),DDe(e,"error")===0&&G2(e,g)}qUt(e,"error",d);function p(){e.removeListener("finish",h),b()}e.once("close",p);function h(){br("onfinish"),e.removeListener("close",p),b()}e.once("finish",h);function b(){br("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(br("pipe resume"),r.resume()),e};function HUt(e){return function(){var r=e._readableState;br("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&DDe(e,"data")&&(r.flowing=!0,_H(e))}}Ur.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=PDe(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Ur.prototype.on=function(e,t){var r=z2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,br("on readable",n.length,n.reading),n.length?_F(this):n.reading||process.nextTick(WUt,this)),r};Ur.prototype.addListener=Ur.prototype.on;Ur.prototype.removeListener=function(e,t){var r=z2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(ODe,this),r};Ur.prototype.removeAllListeners=function(e){var t=z2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(ODe,this),t};function ODe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function WUt(e){br("readable nexttick read 0"),e.read(0)}Ur.prototype.resume=function(){var e=this._readableState;return e.flowing||(br("resume"),e.flowing=!e.readableListening,VUt(this,e)),e.paused=!1,this};function VUt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(KUt,e,t))}function KUt(e,t){br("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),_H(e),t.flowing&&!t.reading&&e.read(0)}Ur.prototype.pause=function(){return br("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(br("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function _H(e){var t=e._readableState;for(br("flow",t.flowing);t.flowing&&e.read()!==null;);}Ur.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(br("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(br("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<gH.length;a++)e.on(gH[a],this.emit.bind(this,gH[a]));return this._read=function(o){br("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Ur.prototype[Symbol.asyncIterator]=function(){return hH===void 0&&(hH=_De()),hH(this)});Object.defineProperty(Ur.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Ur.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Ur.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Ur._fromList=IDe;Object.defineProperty(Ur.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function IDe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function bH(e){var t=e._readableState;br("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick($Ut,t,e))}function $Ut(e,t){if(br("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Ur.from=function(e,t){return mH===void 0&&(mH=SDe()),mH(Ur,e,t)});function PDe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var wH=v((H8r,LDe)=>{"use strict";LDe.exports=Ql;var wF=tp().codes,YUt=wF.ERR_METHOD_NOT_IMPLEMENTED,JUt=wF.ERR_MULTIPLE_CALLBACK,XUt=wF.ERR_TRANSFORM_ALREADY_TRANSFORMING,QUt=wF.ERR_TRANSFORM_WITH_LENGTH_0,EF=b0();tr()(Ql,EF);function ZUt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new JUt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ql(e){if(!(this instanceof Ql))return new Ql(e);EF.call(this,e),this._transformState={afterTransform:ZUt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",eGt)}function eGt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){jDe(e,t,r)}):jDe(this,null,null)}Ql.prototype.push=function(e,t){return this._transformState.needTransform=!1,EF.prototype.push.call(this,e,t)};Ql.prototype._transform=function(e,t,r){r(new YUt("_transform()"))};Ql.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ql.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Ql.prototype._destroy=function(e,t){EF.prototype._destroy.call(this,e,function(r){t(r)})};function jDe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new QUt;if(e._transformState.transforming)throw new XUt;return e.push(null)}});var NDe=v((W8r,qDe)=>{"use strict";qDe.exports=H2;var MDe=wH();tr()(H2,MDe);function H2(e){if(!(this instanceof H2))return new H2(e);MDe.call(this,e)}H2.prototype._transform=function(e,t,r){r(null,e)}});var WDe=v((V8r,HDe)=>{"use strict";var EH;function tGt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var zDe=tp().codes,rGt=zDe.ERR_MISSING_ARGS,nGt=zDe.ERR_STREAM_DESTROYED;function UDe(e){if(e)throw e}function iGt(e){return e.setHeader&&typeof e.abort=="function"}function aGt(e,t,r,n){n=tGt(n);var i=!1;e.on("close",function(){i=!0}),EH===void 0&&(EH=gF()),EH(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,iGt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new nGt("pipe"))}}}function GDe(e){e()}function oGt(e,t){return e.pipe(t)}function sGt(e){return!e.length||typeof e[e.length-1]!="function"?UDe:e.pop()}function uGt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=sGt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new rGt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return aGt(o,u,c,function(l){i||(i=l),l&&a.forEach(GDe),!u&&(a.forEach(GDe),n(i))})});return t.reduce(oGt)}HDe.exports=uGt});var AH=v((Is,V2)=>{var W2=require("stream");process.env.READABLE_STREAM==="disable"&&W2?(V2.exports=W2.Readable,Object.assign(V2.exports,W2),V2.exports.Stream=W2):(Is=V2.exports=uH(),Is.Stream=W2||Is,Is.Readable=Is,Is.Writable=aH(),Is.Duplex=b0(),Is.Transform=wH(),Is.PassThrough=NDe(),Is.finished=gF(),Is.pipeline=WDe())});var TH=v((K8r,VDe)=>{var cGt=require("stream").Stream,lGt=AH().PassThrough,SH=VDe.exports={};SH.isStream=function(e){return e instanceof cGt};SH.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e=="string")return Buffer.from(e);if(SH.isStream(e)&&!e._readableState){var t=new lGt;return e.pipe(t),t}return e}});var DH=v(($8r,$De)=>{var fGt=require("util").inherits,CH=AH().Transform,dGt=uF(),KDe=TH(),zo=$De.exports=function(e){if(!(this instanceof zo))return new zo(e);CH.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};fGt(zo,CH);zo.prototype._appendBuffer=function(e,t,r){};zo.prototype._appendStream=function(e,t,r){};zo.prototype._emitErrorCallback=function(e){e&&this.emit("error",e)};zo.prototype._finish=function(e){};zo.prototype._normalizeEntry=function(e){};zo.prototype._transform=function(e,t,r){r(null,e)};zo.prototype.entry=function(e,t,r){if(t=t||null,typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),!(e instanceof dGt)){r(new Error("not a valid instance of ArchiveEntry"));return}if(this._archive.finish||this._archive.finished){r(new Error("unacceptable entry after finish"));return}if(this._archive.processing){r(new Error("already processing an entry"));return}if(this._archive.processing=!0,this._normalizeEntry(e),this._entry=e,t=KDe.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,r);else if(KDe.isStream(t))this._appendStream(e,t,r);else{this._archive.processing=!1,r(new Error("input source must be valid Stream or Buffer instance"));return}return this};zo.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()};zo.prototype.getBytesWritten=function(){return this.offset};zo.prototype.write=function(e,t){return e&&(this.offset+=e.length),CH.prototype.write.call(this,e,t)}});var OH=v((Y8r,JDe)=>{var op=require("buffer").Buffer,FH=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];typeof Int32Array<"u"&&(FH=new Int32Array(FH));function YDe(e){if(op.isBuffer(e))return e;var t=typeof op.alloc=="function"&&typeof op.from=="function";if(typeof e=="number")return t?op.alloc(e):new op(e);if(typeof e=="string")return t?op.from(e):new op(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function pGt(e){var t=YDe(4);return t.writeInt32BE(e,0),t}function kH(e,t){e=YDe(e),op.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,n=0;n<e.length;n++)r=FH[(r^e[n])&255]^r>>>8;return r^-1}function BH(){return pGt(kH.apply(null,arguments))}BH.signed=function(){return kH.apply(null,arguments)};BH.unsigned=function(){return kH.apply(null,arguments)>>>0};JDe.exports=BH});var IH=v((J8r,XDe)=>{XDe.exports=require("stream")});var n4e=v((X8r,r4e)=>{"use strict";function QDe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ZDe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QDe(Object(r),!0).forEach(function(n){hGt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QDe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function hGt(e,t,r){return t=t4e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mGt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function e4e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,t4e(n.key),n)}}function gGt(e,t,r){return t&&e4e(e.prototype,t),r&&e4e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function t4e(e){var t=vGt(e,"string");return typeof t=="symbol"?t:String(t)}function vGt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var bGt=require("buffer"),AF=bGt.Buffer,yGt=require("util"),PH=yGt.inspect,xGt=PH&&PH.custom||"inspect";function _Gt(e,t,r){AF.prototype.copy.call(e,t,r)}r4e.exports=function(){function e(){mGt(this,e),this.head=null,this.tail=null,this.length=0}return gGt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return AF.alloc(0);for(var n=AF.allocUnsafe(r>>>0),i=this.head,a=0;i;)_Gt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=AF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:xGt,value:function(r,n){return PH(this,ZDe(ZDe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var jH=v((Q8r,a4e)=>{"use strict";function wGt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(RH,this,e)):process.nextTick(RH,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(SF,r):(r._writableState.errorEmitted=!0,process.nextTick(i4e,r,a)):process.nextTick(i4e,r,a):t?(process.nextTick(SF,r),t(a)):process.nextTick(SF,r)}),this)}function i4e(e,t){RH(e,t),SF(e)}function SF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function EGt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function RH(e,t){e.emit("error",t)}function AGt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}a4e.exports={destroy:wGt,undestroy:EGt,errorOrDestroy:AGt}});var sp=v((Z8r,u4e)=>{"use strict";var s4e={};function Ps(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,s4e[e]=i}function o4e(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function SGt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function TGt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function CGt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ps("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ps("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&SGt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(TGt(e," argument"))i=`The ${e} ${n} ${o4e(t,"type")}`;else{let a=CGt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${o4e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Ps("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ps("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ps("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ps("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ps("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ps("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ps("ERR_STREAM_WRITE_AFTER_END","write after end");Ps("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ps("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ps("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");u4e.exports.codes=s4e});var LH=v((eCr,c4e)=>{"use strict";var DGt=sp().codes.ERR_INVALID_OPT_VALUE;function FGt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function kGt(e,t,r,n){var i=FGt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new DGt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}c4e.exports={getHighWaterMark:kGt}});var NH=v((tCr,m4e)=>{"use strict";m4e.exports=ci;function f4e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){nzt(t,e)}}var Nb;ci.WritableState=$2;var BGt={deprecate:mh()},d4e=IH(),CF=require("buffer").Buffer,OGt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function IGt(e){return CF.from(e)}function PGt(e){return CF.isBuffer(e)||e instanceof OGt}var qH=jH(),RGt=LH(),jGt=RGt.getHighWaterMark,up=sp().codes,LGt=up.ERR_INVALID_ARG_TYPE,MGt=up.ERR_METHOD_NOT_IMPLEMENTED,qGt=up.ERR_MULTIPLE_CALLBACK,NGt=up.ERR_STREAM_CANNOT_PIPE,UGt=up.ERR_STREAM_DESTROYED,GGt=up.ERR_STREAM_NULL_VALUES,zGt=up.ERR_STREAM_WRITE_AFTER_END,HGt=up.ERR_UNKNOWN_ENCODING,Ub=qH.errorOrDestroy;tr()(ci,d4e);function WGt(){}function $2(e,t,r){Nb=Nb||w0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Nb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=jGt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){QGt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new f4e(this)}$2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty($2.prototype,"buffer",{get:BGt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var TF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(TF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ci,Symbol.hasInstance,{value:function(t){return TF.call(this,t)?!0:this!==ci?!1:t&&t._writableState instanceof $2}})):TF=function(t){return t instanceof this};function ci(e){Nb=Nb||w0();var t=this instanceof Nb;if(!t&&!TF.call(ci,this))return new ci(e);this._writableState=new $2(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),d4e.call(this)}ci.prototype.pipe=function(){Ub(this,new NGt)};function VGt(e,t){var r=new zGt;Ub(e,r),process.nextTick(t,r)}function KGt(e,t,r,n){var i;return r===null?i=new GGt:typeof r!="string"&&!t.objectMode&&(i=new LGt("chunk",["string","Buffer"],r)),i?(Ub(e,i),process.nextTick(n,i),!1):!0}ci.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&PGt(e);return a&&!CF.isBuffer(e)&&(e=IGt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=WGt),n.ending?VGt(this,r):(a||KGt(this,n,e,r))&&(n.pendingcb++,i=YGt(this,n,a,e,t,r)),i};ci.prototype.cork=function(){this._writableState.corked++};ci.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&p4e(this,e))};ci.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new HGt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ci.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function $Gt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=CF.from(t,r)),t}Object.defineProperty(ci.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function YGt(e,t,r,n,i,a){if(!r){var o=$Gt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else MH(e,t,!1,s,n,i,a);return u}function MH(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new UGt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function JGt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(K2,e,t),e._writableState.errorEmitted=!0,Ub(e,n)):(i(n),e._writableState.errorEmitted=!0,Ub(e,n),K2(e,t))}function XGt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function QGt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new qGt;if(XGt(r),t)JGt(e,r,n,t,i);else{var a=h4e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&p4e(e,r),n?process.nextTick(l4e,e,r,a,i):l4e(e,r,a,i)}}function l4e(e,t,r,n){r||ZGt(e,t),t.pendingcb--,n(),K2(e,t)}function ZGt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function p4e(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,MH(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new f4e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(MH(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}ci.prototype._write=function(e,t,r){r(new MGt("_write()"))};ci.prototype._writev=null;ci.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||rzt(this,n,r),this};Object.defineProperty(ci.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function h4e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function ezt(e,t){e._final(function(r){t.pendingcb--,r&&Ub(e,r),t.prefinished=!0,e.emit("prefinish"),K2(e,t)})}function tzt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(ezt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function K2(e,t){var r=h4e(t);if(r&&(tzt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function rzt(e,t,r){t.ending=!0,K2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function nzt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ci.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ci.prototype.destroy=qH.destroy;ci.prototype._undestroy=qH.undestroy;ci.prototype._destroy=function(e,t){t(e)}});var w0=v((rCr,v4e)=>{"use strict";var izt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};v4e.exports=qc;var g4e=zH(),GH=NH();tr()(qc,g4e);for(UH=izt(GH.prototype),DF=0;DF<UH.length;DF++)FF=UH[DF],qc.prototype[FF]||(qc.prototype[FF]=GH.prototype[FF]);var UH,FF,DF;function qc(e){if(!(this instanceof qc))return new qc(e);g4e.call(this,e),GH.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",azt)))}Object.defineProperty(qc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(qc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(qc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function azt(){this._writableState.ended||process.nextTick(ozt,this)}function ozt(e){e.end()}Object.defineProperty(qc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var VH=v(y4e=>{"use strict";var WH=Hs().Buffer,b4e=WH.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function szt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function uzt(e){var t=szt(e);if(typeof t!="string"&&(WH.isEncoding===b4e||!b4e(e)))throw new Error("Unknown encoding: "+e);return t||e}y4e.StringDecoder=Y2;function Y2(e){this.encoding=uzt(e);var t;switch(this.encoding){case"utf16le":this.text=hzt,this.end=mzt,t=4;break;case"utf8":this.fillLast=fzt,t=4;break;case"base64":this.text=gzt,this.end=vzt,t=3;break;default:this.write=bzt,this.end=yzt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=WH.allocUnsafe(t)}Y2.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};Y2.prototype.end=pzt;Y2.prototype.text=dzt;Y2.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function HH(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function czt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=HH(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=HH(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=HH(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function lzt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function fzt(e){var t=this.lastTotal-this.lastNeed,r=lzt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function dzt(e,t){var r=czt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function pzt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function hzt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function mzt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function gzt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function vzt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function bzt(e){return e.toString(this.encoding)}function yzt(e){return e&&e.length?this.write(e):""}});var kF=v((iCr,w4e)=>{"use strict";var x4e=sp().codes.ERR_STREAM_PREMATURE_CLOSE;function xzt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function _zt(){}function wzt(e){return e.setHeader&&typeof e.abort=="function"}function _4e(e,t,r){if(typeof t=="function")return _4e(e,null,t);t||(t={}),r=xzt(r||_zt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(h){r.call(e,h)},f=function(){var h;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(h=new x4e),r.call(e,h);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(h=new x4e),r.call(e,h)},d=function(){e.req.on("finish",s)};return wzt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}w4e.exports=_4e});var A4e=v((aCr,E4e)=>{"use strict";var BF;function cp(e,t,r){return t=Ezt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ezt(e){var t=Azt(e,"string");return typeof t=="symbol"?t:String(t)}function Azt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Szt=kF(),lp=Symbol("lastResolve"),E0=Symbol("lastReject"),J2=Symbol("error"),OF=Symbol("ended"),A0=Symbol("lastPromise"),KH=Symbol("handlePromise"),S0=Symbol("stream");function fp(e,t){return{value:e,done:t}}function Tzt(e){var t=e[lp];if(t!==null){var r=e[S0].read();r!==null&&(e[A0]=null,e[lp]=null,e[E0]=null,t(fp(r,!1)))}}function Czt(e){process.nextTick(Tzt,e)}function Dzt(e,t){return function(r,n){e.then(function(){if(t[OF]){r(fp(void 0,!0));return}t[KH](r,n)},n)}}var Fzt=Object.getPrototypeOf(function(){}),kzt=Object.setPrototypeOf((BF={get stream(){return this[S0]},next:function(){var t=this,r=this[J2];if(r!==null)return Promise.reject(r);if(this[OF])return Promise.resolve(fp(void 0,!0));if(this[S0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[J2]?s(t[J2]):o(fp(void 0,!0))})});var n=this[A0],i;if(n)i=new Promise(Dzt(n,this));else{var a=this[S0].read();if(a!==null)return Promise.resolve(fp(a,!1));i=new Promise(this[KH])}return this[A0]=i,i}},cp(BF,Symbol.asyncIterator,function(){return this}),cp(BF,"return",function(){var t=this;return new Promise(function(r,n){t[S0].destroy(null,function(i){if(i){n(i);return}r(fp(void 0,!0))})})}),BF),Fzt),Bzt=function(t){var r,n=Object.create(kzt,(r={},cp(r,S0,{value:t,writable:!0}),cp(r,lp,{value:null,writable:!0}),cp(r,E0,{value:null,writable:!0}),cp(r,J2,{value:null,writable:!0}),cp(r,OF,{value:t._readableState.endEmitted,writable:!0}),cp(r,KH,{value:function(a,o){var s=n[S0].read();s?(n[A0]=null,n[lp]=null,n[E0]=null,a(fp(s,!1))):(n[lp]=a,n[E0]=o)},writable:!0}),r));return n[A0]=null,Szt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[E0];a!==null&&(n[A0]=null,n[lp]=null,n[E0]=null,a(i)),n[J2]=i;return}var o=n[lp];o!==null&&(n[A0]=null,n[lp]=null,n[E0]=null,o(fp(void 0,!0))),n[OF]=!0}),t.on("readable",Czt.bind(null,n)),n};E4e.exports=Bzt});var D4e=v((oCr,C4e)=>{"use strict";function S4e(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function Ozt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){S4e(a,n,i,o,s,"next",u)}function s(u){S4e(a,n,i,o,s,"throw",u)}o(void 0)})}}function T4e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Izt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?T4e(Object(r),!0).forEach(function(n){Pzt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Pzt(e,t,r){return t=Rzt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rzt(e){var t=jzt(e,"string");return typeof t=="symbol"?t:String(t)}function jzt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lzt=sp().codes.ERR_INVALID_ARG_TYPE;function Mzt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new Lzt("iterable",["Iterable"],t);var i=new e(Izt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=Ozt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}C4e.exports=Mzt});var zH=v((uCr,M4e)=>{"use strict";M4e.exports=Gr;var Gb;Gr.ReadableState=O4e;var sCr=require("events").EventEmitter,B4e=function(t,r){return t.listeners(r).length},Q2=IH(),IF=require("buffer").Buffer,qzt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Nzt(e){return IF.from(e)}function Uzt(e){return IF.isBuffer(e)||e instanceof qzt}var $H=require("util"),yr;$H&&$H.debuglog?yr=$H.debuglog("stream"):yr=function(){};var Gzt=n4e(),tW=jH(),zzt=LH(),Hzt=zzt.getHighWaterMark,PF=sp().codes,Wzt=PF.ERR_INVALID_ARG_TYPE,Vzt=PF.ERR_STREAM_PUSH_AFTER_EOF,Kzt=PF.ERR_METHOD_NOT_IMPLEMENTED,$zt=PF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,zb,YH,JH;tr()(Gr,Q2);var X2=tW.errorOrDestroy,XH=["error","close","destroy","pause","resume"];function Yzt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function O4e(e,t,r){Gb=Gb||w0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Gb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=Hzt(this,e,"readableHighWaterMark",r),this.buffer=new Gzt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(zb||(zb=VH().StringDecoder),this.decoder=new zb(e.encoding),this.encoding=e.encoding)}function Gr(e){if(Gb=Gb||w0(),!(this instanceof Gr))return new Gr(e);var t=this instanceof Gb;this._readableState=new O4e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),Q2.call(this)}Object.defineProperty(Gr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});Gr.prototype.destroy=tW.destroy;Gr.prototype._undestroy=tW.undestroy;Gr.prototype._destroy=function(e,t){t(e)};Gr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=IF.from(e,t),t=""),n=!0),I4e(this,e,t,!1,n)};Gr.prototype.unshift=function(e){return I4e(this,e,null,!0,!1)};function I4e(e,t,r,n,i){yr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Qzt(e,a);else{var o;if(i||(o=Jzt(a,t)),o)X2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==IF.prototype&&(t=Nzt(t)),n)a.endEmitted?X2(e,new $zt):QH(e,a,t,!0);else if(a.ended)X2(e,new Vzt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?QH(e,a,t,!1):eW(e,a)):QH(e,a,t,!1)}else n||(a.reading=!1,eW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function QH(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&RF(e)),eW(e,t)}function Jzt(e,t){var r;return!Uzt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Wzt("chunk",["string","Buffer","Uint8Array"],t)),r}Gr.prototype.isPaused=function(){return this._readableState.flowing===!1};Gr.prototype.setEncoding=function(e){zb||(zb=VH().StringDecoder);var t=new zb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var F4e=1073741824;function Xzt(e){return e>=F4e?e=F4e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function k4e(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=Xzt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}Gr.prototype.read=function(e){yr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return yr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ZH(this):RF(this),null;if(e=k4e(e,t),e===0&&t.ended)return t.length===0&&ZH(this),null;var n=t.needReadable;yr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,yr("length less than watermark",n)),t.ended||t.reading?(n=!1,yr("reading or ended",n)):n&&(yr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=k4e(r,t)));var i;return e>0?i=j4e(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ZH(this)),i!==null&&this.emit("data",i),i};function Qzt(e,t){if(yr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?RF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P4e(e)))}}function RF(e){var t=e._readableState;yr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(yr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(P4e,e))}function P4e(e){var t=e._readableState;yr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,rW(e)}function eW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Zzt,e,t))}function Zzt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(yr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}Gr.prototype._read=function(e){X2(this,new Kzt("_read()"))};Gr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,yr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){yr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){yr("onend"),e.end()}var u=eHt(r);e.on("drain",u);var c=!1;function l(){yr("cleanup"),e.removeListener("close",p),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){yr("ondata");var x=e.write(g);yr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&L4e(n.pipes,e)!==-1)&&!c&&(yr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){yr("onerror",g),b(),e.removeListener("error",d),B4e(e,"error")===0&&X2(e,g)}Yzt(e,"error",d);function p(){e.removeListener("finish",h),b()}e.once("close",p);function h(){yr("onfinish"),e.removeListener("close",p),b()}e.once("finish",h);function b(){yr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(yr("pipe resume"),r.resume()),e};function eHt(e){return function(){var r=e._readableState;yr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&B4e(e,"data")&&(r.flowing=!0,rW(e))}}Gr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=L4e(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};Gr.prototype.on=function(e,t){var r=Q2.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,yr("on readable",n.length,n.reading),n.length?RF(this):n.reading||process.nextTick(tHt,this)),r};Gr.prototype.addListener=Gr.prototype.on;Gr.prototype.removeListener=function(e,t){var r=Q2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(R4e,this),r};Gr.prototype.removeAllListeners=function(e){var t=Q2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(R4e,this),t};function R4e(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function tHt(e){yr("readable nexttick read 0"),e.read(0)}Gr.prototype.resume=function(){var e=this._readableState;return e.flowing||(yr("resume"),e.flowing=!e.readableListening,rHt(this,e)),e.paused=!1,this};function rHt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(nHt,e,t))}function nHt(e,t){yr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),rW(e),t.flowing&&!t.reading&&e.read(0)}Gr.prototype.pause=function(){return yr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(yr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function rW(e){var t=e._readableState;for(yr("flow",t.flowing);t.flowing&&e.read()!==null;);}Gr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(yr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(yr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<XH.length;a++)e.on(XH[a],this.emit.bind(this,XH[a]));return this._read=function(o){yr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(Gr.prototype[Symbol.asyncIterator]=function(){return YH===void 0&&(YH=A4e()),YH(this)});Object.defineProperty(Gr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(Gr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(Gr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});Gr._fromList=j4e;Object.defineProperty(Gr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function j4e(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ZH(e){var t=e._readableState;yr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(iHt,t,e))}function iHt(e,t){if(yr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Gr.from=function(e,t){return JH===void 0&&(JH=D4e()),JH(Gr,e,t)});function L4e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var nW=v((cCr,N4e)=>{"use strict";N4e.exports=Zl;var jF=sp().codes,aHt=jF.ERR_METHOD_NOT_IMPLEMENTED,oHt=jF.ERR_MULTIPLE_CALLBACK,sHt=jF.ERR_TRANSFORM_ALREADY_TRANSFORMING,uHt=jF.ERR_TRANSFORM_WITH_LENGTH_0,LF=w0();tr()(Zl,LF);function cHt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new oHt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Zl(e){if(!(this instanceof Zl))return new Zl(e);LF.call(this,e),this._transformState={afterTransform:cHt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",lHt)}function lHt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){q4e(e,t,r)}):q4e(this,null,null)}Zl.prototype.push=function(e,t){return this._transformState.needTransform=!1,LF.prototype.push.call(this,e,t)};Zl.prototype._transform=function(e,t,r){r(new aHt("_transform()"))};Zl.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Zl.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Zl.prototype._destroy=function(e,t){LF.prototype._destroy.call(this,e,function(r){t(r)})};function q4e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new uHt;if(e._transformState.transforming)throw new sHt;return e.push(null)}});var z4e=v((lCr,G4e)=>{"use strict";G4e.exports=Z2;var U4e=nW();tr()(Z2,U4e);function Z2(e){if(!(this instanceof Z2))return new Z2(e);U4e.call(this,e)}Z2.prototype._transform=function(e,t,r){r(null,e)}});var $4e=v((fCr,K4e)=>{"use strict";var iW;function fHt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var V4e=sp().codes,dHt=V4e.ERR_MISSING_ARGS,pHt=V4e.ERR_STREAM_DESTROYED;function H4e(e){if(e)throw e}function hHt(e){return e.setHeader&&typeof e.abort=="function"}function mHt(e,t,r,n){n=fHt(n);var i=!1;e.on("close",function(){i=!0}),iW===void 0&&(iW=kF()),iW(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,hHt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new pHt("pipe"))}}}function W4e(e){e()}function gHt(e,t){return e.pipe(t)}function vHt(e){return!e.length||typeof e[e.length-1]!="function"?H4e:e.pop()}function bHt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=vHt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new dHt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return mHt(o,u,c,function(l){i||(i=l),l&&a.forEach(W4e),!u&&(a.forEach(W4e),n(i))})});return t.reduce(gHt)}K4e.exports=bHt});var Y4e=v((Rs,tw)=>{var ew=require("stream");process.env.READABLE_STREAM==="disable"&&ew?(tw.exports=ew.Readable,Object.assign(tw.exports,ew),tw.exports.Stream=ew):(Rs=tw.exports=zH(),Rs.Stream=ew||Rs,Rs.Readable=Rs,Rs.Writable=NH(),Rs.Duplex=w0(),Rs.Transform=nW(),Rs.PassThrough=z4e(),Rs.finished=kF(),Rs.pipeline=$4e())});var oW=v(aW=>{var J4e;(function(e){typeof DO_NOT_EXPORT_CRC>"u"?typeof aW=="object"?e(aW):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(J4e={}):e(J4e={})})(function(e){e.version="1.2.2";function t(){for(var k=0,N=new Array(256),C=0;C!=256;++C)k=C,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,k=k&1?-306674912^k>>>1:k>>>1,N[C]=k;return typeof Int32Array<"u"?new Int32Array(N):N}var r=t();function n(k){var N=0,C=0,I=0,P=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(I=0;I!=256;++I)P[I]=k[I];for(I=0;I!=256;++I)for(C=k[I],N=256+I;N<4096;N+=256)C=P[N]=C>>>8^k[C&255];var U=[];for(I=1;I!=16;++I)U[I-1]=typeof Int32Array<"u"?P.subarray(I*256,I*256+256):P.slice(I*256,I*256+256);return U}var i=n(r),a=i[0],o=i[1],s=i[2],u=i[3],c=i[4],l=i[5],f=i[6],d=i[7],p=i[8],h=i[9],b=i[10],g=i[11],x=i[12],E=i[13],S=i[14];function F(k,N){for(var C=N^-1,I=0,P=k.length;I<P;)C=C>>>8^r[(C^k.charCodeAt(I++))&255];return~C}function D(k,N){for(var C=N^-1,I=k.length-15,P=0;P<I;)C=S[k[P++]^C&255]^E[k[P++]^C>>8&255]^x[k[P++]^C>>16&255]^g[k[P++]^C>>>24]^b[k[P++]]^h[k[P++]]^p[k[P++]]^d[k[P++]]^f[k[P++]]^l[k[P++]]^c[k[P++]]^u[k[P++]]^s[k[P++]]^o[k[P++]]^a[k[P++]]^r[k[P++]];for(I+=15;P<I;)C=C>>>8^r[(C^k[P++])&255];return~C}function j(k,N){for(var C=N^-1,I=0,P=k.length,U=0,Y=0;I<P;)U=k.charCodeAt(I++),U<128?C=C>>>8^r[(C^U)&255]:U<2048?(C=C>>>8^r[(C^(192|U>>6&31))&255],C=C>>>8^r[(C^(128|U&63))&255]):U>=55296&&U<57344?(U=(U&1023)+64,Y=k.charCodeAt(I++)&1023,C=C>>>8^r[(C^(240|U>>8&7))&255],C=C>>>8^r[(C^(128|U>>2&63))&255],C=C>>>8^r[(C^(128|Y>>6&15|(U&3)<<4))&255],C=C>>>8^r[(C^(128|Y&63))&255]):(C=C>>>8^r[(C^(224|U>>12&15))&255],C=C>>>8^r[(C^(128|U>>6&63))&255],C=C>>>8^r[(C^(128|U&63))&255]);return~C}e.table=r,e.bstr=F,e.buf=D,e.str=j})});var Q4e=v((pCr,X4e)=>{"use strict";var{Transform:yHt}=Y4e(),xHt=oW(),sW=class extends yHt{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(t,r,n){t&&(this.checksum=xHt.buf(t,this.checksum)>>>0,this.rawSize+=t.length),n(null,t)}digest(t){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(){return this.rawSize}};X4e.exports=sW});var eFe=v((hCr,Z4e)=>{"use strict";var{DeflateRaw:_Ht}=require("zlib"),wHt=oW(),uW=class extends _Ht{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0,this.compressedSize=0}push(t,r){return t&&(this.compressedSize+=t.length),super.push(t,r)}_transform(t,r,n){t&&(this.checksum=wHt.buf(t,this.checksum)>>>0,this.rawSize+=t.length),super._transform(t,r,n)}digest(t){let r=Buffer.allocUnsafe(4);return r.writeUInt32BE(this.checksum>>>0,0),t?r.toString(t):r}hex(){return this.digest("hex").toUpperCase()}size(t=!1){return t?this.compressedSize:this.rawSize}};Z4e.exports=uW});var cW=v((mCr,tFe)=>{"use strict";tFe.exports={CRC32Stream:Q4e(),DeflateCRC32Stream:eFe()}});var iFe=v((yCr,nFe)=>{var EHt=require("util").inherits,AHt=OH(),{CRC32Stream:SHt}=cW(),{DeflateCRC32Stream:THt}=cW(),rFe=DH(),gCr=Xz(),vCr=Yz(),sr=Jz(),bCr=TH(),Ut=cF(),ca=nFe.exports=function(e){if(!(this instanceof ca))return new ca(e);e=this.options=this._defaults(e),rFe.call(this,e),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:"",finish:!1,finished:!1,processing:!1,forceZip64:e.forceZip64,forceLocalTime:e.forceLocalTime}};EHt(ca,rFe);ca.prototype._afterAppend=function(e){this._entries.push(e),e.getGeneralPurposeBit().usesDataDescriptor()&&this._writeDataDescriptor(e),this._archive.processing=!1,this._entry=null,this._archive.finish&&!this._archive.finished&&this._finish()};ca.prototype._appendBuffer=function(e,t,r){t.length===0&&e.setMethod(sr.METHOD_STORED);var n=e.getMethod();if(n===sr.METHOD_STORED&&(e.setSize(t.length),e.setCompressedSize(t.length),e.setCrc(AHt.unsigned(t))),this._writeLocalFileHeader(e),n===sr.METHOD_STORED){this.write(t),this._afterAppend(e),r(null,e);return}else if(n===sr.METHOD_DEFLATED){this._smartStream(e,r).end(t);return}else{r(new Error("compression method "+n+" not implemented"));return}};ca.prototype._appendStream=function(e,t,r){e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_DATA_DESCRIPTOR),this._writeLocalFileHeader(e);var n=this._smartStream(e,r);t.once("error",function(i){n.emit("error",i),n.end()}),t.pipe(n)};ca.prototype._defaults=function(e){return typeof e!="object"&&(e={}),typeof e.zlib!="object"&&(e.zlib={}),typeof e.zlib.level!="number"&&(e.zlib.level=sr.ZLIB_BEST_SPEED),e.forceZip64=!!e.forceZip64,e.forceLocalTime=!!e.forceLocalTime,e};ca.prototype._finish=function(){this._archive.centralOffset=this.offset,this._entries.forEach(function(e){this._writeCentralFileHeader(e)}.bind(this)),this._archive.centralLength=this.offset-this._archive.centralOffset,this.isZip64()&&this._writeCentralDirectoryZip64(),this._writeCentralDirectoryEnd(),this._archive.processing=!1,this._archive.finish=!0,this._archive.finished=!0,this.end()};ca.prototype._normalizeEntry=function(e){e.getMethod()===-1&&e.setMethod(sr.METHOD_DEFLATED),e.getMethod()===sr.METHOD_DEFLATED&&(e.getGeneralPurposeBit().useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_DATA_DESCRIPTOR)),e.getTime()===-1&&e.setTime(new Date,this._archive.forceLocalTime),e._offsets={file:0,data:0,contents:0}};ca.prototype._smartStream=function(e,t){var r=e.getMethod()===sr.METHOD_DEFLATED,n=r?new THt(this.options.zlib):new SHt,i=null;function a(){var o=n.digest().readUInt32BE(0);e.setCrc(o),e.setSize(n.size()),e.setCompressedSize(n.size(!0)),this._afterAppend(e),t(i,e)}return n.once("end",a.bind(this)),n.once("error",function(o){i=o}),n.pipe(this,{end:!1}),n};ca.prototype._writeCentralDirectoryEnd=function(){var e=this._entries.length,t=this._archive.centralLength,r=this._archive.centralOffset;this.isZip64()&&(e=sr.ZIP64_MAGIC_SHORT,t=sr.ZIP64_MAGIC,r=sr.ZIP64_MAGIC),this.write(Ut.getLongBytes(sr.SIG_EOCD)),this.write(sr.SHORT_ZERO),this.write(sr.SHORT_ZERO),this.write(Ut.getShortBytes(e)),this.write(Ut.getShortBytes(e)),this.write(Ut.getLongBytes(t)),this.write(Ut.getLongBytes(r));var n=this.getComment(),i=Buffer.byteLength(n);this.write(Ut.getShortBytes(i)),this.write(n)};ca.prototype._writeCentralDirectoryZip64=function(){this.write(Ut.getLongBytes(sr.SIG_ZIP64_EOCD)),this.write(Ut.getEightBytes(44)),this.write(Ut.getShortBytes(sr.MIN_VERSION_ZIP64)),this.write(Ut.getShortBytes(sr.MIN_VERSION_ZIP64)),this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO),this.write(Ut.getEightBytes(this._entries.length)),this.write(Ut.getEightBytes(this._entries.length)),this.write(Ut.getEightBytes(this._archive.centralLength)),this.write(Ut.getEightBytes(this._archive.centralOffset)),this.write(Ut.getLongBytes(sr.SIG_ZIP64_EOCD_LOC)),this.write(sr.LONG_ZERO),this.write(Ut.getEightBytes(this._archive.centralOffset+this._archive.centralLength)),this.write(Ut.getLongBytes(1))};ca.prototype._writeCentralFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e._offsets,i=e.getSize(),a=e.getCompressedSize();if(e.isZip64()||n.file>sr.ZIP64_MAGIC){i=sr.ZIP64_MAGIC,a=sr.ZIP64_MAGIC,e.setVersionNeededToExtract(sr.MIN_VERSION_ZIP64);var o=Buffer.concat([Ut.getShortBytes(sr.ZIP64_EXTRA_ID),Ut.getShortBytes(24),Ut.getEightBytes(e.getSize()),Ut.getEightBytes(e.getCompressedSize()),Ut.getEightBytes(n.file)],28);e.setExtra(o)}this.write(Ut.getLongBytes(sr.SIG_CFH)),this.write(Ut.getShortBytes(e.getPlatform()<<8|sr.VERSION_MADEBY)),this.write(Ut.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(Ut.getShortBytes(r)),this.write(Ut.getLongBytes(e.getTimeDos())),this.write(Ut.getLongBytes(e.getCrc())),this.write(Ut.getLongBytes(a)),this.write(Ut.getLongBytes(i));var s=e.getName(),u=e.getComment(),c=e.getCentralDirectoryExtra();t.usesUTF8ForNames()&&(s=Buffer.from(s),u=Buffer.from(u)),this.write(Ut.getShortBytes(s.length)),this.write(Ut.getShortBytes(c.length)),this.write(Ut.getShortBytes(u.length)),this.write(sr.SHORT_ZERO),this.write(Ut.getShortBytes(e.getInternalAttributes())),this.write(Ut.getLongBytes(e.getExternalAttributes())),n.file>sr.ZIP64_MAGIC?this.write(Ut.getLongBytes(sr.ZIP64_MAGIC)):this.write(Ut.getLongBytes(n.file)),this.write(s),this.write(c),this.write(u)};ca.prototype._writeDataDescriptor=function(e){this.write(Ut.getLongBytes(sr.SIG_DD)),this.write(Ut.getLongBytes(e.getCrc())),e.isZip64()?(this.write(Ut.getEightBytes(e.getCompressedSize())),this.write(Ut.getEightBytes(e.getSize()))):(this.write(Ut.getLongBytes(e.getCompressedSize())),this.write(Ut.getLongBytes(e.getSize())))};ca.prototype._writeLocalFileHeader=function(e){var t=e.getGeneralPurposeBit(),r=e.getMethod(),n=e.getName(),i=e.getLocalFileDataExtra();e.isZip64()&&(t.useDataDescriptor(!0),e.setVersionNeededToExtract(sr.MIN_VERSION_ZIP64)),t.usesUTF8ForNames()&&(n=Buffer.from(n)),e._offsets.file=this.offset,this.write(Ut.getLongBytes(sr.SIG_LFH)),this.write(Ut.getShortBytes(e.getVersionNeededToExtract())),this.write(t.encode()),this.write(Ut.getShortBytes(r)),this.write(Ut.getLongBytes(e.getTimeDos())),e._offsets.data=this.offset,t.usesDataDescriptor()?(this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO),this.write(sr.LONG_ZERO)):(this.write(Ut.getLongBytes(e.getCrc())),this.write(Ut.getLongBytes(e.getCompressedSize())),this.write(Ut.getLongBytes(e.getSize()))),this.write(Ut.getShortBytes(n.length)),this.write(Ut.getShortBytes(i.length)),this.write(n),this.write(i),e._offsets.contents=this.offset};ca.prototype.getComment=function(e){return this._archive.comment!==null?this._archive.comment:""};ca.prototype.isZip64=function(){return this._archive.forceZip64||this._entries.length>sr.ZIP64_MAGIC_SHORT||this._archive.centralLength>sr.ZIP64_MAGIC||this._archive.centralOffset>sr.ZIP64_MAGIC};ca.prototype.setComment=function(e){this._archive.comment=e}});var lW=v((xCr,aFe)=>{aFe.exports={ArchiveEntry:uF(),ZipArchiveEntry:Xz(),ArchiveOutputStream:DH(),ZipArchiveOutputStream:iFe()}});var sFe=v((_Cr,oFe)=>{var CHt=require("util").inherits,dW=lW().ZipArchiveOutputStream,DHt=lW().ZipArchiveEntry,fW=Bb(),Hb=oFe.exports=function(e){if(!(this instanceof Hb))return new Hb(e);e=this.options=e||{},e.zlib=e.zlib||{},dW.call(this,e),typeof e.level=="number"&&e.level>=0&&(e.zlib.level=e.level,delete e.level),!e.forceZip64&&typeof e.zlib.level=="number"&&e.zlib.level===0&&(e.store=!0),e.namePrependSlash=e.namePrependSlash||!1,e.comment&&e.comment.length>0&&this.setComment(e.comment)};CHt(Hb,dW);Hb.prototype._normalizeFileData=function(e){e=fW.defaults(e,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""});var t=e.type==="directory",r=e.type==="symlink";return e.name&&(e.name=fW.sanitizePath(e.name),!r&&e.name.slice(-1)==="/"?(t=!0,e.type="directory"):t&&(e.name+="/")),(t||r)&&(e.store=!0),e.date=fW.dateify(e.date),e};Hb.prototype.entry=function(e,t,r){if(typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),t=this._normalizeFileData(t),t.type!=="file"&&t.type!=="directory"&&t.type!=="symlink"){r(new Error(t.type+" entries not currently supported"));return}if(typeof t.name!="string"||t.name.length===0){r(new Error("entry name must be a non-empty string value"));return}if(t.type==="symlink"&&typeof t.linkname!="string"){r(new Error("entry linkname must be a non-empty string value when type equals symlink"));return}var n=new DHt(t.name);return n.setTime(t.date,this.options.forceLocalTime),t.namePrependSlash&&n.setName(t.name,!0),t.store&&n.setMethod(0),t.comment.length>0&&n.setComment(t.comment),t.type==="symlink"&&typeof t.mode!="number"&&(t.mode=40960),typeof t.mode=="number"&&(t.type==="symlink"&&(t.mode|=40960),n.setUnixMode(t.mode)),t.type==="symlink"&&typeof t.linkname=="string"&&(e=Buffer.from(t.linkname)),dW.prototype.entry.call(this,n,e,r)};Hb.prototype.finalize=function(){this.finish()}});var cFe=v((wCr,uFe)=>{var FHt=sFe(),kHt=Bb(),dp=function(e){if(!(this instanceof dp))return new dp(e);e=this.options=kHt.defaults(e,{comment:"",forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new FHt(e)};dp.prototype.append=function(e,t,r){this.engine.entry(e,t,r)};dp.prototype.finalize=function(){this.engine.finalize()};dp.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};dp.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};dp.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};uFe.exports=dp});var mW=v(Vb=>{var BHt=Buffer.alloc,OHt="0000000000000000000",IHt="7777777777777777777",lFe="0".charCodeAt(0),fFe=Buffer.from("ustar\0","binary"),PHt=Buffer.from("00","binary"),RHt=Buffer.from("ustar ","binary"),jHt=Buffer.from(" \0","binary"),LHt=parseInt("7777",8),rw=257,hW=263,MHt=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},qHt=function(e){switch(e){case 0:return"file";case 1:return"link";case 2:return"symlink";case 3:return"character-device";case 4:return"block-device";case 5:return"directory";case 6:return"fifo";case 7:return"contiguous-file";case 72:return"pax-header";case 55:return"pax-global-header";case 27:return"gnu-long-link-path";case 28:case 30:return"gnu-long-path"}return null},NHt=function(e){switch(e){case"file":return 0;case"link":return 1;case"symlink":return 2;case"character-device":return 3;case"block-device":return 4;case"directory":return 5;case"fifo":return 6;case"contiguous-file":return 7;case"pax-header":return 72}return 0},dFe=function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},pFe=function(e){for(var t=256,r=0;r<148;r++)t+=e[r];for(var n=156;n<512;n++)t+=e[n];return t},pp=function(e,t){return e=e.toString(8),e.length>t?IHt.slice(0,t)+" ":OHt.slice(0,t-e.length)+e+" "};function UHt(e){var t;if(e[0]===128)t=!0;else if(e[0]===255)t=!1;else return null;for(var r=[],n=e.length-1;n>0;n--){var i=e[n];t?r.push(i):r.push(255-i)}var a=0,o=r.length;for(n=0;n<o;n++)a+=r[n]*Math.pow(256,n);return t?a:-1*a}var hp=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return UHt(e);for(;t<e.length&&e[t]===32;)t++;for(var n=MHt(dFe(e,32,t,e.length),e.length,e.length);t<n&&e[t]===0;)t++;return n===t?0:parseInt(e.slice(t,n).toString(),8)},Wb=function(e,t,r,n){return e.slice(t,dFe(e,0,t,t+r)).toString(n)},pW=function(e){var t=Buffer.byteLength(e),r=Math.floor(Math.log(t)/Math.log(10))+1;return t+r>=Math.pow(10,r)&&r++,t+r+e};Vb.decodeLongPath=function(e,t){return Wb(e,0,e.length,t)};Vb.encodePax=function(e){var t="";e.name&&(t+=pW(" path="+e.name+`
|
|
171
171
|
`)),e.linkname&&(t+=pW(" linkpath="+e.linkname+`
|
|
172
172
|
`));var r=e.pax;if(r)for(var n in r)t+=pW(" "+n+"="+r[n]+`
|
|
173
|
-
`);return Buffer.from(t)};Vb.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var i=e.slice(r+1,n-1).toString(),a=i.indexOf("=");if(a===-1)return t;t[i.slice(0,a)]=i.slice(a+1),e=e.slice(n)}return t};Vb.encode=function(e){var t=BHt(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var i=r.indexOf("/");if(i===-1)return null;n+=n?"/"+r.slice(0,i):r.slice(0,i),r=r.slice(i+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(pp(e.mode&LHt,6),100),t.write(pp(e.uid,6),108),t.write(pp(e.gid,6),116),t.write(pp(e.size,11),124),t.write(pp(e.mtime.getTime()/1e3|0,11),136),t[156]=lFe+NHt(e.type),e.linkname&&t.write(e.linkname,157),fFe.copy(t,rw),PHt.copy(t,hW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(pp(e.devmajor||0,6),329),t.write(pp(e.devminor||0,6),337),n&&t.write(n,345),t.write(pp(pFe(t),6),148),t)};Vb.decode=function(e,t,r){var n=e[156]===0?0:e[156]-lFe,i=Wb(e,0,100,t),a=hp(e,100,8),o=hp(e,108,8),s=hp(e,116,8),u=hp(e,124,12),c=hp(e,136,12),l=qHt(n),f=e[157]===0?null:Wb(e,157,100,t),d=Wb(e,265,32),p=Wb(e,297,32),h=hp(e,329,8),b=hp(e,337,8),g=pFe(e);if(g===8*32)return null;if(g!==hp(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(fFe.compare(e,rw,rw+6)===0)e[345]&&(i=Wb(e,345,155,t)+"/"+i);else if(!(RHt.compare(e,rw,rw+6)===0&&jHt.compare(e,hW,hW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:d,gname:p,devmajor:h,devminor:b}}});var gW=v((ACr,hFe)=>{hFe.exports=require("stream")});var xFe=v((SCr,yFe)=>{"use strict";function mFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gFe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mFe(Object(r),!0).forEach(function(n){GHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GHt(e,t,r){return t=bFe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bFe(n.key),n)}}function HHt(e,t,r){return t&&vFe(e.prototype,t),r&&vFe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function bFe(e){var t=WHt(e,"string");return typeof t=="symbol"?t:String(t)}function WHt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VHt=require("buffer"),MF=VHt.Buffer,KHt=require("util"),vW=KHt.inspect,$Ht=vW&&vW.custom||"inspect";function YHt(e,t,r){MF.prototype.copy.call(e,t,r)}yFe.exports=function(){function e(){zHt(this,e),this.head=null,this.tail=null,this.length=0}return HHt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return MF.alloc(0);for(var n=MF.allocUnsafe(r>>>0),i=this.head,a=0;i;)YHt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=MF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:$Ht,value:function(r,n){return vW(this,gFe(gFe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var yW=v((TCr,wFe)=>{"use strict";function JHt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(bW,this,e)):process.nextTick(bW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(qF,r):(r._writableState.errorEmitted=!0,process.nextTick(_Fe,r,a)):process.nextTick(_Fe,r,a):t?(process.nextTick(qF,r),t(a)):process.nextTick(qF,r)}),this)}function _Fe(e,t){bW(e,t),qF(e)}function qF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function XHt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function bW(e,t){e.emit("error",t)}function QHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}wFe.exports={destroy:JHt,undestroy:XHt,errorOrDestroy:QHt}});var mp=v((CCr,SFe)=>{"use strict";var AFe={};function js(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,AFe[e]=i}function EFe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function ZHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function eWt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function tWt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}js("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);js("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&ZHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(eWt(e," argument"))i=`The ${e} ${n} ${EFe(t,"type")}`;else{let a=tWt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${EFe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);js("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");js("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});js("ERR_STREAM_PREMATURE_CLOSE","Premature close");js("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});js("ERR_MULTIPLE_CALLBACK","Callback called multiple times");js("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");js("ERR_STREAM_WRITE_AFTER_END","write after end");js("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);js("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);js("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");SFe.exports.codes=AFe});var xW=v((DCr,TFe)=>{"use strict";var rWt=mp().codes.ERR_INVALID_OPT_VALUE;function nWt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function iWt(e,t,r,n){var i=nWt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new rWt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}TFe.exports={getHighWaterMark:iWt}});var EW=v((FCr,OFe)=>{"use strict";OFe.exports=li;function DFe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){BWt(t,e)}}var Kb;li.WritableState=iw;var aWt={deprecate:mh()},FFe=gW(),UF=require("buffer").Buffer,oWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function sWt(e){return UF.from(e)}function uWt(e){return UF.isBuffer(e)||e instanceof oWt}var wW=yW(),cWt=xW(),lWt=cWt.getHighWaterMark,gp=mp().codes,fWt=gp.ERR_INVALID_ARG_TYPE,dWt=gp.ERR_METHOD_NOT_IMPLEMENTED,pWt=gp.ERR_MULTIPLE_CALLBACK,hWt=gp.ERR_STREAM_CANNOT_PIPE,mWt=gp.ERR_STREAM_DESTROYED,gWt=gp.ERR_STREAM_NULL_VALUES,vWt=gp.ERR_STREAM_WRITE_AFTER_END,bWt=gp.ERR_UNKNOWN_ENCODING,$b=wW.errorOrDestroy;tr()(li,FFe);function yWt(){}function iw(e,t,r){Kb=Kb||T0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Kb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=lWt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){TWt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new DFe(this)}iw.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(iw.prototype,"buffer",{get:aWt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var NF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(NF=Function.prototype[Symbol.hasInstance],Object.defineProperty(li,Symbol.hasInstance,{value:function(t){return NF.call(this,t)?!0:this!==li?!1:t&&t._writableState instanceof iw}})):NF=function(t){return t instanceof this};function li(e){Kb=Kb||T0();var t=this instanceof Kb;if(!t&&!NF.call(li,this))return new li(e);this._writableState=new iw(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),FFe.call(this)}li.prototype.pipe=function(){$b(this,new hWt)};function xWt(e,t){var r=new vWt;$b(e,r),process.nextTick(t,r)}function _Wt(e,t,r,n){var i;return r===null?i=new gWt:typeof r!="string"&&!t.objectMode&&(i=new fWt("chunk",["string","Buffer"],r)),i?($b(e,i),process.nextTick(n,i),!1):!0}li.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&uWt(e);return a&&!UF.isBuffer(e)&&(e=sWt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=yWt),n.ending?xWt(this,r):(a||_Wt(this,n,e,r))&&(n.pendingcb++,i=EWt(this,n,a,e,t,r)),i};li.prototype.cork=function(){this._writableState.corked++};li.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&kFe(this,e))};li.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new bWt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(li.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function wWt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=UF.from(t,r)),t}Object.defineProperty(li.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function EWt(e,t,r,n,i,a){if(!r){var o=wWt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _W(e,t,!1,s,n,i,a);return u}function _W(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new mWt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function AWt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(nw,e,t),e._writableState.errorEmitted=!0,$b(e,n)):(i(n),e._writableState.errorEmitted=!0,$b(e,n),nw(e,t))}function SWt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function TWt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new pWt;if(SWt(r),t)AWt(e,r,n,t,i);else{var a=BFe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&kFe(e,r),n?process.nextTick(CFe,e,r,a,i):CFe(e,r,a,i)}}function CFe(e,t,r,n){r||CWt(e,t),t.pendingcb--,n(),nw(e,t)}function CWt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function kFe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,_W(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new DFe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(_W(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}li.prototype._write=function(e,t,r){r(new dWt("_write()"))};li.prototype._writev=null;li.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||kWt(this,n,r),this};Object.defineProperty(li.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function BFe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function DWt(e,t){e._final(function(r){t.pendingcb--,r&&$b(e,r),t.prefinished=!0,e.emit("prefinish"),nw(e,t)})}function FWt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(DWt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function nw(e,t){var r=BFe(t);if(r&&(FWt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function kWt(e,t,r){t.ending=!0,nw(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function BWt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(li.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});li.prototype.destroy=wW.destroy;li.prototype._undestroy=wW.undestroy;li.prototype._destroy=function(e,t){t(e)}});var T0=v((kCr,PFe)=>{"use strict";var OWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};PFe.exports=Nc;var IFe=TW(),SW=EW();tr()(Nc,IFe);for(AW=OWt(SW.prototype),GF=0;GF<AW.length;GF++)zF=AW[GF],Nc.prototype[zF]||(Nc.prototype[zF]=SW.prototype[zF]);var AW,zF,GF;function Nc(e){if(!(this instanceof Nc))return new Nc(e);IFe.call(this,e),SW.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",IWt)))}Object.defineProperty(Nc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Nc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Nc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function IWt(){this._writableState.ended||process.nextTick(PWt,this)}function PWt(e){e.end()}Object.defineProperty(Nc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var FW=v(jFe=>{"use strict";var DW=Hs().Buffer,RFe=DW.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function RWt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function jWt(e){var t=RWt(e);if(typeof t!="string"&&(DW.isEncoding===RFe||!RFe(e)))throw new Error("Unknown encoding: "+e);return t||e}jFe.StringDecoder=aw;function aw(e){this.encoding=jWt(e);var t;switch(this.encoding){case"utf16le":this.text=GWt,this.end=zWt,t=4;break;case"utf8":this.fillLast=qWt,t=4;break;case"base64":this.text=HWt,this.end=WWt,t=3;break;default:this.write=VWt,this.end=KWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=DW.allocUnsafe(t)}aw.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};aw.prototype.end=UWt;aw.prototype.text=NWt;aw.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function CW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function LWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=CW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=CW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=CW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function MWt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function qWt(e){var t=this.lastTotal-this.lastNeed,r=MWt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function NWt(e,t){var r=LWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function UWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function GWt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function zWt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function HWt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function WWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function VWt(e){return e.toString(this.encoding)}function KWt(e){return e&&e.length?this.write(e):""}});var HF=v((OCr,qFe)=>{"use strict";var LFe=mp().codes.ERR_STREAM_PREMATURE_CLOSE;function $Wt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function YWt(){}function JWt(e){return e.setHeader&&typeof e.abort=="function"}function MFe(e,t,r){if(typeof t=="function")return MFe(e,null,t);t||(t={}),r=$Wt(r||YWt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(h){r.call(e,h)},f=function(){var h;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(h=new LFe),r.call(e,h);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(h=new LFe),r.call(e,h)},d=function(){e.req.on("finish",s)};return JWt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}qFe.exports=MFe});var UFe=v((ICr,NFe)=>{"use strict";var WF;function vp(e,t,r){return t=XWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XWt(e){var t=QWt(e,"string");return typeof t=="symbol"?t:String(t)}function QWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZWt=HF(),bp=Symbol("lastResolve"),C0=Symbol("lastReject"),ow=Symbol("error"),VF=Symbol("ended"),D0=Symbol("lastPromise"),kW=Symbol("handlePromise"),F0=Symbol("stream");function yp(e,t){return{value:e,done:t}}function eVt(e){var t=e[bp];if(t!==null){var r=e[F0].read();r!==null&&(e[D0]=null,e[bp]=null,e[C0]=null,t(yp(r,!1)))}}function tVt(e){process.nextTick(eVt,e)}function rVt(e,t){return function(r,n){e.then(function(){if(t[VF]){r(yp(void 0,!0));return}t[kW](r,n)},n)}}var nVt=Object.getPrototypeOf(function(){}),iVt=Object.setPrototypeOf((WF={get stream(){return this[F0]},next:function(){var t=this,r=this[ow];if(r!==null)return Promise.reject(r);if(this[VF])return Promise.resolve(yp(void 0,!0));if(this[F0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[ow]?s(t[ow]):o(yp(void 0,!0))})});var n=this[D0],i;if(n)i=new Promise(rVt(n,this));else{var a=this[F0].read();if(a!==null)return Promise.resolve(yp(a,!1));i=new Promise(this[kW])}return this[D0]=i,i}},vp(WF,Symbol.asyncIterator,function(){return this}),vp(WF,"return",function(){var t=this;return new Promise(function(r,n){t[F0].destroy(null,function(i){if(i){n(i);return}r(yp(void 0,!0))})})}),WF),nVt),aVt=function(t){var r,n=Object.create(iVt,(r={},vp(r,F0,{value:t,writable:!0}),vp(r,bp,{value:null,writable:!0}),vp(r,C0,{value:null,writable:!0}),vp(r,ow,{value:null,writable:!0}),vp(r,VF,{value:t._readableState.endEmitted,writable:!0}),vp(r,kW,{value:function(a,o){var s=n[F0].read();s?(n[D0]=null,n[bp]=null,n[C0]=null,a(yp(s,!1))):(n[bp]=a,n[C0]=o)},writable:!0}),r));return n[D0]=null,ZWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[C0];a!==null&&(n[D0]=null,n[bp]=null,n[C0]=null,a(i)),n[ow]=i;return}var o=n[bp];o!==null&&(n[D0]=null,n[bp]=null,n[C0]=null,o(yp(void 0,!0))),n[VF]=!0}),t.on("readable",tVt.bind(null,n)),n};NFe.exports=aVt});var WFe=v((PCr,HFe)=>{"use strict";function GFe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function oVt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){GFe(a,n,i,o,s,"next",u)}function s(u){GFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function zFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sVt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zFe(Object(r),!0).forEach(function(n){uVt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uVt(e,t,r){return t=cVt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cVt(e){var t=lVt(e,"string");return typeof t=="symbol"?t:String(t)}function lVt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fVt=mp().codes.ERR_INVALID_ARG_TYPE;function dVt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new fVt("iterable",["Iterable"],t);var i=new e(sVt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=oVt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}HFe.exports=dVt});var TW=v((jCr,tke)=>{"use strict";tke.exports=zr;var Yb;zr.ReadableState=YFe;var RCr=require("events").EventEmitter,$Fe=function(t,r){return t.listeners(r).length},uw=gW(),KF=require("buffer").Buffer,pVt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hVt(e){return KF.from(e)}function mVt(e){return KF.isBuffer(e)||e instanceof pVt}var BW=require("util"),xr;BW&&BW.debuglog?xr=BW.debuglog("stream"):xr=function(){};var gVt=xFe(),MW=yW(),vVt=xW(),bVt=vVt.getHighWaterMark,$F=mp().codes,yVt=$F.ERR_INVALID_ARG_TYPE,xVt=$F.ERR_STREAM_PUSH_AFTER_EOF,_Vt=$F.ERR_METHOD_NOT_IMPLEMENTED,wVt=$F.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Jb,OW,IW;tr()(zr,uw);var sw=MW.errorOrDestroy,PW=["error","close","destroy","pause","resume"];function EVt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function YFe(e,t,r){Yb=Yb||T0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Yb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=bVt(this,e,"readableHighWaterMark",r),this.buffer=new gVt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Jb||(Jb=FW().StringDecoder),this.decoder=new Jb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Yb=Yb||T0(),!(this instanceof zr))return new zr(e);var t=this instanceof Yb;this._readableState=new YFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),uw.call(this)}Object.defineProperty(zr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});zr.prototype.destroy=MW.destroy;zr.prototype._undestroy=MW.undestroy;zr.prototype._destroy=function(e,t){t(e)};zr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=KF.from(e,t),t=""),n=!0),JFe(this,e,t,!1,n)};zr.prototype.unshift=function(e){return JFe(this,e,null,!0,!1)};function JFe(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,TVt(e,a);else{var o;if(i||(o=AVt(a,t)),o)sw(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==KF.prototype&&(t=hVt(t)),n)a.endEmitted?sw(e,new wVt):RW(e,a,t,!0);else if(a.ended)sw(e,new xVt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?RW(e,a,t,!1):LW(e,a)):RW(e,a,t,!1)}else n||(a.reading=!1,LW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function RW(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&YF(e)),LW(e,t)}function AVt(e,t){var r;return!mVt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new yVt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Jb||(Jb=FW().StringDecoder);var t=new Jb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var VFe=1073741824;function SVt(e){return e>=VFe?e=VFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function KFe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=SVt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}zr.prototype.read=function(e){xr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return xr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jW(this):YF(this),null;if(e=KFe(e,t),e===0&&t.ended)return t.length===0&&jW(this),null;var n=t.needReadable;xr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,xr("length less than watermark",n)),t.ended||t.reading?(n=!1,xr("reading or ended",n)):n&&(xr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=KFe(r,t)));var i;return e>0?i=ZFe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&jW(this)),i!==null&&this.emit("data",i),i};function TVt(e,t){if(xr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?YF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,XFe(e)))}}function YF(e){var t=e._readableState;xr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(xr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(XFe,e))}function XFe(e){var t=e._readableState;xr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,qW(e)}function LW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(CVt,e,t))}function CVt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(xr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}zr.prototype._read=function(e){sw(this,new _Vt("_read()"))};zr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,xr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){xr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){xr("onend"),e.end()}var u=DVt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",p),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&eke(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){xr("onerror",g),b(),e.removeListener("error",d),$Fe(e,"error")===0&&sw(e,g)}EVt(e,"error",d);function p(){e.removeListener("finish",h),b()}e.once("close",p);function h(){xr("onfinish"),e.removeListener("close",p),b()}e.once("finish",h);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function DVt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&$Fe(e,"data")&&(r.flowing=!0,qW(e))}}zr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=eke(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};zr.prototype.on=function(e,t){var r=uw.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,xr("on readable",n.length,n.reading),n.length?YF(this):n.reading||process.nextTick(FVt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=uw.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(QFe,this),r};zr.prototype.removeAllListeners=function(e){var t=uw.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(QFe,this),t};function QFe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function FVt(e){xr("readable nexttick read 0"),e.read(0)}zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(xr("resume"),e.flowing=!e.readableListening,kVt(this,e)),e.paused=!1,this};function kVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(BVt,e,t))}function BVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),qW(e),t.flowing&&!t.reading&&e.read(0)}zr.prototype.pause=function(){return xr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(xr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function qW(e){var t=e._readableState;for(xr("flow",t.flowing);t.flowing&&e.read()!==null;);}zr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(xr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(xr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<PW.length;a++)e.on(PW[a],this.emit.bind(this,PW[a]));return this._read=function(o){xr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(zr.prototype[Symbol.asyncIterator]=function(){return OW===void 0&&(OW=UFe()),OW(this)});Object.defineProperty(zr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(zr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(zr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});zr._fromList=ZFe;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ZFe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function jW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(OVt,t,e))}function OVt(e,t){if(xr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(zr.from=function(e,t){return IW===void 0&&(IW=WFe()),IW(zr,e,t)});function eke(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var NW=v((LCr,nke)=>{"use strict";nke.exports=ef;var JF=mp().codes,IVt=JF.ERR_METHOD_NOT_IMPLEMENTED,PVt=JF.ERR_MULTIPLE_CALLBACK,RVt=JF.ERR_TRANSFORM_ALREADY_TRANSFORMING,jVt=JF.ERR_TRANSFORM_WITH_LENGTH_0,XF=T0();tr()(ef,XF);function LVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new PVt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ef(e){if(!(this instanceof ef))return new ef(e);XF.call(this,e),this._transformState={afterTransform:LVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",MVt)}function MVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){rke(e,t,r)}):rke(this,null,null)}ef.prototype.push=function(e,t){return this._transformState.needTransform=!1,XF.prototype.push.call(this,e,t)};ef.prototype._transform=function(e,t,r){r(new IVt("_transform()"))};ef.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};ef.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ef.prototype._destroy=function(e,t){XF.prototype._destroy.call(this,e,function(r){t(r)})};function rke(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new jVt;if(e._transformState.transforming)throw new RVt;return e.push(null)}});var oke=v((MCr,ake)=>{"use strict";ake.exports=cw;var ike=NW();tr()(cw,ike);function cw(e){if(!(this instanceof cw))return new cw(e);ike.call(this,e)}cw.prototype._transform=function(e,t,r){r(null,e)}});var fke=v((qCr,lke)=>{"use strict";var UW;function qVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var cke=mp().codes,NVt=cke.ERR_MISSING_ARGS,UVt=cke.ERR_STREAM_DESTROYED;function ske(e){if(e)throw e}function GVt(e){return e.setHeader&&typeof e.abort=="function"}function zVt(e,t,r,n){n=qVt(n);var i=!1;e.on("close",function(){i=!0}),UW===void 0&&(UW=HF()),UW(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,GVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new UVt("pipe"))}}}function uke(e){e()}function HVt(e,t){return e.pipe(t)}function WVt(e){return!e.length||typeof e[e.length-1]!="function"?ske:e.pop()}function VVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=WVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new NVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return zVt(o,u,c,function(l){i||(i=l),l&&a.forEach(uke),!u&&(a.forEach(uke),n(i))})});return t.reduce(HVt)}lke.exports=VVt});var dw=v((Ls,fw)=>{var lw=require("stream");process.env.READABLE_STREAM==="disable"&&lw?(fw.exports=lw.Readable,Object.assign(fw.exports,lw),fw.exports.Stream=lw):(Ls=fw.exports=TW(),Ls.Stream=lw||Ls,Ls.Readable=Ls,Ls.Writable=EW(),Ls.Duplex=T0(),Ls.Transform=NW(),Ls.PassThrough=oke(),Ls.finished=HF(),Ls.pipeline=fke())});var bke=v((NCr,vke)=>{var pke=require("util"),KVt=UL(),pw=mW(),hke=dw().Writable,mke=dw().PassThrough,gke=function(){},dke=function(e){return e&=511,e&&512-e},$Vt=function(e,t){var r=new QF(e,t);return r.end(),r},YVt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},QF=function(e,t){this._parent=e,this.offset=t,mke.call(this,{autoDestroy:!1})};pke.inherits(QF,mke);QF.prototype.destroy=function(e){this._parent.destroy(e)};var tf=function(e){if(!(this instanceof tf))return new tf(e);hke.call(this,e),e=e||{},this._offset=0,this._buffer=KVt(),this._missing=0,this._partial=!1,this._onparse=gke,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(d){if(t._locked=!1,d)return t.destroy(d);t._stream||n()},a=function(){t._stream=null;var d=dke(t._header.size);d?t._parse(d,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(dke(t._header.size)),t._parse(512,f),n()},s=function(){var d=t._header.size;t._paxGlobal=pw.decodePax(r.slice(0,d)),r.consume(d),a()},u=function(){var d=t._header.size;t._pax=pw.decodePax(r.slice(0,d)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(d),a()},c=function(){var d=t._header.size;this._gnuLongPath=pw.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},l=function(){var d=t._header.size;this._gnuLongLinkPath=pw.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},f=function(){var d=t._offset,p;try{p=t._header=pw.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(h){t.emit("error",h)}if(r.consume(512),!p){t._parse(512,f),n();return}if(p.type==="gnu-long-path"){t._parse(p.size,c),n();return}if(p.type==="gnu-long-link-path"){t._parse(p.size,l),n();return}if(p.type==="pax-global-header"){t._parse(p.size,s),n();return}if(p.type==="pax-header"){t._parse(p.size,u),n();return}if(t._gnuLongPath&&(p.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(p.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=p=YVt(p,t._pax),t._pax=null),t._locked=!0,!p.size||p.type==="directory"){t._parse(512,f),t.emit("entry",p,$Vt(t,d),i);return}t._stream=new QF(t,d),t.emit("entry",p,t._stream,i),t._parse(p.size,a),n()};this._onheader=f,this._parse(512,f)};pke.inherits(tf,hke);tf.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};tf.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};tf.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=gke,this._overflow?this._write(this._overflow,void 0,e):e()}};tf.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,i=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(i.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),n?n.end(e):i.append(e),this._overflow=o,this._onparse()}};tf.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};vke.exports=tf});var xke=v((UCr,yke)=>{yke.exports=require("fs").constants||require("constants")});var Eke=v((GCr,wke)=>{var JVt=V4(),XVt=function(){},QVt=function(e){return e.setHeader&&typeof e.abort=="function"},ZVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},_ke=function(e,t,r){if(typeof t=="function")return _ke(e,null,t);t||(t={}),r=JVt(r||XVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},d=function(g){r.call(e,g)},p=function(){process.nextTick(h)},h=function(){if(!s){if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},b=function(){e.req.on("finish",c)};return QVt(e)?(e.on("complete",c),e.on("abort",p),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),ZVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",d),e.on("close",p),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",b),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}};wke.exports=_ke});var Dke=v((zCr,Cke)=>{var Xb=xke(),Ake=Eke(),ek=tr(),eKt=Buffer.alloc,Ske=dw().Readable,Qb=dw().Writable,tKt=require("string_decoder").StringDecoder,ZF=mW(),rKt=parseInt("755",8),nKt=parseInt("644",8),Tke=eKt(1024),zW=function(){},GW=function(e,t){t&=511,t&&e.push(Tke.slice(0,512-t))};function iKt(e){switch(e&Xb.S_IFMT){case Xb.S_IFBLK:return"block-device";case Xb.S_IFCHR:return"character-device";case Xb.S_IFDIR:return"directory";case Xb.S_IFIFO:return"fifo";case Xb.S_IFLNK:return"symlink"}return"file"}var tk=function(e){Qb.call(this),this.written=0,this._to=e,this._destroyed=!1};ek(tk,Qb);tk.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};tk.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var rk=function(){Qb.call(this),this.linkname="",this._decoder=new tKt("utf-8"),this._destroyed=!1};ek(rk,Qb);rk.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};rk.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var hw=function(){Qb.call(this),this._destroyed=!1};ek(hw,Qb);hw.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};hw.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Uc=function(e){if(!(this instanceof Uc))return new Uc(e);Ske.call(this,e),this._drain=zW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};ek(Uc,Ske);Uc.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=zW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=iKt(e.mode)),e.mode||(e.mode=e.type==="directory"?rKt:nKt),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var i=this.push(t);return GW(n,e.size),i?process.nextTick(r):this._drain=r,new hw}if(e.type==="symlink"&&!e.linkname){var a=new rk;return Ake(a,function(s){if(s)return n.destroy(),r(s);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new hw;var o=new tk(this);return this._stream=o,Ake(o,function(s){if(n._stream=null,s)return n.destroy(),r(s);if(o.written!==e.size)return n.destroy(),r(new Error("size mismatch"));GW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Uc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Tke),this.push(null))};Uc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Uc.prototype._encode=function(e){if(!e.pax){var t=ZF.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Uc.prototype._encodePax=function(e){var t=ZF.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(ZF.encode(r)),this.push(t),GW(this,t.length),r.size=e.size,r.type=e.type,this.push(ZF.encode(r))};Uc.prototype._read=function(e){var t=this._drain;this._drain=zW,t()};Cke.exports=Uc});var Fke=v(HW=>{HW.extract=bke();HW.pack=Dke()});var Oke=v((WCr,Bke)=>{var aKt=require("zlib"),oKt=Fke(),kke=Bb(),rf=function(e){if(!(this instanceof rf))return new rf(e);e=this.options=kke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=oKt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=aKt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};rf.prototype._onCompressorError=function(e){this.engine.emit("error",e)};rf.prototype.append=function(e,t,r){var n=this;t.mtime=t.date;function i(o,s){if(o){r(o);return}n.engine.entry(t,s,function(u){r(u,t)})}if(t.sourceType==="buffer")i(null,e);else if(t.sourceType==="stream"&&t.stats){t.size=t.stats.size;var a=n.engine.entry(t,function(o){r(o,t)});e.pipe(a)}else t.sourceType==="stream"&&kke.collectStream(e,i)};rf.prototype.finalize=function(){this.engine.finalize()};rf.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};rf.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)};rf.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};Bke.exports=rf});var jke=v((VCr,Rke)=>{var sKt=require("util").inherits,Ike=Wz().Transform,uKt=OH(),Pke=Bb(),xp=function(e){if(!(this instanceof xp))return new xp(e);e=this.options=Pke.defaults(e,{}),Ike.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};sKt(xp,Ike);xp.prototype._transform=function(e,t,r){r(null,e)};xp.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};xp.prototype.append=function(e,t,r){var n=this;t.crc32=0;function i(a,o){if(a){r(a);return}t.size=o.length||0,t.crc32=uKt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&Pke.collectStream(e,i)};xp.prototype.finalize=function(){this._writeStringified(),this.end()};Rke.exports=xp});var Mke=v((KCr,Lke)=>{var cKt=BCe(),mw={},_p=function(e,t){return _p.create(e,t)};_p.create=function(e,t){if(mw[e]){var r=new cKt(e,t);return r.setFormat(e),r.setModule(new mw[e](t)),r}else throw new Error("create("+e+"): format not registered")};_p.registerFormat=function(e,t){if(mw[e])throw new Error("register("+e+"): format already registered");if(typeof t!="function")throw new Error("register("+e+"): format module invalid");if(typeof t.prototype.append!="function"||typeof t.prototype.finalize!="function")throw new Error("register("+e+"): format module missing methods");mw[e]=t};_p.isRegisteredFormat=function(e){return!!mw[e]};_p.registerFormat("zip",cFe());_p.registerFormat("tar",Oke());_p.registerFormat("json",jke());Lke.exports=_p});var RV=typeof process!="object"||String(process)!=="[object process]"||process.browser;var jV={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"]=jV||{};function er(e,t,r){return t<=e&&e<=r}function V5e(e,t){return e.indexOf(t)!==-1}var Yc=Math.floor;function Gw(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function K5e(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;i.push(65536+(s<<10)+u),n+=1}else i.push(65533)}n+=1}return i}function $5e(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function Ko(e){return 0<=e&&e<=127}var Vo=Ko,Fr=-1;function Ik(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Ik.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Fr},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var xn=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Us(e){throw TypeError("The code point "+e+" could not be encoded.")}function Y5e(){}Y5e.prototype={handler:function(e,t){}};function J5e(){}J5e.prototype={handler:function(e,t){}};function Bk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ok,e)?Ok[e]:null}var LV=[{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"}],Ok={};LV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){Ok[r]=t})})});var no={},io={};function U0(e,t){return t&&t[e]||null}function G0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Wa(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 X5e(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Wa("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function Q5e(e){if(e===59335)return 7457;var t=0,r=0,n=Wa("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function Z5e(e){Fk=Fk||Wa("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=Fk;return t.indexOf(e)}var Fk;function eOe(e){kk=kk||Wa("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=kk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):G0(e,t)}var kk,MV="utf-8";function Tp(e,t){if(!(this instanceof Tp))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):MV,t=Gw(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=Bk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!io[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,Boolean(t.fatal)&&(n._error_mode="fatal"),Boolean(t.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(Tp.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Tp.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Tp.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Tp.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=Gw(r),this._do_not_flush||(this._decoder=io[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new Ik(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===xn))break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(i,i.read()),o===xn)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return V5e(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(c.length>0&&c[0]===65279?(this._BOMseen=!0,c.shift()):c.length>0&&(this._BOMseen=!0)),$5e(c)}return u.call(this,a)};function Ay(e,t){if(!(this instanceof Ay))throw TypeError("Called as a function. Did you forget 'new'?");t=Gw(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";var r=this;if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):MV;var n=Bk(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!no[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=Bk("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(Ay.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Ay.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Gw(r),this._do_not_flush||(this._encoder=no[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new Ik(K5e(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===xn))break;Array.isArray(a)?i.push.apply(i,a):i.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(n,n.read()),a!==xn;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function tOe(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(s,u){if(u===Fr&&i!==0)return i=0,Dr(t);if(u===Fr)return xn;if(i===0){if(er(u,0,127))return u;if(er(u,194,223))i=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),i=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),i=3,r=u&7;else return Dr(t);return null}if(!er(u,a,o))return r=i=n=0,a=128,o=191,s.prepend(u),Dr(t);if(a=128,o=191,r=r<<6|u&63,n+=1,n!==i)return null;var c=r;return r=i=n=0,c}}function rOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;var i,a;er(n,128,2047)?(i=1,a=192):er(n,2048,65535)?(i=2,a=224):er(n,65536,1114111)&&(i=3,a=240);for(var o=[(n>>6*i)+a];i>0;){var s=n>>6*(i-1);o.push(128|s&63),i-=1}return o}}no["UTF-8"]=function(e){return new rOe(e)};io["UTF-8"]=function(e){return new tOe(e)};function nOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ko(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function iOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Vo(i))return i;var a=G0(i,e);return a===null&&Us(i),a+128}}(function(){"encoding-indexes"in globalThis&&LV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Wa(r.toLowerCase());io[r]=function(i){return new nOe(n,i)},no[r]=function(i){return new iOe(n,i)}})})})();io.GBK=function(e){return new qV(e)};no.GBK=function(e){return new NV(e,!0)};function qV(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(a,o){if(o===Fr&&r===0&&n===0&&i===0)return xn;o===Fr&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Dr(t));var s;if(i!==0){s=null,er(o,48,57)&&(s=X5e((((r-129)*10+n-48)*126+i-129)*10+o-48));var u=[n,i,o];return r=0,n=0,i=0,s===null?(a.prepend(u),Dr(t)):s}if(n!==0)return er(o,129,254)?(i=o,null):(a.prepend([n,o]),r=0,n=0,Dr(t));if(r!==0){if(er(o,48,57))return n=o,null;var c=r,l=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(l=(c-129)*190+(o-f)),s=l===null?null:U0(l,Wa("gb18030")),s===null&&Ko(o)&&a.prepend(o),s===null?Dr(t):s}return Ko(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function NV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Vo(i))return i;if(i===58853)return Us(i);if(t&&i===8364)return 128;var a=G0(i,Wa("gb18030"));if(a!==null){var o=Yc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Us(i);a=Q5e(i);var c=Yc(a/10/126/10);a=a-c*10*126*10;var l=Yc(a/10/126);a=a-l*10*126;var f=Yc(a/10),d=a-f*10;return[c+129,l+48,f+129,d+48]}}no.gb18030=function(e){return new NV(e)};io.gb18030=function(e){return new qV(e)};function aOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:98;switch((er(i,64,126)||er(i,161,254))&&(o=(a-129)*157+(i-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:U0(o,Wa("big5"));return u===null&&Ko(i)&&n.prepend(i),u===null?Dr(t):u}return Ko(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function oOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;var i=eOe(n);if(i===null)return Us(n);var a=Yc(i/157)+129;if(a<161)return Us(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}no.Big5=function(e){return new oOe(e)};io.Big5=function(e){return new aOe(e)};function sOe(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,a){if(a===Fr&&n!==0)return n=0,Dr(t);if(a===Fr&&n===0)return xn;if(n===142&&er(a,161,223))return n=0,65377-161+a;if(n===143&&er(a,161,254))return r=!0,n=a,null;if(n!==0){var o=n;n=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=U0((o-161)*94+(a-161),Wa(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Ko(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function uOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=G0(n,Wa("jis0208"));if(i===null)return Us(n);var a=Yc(i/94)+161,o=i%94+161;return[a,o]}}no["EUC-JP"]=function(e){return new uOe(e)};io["EUC-JP"]=function(e){return new sOe(e)};function cOe(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(n){default:case r.ASCII:return u===27?(n=r.EscapeStart,null):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Roman:return u===27?(n=r.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===Fr?xn:(o=!1,Dr(t));case r.Katakana:return u===27?(n=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Fr?xn:(o=!1,Dr(t));case r.LeadByte:return u===27?(n=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,n=r.TrailByte,null):u===Fr?xn:(o=!1,Dr(t));case r.TrailByte:if(u===27)return n=r.EscapeStart,Dr(t);if(er(u,33,126)){n=r.LeadByte;var c=(a-33)*94+u-33,l=U0(c,Wa("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var d=null;if(f===40&&u===66&&(d=r.ASCII),f===40&&u===74&&(d=r.Roman),f===40&&u===73&&(d=r.Katakana),f===36&&(u===64||u===66)&&(d=r.LeadByte),d!==null){n=n=d;var p=o;return o=!0,p?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function lOe(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,a){if(a===Fr&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if(a===Fr&&n===r.ASCII)return xn;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return Us(65533);if(n===r.ASCII&&Vo(a))return a;if(n===r.Roman&&(Vo(a)&&a!==92&&a!==126||a==165||a==8254)){if(Vo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Vo(a)&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if((a===165||a===8254)&&n!==r.Roman)return i.prepend(a),n=r.Roman,[27,40,74];a===8722&&(a=65293);var o=G0(a,Wa("jis0208"));if(o===null)return Us(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Yc(o/94)+33,u=o%94+33;return[s,u]}}no["ISO-2022-JP"]=function(e){return new lOe(e)};io["ISO-2022-JP"]=function(e){return new cOe(e)};function fOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:65,u=a<160?129:193;if((er(i,64,126)||er(i,128,252))&&(o=(a-u)*188+i-s),er(o,8836,10715))return 57344-8836+o;var c=o===null?null:U0(o,Wa("jis0208"));return c===null&&Ko(i)&&n.prepend(i),c===null?Dr(t):c}return Ko(i)||i===128?i:er(i,161,223)?65377-161+i:er(i,129,159)||er(i,224,252)?(r=i,null):Dr(t)}}function dOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=Z5e(n);if(i===null)return Us(n);var a=Yc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}no.Shift_JIS=function(e){return new dOe(e)};io.Shift_JIS=function(e){return new fOe(e)};function pOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0,er(i,65,254)&&(o=(a-129)*190+(i-65));var s=o===null?null:U0(o,Wa("euc-kr"));return o===null&&Ko(i)&&n.prepend(i),s===null?Dr(t):s}return Ko(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function hOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;var i=G0(n,Wa("euc-kr"));if(i===null)return Us(n);var a=Yc(i/190)+129,o=i%190+65;return[a,o]}}no["EUC-KR"]=function(e){return new hOe(e)};io["EUC-KR"]=function(e){return new pOe(e)};function Uw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function UV(e,t){var r=t.fatal,n=null,i=null;this.handler=function(a,o){if(o===Fr&&(n!==null||i!==null))return Dr(r);if(o===Fr&&n===null&&i===null)return xn;if(n===null)return n=o,null;var s;if(e?s=(n<<8)+o:s=(o<<8)+n,n=null,i!==null){var u=i;return i=null,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Uw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function GV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Uw(i,e);var a=Uw((i-65536>>10)+55296,e),o=Uw((i-65536&1023)+56320,e);return a.concat(o)}}no["UTF-16BE"]=function(e){return new GV(!0,e)};io["UTF-16BE"]=function(e){return new UV(!0,e)};no["UTF-16LE"]=function(e){return new GV(!1,e)};io["UTF-16LE"]=function(e){return new UV(!1,e)};function mOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ko(n)?n:63360+n-128}}function gOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Vo(n)?n:er(n,63360,63487)?n-63360+128:Us(n)}}no["x-user-defined"]=function(e){return new gOe(e)};io["x-user-defined"]=function(e){return new mOe(e)};function Sy(e){return Buffer.from(e).toString("base64")}function Pk(e){return Buffer.from(e,"base64").toString("ascii")}var jY=Wt(PY(),1),LY=Wt(Iy(),1);function RY(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function kRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,LY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,jY.default)(n,r,t)}function MY(e,t){let r=kRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(RY(a))})})}var vae=Wt(gae(),1),LI=["image/png","image/jpeg","image/gif"];async function MI(e,t){if(!t)throw new Error("MIMEType is required to parse image under Node.js");let r=e instanceof Buffer?e:Buffer.from(e);return await GWe(r,t)}function GWe(e,t){return new Promise(r=>(0,vae.default)(e,t,(n,i)=>{if(n)throw n;let a=[...i.shape],o=i.shape.length===4?i.shape.shift():1,s=i.data instanceof Buffer?new Uint8Array(i.data):i.data;r({shape:a,data:s,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o?[o]:[]})}))}async function Do(e,t,r,n){return n._parse(e,t,r,n)}function Qt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var tc={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},yae=tc.self||tc.window||tc.global||{},xae=tc.window||tc.self||tc.global||{},_ae=tc.global||tc.self||tc.window||{},wae=tc.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var bae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),zWe=bae&&parseFloat(bae[1])||0;function qI(e,t){return Eae(e||{},t)}function Eae(e,t,r=0){if(r>3)return t;let n={...e};for(let[i,a]of Object.entries(t))a&&typeof a=="object"&&!Array.isArray(a)?n[i]=Eae(n[i]||{},t[i],r+1):n[i]=t[i];return n}var Aae="latest";function HWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.1.0-alpha.6"),globalThis._loadersgl_.version}var Wp=HWe();function ga(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var rc={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},rrr=rc.self||rc.window||rc.global||{},nrr=rc.window||rc.self||rc.global||{},irr=rc.global||rc.self||rc.window||{},arr=rc.document||{};var ra=typeof process!="object"||String(process)!=="[object process]"||process.browser,Fx=typeof importScripts=="function",Tae=typeof window<"u"&&typeof window.orientation<"u",Sae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),orr=Sae&&parseFloat(Sae[1])||0;var kx=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){ga(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ga(this.isRunning),this.isRunning=!1,this._reject(t)}};var Vp={};da(Vp,{NodeWorker:()=>Ox,parentPort:()=>WWe});var Bx=Wt(require("worker_threads"),1);Ey(Vp,require("worker_threads"));var WWe=Bx==null?void 0:Bx.parentPort,Ox=Bx.Worker;var NI=new Map;function Cae(e){ga(e.source&&!e.url||!e.source&&e.url);let t=NI.get(e.source||e.url);return t||(e.url&&(t=VWe(e.url),NI.set(e.url,t)),e.source&&(t=Dae(e.source),NI.set(e.source,t))),ga(t),t}function VWe(e){if(!e.startsWith("http"))return e;let t=KWe(e);return Dae(t)}function Dae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function KWe(e){return`try {
|
|
173
|
+
`);return Buffer.from(t)};Vb.decodePax=function(e){for(var t={};e.length;){for(var r=0;r<e.length&&e[r]!==32;)r++;var n=parseInt(e.slice(0,r).toString(),10);if(!n)return t;var i=e.slice(r+1,n-1).toString(),a=i.indexOf("=");if(a===-1)return t;t[i.slice(0,a)]=i.slice(a+1),e=e.slice(n)}return t};Vb.encode=function(e){var t=BHt(512),r=e.name,n="";if(e.typeflag===5&&r[r.length-1]!=="/"&&(r+="/"),Buffer.byteLength(r)!==r.length)return null;for(;Buffer.byteLength(r)>100;){var i=r.indexOf("/");if(i===-1)return null;n+=n?"/"+r.slice(0,i):r.slice(0,i),r=r.slice(i+1)}return Buffer.byteLength(r)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(r),t.write(pp(e.mode&LHt,6),100),t.write(pp(e.uid,6),108),t.write(pp(e.gid,6),116),t.write(pp(e.size,11),124),t.write(pp(e.mtime.getTime()/1e3|0,11),136),t[156]=lFe+NHt(e.type),e.linkname&&t.write(e.linkname,157),fFe.copy(t,rw),PHt.copy(t,hW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(pp(e.devmajor||0,6),329),t.write(pp(e.devminor||0,6),337),n&&t.write(n,345),t.write(pp(pFe(t),6),148),t)};Vb.decode=function(e,t,r){var n=e[156]===0?0:e[156]-lFe,i=Wb(e,0,100,t),a=hp(e,100,8),o=hp(e,108,8),s=hp(e,116,8),u=hp(e,124,12),c=hp(e,136,12),l=qHt(n),f=e[157]===0?null:Wb(e,157,100,t),d=Wb(e,265,32),p=Wb(e,297,32),h=hp(e,329,8),b=hp(e,337,8),g=pFe(e);if(g===8*32)return null;if(g!==hp(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(fFe.compare(e,rw,rw+6)===0)e[345]&&(i=Wb(e,345,155,t)+"/"+i);else if(!(RHt.compare(e,rw,rw+6)===0&&jHt.compare(e,hW,hW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:d,gname:p,devmajor:h,devminor:b}}});var gW=v((ACr,hFe)=>{hFe.exports=require("stream")});var xFe=v((SCr,yFe)=>{"use strict";function mFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function gFe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?mFe(Object(r),!0).forEach(function(n){GHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function GHt(e,t,r){return t=bFe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,bFe(n.key),n)}}function HHt(e,t,r){return t&&vFe(e.prototype,t),r&&vFe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function bFe(e){var t=WHt(e,"string");return typeof t=="symbol"?t:String(t)}function WHt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var VHt=require("buffer"),MF=VHt.Buffer,KHt=require("util"),vW=KHt.inspect,$Ht=vW&&vW.custom||"inspect";function YHt(e,t,r){MF.prototype.copy.call(e,t,r)}yFe.exports=function(){function e(){zHt(this,e),this.head=null,this.tail=null,this.length=0}return HHt(e,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return MF.alloc(0);for(var n=MF.allocUnsafe(r>>>0),i=this.head,a=0;i;)YHt(i.data,n,a),a+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,a=n.data;for(r-=a.length;n=n.next;){var o=n.data,s=r>o.length?o.length:r;if(s===o.length?a+=o:a+=o.slice(0,r),r-=s,r===0){s===o.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(s));break}++i}return this.length-=i,a}},{key:"_getBuffer",value:function(r){var n=MF.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:$Ht,value:function(r,n){return vW(this,gFe(gFe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var yW=v((TCr,wFe)=>{"use strict";function JHt(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(bW,this,e)):process.nextTick(bW,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(a){!t&&a?r._writableState?r._writableState.errorEmitted?process.nextTick(qF,r):(r._writableState.errorEmitted=!0,process.nextTick(_Fe,r,a)):process.nextTick(_Fe,r,a):t?(process.nextTick(qF,r),t(a)):process.nextTick(qF,r)}),this)}function _Fe(e,t){bW(e,t),qF(e)}function qF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function XHt(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function bW(e,t){e.emit("error",t)}function QHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}wFe.exports={destroy:JHt,undestroy:XHt,errorOrDestroy:QHt}});var mp=v((CCr,SFe)=>{"use strict";var AFe={};function js(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,AFe[e]=i}function EFe(e,t){if(Array.isArray(e)){let r=e.length;return e=e.map(n=>String(n)),r>2?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:r===2?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}else return`of ${t} ${String(e)}`}function ZHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function eWt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function tWt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}js("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);js("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&ZHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(eWt(e," argument"))i=`The ${e} ${n} ${EFe(t,"type")}`;else{let a=tWt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${EFe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);js("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");js("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});js("ERR_STREAM_PREMATURE_CLOSE","Premature close");js("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});js("ERR_MULTIPLE_CALLBACK","Callback called multiple times");js("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");js("ERR_STREAM_WRITE_AFTER_END","write after end");js("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);js("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);js("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");SFe.exports.codes=AFe});var xW=v((DCr,TFe)=>{"use strict";var rWt=mp().codes.ERR_INVALID_OPT_VALUE;function nWt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function iWt(e,t,r,n){var i=nWt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new rWt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}TFe.exports={getHighWaterMark:iWt}});var EW=v((FCr,OFe)=>{"use strict";OFe.exports=li;function DFe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){BWt(t,e)}}var Kb;li.WritableState=iw;var aWt={deprecate:mh()},FFe=gW(),UF=require("buffer").Buffer,oWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function sWt(e){return UF.from(e)}function uWt(e){return UF.isBuffer(e)||e instanceof oWt}var wW=yW(),cWt=xW(),lWt=cWt.getHighWaterMark,gp=mp().codes,fWt=gp.ERR_INVALID_ARG_TYPE,dWt=gp.ERR_METHOD_NOT_IMPLEMENTED,pWt=gp.ERR_MULTIPLE_CALLBACK,hWt=gp.ERR_STREAM_CANNOT_PIPE,mWt=gp.ERR_STREAM_DESTROYED,gWt=gp.ERR_STREAM_NULL_VALUES,vWt=gp.ERR_STREAM_WRITE_AFTER_END,bWt=gp.ERR_UNKNOWN_ENCODING,$b=wW.errorOrDestroy;tr()(li,FFe);function yWt(){}function iw(e,t,r){Kb=Kb||T0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Kb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=lWt(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=e.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){TWt(t,i)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new DFe(this)}iw.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(iw.prototype,"buffer",{get:aWt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var NF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(NF=Function.prototype[Symbol.hasInstance],Object.defineProperty(li,Symbol.hasInstance,{value:function(t){return NF.call(this,t)?!0:this!==li?!1:t&&t._writableState instanceof iw}})):NF=function(t){return t instanceof this};function li(e){Kb=Kb||T0();var t=this instanceof Kb;if(!t&&!NF.call(li,this))return new li(e);this._writableState=new iw(e,this,t),this.writable=!0,e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final)),FFe.call(this)}li.prototype.pipe=function(){$b(this,new hWt)};function xWt(e,t){var r=new vWt;$b(e,r),process.nextTick(t,r)}function _Wt(e,t,r,n){var i;return r===null?i=new gWt:typeof r!="string"&&!t.objectMode&&(i=new fWt("chunk",["string","Buffer"],r)),i?($b(e,i),process.nextTick(n,i),!1):!0}li.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&uWt(e);return a&&!UF.isBuffer(e)&&(e=sWt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=yWt),n.ending?xWt(this,r):(a||_Wt(this,n,e,r))&&(n.pendingcb++,i=EWt(this,n,a,e,t,r)),i};li.prototype.cork=function(){this._writableState.corked++};li.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&kFe(this,e))};li.prototype.setDefaultEncoding=function(t){if(typeof t=="string"&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new bWt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(li.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function wWt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=UF.from(t,r)),t}Object.defineProperty(li.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function EWt(e,t,r,n,i,a){if(!r){var o=wWt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else _W(e,t,!1,s,n,i,a);return u}function _W(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new mWt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function AWt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(nw,e,t),e._writableState.errorEmitted=!0,$b(e,n)):(i(n),e._writableState.errorEmitted=!0,$b(e,n),nw(e,t))}function SWt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function TWt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new pWt;if(SWt(r),t)AWt(e,r,n,t,i);else{var a=BFe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&kFe(e,r),n?process.nextTick(CFe,e,r,a,i):CFe(e,r,a,i)}}function CFe(e,t,r,n){r||CWt(e,t),t.pendingcb--,n(),nw(e,t)}function CWt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function kFe(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),a=t.corkedRequestsFree;a.entry=r;for(var o=0,s=!0;r;)i[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;i.allBuffers=s,_W(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new DFe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(_W(e,t,!1,f,u,c,l),r=r.next,t.bufferedRequestCount--,t.writing)break}r===null&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}li.prototype._write=function(e,t,r){r(new dWt("_write()"))};li.prototype._writev=null;li.prototype.end=function(e,t,r){var n=this._writableState;return typeof e=="function"?(r=e,e=null,t=null):typeof t=="function"&&(r=t,t=null),e!=null&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||kWt(this,n,r),this};Object.defineProperty(li.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function BFe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function DWt(e,t){e._final(function(r){t.pendingcb--,r&&$b(e,r),t.prefinished=!0,e.emit("prefinish"),nw(e,t)})}function FWt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(DWt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function nw(e,t){var r=BFe(t);if(r&&(FWt(e,t),t.pendingcb===0&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function kWt(e,t,r){t.ending=!0,nw(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function BWt(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(li.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});li.prototype.destroy=wW.destroy;li.prototype._undestroy=wW.undestroy;li.prototype._destroy=function(e,t){t(e)}});var T0=v((kCr,PFe)=>{"use strict";var OWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};PFe.exports=Nc;var IFe=TW(),SW=EW();tr()(Nc,IFe);for(AW=OWt(SW.prototype),GF=0;GF<AW.length;GF++)zF=AW[GF],Nc.prototype[zF]||(Nc.prototype[zF]=SW.prototype[zF]);var AW,zF,GF;function Nc(e){if(!(this instanceof Nc))return new Nc(e);IFe.call(this,e),SW.call(this,e),this.allowHalfOpen=!0,e&&(e.readable===!1&&(this.readable=!1),e.writable===!1&&(this.writable=!1),e.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",IWt)))}Object.defineProperty(Nc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Nc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Nc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function IWt(){this._writableState.ended||process.nextTick(PWt,this)}function PWt(e){e.end()}Object.defineProperty(Nc.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(t){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=t,this._writableState.destroyed=t)}})});var FW=v(jFe=>{"use strict";var DW=Hs().Buffer,RFe=DW.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function RWt(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function jWt(e){var t=RWt(e);if(typeof t!="string"&&(DW.isEncoding===RFe||!RFe(e)))throw new Error("Unknown encoding: "+e);return t||e}jFe.StringDecoder=aw;function aw(e){this.encoding=jWt(e);var t;switch(this.encoding){case"utf16le":this.text=GWt,this.end=zWt,t=4;break;case"utf8":this.fillLast=qWt,t=4;break;case"base64":this.text=HWt,this.end=WWt,t=3;break;default:this.write=VWt,this.end=KWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=DW.allocUnsafe(t)}aw.prototype.write=function(e){if(e.length===0)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""};aw.prototype.end=UWt;aw.prototype.text=NWt;aw.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function CW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function LWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=CW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=CW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=CW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function MWt(e,t,r){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}function qWt(e){var t=this.lastTotal-this.lastNeed,r=MWt(this,e,t);if(r!==void 0)return r;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function NWt(e,t){var r=LWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function UWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function GWt(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function zWt(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function HWt(e,t){var r=(e.length-t)%3;return r===0?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function WWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function VWt(e){return e.toString(this.encoding)}function KWt(e){return e&&e.length?this.write(e):""}});var HF=v((OCr,qFe)=>{"use strict";var LFe=mp().codes.ERR_STREAM_PREMATURE_CLOSE;function $Wt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function YWt(){}function JWt(e){return e.setHeader&&typeof e.abort=="function"}function MFe(e,t,r){if(typeof t=="function")return MFe(e,null,t);t||(t={}),r=$Wt(r||YWt);var n=t.readable||t.readable!==!1&&e.readable,i=t.writable||t.writable!==!1&&e.writable,a=function(){e.writable||s()},o=e._writableState&&e._writableState.finished,s=function(){i=!1,o=!0,n||r.call(e)},u=e._readableState&&e._readableState.endEmitted,c=function(){n=!1,u=!0,i||r.call(e)},l=function(h){r.call(e,h)},f=function(){var h;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(h=new LFe),r.call(e,h);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(h=new LFe),r.call(e,h)},d=function(){e.req.on("finish",s)};return JWt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}qFe.exports=MFe});var UFe=v((ICr,NFe)=>{"use strict";var WF;function vp(e,t,r){return t=XWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XWt(e){var t=QWt(e,"string");return typeof t=="symbol"?t:String(t)}function QWt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ZWt=HF(),bp=Symbol("lastResolve"),C0=Symbol("lastReject"),ow=Symbol("error"),VF=Symbol("ended"),D0=Symbol("lastPromise"),kW=Symbol("handlePromise"),F0=Symbol("stream");function yp(e,t){return{value:e,done:t}}function eVt(e){var t=e[bp];if(t!==null){var r=e[F0].read();r!==null&&(e[D0]=null,e[bp]=null,e[C0]=null,t(yp(r,!1)))}}function tVt(e){process.nextTick(eVt,e)}function rVt(e,t){return function(r,n){e.then(function(){if(t[VF]){r(yp(void 0,!0));return}t[kW](r,n)},n)}}var nVt=Object.getPrototypeOf(function(){}),iVt=Object.setPrototypeOf((WF={get stream(){return this[F0]},next:function(){var t=this,r=this[ow];if(r!==null)return Promise.reject(r);if(this[VF])return Promise.resolve(yp(void 0,!0));if(this[F0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[ow]?s(t[ow]):o(yp(void 0,!0))})});var n=this[D0],i;if(n)i=new Promise(rVt(n,this));else{var a=this[F0].read();if(a!==null)return Promise.resolve(yp(a,!1));i=new Promise(this[kW])}return this[D0]=i,i}},vp(WF,Symbol.asyncIterator,function(){return this}),vp(WF,"return",function(){var t=this;return new Promise(function(r,n){t[F0].destroy(null,function(i){if(i){n(i);return}r(yp(void 0,!0))})})}),WF),nVt),aVt=function(t){var r,n=Object.create(iVt,(r={},vp(r,F0,{value:t,writable:!0}),vp(r,bp,{value:null,writable:!0}),vp(r,C0,{value:null,writable:!0}),vp(r,ow,{value:null,writable:!0}),vp(r,VF,{value:t._readableState.endEmitted,writable:!0}),vp(r,kW,{value:function(a,o){var s=n[F0].read();s?(n[D0]=null,n[bp]=null,n[C0]=null,a(yp(s,!1))):(n[bp]=a,n[C0]=o)},writable:!0}),r));return n[D0]=null,ZWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[C0];a!==null&&(n[D0]=null,n[bp]=null,n[C0]=null,a(i)),n[ow]=i;return}var o=n[bp];o!==null&&(n[D0]=null,n[bp]=null,n[C0]=null,o(yp(void 0,!0))),n[VF]=!0}),t.on("readable",tVt.bind(null,n)),n};NFe.exports=aVt});var WFe=v((PCr,HFe)=>{"use strict";function GFe(e,t,r,n,i,a,o){try{var s=e[a](o),u=s.value}catch(c){r(c);return}s.done?t(u):Promise.resolve(u).then(n,i)}function oVt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){GFe(a,n,i,o,s,"next",u)}function s(u){GFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function zFe(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function sVt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?zFe(Object(r),!0).forEach(function(n){uVt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function uVt(e,t,r){return t=cVt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cVt(e){var t=lVt(e,"string");return typeof t=="symbol"?t:String(t)}function lVt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fVt=mp().codes.ERR_INVALID_ARG_TYPE;function dVt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new fVt("iterable",["Iterable"],t);var i=new e(sVt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=oVt(function*(){try{var u=yield n.next(),c=u.value,l=u.done;l?i.push(null):i.push(yield c)?o():a=!1}catch(f){i.destroy(f)}}),s.apply(this,arguments)}return i}HFe.exports=dVt});var TW=v((jCr,tke)=>{"use strict";tke.exports=zr;var Yb;zr.ReadableState=YFe;var RCr=require("events").EventEmitter,$Fe=function(t,r){return t.listeners(r).length},uw=gW(),KF=require("buffer").Buffer,pVt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hVt(e){return KF.from(e)}function mVt(e){return KF.isBuffer(e)||e instanceof pVt}var BW=require("util"),xr;BW&&BW.debuglog?xr=BW.debuglog("stream"):xr=function(){};var gVt=xFe(),MW=yW(),vVt=xW(),bVt=vVt.getHighWaterMark,$F=mp().codes,yVt=$F.ERR_INVALID_ARG_TYPE,xVt=$F.ERR_STREAM_PUSH_AFTER_EOF,_Vt=$F.ERR_METHOD_NOT_IMPLEMENTED,wVt=$F.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Jb,OW,IW;tr()(zr,uw);var sw=MW.errorOrDestroy,PW=["error","close","destroy","pause","resume"];function EVt(e,t,r){if(typeof e.prependListener=="function")return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}function YFe(e,t,r){Yb=Yb||T0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Yb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=bVt(this,e,"readableHighWaterMark",r),this.buffer=new gVt,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=e.emitClose!==!1,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(Jb||(Jb=FW().StringDecoder),this.decoder=new Jb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Yb=Yb||T0(),!(this instanceof zr))return new zr(e);var t=this instanceof Yb;this._readableState=new YFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),uw.call(this)}Object.defineProperty(zr.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}});zr.prototype.destroy=MW.destroy;zr.prototype._undestroy=MW.undestroy;zr.prototype._destroy=function(e,t){t(e)};zr.prototype.push=function(e,t){var r=this._readableState,n;return r.objectMode?n=!0:typeof e=="string"&&(t=t||r.defaultEncoding,t!==r.encoding&&(e=KF.from(e,t),t=""),n=!0),JFe(this,e,t,!1,n)};zr.prototype.unshift=function(e){return JFe(this,e,null,!0,!1)};function JFe(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,TVt(e,a);else{var o;if(i||(o=AVt(a,t)),o)sw(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==KF.prototype&&(t=hVt(t)),n)a.endEmitted?sw(e,new wVt):RW(e,a,t,!0);else if(a.ended)sw(e,new xVt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?RW(e,a,t,!1):LW(e,a)):RW(e,a,t,!1)}else n||(a.reading=!1,LW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function RW(e,t,r,n){t.flowing&&t.length===0&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&YF(e)),LW(e,t)}function AVt(e,t){var r;return!mVt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new yVt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Jb||(Jb=FW().StringDecoder);var t=new Jb(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var VFe=1073741824;function SVt(e){return e>=VFe?e=VFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function KFe(e,t){return e<=0||t.length===0&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=SVt(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}zr.prototype.read=function(e){xr("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(e!==0&&(t.emittedReadable=!1),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return xr("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?jW(this):YF(this),null;if(e=KFe(e,t),e===0&&t.ended)return t.length===0&&jW(this),null;var n=t.needReadable;xr("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,xr("length less than watermark",n)),t.ended||t.reading?(n=!1,xr("reading or ended",n)):n&&(xr("do read"),t.reading=!0,t.sync=!0,t.length===0&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=KFe(r,t)));var i;return e>0?i=ZFe(e,t):i=null,i===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),t.length===0&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&jW(this)),i!==null&&this.emit("data",i),i};function TVt(e,t){if(xr("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?YF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,XFe(e)))}}function YF(e){var t=e._readableState;xr("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(xr("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(XFe,e))}function XFe(e){var t=e._readableState;xr("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,qW(e)}function LW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(CVt,e,t))}function CVt(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){var r=t.length;if(xr("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}zr.prototype._read=function(e){sw(this,new _Vt("_read()"))};zr.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,xr("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){xr("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){xr("onend"),e.end()}var u=DVt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",p),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&eke(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){xr("onerror",g),b(),e.removeListener("error",d),$Fe(e,"error")===0&&sw(e,g)}EVt(e,"error",d);function p(){e.removeListener("finish",h),b()}e.once("close",p);function h(){xr("onfinish"),e.removeListener("close",p),b()}e.once("finish",h);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function DVt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&$Fe(e,"data")&&(r.flowing=!0,qW(e))}}zr.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(t.pipesCount===0)return this;if(t.pipesCount===1)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a<i;a++)n[a].emit("unpipe",this,{hasUnpiped:!1});return this}var o=eke(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,t.pipesCount===1&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r),this)};zr.prototype.on=function(e,t){var r=uw.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,xr("on readable",n.length,n.reading),n.length?YF(this):n.reading||process.nextTick(FVt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=uw.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(QFe,this),r};zr.prototype.removeAllListeners=function(e){var t=uw.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(QFe,this),t};function QFe(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function FVt(e){xr("readable nexttick read 0"),e.read(0)}zr.prototype.resume=function(){var e=this._readableState;return e.flowing||(xr("resume"),e.flowing=!e.readableListening,kVt(this,e)),e.paused=!1,this};function kVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(BVt,e,t))}function BVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),qW(e),t.flowing&&!t.reading&&e.read(0)}zr.prototype.pause=function(){return xr("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(xr("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function qW(e){var t=e._readableState;for(xr("flow",t.flowing);t.flowing&&e.read()!==null;);}zr.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;e.on("end",function(){if(xr("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&t.push(o)}t.push(null)}),e.on("data",function(o){if(xr("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var s=t.push(o);s||(n=!0,e.pause())}});for(var i in e)this[i]===void 0&&typeof e[i]=="function"&&(this[i]=function(s){return function(){return e[s].apply(e,arguments)}}(i));for(var a=0;a<PW.length;a++)e.on(PW[a],this.emit.bind(this,PW[a]));return this._read=function(o){xr("wrapped _read",o),n&&(n=!1,e.resume())},this};typeof Symbol=="function"&&(zr.prototype[Symbol.asyncIterator]=function(){return OW===void 0&&(OW=UFe()),OW(this)});Object.defineProperty(zr.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(zr.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(zr.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}});zr._fromList=ZFe;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function ZFe(e,t){if(t.length===0)return null;var r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(t.decoder?r=t.buffer.join(""):t.buffer.length===1?r=t.buffer.first():r=t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function jW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(OVt,t,e))}function OVt(e,t){if(xr("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(zr.from=function(e,t){return IW===void 0&&(IW=WFe()),IW(zr,e,t)});function eke(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var NW=v((LCr,nke)=>{"use strict";nke.exports=ef;var JF=mp().codes,IVt=JF.ERR_METHOD_NOT_IMPLEMENTED,PVt=JF.ERR_MULTIPLE_CALLBACK,RVt=JF.ERR_TRANSFORM_ALREADY_TRANSFORMING,jVt=JF.ERR_TRANSFORM_WITH_LENGTH_0,XF=T0();tr()(ef,XF);function LVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new PVt);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function ef(e){if(!(this instanceof ef))return new ef(e);XF.call(this,e),this._transformState={afterTransform:LVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",MVt)}function MVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){rke(e,t,r)}):rke(this,null,null)}ef.prototype.push=function(e,t){return this._transformState.needTransform=!1,XF.prototype.push.call(this,e,t)};ef.prototype._transform=function(e,t,r){r(new IVt("_transform()"))};ef.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};ef.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};ef.prototype._destroy=function(e,t){XF.prototype._destroy.call(this,e,function(r){t(r)})};function rke(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new jVt;if(e._transformState.transforming)throw new RVt;return e.push(null)}});var oke=v((MCr,ake)=>{"use strict";ake.exports=cw;var ike=NW();tr()(cw,ike);function cw(e){if(!(this instanceof cw))return new cw(e);ike.call(this,e)}cw.prototype._transform=function(e,t,r){r(null,e)}});var fke=v((qCr,lke)=>{"use strict";var UW;function qVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var cke=mp().codes,NVt=cke.ERR_MISSING_ARGS,UVt=cke.ERR_STREAM_DESTROYED;function ske(e){if(e)throw e}function GVt(e){return e.setHeader&&typeof e.abort=="function"}function zVt(e,t,r,n){n=qVt(n);var i=!1;e.on("close",function(){i=!0}),UW===void 0&&(UW=HF()),UW(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,GVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new UVt("pipe"))}}}function uke(e){e()}function HVt(e,t){return e.pipe(t)}function WVt(e){return!e.length||typeof e[e.length-1]!="function"?ske:e.pop()}function VVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=WVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new NVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return zVt(o,u,c,function(l){i||(i=l),l&&a.forEach(uke),!u&&(a.forEach(uke),n(i))})});return t.reduce(HVt)}lke.exports=VVt});var dw=v((Ls,fw)=>{var lw=require("stream");process.env.READABLE_STREAM==="disable"&&lw?(fw.exports=lw.Readable,Object.assign(fw.exports,lw),fw.exports.Stream=lw):(Ls=fw.exports=TW(),Ls.Stream=lw||Ls,Ls.Readable=Ls,Ls.Writable=EW(),Ls.Duplex=T0(),Ls.Transform=NW(),Ls.PassThrough=oke(),Ls.finished=HF(),Ls.pipeline=fke())});var bke=v((NCr,vke)=>{var pke=require("util"),KVt=UL(),pw=mW(),hke=dw().Writable,mke=dw().PassThrough,gke=function(){},dke=function(e){return e&=511,e&&512-e},$Vt=function(e,t){var r=new QF(e,t);return r.end(),r},YVt=function(e,t){return t.path&&(e.name=t.path),t.linkpath&&(e.linkname=t.linkpath),t.size&&(e.size=parseInt(t.size,10)),e.pax=t,e},QF=function(e,t){this._parent=e,this.offset=t,mke.call(this,{autoDestroy:!1})};pke.inherits(QF,mke);QF.prototype.destroy=function(e){this._parent.destroy(e)};var tf=function(e){if(!(this instanceof tf))return new tf(e);hke.call(this,e),e=e||{},this._offset=0,this._buffer=KVt(),this._missing=0,this._partial=!1,this._onparse=gke,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(d){if(t._locked=!1,d)return t.destroy(d);t._stream||n()},a=function(){t._stream=null;var d=dke(t._header.size);d?t._parse(d,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(dke(t._header.size)),t._parse(512,f),n()},s=function(){var d=t._header.size;t._paxGlobal=pw.decodePax(r.slice(0,d)),r.consume(d),a()},u=function(){var d=t._header.size;t._pax=pw.decodePax(r.slice(0,d)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(d),a()},c=function(){var d=t._header.size;this._gnuLongPath=pw.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},l=function(){var d=t._header.size;this._gnuLongLinkPath=pw.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},f=function(){var d=t._offset,p;try{p=t._header=pw.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(h){t.emit("error",h)}if(r.consume(512),!p){t._parse(512,f),n();return}if(p.type==="gnu-long-path"){t._parse(p.size,c),n();return}if(p.type==="gnu-long-link-path"){t._parse(p.size,l),n();return}if(p.type==="pax-global-header"){t._parse(p.size,s),n();return}if(p.type==="pax-header"){t._parse(p.size,u),n();return}if(t._gnuLongPath&&(p.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(p.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=p=YVt(p,t._pax),t._pax=null),t._locked=!0,!p.size||p.type==="directory"){t._parse(512,f),t.emit("entry",p,$Vt(t,d),i);return}t._stream=new QF(t,d),t.emit("entry",p,t._stream,i),t._parse(p.size,a),n()};this._onheader=f,this._parse(512,f)};pke.inherits(tf,hke);tf.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};tf.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};tf.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=gke,this._overflow?this._write(this._overflow,void 0,e):e()}};tf.prototype._write=function(e,t,r){if(!this._destroyed){var n=this._stream,i=this._buffer,a=this._missing;if(e.length&&(this._partial=!0),e.length<a)return this._missing-=e.length,this._overflow=null,n?n.write(e,r):(i.append(e),r());this._cb=r,this._missing=0;var o=null;e.length>a&&(o=e.slice(a),e=e.slice(0,a)),n?n.end(e):i.append(e),this._overflow=o,this._onparse()}};tf.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};vke.exports=tf});var xke=v((UCr,yke)=>{yke.exports=require("fs").constants||require("constants")});var Eke=v((GCr,wke)=>{var JVt=V4(),XVt=function(){},QVt=function(e){return e.setHeader&&typeof e.abort=="function"},ZVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},_ke=function(e,t,r){if(typeof t=="function")return _ke(e,null,t);t||(t={}),r=JVt(r||XVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},d=function(g){r.call(e,g)},p=function(){process.nextTick(h)},h=function(){if(!s){if(a&&!(i&&i.ended&&!i.destroyed))return r.call(e,new Error("premature close"));if(o&&!(n&&n.ended&&!n.destroyed))return r.call(e,new Error("premature close"))}},b=function(){e.req.on("finish",c)};return QVt(e)?(e.on("complete",c),e.on("abort",p),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),ZVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",d),e.on("close",p),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",p),e.removeListener("request",b),e.req&&e.req.removeListener("finish",c),e.removeListener("end",u),e.removeListener("close",u),e.removeListener("finish",c),e.removeListener("exit",f),e.removeListener("end",l),e.removeListener("error",d),e.removeListener("close",p)}};wke.exports=_ke});var Dke=v((zCr,Cke)=>{var Xb=xke(),Ake=Eke(),ek=tr(),eKt=Buffer.alloc,Ske=dw().Readable,Qb=dw().Writable,tKt=require("string_decoder").StringDecoder,ZF=mW(),rKt=parseInt("755",8),nKt=parseInt("644",8),Tke=eKt(1024),zW=function(){},GW=function(e,t){t&=511,t&&e.push(Tke.slice(0,512-t))};function iKt(e){switch(e&Xb.S_IFMT){case Xb.S_IFBLK:return"block-device";case Xb.S_IFCHR:return"character-device";case Xb.S_IFDIR:return"directory";case Xb.S_IFIFO:return"fifo";case Xb.S_IFLNK:return"symlink"}return"file"}var tk=function(e){Qb.call(this),this.written=0,this._to=e,this._destroyed=!1};ek(tk,Qb);tk.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};tk.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var rk=function(){Qb.call(this),this.linkname="",this._decoder=new tKt("utf-8"),this._destroyed=!1};ek(rk,Qb);rk.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};rk.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var hw=function(){Qb.call(this),this._destroyed=!1};ek(hw,Qb);hw.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};hw.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Uc=function(e){if(!(this instanceof Uc))return new Uc(e);Ske.call(this,e),this._drain=zW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};ek(Uc,Ske);Uc.prototype.entry=function(e,t,r){if(this._stream)throw new Error("already piping an entry");if(!(this._finalized||this._destroyed)){typeof t=="function"&&(r=t,t=null),r||(r=zW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=iKt(e.mode)),e.mode||(e.mode=e.type==="directory"?rKt:nKt),e.uid||(e.uid=0),e.gid||(e.gid=0),e.mtime||(e.mtime=new Date),typeof t=="string"&&(t=Buffer.from(t)),Buffer.isBuffer(t)){e.size=t.length,this._encode(e);var i=this.push(t);return GW(n,e.size),i?process.nextTick(r):this._drain=r,new hw}if(e.type==="symlink"&&!e.linkname){var a=new rk;return Ake(a,function(s){if(s)return n.destroy(),r(s);e.linkname=a.linkname,n._encode(e),r()}),a}if(this._encode(e),e.type!=="file"&&e.type!=="contiguous-file")return process.nextTick(r),new hw;var o=new tk(this);return this._stream=o,Ake(o,function(s){if(n._stream=null,s)return n.destroy(),r(s);if(o.written!==e.size)return n.destroy(),r(new Error("size mismatch"));GW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Uc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(Tke),this.push(null))};Uc.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.destroy&&this._stream.destroy())};Uc.prototype._encode=function(e){if(!e.pax){var t=ZF.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Uc.prototype._encodePax=function(e){var t=ZF.encodePax({name:e.name,linkname:e.linkname,pax:e.pax}),r={name:"PaxHeader",mode:e.mode,uid:e.uid,gid:e.gid,size:t.length,mtime:e.mtime,type:"pax-header",linkname:e.linkname&&"PaxHeader",uname:e.uname,gname:e.gname,devmajor:e.devmajor,devminor:e.devminor};this.push(ZF.encode(r)),this.push(t),GW(this,t.length),r.size=e.size,r.type=e.type,this.push(ZF.encode(r))};Uc.prototype._read=function(e){var t=this._drain;this._drain=zW,t()};Cke.exports=Uc});var Fke=v(HW=>{HW.extract=bke();HW.pack=Dke()});var Oke=v((WCr,Bke)=>{var aKt=require("zlib"),oKt=Fke(),kke=Bb(),rf=function(e){if(!(this instanceof rf))return new rf(e);e=this.options=kke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=oKt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=aKt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};rf.prototype._onCompressorError=function(e){this.engine.emit("error",e)};rf.prototype.append=function(e,t,r){var n=this;t.mtime=t.date;function i(o,s){if(o){r(o);return}n.engine.entry(t,s,function(u){r(u,t)})}if(t.sourceType==="buffer")i(null,e);else if(t.sourceType==="stream"&&t.stats){t.size=t.stats.size;var a=n.engine.entry(t,function(o){r(o,t)});e.pipe(a)}else t.sourceType==="stream"&&kke.collectStream(e,i)};rf.prototype.finalize=function(){this.engine.finalize()};rf.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};rf.prototype.pipe=function(e,t){return this.compressor?this.engine.pipe.apply(this.engine,[this.compressor]).pipe(e,t):this.engine.pipe.apply(this.engine,arguments)};rf.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};Bke.exports=rf});var jke=v((VCr,Rke)=>{var sKt=require("util").inherits,Ike=Wz().Transform,uKt=OH(),Pke=Bb(),xp=function(e){if(!(this instanceof xp))return new xp(e);e=this.options=Pke.defaults(e,{}),Ike.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};sKt(xp,Ike);xp.prototype._transform=function(e,t,r){r(null,e)};xp.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};xp.prototype.append=function(e,t,r){var n=this;t.crc32=0;function i(a,o){if(a){r(a);return}t.size=o.length||0,t.crc32=uKt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&Pke.collectStream(e,i)};xp.prototype.finalize=function(){this._writeStringified(),this.end()};Rke.exports=xp});var Mke=v((KCr,Lke)=>{var cKt=BCe(),mw={},_p=function(e,t){return _p.create(e,t)};_p.create=function(e,t){if(mw[e]){var r=new cKt(e,t);return r.setFormat(e),r.setModule(new mw[e](t)),r}else throw new Error("create("+e+"): format not registered")};_p.registerFormat=function(e,t){if(mw[e])throw new Error("register("+e+"): format already registered");if(typeof t!="function")throw new Error("register("+e+"): format module invalid");if(typeof t.prototype.append!="function"||typeof t.prototype.finalize!="function")throw new Error("register("+e+"): format module missing methods");mw[e]=t};_p.isRegisteredFormat=function(e){return!!mw[e]};_p.registerFormat("zip",cFe());_p.registerFormat("tar",Oke());_p.registerFormat("json",jke());Lke.exports=_p});var RV=typeof process!="object"||String(process)!=="[object process]"||process.browser;var jV={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"]=jV||{};function er(e,t,r){return t<=e&&e<=r}function V5e(e,t){return e.indexOf(t)!==-1}var Yc=Math.floor;function Gw(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function K5e(e){for(var t=String(e),r=t.length,n=0,i=[];n<r;){var a=t.charCodeAt(n);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319)if(n===r-1)i.push(65533);else{var o=t.charCodeAt(n+1);if(56320<=o&&o<=57343){var s=a&1023,u=o&1023;i.push(65536+(s<<10)+u),n+=1}else i.push(65533)}n+=1}return i}function $5e(e){for(var t="",r=0;r<e.length;++r){var n=e[r];n<=65535?t+=String.fromCharCode(n):(n-=65536,t+=String.fromCharCode((n>>10)+55296,(n&1023)+56320))}return t}function Ko(e){return 0<=e&&e<=127}var Vo=Ko,Fr=-1;function Ik(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Ik.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():Fr},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.pop());else this.tokens.push(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.shift());else this.tokens.unshift(e)}};var xn=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Us(e){throw TypeError("The code point "+e+" could not be encoded.")}function Y5e(){}Y5e.prototype={handler:function(e,t){}};function J5e(){}J5e.prototype={handler:function(e,t){}};function Bk(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ok,e)?Ok[e]:null}var LV=[{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"}],Ok={};LV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){Ok[r]=t})})});var no={},io={};function U0(e,t){return t&&t[e]||null}function G0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Wa(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 X5e(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Wa("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[0]<=e)t=a[0],r=a[1];else break}return r+e-t}function Q5e(e){if(e===59335)return 7457;var t=0,r=0,n=Wa("gb18030-ranges"),i;for(i=0;i<n.length;++i){var a=n[i];if(a[1]<=e)t=a[1],r=a[0];else break}return r+e-t}function Z5e(e){Fk=Fk||Wa("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=Fk;return t.indexOf(e)}var Fk;function eOe(e){kk=kk||Wa("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=kk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):G0(e,t)}var kk,MV="utf-8";function Tp(e,t){if(!(this instanceof Tp))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):MV,t=Gw(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=Bk(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!io[r.name])throw Error("Decoder not present. Did you forget to include encoding-indexes.js first?");var n=this;return n._encoding=r,Boolean(t.fatal)&&(n._error_mode="fatal"),Boolean(t.ignoreBOM)&&(n._ignoreBOM=!0),Object.defineProperty||(this.encoding=n._encoding.name.toLowerCase(),this.fatal=n._error_mode==="fatal",this.ignoreBOM=n._ignoreBOM),n}Object.defineProperty&&(Object.defineProperty(Tp.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Tp.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Tp.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Tp.prototype.decode=function(t,r){var n;typeof t=="object"&&t instanceof ArrayBuffer?n=new Uint8Array(t):typeof t=="object"&&"buffer"in t&&t.buffer instanceof ArrayBuffer?n=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):n=new Uint8Array(0),r=Gw(r),this._do_not_flush||(this._decoder=io[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new Ik(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===xn))break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}if(!this._do_not_flush){do{if(o=this._decoder.handler(i,i.read()),o===xn)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return V5e(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)&&!this._ignoreBOM&&!this._BOMseen&&(c.length>0&&c[0]===65279?(this._BOMseen=!0,c.shift()):c.length>0&&(this._BOMseen=!0)),$5e(c)}return u.call(this,a)};function Ay(e,t){if(!(this instanceof Ay))throw TypeError("Called as a function. Did you forget 'new'?");t=Gw(t),this._encoding=null,this._encoder=null,this._do_not_flush=!1,this._fatal=Boolean(t.fatal)?"fatal":"replacement";var r=this;if(Boolean(t.NONSTANDARD_allowLegacyEncoding)){e=e!==void 0?String(e):MV;var n=Bk(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!no[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=Bk("utf-8"),e!==void 0&&"console"in globalThis&&console.warn("TextEncoder constructor called with encoding label, which is ignored.");return Object.defineProperty||(this.encoding=r._encoding.name.toLowerCase()),r}Object.defineProperty&&Object.defineProperty(Ay.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});Ay.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Gw(r),this._do_not_flush||(this._encoder=no[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new Ik(K5e(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===xn))break;Array.isArray(a)?i.push.apply(i,a):i.push(a)}if(!this._do_not_flush){for(;a=this._encoder.handler(n,n.read()),a!==xn;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function tOe(e){var t=e.fatal,r=0,n=0,i=0,a=128,o=191;this.handler=function(s,u){if(u===Fr&&i!==0)return i=0,Dr(t);if(u===Fr)return xn;if(i===0){if(er(u,0,127))return u;if(er(u,194,223))i=1,r=u&31;else if(er(u,224,239))u===224&&(a=160),u===237&&(o=159),i=2,r=u&15;else if(er(u,240,244))u===240&&(a=144),u===244&&(o=143),i=3,r=u&7;else return Dr(t);return null}if(!er(u,a,o))return r=i=n=0,a=128,o=191,s.prepend(u),Dr(t);if(a=128,o=191,r=r<<6|u&63,n+=1,n!==i)return null;var c=r;return r=i=n=0,c}}function rOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;var i,a;er(n,128,2047)?(i=1,a=192):er(n,2048,65535)?(i=2,a=224):er(n,65536,1114111)&&(i=3,a=240);for(var o=[(n>>6*i)+a];i>0;){var s=n>>6*(i-1);o.push(128|s&63),i-=1}return o}}no["UTF-8"]=function(e){return new rOe(e)};io["UTF-8"]=function(e){return new tOe(e)};function nOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ko(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function iOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Vo(i))return i;var a=G0(i,e);return a===null&&Us(i),a+128}}(function(){"encoding-indexes"in globalThis&&LV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Wa(r.toLowerCase());io[r]=function(i){return new nOe(n,i)},no[r]=function(i){return new iOe(n,i)}})})})();io.GBK=function(e){return new qV(e)};no.GBK=function(e){return new NV(e,!0)};function qV(e){var t=e.fatal,r=0,n=0,i=0;this.handler=function(a,o){if(o===Fr&&r===0&&n===0&&i===0)return xn;o===Fr&&(r!==0||n!==0||i!==0)&&(r=0,n=0,i=0,Dr(t));var s;if(i!==0){s=null,er(o,48,57)&&(s=X5e((((r-129)*10+n-48)*126+i-129)*10+o-48));var u=[n,i,o];return r=0,n=0,i=0,s===null?(a.prepend(u),Dr(t)):s}if(n!==0)return er(o,129,254)?(i=o,null):(a.prepend([n,o]),r=0,n=0,Dr(t));if(r!==0){if(er(o,48,57))return n=o,null;var c=r,l=null;r=0;var f=o<127?64:65;return(er(o,64,126)||er(o,128,254))&&(l=(c-129)*190+(o-f)),s=l===null?null:U0(l,Wa("gb18030")),s===null&&Ko(o)&&a.prepend(o),s===null?Dr(t):s}return Ko(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function NV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Vo(i))return i;if(i===58853)return Us(i);if(t&&i===8364)return 128;var a=G0(i,Wa("gb18030"));if(a!==null){var o=Yc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return Us(i);a=Q5e(i);var c=Yc(a/10/126/10);a=a-c*10*126*10;var l=Yc(a/10/126);a=a-l*10*126;var f=Yc(a/10),d=a-f*10;return[c+129,l+48,f+129,d+48]}}no.gb18030=function(e){return new NV(e)};io.gb18030=function(e){return new qV(e)};function aOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:98;switch((er(i,64,126)||er(i,161,254))&&(o=(a-129)*157+(i-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:U0(o,Wa("big5"));return u===null&&Ko(i)&&n.prepend(i),u===null?Dr(t):u}return Ko(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function oOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;var i=eOe(n);if(i===null)return Us(n);var a=Yc(i/157)+129;if(a<161)return Us(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}no.Big5=function(e){return new oOe(e)};io.Big5=function(e){return new aOe(e)};function sOe(e){var t=e.fatal,r=!1,n=0;this.handler=function(i,a){if(a===Fr&&n!==0)return n=0,Dr(t);if(a===Fr&&n===0)return xn;if(n===142&&er(a,161,223))return n=0,65377-161+a;if(n===143&&er(a,161,254))return r=!0,n=a,null;if(n!==0){var o=n;n=0;var s=null;return er(o,161,254)&&er(a,161,254)&&(s=U0((o-161)*94+(a-161),Wa(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Ko(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function uOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return[142,n-65377+161];n===8722&&(n=65293);var i=G0(n,Wa("jis0208"));if(i===null)return Us(n);var a=Yc(i/94)+161,o=i%94+161;return[a,o]}}no["EUC-JP"]=function(e){return new uOe(e)};io["EUC-JP"]=function(e){return new sOe(e)};function cOe(e){var t=e.fatal,r={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},n=r.ASCII,i=r.ASCII,a=0,o=!1;this.handler=function(s,u){switch(n){default:case r.ASCII:return u===27?(n=r.EscapeStart,null):er(u,0,127)&&u!==14&&u!==15&&u!==27?(o=!1,u):u===Fr?xn:(o=!1,Dr(t));case r.Roman:return u===27?(n=r.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===Fr?xn:(o=!1,Dr(t));case r.Katakana:return u===27?(n=r.EscapeStart,null):er(u,33,95)?(o=!1,65377-33+u):u===Fr?xn:(o=!1,Dr(t));case r.LeadByte:return u===27?(n=r.EscapeStart,null):er(u,33,126)?(o=!1,a=u,n=r.TrailByte,null):u===Fr?xn:(o=!1,Dr(t));case r.TrailByte:if(u===27)return n=r.EscapeStart,Dr(t);if(er(u,33,126)){n=r.LeadByte;var c=(a-33)*94+u-33,l=U0(c,Wa("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var d=null;if(f===40&&u===66&&(d=r.ASCII),f===40&&u===74&&(d=r.Roman),f===40&&u===73&&(d=r.Katakana),f===36&&(u===64||u===66)&&(d=r.LeadByte),d!==null){n=n=d;var p=o;return o=!0,p?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function lOe(e){var t=e.fatal,r={ASCII:0,Roman:1,jis0208:2},n=r.ASCII;this.handler=function(i,a){if(a===Fr&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if(a===Fr&&n===r.ASCII)return xn;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return Us(65533);if(n===r.ASCII&&Vo(a))return a;if(n===r.Roman&&(Vo(a)&&a!==92&&a!==126||a==165||a==8254)){if(Vo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Vo(a)&&n!==r.ASCII)return i.prepend(a),n=r.ASCII,[27,40,66];if((a===165||a===8254)&&n!==r.Roman)return i.prepend(a),n=r.Roman,[27,40,74];a===8722&&(a=65293);var o=G0(a,Wa("jis0208"));if(o===null)return Us(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Yc(o/94)+33,u=o%94+33;return[s,u]}}no["ISO-2022-JP"]=function(e){return new lOe(e)};io["ISO-2022-JP"]=function(e){return new cOe(e)};function fOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0;var s=i<127?64:65,u=a<160?129:193;if((er(i,64,126)||er(i,128,252))&&(o=(a-u)*188+i-s),er(o,8836,10715))return 57344-8836+o;var c=o===null?null:U0(o,Wa("jis0208"));return c===null&&Ko(i)&&n.prepend(i),c===null?Dr(t):c}return Ko(i)||i===128?i:er(i,161,223)?65377-161+i:er(i,129,159)||er(i,224,252)?(r=i,null):Dr(t)}}function dOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n)||n===128)return n;if(n===165)return 92;if(n===8254)return 126;if(er(n,65377,65439))return n-65377+161;n===8722&&(n=65293);var i=Z5e(n);if(i===null)return Us(n);var a=Yc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}no.Shift_JIS=function(e){return new dOe(e)};io.Shift_JIS=function(e){return new fOe(e)};function pOe(e){var t=e.fatal,r=0;this.handler=function(n,i){if(i===Fr&&r!==0)return r=0,Dr(t);if(i===Fr&&r===0)return xn;if(r!==0){var a=r,o=null;r=0,er(i,65,254)&&(o=(a-129)*190+(i-65));var s=o===null?null:U0(o,Wa("euc-kr"));return o===null&&Ko(i)&&n.prepend(i),s===null?Dr(t):s}return Ko(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function hOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Vo(n))return n;var i=G0(n,Wa("euc-kr"));if(i===null)return Us(n);var a=Yc(i/190)+129,o=i%190+65;return[a,o]}}no["EUC-KR"]=function(e){return new hOe(e)};io["EUC-KR"]=function(e){return new pOe(e)};function Uw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function UV(e,t){var r=t.fatal,n=null,i=null;this.handler=function(a,o){if(o===Fr&&(n!==null||i!==null))return Dr(r);if(o===Fr&&n===null&&i===null)return xn;if(n===null)return n=o,null;var s;if(e?s=(n<<8)+o:s=(o<<8)+n,n=null,i!==null){var u=i;return i=null,er(s,56320,57343)?65536+(u-55296)*1024+(s-56320):(a.prepend(Uw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function GV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Uw(i,e);var a=Uw((i-65536>>10)+55296,e),o=Uw((i-65536&1023)+56320,e);return a.concat(o)}}no["UTF-16BE"]=function(e){return new GV(!0,e)};io["UTF-16BE"]=function(e){return new UV(!0,e)};no["UTF-16LE"]=function(e){return new GV(!1,e)};io["UTF-16LE"]=function(e){return new UV(!1,e)};function mOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ko(n)?n:63360+n-128}}function gOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Vo(n)?n:er(n,63360,63487)?n-63360+128:Us(n)}}no["x-user-defined"]=function(e){return new gOe(e)};io["x-user-defined"]=function(e){return new mOe(e)};function Sy(e){return Buffer.from(e).toString("base64")}function Pk(e){return Buffer.from(e,"base64").toString("ascii")}var jY=Wt(PY(),1),LY=Wt(Iy(),1);function RY(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function kRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,LY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,jY.default)(n,r,t)}function MY(e,t){let r=kRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(RY(a))})})}var vae=Wt(gae(),1),LI=["image/png","image/jpeg","image/gif"];async function MI(e,t){if(!t)throw new Error("MIMEType is required to parse image under Node.js");let r=e instanceof Buffer?e:Buffer.from(e);return await GWe(r,t)}function GWe(e,t){return new Promise(r=>(0,vae.default)(e,t,(n,i)=>{if(n)throw n;let a=[...i.shape],o=i.shape.length===4?i.shape.shift():1,s=i.data instanceof Buffer?new Uint8Array(i.data):i.data;r({shape:a,data:s,width:i.shape[0],height:i.shape[1],components:i.shape[2],layers:o?[o]:[]})}))}async function Do(e,t,r,n){return n._parse(e,t,r,n)}function Qt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var tc={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},yae=tc.self||tc.window||tc.global||{},xae=tc.window||tc.self||tc.global||{},_ae=tc.global||tc.self||tc.window||{},wae=tc.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var bae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),zWe=bae&&parseFloat(bae[1])||0;function qI(e,t){return Eae(e||{},t)}function Eae(e,t,r=0){if(r>3)return t;let n={...e};for(let[i,a]of Object.entries(t))a&&typeof a=="object"&&!Array.isArray(a)?n[i]=Eae(n[i]||{},t[i],r+1):n[i]=t[i];return n}var Aae="latest";function HWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.1.0-alpha.7"),globalThis._loadersgl_.version}var Wp=HWe();function ga(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var rc={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},rrr=rc.self||rc.window||rc.global||{},nrr=rc.window||rc.self||rc.global||{},irr=rc.global||rc.self||rc.window||{},arr=rc.document||{};var ra=typeof process!="object"||String(process)!=="[object process]"||process.browser,Fx=typeof importScripts=="function",Tae=typeof window<"u"&&typeof window.orientation<"u",Sae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),orr=Sae&&parseFloat(Sae[1])||0;var kx=class{name;workerThread;isRunning=!0;result;_resolve=()=>{};_reject=()=>{};constructor(t,r){this.name=t,this.workerThread=r,this.result=new Promise((n,i)=>{this._resolve=n,this._reject=i})}postMessage(t,r){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:r})}done(t){ga(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ga(this.isRunning),this.isRunning=!1,this._reject(t)}};var Vp={};da(Vp,{NodeWorker:()=>Ox,parentPort:()=>WWe});var Bx=Wt(require("worker_threads"),1);Ey(Vp,require("worker_threads"));var WWe=Bx==null?void 0:Bx.parentPort,Ox=Bx.Worker;var NI=new Map;function Cae(e){ga(e.source&&!e.url||!e.source&&e.url);let t=NI.get(e.source||e.url);return t||(e.url&&(t=VWe(e.url),NI.set(e.url,t)),e.source&&(t=Dae(e.source),NI.set(e.source,t))),ga(t),t}function VWe(e){if(!e.startsWith("http"))return e;let t=KWe(e);return Dae(t)}function Dae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function KWe(e){return`try {
|
|
174
174
|
importScripts('${e}');
|
|
175
175
|
} catch (error) {
|
|
176
176
|
console.error(error);
|
|
177
177
|
throw error;
|
|
178
178
|
}`}function UI(e,t=!0,r){let n=r||new Set;if(e){if(Fae(e))n.add(e);else if(Fae(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)UI(e[i],t,n)}}return r===void 0?Array.from(n):[]}function Fae(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}function GI(e){if(e===null)return{};let t=Object.assign({},e);return Object.keys(t).forEach(r=>{typeof e[r]=="object"&&!ArrayBuffer.isView(e[r])&&!(e[r]instanceof Array)?t[r]=GI(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var zI=()=>{},qf=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&ra||typeof Ox<"u"&&!ra}constructor(t){let{name:r,source:n,url:i}=t;ga(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=zI,this.onError=a=>console.log(a),this.worker=ra?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=zI,this.onError=zI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||UI(t),this.worker.postMessage(t,r)}_getErrorFromErrorEvent(t){let r="Failed to load ";return r+=`worker ${this.name} from ${this.url}. `,t.message&&(r+=`${t.message} in `),t.lineno&&(r+=`:${t.lineno}:${t.colno}`),new Error(r)}_createBrowserWorker(){this._loadableURL=Cae({source:this.source,url:this.url});let t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=r=>{r.data?this.onMessage(r.data):this.onError(new Error("No data received"))},t.onerror=r=>{this.onError(this._getErrorFromErrorEvent(r)),this.terminated=!0},t.onmessageerror=r=>console.error(r),t}_createNodeWorker(){let t;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;t=new Ox(n,{eval:!1})}else if(this.source)t=new Ox(this.source,{eval:!0});else throw new Error("no worker");return t.on("message",r=>{this.onMessage(r)}),t.on("error",r=>{this.onError(r)}),t.on("exit",r=>{}),t}};var Ix=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return qf.isSupported()}constructor(t){this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach(t=>t.destroy()),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},t.name!==void 0&&(this.name=t.name),t.maxConcurrency!==void 0&&(this.maxConcurrency=t.maxConcurrency),t.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=t.maxMobileConcurrency),t.reuseWorkers!==void 0&&(this.reuseWorkers=t.reuseWorkers),t.onDebug!==void 0&&(this.onDebug=t.onDebug)}async startJob(t,r=(i,a,o)=>i.done(o),n=(i,a)=>i.error(a)){let i=new Promise(a=>(this.jobQueue.push({name:t,onMessage:r,onError:n,onStart:a}),this));return this._startQueuedJob(),await i}async _startQueuedJob(){if(!this.jobQueue.length)return;let t=this._getAvailableWorker();if(!t)return;let r=this.jobQueue.shift();if(r){this.onDebug({message:"Starting job",name:r.name,workerThread:t,backlog:this.jobQueue.length});let n=new kx(r.name,t);t.onMessage=i=>r.onMessage(n,i.type,i.payload),t.onError=i=>r.onError(n,i),r.onStart(n);try{await n.result}catch(i){console.error(`Worker exception: ${i}`)}finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){!ra||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let t=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new qf({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Tae?this.maxMobileConcurrency:this.maxConcurrency}};var $We={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Kp=class{props;workerPools=new Map;static isSupported(){return qf.isSupported()}static getWorkerFarm(t={}){return Kp._workerFarm=Kp._workerFarm||new Kp({}),Kp._workerFarm.setProps(t),Kp._workerFarm}constructor(t){this.props={...$We},this.setProps(t),this.workerPools=new Map}destroy(){for(let t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(let r of this.workerPools.values())r.setProps(this._getWorkerPoolProps())}getWorkerPool(t){let{name:r,source:n,url:i}=t,a=this.workerPools.get(r);return a||(a=new Ix({name:r,source:n,url:i}),a.setProps(this._getWorkerPoolProps()),this.workerPools.set(r,a)),a}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}},Ma=Kp;PV(Ma,"_workerFarm");function kae(e){let t=e.version!==Wp?` (worker-utils@${Wp})`:"";return`${e.name}@${e.version}${t}`}function Px(e,t={}){let r=t[e.id]||{},n=ra?`${e.id}-worker.js`:`${e.id}-worker-node.js`,i=r.workerUrl;if(!i&&e.id==="compression"&&(i=t.workerUrl),t._workerType==="test"&&(ra?i=`modules/${e.module}/dist/${n}`:i=`modules/${e.module}/src/workers/${e.id}-worker-node.ts`),!i){let a=e.version;a==="latest"&&(a=Aae);let o=a?`@${a}`:"";i=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return ga(i),i}async function HI(e,t,r={},n={}){let i=kae(e),a=Ma.getWorkerFarm(r),{source:o}=r,s={name:i,source:o};o||(s.url=Px(e,r));let u=a.getWorkerPool(s),c=r.jobName||e.name,l=await u.startJob(c,YWe.bind(null,n)),f=GI(r);return l.postMessage("process",{input:t,options:f}),(await l.result).result}async function YWe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{if(!e.process){t.postMessage("error",{id:i,error:"Worker not set up to process on main thread"});return}let s=await e.process(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`process-on-worker: unknown message ${r}`)}}function WI(e,t=Wp){ga(e,"no worker provided");let r=e.version;return!(!t||!r)}var KI={};da(KI,{readFileAsArrayBuffer:()=>LA,readFileAsText:()=>MA,requireFromFile:()=>qA,requireFromString:()=>Om});var VI=Wt(require("module"),1),Bae=Wt(require("path"),1),Rx=Wt(require("fs"),1);async function LA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():Rx.readFileSync(e).buffer}async function MA(e){return e.startsWith("http")?await(await fetch(e)).text():Rx.readFileSync(e,"utf8")}async function qA(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return Om(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await Rx.promises.readFile(e,"utf8");return Om(t)}function Om(e,t="",r){if(typeof t=="object"&&(r=t,t=""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=VI.default._nodeModulePaths(Bae.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new VI.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var $I={};async function nc(e,t=null,r={},n=null){return t&&(e=Oae(e,t,r,n)),$I[e]=$I[e]||JWe(e),await $I[e]}function Oae(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let i=r.modules||{};return i[n]?i[n]:ra?r.CDN?(ga(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Wp}/dist/libs/${n}`):Fx?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function JWe(e){if(e.endsWith("wasm"))return await QWe(e);if(!ra)try{return KI&&qA&&await qA(e)}catch(r){return console.error(r),null}if(Fx)return importScripts(e);let t=await ZWe(e);return XWe(t,e)}function XWe(e,t){if(!ra)return Om&&Om(e,t);if(Fx)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function QWe(e){return ra||!LA||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await LA(e)}async function ZWe(e){return ra||!MA||e.startsWith("http")?await(await fetch(e)).text():await MA(e)}var jae=Wt(require("child_process"),1);var Iae=Wt(require("child_process"),1);function Pae(e=3e3){return new Promise(t=>{Iae.default.exec("lsof -i -P -n | grep LISTEN",(r,n)=>{if(r){t(e);return}let i=[],a=/:(\d+) \(LISTEN\)/;n.split(`
|
|
179
|
-
`).forEach(s=>{let u=a.exec(s);u&&i.push(Number(u[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}var Rae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},dl=class{id;props={...Rae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Rae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await Pae(t.port)),r.push(t.portArg,String(this.port))),await new Promise((n,i)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),n({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=jae.spawn(t.command,r,t.spawn);this.childProcess=a,a.stdout.on("data",o=>{console.log(o.toString())}),a.stderr.on("data",o=>{console.log(`Child process wrote to stderr: "${o}".`),t.ignoreStderr||(this._clearTimeout(),i(new Error(o)))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),i(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),n({})})}catch(a){i(a)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(t=0){try{await this.stop(),process.exit(t)}catch(r){console.error(r.message||r),process.exit(1)}}_setTimeout(t){Number(this.props.wait)>0&&(this.successTimer=setTimeout(t,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}};function YI(e,t){return!Ma.isSupported()||!ra&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function JI(e,t,r,n,i){let a=e.id,o=Px(e,r),u=Ma.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let c=await u.startJob("process-on-worker",eVe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function eVe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{let s=await e(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function XI(e,t){return!Ma.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Mae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Lae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Lae(e,0,t):""}function Lae(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function QI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Mae(e)}"`)}}function ic(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),i=new Uint8Array(t);for(let a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}function Di(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function Fo(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,s)=>o+s.length,0),i=new r(n),a=0;for(let o of t)i.set(o,a),a+=o.length;return i}function $p(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function ko(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function ZI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+ko(n.byteLength,4)}function eP(e,t){let r=e.length,i=Math.ceil(r/t)*t-r,a="";for(let o=0;o<i;++o)a+=" ";return e+a}function Im(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function jx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function NA(e,t,r,n){let i=ko(r.byteLength,n),a=i-r.byteLength;if(e){let o=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),s=new Uint8Array(r);o.set(s);for(let u=0;u<a;++u)e.setUint8(t+r.byteLength+u,32)}return t+=i,t}function Pm(e,t,r,n){let a=new TextEncoder().encode(r);return t=NA(e,t,a,n),t}async function Yp(e){let t=[];for await(let r of e)t.push(r);return Di(...t)}function Nf(e){return Nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nf(e)}function tP(e,t){if(Nf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rP(e){var t=tP(e,"string");return Nf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=rP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tVe="",qae={};function ac(e){for(let t in qae)if(e.startsWith(t)){let r=qae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${tVe}${e}`),e}var rVe="4.1.0-alpha.6",nP={name:"JSON",id:"json",module:"json",version:rVe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Nae,parse:async e=>Nae(new TextDecoder().decode(e)),options:{}};function Nae(e){return JSON.parse(e)}function Uae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Gae(e){return e&&typeof e=="object"&&e.isBuffer}function pl(e){if(Gae(e))return Uae(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 t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Rm(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var nu={};da(nu,{dirname:()=>aVe,filename:()=>iVe,join:()=>oVe,resolve:()=>sVe});function zae(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(t=window.location)==null?void 0:t.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function iVe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function aVe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function oVe(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function sVe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",n=!1,i;for(let a=t.length-1;a>=-1&&!n;a--){let o;a>=0?o=t[a]:(i===void 0&&(i=zae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Lx)}return r=uVe(r,!n),n?`/${r}`:r.length>0?r:"."}var Lx=47,iP=46;function uVe(e,t){let r="",n=-1,i=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Lx)break;a=Lx}if(a===Lx){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==iP||r.charCodeAt(r.length-2)!==iP){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Lx;--c);if(c!==u){r=c===-1?"":r.slice(0,c),n=s,i=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=s,i=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(n+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}n=s,i=0}else a===iP&&i!==-1?++i:i=-1}return r}var Mx=new Error("Not implemented"),Jp=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){var i;if((i=globalThis.loaders)!=null&&i.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw gn?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw Mx}async write(t,r,n){throw Mx}async stat(){throw Mx}async truncate(t){throw Mx}async append(t){throw Mx}async close(){}};var aP=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var iu=class{file;constructor(t,r=!1){this.file=new Jp(t,r?"a+":"r")}async truncate(t){await this.file.truncate(t)}async append(t){await this.file.append(t)}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let i=Number(n);return await this.file.read(t,i)}get length(){return this.file.bigsize}};var hl=Wt(require("fs"),1),Xp=class{handle;size;bigsize;url;constructor(t,r,n){t=ac(t),this.handle=hl.default.openSync(t,r,n);let i=hl.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{hl.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{hl.default.ftruncate(this.handle,t,i=>{i?n(i):(this.bigsize=BigInt(t),this.size=Number(this.bigsize),r())})})}async append(t){return new Promise((r,n)=>{hl.default.appendFile(this.handle,t,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(t.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((t,r)=>hl.default.fstat(this.handle,{bigint:!0},(n,i)=>{let a={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(a)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),a=0,o=new Uint8Array(n),s;for(;r>0;){let u=await lVe(this.handle,o,0,r,i);if(u===0)break;a+=u,i+=BigInt(u),r-=u,s!==void 0&&(s+=u)}return a<r?n.slice(0,a):n}async write(t,r=0,n=t.byteLength){return new Promise((i,a)=>{let o=Number(r),s=new Uint8Array(t,Number(r),n);hl.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function lVe(e,t,r,n,i){return await new Promise((a,o)=>hl.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var HA=Wt(require("fs/promises"),1);var sP=Wt(require("fs"),1),oP=require("stream");var UA=Wt(require("zlib"),1),fVe=e=>e&&e instanceof ArrayBuffer,dVe=e=>e&&e instanceof Buffer;function GA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(UA.default.createBrotliDecompress());case"gzip":return e.pipe(UA.default.createGunzip());case"deflate":return e.pipe(UA.default.createDeflate());default:return e}}async function Hae(e){let t=[];return await new Promise((r,n)=>{e.on("error",i=>n(i)),e.on("readable",()=>e.read()),e.on("data",i=>{typeof i=="string"&&n(new Error("Read stream not binary")),t.push(hVe(i))}),e.on("end",()=>{let i=pVe(t);r(i)})})}function pVe(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function hVe(e){if(fVe(e))return e;if(dVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var mVe=e=>typeof e=="boolean",Wae=e=>typeof e=="function",gVe=e=>e!==null&&typeof e=="object",vVe=e=>gVe(e)&&Wae(e.read)&&Wae(e.pipe)&&mVe(e.readable);async function zA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=ac(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,d)=>{let p=sP.default.createReadStream(n,{encoding:null});p.once("readable",()=>f(p)),p.on("error",h=>d(h))}),o=a;vVe(a)?o=GA(a,i):typeof a=="string"?o=oP.Readable.from([new TextEncoder().encode(a)]):o=oP.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=bVe(n),l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}catch(a){let o=a.message,s=400,u=o,c={},l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}}function bVe(e){let t={};if(!t["content-length"]){let r=sP.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var WA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await HA.default.readdir(t,r)}async stat(t){let r=await HA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await HA.default.unlink(t)}async fetch(t,r){return await zA(t,r)}async openReadableFile(t,r="r"){return new Xp(t,r)}async openWritableFile(t,r="w",n){return new Xp(t,r,n)}};var ml=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){var o,s;let n=[];for await(let u of t)n.push(u),yield u;let i=await this.concatenate(n),a=await this.hash(i,r);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:a})}async concatenate(t){return await Yp(t)}};var jm=class{crc;constructor(){this.crc=-1}update(t){let r=xVe(),n=new Uint8Array(t);for(let i=0;i<n.byteLength;i++)this.crc=this.crc>>>8^r[(this.crc^n[i])&255];return this}finalize(){return this.crc=(this.crc^-1)>>>0,this.crc}},yVe=Uint32Array.of(0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117);function xVe(){return yVe}function Vae(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let i=0;i<n.length;i++)typeof n[i]>"u"?t+="=":t+=_Ve(n[i])}return t}function _Ve(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function uP(e,t){switch(t){case"hex":return Kae(e);case"base64":return Yae(Kae(e));default:throw new Error(t)}}function $ae(e,t){switch(t){case"hex":return e;case"base64":return Yae(e);default:throw new Error(t)}}function Yae(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Vae(r)||""}function Kae(e){let t=e.toString(16);return t==="0"?`0${t}`:t}var qx=class extends ml{name="crc32";options;constructor(t={}){super(),this.options={crypto:{},...t},this.hashBatches=this.hashBatches.bind(this)}async hash(t,r){return this.hashSync(t,r)}hashSync(t,r){let n=new jm;n.update(t);let i=n.finalize();return uP(i,r)}async*hashBatches(t,r="base64"){var a,o;let n=new jm;for await(let s of t)n.update(s),yield s;let i=n.finalize();(o=(a=this.options.crypto)==null?void 0:a.onEnd)==null||o.call(a,{hash:uP(i,r)})}};var Xae=typeof atob=="function"?atob:typeof Buffer=="function"?DVe:Zae,wVe=Xae("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),cP=WebAssembly&&Xae!==Zae?CVe(wVe).buffer:!1,oc=FVe(),lP=240*16*16,Qae=Math.floor(lP*16*1.066666667),EVe=268435456-65536,Jae="Parameter must be Buffer, ArrayBuffer or Uint8Array",AVe="Parameter exceeds max size of 255.9 Mbytes";cP||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function fP(e){var t,r,n,i,a,o,s,u,c,l;let f=TVe(),d=SVe(),p={},h=new Date().getTime();return p.then=function(E){return s=E,g(),p},p.catch=function(E){return u=E,p},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?o=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?o=e.constructor===ArrayBuffer?new Uint8Array(e):e:x(new TypeError(Jae)):x(new TypeError(Jae)),o&&(a=o.length,cP&&a>Qae?a>EVe?x(new Error(AVe)):(t=new WebAssembly.Memory({initial:a>32e6?a>64e6?a>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),i={mem:t,log:console.log},n={imports:i},WebAssembly.instantiate(cP,n).then(b)):g(f(o))),p;function b(E){g(d(o,E.instance.exports,r))}function g(E){var S=Boolean(E)?E:c;Boolean(E)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-h),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function SVe(){var e,t,r,n,i,a,o,s,u,c,l,f,d,p=function(h){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,pe,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=h.length*8,ft;for(ft=Ie(h,d),d[at>>>5]|=128<<at%32,d[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,pe=d;Ge<ft;)ft>Ge+Qae?(n(oe),a(V),s(ne),c(se),t(lP),Ge=Ge+lP*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=pe[Ge+0]>>>0,g=pe[Ge+1]>>>0,x=pe[Ge+2]>>>0,E=pe[Ge+3]>>>0,S=pe[Ge+4]>>>0,F=pe[Ge+5]>>>0,D=pe[Ge+6]>>>0,j=pe[Ge+7]>>>0,k=pe[Ge+8]>>>0,N=pe[Ge+9]>>>0,C=pe[Ge+10]>>>0,I=pe[Ge+11]>>>0,P=pe[Ge+12]>>>0,U=pe[Ge+13]>>>0,Y=pe[Ge+14]>>>0,J=pe[Ge+15]>>>0,oe=me(7,25,oe+(V&ne|~V&se)+b-680876936)+V,se=me(12,20,se+(oe&V|~oe&ne)+g-389564586)+oe,ne=me(17,15,ne+(se&oe|~se&V)+x+606105819)+se,V=me(22,10,V+(ne&se|~ne&oe)+E-1044525330)+ne,oe=me(7,25,oe+(V&ne|~V&se)+S-176418897)+V,se=me(12,20,se+(oe&V|~oe&ne)+F+1200080426)+oe,ne=me(17,15,ne+(se&oe|~se&V)+D-1473231341)+se,V=me(22,10,V+(ne&se|~ne&oe)+j-45705983)+ne,oe=me(7,25,oe+(V&ne|~V&se)+k+1770035416)+V,se=me(12,20,se+(oe&V|~oe&ne)+N-1958414417)+oe,ne=me(17,15,ne+(se&oe|~se&V)+C-42063)+se,V=me(22,10,V+(ne&se|~ne&oe)+I-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+P+1804603682)+V,se=me(12,20,se+(oe&V|~oe&ne)+U-40341101)+oe,ne=me(17,15,ne+(se&oe|~se&V)+Y-1502002290)+se,V=me(22,10,V+(ne&se|~ne&oe)+J+1236535329)+ne,oe=me(5,27,oe+(V&se|ne&~se)+g-165796510)+V,se=me(9,23,se+(oe&ne|V&~ne)+D-1069501632)+oe,ne=me(14,18,ne+(se&V|oe&~V)+I+643717713)+se,V=me(20,12,V+(ne&oe|se&~oe)+b-373897302)+ne,oe=me(5,27,oe+(V&se|ne&~se)+F-701558691)+V,se=me(9,23,se+(oe&ne|V&~ne)+C+38016083)+oe,ne=me(14,18,ne+(se&V|oe&~V)+J-660478335)+se,V=me(20,12,V+(ne&oe|se&~oe)+S-405537848)+ne,oe=me(5,27,oe+(V&se|ne&~se)+N+568446438)+V,se=me(9,23,se+(oe&ne|V&~ne)+Y-1019803690)+oe,ne=me(14,18,ne+(se&V|oe&~V)+E-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+k+1163531501)+ne,oe=me(5,27,oe+(V&se|ne&~se)+U-1444681467)+V,se=me(9,23,se+(oe&ne|V&~ne)+x-51403784)+oe,ne=me(14,18,ne+(se&V|oe&~V)+j+1735328473)+se,V=me(20,12,V+(ne&oe|se&~oe)+P-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+k-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+I+1839030562)+se,V=me(23,9,V+(ne^se^oe)+Y-35309556)+ne,oe=me(4,28,oe+(V^ne^se)+g-1530992060)+V,se=me(11,21,se+(oe^V^ne)+S+1272893353)+oe,ne=me(16,16,ne+(se^oe^V)+j-155497632)+se,V=me(23,9,V+(ne^se^oe)+C-1094730640)+ne,oe=me(4,28,oe+(V^ne^se)+U+681279174)+V,se=me(11,21,se+(oe^V^ne)+b-358537222)+oe,ne=me(16,16,ne+(se^oe^V)+E-722521979)+se,V=me(23,9,V+(ne^se^oe)+D+76029189)+ne,oe=me(4,28,oe+(V^ne^se)+N-640364487)+V,se=me(11,21,se+(oe^V^ne)+P-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+J+530742520)+se,V=me(23,9,V+(ne^se^oe)+x-995338651)+ne,oe=me(6,26,oe+(ne^(V|~se))+b-198630844)+V,se=me(10,22,se+(V^(oe|~ne))+j+1126891415)+oe,ne=me(15,17,ne+(oe^(se|~V))+Y-1416354905)+se,V=me(21,11,V+(se^(ne|~oe))+F-57434055)+ne,oe=me(6,26,oe+(ne^(V|~se))+P+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+E-1894986606)+oe,ne=me(15,17,ne+(oe^(se|~V))+C-1051523)+se,V=me(21,11,V+(se^(ne|~oe))+g-2054922799)+ne,oe=me(6,26,oe+(ne^(V|~se))+k+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+J-30611744)+oe,ne=me(15,17,ne+(oe^(se|~V))+D-1560198380)+se,V=me(21,11,V+(se^(ne|~oe))+U+1309151649)+ne,oe=me(6,26,oe+(ne^(V|~se))+S-145523070)+V,se=me(10,22,se+(V^(oe|~ne))+I-1120210379)+oe,ne=me(15,17,ne+(oe^(se|~V))+x+718787259)+se,V=me(21,11,V+(se^(ne|~oe))+N-343485551)+ne,Ge=Ge+16,oe=oe+re>>>0,V=V+ee>>>0,ne=ne+ge>>>0,se=se+ye>>>0);return oc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function Ie(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,de,Xe,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],de=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Xe=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|de<<8|Xe<<16|ct<<24;return _t+1}};return function(h,b,g,x){var E;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,d=g,E=oc.wordsToBytes(p(h)),x&&x.asBytes?E:oc.bytesconvertNumberToHex(E)}}function TVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,d,p,h,b,g,x,E,S,F,D,j,k,N=new Date().getTime(),C=1732584193,I=-271733879,P=-1732584194,U=271733878,Y=t.length*8;k=oc.bytesToWords(t);for(var J=0;J<k.length;J++)k[J]=(k[J]<<8|k[J]>>>24)&16711935|(k[J]<<24|k[J]>>>8)&4278255360;k[Y>>>5]|=128<<Y%32,k[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<k.length;re+=16)S=C,F=I,D=P,j=U,n=k[re+0]>>>0,i=k[re+1]>>>0,a=k[re+2]>>>0,o=k[re+3]>>>0,s=k[re+4]>>>0,u=k[re+5]>>>0,c=k[re+6]>>>0,l=k[re+7]>>>0,f=k[re+8]>>>0,d=k[re+9]>>>0,p=k[re+10]>>>0,h=k[re+11]>>>0,b=k[re+12]>>>0,g=k[re+13]>>>0,x=k[re+14]>>>0,E=k[re+15]>>>0,C=ee(7,25,C+(I&P|~I&U)+n-680876936)+I,U=ee(12,20,U+(C&I|~C&P)+i-389564586)+C,P=ee(17,15,P+(U&C|~U&I)+a+606105819)+U,I=ee(22,10,I+(P&U|~P&C)+o-1044525330)+P,C=ee(7,25,C+(I&P|~I&U)+s-176418897)+I,U=ee(12,20,U+(C&I|~C&P)+u+1200080426)+C,P=ee(17,15,P+(U&C|~U&I)+c-1473231341)+U,I=ee(22,10,I+(P&U|~P&C)+l-45705983)+P,C=ee(7,25,C+(I&P|~I&U)+f+1770035416)+I,U=ee(12,20,U+(C&I|~C&P)+d-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+p-42063)+U,I=ee(22,10,I+(P&U|~P&C)+h-1990404162)+P,C=ee(7,25,C+(I&P|~I&U)+b+1804603682)+I,U=ee(12,20,U+(C&I|~C&P)+g-40341101)+C,P=ee(17,15,P+(U&C|~U&I)+x-1502002290)+U,I=ee(22,10,I+(P&U|~P&C)+E+1236535329)+P,C=ee(5,27,C+(I&U|P&~U)+i-165796510)+I,U=ee(9,23,U+(C&P|I&~P)+c-1069501632)+C,P=ee(14,18,P+(U&I|C&~I)+h+643717713)+U,I=ee(20,12,I+(P&C|U&~C)+n-373897302)+P,C=ee(5,27,C+(I&U|P&~U)+u-701558691)+I,U=ee(9,23,U+(C&P|I&~P)+p+38016083)+C,P=ee(14,18,P+(U&I|C&~I)+E-660478335)+U,I=ee(20,12,I+(P&C|U&~C)+s-405537848)+P,C=ee(5,27,C+(I&U|P&~U)+d+568446438)+I,U=ee(9,23,U+(C&P|I&~P)+x-1019803690)+C,P=ee(14,18,P+(U&I|C&~I)+o-187363961)+U,I=ee(20,12,I+(P&C|U&~C)+f+1163531501)+P,C=ee(5,27,C+(I&U|P&~U)+g-1444681467)+I,U=ee(9,23,U+(C&P|I&~P)+a-51403784)+C,P=ee(14,18,P+(U&I|C&~I)+l+1735328473)+U,I=ee(20,12,I+(P&C|U&~C)+b-1926607734)+P,C=ee(4,28,C+(I^P^U)+u-378558)+I,U=ee(11,21,U+(C^I^P)+f-2022574463)+C,P=ee(16,16,P+(U^C^I)+h+1839030562)+U,I=ee(23,9,I+(P^U^C)+x-35309556)+P,C=ee(4,28,C+(I^P^U)+i-1530992060)+I,U=ee(11,21,U+(C^I^P)+s+1272893353)+C,P=ee(16,16,P+(U^C^I)+l-155497632)+U,I=ee(23,9,I+(P^U^C)+p-1094730640)+P,C=ee(4,28,C+(I^P^U)+g+681279174)+I,U=ee(11,21,U+(C^I^P)+n-358537222)+C,P=ee(16,16,P+(U^C^I)+o-722521979)+U,I=ee(23,9,I+(P^U^C)+c+76029189)+P,C=ee(4,28,C+(I^P^U)+d-640364487)+I,U=ee(11,21,U+(C^I^P)+b-421815835)+C,P=ee(16,16,P+(U^C^I)+E+530742520)+U,I=ee(23,9,I+(P^U^C)+a-995338651)+P,C=ee(6,26,C+(P^(I|~U))+n-198630844)+I,U=ee(10,22,U+(I^(C|~P))+l+1126891415)+C,P=ee(15,17,P+(C^(U|~I))+x-1416354905)+U,I=ee(21,11,I+(U^(P|~C))+u-57434055)+P,C=ee(6,26,C+(P^(I|~U))+b+1700485571)+I,U=ee(10,22,U+(I^(C|~P))+o-1894986606)+C,P=ee(15,17,P+(C^(U|~I))+p-1051523)+U,I=ee(21,11,I+(U^(P|~C))+i-2054922799)+P,C=ee(6,26,C+(P^(I|~U))+f+1873313359)+I,U=ee(10,22,U+(I^(C|~P))+E-30611744)+C,P=ee(15,17,P+(C^(U|~I))+c-1560198380)+U,I=ee(21,11,I+(U^(P|~C))+g+1309151649)+P,C=ee(6,26,C+(P^(I|~U))+s-145523070)+I,U=ee(10,22,U+(I^(C|~P))+h-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+d-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return oc.endian([C,I,P,U]);function ee(ge,ye,pe){return pe<<ge|pe>>>ye}};return function(t,r){var n=oc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:oc.bytesconvertNumberToHex(n);return i}}function CVe(e){var t,r,n,i=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>i++;)n[i]=e.charCodeAt(i);return n}function DVe(e){return Buffer.from(e,"base64").toString("binary")}function Zae(e){return e}function FVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return oc.rotl(t,8)&16711935|oc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=oc.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,i=0;n<t.length;n++,i+=8)r[i>>>5]|=t[n]<<24-i%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var Qp=class extends ml{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>fP(t).then(a).catch(o));return $ae(i,r)}};var Nx=Wt(require("crypto"),1),VA=class extends ml{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(super(),this.options=t,!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async hash(t,r){var i,a,o,s;let n=(o=(a=(i=this.options)==null?void 0:i.crypto)==null?void 0:a.algorithm)==null?void 0:o.toLowerCase();try{if(!Nx.createHash)throw new Error("crypto.createHash not available");let u=(s=Nx.createHash)==null?void 0:s(n),c=new Uint8Array(t);return u.update(c).digest("base64")}catch(u){throw Error(`${n} hash not available. ${u}`)}}async*hashBatches(t,r="base64"){var a,o,s,u,c,l,f;if(!Nx.createHash)throw new Error("crypto.createHash not available");let n=(u=Nx.createHash)==null?void 0:u((s=(o=(a=this.options)==null?void 0:a.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let d of t){let p=new Uint8Array(d);n.update(p),yield d}let i=n.digest(r);(f=(l=(c=this.options)==null?void 0:c.crypto)==null?void 0:l.onEnd)==null||f.call(l,{hash:i})}};var hoe=require("process");var eoe=Wt(require("stream"),1),dP=class{},kVe=eoe.Readable||dP;function hP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new pP(r,t)}var pP=class extends kVe{_pulling;_bytesMode;_iterator;constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,r){var n,i,a,o;this._iterator&&(t?await((i=(n=this._iterator)==null?void 0:n.throw)==null?void 0:i.call(n,t)):await((o=(a=this._iterator)==null?void 0:a.return)==null?void 0:o.call(a,t)),r==null||r(null))}async _pull(t,r){var a;let n=this._bytesMode,i=null;for(;this.readable&&!(i=await r.next()).done&&(t!==null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(new Uint8Array(i.value))||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&((a=r==null?void 0:r.return)==null||a.call(r)),!this.readable}};var noe=Wt(roe(),1);delete globalThis.ReadableStream;var $A=class extends noe.ReadableStream{};var YA=class{chunks;isWorking=!1;isCancelled=!1;constructor(t){this.chunks=t}start(t){this.work(t)}async work(t){let{chunks:r}=this;for(this.isWorking=!0;!this.isCancelled&&(t.desiredSize||0)>0;){let n;try{n=r.next()}catch(i){t.error(i);break}n&&(!n.done&&!this.isCancelled?t.enqueue(n.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var JA=class extends $A{_chunks;constructor(t){super(new YA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Zp=class{type;size;parts;constructor(t=[],r={}){this.parts=[],this.size=0;for(let n of t)if(typeof n=="string"){let i=new TextEncoder().encode(n);this.parts.push(i),this.size+=i.byteLength}else if(n instanceof Zp)this.size+=n.size,this.parts.push(...n.parts);else if(n instanceof ArrayBuffer)this.parts.push(new Uint8Array(n)),this.size+=n.byteLength;else if(n instanceof Uint8Array)this.parts.push(n),this.size+=n.byteLength;else if(ArrayBuffer.isView(n)){let{buffer:i,byteOffset:a,byteLength:o}=n;this.parts.push(new Uint8Array(i,a,o)),this.size+=o}else{let i=new TextEncoder().encode(String(n));this.parts.push(i),this.size+=i.byteLength}this.type=BVe(r.type)}slice(t=0,r=this.size,n=""){let{size:i,parts:a}=this,o=t<0?Math.max(i+t,0):Math.min(t,i),s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.max(s-o,0),c=new Zp([],{type:n});if(u===0)return c;let l=0,f=[];for(let d of a){let{byteLength:p}=d;if(o>0&&p<=o)o-=p,s-=p;else{let h=d.subarray(o,Math.min(p,s));if(f.push(h),l+=h.byteLength,o=0,l>=u)break}}return c.parts=f,c.size=l,c}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let n of this.parts)r+=t.decode(n);return r}stream(){return new JA(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),n=0;for(let i of this.parts)r.set(i,n),n+=i.byteLength;return t}};function BVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function OVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Zp),globalThis.Blob}var IVe=OVe();var XA=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${Sy(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var QA=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(t,r,n={}){super(t,n),this.name=String(r).replace(/\//g,":"),this.lastModified=(n==null?void 0:n.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function ioe(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=XA),typeof File>"u"&&!globalThis.File&&(globalThis.File=QA),global}var PVe=ioe();var mP=Wt(require("module"),1),aoe=Wt(require("path"),1),eS=Wt(require("fs"),1);async function ooe(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():eS.default.readFileSync(e).buffer}async function soe(e){return e.startsWith("http")?await(await fetch(e)).text():eS.default.readFileSync(e,"utf8")}async function uoe(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return ZA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await eS.default.readFileSync(e,"utf8");return ZA(t)}function ZA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=mP.default._nodeModulePaths(aoe.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new mP.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var au=class{map;constructor(t){this.map={},t instanceof au?t.forEach((r,n)=>this.append(n,r)):Array.isArray(t)?t.forEach(r=>this.append(r[0],r[1])):t&&Object.getOwnPropertyNames(t).forEach(r=>this.append(r,t[r]))}append(t,r){t=Ux(t),r=coe(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Ux(t)]}get(t){return t=Ux(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Ux(t))}set(t,r){this.map[Ux(t)]=coe(r)}forEach(t,r=null){for(let n in this.map)this.map.hasOwnProperty(n)&&(r?t.call(r,this.map[n],n,this):t(this.map[n],n,this))}keys(){let t=[];return this.forEach(function(r,n){t.push(n)}),gP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),gP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),gP(t)}*[Symbol.iterator](){yield*this.entries()}};function Ux(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 coe(e){return typeof e!="string"&&(e=String(e)),e}function gP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function vP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var yP=Wt(require("stream"),1),RVe=e=>typeof e=="boolean",loe=e=>typeof e=="function",jVe=e=>e!==null&&typeof e=="object",bP=e=>jVe(e)&&loe(e.read)&&loe(e.pipe)&&RVe(e.readable),gl=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(t,r){let{headers:n,status:i=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=i===200,this.status=i,this.statusText=a,this.headers=new au((r==null?void 0:r.headers)||{}),bP(t)?this._body=GA(t,n):typeof t=="string"?this._body=yP.Readable.from([new TextEncoder().encode(t)]):this._body=yP.Readable.from([t||new ArrayBuffer(0)])}get body(){return vP(!this.bodyUsed),vP(bP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return bP(this._body)?await Hae(this._body):this._body||new ArrayBuffer(0)}async text(){let t=await this.arrayBuffer();return new TextDecoder().decode(t)}async json(){let t=await this.text();return JSON.parse(t)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var doe=Wt(require("http"),1),poe=Wt(require("https"),1);var LVe=e=>e&&e instanceof ArrayBuffer,MVe=e=>e&&e instanceof Buffer;function foe(e){let t=e.indexOf(","),r,n;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n=`text/plain${n}`):n="text/plain;charset=US-ASCII",{arrayBuffer:qVe(r),mimeType:n}}function qVe(e){if(LVe(e))return e;if(MVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var xP=e=>e.startsWith("data:"),NVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Gx(e,t){try{if(globalThis.fetch!==Gx&&(NVe(e)||xP(e)))return await fetch(e,t);if(xP(e)){let{arrayBuffer:c,mimeType:l}=foe(e);return new gl(c,{headers:{"content-type":l},url:e})}let r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let i=await UVe(n,t),a=WVe(e,i,r),{status:o,statusText:s}=HVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=GVe(e,a.get("location"));return await Gx(c,t)}return new gl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new gl(null,{status:400,statusText:String(r),url:e})}}async function UVe(e,t){return await new Promise((r,n)=>{let i=zVe(e,t),a=e.startsWith("https:")?poe.default.request(i,o=>r(o)):doe.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function GVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function zVe(e,t){let r=(t==null?void 0:t.headers)||{},n={};for(let a of Object.keys(r))n[a.toLowerCase()]=r[a];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";let i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...t==null?void 0:t.fetch,headers:n,port:i.port}}function HVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function WVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=VVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new au(n)}function VVe(e){return xP(e)?e.length-5:null}var KVe=parseInt(hoe.versions.node.split(".")[0]);RV&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=hP;globalThis.loaders.NodeFile=Xp;globalThis.loaders.NodeFileSystem=WA;globalThis.loaders.fetchNode=zA;globalThis.loaders.NodeHash=VA;globalThis.TextEncoder||(globalThis.TextEncoder=Ay);globalThis.TextDecoder||(globalThis.TextDecoder=Tp);!("atob"in globalThis)&&Sy&&(globalThis.atob=Sy);!("btoa"in globalThis)&&Pk&&(globalThis.btoa=Pk);globalThis.loaders.encodeImageNode=MY;globalThis.loaders.parseImageNode=MI;globalThis.loaders.imageFormatsNode=LI;globalThis._parseImageNode=MI;globalThis._imageFormatsNode=LI;globalThis.loaders.readFileAsArrayBuffer=ooe;globalThis.loaders.readFileAsText=soe;globalThis.loaders.requireFromFile=uoe;globalThis.loaders.requireFromString=ZA;KVe<18&&(!("Headers"in globalThis)&&au&&(globalThis.Headers=au),!("Response"in globalThis)&&gl&&(globalThis.Response=gl),!("fetch"in globalThis)&&Gx&&(globalThis.fetch=Gx));var s5e=require("path"),dV=Wt(axe(),1);var Ln={OBJECT_ID_TYPE:"OBJECTID",STRING_TYPE:"string",DOUBLE_TYPE:"double",SHORT_INT_TYPE:"Int32"};var aC=class{_attributeStorageInfo;_fields;_popupInfo;constructor(){this._attributeStorageInfo=[],this._fields=[]}get attributeStorageInfo(){return this._attributeStorageInfo}get fields(){return this._fields}get popupInfo(){return this._popupInfo}addMetadataInfo(t){if(!Object.keys(t).length)return;let r={OBJECTID:Ln.OBJECT_ID_TYPE,...t},n=!1,i=this._attributeStorageInfo.length;for(let a in r)if(!this._attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=this.createStorageAttribute(i,a,s),c=this.getFieldAttributeType(s),l=this.createFieldAttribute(a,c);this._attributeStorageInfo.push(u),this._fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this._attributeStorageInfo)a.push(o.name);this._popupInfo=this.createPopupInfo(a)}}createStorageAttribute(t,r,n){let i={key:`f_${t}`,name:r,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(n){case Ln.OBJECT_ID_TYPE:this.setupIdAttribute(i);break;case Ln.STRING_TYPE:this.setupStringAttribute(i);break;case Ln.DOUBLE_TYPE:this.setupDoubleAttribute(i);break;case Ln.SHORT_INT_TYPE:break;default:this.setupStringAttribute(i)}return i}getFieldAttributeType(t){switch(t){case Ln.OBJECT_ID_TYPE:return"esriFieldTypeOID";case Ln.STRING_TYPE:return"esriFieldTypeString";case Ln.SHORT_INT_TYPE:return"esriFieldTypeInteger";case Ln.DOUBLE_TYPE:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}setupIdAttribute(t){t.attributeValues={valueType:"Oid32",valuesPerElement:1}}setupStringAttribute(t){t.ordering.unshift("attributeByteCounts"),t.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),t.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},t.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}setupDoubleAttribute(t){t.attributeValues={valueType:"Float64",valuesPerElement:1}}createFieldAttribute(t,r){return{name:t,type:r,alias:t}}createPopupInfo(t){let r="{OBJECTID}",n=[],i=[],a=[],o=[];for(let s of t)i.push({fieldName:s,visible:!0,isEditable:!1,label:s});return a.push({fieldInfos:i,type:"fields"}),{title:r,mediaInfos:n,popupElements:a,fieldInfos:i,expressionInfos:o}}};var TTt=e=>typeof e=="boolean",Q1=e=>typeof e=="function",Ch=e=>e!==null&&typeof e=="object",t7=e=>Ch(e)&&e.constructor==={}.constructor;var oxe=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",sxe=e=>e&&typeof e[Symbol.asyncIterator]=="function";var fs=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ds=e=>typeof Blob<"u"&&e instanceof Blob,uxe=e=>e&&typeof e=="object"&&e.isBuffer;var CTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ch(e)&&Q1(e.tee)&&Q1(e.cancel)&&Q1(e.getReader);var DTt=e=>Ch(e)&&Q1(e.read)&&Q1(e.pipe)&&TTt(e.readable),oC=e=>CTt(e)||DTt(e);var FTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,kTt=/^([-\w.]+\/[-\w.+]+)/;function cxe(e){let t=kTt.exec(e);return t?t[1]:e}function r7(e){let t=FTt.exec(e);return t?t[1]:""}var lxe=/\?.*/;function fxe(e){let t=e.match(lxe);return t&&t[0]}function fv(e){return e.replace(lxe,"")}function Dh(e){return fs(e)?e.url:ds(e)?e.name||"":typeof e=="string"?e:""}function Z1(e){if(fs(e)){let t=e,r=t.headers.get("content-type")||"",n=fv(t.url);return cxe(r)||r7(n)}return ds(e)?e.type||"":typeof e=="string"?r7(e):""}function dxe(e){return fs(e)?e.headers["content-length"]||-1:ds(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function sC(e){if(fs(e))return e;let t={},r=dxe(e);r>=0&&(t["content-length"]=String(r));let n=Dh(e),i=Z1(e);i&&(t["content-type"]=i);let a=await OTt(e);a&&(t["x-first-bytes"]=a),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function pxe(e){if(!e.ok){let t=await BTt(e);throw new Error(t)}}async function BTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r!=null&&r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function OTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${ITt(r)}`}return null}function ITt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function PTt(e){return!RTt(e)&&!jTt(e)}function RTt(e){return e.startsWith("http:")||e.startsWith("https:")}function jTt(e){return e.startsWith("data:")}async function Oo(e,t){var r,n;if(typeof e=="string"){let i=ac(e);return PTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await sC(e)}function n7(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function hu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||n7()}var LTt=globalThis.self||globalThis.window||globalThis.global,dv=globalThis.window||globalThis.self||globalThis.global,MTt=globalThis.document||{},Fh=globalThis.process||{},qTt=globalThis.console,F0r=globalThis.navigator||{};var uC="4.1.0-alpha.6",O0r=hu();function NTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var cC=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";zt(this,"storage",void 0),zt(this,"id",void 0),zt(this,"config",void 0),this.storage=NTt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function hxe(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function mxe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function lC(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var fC;(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"})(fC||(fC={}));var UTt=10;function gxe(e){return typeof e!="string"?e:(e=e.toUpperCase(),fC[e]||fC.WHITE)}function vxe(e,t,r){if(!hu&&typeof e=="string"){if(t){let n=gxe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=gxe(r);e="\x1B[".concat(n+UTt,"m").concat(e,"\x1B[49m")}}return e}function bxe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function pv(e,t){if(!e)throw new Error(t||"Assertion failed")}function kh(){let e;if(hu()&&dv.performance){var t,r;e=dv===null||dv===void 0||(t=dv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Fh){var n;let i=Fh===null||Fh===void 0||(n=Fh.hrtime)===null||n===void 0?void 0:n.call(Fh);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var hv={debug:hu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},GTt={enabled:!0,level:0};function ps(){}var yxe={},xxe={once:!0},_c=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",uC),zt(this,"_startTs",kh()),zt(this,"_deltaTs",kh()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new cC("__probe-".concat(this.id,"__"),GTt),this.timeStamp("".concat(this.id," started")),bxe(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((kh()-this._startTs).toPrecision(10))}getDelta(){return Number((kh()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){pv(t,r)}warn(t){return this._getLogFunction(0,t,hv.warn,arguments,xxe)}error(t){return this._getLogFunction(0,t,hv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,hv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,hv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,hv.debug||hv.info,arguments,xxe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ps,n&&[n],{tag:VTt(r)}):ps}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?hu()?WTt({image:i,message:a,scale:o}):HTt({image:i,message:a,scale:o}):ps}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ps)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=_xe({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ps)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=wxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=_xe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,pv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=kh();let o=a.tag||a.message;if(a.once&&o)if(!yxe[o])yxe[o]=kh();else return ps;return r=zTt(this.id,a.message,a),n.bind(console,r,...a.args)}return ps}};zt(_c,"VERSION",uC);function wxe(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return pv(Number.isFinite(t)&&t>=0),t}function _xe(e){let{logLevel:t,message:r}=e;e.logLevel=wxe(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return pv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function zTt(e,t,r){if(typeof t=="string"){let n=r.time?mxe(hxe(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=vxe(t,r.color,r.background)}return t}function HTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ps}function WTt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=lC(a,r,n);console.log(...o)},a.src=t,ps}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...lC(t,r,n)),ps;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...lC(a,r,n)),a.src=t.toDataURL(),ps}return ps}function VTt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var amr=new _c({id:"@probe.gl/log"});var i7=new _c({id:"loaders.gl"}),dC=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},pC=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var a7={fetch:null,mimeType:void 0,nothrow:!1,log:new pC,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:gn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Exe={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 o7(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function mv(){let e=o7();return e.globalOptions=e.globalOptions||{...a7},e.globalOptions}function Txe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],KTt(e,r),YTt(t,e,n)}function KTt(e,t){Axe(e,null,a7,Exe,t);for(let r of t){let n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};Axe(n,r.id,i,a,t)}}function Axe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ch(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)i7.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=$Tt(s,i);i7.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function $Tt(e,t){let r=e.toLowerCase(),n="";for(let i of t)for(let a in i.options){if(e===a)return`Did you mean '${i.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${i.id}.${a}'?`)}return n}function YTt(e,t,r){let i={...e.options||{}};return JTt(i,r),i.log===null&&(i.log=new dC),Sxe(i,mv()),Sxe(i,t),i}function Sxe(e,t){for(let r in t)if(r in t){let n=t[r];t7(n)&&t7(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function JTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function e_(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function s7(e){Qt(e,"null loader"),Qt(e_(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var XTt=()=>{let e=o7();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Cxe(){return XTt()}var Dxe=new _c({id:"loaders.gl"});var QTt=/\.([^.]+)$/;async function Bxe(e,t=[],r,n){if(!Oxe(e))return null;let i=Fxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(ds(e)&&(e=await e.slice(0,10).arrayBuffer(),i=Fxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(Ixe(e));return i}function Fxe(e,t=[],r,n){if(!Oxe(e))return null;if(t&&!Array.isArray(t))return s7(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...Cxe()),e6t(i);let a=ZTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(Ixe(e));return a}function ZTt(e,t,r,n){let i=Dh(e),a=Z1(e),o=fv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=u7(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||t6t(t,o),u=u||(s?`matched url ${o}`:""),s=s||u7(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||n6t(t,e),u=u||(s?`matched initial data ${Pxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||u7(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&Dxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function Oxe(e){return!(e instanceof Response&&e.status===204)}function Ixe(e){let t=Dh(e),r=Z1(e),n="No valid loader found (";n+=t?`${nu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?Pxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function e6t(e){for(let t of e)s7(t)}function t6t(e,t){let r=t&&QTt.exec(t),n=r&&r[1];return n?r6t(e,n):null}function r6t(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function u7(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function n6t(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(i6t(t,r))return r}else if(ArrayBuffer.isView(t)){if(kxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&kxe(t,0,r))return r;return null}function i6t(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function kxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>a6t(e,t,r,i))}function a6t(e,t,r,n){if(n instanceof ArrayBuffer)return ic(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=c7(e,t,n.length);return n===i;default:return!1}}function Pxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?c7(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?c7(e,0,t):""}function c7(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function*Rxe(e,t){let r=(t==null?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;for(;n<e.length;){let a=Math.min(e.length-n,r),o=e.slice(n,n+a);n+=a,yield i.encode(o)}}function*jxe(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let i=Math.min(e.byteLength-n,r),a=new ArrayBuffer(i),o=new Uint8Array(e,n,i);new Uint8Array(a).set(o),n+=i,yield a}}async function*Lxe(e,t){let r=(t==null?void 0:t.chunkSize)||1048576,n=0;for(;n<e.size;){let i=n+r,a=await e.slice(n,i).arrayBuffer();n=i,yield a}}function l7(e,t){return gn?o6t(e,t):s6t(e,t)}async function*o6t(e,t){let r=e.getReader(),n;try{for(;;){let i=n||r.read();t!=null&&t._streamReadAhead&&(n=r.read());let{done:a,value:o}=await i;if(a)return;yield pl(o)}}catch{r.releaseLock()}}async function*s6t(e,t){for await(let r of e)yield pl(r)}function Mxe(e,t){if(typeof e=="string")return Rxe(e,t);if(e instanceof ArrayBuffer)return jxe(e,t);if(ds(e))return Lxe(e,t);if(oC(e))return l7(e,t);if(fs(e))return l7(e.body,t);throw new Error("makeIterator")}var qxe="Cannot convert supplied data type";function u6t(e,t,r){if(t.text&&typeof e=="string")return e;if(uxe(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,i=e.byteLength||e.length;return(e.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+i)),n}throw new Error(qxe)}async function Nxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return u6t(e,t,r);if(ds(e)&&(e=await sC(e)),fs(e)){let i=e;return await pxe(i),t.binary?await i.arrayBuffer():await i.text()}if(oC(e)&&(e=Mxe(e,r)),oxe(e)||sxe(e))return Yp(e);throw new Error(qxe)}function hC(e,t){let r=mv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ch(n.fetch)?i=>Oo(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:Oo}function Uxe(e,t,r){if(r)return r;let n={fetch:hC(t,e),...e};if(n.url){let i=fv(n.url);n.baseUrl=i,n.queryString=fxe(n.url),n.filename=nu.filename(i),n.baseUrl=nu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Gxe(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function Io(e,t,r,n){t&&!Array.isArray(t)&&!e_(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Dh(e),o=Gxe(t,n),s=await Bxe(e,o,r);return s?(r=Txe(r,s,o,i),n=Uxe({url:i,_parse:Io,loaders:o},r,n||null),await c6t(s,e,r,n)):null}async function c6t(e,t,r,n){if(WI(e),r=qI(e.options,r),fs(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,d=Object.fromEntries(a.headers.entries());n.response={headers:d,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Nxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(YI(e,r))return await JI(e,t,r,n,Io);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw ga(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function zxe(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 f7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],d=s[c+2];t=l<t?l:t,r=f<r?f:r,n=d<n?d:n,i=l>i?l:i,a=f>a?f:a,o=d>o?d:o}return[[t,r,n],[i,a,o]]}function d7(e,t,r){let n=zxe(t.value),i=r||Hxe(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function Hxe(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function An(e,t,r,n){let i,a;!Array.isArray(t)&&!e_(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=hC(a),s=e;return typeof e=="string"&&(s=await o(e)),ds(e)&&(s=await o(e)),Array.isArray(i)?await Io(s,i,a):await Io(s,i,a)}async function gv(e,t,r){return r={...mv(),...r},t.encodeURLtoURL?l6t(t,e,r):XI(t,r)?await HI(t,e,r):await t.encode(e,r)}function mC(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeTextSync)return new TextEncoder().encode(t.encodeTextSync(e,r));throw new Error(`Writer ${t.name} could not synchronously encode data`)}async function Vxe(e,t,r,n){if(e=ac(e),t=ac(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}async function l6t(e,t,r){if(gn)throw new Error(`Writer ${e.name} not supported in browser`);let n=Wxe("input");await new Jp(n,"w").write(t);let a=Wxe("output"),o=await Vxe(n,a,e,r);return(await Oo(o)).arrayBuffer()}function Wxe(e){return`/tmp/${e}`}var f6t=1/Math.PI*180,d6t=1/180*Math.PI,p6t={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...p6t}};var Sn=globalThis.mathgl.config;function p7(e,{precision:t=Sn.precision}={}){return e=h6t(e),"".concat(parseFloat(e.toPrecision(t)))}function hs(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function h7(e){return Kxe(e)}function m7(e){return Bl(e)}function Kxe(e,t){return v7(e,r=>r*d6t,t)}function Bl(e,t){return v7(e,r=>r*f6t,t)}function g7(e,t,r){return v7(e,n=>Math.max(t,Math.min(r,n)))}function Po(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(hs(e)&&hs(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Po(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Sn.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Sn.EPSILON=n}}function h6t(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function m6t(e){return e.clone?e.clone():new Array(e.length)}function v7(e,t,r){if(hs(e)){let n=e;r=r||m6t(n);for(let i=0;i<r.length&&i<n.length;++i){let a=typeof e=="number"?e:e[i];r[i]=t(a,i,r)}return r}return t(e)}function g6t(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var wd=class extends g6t(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:hs(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Sn)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+p7(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Po(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let a=t[i],o=typeof r=="number"?r:r[i];this[i]=a+n*(o-a)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Sn.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function v6t(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Ar(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Ed(e,t,r=""){if(Sn.debug&&!v6t(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function oa(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var Ad=class extends wd{get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Ar(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Ar(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return oa(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return oa(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Mn=typeof Float32Array<"u"?Float32Array:Array,t_=Math.random;function vv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Zgr=Math.PI/180;function b6t(){let e=new Mn(2);return Mn!=Float32Array&&(e[0]=0,e[1]=0),e}function $xe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e}function Yxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function gC(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function vC(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var evr=function(){let e=b6t();return function(t,r,n,i,a,o){let s,u;for(r||(r=2),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}();function bC(e,t,r){let n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function yC(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Jxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function Xxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3],e}function xC(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Bh=class extends Ad{constructor(t=0,r=0){super(2),hs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return vC(this,this,t),this.check()}transformAsVector(t){return bC(this,this,t),this.check()}transformByMatrix3(t){return gC(this,this,t),this.check()}transformByMatrix2x3(t){return Yxe(this,this,t),this.check()}transformByMatrix2(t){return $xe(this,this,t),this.check()}};var yv={};da(yv,{add:()=>w6t,angle:()=>w7,bezier:()=>R6t,ceil:()=>E6t,clone:()=>y6t,copy:()=>x6t,create:()=>_C,cross:()=>Oh,dist:()=>H6t,distance:()=>r1e,div:()=>z6t,divide:()=>t1e,dot:()=>r_,equals:()=>N6t,exactEquals:()=>q6t,floor:()=>A6t,forEach:()=>K6t,fromValues:()=>wC,hermite:()=>P6t,inverse:()=>B6t,len:()=>E7,length:()=>Qxe,lerp:()=>O6t,max:()=>T6t,min:()=>S6t,mul:()=>G6t,multiply:()=>e1e,negate:()=>k6t,normalize:()=>b7,random:()=>j6t,rotateX:()=>y7,rotateY:()=>x7,rotateZ:()=>_7,round:()=>C6t,scale:()=>D6t,scaleAndAdd:()=>F6t,set:()=>_6t,slerp:()=>I6t,sqrDist:()=>W6t,sqrLen:()=>V6t,squaredDistance:()=>n1e,squaredLength:()=>i1e,str:()=>M6t,sub:()=>U6t,subtract:()=>Zxe,transformMat3:()=>n_,transformMat4:()=>Ih,transformQuat:()=>i_,zero:()=>L6t});function _C(){let e=new Mn(3);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function y6t(e){let t=new Mn(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Qxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function wC(e,t,r){let n=new Mn(3);return n[0]=e,n[1]=t,n[2]=r,n}function x6t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function _6t(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function w6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Zxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function e1e(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function t1e(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function E6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function A6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function S6t(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function T6t(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function C6t(e,t){return e[0]=vv(t[0]),e[1]=vv(t[1]),e[2]=vv(t[2]),e}function D6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function F6t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function r1e(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function n1e(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function i1e(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function k6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function B6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function b7(e,t){let r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function r_(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Oh(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function O6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function I6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(r_(t,r),-1),1)),a=Math.sin(i),o=Math.sin((1-n)*i)/a,s=Math.sin(n*i)/a;return e[0]=o*t[0]+s*r[0],e[1]=o*t[1]+s*r[1],e[2]=o*t[2]+s*r[2],e}function P6t(e,t,r,n,i,a){let o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,c=o*(a-1),l=o*(3-2*a);return e[0]=t[0]*s+r[0]*u+n[0]*c+i[0]*l,e[1]=t[1]*s+r[1]*u+n[1]*c+i[1]*l,e[2]=t[2]*s+r[2]*u+n[2]*c+i[2]*l,e}function R6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,d=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*d,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*d,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*d,e}function j6t(e,t){t=t===void 0?1:t;let r=t_()*2*Math.PI,n=t_()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}function Ih(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function n_(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function i_(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,d=n*u-i*s,p=i*d-a*f,h=a*l-n*d,b=n*f-i*l,g=o*2;return l*=g,f*=g,d*=g,p*=2,h*=2,b*=2,e[0]=s+l+p,e[1]=u+f+h,e[2]=c+d+b,e}function y7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function x7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function _7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function w7(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt((r*r+n*n+i*i)*(a*a+o*o+s*s)),c=u&&r_(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function L6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function M6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function q6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function N6t(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(r-a)<=1e-6*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=1e-6*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))}var U6t=Zxe,G6t=e1e,z6t=t1e,H6t=r1e,W6t=n1e,E7=Qxe,V6t=i1e,K6t=function(){let e=_C();return function(t,r,n,i,a,o){let s,u;for(r||(r=3),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}();var A7=[0,0,0],EC,ce=class extends Ad{static get ZERO(){return EC||(EC=new ce(0,0,0),Object.freeze(EC)),EC}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&hs(t)?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Ar(t)}angle(t){return w7(this,t)}cross(t){return Oh(this,this,t),this.check()}rotateX({radians:t,origin:r=A7}){return y7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=A7}){return x7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=A7}){return _7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ih(this,this,t),this.check()}transformAsVector(t){return yC(this,this,t),this.check()}transformByMatrix3(t){return n_(this,this,t),this.check()}transformByMatrix2(t){return Jxe(this,this,t),this.check()}transformByQuaternion(t){return i_(this,this,t),this.check()}};var AC,ms=class extends Ad{static get ZERO(){return AC||(AC=new ms(0,0,0,0),Object.freeze(AC)),AC}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),hs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n),Ar(i)),this[0]=t,this[1]=r,this[2]=n,this[3]=i)}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z),Ar(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}transform(t){return Ih(this,this,t),this.check()}transformByMatrix3(t){return xC(this,this,t),this.check()}transformByMatrix2(t){return Xxe(this,this,t),this.check()}transformByQuaternion(t){return i_(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var xv=class extends wd{toString(){let t="[";if(Sn.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Ar(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function a1e(){let e=new Mn(9);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function o1e(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function s1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,d=-l*a+s*u,p=c*a-o*u,h=r*f+n*d+i*p;return h?(h=1/h,e[0]=f*h,e[1]=(-l*n+i*c)*h,e[2]=(s*n-i*o)*h,e[3]=d*h,e[4]=(l*r-i*u)*h,e[5]=(-s*r+i*a)*h,e[6]=p*h,e[7]=(-c*r+n*u)*h,e[8]=(o*r-n*a)*h,e):null}function u1e(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s)}function S7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],p=r[1],h=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=d*n+p*o+h*c,e[1]=d*i+p*s+h*l,e[2]=d*a+p*u+h*f,e[3]=b*n+g*o+x*c,e[4]=b*i+g*s+x*l,e[5]=b*a+g*u+x*f,e[6]=E*n+S*o+F*c,e[7]=E*i+S*s+F*l,e[8]=E*a+S*u+F*f,e}function c1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],p=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+p*o+c,e[7]=d*i+p*s+l,e[8]=d*a+p*u+f,e}function l1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=Math.sin(r),p=Math.cos(r);return e[0]=p*n+d*o,e[1]=p*i+d*s,e[2]=p*a+d*u,e[3]=p*o-d*n,e[4]=p*s-d*i,e[5]=p*u-d*a,e[6]=c,e[7]=l,e[8]=f,e}function T7(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function f1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,p=i*s,h=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-h,e[3]=l-x,e[6]=d+g,e[1]=l+x,e[4]=1-c-h,e[7]=p-b,e[2]=d-g,e[5]=p+b,e[8]=1-c-f,e}var C7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(C7||(C7={}));var Y6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends xv{static get IDENTITY(){return X6t()}static get ZERO(){return J6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return C7}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(Y6t)}fromObject(t){return this.check()}fromQuaternion(t){return f1e(this,t),this.check()}set(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=i,this[2]=s,this[3]=r,this[4]=a,this[5]=u,this[6]=n,this[7]=o,this[8]=c,this.check()}determinant(){return u1e(this)}transpose(){return o1e(this,this),this.check()}invert(){return s1e(this,this),this.check()}multiplyLeft(t){return S7(this,t,this),this.check()}multiplyRight(t){return S7(this,this,t),this.check()}rotate(t){return l1e(this,this,t),this.check()}scale(t){return Array.isArray(t)?T7(this,this,t):T7(this,this,[t,t]),this.check()}translate(t){return c1e(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=gC(r||[-0,-0],t,this);break;case 3:n=n_(r||[-0,-0,-0],t,this);break;case 4:n=xC(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ed(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},SC,TC=null;function J6t(){return SC||(SC=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(SC)),SC}function X6t(){return TC||(TC=new Rr,Object.freeze(TC)),TC}var CC={};da(CC,{add:()=>w3t,adjoint:()=>n3t,clone:()=>Z6t,copy:()=>e3t,create:()=>Q6t,decompose:()=>p3t,determinant:()=>k7,equals:()=>T3t,exactEquals:()=>S3t,frob:()=>_3t,fromQuat:()=>L7,fromQuat2:()=>l3t,fromRotation:()=>o3t,fromRotationTranslation:()=>p1e,fromRotationTranslationScale:()=>h3t,fromRotationTranslationScaleOrigin:()=>m3t,fromScaling:()=>a3t,fromTranslation:()=>i3t,fromValues:()=>t3t,fromXRotation:()=>s3t,fromYRotation:()=>u3t,fromZRotation:()=>c3t,frustum:()=>M7,getRotation:()=>d3t,getScaling:()=>h1e,getTranslation:()=>f3t,identity:()=>d1e,invert:()=>F7,lookAt:()=>U7,mul:()=>C3t,multiply:()=>a_,multiplyScalar:()=>E3t,multiplyScalarAndAdd:()=>A3t,ortho:()=>N7,orthoNO:()=>g1e,orthoZO:()=>b3t,perspective:()=>q7,perspectiveFromFieldOfView:()=>v3t,perspectiveNO:()=>m1e,perspectiveZO:()=>g3t,rotate:()=>I7,rotateX:()=>P7,rotateY:()=>R7,rotateZ:()=>j7,scale:()=>O7,set:()=>r3t,str:()=>x3t,sub:()=>D3t,subtract:()=>v1e,targetTo:()=>y3t,translate:()=>B7,transpose:()=>D7});function Q6t(){let e=new Mn(16);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Z6t(e){let t=new Mn(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function e3t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function t3t(e,t,r,n,i,a,o,s,u,c,l,f,d,p,h,b){let g=new Mn(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=d,g[13]=p,g[14]=h,g[15]=b,g}function r3t(e,t,r,n,i,a,o,s,u,c,l,f,d,p,h,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=d,e[12]=p,e[13]=h,e[14]=b,e[15]=g,e}function d1e(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 D7(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function F7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],h=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*h,C=l*g-d*h,I=l*x-p*h,P=f*g-d*b,U=f*x-p*b,Y=d*x-p*g,J=E*Y-S*U+F*P+D*I-j*C+k*N;return J?(J=1/J,e[0]=(s*Y-u*U+c*P)*J,e[1]=(i*U-n*Y-a*P)*J,e[2]=(b*k-g*j+x*D)*J,e[3]=(d*j-f*k-p*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-h*k-x*S)*J,e[7]=(l*k-d*F+p*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(h*j-b*F+x*E)*J,e[11]=(f*F-l*j-p*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-h*D-g*E)*J,e[15]=(l*D-f*S+d*E)*J,e):null}function n3t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],h=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*h,C=l*g-d*h,I=l*x-p*h,P=f*g-d*b,U=f*x-p*b,Y=d*x-p*g;return e[0]=s*Y-u*U+c*P,e[1]=i*U-n*Y-a*P,e[2]=b*k-g*j+x*D,e[3]=d*j-f*k-p*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-h*k-x*S,e[7]=l*k-d*F+p*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=h*j-b*F+x*E,e[11]=f*F-l*j-p*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-h*D-g*E,e[15]=l*D-f*S+d*E,e}function k7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],h=e[13],b=e[14],g=e[15],x=t*o-r*a,E=t*s-n*a,S=r*s-n*o,F=c*h-l*p,D=c*b-f*p,j=l*b-f*h,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=p*S-h*E+b*x;return u*k-i*N+g*C-d*I}function a_(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=t[9],p=t[10],h=t[11],b=t[12],g=t[13],x=t[14],E=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*d+j*g,e[2]=S*a+F*c+D*p+j*x,e[3]=S*o+F*l+D*h+j*E,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*d+j*g,e[6]=S*a+F*c+D*p+j*x,e[7]=S*o+F*l+D*h+j*E,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*d+j*g,e[10]=S*a+F*c+D*p+j*x,e[11]=S*o+F*l+D*h+j*E,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*d+j*g,e[14]=S*a+F*c+D*p+j*x,e[15]=S*o+F*l+D*h+j*E,e}function B7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,d,p,h,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],d=t[6],p=t[7],h=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=d,e[7]=p,e[8]=h,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+h*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+d*i+g*a+t[14],e[15]=c*n+p*i+x*a+t[15]),e}function O7(e,t,r){let n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function I7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,d,p,h,b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],d=t[1],p=t[2],h=t[3],b=t[4],g=t[5],x=t[6],E=t[7],S=t[8],F=t[9],D=t[10],j=t[11],k=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,I=i*a*l-o*c,P=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,J=a*o*l-i*c,re=o*o*l+u,e[0]=f*k+b*N+S*C,e[1]=d*k+g*N+F*C,e[2]=p*k+x*N+D*C,e[3]=h*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=d*I+g*P+F*U,e[6]=p*I+x*P+D*U,e[7]=h*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=d*Y+g*J+F*re,e[10]=p*Y+x*J+D*re,e[11]=h*Y+E*J+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function P7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+d*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=d*i-u*n,e}function R7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-d*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+d*i,e}function j7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+d*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=d*i-u*n,e}function i3t(e,t){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]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function a3t(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function o3t(e,t,r){let n=r[0],i=r[1],a=r[2],o=Math.sqrt(n*n+i*i+a*a),s,u,c;return o<1e-6?null:(o=1/o,n*=o,i*=o,a*=o,u=Math.sin(t),s=Math.cos(t),c=1-s,e[0]=n*n*c+s,e[1]=i*n*c+a*u,e[2]=a*n*c-i*u,e[3]=0,e[4]=n*i*c-a*u,e[5]=i*i*c+s,e[6]=a*i*c+n*u,e[7]=0,e[8]=n*a*c+i*u,e[9]=i*a*c-n*u,e[10]=a*a*c+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function s3t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function u3t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function c3t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,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 p1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,d=n*c,p=i*u,h=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(p+b),e[1]=f+E,e[2]=d-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=h+g,e[7]=0,e[8]=d+x,e[9]=h-g,e[10]=1-(l+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function l3t(e,t){let r=new Mn(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=n*n+i*i+a*a+o*o;return f>0?(r[0]=(s*o+l*n+u*a-c*i)*2/f,r[1]=(u*o+l*i+c*n-s*a)*2/f,r[2]=(c*o+l*a+s*i-u*n)*2/f):(r[0]=(s*o+l*n+u*a-c*i)*2,r[1]=(u*o+l*i+c*n-s*a)*2,r[2]=(c*o+l*a+s*i-u*n)*2),p1e(e,t,r),e}function f3t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function h1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(a*a+o*o+s*s),e[2]=Math.sqrt(u*u+c*c+l*l),e}function d3t(e,t){let r=new Mn(3);h1e(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,d=t[8]*n,p=t[9]*i,h=t[10]*a,b=o+l+h,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-p)/g,e[1]=(d-u)/g,e[2]=(s-c)/g):o>l&&o>h?(g=Math.sqrt(1+o-l-h)*2,e[3]=(f-p)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(d+u)/g):l>h?(g=Math.sqrt(1+l-o-h)*2,e[3]=(d-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+p)/g):(g=Math.sqrt(1+h-o-l)*2,e[3]=(s-c)/g,e[0]=(d+u)/g,e[1]=(f+p)/g,e[2]=.25*g),e}function p3t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],d=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+d*d);let p=1/r[0],h=1/r[1],b=1/r[2],g=i*p,x=a*h,E=o*b,S=s*p,F=u*h,D=c*b,j=l*p,k=f*h,N=d*b,C=g+F+N,I=0;return C>0?(I=Math.sqrt(C+1)*2,e[3]=.25*I,e[0]=(D-k)/I,e[1]=(j-E)/I,e[2]=(x-S)/I):g>F&&g>N?(I=Math.sqrt(1+g-F-N)*2,e[3]=(D-k)/I,e[0]=.25*I,e[1]=(x+S)/I,e[2]=(j+E)/I):F>N?(I=Math.sqrt(1+F-g-N)*2,e[3]=(j-E)/I,e[0]=(x+S)/I,e[1]=.25*I,e[2]=(D+k)/I):(I=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/I,e[0]=(j+E)/I,e[1]=(D+k)/I,e[2]=.25*I),e}function h3t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,d=i*c,p=i*l,h=a*c,b=a*l,g=o*l,x=s*u,E=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(h+g))*F,e[1]=(d+S)*F,e[2]=(p-E)*F,e[3]=0,e[4]=(d-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(p+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+h))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function m3t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,d=a*c,p=a*l,h=a*f,b=o*l,g=o*f,x=s*f,E=u*c,S=u*l,F=u*f,D=n[0],j=n[1],k=n[2],N=i[0],C=i[1],I=i[2],P=(1-(b+x))*D,U=(p+F)*D,Y=(h-S)*D,J=(p-F)*j,re=(1-(d+x))*j,ee=(g+E)*j,ge=(h+S)*k,ye=(g-E)*k,pe=(1-(d+b))*k;return e[0]=P,e[1]=U,e[2]=Y,e[3]=0,e[4]=J,e[5]=re,e[6]=ee,e[7]=0,e[8]=ge,e[9]=ye,e[10]=pe,e[11]=0,e[12]=r[0]+N-(P*N+J*C+ge*I),e[13]=r[1]+C-(U*N+re*C+ye*I),e[14]=r[2]+I-(Y*N+ee*C+pe*I),e[15]=1,e}function L7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,p=i*s,h=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-h,e[1]=l+x,e[2]=d-g,e[3]=0,e[4]=l-x,e[5]=1-c-h,e[6]=p+b,e[7]=0,e[8]=d+g,e[9]=p-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function M7(e,t,r,n,i,a,o){let s=1/(r-t),u=1/(i-n),c=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}function m1e(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=(i+n)*o,e[14]=2*i*n*o}else e[10]=-1,e[14]=-2*n;return e}var q7=m1e;function g3t(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=i*o,e[14]=i*n*o}else e[10]=-1,e[14]=-n;return e}function v3t(e,t,r,n){let i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(i+a);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((o-s)*u*.5),e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function g1e(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e}var N7=g1e;function b3t(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=a*c,e[15]=1,e}function U7(e,t,r,n){let i,a,o,s,u,c,l,f,d,p,h=t[0],b=t[1],g=t[2],x=n[0],E=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(h-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?d1e(e):(f=h-F,d=b-D,p=g-j,i=1/Math.sqrt(f*f+d*d+p*p),f*=i,d*=i,p*=i,a=E*p-S*d,o=S*f-x*p,s=x*d-E*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=d*s-p*o,c=p*a-f*s,l=f*o-d*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=p,e[11]=0,e[12]=-(a*h+o*b+s*g),e[13]=-(u*h+c*b+l*g),e[14]=-(f*h+d*b+p*g),e[15]=1,e)}function y3t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],d=o-r[2],p=l*l+f*f+d*d;p>0&&(p=1/Math.sqrt(p),l*=p,f*=p,d*=p);let h=u*d-c*f,b=c*l-s*d,g=s*f-u*l;return p=h*h+b*b+g*g,p>0&&(p=1/Math.sqrt(p),h*=p,b*=p,g*=p),e[0]=h,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-d*b,e[5]=d*h-l*g,e[6]=l*b-f*h,e[7]=0,e[8]=l,e[9]=f,e[10]=d,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function x3t(e){return"mat4(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3],", ").concat(e[4],", ").concat(e[5],", ").concat(e[6],", ").concat(e[7],", ").concat(e[8],", ").concat(e[9],", ").concat(e[10],", ").concat(e[11],", ").concat(e[12],", ").concat(e[13],", ").concat(e[14],", ").concat(e[15],")")}function _3t(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function w3t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function v1e(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function E3t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function A3t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function S3t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function T3t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],h=e[12],b=e[13],g=e[14],x=e[15],E=t[0],S=t[1],F=t[2],D=t[3],j=t[4],k=t[5],N=t[6],C=t[7],I=t[8],P=t[9],U=t[10],Y=t[11],J=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-S)<=1e-6*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(i-F)<=1e-6*Math.max(1,Math.abs(i),Math.abs(F))&&Math.abs(a-D)<=1e-6*Math.max(1,Math.abs(a),Math.abs(D))&&Math.abs(o-j)<=1e-6*Math.max(1,Math.abs(o),Math.abs(j))&&Math.abs(s-k)<=1e-6*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(u-N)<=1e-6*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(p-Y)<=1e-6*Math.max(1,Math.abs(p),Math.abs(Y))&&Math.abs(h-J)<=1e-6*Math.max(1,Math.abs(h),Math.abs(J))&&Math.abs(b-re)<=1e-6*Math.max(1,Math.abs(b),Math.abs(re))&&Math.abs(g-ee)<=1e-6*Math.max(1,Math.abs(g),Math.abs(ee))&&Math.abs(x-ge)<=1e-6*Math.max(1,Math.abs(x),Math.abs(ge))}var C3t=a_,D3t=v1e;function F3t(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function b1e(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function y1e(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function x1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function _1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function w1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function E1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function A1e(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function S1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function T1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,d=c*a+o*i-s*n,p=-o*n-s*i-u*a;return e[0]=l*c+p*-o+f*-u-d*-s,e[1]=f*c+p*-s+d*-o-l*-u,e[2]=d*c+p*-u+l*-s-f*-o,e[3]=t[3],e}var Ovr=function(){let e=F3t();return function(t,r,n,i,a,o){let s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var H7;(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"})(H7||(H7={}));var B3t=45*Math.PI/180,O3t=1,G7=.1,z7=500,I3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends xv{static get IDENTITY(){return R3t()}static get ZERO(){return P3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return H7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,d,p,h,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=d,this[12]=p,this[13]=h,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,d,p,h,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=p,this[4]=r,this[5]=o,this[6]=l,this[7]=h,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=d,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(I3t)}fromObject(t){return this.check()}fromQuaternion(t){return L7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=G7,far:s=z7}=t;return s===1/0?j3t(this,r,n,i,a,o):M7(this,r,n,i,a,o,s),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return U7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=G7,far:s=z7}=t;return N7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=B3t,aspect:n=O3t,focalDistance:i=1,near:a=G7,far:o=z7}=t;C1e(r);let s=r/2,u=i*Math.tan(s),c=u*n;return this.ortho({left:-c,right:c,bottom:-u,top:u,near:a,far:o})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:a=500}=t;return C1e(r),q7(this,r,n,i,a),this.check()}determinant(){return k7(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*a,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*a,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*a,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*a,t[8]=this[10]*o,t}transpose(){return D7(this,this),this.check()}invert(){return F7(this,this),this.check()}multiplyLeft(t){return a_(this,t,this),this.check()}multiplyRight(t){return a_(this,this,t),this.check()}rotateX(t){return P7(this,this,t),this.check()}rotateY(t){return R7(this,this,t),this.check()}rotateZ(t){return j7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return I7(this,this,t,r),this.check()}scale(t){return O7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return B7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=S1e(r||[-0,-0,-0,-0],t,this),Ed(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=vC(r||[-0,-0],t,this);break;case 3:i=Ih(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ed(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=bC(r||[-0,-0],t,this);break;case 3:n=yC(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ed(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},DC,FC;function P3t(){return DC||(DC=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(DC)),DC}function R3t(){return FC||(FC=new Kr,Object.freeze(FC)),FC}function C1e(e){if(e>Math.PI*2)throw Error("expected radians")}function j3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,d=-2*a;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]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}function D1e(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function F1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function W7(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function V7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function k1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function B1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function O1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function I1e(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function o_(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],d,p,h,b,g;return d=i*u+a*c+o*l+s*f,d<0&&(d=-d,u=-u,c=-c,l=-l,f=-f),1-d>1e-6?(p=Math.acos(d),g=Math.sin(p),h=Math.sin((1-n)*p)/g,b=Math.sin(n*p)/g):(h=1-n,b=n),e[0]=h*i+b*u,e[1]=h*a+b*c,e[2]=h*o+b*l,e[3]=h*s+b*f,e}function P1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function R1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function K7(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+o]-t[o*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[o]=(t[o*3+i]+t[i*3+o])*n}return e}var j1e=b1e;var L1e=y1e,M1e=E1e,q1e=A1e,N1e=x1e;var U1e=_1e;var G1e=w1e;var z1e=function(){let e=_C(),t=wC(1,0,0),r=wC(0,1,0);return function(n,i,a){let o=r_(i,a);return o<-.999999?(Oh(e,t,i),E7(e)<1e-6&&Oh(e,r,i),b7(e,e),W7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Oh(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,G1e(n,n))}}(),Vvr=function(){let e=D1e(),t=D1e();return function(r,n,i,a,o,s){return o_(e,n,o,s),o_(t,i,a,s),o_(r,e,t,2*s*(1-s)),r}}(),Kvr=function(){let e=a1e();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],G1e(t,K7(t,e))}}();var L3t=[0,0,0,1],gs=class extends wd{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return K7(this,t),this.check()}fromAxisRotation(t,r){return W7(this,t,r),this.check()}identity(){return F1e(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}len(){return N1e(this)}lengthSquared(){return U1e(this)}dot(t){return M1e(this,t)}rotationTo(t,r){return z1e(this,t,r),this.check()}add(t){return j1e(this,this,t),this.check()}calculateW(){return I1e(this,this),this.check()}conjugate(){return R1e(this,this),this.check()}invert(){return P1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(q1e(this,t,r,n),this.check())}multiplyRight(t){return V7(this,this,t),this.check()}multiplyLeft(t){return V7(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return k1e(this,this,t),this.check()}rotateY(t){return B1e(this,this,t),this.check()}rotateZ(t){return O1e(this,this,t),this.check()}scale(t){return L1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=L3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return o_(this,i,a,o),this.check()}transformVector4(t,r=new ms){return T1e(r,t,this),Ed(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var mu={};da(mu,{EPSILON1:()=>M3t,EPSILON10:()=>K3t,EPSILON11:()=>$3t,EPSILON12:()=>Y3t,EPSILON13:()=>J3t,EPSILON14:()=>X3t,EPSILON15:()=>Q3t,EPSILON16:()=>Z3t,EPSILON17:()=>e8t,EPSILON18:()=>t8t,EPSILON19:()=>r8t,EPSILON2:()=>q3t,EPSILON20:()=>n8t,EPSILON3:()=>N3t,EPSILON4:()=>U3t,EPSILON5:()=>G3t,EPSILON6:()=>z3t,EPSILON7:()=>H3t,EPSILON8:()=>W3t,EPSILON9:()=>V3t,PI_OVER_FOUR:()=>a8t,PI_OVER_SIX:()=>o8t,PI_OVER_TWO:()=>i8t,TWO_PI:()=>s8t});var M3t=.1,q3t=.01,N3t=.001,U3t=1e-4,G3t=1e-5,z3t=1e-6,H3t=1e-7,W3t=1e-8,V3t=1e-9,K3t=1e-10,$3t=1e-11,Y3t=1e-12,J3t=1e-13,X3t=1e-14,Q3t=1e-15,Z3t=1e-16,e8t=1e-17,t8t=1e-18,r8t=1e-19,n8t=1e-20,i8t=Math.PI/2,a8t=Math.PI/4,o8t=Math.PI/6,s8t=Math.PI*2;var Ol=6356752314245179e-9,u8t={radii:[6378137,6378137,Ol],radiiSquared:[6378137*6378137,6378137*6378137,Ol*Ol],oneOverRadii:[1/6378137,1/6378137,1/Ol],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Ol*Ol)],maximumRadius:Math.max(6378137,6378137,Ol),centerToleranceSquared:.1};function kC(e){return e}var Abr=new ce;function c8t(e,t=[],r=kC){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function H1e(e,t=[]){return c8t(e,t,Sn._cartographicRadians?kC:h7)}function l8t(e,t,r=kC){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function W1e(e,t){return l8t(e,t,Sn._cartographicRadians?kC:m7)}var V1e=1e-14,f8t=new ce,K1e={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"}},$7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},s_={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},d8t=new ce,p8t=new ce,h8t=new ce;function Y7(e,t,r,n,i,a){let o=K1e[t]&&K1e[t][r];oa(o&&(!n||n===o));let s,u,c,l=f8t.copy(i);if(Po(l.x,0,V1e)&&Po(l.y,0,V1e)){let d=Math.sign(l.z);s=d8t.fromArray($7[t]),t!=="east"&&t!=="west"&&s.scale(d),u=p8t.fromArray($7[r]),r!=="east"&&r!=="west"&&u.scale(d),c=h8t.fromArray($7[n]),n!=="east"&&n!=="west"&&c.scale(d)}else{let{up:d,east:p,north:h}=s_;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),h.copy(d).cross(p);let{down:b,west:g,south:x}=s_;b.copy(d).scale(-1),g.copy(p).scale(-1),x.copy(h).scale(-1),s=s_[t],u=s_[r],c=s_[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=c.x,a[9]=c.y,a[10]=c.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var _v=new ce,m8t=new ce,g8t=new ce;function $1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;_v.from(e);let o=_v.x,s=_v.y,u=_v.z,c=n.x,l=n.y,f=n.z,d=o*o*c*c,p=s*s*l*l,h=u*u*f*f,b=d+p+h,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=m8t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=g8t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*_v.len()/(.5*D.len()),k=0,N,C,I,P;do{j-=k,N=1/(1+j*E),C=1/(1+j*S),I=1/(1+j*F);let U=N*N,Y=C*C,J=I*I,re=U*N,ee=Y*C,ge=J*I;P=d*U+p*Y+h*J-1;let pe=-2*(d*re*E+p*ee*S+h*ge*F);k=P/pe}while(Math.abs(P)>mu.EPSILON12);return _v.scale([N,C,I]).to(r)}var BC=new ce,Y1e=new ce,y8t=new ce,gu=new ce,x8t=new ce,OC=new ce,or=class{constructor(t=0,r=0,n=0){zt(this,"radii",void 0),zt(this,"radiiSquared",void 0),zt(this,"radiiToTheFourth",void 0),zt(this,"oneOverRadii",void 0),zt(this,"oneOverRadiiSquared",void 0),zt(this,"minimumRadius",void 0),zt(this,"maximumRadius",void 0),zt(this,"centerToleranceSquared",mu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),oa(t>=0),oa(r>=0),oa(n>=0),this.radii=new ce(t,r,n),this.radiiSquared=new ce(t*t,r*r,n*n),this.radiiToTheFourth=new ce(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new ce(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new ce(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=Y1e,i=y8t,[,,a]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);let o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(a),i.add(n),i.to(r)}cartesianToCartographic(t,r=[0,0,0]){OC.from(t);let n=this.scaleToGeodeticSurface(OC,gu);if(!n)return;let i=this.geodeticSurfaceNormal(n,Y1e),a=x8t;a.copy(OC).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(yv.dot(a,OC))*yv.length(a);return W1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return Y7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return Y7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return BC.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=H1e(t),i=n[0],a=n[1],o=Math.cos(a);return BC.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),BC.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return BC.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return $1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){gu.from(t);let n=gu.x,i=gu.y,a=gu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return gu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return gu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return gu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){oa(Po(this.radii.x,this.radii.y,mu.EPSILON15)),oa(this.radii.z>0),gu.from(t);let i=gu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return gu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Ol));var sa={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var Wbr=new ce,Vbr=new ce;var u_=new ce,J1e=new ce,Xa=class{constructor(t=[0,0,0],r=0){zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new ce,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=u_.from(r),this.center=new ce().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Xa(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=u_.copy(i).subtract(r),s=o.magnitude();if(n>=s+a)return this.clone();if(a>=s+n)return t.clone();let u=(n+s+a)*.5;return J1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(J1e),this.radius=u,this}expand(t){let n=u_.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=CC.getScaling(u_,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=u_.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,a=t.normal.dot(r)+t.distance;return a<-n?sa.OUTSIDE:a<n?sa.INTERSECTING:sa.INSIDE}};var _8t=new ce,w8t=new ce,IC=new ce,PC=new ce,RC=new ce,E8t=new ce,A8t=new ce,Il={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},ua=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=new ce().from(t),this.halfAxes=new Rr(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new ce(t).len(),new ce(r).len(),new ce(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new ce(t).normalize(),a=new ce(r).normalize(),o=new ce(n).normalize();return new gs().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new gs(n),a=new Rr().fromQuaternion(i);return a[0]=a[0]*r[0],a[1]=a[1]*r[0],a[2]=a[2]*r[0],a[3]=a[3]*r[1],a[4]=a[4]*r[1],a[5]=a[5]*r[1],a[6]=a[6]*r[2],a[7]=a[7]*r[2],a[8]=a[8]*r[2],this.center=new ce().from(t),this.halfAxes=a,this}clone(){return new ua(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Xa){let r=this.halfAxes,n=r.getColumn(0,IC),i=r.getColumn(1,PC),a=r.getColumn(2,RC),o=_8t.copy(n).add(i).add(a);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,i=this.halfAxes,a=n.x,o=n.y,s=n.z,u=Math.abs(a*i[Il.COLUMN0ROW0]+o*i[Il.COLUMN0ROW1]+s*i[Il.COLUMN0ROW2])+Math.abs(a*i[Il.COLUMN1ROW0]+o*i[Il.COLUMN1ROW1]+s*i[Il.COLUMN1ROW2])+Math.abs(a*i[Il.COLUMN2ROW0]+o*i[Il.COLUMN2ROW1]+s*i[Il.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?sa.OUTSIDE:c>=u?sa.INSIDE:sa.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=w8t.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,IC),a=n.getColumn(1,PC),o=n.getColumn(2,RC),s=i.magnitude(),u=a.magnitude(),c=o.magnitude();i.normalize(),a.normalize(),o.normalize();let l=0,f;return f=Math.abs(r.dot(i))-s,f>0&&(l+=f*f),f=Math.abs(r.dot(a))-u,f>0&&(l+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(l+=f*f),l}computePlaneDistances(t,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=this.center,s=this.halfAxes,u=s.getColumn(0,IC),c=s.getColumn(1,PC),l=s.getColumn(2,RC),f=E8t.copy(u).add(c).add(l).add(o),d=A8t.copy(f).subtract(t),p=r.dot(d);return i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).add(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).add(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).add(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).add(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,IC);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,PC);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,RC);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var X1e=new ce,Q1e=new ce,Pl=class{constructor(t=[0,0,1],r=0){zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new ce,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return oa(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=X1e.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,i){return this.normal.set(t,r,n),oa(Po(this.normal.len(),1)),this.distance=i,this}clone(){return new Pl(this.normal,this.distance)}equals(t){return Po(this.distance,t.distance)&&Po(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=Q1e.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=X1e.from(t),i=this.getPointDistance(n),a=Q1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var Z1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],e_e=new ce,S8t=new ce,vs=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*Z1e.length;let r=t.center,n=t.radius,i=0;for(let a of Z1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new Pl),s||(s=this.planes[i+1]=new Pl);let u=e_e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=e_e.copy(a).scale(n).add(r),l=S8t.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=sa.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case sa.OUTSIDE:return sa.OUTSIDE;case sa.INTERSECTING:r=sa.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(oa(Number.isFinite(r),"parentPlaneMask is required."),r===vs.MASK_OUTSIDE||r===vs.MASK_INSIDE)return r;let n=vs.MASK_INSIDE,i=this.planes;for(let a=0;a<this.planes.length;++a){let o=a<31?1<<a:0;if(a<31&&!(r&o))continue;let s=i[a],u=t.intersectPlane(s);if(u===sa.OUTSIDE)return vs.MASK_OUTSIDE;u===sa.INTERSECTING&&(n|=o)}return n}};zt(vs,"MASK_OUTSIDE",4294967295);zt(vs,"MASK_INSIDE",0);zt(vs,"MASK_INDETERMINATE",2147483647);var myr=new ce,gyr=new ce,vyr=new ce,byr=new ce,yyr=new ce;var C8t=new ce,D8t=new ce,F8t=new ce,k8t=new ce,B8t=new ce,O8t=new ce,I8t=new ce,wv=new ce,P8t=new ce,R8t=new ce,j8t=new ce,L8t=new ce;function J7(e,t=new Xa){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=I8t.copy(e[0]),n=C8t.copy(r),i=D8t.copy(r),a=F8t.copy(r),o=k8t.copy(r),s=B8t.copy(r),u=O8t.copy(r);for(let j of e){r.copy(j);let k=r.x,N=r.y,C=r.z;k<n.x&&n.copy(r),k>o.x&&o.copy(r),N<i.y&&i.copy(r),N>s.y&&s.copy(r),C<a.z&&a.copy(r),C>u.z&&u.copy(r)}let c=wv.copy(o).subtract(n).magnitudeSquared(),l=wv.copy(s).subtract(i).magnitudeSquared(),f=wv.copy(u).subtract(a).magnitudeSquared(),d=n,p=o,h=c;l>h&&(h=l,d=i,p=s),f>h&&(h=f,d=a,p=u);let b=P8t;b.x=(d.x+p.x)*.5,b.y=(d.y+p.y)*.5,b.z=(d.z+p.z)*.5;let g=wv.copy(p).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=R8t;E.x=n.x,E.y=i.y,E.z=a.z;let S=j8t;S.x=o.x,S.y=s.y,S.z=u.z;let F=L8t.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=wv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=wv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let I=C-x;b.x=(x*b.x+I*r.x)/C,b.y=(x*b.y+I*r.y)/C,b.z=(x*b.z+I*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var wc=new Rr,M8t=new Rr,q8t=new Rr,jC=new Rr,t_e=new Rr;function Z7(e,t={}){let r=mu.EPSILON20,n=10,i=0,a=0,o=M8t,s=q8t;o.identity(),s.copy(e);let u=r*N8t(s);for(;a<n&&U8t(s)>u;)G8t(s,jC),t_e.copy(jC).transpose(),s.multiplyRight(jC),s.multiplyLeft(t_e),o.multiplyRight(jC),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function N8t(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var X7=[1,0,0],Q7=[2,2,1];function U8t(e){let t=0;for(let r=0;r<3;++r){let n=e[wc.getElementIndex(Q7[r],X7[r])];t+=2*n*n}return Math.sqrt(t)}function G8t(e,t){let r=mu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[wc.getElementIndex(Q7[c],X7[c])]);l>n&&(i=c,n=l)}let a=X7[i],o=Q7[i],s=1,u=0;if(Math.abs(e[wc.getElementIndex(o,a)])>r){let c=e[wc.getElementIndex(o,o)],l=e[wc.getElementIndex(a,a)],f=e[wc.getElementIndex(o,a)],d=(c-l)/2/f,p;d<0?p=-1/(-d+Math.sqrt(1+d*d)):p=1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+p*p),u=p*s}return Rr.IDENTITY.to(t),t[wc.getElementIndex(a,a)]=t[wc.getElementIndex(o,o)]=s,t[wc.getElementIndex(o,a)]=u,t[wc.getElementIndex(a,o)]=-u,t}var Sd=new ce,H8t=new ce,W8t=new ce,V8t=new ce,K8t=new ce,$8t=new Rr,Y8t={diagonal:new Rr,unitary:new Rr};function c_(e,t=new ua){if(!e||e.length===0)return t.halfAxes=new Rr([0,0,0,0,0,0,0,0,0]),t.center=new ce,t;let r=e.length,n=new ce(0,0,0);for(let C of e)n.add(C);let i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,u=0,c=0,l=0;for(let C of e){let I=Sd.copy(C).subtract(n);a+=I.x*I.x,o+=I.x*I.y,s+=I.x*I.z,u+=I.y*I.y,c+=I.y*I.z,l+=I.z*I.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=$8t;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:d}=Z7(f,Y8t),p=t.halfAxes.copy(d),h=p.getColumn(0,W8t),b=p.getColumn(1,V8t),g=p.getColumn(2,K8t),x=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)Sd.copy(C),x=Math.max(Sd.dot(h),x),E=Math.max(Sd.dot(b),E),S=Math.max(Sd.dot(g),S),F=Math.min(Sd.dot(h),F),D=Math.min(Sd.dot(b),D),j=Math.min(Sd.dot(g),j);h=h.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(h).add(b).add(g);let k=H8t.set(x-F,E-D,S-j).multiplyByScalar(.5),N=new Rr([k[0],0,0,0,k[1],0,0,0,k[2]]);return t.halfAxes.multiplyRight(N),t}function a_e(e){return e!=null}var Qyr=new ce,J8t=new ce,X8t=new ce,Q8t=new ce,Ph=new ce,r_e=new ce,n_e=new ce,i_e=new ce;function LC(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return o_e(e.box,t,r);if(e.region)return eCt(e.region);if(e.sphere)return Z8t(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function o_e(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(e.length===10){let c=e.slice(3,6),l=new gs;l.fromArray(e,6);let f=new ce([1,0,0]),d=new ce([0,1,0]),p=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),d.transformByQuaternion(l),d.scale(c[1]),p.transformByQuaternion(l),p.scale(c[2]),i=[...f.toArray(),...d.toArray(),...p.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),u=new Rr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return a_e(r)?(r.center=n,r.halfAxes=u,r):new ua(n,u)}function Z8t(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(J8t),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return a_e(r)?(r.center=n,r.radius=o,r):new Xa(n,o)}function eCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Bl(t),Bl(i),a],X8t),u=or.WGS84.cartographicToCartesian([Bl(n),Bl(r),o],Q8t),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Ph),or.WGS84.cartographicToCartesian([Bl(n),Ph[1],Ph[2]],r_e),or.WGS84.cartographicToCartesian([Ph[0],Bl(i),Ph[2]],n_e),or.WGS84.cartographicToCartesian([Ph[0],Ph[1],o],i_e),o_e([...c,...r_e.subtract(c),...n_e.subtract(c),...i_e.subtract(c)],new Kr)}var Ev="4.1.0-alpha.6";var bs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},nxr=Object.keys(bs),Td={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function eq(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function s_e(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var MC="4.1.0-alpha.6";var u_e={name:"Draco",id:"draco",module:"draco",version:MC,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 l_e(e,t,r){let n=f_e(t.metadata),i=[],a=tCt(t.attributes);for(let o in e){let s=e[o],u=c_e(o,s,a[o]);i.push(u)}if(r){let o=c_e("indices",r);i.push(o)}return{fields:i,metadata:n}}function tCt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function c_e(e,t,r){let n=r?f_e(r.metadata):void 0;return d7(e,t,n)}function f_e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var d_e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},rCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},nCt=4,l_=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=f7(u.attributes),l=l_e(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:c},...u,schema:l}}finally{this.draco.destroy(n),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:a}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let a=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[a.unique_id()]={unique_id:a.unique_id(),attribute_type:a.attribute_type(),data_type:a.data_type(),num_components:a.num_components(),byte_offset:a.byte_offset(),byte_stride:a.byte_stride(),normalized:a.normalized(),attribute_index:i,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(n[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(n[a.unique_id()].octahedron_transform=u)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,n);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);i[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return i}_getTriangleListIndices(t){let n=t.num_faces()*3,i=n*nCt,a=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,a),new Uint32Array(this.draco.HEAPF32.buffer,a,n).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),oCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=rCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=iCt(this.draco,n),c,l=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,l),c=new n(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===n)return o;let i=t.attribute_type;for(let o in d_e)if(this.draco[o]===i)return d_e[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let a=this.metadataQuerier.GetEntryName(t,i);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=aCt(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let a of i)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))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(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function iCt(e,t){switch(t){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 aCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function oCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var sCt="1.5.6",uCt="1.4.1",tq=`https://www.gstatic.com/draco/versioned/decoders/${sCt}`,ai={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Cd={[ai.DECODER]:`${tq}/${ai.DECODER}`,[ai.DECODER_WASM]:`${tq}/${ai.DECODER_WASM}`,[ai.FALLBACK_DECODER]:`${tq}/${ai.FALLBACK_DECODER}`,[ai.ENCODER]:`https://raw.githubusercontent.com/google/draco/${uCt}/javascript/${ai.ENCODER}`},f_;async function p_e(e){let t=e.modules||{};return t.draco3d?f_=f_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):f_=f_||cCt(e),await f_}async function cCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await nc(Cd[ai.FALLBACK_DECODER],"draco",e,ai.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await nc(Cd[ai.DECODER],"draco",e,ai.DECODER),await nc(Cd[ai.DECODER_WASM],"draco",e,ai.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await lCt(t,r)}function lCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var rq={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:MC,worker:!0,options:{draco:{},source:null}};var Av={...u_e,parse:fCt};async function fCt(e,t){let{draco:r}=await p_e(t),n=new l_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var dCt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ht={...dCt,...bi};var nq={[bi.DOUBLE]:Float64Array,[bi.FLOAT]:Float32Array,[bi.UNSIGNED_SHORT]:Uint16Array,[bi.UNSIGNED_INT]:Uint32Array,[bi.UNSIGNED_BYTE]:Uint8Array,[bi.BYTE]:Int8Array,[bi.SHORT]:Int16Array,[bi.INT]:Int32Array},pCt={DOUBLE:bi.DOUBLE,FLOAT:bi.FLOAT,UNSIGNED_SHORT:bi.UNSIGNED_SHORT,UNSIGNED_INT:bi.UNSIGNED_INT,UNSIGNED_BYTE:bi.UNSIGNED_BYTE,BYTE:bi.BYTE,SHORT:bi.SHORT,INT:bi.INT},iq="Failed to convert GL type",Na=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in nq)if(nq[r]===t)return r;throw new Error(iq)}static fromName(t){let r=pCt[t];if(!r)throw new Error(iq);return r}static getArrayType(t){switch(t){case bi.UNSIGNED_SHORT_5_6_5:case bi.UNSIGNED_SHORT_4_4_4_4:case bi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=nq[t];if(!r)throw new Error(iq);return r}}static getByteSize(t){return Na.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(Na.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/Na.getByteSize(t));let a=Na.getArrayType(t);return new a(r,n,i)}};function h_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function aq(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,i=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}var Bxr=1/256;var Oxr=new Bh,Ixr=new ce,Pxr=new Bh,Rxr=new Bh,jxr=new Uint8Array(1);function m_e(e,t=255){return g7(e,0,t)/t*2-1}function g_e(e){return e<0?-1:1}function v_e(e,t,r,n){if(h_e(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=m_e(e,r),n.y=m_e(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let i=n.x;n.x=(1-Math.abs(n.y))*g_e(i),n.y=(1-Math.abs(i))*g_e(n.y)}return n.normalize()}function oq(e,t,r){return v_e(e,t,255,r)}function qC(e){return(e%1+1)%1}var Rl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Ht.UNSIGNED_INT,n=1){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,i.byteOffset):i}getPropertyArray(t,r,n){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(r=Na.fromName(i.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,r,i)}getProperty(t,r,n,i,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,n);if(n===1)return s[i];for(let u=0;u<n;++u)a[u]=s[n*i+u];return a}_getTypedArrayFromBinary(t,r,n,i,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=Na.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,i*n),o[t]=s),s}_getTypedArrayFromArray(t,r,n){let i=this._cachedTypedArrays,a=i[t];return a||(a=Na.createTypedArray(r,n),i[t]=a),a}};var hCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mCt={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},gCt={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function b_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?Na.fromName(i):i,o=hCt[e.type],s=mCt[e.type],u=gCt[e.type];return r+=e.byteOffset,{values:Na.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var Ec=e=>e!==void 0;function y_e(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?vCt(n,r):null}function vCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;Ec(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(Ec(u))for(Ec(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),l=0,r=0;r<a;++r)f[r]=l,l+=u[r];Ec(c)&&Ec(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let d=o.length;for(r=0;r<d;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let p=new Array(d).fill(0),h=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],h[r]=p[n],++p[n];let b={classes:o,classIds:s,classIndexes:h,parentCounts:u,parentIndexes:f,parentIds:c};return xCt(b),b}function Sv(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?bCt(e,t,r):yCt(e,t,r)}function bCt(e,t,r){let n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);let c=++marker,l=scratchStack;for(l.length=0,l.push(t);l.length>0;){if(t=l.pop(),u[t]===c)continue;u[t]=c;let f=r(e,t);if(Ec(f))return f;let d=i[t],p=o[t];for(let h=0;h<d;++h){let b=a[p+h];b!==t&&l.push(b)}}return null}function yCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(Ec(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function xCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)x_e(e,i,stack)}function x_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!Ec(i))return;assert(t<s,`Parent index ${t} exceeds the total number of instances: ${s}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let u=Ec(n)?n[t]:1,c=Ec(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&x_e(e,f,r)}r.pop(t)}function go(e){return e!=null}var NC=(e,t)=>e,_Ct={HIERARCHY:!0,extensions:!0,extras:!0},Rh=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Qt(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)_Ct[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=y_e(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._hierarchy){let n=Sv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return go(n)}return!1}isExactClass(t,r){return Qt(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),Qt(typeof r=="string",r),go(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=go(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(go(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(go(n))return NC(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(go(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let a=this._properties[r];go(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=NC(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],i=this._initializeBinaryProperty(r,n);i&&(t=t||{},t[r]=i)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;Qt(this.binary,`Property ${t} requires a batch table binary.`),Qt(n.type,`Property ${t} requires a type.`);let i=b_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=Sv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return go(s[r])});return go(n)}_getPropertyNamesInHierarchy(t,r){Sv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return Sv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return go(u)?go(u.typedArray)?this._getBinaryProperty(u,s):NC(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=Sv(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return go(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),go(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=NC(i,!0),!0):!1});return go(a)}};var sq=4;function Dd(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=sq,e.version=n.getUint32(r,!0),r+=sq,e.byteLength=n.getUint32(r,!0),r+=sq,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Tv=4,__e="b3dm tile in legacy format.";function Cv(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=Tv;let o=n.getUint32(r,!0);r+=Tv;let s=n.getUint32(r,!0);r+=Tv;let u=n.getUint32(r,!0);return r+=Tv,s>=570425344?(r-=Tv*2,i=a,s=o,u=0,a=0,o=0,console.warn(__e)):u>=570425344&&(r-=Tv,i=s,s=a,u=o,a=0,o=0,console.warn(__e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Dv(e,t,r,n){return r=wCt(e,t,r,n),r=ECt(e,t,r,n),r}function wCt(e,t,r,n){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){let s=eq(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function ECt(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=eq(t,r,i);e.batchTableJson=JSON.parse(o),r+=i,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function uq(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:i,pointCount:a=0}=e;if(n&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=n[s],l=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=l[0],o[s*3+1]=l[1],o[s*3+2]=l[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&i){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=aq(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ht.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var w_e=new ce;function E_e(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)oq(t[n*2],t[n*2+1],w_e),w_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function A_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,ACt(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function ACt(e,t){let r=new ce,n=new Float32Array(e.pointCount*3);for(let i=0;i<e.pointCount;i++)r.set(t[i*3],t[i*3+1],t[i*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,i*3);return n}async function S_e(e,t,r,n,i){r=Dd(e,t,r),r=Cv(e,t,r),r=Dv(e,t,r,n),SCt(e);let{featureTable:a,batchTable:o}=TCt(e);return await BCt(e,a,o,n,i),CCt(e,a,n),DCt(e,a,o),FCt(e,a),r}function SCt(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function TCt(e){let t=new Rl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let n=kCt(e,t);return{featureTable:t,batchTable:n}}function CCt(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ht.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=A_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function DCt(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",Ht.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Ht.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Ht.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=uq(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function FCt(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Ht.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Ht.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=E_e(e,r)}}function kCt(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ht.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:i,batchTableBinary:a}=e;r=new Rh(i,a,n)}return r}async function BCt(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,d=c.byteLength;if(!o||!Number.isFinite(f)||!d)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+d),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await OCt(e,l,n,i)}async function OCt(e,t,r,n){if(!n)return;let i={...r,draco:{...r==null?void 0:r.draco,extraAttributes:t.batchTableProperties||{}}};delete i["3d-tiles"];let a=await Do(t.buffer,Av,i,n),o=a.attributes.POSITION&&a.attributes.POSITION.value,s=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,u=a.attributes.NORMAL&&a.attributes.NORMAL.value,c=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,l=o&&a.attributes.POSITION.value.quantization,f=u&&a.attributes.NORMAL.value.quantization;if(l){let p=a.POSITION.data.quantization,h=p.range;e.quantizedVolumeScale=new ce(h,h,h),e.quantizedVolumeOffset=new ce(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let d={};if(t.batchTableProperties)for(let p of Object.keys(t.batchTableProperties))a.attributes[p]&&a.attributes[p].value&&(d[p.toLowerCase()]=a.attributes[p].value);e.attributes={positions:o,colors:uq(e,s,void 0),normals:u,batchIds:c,...d}}var vq={};da(vq,{decode:()=>vDt,name:()=>XC});var UC="4.1.0-alpha.6";var T_e,ICt=(T_e=globalThis.loaders)==null?void 0:T_e.parseImageNode,cq=typeof Image<"u",lq=typeof ImageBitmap<"u",PCt=Boolean(ICt),fq=gn?!0:PCt;function C_e(e){switch(e){case"auto":return lq||cq||fq;case"imagebitmap":return lq;case"image":return cq;case"data":return fq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function D_e(){if(lq)return"imagebitmap";if(cq)return"image";if(fq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function F_e(e){let t=RCt(e);if(!t)throw new Error("Not an image");return t}function dq(e){return Fv(e)}function Fv(e){switch(F_e(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function RCt(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 jCt=/^data:image\/svg\+xml/,LCt=/\.svg((\?|#).*)?$/;function GC(e){return e&&(jCt.test(e)||LCt.test(e))}function k_e(e,t){if(GC(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return pq(e,t)}function pq(e,t){if(GC(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function zC(e,t,r){let n=k_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await MCt(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function MCt(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=a=>{let o=a instanceof Error?a.message:"error";i(new Error(o))}}catch(a){i(a)}})}var qCt={},B_e=!0;async function O_e(e,t,r){let n;GC(r)?n=await zC(e,t,r):n=pq(e,r);let i=t&&t.imagebitmap;return await NCt(n,i)}async function NCt(e,t=null){if((UCt(t)||!B_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),B_e=!1}return await createImageBitmap(e)}function UCt(e){for(let t in e||qCt)return!1;return!0}function I_e(e){return!WCt(e,"ftyp",4)||!(e[8]&96)?null:GCt(e)}function GCt(e){switch(zCt(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function zCt(e,t,r){return String.fromCharCode(...e.slice(t,r))}function HCt(e){return[...e].map(t=>t.charCodeAt(0))}function WCt(e,t,r=0){let n=HCt(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var Ac=!1,d_=!0;function jh(e){let t=p_(e);return KCt(t)||JCt(t)||$Ct(t)||YCt(t)||VCt(t)}function VCt(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=I_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function KCt(e){let t=p_(e);return t.byteLength>=24&&t.getUint32(0,Ac)===2303741511?{mimeType:"image/png",width:t.getUint32(16,Ac),height:t.getUint32(20,Ac)}:null}function $Ct(e){let t=p_(e);return t.byteLength>=10&&t.getUint32(0,Ac)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,d_),height:t.getUint16(8,d_)}:null}function YCt(e){let t=p_(e);return t.byteLength>=14&&t.getUint16(0,Ac)===16973&&t.getUint32(2,d_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,d_),height:t.getUint32(22,d_)}:null}function JCt(e){let t=p_(e);if(!(t.byteLength>=3&&t.getUint16(0,Ac)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=XCt(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,Ac);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,Ac),width:t.getUint16(a+7,Ac)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,Ac)}return null}function XCt(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function p_(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 P_e(e,t){var i;let{mimeType:r}=jh(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function R_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=QCt(i),s;switch(o){case"imagebitmap":s=await O_e(e,t,a);break;case"image":s=await zC(e,t,a);break;case"data":s=await P_e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Fv(s)),s}function QCt(e){switch(e){case"auto":case"data":return D_e();default:return C_e(e),e}}var ZCt=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],eDt=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],tDt={image:{type:"auto",decode:!0}},kv={id:"image",module:"images",name:"Images",version:UC,mimeTypes:eDt,extensions:ZCt,parse:R_e,tests:[e=>Boolean(jh(new DataView(e)))],options:tDt};var M_e,j_e=(M_e=globalThis.loaders)==null?void 0:M_e.encodeImageNode;async function q_e(e,t){return t=t||{},t.image=t.image||{},j_e?j_e(e,{type:t.image.mimeType}):rDt(e,t)}var L_e=!0;async function rDt(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=dq(e),o=document.createElement("canvas");o.width=i,o.height=a,nDt(e,o);let s=await new Promise(u=>{if(n&&L_e)try{o.toBlob(u,r,n);return}catch{L_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function nDt(e,t,r=0,n=0){if(r===0&&n===0&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let i=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return i.putImageData(o,0,0),t}return i.drawImage(e,0,0),t}var hq={name:"Images",id:"image",module:"images",version:UC,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:q_e};var mq={};function gq(e){if(mq[e]===void 0){let t=gn?aDt(e):iDt(e);mq[e]=t}return mq[e]}function iDt(e){var i,a;let t=["image/png","image/jpeg","image/gif"],r=((i=globalThis.loaders)==null?void 0:i.imageFormatsNode)||t,n=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return Boolean(n)&&r.includes(e)}function aDt(e){switch(e){case"image/avif":case"image/webp":return oDt(e);default:return!0}}function oDt(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Gi(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var HC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},WC={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var sDt=1.33,N_e=["SCALAR","VEC2","VEC3","VEC4"],uDt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],cDt=new Map(uDt),lDt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},fDt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},dDt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function VC(e){return N_e[e-1]||N_e[0]}function Bv(e){let t=cDt.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Ov(e,t){let r=dDt[e.componentType],n=lDt[e.type],i=fDt[e.componentType],a=e.count*n,o=e.count*n*i;Gi(o>=0&&o<=t.byteLength);let s=WC[e.componentType],u=HC[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function h_(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(o=>o.bufferView);r=r.filter(o=>!n.includes(o));let i=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:c}=s.image;return o+u*c},0);return i+Math.ceil(4*a*sDt)}function U_e(e,t,r){let n=e.bufferViews[r];Gi(n);let i=n.buffer,a=t[i];Gi(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function G_e(e,t,r){var b,g;let n=typeof r=="number"?(b=e.accessors)==null?void 0:b[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let i=(g=e.bufferViews)==null?void 0:g[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);let{arrayBuffer:a,byteOffset:o}=t[i.buffer],s=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:u,length:c,componentByteSize:l,numberOfComponentsInElement:f}=Ov(n,i),d=l*f,p=i.byteStride||d;if(typeof i.byteStride>"u"||i.byteStride===d)return new u(a,s,c);let h=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*p,f);h.set(E,x*f)}return h}function pDt(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var qr=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:(t==null?void 0:t.json)||pDt(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.getRequiredExtensions().find(i=>i===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];Gi(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return G_e(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),i=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(i,a,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let i=t.extensions||{};i[r]=n}removeObjectExtension(t,r){let n=(t==null?void 0:t.extensions)||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(r)||i.push(r)}delete n[r]}addExtension(t,r={}){return Gi(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Gi(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)!=null&&r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(t)||n.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let i={mesh:r};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:i,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(n){let u=this._addIndices(n);s.primitives[0].indices=u}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=jh(t),i=r||(n==null?void 0:n.mimeType),o={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let i=t.byteLength;Gi(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=ko(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:VC(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),i={min:r.min,max:r.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:Bv(t),count:Math.round(t.length/r.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var a,o;this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;for(let s of this.sourceBuffers||[])i=ZI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};function z_e(e){return(e%1+1)%1}var H_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},hDt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},W_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function m_(e,t){return W_e[t]*H_e[e]}function Iv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=Pv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function Pv(e,t,r,n=1){let i=H_e[t],a=hDt[r],o=W_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Rv(e,t,r){var c,l,f,d,p;let n=`TEXCOORD_${t.texCoord||0}`,i=r.attributes[n],a=e.getTypedArrayForAccessor(i),o=e.gltf.json,s=t.index,u=(l=(c=o.textures)==null?void 0:c[s])==null?void 0:l.source;if(typeof u<"u"){let h=(d=(f=o.images)==null?void 0:f[u])==null?void 0:d.mimeType,b=(p=e.gltf.images)==null?void 0:p[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=mDt(b,h,a,x,t.channels);g.push(E)}return g}}return[]}function KC(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(d=>d===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Bv(o),count:o.length});i.attributes[t]=c}function mDt(e,t,r,n,i=[0]){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],s=r[n+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let c=gDt(o,s,e,u),l=0;for(let f of i){let d=typeof f=="number"?Object.values(a)[f]:a[f],p=c+d.offset,h=Fv(e);if(h.data.length<=p)throw new Error(`${h.data.length} <= ${p}`);let b=h.data[p];l|=b<<d.shift}return l}function gDt(e,t,r,n=1){let i=r.width,a=z_e(e)*(i-1),o=Math.round(a),s=r.height,u=z_e(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function $C(e,t,r,n,i){let a=[];for(let o=0;o<t;o++){let s=r[o],u=r[o+1]-r[o];if(u+s>n)break;let c=s/i,l=u/i;a.push(e.slice(c,c+l))}return a}function YC(e,t,r){let n=[];for(let i=0;i<t;i++){let a=i*r;n.push(e.slice(a,a+r))}return n}function JC(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let i=[],a=new TextDecoder("utf8"),o=0;for(let s=0;s<e;s++){let u=n[s+1]-n[s];if(u+o<=t.length){let c=t.subarray(o,u+o),l=a.decode(c);i.push(l),o+=u}}return i}return[]}var V_e="EXT_mesh_features",XC=V_e;async function vDt(e,t){let r=new qr(e);bDt(r,t)}function bDt(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)yDt(e,i,t)}function yDt(e,t,r){var a,o,s;if(!((a=r==null?void 0:r.gltf)!=null&&a.loadBuffers))return;let n=(o=t.extensions)==null?void 0:o[V_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Rv(e,u.texture,t):c=[];u.data=c}}var xq={};da(xq,{decode:()=>xDt,name:()=>jl});var bq="EXT_structural_metadata",jl=bq;async function xDt(e,t){let r=new qr(e);_Dt(r,t)}function _Dt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(bq);r&&((i=t.gltf)!=null&&i.loadImages&&wDt(e,r),EDt(e,r))}function wDt(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let i of n.meshes)for(let a of i.primitives)SDt(e,r,a,t)}function EDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.propertyTables;if(n&&i)for(let a in n){let o=ADt(i,a);o&&CDt(e,r,o)}}function ADt(e,t){for(let r of e)if(r.class===t)return r;return null}function SDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[bq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];TDt(e,u,r,n)}}function TDt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Rv(e,u,r);l!==null&&(KC(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function CDt(e,t,r){var a,o;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=DDt(e,t,u,i,c);c.data=l}}}function DDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=FDt(e,r,i,n),c=kDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=BDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=JC(n,s,u,c);break}case"ENUM":{a=ODt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function FDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Iv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function kDt(e,t,r){return typeof t.stringOffsets<"u"?Iv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function BDt(e,t,r,n){let i=e.array,a=e.count,o=m_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=Pv(r,e.type,e.componentType,s):u=r,i?n?$C(u,t,n,r.length,o):a?YC(u,t,a):[]:u}function ODt(e,t,r,n,i){var f;let a=t.enumType;if(!a)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=(f=e.enums)==null?void 0:f[a];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${a}`);let s=o.valueType||"UINT16",u=m_(t.type,s),c=n.byteLength/u,l=Pv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return IDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let d=t.count;return d?PDt(l,r,d,o):[]}return yq(l,0,r,o)}function IDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,d=l/a,p=yq(t,f,d,o);s.push(p)}return s}function PDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=yq(e,o,r,n);i.push(s)}return i}function yq(e,t,r,n){let i=[];for(let a=0;a<r;a++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)i.push("");else{let o=e[t+a],s=RDt(n,o);s?i.push(s.name):i.push("")}return i}function RDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var _q={};da(_q,{decode:()=>jDt,name:()=>ys});var K_e="EXT_feature_metadata",ys=K_e;async function jDt(e,t){let r=new qr(e);LDt(r,t)}function LDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(K_e);r&&((i=t.gltf)!=null&&i.loadImages&&MDt(e,r),qDt(e,r))}function MDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:i}=t;if(n&&i)for(let a in n){let o=n[a],s=UDt(i,a);s&&zDt(e,s,o)}}function qDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.featureTables;if(n&&i)for(let a in n){let o=NDt(i,a);o&&GDt(e,r,o)}}function NDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function UDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function GDt(e,t,r){var a,o;if(!r.class)return;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=HDt(e,t,u,i,c);c.data=l}}}function zDt(e,t,r){var i;let n=t.class;for(let a in r.properties){let o=(i=t==null?void 0:t.properties)==null?void 0:i[a];if(o){let s=YDt(e,o,n);o.data=s}}}function HDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=WDt(e,r,i,n),c=VDt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=JC(n,s,u,c):KDt(r)&&(a=$Dt(r,n,s,u)),a}function WDt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Iv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function VDt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Iv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function KDt(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function $Dt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=m_(o,s),c=r.byteLength/u,l=Pv(r,o,s,c);return i?n?$C(l,t,n,r.length,u):a?YC(l,t,a):[]:l}function YDt(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let i=[];for(let a of n.meshes)for(let o of a.primitives)JDt(e,r,t,i,o);return i}function JDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Rv(e,a,i);o&&KC(e,t,o,n,i)}var QC="4.1.0-alpha.6";var jv="4.1.0-alpha.6";var Sc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},wq;async function Aq(e){let t=e.modules||{};return t.basis?t.basis:(wq=wq||XDt(e),await wq)}async function XDt(e){let t=null,r=null;return[t,r]=await Promise.all([await nc(Sc.TRANSCODER,"textures",e),await nc(Sc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await QDt(t,r)}function QDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,initializeBasis:o}=i;o(),n({BasisFile:a})})})}var Eq;async function Sq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(Eq=Eq||ZDt(e),await Eq)}async function ZDt(e){let t=null,r=null;return[t,r]=await Promise.all([await nc(Sc.ENCODER,"textures",e),await nc(Sc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await e4t(t,r)}function e4t(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=i;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var ke={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 t4t=["","WEBKIT_","MOZ_"],$_e={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"},ZC=null;function g_(e){if(!ZC){e=e||r4t()||void 0,ZC=new Set;for(let t of t4t)for(let r in $_e)if(e&&e.getExtension(`${t}${r}`)){let n=$_e[r];ZC.add(n)}}return ZC}function r4t(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var o2e=Wt(i2e(),1);function Lv(e,t){let r=new Array(t.mipMapLevels),n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=a4t(t,n,i,e,o),u=i4t(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function i4t(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function a4t(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var o4t={131:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ke.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ke.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ke.COMPRESSED_RED_RGTC1_EXT,140:ke.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ke.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ke.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ke.COMPRESSED_RGB8_ETC2,148:ke.COMPRESSED_SRGB8_ETC2,149:ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ke.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ke.COMPRESSED_RGBA8_ETC2_EAC,152:ke.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ke.COMPRESSED_R11_EAC,154:ke.COMPRESSED_SIGNED_R11_EAC,155:ke.COMPRESSED_RG11_EAC,156:ke.COMPRESSED_SIGNED_RG11_EAC,157:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ke.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ke.COMPRESSED_RGBA_ASTC_12x12_KHR};function a2e(e){return o4t[e]}var Ro=[171,75,84,88,32,50,48,187,13,10,26,10];function iD(e){let t=new Uint8Array(e);return!(t.byteLength<Ro.length||t[0]!==Ro[0]||t[1]!==Ro[1]||t[2]!==Ro[2]||t[3]!==Ro[3]||t[4]!==Ro[4]||t[5]!==Ro[5]||t[6]!==Ro[6]||t[7]!==Ro[7]||t[8]!==Ro[8]||t[9]!==Ro[9]||t[10]!==Ro[10]||t[11]!==Ro[11])}function s2e(e){let t=new Uint8Array(e),r=(0,o2e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=a2e(r.vkFormat);return Lv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var s4t={etc1:{basisFormat:0,compressed:!0,format:ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ke.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:ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ke.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 b_(e,t){if(t.basis.containerFormat==="auto"){if(iD(e)){let n=await Sq(t);return u2e(n.KTX2File,e,t)}let{BasisFile:r}=await Aq(t);return kq(r,e,t)}switch(t.basis.module){case"encoder":let r=await Sq(t);switch(t.basis.containerFormat){case"ktx2":return u2e(r.KTX2File,e,t);case"basis":default:return kq(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await Aq(t);return kq(n,e,t)}}function kq(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),a=[];for(let o=0;o<i;o++){let s=n.getNumLevels(o),u=[];for(let c=0;c<s;c++)u.push(u4t(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function u4t(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=c2e(n,o),l=e.getImageTranscodedSizeInBytes(t,r,c),f=new Uint8Array(l);if(!e.transcodeImage(f,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function u2e(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let i=n.getLevels(),a=[];for(let o=0;o<i;o++){a.push(c4t(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function c4t(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=c2e(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,u),l=new Uint8Array(c);if(!e.transcodeImage(l,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:i,data:l,compressed:o,levelSize:c,hasAlpha:n,format:s}}function c2e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Mv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),s4t[r]}function Mv(){let e=g_();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 l2e={name:"Basis",id:"basis",module:"textures",version:jv,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"}}},Lh={...l2e,parse:b_};var jo={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},l4t={DXT1:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ke.COMPRESSED_RGB_ATC_WEBGL,ATCA:ke.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ke.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},f4t=p2e,d4t=aD,p4t=aD,h4t={DXT1:p2e,DXT3:aD,DXT5:aD,"ATC ":f4t,ATCA:d4t,ATCI:p4t};function f2e(e){return new Uint32Array(e,0,jo.HEADER_LENGTH)[jo.MAGIC_NUMBER_INDEX]===jo.MAGIC_NUMBER}function d2e(e){let t=new Int32Array(e,0,jo.HEADER_LENGTH),r=t[jo.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[jo.HEADER_PF_FLAGS_INDEX]&jo.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=m4t(r),i=l4t[n],a=h4t[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[jo.HEADER_FLAGS_INDEX]&jo.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[jo.MIPMAPCOUNT_INDEX]));let s=t[jo.HEADER_WIDTH_INDEX],u=t[jo.HEADER_HEIGHT_INDEX],c=t[jo.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Lv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function p2e(e,t){return(e+3>>2)*(t+3>>2)*8}function aD(e,t){return(e+3>>2)*(t+3>>2)*16}function m4t(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var xs={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},g4t={0:[ke.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ke.COMPRESSED_RGB_ETC1_WEBGL],7:[ke.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ke.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ke.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ke.COMPRESSED_RGB8_ETC2],23:[ke.COMPRESSED_RGBA8_ETC2_EAC],24:[ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ke.COMPRESSED_R11_EAC],26:[ke.COMPRESSED_RG11_EAC],27:[ke.COMPRESSED_RGBA_ASTC_4X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ke.COMPRESSED_RGBA_ASTC_5X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ke.COMPRESSED_RGBA_ASTC_5X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ke.COMPRESSED_RGBA_ASTC_6X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ke.COMPRESSED_RGBA_ASTC_6X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ke.COMPRESSED_RGBA_ASTC_8X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ke.COMPRESSED_RGBA_ASTC_8X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ke.COMPRESSED_RGBA_ASTC_8X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ke.COMPRESSED_RGBA_ASTC_10X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ke.COMPRESSED_RGBA_ASTC_10X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ke.COMPRESSED_RGBA_ASTC_10X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ke.COMPRESSED_RGBA_ASTC_10X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ke.COMPRESSED_RGBA_ASTC_12X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ke.COMPRESSED_RGBA_ASTC_12X12_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},v4t={0:h2e,1:h2e,2:m2e,3:m2e,6:y_,7:y_,9:x_,11:x_,22:y_,23:x_,24:y_,25:y_,26:x_,27:x_,28:b4t,29:y4t,30:x4t,31:_4t,32:w4t,33:E4t,34:A4t,35:S4t,36:T4t,37:C4t,38:D4t,39:F4t,40:k4t};function g2e(e){let r=new Uint32Array(e,0,xs.HEADER_LENGTH)[xs.MAGIC_NUMBER_INDEX];return r===xs.MAGIC_NUMBER||r===xs.MAGIC_NUMBER_EXTRA}function v2e(e){let t=new Uint32Array(e,0,xs.HEADER_LENGTH),r=t[xs.PIXEL_FORMAT_INDEX],n=t[xs.COLOUR_SPACE_INDEX],i=g4t[r]||[],a=i.length>1&&n?i[1]:i[0],o=v4t[r],s=t[xs.MIPMAPCOUNT_INDEX],u=t[xs.WIDTH_INDEX],c=t[xs.HEIGHT_INDEX],l=xs.HEADER_SIZE+t[xs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Lv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function h2e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function m2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function y_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function x_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function b4t(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function y4t(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function x4t(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function _4t(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function w4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function E4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function A4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function S4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function T4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function C4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function D4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function F4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function k4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function b2e(e){if(iD(e))return s2e(e);if(f2e(e))return d2e(e);if(g2e(e))return v2e(e);throw new Error("Texture container format not recognized")}var y2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:jv,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}}},oD={...y2e,parse:async(e,t)=>{var r;return(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},(await b_(e,t))[0]):b2e(e)}};var Bq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:jv,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var qv=!0,x2e=1735152710,Pq=12,sD=8,B4t=1313821514,O4t=5130562,I4t=0,P4t=0,R4t=1;function j4t(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function _2e(e,t=0,r={}){let n=new DataView(e),{magic:i=x2e}=r,a=n.getUint32(t,!1);return a===i||a===x2e}function w2e(e,t,r=0,n={}){let i=new DataView(t),a=j4t(i,r+0),o=i.getUint32(r+4,qv),s=i.getUint32(r+8,qv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Pq,e.version){case 1:return L4t(e,i,r);case 2:return M4t(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function L4t(e,t,r){Qt(e.header.byteLength>Pq+sD);let n=t.getUint32(r+0,qv),i=t.getUint32(r+4,qv);return r+=sD,Qt(i===I4t),Oq(e,t,r,n),r+=n,r+=Iq(e,t,r,e.header.byteLength),r}function M4t(e,t,r,n){return Qt(e.header.byteLength>Pq+sD),q4t(e,t,r,n),r+e.header.byteLength}function q4t(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,qv),a=t.getUint32(r+4,qv);switch(r+=sD,a){case B4t:Oq(e,t,r,i);break;case O4t:Iq(e,t,r,i);break;case P4t:n.strict||Oq(e,t,r,i);break;case R4t:n.strict||Iq(e,t,r,i);break;default:break}r+=ko(i,4)}return r}function Oq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),ko(n,4)}function Iq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),ko(n,4)}function Rq(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var Lq={};da(Lq,{decode:()=>X4t,name:()=>J4t});var N4t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",U4t="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",G4t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),z4t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),H4t={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},W4t={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function E2e(e,t,r,n,i,a="NONE"){let o=await V4t();Y4t(o,o.exports[W4t[i]],e,t,r,n,o.exports[H4t[a||"NONE"]])}var jq;async function V4t(){return jq||(jq=K4t()),jq}async function K4t(){let e=N4t;WebAssembly.validate(G4t)&&(e=U4t,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate($4t(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function $4t(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);t[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?z4t[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function Y4t(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let d=t(c,n,i,l,a.length);if(d===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),d!==0)throw new Error(`Malformed buffer data: ${d}`)}var uD="EXT_meshopt_compression",J4t=uD;async function X4t(e,t){var i,a;let r=new qr(e);if(!((i=t==null?void 0:t.gltf)!=null&&i.decompressMeshes)||!((a=t.gltf)!=null&&a.loadBuffers))return;let n=[];for(let o of e.json.bufferViews||[])n.push(Q4t(r,o));await Promise.all(n),r.removeExtension(uD)}async function Q4t(e,t){let r=e.getObjectExtension(t,uD);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),d=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await E2e(d,o,a,f,s,u),e.removeObjectExtension(t,uD)}}var Mq={};da(Mq,{name:()=>Z4t,preprocess:()=>eFt});var Nv="EXT_texture_webp",Z4t=Nv;function eFt(e,t){let r=new qr(e);if(!gq("image/webp")){if(r.getRequiredExtensions().includes(Nv))throw new Error(`gltf: Required extension ${Nv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,Nv);a&&(i.source=a.source),r.removeObjectExtension(i,Nv)}r.removeExtension(Nv)}var qq={};da(qq,{name:()=>tFt,preprocess:()=>rFt});var cD="KHR_texture_basisu",tFt=cD;function rFt(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,cD);a&&(i.source=a.source,r.removeObjectExtension(i,cD))}r.removeExtension(cD)}var Uq={};da(Uq,{decode:()=>sFt,encode:()=>uFt,name:()=>aFt,preprocess:()=>oFt});function A2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Nq(n);t[r]=i}}return t}function Nq(e){let{buffer:t,size:r,count:n}=nFt(e);return{value:t,size:r,byteOffset:0,count:n,type:VC(r),componentType:Bv(t)}}function nFt(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=iFt(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function iFt(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Fd="KHR_draco_mesh_compression",aFt=Fd;function oFt(e,t,r){let n=new qr(e);for(let i of S2e(n))n.getObjectExtension(i,Fd)}async function sFt(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)!=null&&a.decompressMeshes))return;let n=new qr(e),i=[];for(let o of S2e(n))n.getObjectExtension(o,Fd)&&i.push(cFt(n,o,t,r));await Promise.all(i),n.removeExtension(Fd)}function uFt(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])lFt(n,t),r.addRequiredExtension(Fd)}async function cFt(e,t,r,n){let i=e.getObjectExtension(t,Fd);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=$p(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await Do(o,Av,s,n),c=A2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let d=t.attributes[l],p=e.getAccessor(d);p!=null&&p.min&&(p!=null&&p.max)&&(f.min=p.min,f.max=p.max)}t.attributes=c,u.indices&&(t.indices=Nq(u.indices)),e.removeObjectExtension(t,Fd),fFt(t)}function lFt(e,t,r=4,n,i){var l;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=n.DracoWriter.encodeSync({attributes:e}),o=(l=i==null?void 0:i.parseSync)==null?void 0:l.call(i,{attributes:e}),s=n._addFauxAttributes(o.attributes),u=n.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Fd]:{bufferView:u,attributes:s}}}]}}function fFt(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*S2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var zq={};da(zq,{decode:()=>mFt,name:()=>dFt});var Gq="KHR_texture_transform",dFt=Gq,lD=new ce,pFt=new Rr,hFt=new Rr;async function mFt(e,t){var a;if(!new qr(e).hasExtension(Gq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)gFt(o,e)}function gFt(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&__(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&__(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&__(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&__(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&__(t,e,u,r)}function __(e,t,r,n){let i=vFt(r,n);if(!i)return;let a=e.json.meshes||[];for(let o of a)for(let s of o.primitives){let u=s.material;Number.isFinite(u)&&t===u&&bFt(e,s,i)}}function vFt(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Gq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=_Ft(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function bFt(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:d}=e.buffers[l.buffer],p=(d||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:h,length:b}=Ov(c,l),g=WC[c.componentType],x=HC[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new h(f,p+F*E,2);lD.set(D[0],D[1],1),lD.transformByMatrix3(a),S.set([lD[0],lD[1]],F*x)}n===i?yFt(c,l,e.buffers,S):xFt(i,c,t,e,S)}}}}function yFt(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function xFt(e,t,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});let a=n.json.bufferViews;if(!a)return;a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:(a==null?void 0:a.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=o.length-1)}function _Ft(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Rr().set(1,0,0,0,1,0,t[0],t[1],1),a=pFt.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=hFt.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Hq={};da(Hq,{decode:()=>EFt,encode:()=>AFt,name:()=>wFt});var Mh="KHR_lights_punctual",wFt=Mh;async function EFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Mh);n&&(t.json.lights=n.lights,t.removeExtension(Mh));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Mh);a&&(i.light=a.light),t.removeObjectExtension(i,Mh)}}async function AFt(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Mh);Gi(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let i=n.node;t.addObjectExtension(i,Mh,n)}delete t.json.lights}}var Wq={};da(Wq,{decode:()=>TFt,encode:()=>CFt,name:()=>SFt});var w_="KHR_materials_unlit",SFt=w_;async function TFt(e){let t=new qr(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,w_);t.removeExtension(w_)}function CFt(e){let t=new qr(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,w_,{}),t.addExtension(w_))}var Vq={};da(Vq,{decode:()=>FFt,encode:()=>kFt,name:()=>DFt});var E_="KHR_techniques_webgl",DFt=E_;async function FFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(E_);if(n){let i=BFt(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,E_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=OFt(a.technique,t)),t.removeObjectExtension(a,E_)}t.removeExtension(E_)}}async function kFt(e,t){}function BFt(e,t){let{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=a.decode(t.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=r[o.program]}),i}function OFt(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var T2e=[xq,vq,Lq,Mq,qq,Uq,Hq,Wq,Vq,zq,_q];function C2e(e,t={},r){var i;let n=T2e.filter(a=>F2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function D2e(e,t={},r){var i;let n=T2e.filter(a=>F2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function F2e(e,t){var i;let r=((i=t==null?void 0:t.gltf)==null?void 0:i.excludeExtensions)||{};return!(e in r&&!r[e])}var Kq="KHR_binary_glTF";function k2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Kq);i&&Object.assign(n,i),t.removeObjectExtension(n,Kq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Kq)}var B2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},PFt={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},$q=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),k2e(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in B2e)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let i in n){let a=n[i];a.id=a.id||i;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][i]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in B2e)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:i,material:a}=r;for(let o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(r.indices=this._convertIdToIndex(i,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let i in n){let a=n[i],o=this._convertIdToIndex(a,i);n[i]=o}}_convertIdToIndex(t,r){let n=PFt[r];if(n in this.idToIndexMap){let i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return i}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,n,i;for(let a of t.materials){a.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let o=((r=a.values)==null?void 0:r.tex)||((n=a.values)==null?void 0:n.texture2d_0)||((i=a.values)==null?void 0:i.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function O2e(e,t={}){return new $q().normalize(e,t)}async function I2e(e,t,r=0,n,i){var a,o,s;return RFt(e,t,r,n),O2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),C2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await jFt(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await LFt(e,n,i),await D2e(e,n,i),e}function RFt(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!_2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=QI(t);else if(t instanceof ArrayBuffer){let o={};r=w2e(o,t,r,n.glb),Gi(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Gi(!1,"GLTF: must be ArrayBuffer or string");let i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:o}=e._glb;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}let a=e.json.images||[];e.images=new Array(a.length).fill({})}async function jFt(e,t,r){var i,a;let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:u}=r;Gi(u);let c=Rq(s.uri,t),l=await((i=r==null?void 0:r.fetch)==null?void 0:i.call(r,c)),f=await((a=l==null?void 0:l.arrayBuffer)==null?void 0:a.call(l));e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function LFt(e,t,r){let n=MFt(e),i=e.json.images||[],a=[];for(let o of n)a.push(qFt(e,i[o],o,t,r));return await Promise.all(a)}function MFt(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function qFt(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Rq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=U_e(e.json,e.buffers,t.bufferView);a=$p(s.buffer,s.byteOffset,s.byteLength)}Gi(a,"glTF image has no data");let o=await Do(a,[kv,Lh],{...n,mimeType:t.mimeType,basis:n.basis||{format:Mv()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),e.images=e.images||[],e.images[r]=o}var Ll={name:"glTF",id:"gltf",module:"gltf",version:QC,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:NFt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function NFt(e,t={},r){t={...Ll.options,...t},t.gltf={...Ll.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await I2e({},e,n,t,r)}var UFt=1179937895,GFt=1313821514,zFt=5130562,Tc=!0;function P2e(e,t,r=0,n={}){let{magic:i=UFt,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,Tc),t.setUint32(r+4,a,Tc),t.setUint32(r+8,0,Tc));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,Tc),t.setUint32(r+4,GFt,Tc)),r+=8;let f=JSON.stringify(o);if(r=Pm(t,r,f,4),t){let d=r-l-8;t.setUint32(l+0,d,Tc)}if(s){let d=r;if(t&&(t.setUint32(r+0,0,Tc),t.setUint32(r+4,zFt,Tc)),r+=8,r=NA(t,r,s,4),t){let p=r-d-8;t.setUint32(d+0,p,Tc)}}if(t){let d=r-u;t.setUint32(c,d,Tc)}return r}function Yq(e,t,r,n){return HFt(e),P2e(e,t,r,n)}function HFt(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Jq={name:"glTF",id:"gltf",module:"gltf",version:QC,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,options:{gltf:{}},encode:async(e,t={})=>R2e(e,t),encodeSync:R2e};function R2e(e,t={}){let{byteOffset:r=0}=t,n=Yq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Yq(e,a,r,t),i}var WFt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},VFt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_s={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},KFt={magFilter:_s.TEXTURE_MAG_FILTER,minFilter:_s.TEXTURE_MIN_FILTER,wrapS:_s.TEXTURE_WRAP_S,wrapT:_s.TEXTURE_WRAP_T},$Ft={[_s.TEXTURE_MAG_FILTER]:_s.LINEAR,[_s.TEXTURE_MIN_FILTER]:_s.NEAREST_MIPMAP_LINEAR,[_s.TEXTURE_WRAP_S]:_s.REPEAT,[_s.TEXTURE_WRAP_T]:_s.REPEAT};function YFt(){return{id:"default-sampler",parameters:$Ft}}function JFt(e){return VFt[e]}function XFt(e){return WFt[e]}var Xq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Gi(n),this.baseUri=o,this.buffers=i,this.images=a,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((i,a)=>this._resolveBufferView(i,a))),t.images&&(n.images=t.images.map((i,a)=>this._resolveImage(i,a))),t.samplers&&(n.samplers=t.samplers.map((i,a)=>this._resolveSampler(i,a))),t.textures&&(n.textures=t.textures.map((i,a)=>this._resolveTexture(i,a))),t.accessors&&(n.accessors=t.accessors.map((i,a)=>this._resolveAccessor(i,a))),t.materials&&(n.materials=t.materials.map((i,a)=>this._resolveMaterial(i,a))),t.meshes&&(n.meshes=t.meshes.map((i,a)=>this._resolveMesh(i,a))),t.nodes&&(n.nodes=t.nodes.map((i,a)=>this._resolveNode(i,a)),n.nodes=n.nodes.map((i,a)=>this._resolveNodeChildren(i))),t.skins&&(n.skins=t.skins.map((i,a)=>this._resolveSkin(i,a))),t.scenes&&(n.scenes=t.scenes.map((i,a)=>this._resolveScene(i,a))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:(t==null?void 0:t.id)||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((i,a)=>{let o=this.getMesh(a);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(i=>{let a={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return i.indices!==void 0&&(a.indices=this.getAccessor(i.indices)),i.material!==void 0&&(a.material=this.getMaterial(i.material)),a})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=JFt(t.componentType),i=XFt(t.type),a=n*i,o={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:i,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:c}=Ov(o,o.bufferView),l=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(l,l+c);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,l,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_getValueFromInterleavedBuffer(t,r,n,i,a){let o=new Uint8Array(a*i);for(let s=0;s<a;s++){let u=r+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+i)),s*i)}return o.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):YFt(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let i in n){let a=this._enumSamplerParameter(i);a!==void 0&&(n.parameters[a]=n[i])}return n}_enumSamplerParameter(t){return KFt[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},i=this.images[r];return i&&(n.image=i),n}_resolveBufferView(t,r){let n=t.buffer,i=this.buffers[n].arrayBuffer,a=this.buffers[n].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(i,a,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function A_(e,t){return new Xq().postProcess(e,t)}var fD={URI:0,EMBEDDED:1};function dD(e,t,r,n){e.rotateYtoZ=!0;let i=(e.byteOffset||0)+(e.byteLength||0)-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n!=null&&n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=$p(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function pD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(QFt(e,t,r),i.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:a}=n,o=await a(e.gltfUrl,r);e.gltfArrayBuffer=await o.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let a=await Do(e.gltfArrayBuffer,Ll,r,n);e.gltf=A_(a),e.gpuMemoryUsageInBytes=h_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function QFt(e,t,r){switch(t){case fD.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case fD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function j2e(e,t,r,n,i){var o;r=ZFt(e,t,r,n,i),await pD(e,fD.EMBEDDED,n,i);let a=(o=e==null?void 0:e.gltf)==null?void 0:o.extensions;return a&&a.CESIUM_RTC&&(e.rtcCenter=a.CESIUM_RTC.center),r}function ZFt(e,t,r,n,i){r=Dd(e,t,r),r=Cv(e,t,r),r=Dv(e,t,r,n),r=dD(e,t,r,n);let a=new Rl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function L2e(e,t,r,n,i){return r=ekt(e,t,r,n,i),await pD(e,e.gltfFormat||0,n,i),r}function ekt(e,t,r,n,i){var c;if(r=Dd(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Cv(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Dv(e,t,r,n),r=dD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Rl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let u=new Rh(e.batchTableJson,e.batchTableBinary,s);return tkt(e,o,u,s),r}function tkt(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Rr,l=new gs,f=new ce,d={},p=new Kr,h=[],b=[],g=[],x=[];for(let E=0;E<n;E++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Ht.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3,E,a);let I=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3);if(!I)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let P=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let U=65535;for(let Y=0;Y<3;Y++)S[Y]=S[Y]/U*P[Y]+I[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),d.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,h),e.normalRight=t.getProperty("NORMAL_RIGHT",Ht.FLOAT,3,E,b);let F=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ht.UNSIGNED_SHORT,2,E,h),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ht.UNSIGNED_SHORT,2,E,b),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(or.WGS84.eastNorthUpToFixedFrame(a,p),p.getRotationMatrix3(c)):c.identity()}F&&(u.copy(o).cross(s).normalize(),c.setColumn(0,o),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),d.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Ht.FLOAT,1,E,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Ht.FLOAT,3,E,h);j&&f.scale(j),d.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(d.rotation);p.identity(),p.translate(d.translation),p.multiplyRight(N),p.scale(d.scale);let C=p.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function M2e(e,t,r,n,i,a){r=Dd(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={shape:"tile3d"};e.tiles.push(s),r=await a(t,r,n,i,s)}return r}async function q2e(e,t,r,n){var i,a;if(e.rotateYtoZ=!0,e.gltfUpAxis=(i=r==null?void 0:r["3d-tiles"])!=null&&i.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(a=r==null?void 0:r["3d-tiles"])!=null&&a.loadGLTF){if(!n)return t.byteLength;let o=await Do(t,Ll,r,n);e.gltf=A_(o),e.gpuMemoryUsageInBytes=h_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Qq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=s_e(e,t),i.type){case bs.COMPOSITE:return await M2e(i,e,t,r,n,Qq);case bs.BATCHED_3D_MODEL:return await j2e(i,e,t,r,n);case bs.GLTF:return await q2e(i,e,r,n);case bs.INSTANCED_3D_MODEL:return await L2e(i,e,t,r,n);case bs.POINT_CLOUD:return await S_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Zq(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let a=N2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=N2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await hD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let d of c.contentAvailability)await hD(c,d,f,r);else await hD(c,c.contentAvailability,f,r);return await hD(c,c.childSubtreeAvailability,f,r),c}async function hD(e,t,r,n){let i=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof i!="number")return;let a=e.bufferViews[i],o=e.buffers[a.buffer];if(!(n!=null&&n.baseUrl))throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){let u=`${(n==null?void 0:n.baseUrl)||""}/${o.uri}`,l=await(await n.fetch(u)).arrayBuffer();t.explicitBitstream=new Uint8Array(l,a.byteOffset,a.byteLength);return}let s=e.buffers.slice(0,a.buffer).reduce((u,c)=>u+c.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(s,s+o.byteLength),a.byteOffset,a.byteLength)}function N2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var mD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Ev,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Zq,options:{}};function eN(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function vu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||eN()}var rkt=globalThis.self||globalThis.window||globalThis.global,Uv=globalThis.window||globalThis.self||globalThis.global,nkt=globalThis.document||{},qh=globalThis.process||{},ikt=globalThis.console,FEr=globalThis.navigator||{};var gD="4.1.0-alpha.6",OEr=vu();function akt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var vD=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=akt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function U2e(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function G2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function bD(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var yD;(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"})(yD||(yD={}));var okt=10;function z2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),yD[e]||yD.WHITE)}function H2e(e,t,r){if(!vu&&typeof e=="string"){if(t){let n=z2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=z2e(r);e="\x1B[".concat(n+okt,"m").concat(e,"\x1B[49m")}}return e}function W2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function Gv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Nh(){let e;if(vu()&&Uv.performance){var t,r;e=Uv===null||Uv===void 0||(t=Uv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in qh){var n;let i=qh===null||qh===void 0||(n=qh.hrtime)===null||n===void 0?void 0:n.call(qh);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var zv={debug:vu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},skt={enabled:!0,level:0};function ws(){}var V2e={},K2e={once:!0},S_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=gD,this._startTs=Nh(),this._deltaTs=Nh(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new vD("__probe-".concat(this.id,"__"),skt),this.timeStamp("".concat(this.id," started")),W2e(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Nh()-this._startTs).toPrecision(10))}getDelta(){return Number((Nh()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Gv(t,r)}warn(t){return this._getLogFunction(0,t,zv.warn,arguments,K2e)}error(t){return this._getLogFunction(0,t,zv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,zv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,zv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,zv.debug||zv.info,arguments,K2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ws,n&&[n],{tag:fkt(r)}):ws}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?vu()?lkt({image:i,message:a,scale:o}):ckt({image:i,message:a,scale:o}):ws}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ws)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=$2e({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ws)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Y2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=$2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Gv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Nh();let o=a.tag||a.message;if(a.once&&o)if(!V2e[o])V2e[o]=Nh();else return ws;return r=ukt(this.id,a.message,a),n.bind(console,r,...a.args)}return ws}};S_.VERSION=gD;function Y2e(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Gv(Number.isFinite(t)&&t>=0),t}function $2e(e){let{logLevel:t,message:r}=e;e.logLevel=Y2e(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return Gv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function ukt(e,t,r){if(typeof t=="string"){let n=r.time?G2e(U2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=H2e(t,r.color,r.background)}return t}function ckt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ws}function lkt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=bD(a,r,n);console.log(...o)},a.src=t,ws}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...bD(t,r,n)),ws;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...bD(a,r,n)),a.src=t.toDataURL(),ws}return ws}function fkt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var tN=new S_({id:"@probe.gl/log"});var Es=null;try{Es=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function kn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}kn.prototype.__isLong__;Object.defineProperty(kn.prototype,"__isLong__",{value:!0});function Ua(e){return(e&&e.__isLong__)===!0}function J2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Ua;var X2e={},Q2e={};function Uh(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=Q2e[e],n)?n:(r=$r(e,0,!0),i&&(Q2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=X2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(X2e[e]=r),r))}kn.fromInt=Uh;function As(e,t){if(isNaN(e))return t?Ml:bu;if(t){if(e<0)return Ml;if(e>=rwe)return awe}else{if(e<=-ewe)return vo;if(e+1>=ewe)return iwe}return e<0?As(-e,t).neg():$r(e%Wv|0,e/Wv|0,t)}kn.fromNumber=As;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var xD=Math.pow;function nN(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?Ml:bu;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return nN(e.substring(1),t,r).neg();for(var i=As(xD(r,8)),a=bu,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),r);if(s<8){var c=As(xD(r,s));a=a.mul(c).add(As(u))}else a=a.mul(i),a=a.add(As(u))}return a.unsigned=t,a}kn.fromString=nN;function yu(e,t){return typeof e=="number"?As(e,t):typeof e=="string"?nN(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=yu;var Z2e=1<<16,dkt=1<<24,Wv=Z2e*Z2e,rwe=Wv*Wv,ewe=rwe/2,twe=Uh(dkt),bu=Uh(0);kn.ZERO=bu;var Ml=Uh(0,!0);kn.UZERO=Ml;var Hv=Uh(1);kn.ONE=Hv;var nwe=Uh(1,!0);kn.UONE=nwe;var rN=Uh(-1);kn.NEG_ONE=rN;var iwe=$r(-1,2147483647,!1);kn.MAX_VALUE=iwe;var awe=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=awe;var vo=$r(0,-2147483648,!1);kn.MIN_VALUE=vo;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Wv+(this.low>>>0):this.high*Wv+(this.low>>>0)};Ke.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(vo)){var r=As(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=As(xD(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),c=o.sub(u.mul(a)).toInt()>>>0,l=c.toString(t);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};Ke.getHighBits=function(){return this.high};Ke.getHighBitsUnsigned=function(){return this.high>>>0};Ke.getLowBits=function(){return this.low};Ke.getLowBitsUnsigned=function(){return this.low>>>0};Ke.getNumBitsAbs=function(){if(this.isNegative())return this.eq(vo)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};Ke.isZero=function(){return this.high===0&&this.low===0};Ke.eqz=Ke.isZero;Ke.isNegative=function(){return!this.unsigned&&this.high<0};Ke.isPositive=function(){return this.unsigned||this.high>=0};Ke.isOdd=function(){return(this.low&1)===1};Ke.isEven=function(){return(this.low&1)===0};Ke.equals=function(t){return Ua(t)||(t=yu(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};Ke.eq=Ke.equals;Ke.notEquals=function(t){return!this.eq(t)};Ke.neq=Ke.notEquals;Ke.ne=Ke.notEquals;Ke.lessThan=function(t){return this.comp(t)<0};Ke.lt=Ke.lessThan;Ke.lessThanOrEqual=function(t){return this.comp(t)<=0};Ke.lte=Ke.lessThanOrEqual;Ke.le=Ke.lessThanOrEqual;Ke.greaterThan=function(t){return this.comp(t)>0};Ke.gt=Ke.greaterThan;Ke.greaterThanOrEqual=function(t){return this.comp(t)>=0};Ke.gte=Ke.greaterThanOrEqual;Ke.ge=Ke.greaterThanOrEqual;Ke.compare=function(t){if(Ua(t)||(t=yu(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};Ke.comp=Ke.compare;Ke.negate=function(){return!this.unsigned&&this.eq(vo)?vo:this.not().add(Hv)};Ke.neg=Ke.negate;Ke.add=function(t){Ua(t)||(t=yu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,d=0,p=0;return p+=a+c,d+=p>>>16,p&=65535,d+=i+u,f+=d>>>16,d&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(d<<16|p,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Ua(t)||(t=yu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Ua(t)||(t=yu(t)),Es){var r=Es.mul(this.low,this.high,t.low,t.high);return $r(r,Es.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Ml:bu;if(this.eq(vo))return t.isOdd()?vo:bu;if(t.eq(vo))return this.isOdd()?vo:bu;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(twe)&&t.lt(twe))return As(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,d=0,p=0,h=0;return h+=o*l,p+=h>>>16,h&=65535,p+=a*l,d+=p>>>16,p&=65535,p+=o*c,d+=p>>>16,p&=65535,d+=i*l,f+=d>>>16,d&=65535,d+=a*c,f+=d>>>16,d&=65535,d+=o*u,f+=d>>>16,d&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(p<<16|h,f<<16|d,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Ua(t)||(t=yu(t)),t.isZero())throw Error("division by zero");if(Es){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Es.div_u:Es.div_s)(this.low,this.high,t.low,t.high);return $r(r,Es.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Ml:bu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Ml;if(t.gt(this.shru(1)))return nwe;a=Ml}else{if(this.eq(vo)){if(t.eq(Hv)||t.eq(rN))return vo;if(t.eq(vo))return Hv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(bu)?t.isNegative()?Hv:rN:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(vo))return this.unsigned?Ml:bu;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=bu}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:xD(2,s-48),c=As(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=As(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Hv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Ua(t)||(t=yu(t)),Es){var r=(this.unsigned?Es.rem_u:Es.rem_s)(this.low,this.high,t.low,t.high);return $r(r,Es.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return $r(~this.low,~this.high,this.unsigned)};Ke.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};Ke.clz=Ke.countLeadingZeros;Ke.countTrailingZeros=function(){return this.low?J2e(this.low):J2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Ua(t)||(t=yu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Ua(t)||(t=yu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Ua(t)||(t=yu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):$r(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):$r(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?$r(this.high,0,this.unsigned):$r(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,$r(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};Ke.rotl=Ke.rotateLeft;Ke.rotateRight=function(t){var r;return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,$r(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?$r(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:$r(this.low,this.high,!0)};Ke.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};Ke.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};Ke.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};kn.fromBytes=function(t,r,n){return n?kn.fromBytesLE(t,r):kn.fromBytesBE(t,r)};kn.fromBytesLE=function(t,r){return new kn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};kn.fromBytesBE=function(t,r){return new kn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var Vv=kn;var pkt=16;function T_(e){e==="X"&&(e="");let t=e.padEnd(pkt,"0");return Vv.fromString(t,!0,16)}function iN(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-a.length).join("0")+a}function aN(e,t){let r=hkt(e).shiftRightUnsigned(2);return e.add(Vv.fromNumber(2*t+1-4).multiply(r))}function hkt(e){return e.and(e.not().add(1))}var mkt=3,gkt=30,vkt=2*gkt+1,owe=180/Math.PI;function uwe(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=0,o=[0,0];for(let s=i-1;s>=0;s--){a=i-s;let u=n[s],c=0,l=0;u==="1"?l=1:u==="2"?(c=1,l=1):u==="3"&&(c=1);let f=Math.pow(2,a-1);bkt(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(r%2===1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function cwe(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<mkt+vkt;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=Vv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Vv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function oN(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function swe(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function sN(e){return[swe(e[0]),swe(e[1])]}function uN(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function cN([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*owe,n*owe]}function bkt(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let i=t[0];t[0]=t[1],t[1]=i}}function lwe(e){let t=oN(e.ij,e.level,[.5,.5]),r=sN(t),n=uN(e.face,r);return cN(n)}var ykt=100;function lN(e){let{face:t,ij:r,level:n}=e,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(ykt*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],d=(f[0]-l[0])/a,p=(f[1]-l[1])/a;for(let h=0;h<a;h++){l[0]+=d,l[1]+=p;let b=oN(r,n,l),g=sN(b),x=uN(t,g),E=cN(x);Math.abs(E[1])>89.999&&(E[0]=u);let S=E[0]-u;E[0]+=S>180?-360:S<-180?360:0,o[s++]=E[0],o[s++]=E[1],u=E[0]}}return o[s++]=o[0],o[s++]=o[1],o}function Kv(e){let t=xkt(e);return uwe(t)}function xkt(e){if(e.indexOf("/")>0)return e;let t=T_(e);return cwe(t)}function fN(e){let t=Kv(e);return lwe(t)}function dwe(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let i=0;i<4;i++){let a=`${e.face}/${i}`,o=Kv(a),s=lN(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=fwe(r)}else{let r=lN(e);t=fwe(r)}return t}function fwe(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,i)=>n-i),r.sort((n,i)=>n-i),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function dN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=Kv(e),a=dwe(i),o=a.west,s=a.south,u=a.east,c=a.north,l=[];return l.push(new ce(o,c,r)),l.push(new ce(u,c,r)),l.push(new ce(u,s,r)),l.push(new ce(o,s,r)),l.push(new ce(o,c,n)),l.push(new ce(u,c,n)),l.push(new ce(u,s,n)),l.push(new ce(o,s,n)),l}function _D(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=dN(t,r),i=fN(t),a=i[0],o=i[1],s=or.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new ce(s[0],s[1],s[2]);n.push(u);let c=c_(n);return[...c.center,...c.halfAxes]}var _kt=4,wkt=8,Ekt={QUADTREE:_kt,OCTREE:wkt};function Akt(e,t,r){if(e!=null&&e.box){let n=T_(e.s2VolumeInfo.token),i=aN(n,t),a=iN(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,d=c.minimumHeight+l/2;c.minimumHeight=d-f,c.maximumHeight=d+f;break;default:break}return{box:_D(o),s2VolumeInfo:o}}}async function hN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:i,loaderOptions:a}=e,{subtree:o,level:s=0,globalData:u={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:d,subtreesUriTemplate:p,basePath:h}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return tN.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${d} won't be loaded...`),b;let g=s+u.level;if(g>f)return b;let x=Ekt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**s-1)/(x-1),k=Gh(r.mortonIndex,n,E),N=j+k,C=Gh(r.x,S,1),I=Gh(r.y,F,1),P=Gh(r.z,D,1),U=!1;s>=l&&(U=pN(o.childSubtreeAvailability,k));let Y=Gh(u.x,C,s),J=Gh(u.y,I,s),re=Gh(u.z,P,s);if(U){let Te=`${h}/${p}`,$e=wD(Te,g,Y,J,re);o=await An($e,mD,a),u={mortonIndex:k,x:C,y:I,z:P,level:s},k=0,N=0,C=0,I=0,P=0,s=0}if(!pN(o.tileAvailability,N))return b;pN(o.contentAvailability,N)&&(b.contentUrl=wD(d,g,Y,J,re));let ye=s+1,pe={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=Akt(i,Te,c),We=await hN({subtree:o,implicitOptions:t,loaderOptions:a,parentData:pe,childIndex:Te,level:ye,globalData:{...u},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=Skt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,i);b.children.push(ne)}}return b}function pN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&tN.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?Dkt(t,r.explicitBitstream):!1}function Skt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,d=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),p=l/2**t,h=i!=null&&i.box?{box:i.box}:f,b=Tkt(t,h,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:p,geometricError:p,transform:e.transform,boundingVolume:b}}function Tkt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,d=2**e,p=(u-o)/d,h=(c-s)/d,b=(f-l)/d,[g,x]=[o+p*n,o+p*(n+1)],[E,S]=[s+h*i,s+h*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,E,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Gh(e,t,r){return(e<<r)+t}function wD(e,t,r,n,i){let a=Ckt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function Ckt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function Dkt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function gN(e,t=""){if(!t)return"empty";let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return"pointcloud";case"i3dm":case"b3dm":case"glb":case"gltf":return"scenegraph";default:return n||"empty"}}function vN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function mN(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return nu.resolve(t,e)}function pwe(e,t){var i;if(!e)return null;let r;if(e.content){let a=e.content.uri||((i=e.content)==null?void 0:i.url);typeof a<"u"&&(r=mN(a,t))}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:gN(e,r),refine:vN(e.refine)}}async function gwe(e,t,r){let n=null,i=mwe(e.root);i&&e.root?n=await hwe(e.root,e,t,i,r):n=pwe(e.root,t);let a=[];for(a.push(n);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let c of s){let l=mwe(c),f;l?f=await hwe(c,e,t,l,r):f=pwe(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function hwe(e,t,r,n,i){var F,D,j;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=wD(c,0,0,0,0),f=mN(l,r),d=await An(f,mD,i),p=(F=e.content)==null?void 0:F.uri,h=p?mN(p,r):"",b=(D=t==null?void 0:t.root)==null?void 0:D.refine,g=e.geometricError,x=(j=e.boundingVolume.extensions)==null?void 0:j["3DTILES_bounding_volume_S2"];if(x){let N={box:_D(x),s2VolumeInfo:x};e.boundingVolume=N}let E=e.boundingVolume,S={contentUrlTemplate:h,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:b,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:g,rootBoundingVolume:E,getTileType:gN,getRefine:vN};return await Fkt(e,r,d,S,i)}async function Fkt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await hN({subtree:r,implicitOptions:n,loaderOptions:i}),s,u=null;return o&&(s=o,u={uri:o.replace(`${t}/`,"")}),{...e,id:s,contentUrl:s,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:gN(e,s),refine:vN(e.refine),content:u||e.content,children:a}}function mwe(e){var t;return((t=e==null?void 0:e.extensions)==null?void 0:t["3DTILES_implicit_tiling"])||(e==null?void 0:e.implicitTiling)}var Cc={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Ev,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:kkt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function kkt(e,t={},r){let n=t["3d-tiles"]||{},i;return n.isTileset==="auto"?i=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:i=n.isTileset,i?Bkt(e,t,r):Okt(e,t,r)}async function Bkt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=Ikt(i),o=await gwe(n,a,t||{});return{...n,shape:"tileset3d",loader:Cc,url:i,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||n.root,type:"TILES3D",lodMetricType:"geometricError",lodMetricValue:((u=n.root)==null?void 0:u.geometricError)||0}}async function Okt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Qq(e,0,t,r,n.content),n.content}function Ikt(e){return nu.dirname(e)}var vwe="https://api.cesium.com/v1/assets";async function bwe(e,t){if(!t){let a=await Pkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await Rkt(e,t),{type:n,url:i}=r;return Qt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function Pkt(e){Qt(e);let t=vwe,r={Authorization:`Bearer ${e}`},n=await Oo(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function Rkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${vwe}/${t}`,i=await Oo(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await Oo(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function jkt(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let i=e.match(/\/([0-9]+)\/tileset.json/);n=i&&i[1]}return bwe(r,n)}var ED={...Cc,id:"cesium-ion",name:"Cesium Ion",preload:jkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=ED,Cc.parse(e,t,r)),options:{"cesium-ion":{...Cc.options["3d-tiles"],accessToken:null}}};var TTe=Wt(iG(),1),rPt="4.1.0-alpha.6",aG={id:"zip",module:"zip",name:"Zip Archive",version:rPt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:nPt};async function nPt(e,t={}){let r=[],n={};try{let i=new TTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=iPt(i,u,t).then(l=>{n[o]=l});r.push(c)}),await Promise.all(r),n}catch(i){throw t.log.error(`Unable to read zip archive: ${i}`),i}}async function iPt(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(n){return r.log.error(`Unable to read ${t} from zip archive: ${n}`),n}}var c2=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let i=e.length-4n;i>-1;i--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(i),r.every((a,o)=>a===t[o])){n=i;break}return n};var aPt=new Uint8Array([1,0]);function h4(e){let t={...e,zip64Length:(e.offset?1:0)*8+(e.size?1:0)*16},r=[];for(let n of oPt){if(!t[n.name??""]&&!n.default)continue;let i=new DataView(new ArrayBuffer(n.size));CTe[n.size](i,0,t[n.name??""]??n.default),r.push(i.buffer)}return Di(...r)}function yo(e,t,r,n){CTe[t](e,Number(r),n)}var CTe={2:(e,t,r)=>{e.setUint16(t,Number(r),!0)},4:(e,t,r)=>{e.setUint32(t,Number(r),!0)},8:(e,t,r)=>{e.setBigUint64(t,BigInt(r),!0)}},oPt=[{size:2,default:new DataView(aPt.buffer).getUint16(0,!0)},{size:2,name:"zip64Length"},{size:8,name:"size"},{size:8,name:"size"},{size:8,name:"offset"}];var sPt=new Uint8Array([80,75,5,6]),uPt=new Uint8Array([80,75,6,7]),cPt=new Uint8Array([80,75,6,6]),DTe=8n,lPt=10n,fPt=12n,FTe=16n,kTe=8n,BTe=24n,dPt=32n,pPt=40n,OTe=48n,m4=async e=>{let t=await c2(e,sPt),r=BigInt(await e.getUint16(t+DTe)),n=BigInt(await e.getUint32(t+FTe)),i=t-20n,a=0n,o=await e.slice(i,i+4n);if(ic(o,uPt)){a=await e.getBigUint64(i+kTe);let s=await e.slice(a,a+4n);if(!ic(s,cPt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(a+BTe),n=await e.getBigUint64(a+OTe)}else i=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:a,zip64EoCDLocatorOffset:i,zipEoCDOffset:t}}};async function ITe(e,t,r,n,i){let a=new DataView(e),o=t.zip64EoCDOffset?t.zipEoCDOffset-t.zip64EoCDOffset:0n;if(Number(i)<=65535&&(yo(a,2,o+DTe,i),yo(a,2,o+lPt,i)),n-r<=4294967295&&yo(a,4,o+fPt,n-r),r<4294967295&&yo(a,4,o+FTe,r),t.zip64EoCDLocatorOffset&&t.zip64EoCDOffset){let s=t.zip64EoCDLocatorOffset-t.zip64EoCDOffset;yo(a,8,s+kTe,n),yo(a,8,OTe,r),yo(a,8,BTe,i),yo(a,8,dPt,i),yo(a,8,pPt,n-r)}return new Uint8Array(a.buffer)}var hPt=20n,mPt=24n,gPt=28n,vPt=30n,bPt=32n,yPt=42n,g4=46n,f2=new Uint8Array([80,75,1,2]),l2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ic(r,f2.buffer))return null;let n=BigInt(await t.getUint32(e+hPt)),i=BigInt(await t.getUint32(e+mPt)),a=await t.getUint16(e+vPt),o=BigInt(await t.getUint16(e+bPt)),s=await t.getUint16(e+gPt),u=await t.slice(e+g4,e+g4+BigInt(s)),c=new TextDecoder().decode(u),l=e+g4+BigInt(s),f=await t.getUint32(e+yPt),d=BigInt(f),p=new DataView(await t.slice(l,l+BigInt(a))),h={uncompressedSize:i,compressedSize:n,localHeaderOffset:d,startDisk:o},b=xPt(h,p);return{...h,...b,extraFieldLength:a,fileNameLength:s,fileName:c,extraOffset:l}};async function*yb(e){let{cdStartOffset:t}=await m4(e),r=await l2(t,e);for(;r;)yield r,r=await l2(r.extraOffset+BigInt(r.extraFieldLength),e)}var PTe=(...e)=>e[0]+e[1]*16,xPt=(e,t)=>{let r=_Pt(e),n={};if(r.length>0){let i=r.reduce((s,u)=>s+u.length,0),a=new Uint8Array(t.buffer).findIndex((s,u,c)=>PTe(c[u],c[u+1])===1&&PTe(c[u+2],c[u+3])===i),o=0;for(let s of r){let u=o;n[s.name]=t.getBigUint64(a+4+u,!0),o=u+s.length}}return n},_Pt=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};function oG(e){let t={...e,fnlength:e.fileName.length,extraLength:0},r=new ArrayBuffer(0),n={};t.offset>=4294967295&&(n.offset=t.offset,t.offset=BigInt(4294967295)),t.length>=4294967295&&(n.size=t.length,t.length=4294967295),Object.keys(n).length&&(r=h4(n),t.extraLength=r.byteLength);let i=new DataView(new ArrayBuffer(Number(g4)));for(let s of wPt)yo(i,s.size,s.offset,t[s.name??""]??s.default??0);let a=new TextEncoder().encode(t.fileName);return Di(i.buffer,a,r)}var wPt=[{offset:0,size:4,default:new DataView(f2.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var EPt=8n,APt=18n,SPt=22n,TPt=26n,CPt=28n,d2=30n,sG=new Uint8Array([80,75,3,4]),n0=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ic(r,sG))return null;let n=await t.getUint16(e+TPt),i=new TextDecoder().decode(await t.slice(e+d2,e+d2+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+CPt),o=e+d2+BigInt(n+a),s=await t.getUint16(e+EPt),u=BigInt(await t.getUint32(e+APt)),c=BigInt(await t.getUint32(e+SPt)),l=e+d2+BigInt(n),f=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(l+f),f+=8n),u===BigInt(4294967295)&&(u=await t.getBigUint64(l+f),f+=8n),o===BigInt(4294967295)&&(o=await t.getBigUint64(l+f)),{fileNameLength:n,fileName:i,extraFieldLength:a,fileDataOffset:o,compressedSize:u,compressionMethod:s}};function uG(e){let t={...e,extraLength:0,fnlength:e.fileName.length},r=new ArrayBuffer(0),n={};t.length>=4294967295&&(n.size=t.length,t.length=4294967295),Object.keys(n).length&&(r=h4(n),t.extraLength=r.byteLength);let i=new DataView(new ArrayBuffer(Number(d2)));for(let s of DPt)yo(i,s.size,s.offset,t[s.name??""]??s.default??0);let a=new TextEncoder().encode(t.fileName);return Di(i.buffer,a,r)}var DPt=[{offset:0,size:4,default:new DataView(sG.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];async function FPt(e){let t=await m4(e),r=t.cdStartOffset,n=Number(t.offsets.zip64EoCDOffset?t.offsets.zip64EoCDOffset-r:t.offsets.zipEoCDOffset-r),i=await e.slice(r,e.length);await e.truncate(Number(r));let a=i.slice(0,n),o=i.slice(n,i.byteLength);return[a,o,t]}async function kPt(e,t,r){let n=parseInt(await new qx().hash(t,"hex"),16),i=uG({crc32:n,fileName:e,length:t.byteLength}),a=oG({crc32:n,fileName:e,offset:r,length:t.byteLength});return[new Uint8Array(Di(i,t)),new Uint8Array(a)]}async function p2(e,t,r){let n=new iu(e,!0),[i,a,o]=await FPt(n),s=n.length,[u,c]=await kPt(r,t,s);await n.append(u);let l=Di(i,c),f=n.length;await n.append(new Uint8Array(l));let d=n.length;await n.append(await ITe(a,o.offsets,f,d,o.cdRecordsNumber+1n))}function cG(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let i=t.getBigUint64(n+16,!0),a=BPt(e,n,16);r[a]=i}return r}function BPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function RTe(e){let t=yb(e),r=new Qp,n=new TextEncoder,i={};for await(let a of t){let o=a.fileName.split("\\").join("/").toLocaleLowerCase(),s=n.encode(o).buffer,u=await r.hash(s,"hex");i[u]=a.localHeaderOffset}return i}async function h2(e){let t=await RTe(e),r=Object.entries(t).map(([n,i])=>Di(IPt(n),PPt(i))).sort(OPt);return Di(...r)}function OPt(e,t){let r=new BigUint64Array(e),n=new BigUint64Array(t);return Number(r[0]===n[0]?r[1]-n[1]:r[0]-n[0])}function IPt(e){var r;let t=(r=e.match(/../g))==null?void 0:r.map(n=>parseInt(n,16));return new Uint8Array(t??new Array(16)).buffer}function PPt(e){return new BigUint64Array([e]).buffer}var xb=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Yp(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var m2=class extends xb{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var i0=Wt(WU(),1),Yl=Wt(require("zlib"),1);var a0=class extends xb{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Rm(Yl.default.gzip)(t):await Rm(Yl.default.deflate)(t);return pl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Rm(Yl.default.gunzip)(t):await Rm(Yl.default.inflate)(t);return pl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Yl.default.gzipSync(t):Yl.default.deflateSync(t);return pl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?i0.default.deflateRaw:i0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Yl.default.gunzipSync(t):Yl.default.inflateSync(t);return pl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?i0.default.inflateRaw:i0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new i0.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new i0.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let o of r){let s=new Uint8Array(o);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var RPt={0:async e=>e,8:async e=>await new a0({raw:!0}).decompress(e)},g2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new iu(t);else throw new Error("Cannot open file for random access in a WEB browser");else aP(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=yb(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=await this.getCDFileHeader(t),n=await n0(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=RPt[n.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(n.fileDataOffset,n.fileDataOffset+n.compressedSize),o=await i(a),s=new Response(o);return Object.defineProperty(s,"url",{value:`${this.fileName||""}/${t}`}),s}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=yb(this.fileProvider),n=null;for await(let i of r)if(i.fileName===t){n=i;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var jPt={0:e=>new m2().decompress(e),8:e=>new a0({raw:!0}).decompress(e)},v4=class{fileProvider;hashTable;constructor(t,r){this.fileProvider=t,this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r=new TextEncoder().encode(t).buffer,n=await new Qp().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await n0(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=jPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var v2=class extends g2{hashTable;constructor(t){super(t)}async fetch(t){let r=this.fileProvider;if(!r)throw new Error("No data detected in the zip archive");if(await this.parseHashTable(),this.hashTable){let i=await new v4(r,this.hashTable).getFile(t),a=new Response(i);return Object.defineProperty(a,"url",{value:`${this.fileName||""}/${t}`}),a}return super.fetch(t)}async parseHashTable(){if(this.hashTable!==void 0)return;let t=this.fileProvider;if(!t)throw new Error("No data detected in the zip archive");let r=await c2(t,f2),n=await l2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await n0(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=cG(o)}else this.hashTable=null}};function Ud(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Qt(Array.isArray(i)&&Number.isFinite(a)&&Number.isFinite(o)),t.setUint8(r+0,i[0]),t.setUint8(r+1,i[1]),t.setUint8(r+2,i[2]),t.setUint8(r+3,i[3]),t.setUint32(r+4,a,!0),t.setUint32(r+8,o,!0),r+=12,r}function Gd(e,t,r){e&&e.setUint32(t+8,r,!0)}function jTe(e,t,r,n,i){e={magic:Td.COMPOSITE,tiles:[],...e};let a=r;r+=Ud(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let o=0;o<e.tiles.length;++o)r+=i(e.tiles[o],t,r,n);return Gd(t,a,r-a),r}function LTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=ko(s.length,8),l=u?ko(u.length,8):0;e={magic:Td.BATCHED_MODEL,...e};let f=r;r=Ud(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r+=16,r=Pm(t,r,s,8),a&&(r=Pm(t,r,u,8));let d=e.gltfEncoded;return d&&(r=jx(t,r,d,d.byteLength)),Gd(t,f,r-f),r}function MTe(e,t,r,n){let{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,u={INSTANCES_LENGTH:i,POSITION:new Array(i*3).fill(0)},c=JSON.stringify(u),l=c.length;e={magic:Td.INSTANCED_MODEL,...e};let f=r;return r=Ud(e,t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=Im(t,r,c,l),r+=Im(t,r,o,s),Gd(t,f,r-f),r}var LPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function qTe(e,t,r,n){let{featureTableJson:i=LPt}=e,a=JSON.stringify(i);a=eP(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:Td.POINT_CLOUD,...e};let c=r;return r+=Ud(e,t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,u,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=Im(t,r,a,o),r+=jx(t,r,s,u),Gd(t,c,r-c),r}function fG(e,t){let r=lG(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return lG(e,i,0,t),n}function lG(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case bs.COMPOSITE:return jTe(e,t,r,n,lG);case bs.POINT_CLOUD:return qTe(e,t,r,n);case bs.BATCHED_3D_MODEL:return LTe(e,t,r,n);case bs.INSTANCED_3D_MODEL:return MTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var dG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Ev,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>NTe(e,t),encodeSync:NTe};function NTe(e,t){return fG(e,t)}var za=require("path");var UTe=Wt(require("crypto")),y4=new Uint8Array(256),b4=y4.length;function pG(){return b4>y4.length-16&&(UTe.default.randomFillSync(y4),b4=0),y4.slice(b4,b4+=16)}var Sa=[];for(let e=0;e<256;++e)Sa.push((e+256).toString(16).slice(1));function GTe(e,t=0){return(Sa[e[t+0]]+Sa[e[t+1]]+Sa[e[t+2]]+Sa[e[t+3]]+"-"+Sa[e[t+4]]+Sa[e[t+5]]+"-"+Sa[e[t+6]]+Sa[e[t+7]]+"-"+Sa[e[t+8]]+Sa[e[t+9]]+"-"+Sa[e[t+10]]+Sa[e[t+11]]+Sa[e[t+12]]+Sa[e[t+13]]+Sa[e[t+14]]+Sa[e[t+15]]).toLowerCase()}var zTe=Wt(require("crypto")),hG={randomUUID:zTe.default.randomUUID};function MPt(e,t,r){if(hG.randomUUID&&!t&&!e)return hG.randomUUID();e=e||{};let n=e.random||(e.rng||pG)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return GTe(n)}var Rc=MPt;var B0=Wt(require("process"),1),hk=Wt(Su(),1),aV=Wt(bG(),1);var ty=require("path"),zke=Wt(Su(),1);var e6e=()=>({folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}});var Zb=require("fs"),ey=require("path");var qke=require("zlib"),Nke=require("path"),gw=require("fs"),lKt=Wt(Mke(),1);var fKt=Wt(iG(),1);var dKt=Wt(mG(),1);function nk(e){let t=`${e}.gz`,r=(0,qke.createGzip)(),n=(0,gw.createReadStream)(e),i=(0,gw.createWriteStream)(t);return new Promise((a,o)=>{n.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),n.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),n.pipe(r).pipe(i)})}async function Uke(e,t,r,n,i){process.platform==="win32"?await hKt(e,t,r,n,i):await pKt(e,t,r,n)}async function pKt(e,t,r=0,n="."){let i=vw(t),a=[`-${r}`,"-r",i,n];await new dl().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function hKt(e,t,r=0,n=(0,Nke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=vw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new dl().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Bi(e,t,r="index.json"){let n;t instanceof Promise?n=new Uint8Array(await t):t instanceof ArrayBuffer?n=new Uint8Array(t):n=t,await Zb.promises.mkdir(e,{recursive:!0});let i=(0,ey.join)(e,r);try{await Zb.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function Gc(e,t,r="index.json",n=!0,i){let a=await Bi(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await nk(a);return await WW(a),o}}return a}async function ik(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,ey.join)(e,t);An(o,nP).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function Gke(e){try{return await Zb.promises.stat(e),!0}catch{return!1}}function bw(e){return Zb.promises.rm(e,{recursive:!0})}function WW(e){return Zb.promises.unlink(e)}function vw(e){return(0,ey.isAbsolute)(e)?e:(0,ey.join)(process.cwd(),e)}var to=class{nodesPerPage;nodesCounter;writeFile;converter;nodePages;length=0;constructor(t,r,n){this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=n,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,n;return this.converter.options.slpk?(r=(0,ty.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,ty.join)(this.converter.layers0Path,"nodepages",t.toString()),n="index.json"),{filePath:r,fileName:n}}async loadNodePage(t){let{filePath:r,fileName:n}=this.getNodePageFileName(t),i=(0,ty.join)(r,n);return await Gke(i)?(console.log(`load ${i}.`),await ik(r,n)):{nodes:[]}}getPageIndexByNodeId(t){return Math.floor(t/this.nodesPerPage)}async getPageByNodeId(t){let r=this.getPageIndexByNodeId(t);return this.converter.options.instantNodeWriting?await this.loadNodePage(r):this.nodePages[r]}async getNodeById(t,r){let n=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[n]}async addChildRelation(t,r){var i;if(t==null)return;let n=await this.getNodeById(t);(i=n.children)==null||i.push(r),await this.saveNode(n)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let n=this.nodePages[this.nodePages.length-1];n.nodes.length===this.nodesPerPage&&(n={nodes:[]},this.nodePages.push(n)),n.nodes.push(t)}return await this.addChildRelation(r,t.index),to.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),n=await this.getPageByNodeId(t.index),{filePath:i,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,n);o?to.updateAll(o,t):n.nodes.push(t);let s=JSON.stringify(n);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(i,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,s)},!0)}else return}async saveMetadata(){let t=(0,zke.default)({nodeCount:this.nodesCounter},e6e()),r=!1;await this.converter.writeQueue.enqueue({archiveKey:"metadata.json",writePromise:()=>this.writeFile(this.converter.layers0Path,JSON.stringify(t),"metadata.json",r)})}async save(){if(this.converter.options.instantNodeWriting){await this.saveMetadata();return}if(this.converter.options.slpk){for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,ty.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(i,n,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,ty.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,n)})}}static updateResourceInMesh(t){t.mesh&&isFinite(t.index)&&(t.mesh.geometry.resource=t.index)}static updateAll(t,r){return Object.assign(t,r,{index:t.index}),to.updateResourceInMesh(t),t}static updateMaterialByNodeId(t,r){t.mesh&&(t.mesh.material={definition:r,resource:t.index})}static updateVertexCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.vertexCount=r)}static updateNodeAttributeByNodeId(t){!t.mesh||!t.index||(t.mesh.attribute.resource=t.index)}static updateFeatureCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.featureCount=r)}static updateTexelCountHintByNodeId(t,r){!t.mesh||!t.mesh.material||(t.mesh.material.texelCountHint=r)}};var yw=require("path"),ak=require("fs");function ry(e){if(typeof e=="number"){let r=Math.floor(e/1e3),n=e-r*1e3;return Hke(r,n)}else{let r=e[0],n=e[1]/1e6;return Hke(r,n)}}function Hke(e,t){let r=Math.floor(e/3600);e=e-r*3600;let n=Math.floor(e/60);e=e-n*60;let i=Math.floor(e),a="";return r&&(a+=`${r}h `),n&&(a+=`${n}m `),i&&(a+=`${i}s`),a||(a+=`${t}ms`),a}async function ok(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=vw(r);try{if(t){let s=(0,yw.join)(i,`${n}.slpk`);return(await ak.promises.stat(s)).size}let a=(0,yw.join)(i,n);return await Wke(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function Wke(e){let t=0,r=await ak.promises.readdir(e);for(let n of r){let i=await ak.promises.stat((0,yw.join)(e,n));i.isDirectory()?t+=await Wke((0,yw.join)(e,n)):t+=i.size}return t}var cBe=Wt(bG(),1);var k0=3,ny=9;function Kke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/ny;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i,uvRegions:a};let u=mKt(o),c=gKt({...u,...e}),l=vKt(c);return bKt(l,u.featureCount)}function mKt(e){let t=1,r=1,n=Vke(e.slice(0,k0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=k0;c<e.length;c+=k0){let l=Vke(e.slice(c,c+k0));n!==l&&(i[t]=c/k0-1,i[t+1]=c/k0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/k0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Vke(e){let t={},r=e[0],n=1;for(let i of e)t[i]=(t[i]||0)+1,n=n>t[i]?n:t[i],r=n>t[i]?r:i;return r}function gKt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),d=new Float32Array(o),p=new Uint16Array(a),h=0,b=0,g=0,x=0,E=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=xw("positions",F,D),k=xw("normals",F,D),N=xw("colors",F,D),C=xw("uvRegions",F,D),I=xw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(h,h+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:p.subarray(x,x+C),texCoords:d.subarray(E,E+I)}),h+=j,b+=k,g+=N,x+=C,E+=I}return u}function xw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*ny;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function vKt(e){let t=[];for(let n of e){let i=t.find(a=>a.featureId===n.featureId);i?i.attributes.push(n):t.push({featureId:n.featureId,attributes:[n]})}let r=[];for(let n of t){let i=$ke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function bKt(e,t){let n=[e[0].featureId||0],i=[0],a=0,o=0;for(let c=1;c<e.length;c++){let l=e[c];n.push(l.featureId||0);let f=e[a];i.push(f.positions.length/ny-1+o),i.push(f.positions.length/ny+o),o+=f.positions.length/ny,a+=1}let s=$ke(e);return i.push(s.positions.length/ny-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function $ke(e){let t=e.map(({positions:f})=>f),r=t.length>1?Fo(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?Fo(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?Fo(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?Fo(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?Fo(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function VW(e,t){let r,n,i,a=or.WGS84.cartesianToCartographic(e.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof ua?(n=e.halfSize,r=new ce(n[0],n[1],n[2]).len(),i=e.quaternion):(r=e.radius,n=[r,r,r],i=new gs().fromMatrix3(new Rr([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:n,quaternion:i}}}function Yke(e,t){let r=yKt(e),n=c_(r),i=J7(r),a=or.WGS84.cartesianToCartographic(i.center,new ce),o=or.WGS84.cartesianToCartographic(n.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function yKt(e){let t=[];for(let r=0;r<e.length;r+=3){let n=new ce([e[r],e[r+1],e[r+2]]);t.push(n)}return t}function Jke(e){let t;e instanceof Xa?t=e:t=e.getBoundingSphere();let r=t.center,n=t.radius,i=or.WGS84.cartesianToCartographic(new ce(r[0]+n,r[1]+n,r[2]+n),new ce),a=or.WGS84.cartesianToCartographic(new ce(r[0]-n,r[1]-n,r[2]-n),new ce);return{xmin:Math.min(a[0],i[0]),xmax:Math.max(a[0],i[0]),ymin:Math.min(a[1],i[1]),ymax:Math.max(a[1],i[1]),zmin:Math.min(a[2],i[2]),zmax:Math.max(a[2],i[2])}}function KW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Rr([t,0,0,0,t,0,0,0,t]);return new ua(r,n)}function Xke(e,t,r){var s,u,c,l,f,d,p,h;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((d=e.gltf)==null?void 0:d.nodes)||[],i=((h=(p=e.gltf)==null?void 0:p.images)==null?void 0:h.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let E=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(E.length);return S.set(E),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];Qke(n);let{cartographicOrigin:a,modelMatrix:o}=_Kt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function xKt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function _Kt(e,t,r){let{rtcCenter:n,gltfUpAxis:i}=e,{center:a}=r,o=new Kr(t);switch(n&&o.translate(n),i){case"Z":break;case"Y":let c=new Kr().rotateX(Math.PI/2);o=o.multiplyRight(c);break;case"X":let l=new Kr().rotateY(-Math.PI/2);o=o.multiplyRight(l);break;default:break}let s=new ce(a),u=or.WGS84.cartesianToCartographic(s,new ce);return{modelMatrix:o,cartographicOrigin:u}}function Qke(e){var t;for(let r=0;r<e.length;r++){let n=e[r];n.mesh&&(e[r]={...n,mesh:{...n.mesh,primitives:(t=n.mesh)==null?void 0:t.primitives.map(i=>{var a,o,s;return{...i,indices:{value:(a=i==null?void 0:i.indices)==null?void 0:a.value},attributes:xKt(i.attributes),material:{id:(o=i==null?void 0:i.material)==null?void 0:o.id,uniqueId:(s=i==null?void 0:i.material)==null?void 0:s.uniqueId}}})}}),n.children&&Qke(n.children)}}function Zke(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[ys];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function eBe(e,t,r,n){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[a,o]of Object.entries(i||{}))switch(a){case ys:return EKt(e,o,r,n);case XC:return wKt(e,o);default:return[]}return[]}function wKt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function EKt(e,t,r,n){var o,s,u,c,l,f,d;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let p=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return AKt(p,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let h=`TEXCOORD_${((d=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:d.texCoord)||0}`,b=e[h].value;return SKt(a,b,r)}return n?e[n].value:[]}function AKt(e,t=0,r=0){let n=[];if(r>0){let i=t,a=r;for(let o=0;o<e;o++)n.push(i),a-=1,a===0&&(i++,a=r)}else n=Array(e).fill(t,0,e);return n}function SKt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let d=0;d<t.length;d+=2){let p=t[d],h=t[d+1],b=Math.min(qC(p)*o.width|0,o.width-1),x=(Math.min(qC(h)*o.height|0,o.height-1)*o.width+b)*o.components+u,E=new Uint8Array(o.data)[x];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function tBe(e,t){let r={};for(let n in t){let i=t[n];r[n]=TKt(i,e)}return r}function TKt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function rBe(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}function CKt(e){return typeof e=="string"||typeof e=="bigint"?Ln.STRING_TYPE:typeof e=="number"?Number.isInteger(e)?Ln.SHORT_INT_TYPE:Ln.DOUBLE_TYPE:Ln.STRING_TYPE}function nBe(e){let t={};for(let r in e){let n=e[r][0],i=CKt(n);t[r]=i}return t}var iBe=(e,t)=>{var a,o,s,u,c,l,f,d;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[ys])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let p in n.properties){let h=n.properties[p],b=DKt(h);r[p]=b}return r}let i=(d=(f=(l=(c=e.extensions)==null?void 0:c[jl])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:d[t];if(i){for(let p in i.properties){let h=i.properties[p],b=FKt(h);r[p]=b}return r}return null},DKt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t},FKt=e=>{let t;if(e.array)t=Ln.STRING_TYPE;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t};var sk=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var kKt=1,BKt=1,Cu=3,_w=2,OKt=4,IKt="string",PKt="Int32",RKt="Float64",jKt="Oid32",aBe=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],wp=new ce;async function $W(e,t,r,n,i,a,o,s,u,c,l,f,d){var S;let p=u,h=await XKt((S=e.gltf)==null?void 0:S.materials,c),b=Xke(e,t,r),g=Zke(e,d),x=await qKt(b,h,p,g);u&&LKt(x,l);let E=[];for(let F of h){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:k,texture:N}=F,C=await n();E.push(await MKt({convertedAttributes:j,material:k,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return E.length?E:null}function LKt(e,t){for(let r of e.values()){let n=Yke(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Cu){let o=r.positions.subarray(a,a+Cu);or.WGS84.cartesianToCartographic(Array.from(o),wp),wp[2]=wp[2]-t.getHeight(wp[1],wp[0]),wp=wp.subtract(i),r.positions.set(wp,a)}}}async function MKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var I;let l=e.boundingVolumes,f=e.positions.length/Cu,{faceRange:d,featureIds:p,positions:h,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=Kke(e),F={};o&&(F=u$t(p,e.featureIndices,a,o));let D=new Uint32Array(2),j=v$t(p);D.set([f,S],0);let k=new Uint8Array(Di(D.buffer,h.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,d.buffer)),N=u?b$t(f,e,{positions:h,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:p,faceRange:d},c):null,C=[];return s&&o&&(C=d$t(p,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:n$t(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function qKt(e,t,r,n){let{nodes:i,images:a,cartographicOrigin:o,cartesianModelMatrix:s}=e,u=new Map;for(let c of t){let l={positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),uvRegions:new Uint16Array(0),featureIndicesGroups:[],featureIndices:[],boundingVolumes:null,mergedMaterials:c.mergedMaterials};for(let f of c.mergedMaterials)u.set(f.originalMaterialId,l)}lBe(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,d)=>f.concat(d)),delete l.featureIndicesGroups)}}return u}function lBe(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){if(e)for(let u of e)UKt(u,t,r,n,i,a,o,s)}function NKt(e,t){let r=t,{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),o&&(r=r.translate(o)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),r}function UKt(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){let u=NKt(e,o),c=e.mesh;c&&GKt(c,t,r,n,i,a,u,s),lBe(e.children||[],t,r,n,i,a,u,s)}function GKt(e,t,r,n,i,a=!1,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){var u;for(let c of e.primitives){let l=null,f;c.material?(l=i.get(c.material.id),f=(u=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:h})=>{var b;return h===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Qt(l!==null,"Primitive - material mapping failed"),Qt(c.mode===void 0||c.mode===Ht.TRIANGLES||c.mode===Ht.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let d=c.attributes;if(!l)continue;let p=zKt(c);l.positions=Fo(l.positions,oBe({vertices:d.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:HKt,useCartesianPositions:a})),l.normals=Fo(l.normals,oBe({vertices:d.NORMAL&&d.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:WKt,useCartesianPositions:!1})),l.texCoords=Fo(l.texCoords,VKt(d.TEXCOORD_0&&d.TEXCOORD_0.value,p)),l.colors=Fo(l.colors,KKt(d.COLOR_0,p)),f&&(l.uvRegions=Fo(l.uvRegions,$Kt(f,p))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(YKt(JKt(d,c,t,s),p))}}function zKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return sk(n.length/Cu)}if(t&&e.mode===Ht.TRIANGLE_STRIP){let n=t.constructor,i=new n((t.length-2)*3),a=0,o=t.slice(0,3);i.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2===0?i.set(o,a):i.set(o.reverse(),a);t=i}return t}function oBe(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Cu);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Cu,s=t.subarray(o,o+Cu),u=new ce(Array.from(s));u=n(u,e),i[a*Cu]=u.x,i[a*Cu+1]=u.y,i[a*Cu+2]=u.z}return i}function HKt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a||(or.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n)),e}function WKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function VKt(e,t){let r=new Float32Array(t.length*_w);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*_w,a=e.subarray(i,i+_w);r[n*_w]=a[0],r[n*_w+1]=a[1]}return r}function KKt(e,t){let r=(e==null?void 0:e.components)||OKt,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;let i=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=i.subarray(o,o+r),u=new Uint8Array(r);for(let c=0;c<s.length;c++)u[c]=s[c]*255;n.set(u,a*r)}return n}function $Kt(e,t){let r=new Uint16Array(t.length*4);for(let n=0;n<r.length;n+=4)r.set(e,n);return r}function YKt(e,t){if(!e.length||!t.length)return[];let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(e[i])}return r}function JKt(e,t,r,n){let i=eBe(e,t,r,n);if(i.length)return i;for(let a=0;a<aBe.length;a++){let o=aBe[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function XKt(e=[],t){let r=[];for(let n of e)r.push(e$t(n));return t&&(r=await QKt(r)),r}async function QKt(e){var r,n;let t=[];for(;e.length>0;){let i=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(i.texture&&s.texture||!i.texture&&!s.texture)&&(i=await ZKt(i,s),a.push(o))}if(i.texture&&a.length){let o=(r=i.mergedMaterials)==null?void 0:r.reduce((c,{textureSize:l})=>c+((l==null?void 0:l.width)||0),0),s=(n=i.mergedMaterials)==null?void 0:n.reduce((c,{textureSize:l})=>Math.max(c,(l==null?void 0:l.height)||0),0),u=-1;for(let c of i.mergedMaterials)if(c.textureSize){let l=u+1+c.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;c.uvRegion=new Uint16Array([u+1,0,l,c.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=l}i.texture.image.width=o,i.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(i)}return t.length||t.push({material:r$t(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function ZKt(e,t){var r,n;if((r=e.texture)!=null&&r.bufferView&&((n=t.texture)!=null&&n.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let i=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([i,a],{direction:"horizontal"});e.texture.bufferView.data=await s.toFormat(e.texture.mimeType==="image/png"?"png":"jpeg").toBuffer()}catch(o){throw console.log("Join images into a texture atlas has failed. Consider usage `--split-nodes` option. (See documentation https://loaders.gl/modules/tile-converter/docs/cli-reference/tile-converter)"),o}e.material.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId=1}return e.mergedMaterials=e.mergedMaterials.concat(t.mergedMaterials),e}function e$t(e){var i,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(i=e.emissiveFactor)==null?void 0:i.map(c=>Math.round(c*255)),alphaMode:t$t(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||kKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||BKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Rc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function t$t(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function r$t(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function n$t(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=i$t(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function i$t(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=o$t(r.texture,t));let{baseColorFactor:i,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=i;return(!i||i[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:a$t(o||[1,1,1,1],a),textureDefinitionInfo:n}}function a$t(e,t=1){let r=.00015686274509803922,n=new ms(0,0,0,1),i=new ms(1,1,1,1),a=new ms(r,r,r,0),o=new ms(e),s=i.subtract(a).multiply(o),u=s.lerp(s,n,t);a[3]=1;let c=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:c.toArray(),renderMode:"solid"}}}function o$t(e,t){var r,n,i,a;return{encoding:(r=e==null?void 0:e.source)!=null&&r.mimeType?[e.source.mimeType]:void 0,images:[{id:s$t(e,t),size:(n=e.source)==null?void 0:n.image.width,length:(i=e.source)!=null&&i.image.data.length?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function s$t(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,d=n-1<<0,p=c+l+f+d;return BigInt(`0b${p.toString(2)}${u}`).toString()}function u$t(e,t,r,n){let i=c$t(e,n,r);return sBe(t,i),sBe(e,i),i}function c$t(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=f$t(i,t,r);n[a.toString()]=o}return n}function l$t(e,t){let r="";for(let n in e)r+=e[n][t];return r}function f$t(e,t,r){let n=l$t(t,e),i=(0,cBe.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function sBe(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function d$t(e,t,r,n){let i=[],o=rBe(e,r)?tBe(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=h$t(u,n);if(c){let l=s[u],f=p$t(c,l);i.push(f)}}return i}function p$t(e,t){let r;switch(e){case jKt:case PKt:r=m$t(t);break;case RKt:r=g$t(t);break;case IKt:r=uBe(t);break;default:r=uBe(t)}return r}function h$t(e,t){let r=t.find(n=>n.name===e);return r?r.attributeValues?r.attributeValues.valueType:(console.error(`attributeValues is null, attribute=${r}`),""):(console.error(`attribute is null, key=${e}, attributeStorageInfo=${JSON.stringify(t,null,2)}`),"")}function m$t(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return Di(t.buffer,r.buffer)}function g$t(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return Di(t.buffer,r.buffer,n.buffer)}function uBe(e){let t=new Uint32Array([e.length]),r=0,n=new Uint32Array(e.length),i=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),c=u.length;r+=c,n[o]=c,i.push(u)}let a=new Uint32Array([r]);return Di(t.buffer,a.buffer,n.buffer,...i)}function v$t(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function b$t(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let d=new Uint32Array(t.featureIndices.length?t.featureIndices:e),p=y$t(d,l),h={positions:i,normals:a,colors:s,"feature-index":p};o.length&&(h.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(h["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),gv({attributes:h,indices:f},rq,{...rq.options,reuseWorkers:!0,_nodeWorkers:!0,modules:n,useLocalLibraries:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:b},["draco-writer"]:{workerUrl:"./modules/draco/dist/draco-writer-worker-node.js"}})}function y$t(e,t){let r=new Uint32Array(e.length),n=0,i=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Cu;r.fill(n,i,o),n++,i=o+1}return r}function fBe(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=w$t(e);switch(i){case jl:return r=x$t(a,t),r;case ys:return r=_$t(a,t),r;default:return null}}function x$t(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return uk(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return uk(r)}return null}function _$t(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return uk(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return uk(n)}return null}function uk(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function w$t(e){var a,o,s,u;let t=[ys,jl];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let n="";for(let c of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(c)){n=c;break}if(!n)return{extensionName:null,extension:null};let i=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[n];return{extensionName:n,extension:i}}var pBe=Wt(Su(),1),hBe=require("path");var dBe=()=>({serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}});async function mBe(e,t,r){let n={serviceItemId:Rc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,pBe.default)(n,dBe()),a=(0,hBe.join)(r,"SceneServer");await Bi(a,JSON.stringify(i))}var YW=16;function gBe(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*YW/i},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return n.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function JW(e){var n,i;let t=(n=e.lodSelection)==null?void 0:n.find(a=>a.metricType==="maxScreenThreshold"),r=t==null?void 0:t.maxError;if(!r){let a=(i=e.lodSelection)==null?void 0:i.find(o=>o.metricType==="maxScreenThresholdSQ");a&&(r=Math.sqrt(a.maxError/(Math.PI*.25)))}return r||(r=YW),e.mbs[3]*2*YW/r}var E$t=240,A$t=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],S$t=372,T$t=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],C$t=372,D$t=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],F$t=12,XW=(3+1)*(3+2)/2,k$t=2,iy=class{constructor(t){zt(this,"_v00",0),zt(this,"_v01",0),zt(this,"_v10",0),zt(this,"_v11",0),zt(this,"_t",[]),zt(this,"_ix",void 0),zt(this,"_iy",void 0),zt(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,r){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(r))return NaN;let n=B$t(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,d=new Array(XW);if(o===this._ix&&s===this._iy)this.options.cubic?d=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let h=[this._rawval(o,s-1),this._rawval(o+1,s-1),this._rawval(o-1,s),this._rawval(o,s),this._rawval(o+1,s),this._rawval(o+2,s),this._rawval(o-1,s+1),this._rawval(o,s+1),this._rawval(o+1,s+1),this._rawval(o+2,s+1),this._rawval(o,s+2),this._rawval(o+1,s+2)],b=T$t;s!==0&&(b=s===this.options._height-2?D$t:A$t);let g=S$t;s!==0&&(g=s===this.options._height-2?C$t:E$t);for(let x=0;x<XW;++x){d[x]=0;for(let E=0;E<F$t;++E)d[x]+=h[E]*b[XW*E+x];d[x]/=g}}if(!this.options.cubic){let h=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*h+a*b,x=this.options._offset+this.options._scale*g;return this._ix=o,this._iy=s,this._v00=u,this._v01=c,this._v10=l,this._v11=f,x}let p=d[0]+i*(d[1]+i*(d[3]+i*d[6]))+a*(d[2]+i*(d[4]+i*d[7])+a*(d[5]+i*d[8]+a*d[9]));return p=this.options._offset+this.options._scale*p,this._ix=o,this._iy=s,this._t=d,p}_rawval(t,r){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(r<0||r>=this.options._height)&&(r=r<0?-r:2*(this.options._height-1)-r,t+=(t<this.options._width/2?1:-1)*this.options._width/2);let n=this.options._datastart+k$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function B$t(e,t){t=Math.abs(t);let r=vBe(e,t);return 2*Math.abs(r)===t?r-=vBe(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function vBe(e,t){return e-Math.floor(e/t)*t}var O$t=10,I$t=65535;function QW(e,t){let r=P$t(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,d=null,p=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let E=x.split(" "),S=E[0],F=E[1];if(S!=="#"||!F)continue;let D=E.length>2?E.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!E[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(E[2],10)}else if(F==="Scale"){if(!E[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(E[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(E[2]))&&(o=parseFloat(E[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(E[2]))&&(s=parseFloat(E[2]))}else{let E=x.split(" ");if(E=E.filter(S=>S!==""),l=parseInt(E[0],10),f=parseInt(E[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let h=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(h!==I$t)throw new Error("Geoid model file: Incorrect value of maxval");if(d=n.value.offset,p=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(a===0)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(f<2||l<2)throw new Error("Geoid model file: Raster size too small");if(l&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");let b=l/360,g=(f-1)/180;return new iy({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:p,_datastart:d,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*P$t(e){let t=0;do{let r=e.indexOf(O$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:bBe(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:bBe(n)}}}while(t<e.length);return{offset:t,line:""}}function bBe(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var R$t="4.1.0-alpha.6";var ck={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:R$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>QW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var ay=Wt(Su(),1);var yBe={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}};var j$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),L$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),M$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),q$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),xBe=()=>({version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>(0,ay.default)(e,j$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,ay.default)(e,yBe)},fullExtent:{path:"fullExtent",transform:e=>(0,ay.default)(e,q$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,ay.default)(e,L$t())},nodePages:{path:"nodePages",transform:e=>(0,ay.default)(e,M$t())},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"geometryDefinitions",default:[]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}});var ZW=Wt(Su(),1),N$t=()=>({offset:{default:8},position:{default:{type:"Float32",component:3}},normal:{default:{type:"Float32",component:3}},uv0:{path:"hasTexture",transform:e=>e&&{type:"Float32",component:2}||!1,omitValues:[!1]},color:{default:{type:"UInt8",component:4}},uvRegion:{path:"hasUvRegions",transform:e=>e&&{type:"UInt16",component:4}||!1,omitValues:[!1]},featureId:{default:{binding:"per-feature",type:"UInt64",component:1}},faceRange:{default:{binding:"per-feature",type:"UInt32",component:2}}}),U$t=()=>({"compressedAttributes.encoding":{default:"draco"},"compressedAttributes.attributes":{path:"geometryConfig",transform:e=>{let t=["position","normal"];return e.hasTexture&&t.push("uv0"),t.push("color"),e.hasUvRegions&&t.push("uv-region"),t.push("feature-index"),t}}}),_Be=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,ZW.default)(e,N$t())];return e.draco&&t.push((0,ZW.default)({geometryConfig:e},U$t())),t}}});var ww=Wt(Su(),1),G$t=()=>({renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1]},diffuse:{path:"diffuse",default:[1,1,1]},specular:{path:"specular",default:[0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}}),z$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,ww.default)(r,G$t())}}),H$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),W$t=()=>({encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(n=>(0,ww.default)(n,H$t()))}}),wBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:V$t},textureDefinitions:{path:"textureDefinitionInfos",transform:K$t}});function V$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,ww.default)(a,z$t());return n}function K$t(e,t,r){if(!e)return null;let n={};for(let[i,a]of e.entries()){let o=`${r.nodePath}${i}`;a.imageIndex=o,n[o]=(0,ww.default)(a,W$t())}return n}var $$t=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]);function ABe(e){var r,n;if(!((r=e==null?void 0:e.parentNode)!=null&&r.obb)||!((n=e==null?void 0:e.parentNode)!=null&&n.mbs))return[];let t=[];return Y$t(t,e),J$t(t,e),t}function Y$t(e,t){var o;let r=X$t(t.parentNode.obb),n=Q$t(t);if(Z$t(r,n))return;let a=`OBB of Tile (${t.id}) doesn't fit into Parent (${(o=t.parentNode)==null?void 0:o.id}) tile OBB`;e.push(a)}function J$t(e,t){var a;let r=EBe(t.mbs),n=EBe(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){let o=`MBS of Tile (${t.id}) doesn't fit into Parent (${(a=t.parentNode)==null?void 0:a.id}) tile MBS`;e.push(o)}}function EBe(e){return new Xa([e[0],e[1],e[2]],e[3])}function X$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new ua().fromCenterHalfSizeQuaternion(t,r,n)}function Q$t(e){let t=e.obb.halfSize,r=$$t,n=or.WGS84.cartographicToCartesian(e.obb.center),i=[];for(let a=0;a<r.length;a+=3){let s=new ce(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(n);i=i.concat(s)}return i}function Z$t(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){let i=[t[n],t[n+1],t[n+2]],a=or.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}var lk=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var SBe=Wt(require("process"),1),eYt=4*1024*1024*1024,oy=class extends lk{intervalId;writePromise=null;fileMap={};listeningInterval;writeConcurrency;constructor(t=2e3,r=400){super(),this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:n,writePromise:i}=t,a=await i();n&&a&&(this.fileMap[n]=a)}else super.enqueue(t),SBe.default.memoryUsage().rss>eYt&&await this.startWrite()}startListening(){this.intervalId=setInterval(this.startWrite.bind(this),this.listeningInterval)}stopListening(){this.intervalId&&clearInterval(this.intervalId)}async startWrite(){this.writePromise||(this.writePromise=this.doWrite()),await this.writePromise,this.writePromise=null}async finalize(){this.stopListening(),await this.startWrite()}async doWrite(){for(;this.length;){let t=[],r=[];for(let i=0;i<this.writeConcurrency;i++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let n=await Promise.allSettled(t);this.updateFileMap(r,n)}}updateFileMap(t,r){for(let n=0;n<t.length;n++){let i=t[n];i&&"value"in r[n]&&(this.fileMap[i]=r[n].value)}}};var sy="Tile converter does not work in browser, only in node js environment";var tV=require("path"),rV=Wt(Su(),1);var TBe=Wt(Su(),1),CBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),tYt=()=>({href:{path:"href"}}),rYt=()=>({id:{path:"id"},...tYt(),...CBe()}),eV=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...CBe(),lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>(0,TBe.default)(e,rYt()),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});var Du=class{id;inPageId;data=null;children=[];converter;_finalized=!1;get finalized(){return this._finalized}constructor(t,r){this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}async addData(t){return this.converter.options.instantNodeWriting?await this.write(t):this.data=t,this}async addChildren(t){let r=[];for(let i of t){let a=await i.load();r.push({id:i.id,href:`../${i.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let n=this.data;this.converter.options.instantNodeWriting&&(n=await this.load()),n&&(n.children=n.children??[],n.children=n.children.concat(r)),this.converter.options.instantNodeWriting&&n&&await this.write(n)}async addNeighbors(){var r;if(this.finalized)return;let t=await this.load();for(let n of this.children){let i=await n.load();if(i.neighbors=i.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])n.id!==a.id&&i.neighbors.push({...a});else console.warn(`Node ${n.id}: neighbors attribute is omited because of large number of neigbors`),delete i.neighbors;this.converter.options.instantNodeWriting&&i&&await n.write(i),await n.save()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,tV.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Gc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Bi(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,tV.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await ik(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Du.createRootNodeIndexDocument(t);return await new Du(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Du.createNodeIndexDocument(t,r,n,i,a);return await new Du(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Rc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,rV.default)(r,eV())}static async createNodeIndexDocument(t,r,n,i,a){var d,p;let{texture:o,attributes:s}=a,u=i.index,c=await t.load(),l={version:c.version,id:u.toString(),level:c.level+1,...r,lodSelection:n,parentNode:{id:t.id,href:`../${t.id}`,mbs:c.mbs,obb:c.obb},children:[],neighbors:[]},f=(0,rV.default)(l,eV());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((p=(d=t.converter.layers0)==null?void 0:d.attributeStorageInfo)!=null&&p.length))){f.attributeData=[];let h=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<h;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var nV=async(e,t,r)=>{let n=Ew(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await fk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},iV=async(e,t,r)=>{let n=Ew(t);if(!e||!t.contentUrl||n)return null;let i={...r,[e.loader.id]:{...r[e.loader.id]||{},isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}};return await fk(t.contentUrl,e.loader,i)};async function fk(e,t,r){let n=e.split(".3tz"),i;if(n.length===1)i=null;else if(n.length===2)i=n[1].slice(1),i===""&&(i="tileset.json");else throw new Error("Unexpected URL format");if(i){let a=`${n[0]}.3tz`,o=new v2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function Ew(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var dk=async(e,t,r,n,i,a=0)=>{if(i&&a>i)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await dk(u,s,r,n,i,a+1);n&&await n(o,t)};var nYt=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],DBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Io(e.gltfArrayBuffer,Ll,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=iYt(n),a=aYt(n);return{meshTopologyTypes:i,metadataClasses:a}},iYt=e=>{let t=new Set;for(let r of e.meshes||[])for(let n of r.primitives){let{mode:i}=n;typeof i!="number"&&(i=4),t.add(nYt[i])}return t},aYt=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[ys])==null?void 0:a.schema)==null?void 0:o.classes;if(r)for(let l of Object.keys(r))t.add(l);let n=(c=(u=(s=e.extensions)==null?void 0:s[jl])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},FBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var kBe=Wt(require("process"),1);var oYt=.2,pk=class{_stepsTotal=0;_stepsDone=0;startTime=0;stopTime=0;timeOfUpdatingStepsDone=0;milliSecForOneStep=0;trust=!1;numberOfDigitsInPercentage=0;threshold;getTime;constructor(t={}){this.getTime=t.getTime||kBe.default.hrtime.bigint,this.threshold=t.threshold||oYt}get stepsTotal(){return this._stepsTotal}set stepsTotal(t){this._stepsTotal=t,this.numberOfDigitsInPercentage=this.stepsTotal>100?Math.ceil(Math.log10(this.stepsTotal))-2:0}get stepsDone(){return this._stepsDone}set stepsDone(t){if(this._stepsDone=t,this.timeOfUpdatingStepsDone=this.getCurrentTimeInMilliSeconds(),this._stepsDone){let n=(this.timeOfUpdatingStepsDone-this.startTime)/this._stepsDone;this.trust=this.isVelocityTrust(n,this.milliSecForOneStep),this.milliSecForOneStep=n}}startMonitoring(){this.startTime=this.getCurrentTimeInMilliSeconds(),this.milliSecForOneStep=0,this.trust=!1,this.timeOfUpdatingStepsDone=0,this.stopTime=0,this.stepsDone=0}stopMonitoring(){this.stopTime=this.getCurrentTimeInMilliSeconds()}getPercent(){return this._stepsTotal?this._stepsDone/this._stepsTotal*100:null}getPercentString(){let t=this.getPercent();return t!==null?t.toFixed(this.numberOfDigitsInPercentage):""}getTimeCurrentlyElapsed(){return(this.stopTime?this.stopTime:this.getCurrentTimeInMilliSeconds())-this.startTime}getTimeRemaining(){return!this._stepsDone||!this.startTime?null:{timeRemaining:(this._stepsTotal-this._stepsDone)*this.milliSecForOneStep,trust:this.trust}}getTimeRemainingString(){let t=this.getTimeRemaining();return t!=null&&t.trust?ry(t.timeRemaining):""}isVelocityTrust(t,r){return r?Math.abs((t-r)/r)<this.threshold:!1}getCurrentTimeInMilliSeconds(){return Number(this.getTime()/BigInt(1e6))}};var OBe,sYt=(OBe=B0.default.env)==null?void 0:OBe.IonToken,BBe=64,uYt="3DTILES",cYt="3DObject",lYt=1800,fYt="https://",Ep="phase1-count",uy=class{attributeMetadataInfo;nodePages;options;layers0Path;materialMap;materialDefinitions;geometryMap;geometryConfigs;vertexCounter;layers0;featuresHashArray;refinementCounter;validate;boundingVolumeWarnings=[];conversionStartTime=[0,0];refreshTokenTime=[0,0];sourceTileset=null;loadOptions={_nodeWorkers:!0,reuseWorkers:!0,useLocalLibraries:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{},modules:{}};geoidHeightModel=null;Loader=Cc;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new oy;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};progresses={};constructor(){this.attributeMetadataInfo=new aC,this.nodePages=new to(Bi,BBe,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(gn)return console.log(sy),sy;this.conversionStartTime=B0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:d,generateBoundingVolumes:p,instantNodeWriting:h=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:E=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:h,mergeMaterials:b,inquirer:g,metadataClass:x},this.progresses[Ep]=new pk,this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(fYt)!==-1?ED:Cc,this.generateTextures=Boolean(d),this.generateBoundingVolumes=Boolean(p),this.writeQueue=new oy,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,ck),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(Gc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await fk(F,this.Loader,this.loadOptions),(this.Loader===Cc||E?await this.preprocessConversion():!0)&&!E&&await this.selectMetadataClass()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(n),outputPath:s,tilesetName:r}))}catch(S){throw S}finally{await this.writeQueue.finalize(),Ma.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await dk(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r,metadataClasses:n}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`Tile count: ${this.progresses[Ep].stepsTotal}`),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),n.size?console.log(`Feature metadata classes have been found: ${Array.from(n).join(", ")}`):console.log("Feature metadata classes have not been found"),console.log("------------------------------------------------"),!r.has("TRIANGLES")&&!r.has("TRIANGLE_STRIP")?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(Ew(t))return await nV(this.sourceTileset,t,this.loadOptions),null;t.id&&(this.progresses[Ep].stepsTotal+=1,console.log(`[analyze]: ${t.id}`));let i=null;try{i=await iV(this.sourceTileset,t,{...this.loadOptions,"3d-tiles":{...this.loadOptions["3d-tiles"],loadGLTF:!1}})}catch{console.log(`[warning]: Failed to load ${t.contentUrl}. An I3S tile with empty content will be added to the output tileset`)}let a=await DBe(i);return FBe(this.preprocessData,a),null}async selectMetadataClass(){var r;let{metadataClasses:t}=this.preprocessData;if(t.size>1)if((r=this.options.metadataClass)!=null&&r.length)console.log(`${this.options.metadataClass} has been selected`);else if(this.options.inquirer){let n=await this.options.inquirer.prompt([{name:"metadataClass",type:"list",message:"Select feature metadata data class to convert...",choices:Array.from(t)}]);this.options.metadataClass=n.metadataClass,console.log(`${n.metadataClass} has been selected`)}else return console.log(`A feature metadata class has not been selected. Start the converter with option "--metadata-class". For example, "npx tile-converter ... --metadata-class ${Array.from(t)[0]}"`),console.log("------------------------------------------------"),!1;return!0}async _createAndSaveTileset(t,r){var u,c,l;let n=(0,za.join)(`${t}`,`${r}`);try{await bw(n)}catch{}this.layers0Path=(0,za.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=LC(i.boundingVolume,new Kr(i.transform),null);this._formLayers0(r,a,(l=(c=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:c.boundingVolume)==null?void 0:l.region);let o=VW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]}),this.progresses[Ep].startMonitoring();let s=await Du.createRootNode(o,this);await dk(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.progresses[Ep].stopMonitoring(),console.log("[finalizing conversion]"),this.layers0.attributeStorageInfo=this.attributeMetadataInfo.attributeStorageInfo,this.layers0.fields=this.attributeMetadataInfo.fields,this.layers0.popupInfo=this.attributeMetadataInfo.popupInfo,this.attributeMetadataInfo.attributeStorageInfo.length&&(this.layers0.layerType=cYt),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,hk.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),_Be()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),mBe(r,this.layers0,n);for(let f of this.compressList||[])await nk(f),await WW(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r,n){var s;if(!((s=this.sourceTileset)!=null&&s.root))return;let i=Jke(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Rc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Rc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:BBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,hk.default)(o,xBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Gc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Bi(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,za.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await Uke(r,n,0,".",this.options.sevenZipExe);let i=await h2(new iu(n));await p2(n,i,"@specialIndexFileHASH128@");try{await bw(t)}catch{}}}async convertTile(t,r){let n=Ew(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await nV(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:a}=r,o=a.clone();t.transform&&(o=o.multiplyRight(t.transform));let s=i[0],u=await this._createNode(s,t,o);await s.addChildren(u);let c={transform:o,parentNodes:u};if(t.id){this.progresses[Ep].stepsDone+=1;let l="Calculating time left...",f=this.progresses[Ep].getTimeRemainingString();f&&(l=`${f} left`);let d=this.progresses[Ep].getPercentString();console.log(`[converted ${d}%, ${l}]: ${t.id}`)}return c}async finalizeTile(t,r){for(let n of t)for(let i of n.parentNodes)await i.addNeighbors();for(let n of r.parentNodes)await n.save()}async _createNode(t,r,n){this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let i=null;try{i=await iV(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=LC(r.boundingVolume,n,null),o=VW(a,this.geoidHeightModel),s=fBe(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],d={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let p of u||[d]){this.layersHasTexture=this.layersHasTexture||Boolean(p.texture),this.generateBoundingVolumes&&p.boundingVolumes&&(o=p.boundingVolumes);let h=gBe(r,o),b=h.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,p),x=await Du.createNodeIndexDocument(t,o,h,g,p),E=await new Du(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(p,E.id),this.validate&&(this.boundingVolumeWarnings=ABe(x),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),l.push(g.index),f.push(g)}return c}async _convertResources(t,r,n,i,a,o){if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await $W(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,this.attributeMetadataInfo.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,d={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(d.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let p=a.nodeId,h;if(p?h=await this.nodePages.getNodeById(p):h=await this.nodePages.push(d,i),d.mesh||console.log(`[warning]: node ${h.index} is created with empty content`),to.updateAll(h,d),o&&to.updateMaterialByNodeId(h,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;to.updateTexelCountHintByNodeId(h,b)}return u&&(this.vertexCounter+=u,to.updateVertexCountByNodeId(h,u)),to.updateNodeAttributeByNodeId(h),c&&to.updateFeatureCountByNodeId(h,c),this.nodePages.saveNode(h),h}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,za.join)(this.layers0Path,"nodes",r),c=(0,za.join)("nodes",r);await this._writeGeometries(n,i,u,c),await this._writeShared(o,u,c,r),await this._writeTexture(a,u,c),await this._writeAttributes(s,u,c)}async _writeGeometries(t,r,n,i){if(this.options.slpk){let a=(0,za.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>Gc(a,t,"0.bin")})}else{let a=(0,za.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Bi(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,za.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>Gc(a,r,"1.bin")})}else{let a=(0,za.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Bi(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,hk.default)(t,wBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,za.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>Gc(s,o,"sharedResource.json")})}else{let s=(0,za.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Bi(s,o)})}}async _writeTexture(t,r,n){if(t){let i=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(i){case"jpg":case"png":{if(a.push({name:"0",format:i}),await this.writeTextureFile(o,"0",i,r,n),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),c=gv({...t.image,data:u},Bq,{...Bq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=gv(t.image.data[0],hq);await this.writeTextureFile(s,"0","jpg",r,n)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,n,i,a){if(this.options.slpk){let o=(0,za.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>Gc(o,t,`${r}.${n}`,s)})}else{let o=(0,za.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Bi(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){if(t!=null&&t.length&&this.attributeMetadataInfo.attributeStorageInfo.length){let i=t.length<this.attributeMetadataInfo.attributeStorageInfo.length?t.length:this.attributeMetadataInfo.attributeStorageInfo.length;for(let a=0;a<i;a++){let o=this.attributeMetadataInfo.attributeStorageInfo[a].key,s=new Uint8Array(t[a]);if(this.options.slpk){let u=(0,za.join)(r,"attributes",o);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${o}.bin.gz`,writePromise:()=>Gc(u,s,"0.bin")})}else{let u=(0,za.join)(r,`attributes/${o}/0`);await this.writeQueue.enqueue({writePromise:()=>Bi(u,s,"index.bin")})}}}}_getFormatByMimeType(t){switch(t){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(t){let r=(0,aV.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let n=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,n),n}findOrCreateGeometryDefinition(t,r){let n={hasTexture:t,hasUvRegions:r},i=(0,aV.default)(JSON.stringify(n));if(this.geometryMap.has(i))return this.geometryMap.get(i)||0;let a=this.geometryConfigs.push(n)-1;return this.geometryMap.set(i,a),a}createAttributeStorageInfo(t,r){let n=null;this.options.metadataClass?!this.attributeMetadataInfo.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=iBe(t.gltf,this.options.metadataClass)):r&&(n=nBe(r)),n&&this.attributeMetadataInfo.addMetadataInfo(n)}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await ok(t),o=B0.default.hrtime(this.conversionStartTime),s=ry(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${uYt}`),console.log(`Total conversion time: ${s}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",a," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',i,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||sYt}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=B0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(B0.default.hrtime(this.refreshTokenTime)[0]<lYt)return;this.refreshTokenTime=B0.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch={...this.loadOptions.fetch,headers:r.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){t.refine===1&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){return["b3dm","glTF","scenegraph"].includes(t.type||"")}};var t5e=require("path"),lV=Wt(require("process"),1),r5e=Wt(Su(),1);function oV(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 IBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function cy(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 PBe="String",RBe="Oid32",jBe="Float64",LBe="Int16";function mk(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function ly(e,t=null){return t?`${e}?token=${t}`:e}function MBe(e,t){let{attributeData:r=[]}=t,n=[];for(let i=0;i<r.length;i++){let a=r[i].href.replace("./","");n.push(`${e}/${a}`)}return n}function qBe(e,t,r){let n=[],{attributeStorageInfo:i=[]}=e;for(let a=0;a<i.length;a++){let o=i[a].key;n.push(`${t}/nodes/${r}/attributes/${o}/0`)}return n}var gk=new ce([0,0,0]);function pYt(e){switch(e){case"ktx-etc2":case"dds":return oD;case"ktx2":return Lh;case"jpg":case"png":default:return kv}}var hYt="i3s-attribute-type";async function zBe(e,t,r,n,i){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Kr,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=ly(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=pYt(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===kv){let d={...t.textureLoaderOptions,image:{type:"data"}};try{let p=await Do(f,[],d,i);a.texture=p}catch{let h=await Io(f,u,d,i);a.texture=h}}else if(u===oD||u===Lh){let d=await An(f,u,t.textureLoaderOptions);u===Lh&&(d=d[0]),a.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else a.texture=f}return a.material=EYt(t.materialDefinition,a.texture),a.material&&(a.texture=null),await mYt(e,a,t,r,n)}async function mYt(e,t,r,n,i){var f,d;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let p=await Io(e,Av,{draco:{attributeNameEntry:hYt}});s=p.header.vertexCount,l=(f=p.indices)==null?void 0:f.value;let{POSITION:h,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=p.attributes;o={position:h,normal:b,color:g,uv0:x,uvRegion:S,id:E},gYt(o,p);let F=CYt(E);F&&TYt(o,F)}else{let{vertexAttributes:p,ordering:h,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=bYt(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=UBe(e,u,p,s,h),{attributes:F}=UBe(e,S,b,c,g);SYt(F),o=vYt(E,F)}if(!((d=i==null?void 0:i.i3s)!=null&&d.coordinateSystem)||i.i3s.coordinateSystem===2){let p=xYt(o.position,r);t.modelMatrix=p.invert(),t.coordinateSystem=2}else t.modelMatrix=wYt(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:NBe(o.color),texCoords:o.uv0,uvRegions:NBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let p in t.attributes)t.attributes[p]||delete t.attributes[p];return t.vertexCount=s,t.byteLength=a,t}function gYt(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function vYt(e,t){return{...e,...t}}function NBe(e){return e&&(e.normalized=!0,e)}function bYt(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=oV(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=cy(o);break;case"featureCount":i=new s(e,4,4)[0],r+=cy(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function UBe(e,t,r,n,i){let a={};for(let o of i)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+n*u*cy(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=yYt(c,n*u,cy(s));else{let f=oV(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:IBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*cy(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function yYt(e,t,r){let n=[],i=new DataView(e),a=0;for(let o=0;o<t;o++){let s=i.getUint32(a,!0),u=i.getUint32(a+4,!0),c=s+2**32*u;n.push(c),a+=r}return new Uint32Array(n)}function xYt(e,t){let r=t.mbs,n=e.value,i=e.metadata,a=new Kr,o=new ce(r[0],r[1],r[2]),s=new ce;return or.WGS84.cartographicToCartesian(o,s),or.WGS84.eastNorthUpToFixedFrame(s,a),e.value=_Yt(n,i,o),a}function _Yt(e,t={},r){let n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let o=0;o<n.length;o+=3)n[o]=e[o]*i+r.x,n[o+1]=e[o+1]*a+r.y,n[o+2]=e[o+2]+r.z;for(let o=0;o<n.length;o+=3)or.WGS84.cartographicToCartesian(n.subarray(o,o+3),gk),n[o]=gk.x,n[o+1]=gk.y,n[o+2]=gk.z;return n}function wYt(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,n=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,i=new Kr;return i[0]=r,i[5]=n,i}function EYt(e,t){let r;return e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=GBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=GBe(r.pbrMetallicRoughness.baseColorFactor)),t&&AYt(r,t),r}function GBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function AYt(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function SYt(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],d=i[c-1],p=f-d+1,h=u+p*3;o.fill(l,u,h),s++,u=h}e.id.value=o}function TYt(e,t){let r=e.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function CYt(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var DYt="4.1.0-alpha.6",HBe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:DYt,mimeTypes:["application/octet-stream"],parse:FYt,extensions:["bin"],options:{"i3s-content":{}}};async function FYt(e,t,r){let{tile:n,_tileOptions:i,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=i||n,u=o||a;return!s||!u?null:await zBe(e,s,u,t,r)}var kYt="4.1.0-alpha.6",WBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:kYt,mimeTypes:["application/json"],parse:BYt,extensions:["json"],options:{i3s:{}}};async function BYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var Aw=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(t,r="",n){var i,a;this.tileset={...t},this.url=r,this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(a=t.nodePages)==null?void 0:a.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var i;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=ly(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,WBe,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=t%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(t){let r=await this.getNodeById(t),n=[],i=[];for(let p of r.children||[])i.push(this.getNodeById(p));let a=await Promise.all(i);for(let p of a)n.push({id:p.index.toString(),obb:p.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:p,isDracoGeometry:h}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=p,f=h;let{textureData:b,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,c=b.format||c,b.name&&(s=`${this.url}/nodes/${r.mesh.material.resource}/textures/${b.name}`),this.tileset.attributeStorageInfo&&(l=qBe(this.tileset,this.url,r.mesh.attribute.resource))}let d=this.getLodSelection(r);return sV({id:t.toString(),lodSelection:d,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Mv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=g_();r.has("etc2")&&t.push("ktx-etc2"),r.has("dxt")&&t.push("dds"),t.push("ktx2")}return t.push("jpg"),t.push("png"),t}};function VBe(e,t){let r=t.url||"",n;e.geometryData&&(n=`${r}/${e.geometryData[0].href}`);let i;e.textureData&&(i=`${r}/${e.textureData[0].href}`);let a;e.attributeData&&(a=MBe(r,e));let o=e.children||[];return sV({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function sV(e){var s,u;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...or.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...or.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let l=new ua().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...l.center,l.radius],r=[...e.obb.center,l.radius]}let n=(s=e.lodSelection)==null?void 0:s[0].metricType,i=(u=e.lodSelection)==null?void 0:u[0].maxError,a="mesh",o=2;return{...e,mbs:r,boundingVolume:t,lodMetricType:n,lodMetricValue:i,type:a,refine:o}}async function KBe(e,t,r){let n=mk(r.url||""),i,a;if(e.nodePages)i=new Aw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=ly(`${n}/nodes/root`,o.token);a=await An(s,nf,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:nf,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var OYt="4.1.0-alpha.6",IYt=/layers\/[0-9]+$/,PYt=/nodes\/([0-9-]+|root)$/,RYt="504b0304",jYt="PointCloud",nf={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:OYt,mimeTypes:["application/octet-stream"],parse:LYt,extensions:["bin"],options:{i3s:{token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,_tileOptions:null,_tilesetOptions:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:2}}};async function LYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},UYt(e)===RYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=mk(n),o;t.i3s.isTileset==="auto"?o=IYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=PYt.test(a):s=t.i3s.isTileHeader,o?e=await qYt(e,t,r):s?e=await NYt(e,r):e=await MYt(e,t),e}async function MYt(e,t){return await Io(e,HBe,t)}async function qYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===jYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await KBe(n,t,r)}async function NYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),VBe(e,t)}function UYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function YBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?GYt(n,e):null}:{}}function GYt(e,t){switch(e){case PBe:return WYt(t);case RBe:return $Be(t);case jBe:return HYt(t);case LBe:return zYt(t);default:return $Be(t)}}function $Be(e){return new Uint32Array(e,4)}function zYt(e){return new Int16Array(e,4)}function HYt(e){return new Float64Array(e,8)}function WYt(e){let i=[];try{let a=new DataView(e,0,4).getUint32(0,!0),o=new Uint32Array(e,8,a),s=8+a*4;for(let u of o){let c=new TextDecoder("utf-8"),l=new Uint8Array(e,s,u);i.push(c.decode(l)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return i}var VYt="4.1.0-alpha.6";var uV={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:VYt,mimeTypes:["application/binary"],parse:async(e,t)=>YBe(e,t),extensions:["bin"],options:{},binary:!0};function cV(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=or.WGS84.cartographicToCartesian(r,new ce),i=new ua().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var vk=Wt(Su(),1),KYt=()=>({version:{path:"version",default:"1.0"}}),JBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,vk.default)(t,JBe()))}}),XBe=()=>({asset:{path:"asset",transform:e=>(0,vk.default)(e,KYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,vk.default)(e,JBe())}});function QBe(e,t){let r=new Float32Array(e.length),n=YYt(t);for(let i=0;i<e.length;i+=2){let a=e.subarray(i,i+2),o=n.slice(i*2,i*2+4),s=$Yt([a[0],a[1]]),u=[o[2]-o[0],o[3]-o[1]],c=[s[0]*u[0],s[1]*u[1]],l=[c[0]+o[0],c[1]+o[1]];r[i]=l[0],r[i+1]=l[1]}return r}function $Yt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function YYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var JYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ZBe=new ce,Sw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return mC({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},dG)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),d=this._convertI3sMaterialToGLTFMaterial(o,f),p=l.addMaterial(d),h=s.positions,b=h.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=QBe(s.texCoords.value,s.uvRegions.value));let g=new ce(a),x=or.WGS84.cartesianToCartographic(g,new ce);s.positions.value=this._normalizePositions(b,g,x,c),this._createBatchIds(n,r),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let E=u||sk(b.length/h.size),S=l.addMesh({attributes:s,indices:E,material:p,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),mC(l.gltf,Jq)}async _addI3sTextureToGLTF(t,r,n){let{texture:i,material:a,attributes:o}=t,s=null,u=i;if(!i&&a&&(u=a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture&&a.pbrMetallicRoughness.baseColorTexture.texture.source.image),u){let c=this._deduceMimeTypeFromFormat(r),l=n.addImage(u,c);s=n.addTexture({imageIndex:l}),delete o.colors}return s}_normalizePositions(t,r,n,i){let a=new Float32Array(t.length);for(let o=0;o<t.length;o+=3){let s=t.subarray(o,o+3),u=new ce(r),c=new ce(Array.from(s)).transform(i).add(n);or.WGS84.cartographicToCartesian(c,ZBe),c=ZBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(JYt)}_createBatchIds(t,r){let{featureIds:n}=t,{OBJECTID:i}=r||{};if(!(!n||!i)){for(let a=0;a<n.length;a++){let o=n[a],s=i.indexOf(o);n[a]=s}t.attributes._BATCHID={size:1,byteOffset:0,value:n}}}_deduceMimeTypeFromFormat(t){switch(t){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${t}`),"image/jpeg"}}_convertI3sMaterialToGLTFMaterial(t,r){let n=r!==null;return t?(r!==null&&(t=this._setGLTFTexture(t,r)),t):(t={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},n?t.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],t)}_setGLTFTexture(t,r){let n={...t,pbrMetallicRoughness:{...t.pbrMetallicRoughness}};return t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?n.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.emissiveTexture?n.emissiveTexture={index:r,texCoord:0}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?n.pbrMetallicRoughness.metallicRoughnessTexture={index:r,texCoord:0}:t.normalTexture?n.normalTexture={index:r,texCoord:0}:t.occlusionTexture&&(n.occlusionTexture={index:r,texCoord:0}),n}_getFeaturesLength(t){if(!t)return 0;let r=Object.keys(t)[0];return r?t[r].length:0}_checkNormals(t){return t.find(r=>r)}};var e5e=async(e,t,r)=>{if(!e||!t.contentUrl)return null;let n={...r,i3s:{...r.i3s,isTileset:!1,isTileHeader:!1,_tileOptions:{attributeUrls:t.attributeUrls,textureUrl:t.textureUrl,textureFormat:t.textureFormat,textureLoaderOptions:t.textureLoaderOptions,materialDefinition:t.materialDefinition,isDracoGeometry:t.isDracoGeometry,mbs:t.mbs},_tilesetOptions:{store:e.store,attributeStorageInfo:e.attributeStorageInfo,fields:e.fields}}};return await An(t.contentUrl,nf,n)};var XYt="I3S",fy=class{options;tilesetPath;vertexCounter;conversionStartTime;geoidHeightModel;sourceTileset;attributeStorageInfo;workerSource={};loaderOptions={_nodeWorkers:!0,reuseWorkers:!0,i3s:{coordinateSystem:3,decodeTextures:!1},"i3s-content":{workerUrl:"./modules/i3s/dist/i3s-content-worker-node.js"}};constructor(){this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null,this.workerSource={}}async convert(t){var f;if(gn)return console.log(sy),sy;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=lV.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,ck),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,nf,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=KW(s.mbs)),this.tilesetPath=(0,t5e.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await bw(this.tilesetPath)}catch{}let u={boundingVolume:{box:cV(s.obb,this.geoidHeightModel)},geometricError:JW(s),children:[]};await this._addChildren(s,u,1);let c=(0,r5e.default)({root:u},XBe());await Bi(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),Ma.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await e5e(this.sourceTileset,a,this.loaderOptions);if(!o){await this._addChildren(a,r,n+1);return}this.vertexCounter+=(o==null?void 0:o.vertexCount)||0;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.obb||(a.obb=KW(a.mbs));let u={box:cV(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:JW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},d=await new Sw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Bi(this.tilesetPath,new Uint8Array(d),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(this.options.maxDepth&&n>this.options.maxDepth)return;let i=[];for(let a of t.children||[])i.push(this.convertChildNode(t,r,n,a));await Promise.all(i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await An(a,nf,o)}return n}_relativeUrlToFullUrl(t="",r){let n=t.split("/"),i=r.split("/");for(let a of i)switch(a){case".":continue;case"..":n=n.slice(0,-1);break;default:n.push(a)}return n.join("/")}async _loadChildAttributes(t,r){let n=[],{attributeUrls:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o],u=r[o],c={attributeName:u.name,attributeType:this._getAttributeType(u)};n.push(An(s,uV,c))}let a=await Promise.all(n);return this._replaceNestedArrays(a),Object.assign({},...a)}_getAttributeType(t){return t.attributeValues?t.attributeValues.valueType:t.objectIds?"Oid32":""}_replaceNestedArrays(t){for(let r=0;r<t.length;r++){let n=t[r];for(let i in n)n[i]=Array.from(n[i])}}async _finishConversion(t){let r=await ok(t),n=lV.default.hrtime(this.conversionStartTime),i=ry(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${XYt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var bk=require("path");var QYt="4.1.0-alpha.6",ZYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",yk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(ZYt,aG,{}),n=process.cwd();t&&(n=(0,bk.join)(n,t)),await Bi(n,new Uint8Array(r["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader" worker'),await this.installFromNpm("i3s","i3s-content-worker-node.js"),console.log('Installing "Draco Loader" worker'),await this.installFromNpm("draco","draco-worker-node.js"),console.log('Installing "Draco Writer" worker'),await this.installFromNpm("draco","draco-writer-worker-node.js"),console.log('Installing "Basis Loader" worker'),await this.installFromNpm("textures","basis-worker-node.js"),console.log('Installing "KTX2 Basis Writer" worker'),await this.installFromNpm("textures","ktx2-basis-writer-worker-node.js"),console.log('Installing "Draco decoder" library'),await this.installFromUrl(Cd[ai.DECODER],"draco",ai.DECODER),await this.installFromUrl(Cd[ai.DECODER_WASM],"draco",ai.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Cd[ai.ENCODER],"draco",ai.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",Sc.TRANSCODER,"libs"),await this.installFromNpm("textures",Sc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",Sc.ENCODER,"libs"),await this.installFromNpm("textures",Sc.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new dl().start({command:process.platform==="win32"?"npm.cmd":"npm",arguments:["install","sharp@0.30.4","join-images@1.1.3"],wait:0,ignoreStderr:!0}),console.log("All dependencies were installed succesfully.")}async installFromNpm(t,r,n=""){let a=await(await Oo(`https://unpkg.com/@loaders.gl/${t}@${QYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,bk.join)(process.cwd(),"modules",t,"dist",n);await Bi(o,a,r)}async installFromUrl(t,r,n){let a=await(await Oo(t)).arrayBuffer();if(!a)return;let o=(0,bk.join)(process.cwd(),"modules",r,"dist","libs");await Bi(o,a,n)}};function Fu(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function n5e(e,t){let r=Fu(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function i5e(e){return e.reduce((t,r)=>{let n=r.indexOf("="),i=r.slice(0,n),a=r.slice(n+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(i,a):t.concat(r)},[])}function a5e(e,t){let r=Fu(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function ku(e,t){let r=Fu(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var u5e=require("fs/promises"),fV={I3S:"I3S",_3DTILES:"3DTILES"};async function eJt(){let[,,...e]=process.argv;e.length===0&&pV();let t=i5e(e),r=rJt(t);if(r.installDependencies){new yk().install("deps");return}if(r.addHash){let i=o5e(r,!0),a=i.tileset;if(i.output==="data"){let s=i.tileset.substring(0,i.tileset.length-5);(await dV.default.prompt([{name:"isNewFileRequired",type:"list",message:"What would you like to do?",choices:[{name:"Add hash file to the current SLPK file",value:!1},{name:`Create a new file ${s}-hash.slpk with hash file inside`,value:!0}]}])).isNewFileRequired&&(a=`${s}-hash.slpk`)}else a=i.output;a!==i.tileset&&await(0,u5e.copyFile)(i.tileset,a);let o=await h2(new iu(a));await p2(a,o,"@specialIndexFileHASH128@");return}let n=o5e(r);await tJt(n)}eJt().catch(e=>{console.log(e),process.exit(1)});function pV(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--instant-node-writing [Keep created 3DNodeIndexDocument files on disk instead of memory. This option reduce memory usage but decelerates conversion speed]"),console.log("--split-nodes [Prevent to merge similar materials that could lead to incorrect visualization (I3S to 3DTiles conversion only)]"),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Generate obb and mbs bounding volumes from geometry]"),console.log("--analyze [Analyze the input tileset content without conversion, default: false]"),console.log('--metadata-class [One of the list of feature metadata classes, detected by converter on "analyze" stage, default: not set]'),console.log("--validate [Enable validation]"),process.exit(0)}async function tJt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case fV.I3S:new fy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case fV._3DTILES:await new uy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,mergeMaterials:e.mergeMaterials,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate,instantNodeWriting:e.instantNodeWriting,metadataClass:e.metadataClass,analyze:e.analyze,inquirer:dV.default});break;default:pV()}}function o5e(e,t){let r={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:i=>t||Boolean(i)||Boolean(e.analyze)},output:{getMessage:()=>console.log("Missed: --output [Output path name]")},sevenZipExe:{getMessage:()=>console.log("Missed: --7zExe [7z archiver executable path]")},egm:{getMessage:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]")},tileset:{getMessage:()=>console.log("Missed: --tileset [tileset.json file]")},inputType:{getMessage:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]"),condition:i=>t||Boolean(i)&&Object.values(fV).includes(i.toUpperCase())}},n=[];for(let i in r){let a=e[i],o=r[i].condition;(o?o(a):a)||n.push(r[i].getMessage)}return n.length&&(n.forEach(i=>i()),process.exit(1)),e}function rJt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,s5e.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1,addHash:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Fu(n,e);break;case"--tileset":t.tileset=n5e(n,e);break;case"--name":t.name=Fu(n,e);break;case"--output":t.output=Fu(n,e);break;case"--instant-node-writing":t.instantNodeWriting=ku(n,e);break;case"--split-nodes":t.mergeMaterials=ku(n,e);break;case"--max-depth":t.maxDepth=a5e(n,e);break;case"--slpk":t.slpk=ku(n,e);break;case"--add-hash":t.addHash=ku(n,e);break;case"--7zExe":t.sevenZipExe=Fu(n,e);break;case"--egm":t.egm=Fu(n,e);break;case"--token":t.token=Fu(n,e);break;case"--no-draco":t.draco=ku(n,e);break;case"--validate":t.validate=ku(n,e);break;case"--install-dependencies":t.installDependencies=ku(n,e);break;case"--generate-textures":t.generateTextures=ku(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=ku(n,e);break;case"--analyze":t.analyze=ku(n,e);break;case"--metadata-class":t.metadataClass=Fu(n,e);break;case"--help":pV();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
|
|
179
|
+
`).forEach(s=>{let u=a.exec(s);u&&i.push(Number(u[1]))});let o=e;for(;i.includes(o);)o++;t(o)})})}var Rae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},dl=class{id;props={...Rae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Rae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await Pae(t.port)),r.push(t.portArg,String(this.port))),await new Promise((n,i)=>{try{this._setTimeout(()=>{t.onSuccess&&t.onSuccess(this),n({})}),console.log(`Spawning ${t.command} ${t.arguments.join(" ")}`);let a=jae.spawn(t.command,r,t.spawn);this.childProcess=a,a.stdout.on("data",o=>{console.log(o.toString())}),a.stderr.on("data",o=>{console.log(`Child process wrote to stderr: "${o}".`),t.ignoreStderr||(this._clearTimeout(),i(new Error(o)))}),a.on("error",o=>{console.log(`Child process errored with ${o}`),this._clearTimeout(),i(o)}),a.on("close",o=>{console.log(`Child process exited with ${o}`),this.childProcess=null,this._clearTimeout(),n({})})}catch(a){i(a)}})}async stop(){this.childProcess&&(this.childProcess.kill(),this.childProcess=null)}async exit(t=0){try{await this.stop(),process.exit(t)}catch(r){console.error(r.message||r),process.exit(1)}}_setTimeout(t){Number(this.props.wait)>0&&(this.successTimer=setTimeout(t,this.props.wait))}_clearTimeout(){this.successTimer&&clearTimeout(this.successTimer)}};function YI(e,t){return!Ma.isSupported()||!ra&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function JI(e,t,r,n,i){let a=e.id,o=Px(e,r),u=Ma.getWorkerFarm(r).getWorkerPool({name:a,url:o});r=JSON.parse(JSON.stringify(r)),n=JSON.parse(JSON.stringify(n||{}));let c=await u.startJob("process-on-worker",eVe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function eVe(e,t,r,n){switch(r){case"done":t.done(n);break;case"error":t.error(new Error(n.error));break;case"process":let{id:i,input:a,options:o}=n;try{let s=await e(a,o);t.postMessage("done",{id:i,result:s})}catch(s){let u=s instanceof Error?s.message:"unknown error";t.postMessage("error",{id:i,error:u})}break;default:console.warn(`parse-with-worker unknown message ${r}`)}}function XI(e,t){return!Ma.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Mae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Lae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Lae(e,0,t):""}function Lae(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function QI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Mae(e)}"`)}}function ic(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),i=new Uint8Array(t);for(let a=0;a<n.length;++a)if(n[a]!==i[a])return!1;return!0}function Di(...e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function Fo(...e){let t=e,r=t&&t.length>1&&t[0].constructor||null;if(!r)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');let n=t.reduce((o,s)=>o+s.length,0),i=new r(n),a=0;for(let o of t)i.set(o,a),a+=o.length;return i}function $p(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function ko(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function ZI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+ko(n.byteLength,4)}function eP(e,t){let r=e.length,i=Math.ceil(r/t)*t-r,a="";for(let o=0;o<i;++o)a+=" ";return e+a}function Im(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function jx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function NA(e,t,r,n){let i=ko(r.byteLength,n),a=i-r.byteLength;if(e){let o=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),s=new Uint8Array(r);o.set(s);for(let u=0;u<a;++u)e.setUint8(t+r.byteLength+u,32)}return t+=i,t}function Pm(e,t,r,n){let a=new TextEncoder().encode(r);return t=NA(e,t,a,n),t}async function Yp(e){let t=[];for await(let r of e)t.push(r);return Di(...t)}function Nf(e){return Nf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nf(e)}function tP(e,t){if(Nf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Nf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rP(e){var t=tP(e,"string");return Nf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=rP(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var tVe="",qae={};function ac(e){for(let t in qae)if(e.startsWith(t)){let r=qae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${tVe}${e}`),e}var rVe="4.1.0-alpha.7",nP={name:"JSON",id:"json",module:"json",version:rVe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Nae,parse:async e=>Nae(new TextDecoder().decode(e)),options:{}};function Nae(e){return JSON.parse(e)}function Uae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Gae(e){return e&&typeof e=="object"&&e.isBuffer}function pl(e){if(Gae(e))return Uae(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 t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function Rm(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var nu={};da(nu,{dirname:()=>aVe,filename:()=>iVe,join:()=>oVe,resolve:()=>sVe});function zae(){var t;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=(t=window.location)==null?void 0:t.pathname;return(e==null?void 0:e.slice(0,e.lastIndexOf("/")+1))||""}function iVe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function aVe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function oVe(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function sVe(...e){let t=[];for(let a=0;a<e.length;a++)t[a]=e[a];let r="",n=!1,i;for(let a=t.length-1;a>=-1&&!n;a--){let o;a>=0?o=t[a]:(i===void 0&&(i=zae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Lx)}return r=uVe(r,!n),n?`/${r}`:r.length>0?r:"."}var Lx=47,iP=46;function uVe(e,t){let r="",n=-1,i=0,a,o=!1;for(let s=0;s<=e.length;++s){if(s<e.length)a=e.charCodeAt(s);else{if(a===Lx)break;a=Lx}if(a===Lx){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==iP||r.charCodeAt(r.length-2)!==iP){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Lx;--c);if(c!==u){r=c===-1?"":r.slice(0,c),n=s,i=0,o=!1;continue}}else if(r.length===2||r.length===1){r="",n=s,i=0,o=!1;continue}}t&&(r.length>0?r+="/..":r="..",o=!0)}else{let u=e.slice(n+1,s);r.length>0?r+=`/${u}`:r=u,o=!1}n=s,i=0}else a===iP&&i!==-1?++i:i=-1}return r}var Mx=new Error("Not implemented"),Jp=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){var i;if((i=globalThis.loaders)!=null&&i.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw gn?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw Mx}async write(t,r,n){throw Mx}async stat(){throw Mx}async truncate(t){throw Mx}async append(t){throw Mx}async close(){}};var aP=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var iu=class{file;constructor(t,r=!1){this.file=new Jp(t,r?"a+":"r")}async truncate(t){await this.file.truncate(t)}async append(t){await this.file.append(t)}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let i=Number(n);return await this.file.read(t,i)}get length(){return this.file.bigsize}};var hl=Wt(require("fs"),1),Xp=class{handle;size;bigsize;url;constructor(t,r,n){t=ac(t),this.handle=hl.default.openSync(t,r,n);let i=hl.default.fstatSync(this.handle,{bigint:!0});this.size=Number(i.size),this.bigsize=i.size,this.url=t}async close(){return new Promise((t,r)=>{hl.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{hl.default.ftruncate(this.handle,t,i=>{i?n(i):(this.bigsize=BigInt(t),this.size=Number(this.bigsize),r())})})}async append(t){return new Promise((r,n)=>{hl.default.appendFile(this.handle,t,i=>{i?n(i):(this.bigsize=this.bigsize+BigInt(t.length),this.size=Number(this.bigsize),r())})})}async stat(){return await new Promise((t,r)=>hl.default.fstat(this.handle,{bigint:!0},(n,i)=>{let a={size:Number(i.size),bigsize:i.size,isDirectory:i.isDirectory()};n?r(n):t(a)}))}async read(t,r){let n=new ArrayBuffer(r),i=BigInt(t),a=0,o=new Uint8Array(n),s;for(;r>0;){let u=await lVe(this.handle,o,0,r,i);if(u===0)break;a+=u,i+=BigInt(u),r-=u,s!==void 0&&(s+=u)}return a<r?n.slice(0,a):n}async write(t,r=0,n=t.byteLength){return new Promise((i,a)=>{let o=Number(r),s=new Uint8Array(t,Number(r),n);hl.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function lVe(e,t,r,n,i){return await new Promise((a,o)=>hl.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var HA=Wt(require("fs/promises"),1);var sP=Wt(require("fs"),1),oP=require("stream");var UA=Wt(require("zlib"),1),fVe=e=>e&&e instanceof ArrayBuffer,dVe=e=>e&&e instanceof Buffer;function GA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(UA.default.createBrotliDecompress());case"gzip":return e.pipe(UA.default.createGunzip());case"deflate":return e.pipe(UA.default.createDeflate());default:return e}}async function Hae(e){let t=[];return await new Promise((r,n)=>{e.on("error",i=>n(i)),e.on("readable",()=>e.read()),e.on("data",i=>{typeof i=="string"&&n(new Error("Read stream not binary")),t.push(hVe(i))}),e.on("end",()=>{let i=pVe(t);r(i)})})}function pVe(e){let t=e.map(a=>a instanceof ArrayBuffer?new Uint8Array(a):a),r=t.reduce((a,o)=>a+o.byteLength,0),n=new Uint8Array(r),i=0;for(let a of t)n.set(a,i),i+=a.byteLength;return n.buffer}function hVe(e){if(fVe(e))return e;if(dVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var mVe=e=>typeof e=="boolean",Wae=e=>typeof e=="function",gVe=e=>e!==null&&typeof e=="object",vVe=e=>gVe(e)&&Wae(e.read)&&Wae(e.pipe)&&mVe(e.readable);async function zA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=ac(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,d)=>{let p=sP.default.createReadStream(n,{encoding:null});p.once("readable",()=>f(p)),p.on("error",h=>d(h))}),o=a;vVe(a)?o=GA(a,i):typeof a=="string"?o=oP.Readable.from([new TextEncoder().encode(a)]):o=oP.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=bVe(n),l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}catch(a){let o=a.message,s=400,u=o,c={},l=new Response(o,{headers:c,status:s,statusText:u});return Object.defineProperty(l,"url",{value:e}),l}}function bVe(e){let t={};if(!t["content-length"]){let r=sP.default.statSync(e);t["content-length"]=r.size}return e.endsWith(".gz")&&(e=e.slice(0,-3),t["content-encoding"]="gzip"),new Headers(t)}var WA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await HA.default.readdir(t,r)}async stat(t){let r=await HA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await HA.default.unlink(t)}async fetch(t,r){return await zA(t,r)}async openReadableFile(t,r="r"){return new Xp(t,r)}async openWritableFile(t,r="w",n){return new Xp(t,r,n)}};var ml=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){var o,s;let n=[];for await(let u of t)n.push(u),yield u;let i=await this.concatenate(n),a=await this.hash(i,r);(s=(o=this.options.crypto)==null?void 0:o.onEnd)==null||s.call(o,{hash:a})}async concatenate(t){return await Yp(t)}};var jm=class{crc;constructor(){this.crc=-1}update(t){let r=xVe(),n=new Uint8Array(t);for(let i=0;i<n.byteLength;i++)this.crc=this.crc>>>8^r[(this.crc^n[i])&255];return this}finalize(){return this.crc=(this.crc^-1)>>>0,this.crc}},yVe=Uint32Array.of(0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117);function xVe(){return yVe}function Vae(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let i=0;i<n.length;i++)typeof n[i]>"u"?t+="=":t+=_Ve(n[i])}return t}function _Ve(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function uP(e,t){switch(t){case"hex":return Kae(e);case"base64":return Yae(Kae(e));default:throw new Error(t)}}function $ae(e,t){switch(t){case"hex":return e;case"base64":return Yae(e);default:throw new Error(t)}}function Yae(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Vae(r)||""}function Kae(e){let t=e.toString(16);return t==="0"?`0${t}`:t}var qx=class extends ml{name="crc32";options;constructor(t={}){super(),this.options={crypto:{},...t},this.hashBatches=this.hashBatches.bind(this)}async hash(t,r){return this.hashSync(t,r)}hashSync(t,r){let n=new jm;n.update(t);let i=n.finalize();return uP(i,r)}async*hashBatches(t,r="base64"){var a,o;let n=new jm;for await(let s of t)n.update(s),yield s;let i=n.finalize();(o=(a=this.options.crypto)==null?void 0:a.onEnd)==null||o.call(a,{hash:uP(i,r)})}};var Xae=typeof atob=="function"?atob:typeof Buffer=="function"?DVe:Zae,wVe=Xae("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD0EYIwlqKAIAJBBBHCMJaigCACQRQSAjCWooAgAkEkEkIwlqKAIAJBNBKCMJaigCACQUQSwjCWooAgAkFUEwIwlqKAIAJBZBNCMJaigCACQXQTgjCWooAgAkGEE8IwlqKAIAJBkLCgAQBRAGEAcQCAsuAEH4yKq7fSMKahAYQdbunsZ+IwtqEBtB2+GBoQIjDGoQGkHunfeNfCMNahAZCy0AQa+f8Kt/Iw5qEBhBqoyfvAQjD2oQG0GTjMHBeiMQahAaQYGqmmojEWoQGQssAEHYsYLMBiMSahAYQa/vk9p4IxNqEBtBsbd9IxRqEBpBvq/zyngjFWoQGQstAEGiosDcBiMWahAYQZPj4WwjF2oQG0GOh+WzeiMYahAaQaGQ0M0EIxlqEBkLCgAQChALEAwQDQsuAEHiyviwfyMLahAcQcDmgoJ8IxBqEB9B0bT5sgIjFWoQHkGqj9vNfiMKahAdCy0AQd2gvLF9Iw9qEBxB06iQEiMUahAfQYHNh8V9IxlqEB5ByPfPvn4jDmoQHQsuAEHmm4ePAiMTahAcQdaP3Jl8IxhqEB9Bh5vUpn8jDWoQHkHtqeiqBCMSahAdCy0AQYXSj896IxdqEBxB+Me+ZyMMahAfQdmFvLsGIxFqEB5Bipmp6XgjFmoQHQsKABAPEBAQERASCysAQcLyaCMPahAgQYHtx7t4IxJqECNBosL17AYjFWoQIkGM8JRvIxhqECELLgBBxNT7pXojC2oQIEGpn/veBCMOahAjQeCW7bV/IxFqECJB8Pj+9XsjFGoQIQstAEHG/e3EAiMXahAgQfrPhNV+IwpqECNBheG8p30jDWoQIkGFuqAkIxBqECELLgBBuaDTzn0jE2oQIEHls+62fiMWahAjQfj5if0BIxlqECJB5ayxpXwjDGoQIQsKABAUEBUQFhAXCy0AQcTEpKF/IwpqECRBl/+rmQQjEWoQJ0Gnx9DceiMYahAmQbnAzmQjD2oQJQstAEHDs+2qBiMWahAkQZKZs/h4Iw1qECdB/ei/fyMUahAmQdG7kax4IwtqECULLQBBz/yh/QYjEmoQJEHgzbNxIxlqECdBlIaFmHojEGoQJkGho6DwBCMXahAlCy4AQYL9zbp/Iw5qECRBteTr6XsjFWoQJ0G7pd/WAiMMahAmQZGnm9x+IxNqECULKAEBf0F/IwFzIwNxIwEjAnFyIwBqIABqIgFBB3QgAUEZdnIjAWokAAsoAQF/QX8jAnMjAHEjAiMDcXIjAWogAGoiAUEWdCABQQp2ciMCaiQBCygBAX9BfyMDcyMBcSMDIwBxciMCaiAAaiIBQRF0IAFBD3ZyIwNqJAILKAEBf0F/IwBzIwJxIwAjAXFyIwNqIABqIgFBDHQgAUEUdnIjAGokAwsoAQF/IwJBfyMDc3EjASMDcXIjAGogAGoiAUEFdCABQRt2ciMBaiQACygBAX8jA0F/IwBzcSMCIwBxciMBaiAAaiIBQRR0IAFBDHZyIwJqJAELKAEBfyMAQX8jAXNxIwMjAXFyIwJqIABqIgFBDnQgAUESdnIjA2okAgsoAQF/IwFBfyMCc3EjACMCcXIjA2ogAGoiAUEJdCABQRd2ciMAaiQDCyIBAX8jASMCcyMDcyMAaiAAaiIBQQR0IAFBHHZyIwFqJAALIgEBfyMCIwNzIwBzIwFqIABqIgFBF3QgAUEJdnIjAmokAQsiAQF/IwMjAHMjAXMjAmogAGoiAUEQdCABQRB2ciMDaiQCCyIBAX8jACMBcyMCcyMDaiAAaiIBQQt0IAFBFXZyIwBqJAMLJQEBf0F/IwNzIwFyIwJzIwBqIABqIgFBBnQgAUEadnIjAWokAAslAQF/QX8jAHMjAnIjA3MjAWogAGoiAUEVdCABQQt2ciMCaiQBCyUBAX9BfyMBcyMDciMAcyMCaiAAaiIBQQ90IAFBEXZyIwNqJAILJQEBf0F/IwJzIwByIwFzIwNqIABqIgFBCnQgAUEWdnIjAGokAwsEACMACwQAIwELBAAjAgsEACMDCwQAIxoLBgAgACQACwYAIAAkAQsGACAAJAILBgAgACQDCwYAIAAkGgsA6gQEbmFtZQGSAzIAA2xvZwEFbG9vcHMCBGxvb3ADBXByaW1lBAVsb29wQQUGbG9vcEExBgZsb29wQTIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),cP=WebAssembly&&Xae!==Zae?CVe(wVe).buffer:!1,oc=FVe(),lP=240*16*16,Qae=Math.floor(lP*16*1.066666667),EVe=268435456-65536,Jae="Parameter must be Buffer, ArrayBuffer or Uint8Array",AVe="Parameter exceeds max size of 255.9 Mbytes";cP||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function fP(e){var t,r,n,i,a,o,s,u,c,l;let f=TVe(),d=SVe(),p={},h=new Date().getTime();return p.then=function(E){return s=E,g(),p},p.catch=function(E){return u=E,p},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?o=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?o=e.constructor===ArrayBuffer?new Uint8Array(e):e:x(new TypeError(Jae)):x(new TypeError(Jae)),o&&(a=o.length,cP&&a>Qae?a>EVe?x(new Error(AVe)):(t=new WebAssembly.Memory({initial:a>32e6?a>64e6?a>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),i={mem:t,log:console.log},n={imports:i},WebAssembly.instantiate(cP,n).then(b)):g(f(o))),p;function b(E){g(d(o,E.instance.exports,r))}function g(E){var S=Boolean(E)?E:c;Boolean(E)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-h),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function SVe(){var e,t,r,n,i,a,o,s,u,c,l,f,d,p=function(h){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,pe,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=h.length*8,ft;for(ft=Ie(h,d),d[at>>>5]|=128<<at%32,d[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,pe=d;Ge<ft;)ft>Ge+Qae?(n(oe),a(V),s(ne),c(se),t(lP),Ge=Ge+lP*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=pe[Ge+0]>>>0,g=pe[Ge+1]>>>0,x=pe[Ge+2]>>>0,E=pe[Ge+3]>>>0,S=pe[Ge+4]>>>0,F=pe[Ge+5]>>>0,D=pe[Ge+6]>>>0,j=pe[Ge+7]>>>0,k=pe[Ge+8]>>>0,N=pe[Ge+9]>>>0,C=pe[Ge+10]>>>0,I=pe[Ge+11]>>>0,P=pe[Ge+12]>>>0,U=pe[Ge+13]>>>0,Y=pe[Ge+14]>>>0,J=pe[Ge+15]>>>0,oe=me(7,25,oe+(V&ne|~V&se)+b-680876936)+V,se=me(12,20,se+(oe&V|~oe&ne)+g-389564586)+oe,ne=me(17,15,ne+(se&oe|~se&V)+x+606105819)+se,V=me(22,10,V+(ne&se|~ne&oe)+E-1044525330)+ne,oe=me(7,25,oe+(V&ne|~V&se)+S-176418897)+V,se=me(12,20,se+(oe&V|~oe&ne)+F+1200080426)+oe,ne=me(17,15,ne+(se&oe|~se&V)+D-1473231341)+se,V=me(22,10,V+(ne&se|~ne&oe)+j-45705983)+ne,oe=me(7,25,oe+(V&ne|~V&se)+k+1770035416)+V,se=me(12,20,se+(oe&V|~oe&ne)+N-1958414417)+oe,ne=me(17,15,ne+(se&oe|~se&V)+C-42063)+se,V=me(22,10,V+(ne&se|~ne&oe)+I-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+P+1804603682)+V,se=me(12,20,se+(oe&V|~oe&ne)+U-40341101)+oe,ne=me(17,15,ne+(se&oe|~se&V)+Y-1502002290)+se,V=me(22,10,V+(ne&se|~ne&oe)+J+1236535329)+ne,oe=me(5,27,oe+(V&se|ne&~se)+g-165796510)+V,se=me(9,23,se+(oe&ne|V&~ne)+D-1069501632)+oe,ne=me(14,18,ne+(se&V|oe&~V)+I+643717713)+se,V=me(20,12,V+(ne&oe|se&~oe)+b-373897302)+ne,oe=me(5,27,oe+(V&se|ne&~se)+F-701558691)+V,se=me(9,23,se+(oe&ne|V&~ne)+C+38016083)+oe,ne=me(14,18,ne+(se&V|oe&~V)+J-660478335)+se,V=me(20,12,V+(ne&oe|se&~oe)+S-405537848)+ne,oe=me(5,27,oe+(V&se|ne&~se)+N+568446438)+V,se=me(9,23,se+(oe&ne|V&~ne)+Y-1019803690)+oe,ne=me(14,18,ne+(se&V|oe&~V)+E-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+k+1163531501)+ne,oe=me(5,27,oe+(V&se|ne&~se)+U-1444681467)+V,se=me(9,23,se+(oe&ne|V&~ne)+x-51403784)+oe,ne=me(14,18,ne+(se&V|oe&~V)+j+1735328473)+se,V=me(20,12,V+(ne&oe|se&~oe)+P-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+k-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+I+1839030562)+se,V=me(23,9,V+(ne^se^oe)+Y-35309556)+ne,oe=me(4,28,oe+(V^ne^se)+g-1530992060)+V,se=me(11,21,se+(oe^V^ne)+S+1272893353)+oe,ne=me(16,16,ne+(se^oe^V)+j-155497632)+se,V=me(23,9,V+(ne^se^oe)+C-1094730640)+ne,oe=me(4,28,oe+(V^ne^se)+U+681279174)+V,se=me(11,21,se+(oe^V^ne)+b-358537222)+oe,ne=me(16,16,ne+(se^oe^V)+E-722521979)+se,V=me(23,9,V+(ne^se^oe)+D+76029189)+ne,oe=me(4,28,oe+(V^ne^se)+N-640364487)+V,se=me(11,21,se+(oe^V^ne)+P-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+J+530742520)+se,V=me(23,9,V+(ne^se^oe)+x-995338651)+ne,oe=me(6,26,oe+(ne^(V|~se))+b-198630844)+V,se=me(10,22,se+(V^(oe|~ne))+j+1126891415)+oe,ne=me(15,17,ne+(oe^(se|~V))+Y-1416354905)+se,V=me(21,11,V+(se^(ne|~oe))+F-57434055)+ne,oe=me(6,26,oe+(ne^(V|~se))+P+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+E-1894986606)+oe,ne=me(15,17,ne+(oe^(se|~V))+C-1051523)+se,V=me(21,11,V+(se^(ne|~oe))+g-2054922799)+ne,oe=me(6,26,oe+(ne^(V|~se))+k+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+J-30611744)+oe,ne=me(15,17,ne+(oe^(se|~V))+D-1560198380)+se,V=me(21,11,V+(se^(ne|~oe))+U+1309151649)+ne,oe=me(6,26,oe+(ne^(V|~se))+S-145523070)+V,se=me(10,22,se+(V^(oe|~ne))+I-1120210379)+oe,ne=me(15,17,ne+(oe^(se|~V))+x+718787259)+se,V=me(21,11,V+(se^(ne|~oe))+N-343485551)+ne,Ge=Ge+16,oe=oe+re>>>0,V=V+ee>>>0,ne=ne+ge>>>0,se=se+ye>>>0);return oc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function Ie(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,de,Xe,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],de=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Xe=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|de<<8|Xe<<16|ct<<24;return _t+1}};return function(h,b,g,x){var E;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,d=g,E=oc.wordsToBytes(p(h)),x&&x.asBytes?E:oc.bytesconvertNumberToHex(E)}}function TVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,d,p,h,b,g,x,E,S,F,D,j,k,N=new Date().getTime(),C=1732584193,I=-271733879,P=-1732584194,U=271733878,Y=t.length*8;k=oc.bytesToWords(t);for(var J=0;J<k.length;J++)k[J]=(k[J]<<8|k[J]>>>24)&16711935|(k[J]<<24|k[J]>>>8)&4278255360;k[Y>>>5]|=128<<Y%32,k[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<k.length;re+=16)S=C,F=I,D=P,j=U,n=k[re+0]>>>0,i=k[re+1]>>>0,a=k[re+2]>>>0,o=k[re+3]>>>0,s=k[re+4]>>>0,u=k[re+5]>>>0,c=k[re+6]>>>0,l=k[re+7]>>>0,f=k[re+8]>>>0,d=k[re+9]>>>0,p=k[re+10]>>>0,h=k[re+11]>>>0,b=k[re+12]>>>0,g=k[re+13]>>>0,x=k[re+14]>>>0,E=k[re+15]>>>0,C=ee(7,25,C+(I&P|~I&U)+n-680876936)+I,U=ee(12,20,U+(C&I|~C&P)+i-389564586)+C,P=ee(17,15,P+(U&C|~U&I)+a+606105819)+U,I=ee(22,10,I+(P&U|~P&C)+o-1044525330)+P,C=ee(7,25,C+(I&P|~I&U)+s-176418897)+I,U=ee(12,20,U+(C&I|~C&P)+u+1200080426)+C,P=ee(17,15,P+(U&C|~U&I)+c-1473231341)+U,I=ee(22,10,I+(P&U|~P&C)+l-45705983)+P,C=ee(7,25,C+(I&P|~I&U)+f+1770035416)+I,U=ee(12,20,U+(C&I|~C&P)+d-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+p-42063)+U,I=ee(22,10,I+(P&U|~P&C)+h-1990404162)+P,C=ee(7,25,C+(I&P|~I&U)+b+1804603682)+I,U=ee(12,20,U+(C&I|~C&P)+g-40341101)+C,P=ee(17,15,P+(U&C|~U&I)+x-1502002290)+U,I=ee(22,10,I+(P&U|~P&C)+E+1236535329)+P,C=ee(5,27,C+(I&U|P&~U)+i-165796510)+I,U=ee(9,23,U+(C&P|I&~P)+c-1069501632)+C,P=ee(14,18,P+(U&I|C&~I)+h+643717713)+U,I=ee(20,12,I+(P&C|U&~C)+n-373897302)+P,C=ee(5,27,C+(I&U|P&~U)+u-701558691)+I,U=ee(9,23,U+(C&P|I&~P)+p+38016083)+C,P=ee(14,18,P+(U&I|C&~I)+E-660478335)+U,I=ee(20,12,I+(P&C|U&~C)+s-405537848)+P,C=ee(5,27,C+(I&U|P&~U)+d+568446438)+I,U=ee(9,23,U+(C&P|I&~P)+x-1019803690)+C,P=ee(14,18,P+(U&I|C&~I)+o-187363961)+U,I=ee(20,12,I+(P&C|U&~C)+f+1163531501)+P,C=ee(5,27,C+(I&U|P&~U)+g-1444681467)+I,U=ee(9,23,U+(C&P|I&~P)+a-51403784)+C,P=ee(14,18,P+(U&I|C&~I)+l+1735328473)+U,I=ee(20,12,I+(P&C|U&~C)+b-1926607734)+P,C=ee(4,28,C+(I^P^U)+u-378558)+I,U=ee(11,21,U+(C^I^P)+f-2022574463)+C,P=ee(16,16,P+(U^C^I)+h+1839030562)+U,I=ee(23,9,I+(P^U^C)+x-35309556)+P,C=ee(4,28,C+(I^P^U)+i-1530992060)+I,U=ee(11,21,U+(C^I^P)+s+1272893353)+C,P=ee(16,16,P+(U^C^I)+l-155497632)+U,I=ee(23,9,I+(P^U^C)+p-1094730640)+P,C=ee(4,28,C+(I^P^U)+g+681279174)+I,U=ee(11,21,U+(C^I^P)+n-358537222)+C,P=ee(16,16,P+(U^C^I)+o-722521979)+U,I=ee(23,9,I+(P^U^C)+c+76029189)+P,C=ee(4,28,C+(I^P^U)+d-640364487)+I,U=ee(11,21,U+(C^I^P)+b-421815835)+C,P=ee(16,16,P+(U^C^I)+E+530742520)+U,I=ee(23,9,I+(P^U^C)+a-995338651)+P,C=ee(6,26,C+(P^(I|~U))+n-198630844)+I,U=ee(10,22,U+(I^(C|~P))+l+1126891415)+C,P=ee(15,17,P+(C^(U|~I))+x-1416354905)+U,I=ee(21,11,I+(U^(P|~C))+u-57434055)+P,C=ee(6,26,C+(P^(I|~U))+b+1700485571)+I,U=ee(10,22,U+(I^(C|~P))+o-1894986606)+C,P=ee(15,17,P+(C^(U|~I))+p-1051523)+U,I=ee(21,11,I+(U^(P|~C))+i-2054922799)+P,C=ee(6,26,C+(P^(I|~U))+f+1873313359)+I,U=ee(10,22,U+(I^(C|~P))+E-30611744)+C,P=ee(15,17,P+(C^(U|~I))+c-1560198380)+U,I=ee(21,11,I+(U^(P|~C))+g+1309151649)+P,C=ee(6,26,C+(P^(I|~U))+s-145523070)+I,U=ee(10,22,U+(I^(C|~P))+h-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+d-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return oc.endian([C,I,P,U]);function ee(ge,ye,pe){return pe<<ge|pe>>>ye}};return function(t,r){var n=oc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:oc.bytesconvertNumberToHex(n);return i}}function CVe(e){var t,r,n,i=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>i++;)n[i]=e.charCodeAt(i);return n}function DVe(e){return Buffer.from(e,"base64").toString("binary")}function Zae(e){return e}function FVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return oc.rotl(t,8)&16711935|oc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=oc.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,i=0;n<t.length;n++,i+=8)r[i>>>5]|=t[n]<<24-i%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var Qp=class extends ml{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>fP(t).then(a).catch(o));return $ae(i,r)}};var Nx=Wt(require("crypto"),1),VA=class extends ml{name="crypto-node";options;_algorithm;_hash;constructor(t){var r,n;if(super(),this.options=t,!((n=(r=this.options)==null?void 0:r.crypto)!=null&&n.algorithm))throw new Error(this.name)}async hash(t,r){var i,a,o,s;let n=(o=(a=(i=this.options)==null?void 0:i.crypto)==null?void 0:a.algorithm)==null?void 0:o.toLowerCase();try{if(!Nx.createHash)throw new Error("crypto.createHash not available");let u=(s=Nx.createHash)==null?void 0:s(n),c=new Uint8Array(t);return u.update(c).digest("base64")}catch(u){throw Error(`${n} hash not available. ${u}`)}}async*hashBatches(t,r="base64"){var a,o,s,u,c,l,f;if(!Nx.createHash)throw new Error("crypto.createHash not available");let n=(u=Nx.createHash)==null?void 0:u((s=(o=(a=this.options)==null?void 0:a.crypto)==null?void 0:o.algorithm)==null?void 0:s.toLowerCase());for await(let d of t){let p=new Uint8Array(d);n.update(p),yield d}let i=n.digest(r);(f=(l=(c=this.options)==null?void 0:c.crypto)==null?void 0:l.onEnd)==null||f.call(l,{hash:i})}};var hoe=require("process");var eoe=Wt(require("stream"),1),dP=class{},kVe=eoe.Readable||dP;function hP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new pP(r,t)}var pP=class extends kVe{_pulling;_bytesMode;_iterator;constructor(t,r){super(r),this._iterator=t,this._pulling=!1,this._bytesMode=!r||!r.objectMode}async _read(t){this._pulling||(this._pulling=!0,this._pulling=await this._pull(t,this._iterator))}async _destroy(t,r){var n,i,a,o;this._iterator&&(t?await((i=(n=this._iterator)==null?void 0:n.throw)==null?void 0:i.call(n,t)):await((o=(a=this._iterator)==null?void 0:a.return)==null?void 0:o.call(a,t)),r==null||r(null))}async _pull(t,r){var a;let n=this._bytesMode,i=null;for(;this.readable&&!(i=await r.next()).done&&(t!==null&&(t-=n&&ArrayBuffer.isView(i.value)?i.value.byteLength:1),!(!this.push(new Uint8Array(i.value))||t<=0)););return(i!=null&&i.done||!this.readable)&&(this.push(null)||!0)&&((a=r==null?void 0:r.return)==null||a.call(r)),!this.readable}};var noe=Wt(roe(),1);delete globalThis.ReadableStream;var $A=class extends noe.ReadableStream{};var YA=class{chunks;isWorking=!1;isCancelled=!1;constructor(t){this.chunks=t}start(t){this.work(t)}async work(t){let{chunks:r}=this;for(this.isWorking=!0;!this.isCancelled&&(t.desiredSize||0)>0;){let n;try{n=r.next()}catch(i){t.error(i);break}n&&(!n.done&&!this.isCancelled?t.enqueue(n.value):t.close())}this.isWorking=!1}pull(t){this.isWorking||this.work(t)}cancel(){this.isCancelled=!0}};var JA=class extends $A{_chunks;constructor(t){super(new YA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Zp=class{type;size;parts;constructor(t=[],r={}){this.parts=[],this.size=0;for(let n of t)if(typeof n=="string"){let i=new TextEncoder().encode(n);this.parts.push(i),this.size+=i.byteLength}else if(n instanceof Zp)this.size+=n.size,this.parts.push(...n.parts);else if(n instanceof ArrayBuffer)this.parts.push(new Uint8Array(n)),this.size+=n.byteLength;else if(n instanceof Uint8Array)this.parts.push(n),this.size+=n.byteLength;else if(ArrayBuffer.isView(n)){let{buffer:i,byteOffset:a,byteLength:o}=n;this.parts.push(new Uint8Array(i,a,o)),this.size+=o}else{let i=new TextEncoder().encode(String(n));this.parts.push(i),this.size+=i.byteLength}this.type=BVe(r.type)}slice(t=0,r=this.size,n=""){let{size:i,parts:a}=this,o=t<0?Math.max(i+t,0):Math.min(t,i),s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.max(s-o,0),c=new Zp([],{type:n});if(u===0)return c;let l=0,f=[];for(let d of a){let{byteLength:p}=d;if(o>0&&p<=o)o-=p,s-=p;else{let h=d.subarray(o,Math.min(p,s));if(f.push(h),l+=h.byteLength,o=0,l>=u)break}}return c.parts=f,c.size=l,c}async arrayBuffer(){return this._toArrayBuffer()}async text(){let t=new TextDecoder,r="";for(let n of this.parts)r+=t.decode(n);return r}stream(){return new JA(this.parts)}toString(){return"[object Blob]"}get[Symbol.toStringTag](){return"Blob"}_toArrayBuffer(){let t=new ArrayBuffer(this.size),r=new Uint8Array(t),n=0;for(let i of this.parts)r.set(i,n),n+=i.byteLength;return t}};function BVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function OVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Zp),globalThis.Blob}var IVe=OVe();var XA=class{onload;onabort;onerror;error;onloadstart;onloadend;onprogress;readyState;result;DONE;EMPTY;LOADING;addEventListener;removeEventListener;dispatchEvent;constructor(){this.onload=null}abort(){}async readAsArrayBuffer(t){let r=await t.arrayBuffer();this.onload&&this.onload({target:{result:r}})}async readAsBinaryString(t){throw Error("Not implemented")}async readAsDataURL(t){let r=await t.text(),n=`data://;base64,${Sy(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var QA=class extends globalThis.Blob{name="";webkitRelativePath="";lastModified;constructor(t,r,n={}){super(t,n),this.name=String(r).replace(/\//g,":"),this.lastModified=(n==null?void 0:n.lastModified)||Date.now()}get[Symbol.toStringTag](){return"File"}};function ioe(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=XA),typeof File>"u"&&!globalThis.File&&(globalThis.File=QA),global}var PVe=ioe();var mP=Wt(require("module"),1),aoe=Wt(require("path"),1),eS=Wt(require("fs"),1);async function ooe(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():eS.default.readFileSync(e).buffer}async function soe(e){return e.startsWith("http")?await(await fetch(e)).text():eS.default.readFileSync(e,"utf8")}async function uoe(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return ZA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await eS.default.readFileSync(e,"utf8");return ZA(t)}function ZA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=mP.default._nodeModulePaths(aoe.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new mP.default(t,i);return a.filename=t,a.paths=[].concat((r==null?void 0:r.prependPaths)||[]).concat(n).concat((r==null?void 0:r.appendPaths)||[]),a._compile(e,t),i&&i.children&&i.children.splice(i.children.indexOf(a),1),a.exports}var au=class{map;constructor(t){this.map={},t instanceof au?t.forEach((r,n)=>this.append(n,r)):Array.isArray(t)?t.forEach(r=>this.append(r[0],r[1])):t&&Object.getOwnPropertyNames(t).forEach(r=>this.append(r,t[r]))}append(t,r){t=Ux(t),r=coe(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Ux(t)]}get(t){return t=Ux(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Ux(t))}set(t,r){this.map[Ux(t)]=coe(r)}forEach(t,r=null){for(let n in this.map)this.map.hasOwnProperty(n)&&(r?t.call(r,this.map[n],n,this):t(this.map[n],n,this))}keys(){let t=[];return this.forEach(function(r,n){t.push(n)}),gP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),gP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),gP(t)}*[Symbol.iterator](){yield*this.entries()}};function Ux(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 coe(e){return typeof e!="string"&&(e=String(e)),e}function gP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function vP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var yP=Wt(require("stream"),1),RVe=e=>typeof e=="boolean",loe=e=>typeof e=="function",jVe=e=>e!==null&&typeof e=="object",bP=e=>jVe(e)&&loe(e.read)&&loe(e.pipe)&&RVe(e.readable),gl=class{ok;status;statusText;headers;url;bodyUsed=!1;_body;constructor(t,r){let{headers:n,status:i=200,statusText:a="OK",url:o}=r||{};this.url=o,this.ok=i===200,this.status=i,this.statusText=a,this.headers=new au((r==null?void 0:r.headers)||{}),bP(t)?this._body=GA(t,n):typeof t=="string"?this._body=yP.Readable.from([new TextEncoder().encode(t)]):this._body=yP.Readable.from([t||new ArrayBuffer(0)])}get body(){return vP(!this.bodyUsed),vP(bP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return bP(this._body)?await Hae(this._body):this._body||new ArrayBuffer(0)}async text(){let t=await this.arrayBuffer();return new TextDecoder().decode(t)}async json(){let t=await this.text();return JSON.parse(t)}async blob(){if(typeof Blob>"u")throw new Error("Blob polyfill not installed");return new Blob([await this.arrayBuffer()])}};var doe=Wt(require("http"),1),poe=Wt(require("https"),1);var LVe=e=>e&&e instanceof ArrayBuffer,MVe=e=>e&&e instanceof Buffer;function foe(e){let t=e.indexOf(","),r,n;return e.slice(t-7,t)===";base64"?(r=Buffer.from(e.slice(t+1),"base64"),n=e.slice(5,t-7).trim()):(r=Buffer.from(decodeURIComponent(e.slice(t+1))),n=e.slice(5,t).trim()),n?n.startsWith(";")&&(n=`text/plain${n}`):n="text/plain;charset=US-ASCII",{arrayBuffer:qVe(r),mimeType:n}}function qVe(e){if(LVe(e))return e;if(MVe(e))return new Uint8Array(e).buffer;if(ArrayBuffer.isView(e))return e.buffer;if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error(`toArrayBuffer(${JSON.stringify(e,null,2).slice(10)})`)}var xP=e=>e.startsWith("data:"),NVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Gx(e,t){try{if(globalThis.fetch!==Gx&&(NVe(e)||xP(e)))return await fetch(e,t);if(xP(e)){let{arrayBuffer:c,mimeType:l}=foe(e);return new gl(c,{headers:{"content-type":l},url:e})}let r={},n=e;e.endsWith(".gz")&&(e=e.slice(0,-3),r["content-encoding"]="gzip");let i=await UVe(n,t),a=WVe(e,i,r),{status:o,statusText:s}=HVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=GVe(e,a.get("location"));return await Gx(c,t)}return new gl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new gl(null,{status:400,statusText:String(r),url:e})}}async function UVe(e,t){return await new Promise((r,n)=>{let i=zVe(e,t),a=e.startsWith("https:")?poe.default.request(i,o=>r(o)):doe.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function GVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function zVe(e,t){let r=(t==null?void 0:t.headers)||{},n={};for(let a of Object.keys(r))n[a.toLowerCase()]=r[a];n["accept-encoding"]=n["accept-encoding"]||"gzip,br,deflate";let i=new URL(e);return{hostname:i.hostname,path:i.pathname,method:"GET",...t,...t==null?void 0:t.fetch,headers:n,port:i.port}}function HVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function WVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=VVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new au(n)}function VVe(e){return xP(e)?e.length-5:null}var KVe=parseInt(hoe.versions.node.split(".")[0]);RV&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=hP;globalThis.loaders.NodeFile=Xp;globalThis.loaders.NodeFileSystem=WA;globalThis.loaders.fetchNode=zA;globalThis.loaders.NodeHash=VA;globalThis.TextEncoder||(globalThis.TextEncoder=Ay);globalThis.TextDecoder||(globalThis.TextDecoder=Tp);!("atob"in globalThis)&&Sy&&(globalThis.atob=Sy);!("btoa"in globalThis)&&Pk&&(globalThis.btoa=Pk);globalThis.loaders.encodeImageNode=MY;globalThis.loaders.parseImageNode=MI;globalThis.loaders.imageFormatsNode=LI;globalThis._parseImageNode=MI;globalThis._imageFormatsNode=LI;globalThis.loaders.readFileAsArrayBuffer=ooe;globalThis.loaders.readFileAsText=soe;globalThis.loaders.requireFromFile=uoe;globalThis.loaders.requireFromString=ZA;KVe<18&&(!("Headers"in globalThis)&&au&&(globalThis.Headers=au),!("Response"in globalThis)&&gl&&(globalThis.Response=gl),!("fetch"in globalThis)&&Gx&&(globalThis.fetch=Gx));var s5e=require("path"),dV=Wt(axe(),1);var Ln={OBJECT_ID_TYPE:"OBJECTID",STRING_TYPE:"string",DOUBLE_TYPE:"double",SHORT_INT_TYPE:"Int32"};var aC=class{_attributeStorageInfo;_fields;_popupInfo;constructor(){this._attributeStorageInfo=[],this._fields=[]}get attributeStorageInfo(){return this._attributeStorageInfo}get fields(){return this._fields}get popupInfo(){return this._popupInfo}addMetadataInfo(t){if(!Object.keys(t).length)return;let r={OBJECTID:Ln.OBJECT_ID_TYPE,...t},n=!1,i=this._attributeStorageInfo.length;for(let a in r)if(!this._attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=this.createStorageAttribute(i,a,s),c=this.getFieldAttributeType(s),l=this.createFieldAttribute(a,c);this._attributeStorageInfo.push(u),this._fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this._attributeStorageInfo)a.push(o.name);this._popupInfo=this.createPopupInfo(a)}}createStorageAttribute(t,r,n){let i={key:`f_${t}`,name:r,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(n){case Ln.OBJECT_ID_TYPE:this.setupIdAttribute(i);break;case Ln.STRING_TYPE:this.setupStringAttribute(i);break;case Ln.DOUBLE_TYPE:this.setupDoubleAttribute(i);break;case Ln.SHORT_INT_TYPE:break;default:this.setupStringAttribute(i)}return i}getFieldAttributeType(t){switch(t){case Ln.OBJECT_ID_TYPE:return"esriFieldTypeOID";case Ln.STRING_TYPE:return"esriFieldTypeString";case Ln.SHORT_INT_TYPE:return"esriFieldTypeInteger";case Ln.DOUBLE_TYPE:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}setupIdAttribute(t){t.attributeValues={valueType:"Oid32",valuesPerElement:1}}setupStringAttribute(t){t.ordering.unshift("attributeByteCounts"),t.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),t.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},t.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}setupDoubleAttribute(t){t.attributeValues={valueType:"Float64",valuesPerElement:1}}createFieldAttribute(t,r){return{name:t,type:r,alias:t}}createPopupInfo(t){let r="{OBJECTID}",n=[],i=[],a=[],o=[];for(let s of t)i.push({fieldName:s,visible:!0,isEditable:!1,label:s});return a.push({fieldInfos:i,type:"fields"}),{title:r,mediaInfos:n,popupElements:a,fieldInfos:i,expressionInfos:o}}};var TTt=e=>typeof e=="boolean",Q1=e=>typeof e=="function",Ch=e=>e!==null&&typeof e=="object",t7=e=>Ch(e)&&e.constructor==={}.constructor;var oxe=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",sxe=e=>e&&typeof e[Symbol.asyncIterator]=="function";var fs=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ds=e=>typeof Blob<"u"&&e instanceof Blob,uxe=e=>e&&typeof e=="object"&&e.isBuffer;var CTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ch(e)&&Q1(e.tee)&&Q1(e.cancel)&&Q1(e.getReader);var DTt=e=>Ch(e)&&Q1(e.read)&&Q1(e.pipe)&&TTt(e.readable),oC=e=>CTt(e)||DTt(e);var FTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,kTt=/^([-\w.]+\/[-\w.+]+)/;function cxe(e){let t=kTt.exec(e);return t?t[1]:e}function r7(e){let t=FTt.exec(e);return t?t[1]:""}var lxe=/\?.*/;function fxe(e){let t=e.match(lxe);return t&&t[0]}function fv(e){return e.replace(lxe,"")}function Dh(e){return fs(e)?e.url:ds(e)?e.name||"":typeof e=="string"?e:""}function Z1(e){if(fs(e)){let t=e,r=t.headers.get("content-type")||"",n=fv(t.url);return cxe(r)||r7(n)}return ds(e)?e.type||"":typeof e=="string"?r7(e):""}function dxe(e){return fs(e)?e.headers["content-length"]||-1:ds(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function sC(e){if(fs(e))return e;let t={},r=dxe(e);r>=0&&(t["content-length"]=String(r));let n=Dh(e),i=Z1(e);i&&(t["content-type"]=i);let a=await OTt(e);a&&(t["x-first-bytes"]=a),typeof e=="string"&&(e=new TextEncoder().encode(e));let o=new Response(e,{headers:t});return Object.defineProperty(o,"url",{value:n}),o}async function pxe(e){if(!e.ok){let t=await BTt(e);throw new Error(t)}}async function BTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r!=null&&r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function OTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${ITt(r)}`}return null}function ITt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function PTt(e){return!RTt(e)&&!jTt(e)}function RTt(e){return e.startsWith("http:")||e.startsWith("https:")}function jTt(e){return e.startsWith("data:")}async function Oo(e,t){var r,n;if(typeof e=="string"){let i=ac(e);return PTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await sC(e)}function n7(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function hu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||n7()}var LTt=globalThis.self||globalThis.window||globalThis.global,dv=globalThis.window||globalThis.self||globalThis.global,MTt=globalThis.document||{},Fh=globalThis.process||{},qTt=globalThis.console,F0r=globalThis.navigator||{};var uC="4.1.0-alpha.7",O0r=hu();function NTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var cC=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";zt(this,"storage",void 0),zt(this,"id",void 0),zt(this,"config",void 0),this.storage=NTt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function hxe(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function mxe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function lC(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var fC;(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"})(fC||(fC={}));var UTt=10;function gxe(e){return typeof e!="string"?e:(e=e.toUpperCase(),fC[e]||fC.WHITE)}function vxe(e,t,r){if(!hu&&typeof e=="string"){if(t){let n=gxe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=gxe(r);e="\x1B[".concat(n+UTt,"m").concat(e,"\x1B[49m")}}return e}function bxe(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function pv(e,t){if(!e)throw new Error(t||"Assertion failed")}function kh(){let e;if(hu()&&dv.performance){var t,r;e=dv===null||dv===void 0||(t=dv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in Fh){var n;let i=Fh===null||Fh===void 0||(n=Fh.hrtime)===null||n===void 0?void 0:n.call(Fh);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var hv={debug:hu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},GTt={enabled:!0,level:0};function ps(){}var yxe={},xxe={once:!0},_c=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",uC),zt(this,"_startTs",kh()),zt(this,"_deltaTs",kh()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new cC("__probe-".concat(this.id,"__"),GTt),this.timeStamp("".concat(this.id," started")),bxe(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((kh()-this._startTs).toPrecision(10))}getDelta(){return Number((kh()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){pv(t,r)}warn(t){return this._getLogFunction(0,t,hv.warn,arguments,xxe)}error(t){return this._getLogFunction(0,t,hv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,hv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,hv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,hv.debug||hv.info,arguments,xxe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ps,n&&[n],{tag:VTt(r)}):ps}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?hu()?WTt({image:i,message:a,scale:o}):HTt({image:i,message:a,scale:o}):ps}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ps)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=_xe({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ps)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=wxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=_xe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,pv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=kh();let o=a.tag||a.message;if(a.once&&o)if(!yxe[o])yxe[o]=kh();else return ps;return r=zTt(this.id,a.message,a),n.bind(console,r,...a.args)}return ps}};zt(_c,"VERSION",uC);function wxe(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return pv(Number.isFinite(t)&&t>=0),t}function _xe(e){let{logLevel:t,message:r}=e;e.logLevel=wxe(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return pv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function zTt(e,t,r){if(typeof t=="string"){let n=r.time?mxe(hxe(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=vxe(t,r.color,r.background)}return t}function HTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ps}function WTt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=lC(a,r,n);console.log(...o)},a.src=t,ps}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...lC(t,r,n)),ps;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...lC(a,r,n)),a.src=t.toDataURL(),ps}return ps}function VTt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var amr=new _c({id:"@probe.gl/log"});var i7=new _c({id:"loaders.gl"}),dC=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},pC=class{console;constructor(){this.console=console}log(...t){return this.console.log.bind(this.console,...t)}info(...t){return this.console.info.bind(this.console,...t)}warn(...t){return this.console.warn.bind(this.console,...t)}error(...t){return this.console.error.bind(this.console,...t)}};var a7={fetch:null,mimeType:void 0,nothrow:!1,log:new pC,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:gn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},Exe={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 o7(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function mv(){let e=o7();return e.globalOptions=e.globalOptions||{...a7},e.globalOptions}function Txe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],KTt(e,r),YTt(t,e,n)}function KTt(e,t){Axe(e,null,a7,Exe,t);for(let r of t){let n=e&&e[r.id]||{},i=r.options&&r.options[r.id]||{},a=r.deprecatedOptions&&r.deprecatedOptions[r.id]||{};Axe(n,r.id,i,a,t)}}function Axe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ch(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)i7.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=$Tt(s,i);i7.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function $Tt(e,t){let r=e.toLowerCase(),n="";for(let i of t)for(let a in i.options){if(e===a)return`Did you mean '${i.id}.${a}'?`;let o=a.toLowerCase();(r.startsWith(o)||o.startsWith(r))&&(n=n||`Did you mean '${i.id}.${a}'?`)}return n}function YTt(e,t,r){let i={...e.options||{}};return JTt(i,r),i.log===null&&(i.log=new dC),Sxe(i,mv()),Sxe(i,t),i}function Sxe(e,t){for(let r in t)if(r in t){let n=t[r];t7(n)&&t7(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function JTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function e_(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function s7(e){Qt(e,"null loader"),Qt(e_(e),"invalid loader");let t;return Array.isArray(e)&&(t=e[1],e=e[0],e={...e,options:{...e.options,...t}}),(e!=null&&e.parseTextSync||e!=null&&e.parseText)&&(e.text=!0),e.text||(e.binary=!0),e}var XTt=()=>{let e=o7();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function Cxe(){return XTt()}var Dxe=new _c({id:"loaders.gl"});var QTt=/\.([^.]+)$/;async function Bxe(e,t=[],r,n){if(!Oxe(e))return null;let i=Fxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(ds(e)&&(e=await e.slice(0,10).arrayBuffer(),i=Fxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(Ixe(e));return i}function Fxe(e,t=[],r,n){if(!Oxe(e))return null;if(t&&!Array.isArray(t))return s7(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...Cxe()),e6t(i);let a=ZTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(Ixe(e));return a}function ZTt(e,t,r,n){let i=Dh(e),a=Z1(e),o=fv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=u7(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||t6t(t,o),u=u||(s?`matched url ${o}`:""),s=s||u7(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||n6t(t,e),u=u||(s?`matched initial data ${Pxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||u7(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&Dxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function Oxe(e){return!(e instanceof Response&&e.status===204)}function Ixe(e){let t=Dh(e),r=Z1(e),n="No valid loader found (";n+=t?`${nu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?Pxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function e6t(e){for(let t of e)s7(t)}function t6t(e,t){let r=t&&QTt.exec(t),n=r&&r[1];return n?r6t(e,n):null}function r6t(e,t){t=t.toLowerCase();for(let r of e)for(let n of r.extensions)if(n.toLowerCase()===t)return r;return null}function u7(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function n6t(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(i6t(t,r))return r}else if(ArrayBuffer.isView(t)){if(kxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&kxe(t,0,r))return r;return null}function i6t(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function kxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>a6t(e,t,r,i))}function a6t(e,t,r,n){if(n instanceof ArrayBuffer)return ic(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=c7(e,t,n.length);return n===i;default:return!1}}function Pxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?c7(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?c7(e,0,t):""}function c7(e,t,r){if(e.byteLength<t+r)return"";let n=new DataView(e),i="";for(let a=0;a<r;a++)i+=String.fromCharCode(n.getUint8(t+a));return i}function*Rxe(e,t){let r=(t==null?void 0:t.chunkSize)||262144,n=0,i=new TextEncoder;for(;n<e.length;){let a=Math.min(e.length-n,r),o=e.slice(n,n+a);n+=a,yield i.encode(o)}}function*jxe(e,t={}){let{chunkSize:r=262144}=t,n=0;for(;n<e.byteLength;){let i=Math.min(e.byteLength-n,r),a=new ArrayBuffer(i),o=new Uint8Array(e,n,i);new Uint8Array(a).set(o),n+=i,yield a}}async function*Lxe(e,t){let r=(t==null?void 0:t.chunkSize)||1048576,n=0;for(;n<e.size;){let i=n+r,a=await e.slice(n,i).arrayBuffer();n=i,yield a}}function l7(e,t){return gn?o6t(e,t):s6t(e,t)}async function*o6t(e,t){let r=e.getReader(),n;try{for(;;){let i=n||r.read();t!=null&&t._streamReadAhead&&(n=r.read());let{done:a,value:o}=await i;if(a)return;yield pl(o)}}catch{r.releaseLock()}}async function*s6t(e,t){for await(let r of e)yield pl(r)}function Mxe(e,t){if(typeof e=="string")return Rxe(e,t);if(e instanceof ArrayBuffer)return jxe(e,t);if(ds(e))return Lxe(e,t);if(oC(e))return l7(e,t);if(fs(e))return l7(e.body,t);throw new Error("makeIterator")}var qxe="Cannot convert supplied data type";function u6t(e,t,r){if(t.text&&typeof e=="string")return e;if(uxe(e)&&(e=e.buffer),e instanceof ArrayBuffer){let n=e;return t.text&&!t.binary?new TextDecoder("utf8").decode(n):n}if(ArrayBuffer.isView(e)){if(t.text&&!t.binary)return new TextDecoder("utf8").decode(e);let n=e.buffer,i=e.byteLength||e.length;return(e.byteOffset!==0||i!==n.byteLength)&&(n=n.slice(e.byteOffset,e.byteOffset+i)),n}throw new Error(qxe)}async function Nxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return u6t(e,t,r);if(ds(e)&&(e=await sC(e)),fs(e)){let i=e;return await pxe(i),t.binary?await i.arrayBuffer():await i.text()}if(oC(e)&&(e=Mxe(e,r)),oxe(e)||sxe(e))return Yp(e);throw new Error(qxe)}function hC(e,t){let r=mv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ch(n.fetch)?i=>Oo(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:Oo}function Uxe(e,t,r){if(r)return r;let n={fetch:hC(t,e),...e};if(n.url){let i=fv(n.url);n.baseUrl=i,n.queryString=fxe(n.url),n.filename=nu.filename(i),n.baseUrl=nu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Gxe(e,t){if(e&&!Array.isArray(e))return e;let r;if(e&&(r=Array.isArray(e)?e:[e]),t&&t.loaders){let n=Array.isArray(t.loaders)?t.loaders:[t.loaders];r=r?[...r,...n]:n}return r&&r.length?r:void 0}async function Io(e,t,r,n){t&&!Array.isArray(t)&&!e_(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Dh(e),o=Gxe(t,n),s=await Bxe(e,o,r);return s?(r=Txe(r,s,o,i),n=Uxe({url:i,_parse:Io,loaders:o},r,n||null),await c6t(s,e,r,n)):null}async function c6t(e,t,r,n){if(WI(e),r=qI(e.options,r),fs(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,d=Object.fromEntries(a.headers.entries());n.response={headers:d,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Nxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(YI(e,r))return await JI(e,t,r,n,Io);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw ga(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function zxe(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 f7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],d=s[c+2];t=l<t?l:t,r=f<r?f:r,n=d<n?d:n,i=l>i?l:i,a=f>a?f:a,o=d>o?d:o}return[[t,r,n],[i,a,o]]}function d7(e,t,r){let n=zxe(t.value),i=r||Hxe(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function Hxe(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}async function An(e,t,r,n){let i,a;!Array.isArray(t)&&!e_(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=hC(a),s=e;return typeof e=="string"&&(s=await o(e)),ds(e)&&(s=await o(e)),Array.isArray(i)?await Io(s,i,a):await Io(s,i,a)}async function gv(e,t,r){return r={...mv(),...r},t.encodeURLtoURL?l6t(t,e,r):XI(t,r)?await HI(t,e,r):await t.encode(e,r)}function mC(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeTextSync)return new TextEncoder().encode(t.encodeTextSync(e,r));throw new Error(`Writer ${t.name} could not synchronously encode data`)}async function Vxe(e,t,r,n){if(e=ac(e),t=ac(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}async function l6t(e,t,r){if(gn)throw new Error(`Writer ${e.name} not supported in browser`);let n=Wxe("input");await new Jp(n,"w").write(t);let a=Wxe("output"),o=await Vxe(n,a,e,r);return(await Oo(o)).arrayBuffer()}function Wxe(e){return`/tmp/${e}`}var f6t=1/Math.PI*180,d6t=1/180*Math.PI,p6t={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...p6t}};var Sn=globalThis.mathgl.config;function p7(e,{precision:t=Sn.precision}={}){return e=h6t(e),"".concat(parseFloat(e.toPrecision(t)))}function hs(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function h7(e){return Kxe(e)}function m7(e){return Bl(e)}function Kxe(e,t){return v7(e,r=>r*d6t,t)}function Bl(e,t){return v7(e,r=>r*f6t,t)}function g7(e,t,r){return v7(e,n=>Math.max(t,Math.min(r,n)))}function Po(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(hs(e)&&hs(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Po(e[i],t[i]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=Sn.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{Sn.EPSILON=n}}function h6t(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function m6t(e){return e.clone?e.clone():new Array(e.length)}function v7(e,t,r){if(hs(e)){let n=e;r=r||m6t(n);for(let i=0;i<r.length&&i<n.length;++i){let a=typeof e=="number"?e:e[i];r[i]=t(a,i,r)}return r}return t(e)}function g6t(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var wd=class extends g6t(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:hs(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Sn)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+p7(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Po(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let i=0;i<this.ELEMENTS;++i){let a=t[i],o=typeof r=="number"?r:r[i];this[i]=a+n*(o-a)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(Sn.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function v6t(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function Ar(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function Ed(e,t,r=""){if(Sn.debug&&!v6t(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function oa(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var Ad=class extends wd{get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let i=this[n]-t[n];r+=i*i}return Ar(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return Ar(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return oa(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return oa(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var Mn=typeof Float32Array<"u"?Float32Array:Array,t_=Math.random;function vv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var Zgr=Math.PI/180;function b6t(){let e=new Mn(2);return Mn!=Float32Array&&(e[0]=0,e[1]=0),e}function $xe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e}function Yxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i+r[4],e[1]=r[1]*n+r[3]*i+r[5],e}function gC(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[3]*i+r[6],e[1]=r[1]*n+r[4]*i+r[7],e}function vC(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[4]*i+r[12],e[1]=r[1]*n+r[5]*i+r[13],e}var evr=function(){let e=b6t();return function(t,r,n,i,a,o){let s,u;for(r||(r=2),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],a(e,e,o),t[s]=e[0],t[s+1]=e[1];return t}}();function bC(e,t,r){let n=t[0],i=t[1],a=r[3]*n+r[7]*i||1;return e[0]=(r[0]*n+r[4]*i)/a,e[1]=(r[1]*n+r[5]*i)/a,e}function yC(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a||1;return e[0]=(r[0]*n+r[4]*i+r[8]*a)/o,e[1]=(r[1]*n+r[5]*i+r[9]*a)/o,e[2]=(r[2]*n+r[6]*i+r[10]*a)/o,e}function Jxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e}function Xxe(e,t,r){let n=t[0],i=t[1];return e[0]=r[0]*n+r[2]*i,e[1]=r[1]*n+r[3]*i,e[2]=t[2],e[3]=t[3],e}function xC(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=r[0]*n+r[3]*i+r[6]*a,e[1]=r[1]*n+r[4]*i+r[7]*a,e[2]=r[2]*n+r[5]*i+r[8]*a,e[3]=t[3],e}var Bh=class extends Ad{constructor(t=0,r=0){super(2),hs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return vC(this,this,t),this.check()}transformAsVector(t){return bC(this,this,t),this.check()}transformByMatrix3(t){return gC(this,this,t),this.check()}transformByMatrix2x3(t){return Yxe(this,this,t),this.check()}transformByMatrix2(t){return $xe(this,this,t),this.check()}};var yv={};da(yv,{add:()=>w6t,angle:()=>w7,bezier:()=>R6t,ceil:()=>E6t,clone:()=>y6t,copy:()=>x6t,create:()=>_C,cross:()=>Oh,dist:()=>H6t,distance:()=>r1e,div:()=>z6t,divide:()=>t1e,dot:()=>r_,equals:()=>N6t,exactEquals:()=>q6t,floor:()=>A6t,forEach:()=>K6t,fromValues:()=>wC,hermite:()=>P6t,inverse:()=>B6t,len:()=>E7,length:()=>Qxe,lerp:()=>O6t,max:()=>T6t,min:()=>S6t,mul:()=>G6t,multiply:()=>e1e,negate:()=>k6t,normalize:()=>b7,random:()=>j6t,rotateX:()=>y7,rotateY:()=>x7,rotateZ:()=>_7,round:()=>C6t,scale:()=>D6t,scaleAndAdd:()=>F6t,set:()=>_6t,slerp:()=>I6t,sqrDist:()=>W6t,sqrLen:()=>V6t,squaredDistance:()=>n1e,squaredLength:()=>i1e,str:()=>M6t,sub:()=>U6t,subtract:()=>Zxe,transformMat3:()=>n_,transformMat4:()=>Ih,transformQuat:()=>i_,zero:()=>L6t});function _C(){let e=new Mn(3);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function y6t(e){let t=new Mn(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Qxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function wC(e,t,r){let n=new Mn(3);return n[0]=e,n[1]=t,n[2]=r,n}function x6t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function _6t(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function w6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Zxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function e1e(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function t1e(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function E6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function A6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function S6t(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function T6t(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function C6t(e,t){return e[0]=vv(t[0]),e[1]=vv(t[1]),e[2]=vv(t[2]),e}function D6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function F6t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function r1e(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return Math.sqrt(r*r+n*n+i*i)}function n1e(e,t){let r=t[0]-e[0],n=t[1]-e[1],i=t[2]-e[2];return r*r+n*n+i*i}function i1e(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function k6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function B6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function b7(e,t){let r=t[0],n=t[1],i=t[2],a=r*r+n*n+i*i;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e}function r_(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Oh(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2];return e[0]=i*u-a*s,e[1]=a*o-n*u,e[2]=n*s-i*o,e}function O6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function I6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(r_(t,r),-1),1)),a=Math.sin(i),o=Math.sin((1-n)*i)/a,s=Math.sin(n*i)/a;return e[0]=o*t[0]+s*r[0],e[1]=o*t[1]+s*r[1],e[2]=o*t[2]+s*r[2],e}function P6t(e,t,r,n,i,a){let o=a*a,s=o*(2*a-3)+1,u=o*(a-2)+a,c=o*(a-1),l=o*(3-2*a);return e[0]=t[0]*s+r[0]*u+n[0]*c+i[0]*l,e[1]=t[1]*s+r[1]*u+n[1]*c+i[1]*l,e[2]=t[2]*s+r[2]*u+n[2]*c+i[2]*l,e}function R6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,d=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*d,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*d,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*d,e}function j6t(e,t){t=t===void 0?1:t;let r=t_()*2*Math.PI,n=t_()*2-1,i=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*i,e[1]=Math.sin(r)*i,e[2]=n*t,e}function Ih(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,e[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,e[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,e[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,e}function n_(e,t,r){let n=t[0],i=t[1],a=t[2];return e[0]=n*r[0]+i*r[3]+a*r[6],e[1]=n*r[1]+i*r[4]+a*r[7],e[2]=n*r[2]+i*r[5]+a*r[8],e}function i_(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,d=n*u-i*s,p=i*d-a*f,h=a*l-n*d,b=n*f-i*l,g=o*2;return l*=g,f*=g,d*=g,p*=2,h*=2,b*=2,e[0]=s+l+p,e[1]=u+f+h,e[2]=c+d+b,e}function y7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0],a[1]=i[1]*Math.cos(n)-i[2]*Math.sin(n),a[2]=i[1]*Math.sin(n)+i[2]*Math.cos(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function x7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[2]*Math.sin(n)+i[0]*Math.cos(n),a[1]=i[1],a[2]=i[2]*Math.cos(n)-i[0]*Math.sin(n),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function _7(e,t,r,n){let i=[],a=[];return i[0]=t[0]-r[0],i[1]=t[1]-r[1],i[2]=t[2]-r[2],a[0]=i[0]*Math.cos(n)-i[1]*Math.sin(n),a[1]=i[0]*Math.sin(n)+i[1]*Math.cos(n),a[2]=i[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e}function w7(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2],u=Math.sqrt((r*r+n*n+i*i)*(a*a+o*o+s*s)),c=u&&r_(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function L6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function M6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function q6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function N6t(e,t){let r=e[0],n=e[1],i=e[2],a=t[0],o=t[1],s=t[2];return Math.abs(r-a)<=1e-6*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(n-o)<=1e-6*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(i-s)<=1e-6*Math.max(1,Math.abs(i),Math.abs(s))}var U6t=Zxe,G6t=e1e,z6t=t1e,H6t=r1e,W6t=n1e,E7=Qxe,V6t=i1e,K6t=function(){let e=_C();return function(t,r,n,i,a,o){let s,u;for(r||(r=3),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}}();var A7=[0,0,0],EC,ce=class extends Ad{static get ZERO(){return EC||(EC=new ce(0,0,0),Object.freeze(EC)),EC}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&hs(t)?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=Ar(t)}angle(t){return w7(this,t)}cross(t){return Oh(this,this,t),this.check()}rotateX({radians:t,origin:r=A7}){return y7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=A7}){return x7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=A7}){return _7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ih(this,this,t),this.check()}transformAsVector(t){return yC(this,this,t),this.check()}transformByMatrix3(t){return n_(this,this,t),this.check()}transformByMatrix2(t){return Jxe(this,this,t),this.check()}transformByQuaternion(t){return i_(this,this,t),this.check()}};var AC,ms=class extends Ad{static get ZERO(){return AC||(AC=new ms(0,0,0,0),Object.freeze(AC)),AC}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),hs(t)&&arguments.length===1?this.copy(t):(Sn.debug&&(Ar(t),Ar(r),Ar(n),Ar(i)),this[0]=t,this[1]=r,this[2]=n,this[3]=i)}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return Sn.debug&&(Ar(t.x),Ar(t.y),Ar(t.z),Ar(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}transform(t){return Ih(this,this,t),this.check()}transformByMatrix3(t){return xC(this,this,t),this.check()}transformByMatrix2(t){return Xxe(this,this,t),this.check()}transformByQuaternion(t){return i_(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var xv=class extends wd{toString(){let t="[";if(Sn.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=Ar(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)r[i]=this[n+i];return r}setColumn(t,r){let n=t*this.RANK;for(let i=0;i<this.RANK;++i)this[n+i]=r[i];return this}};function a1e(){let e=new Mn(9);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function o1e(e,t){if(e===t){let r=t[1],n=t[2],i=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=i}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function s1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,d=-l*a+s*u,p=c*a-o*u,h=r*f+n*d+i*p;return h?(h=1/h,e[0]=f*h,e[1]=(-l*n+i*c)*h,e[2]=(s*n-i*o)*h,e[3]=d*h,e[4]=(l*r-i*u)*h,e[5]=(-s*r+i*a)*h,e[6]=p*h,e[7]=(-c*r+n*u)*h,e[8]=(o*r-n*a)*h,e):null}function u1e(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8];return t*(c*a-o*u)+r*(-c*i+o*s)+n*(u*i-a*s)}function S7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],p=r[1],h=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=d*n+p*o+h*c,e[1]=d*i+p*s+h*l,e[2]=d*a+p*u+h*f,e[3]=b*n+g*o+x*c,e[4]=b*i+g*s+x*l,e[5]=b*a+g*u+x*f,e[6]=E*n+S*o+F*c,e[7]=E*i+S*s+F*l,e[8]=E*a+S*u+F*f,e}function c1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],p=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+p*o+c,e[7]=d*i+p*s+l,e[8]=d*a+p*u+f,e}function l1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=Math.sin(r),p=Math.cos(r);return e[0]=p*n+d*o,e[1]=p*i+d*s,e[2]=p*a+d*u,e[3]=p*o-d*n,e[4]=p*s-d*i,e[5]=p*u-d*a,e[6]=c,e[7]=l,e[8]=f,e}function T7(e,t,r){let n=r[0],i=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=i*t[3],e[4]=i*t[4],e[5]=i*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function f1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,p=i*s,h=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-h,e[3]=l-x,e[6]=d+g,e[1]=l+x,e[4]=1-c-h,e[7]=p-b,e[2]=d-g,e[5]=p+b,e[8]=1-c-f,e}var C7;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(C7||(C7={}));var Y6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends xv{static get IDENTITY(){return X6t()}static get ZERO(){return J6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return C7}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(Y6t)}fromObject(t){return this.check()}fromQuaternion(t){return f1e(this,t),this.check()}set(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c){return this[0]=t,this[1]=i,this[2]=s,this[3]=r,this[4]=a,this[5]=u,this[6]=n,this[7]=o,this[8]=c,this.check()}determinant(){return u1e(this)}transpose(){return o1e(this,this),this.check()}invert(){return s1e(this,this),this.check()}multiplyLeft(t){return S7(this,t,this),this.check()}multiplyRight(t){return S7(this,this,t),this.check()}rotate(t){return l1e(this,this,t),this.check()}scale(t){return Array.isArray(t)?T7(this,this,t):T7(this,this,[t,t]),this.check()}translate(t){return c1e(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=gC(r||[-0,-0],t,this);break;case 3:n=n_(r||[-0,-0,-0],t,this);break;case 4:n=xC(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ed(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},SC,TC=null;function J6t(){return SC||(SC=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(SC)),SC}function X6t(){return TC||(TC=new Rr,Object.freeze(TC)),TC}var CC={};da(CC,{add:()=>w3t,adjoint:()=>n3t,clone:()=>Z6t,copy:()=>e3t,create:()=>Q6t,decompose:()=>p3t,determinant:()=>k7,equals:()=>T3t,exactEquals:()=>S3t,frob:()=>_3t,fromQuat:()=>L7,fromQuat2:()=>l3t,fromRotation:()=>o3t,fromRotationTranslation:()=>p1e,fromRotationTranslationScale:()=>h3t,fromRotationTranslationScaleOrigin:()=>m3t,fromScaling:()=>a3t,fromTranslation:()=>i3t,fromValues:()=>t3t,fromXRotation:()=>s3t,fromYRotation:()=>u3t,fromZRotation:()=>c3t,frustum:()=>M7,getRotation:()=>d3t,getScaling:()=>h1e,getTranslation:()=>f3t,identity:()=>d1e,invert:()=>F7,lookAt:()=>U7,mul:()=>C3t,multiply:()=>a_,multiplyScalar:()=>E3t,multiplyScalarAndAdd:()=>A3t,ortho:()=>N7,orthoNO:()=>g1e,orthoZO:()=>b3t,perspective:()=>q7,perspectiveFromFieldOfView:()=>v3t,perspectiveNO:()=>m1e,perspectiveZO:()=>g3t,rotate:()=>I7,rotateX:()=>P7,rotateY:()=>R7,rotateZ:()=>j7,scale:()=>O7,set:()=>r3t,str:()=>x3t,sub:()=>D3t,subtract:()=>v1e,targetTo:()=>y3t,translate:()=>B7,transpose:()=>D7});function Q6t(){let e=new Mn(16);return Mn!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function Z6t(e){let t=new Mn(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function e3t(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function t3t(e,t,r,n,i,a,o,s,u,c,l,f,d,p,h,b){let g=new Mn(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=d,g[13]=p,g[14]=h,g[15]=b,g}function r3t(e,t,r,n,i,a,o,s,u,c,l,f,d,p,h,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=d,e[12]=p,e[13]=h,e[14]=b,e[15]=g,e}function d1e(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 D7(e,t){if(e===t){let r=t[1],n=t[2],i=t[3],a=t[6],o=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=a,e[11]=t[14],e[12]=i,e[13]=o,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function F7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],h=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*h,C=l*g-d*h,I=l*x-p*h,P=f*g-d*b,U=f*x-p*b,Y=d*x-p*g,J=E*Y-S*U+F*P+D*I-j*C+k*N;return J?(J=1/J,e[0]=(s*Y-u*U+c*P)*J,e[1]=(i*U-n*Y-a*P)*J,e[2]=(b*k-g*j+x*D)*J,e[3]=(d*j-f*k-p*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-h*k-x*S)*J,e[7]=(l*k-d*F+p*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(h*j-b*F+x*E)*J,e[11]=(f*F-l*j-p*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-h*D-g*E)*J,e[15]=(l*D-f*S+d*E)*J,e):null}function n3t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],p=t[11],h=t[12],b=t[13],g=t[14],x=t[15],E=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,k=i*c-a*u,N=l*b-f*h,C=l*g-d*h,I=l*x-p*h,P=f*g-d*b,U=f*x-p*b,Y=d*x-p*g;return e[0]=s*Y-u*U+c*P,e[1]=i*U-n*Y-a*P,e[2]=b*k-g*j+x*D,e[3]=d*j-f*k-p*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-h*k-x*S,e[7]=l*k-d*F+p*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=h*j-b*F+x*E,e[11]=f*F-l*j-p*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-h*D-g*E,e[15]=l*D-f*S+d*E,e}function k7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],p=e[12],h=e[13],b=e[14],g=e[15],x=t*o-r*a,E=t*s-n*a,S=r*s-n*o,F=c*h-l*p,D=c*b-f*p,j=l*b-f*h,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=p*S-h*E+b*x;return u*k-i*N+g*C-d*I}function a_(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=t[9],p=t[10],h=t[11],b=t[12],g=t[13],x=t[14],E=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*d+j*g,e[2]=S*a+F*c+D*p+j*x,e[3]=S*o+F*l+D*h+j*E,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*d+j*g,e[6]=S*a+F*c+D*p+j*x,e[7]=S*o+F*l+D*h+j*E,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*d+j*g,e[10]=S*a+F*c+D*p+j*x,e[11]=S*o+F*l+D*h+j*E,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*d+j*g,e[14]=S*a+F*c+D*p+j*x,e[15]=S*o+F*l+D*h+j*E,e}function B7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,d,p,h,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],d=t[6],p=t[7],h=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=d,e[7]=p,e[8]=h,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+h*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+d*i+g*a+t[14],e[15]=c*n+p*i+x*a+t[15]),e}function O7(e,t,r){let n=r[0],i=r[1],a=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function I7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,d,p,h,b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],d=t[1],p=t[2],h=t[3],b=t[4],g=t[5],x=t[6],E=t[7],S=t[8],F=t[9],D=t[10],j=t[11],k=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,I=i*a*l-o*c,P=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,J=a*o*l-i*c,re=o*o*l+u,e[0]=f*k+b*N+S*C,e[1]=d*k+g*N+F*C,e[2]=p*k+x*N+D*C,e[3]=h*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=d*I+g*P+F*U,e[6]=p*I+x*P+D*U,e[7]=h*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=d*Y+g*J+F*re,e[10]=p*Y+x*J+D*re,e[11]=h*Y+E*J+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function P7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+d*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=d*i-u*n,e}function R7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-d*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+d*i,e}function j7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+d*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=d*i-u*n,e}function i3t(e,t){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]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function a3t(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function o3t(e,t,r){let n=r[0],i=r[1],a=r[2],o=Math.sqrt(n*n+i*i+a*a),s,u,c;return o<1e-6?null:(o=1/o,n*=o,i*=o,a*=o,u=Math.sin(t),s=Math.cos(t),c=1-s,e[0]=n*n*c+s,e[1]=i*n*c+a*u,e[2]=a*n*c-i*u,e[3]=0,e[4]=n*i*c-a*u,e[5]=i*i*c+s,e[6]=a*i*c+n*u,e[7]=0,e[8]=n*a*c+i*u,e[9]=i*a*c-n*u,e[10]=a*a*c+s,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function s3t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function u3t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function c3t(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,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 p1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,d=n*c,p=i*u,h=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(p+b),e[1]=f+E,e[2]=d-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=h+g,e[7]=0,e[8]=d+x,e[9]=h-g,e[10]=1-(l+p),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function l3t(e,t){let r=new Mn(3),n=-t[0],i=-t[1],a=-t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=n*n+i*i+a*a+o*o;return f>0?(r[0]=(s*o+l*n+u*a-c*i)*2/f,r[1]=(u*o+l*i+c*n-s*a)*2/f,r[2]=(c*o+l*a+s*i-u*n)*2/f):(r[0]=(s*o+l*n+u*a-c*i)*2,r[1]=(u*o+l*i+c*n-s*a)*2,r[2]=(c*o+l*a+s*i-u*n)*2),p1e(e,t,r),e}function f3t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function h1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[4],o=t[5],s=t[6],u=t[8],c=t[9],l=t[10];return e[0]=Math.sqrt(r*r+n*n+i*i),e[1]=Math.sqrt(a*a+o*o+s*s),e[2]=Math.sqrt(u*u+c*c+l*l),e}function d3t(e,t){let r=new Mn(3);h1e(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,d=t[8]*n,p=t[9]*i,h=t[10]*a,b=o+l+h,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-p)/g,e[1]=(d-u)/g,e[2]=(s-c)/g):o>l&&o>h?(g=Math.sqrt(1+o-l-h)*2,e[3]=(f-p)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(d+u)/g):l>h?(g=Math.sqrt(1+l-o-h)*2,e[3]=(d-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+p)/g):(g=Math.sqrt(1+h-o-l)*2,e[3]=(s-c)/g,e[0]=(d+u)/g,e[1]=(f+p)/g,e[2]=.25*g),e}function p3t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],d=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+d*d);let p=1/r[0],h=1/r[1],b=1/r[2],g=i*p,x=a*h,E=o*b,S=s*p,F=u*h,D=c*b,j=l*p,k=f*h,N=d*b,C=g+F+N,I=0;return C>0?(I=Math.sqrt(C+1)*2,e[3]=.25*I,e[0]=(D-k)/I,e[1]=(j-E)/I,e[2]=(x-S)/I):g>F&&g>N?(I=Math.sqrt(1+g-F-N)*2,e[3]=(D-k)/I,e[0]=.25*I,e[1]=(x+S)/I,e[2]=(j+E)/I):F>N?(I=Math.sqrt(1+F-g-N)*2,e[3]=(j-E)/I,e[0]=(x+S)/I,e[1]=.25*I,e[2]=(D+k)/I):(I=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/I,e[0]=(j+E)/I,e[1]=(D+k)/I,e[2]=.25*I),e}function h3t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,d=i*c,p=i*l,h=a*c,b=a*l,g=o*l,x=s*u,E=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(h+g))*F,e[1]=(d+S)*F,e[2]=(p-E)*F,e[3]=0,e[4]=(d-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(p+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+h))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function m3t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,d=a*c,p=a*l,h=a*f,b=o*l,g=o*f,x=s*f,E=u*c,S=u*l,F=u*f,D=n[0],j=n[1],k=n[2],N=i[0],C=i[1],I=i[2],P=(1-(b+x))*D,U=(p+F)*D,Y=(h-S)*D,J=(p-F)*j,re=(1-(d+x))*j,ee=(g+E)*j,ge=(h+S)*k,ye=(g-E)*k,pe=(1-(d+b))*k;return e[0]=P,e[1]=U,e[2]=Y,e[3]=0,e[4]=J,e[5]=re,e[6]=ee,e[7]=0,e[8]=ge,e[9]=ye,e[10]=pe,e[11]=0,e[12]=r[0]+N-(P*N+J*C+ge*I),e[13]=r[1]+C-(U*N+re*C+ye*I),e[14]=r[2]+I-(Y*N+ee*C+pe*I),e[15]=1,e}function L7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,p=i*s,h=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-h,e[1]=l+x,e[2]=d-g,e[3]=0,e[4]=l-x,e[5]=1-c-h,e[6]=p+b,e[7]=0,e[8]=d+g,e[9]=p-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function M7(e,t,r,n,i,a,o){let s=1/(r-t),u=1/(i-n),c=1/(a-o);return e[0]=a*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a*2*u,e[6]=0,e[7]=0,e[8]=(r+t)*s,e[9]=(i+n)*u,e[10]=(o+a)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*a*2*c,e[15]=0,e}function m1e(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=(i+n)*o,e[14]=2*i*n*o}else e[10]=-1,e[14]=-2*n;return e}var q7=m1e;function g3t(e,t,r,n,i){let a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0){let o=1/(n-i);e[10]=i*o,e[14]=i*n*o}else e[10]=-1,e[14]=-n;return e}function v3t(e,t,r,n){let i=Math.tan(t.upDegrees*Math.PI/180),a=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),u=2/(o+s),c=2/(i+a);return e[0]=u,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((o-s)*u*.5),e[9]=(i-a)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function g1e(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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*c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=(o+a)*c,e[15]=1,e}var N7=g1e;function b3t(e,t,r,n,i,a,o){let s=1/(t-r),u=1/(n-i),c=1/(a-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]=c,e[11]=0,e[12]=(t+r)*s,e[13]=(i+n)*u,e[14]=a*c,e[15]=1,e}function U7(e,t,r,n){let i,a,o,s,u,c,l,f,d,p,h=t[0],b=t[1],g=t[2],x=n[0],E=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(h-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?d1e(e):(f=h-F,d=b-D,p=g-j,i=1/Math.sqrt(f*f+d*d+p*p),f*=i,d*=i,p*=i,a=E*p-S*d,o=S*f-x*p,s=x*d-E*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=d*s-p*o,c=p*a-f*s,l=f*o-d*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=p,e[11]=0,e[12]=-(a*h+o*b+s*g),e[13]=-(u*h+c*b+l*g),e[14]=-(f*h+d*b+p*g),e[15]=1,e)}function y3t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],d=o-r[2],p=l*l+f*f+d*d;p>0&&(p=1/Math.sqrt(p),l*=p,f*=p,d*=p);let h=u*d-c*f,b=c*l-s*d,g=s*f-u*l;return p=h*h+b*b+g*g,p>0&&(p=1/Math.sqrt(p),h*=p,b*=p,g*=p),e[0]=h,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-d*b,e[5]=d*h-l*g,e[6]=l*b-f*h,e[7]=0,e[8]=l,e[9]=f,e[10]=d,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function x3t(e){return"mat4(".concat(e[0],", ").concat(e[1],", ").concat(e[2],", ").concat(e[3],", ").concat(e[4],", ").concat(e[5],", ").concat(e[6],", ").concat(e[7],", ").concat(e[8],", ").concat(e[9],", ").concat(e[10],", ").concat(e[11],", ").concat(e[12],", ").concat(e[13],", ").concat(e[14],", ").concat(e[15],")")}function _3t(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function w3t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function v1e(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function E3t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function A3t(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function S3t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function T3t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],p=e[11],h=e[12],b=e[13],g=e[14],x=e[15],E=t[0],S=t[1],F=t[2],D=t[3],j=t[4],k=t[5],N=t[6],C=t[7],I=t[8],P=t[9],U=t[10],Y=t[11],J=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-E)<=1e-6*Math.max(1,Math.abs(r),Math.abs(E))&&Math.abs(n-S)<=1e-6*Math.max(1,Math.abs(n),Math.abs(S))&&Math.abs(i-F)<=1e-6*Math.max(1,Math.abs(i),Math.abs(F))&&Math.abs(a-D)<=1e-6*Math.max(1,Math.abs(a),Math.abs(D))&&Math.abs(o-j)<=1e-6*Math.max(1,Math.abs(o),Math.abs(j))&&Math.abs(s-k)<=1e-6*Math.max(1,Math.abs(s),Math.abs(k))&&Math.abs(u-N)<=1e-6*Math.max(1,Math.abs(u),Math.abs(N))&&Math.abs(c-C)<=1e-6*Math.max(1,Math.abs(c),Math.abs(C))&&Math.abs(l-I)<=1e-6*Math.max(1,Math.abs(l),Math.abs(I))&&Math.abs(f-P)<=1e-6*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(p-Y)<=1e-6*Math.max(1,Math.abs(p),Math.abs(Y))&&Math.abs(h-J)<=1e-6*Math.max(1,Math.abs(h),Math.abs(J))&&Math.abs(b-re)<=1e-6*Math.max(1,Math.abs(b),Math.abs(re))&&Math.abs(g-ee)<=1e-6*Math.max(1,Math.abs(g),Math.abs(ee))&&Math.abs(x-ge)<=1e-6*Math.max(1,Math.abs(x),Math.abs(ge))}var C3t=a_,D3t=v1e;function F3t(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function b1e(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function y1e(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function x1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return Math.sqrt(t*t+r*r+n*n+i*i)}function _1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function w1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function E1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function A1e(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e[3]=s+n*(r[3]-s),e}function S1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3];return e[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,e[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,e[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,e[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,e}function T1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,d=c*a+o*i-s*n,p=-o*n-s*i-u*a;return e[0]=l*c+p*-o+f*-u-d*-s,e[1]=f*c+p*-s+d*-o-l*-u,e[2]=d*c+p*-u+l*-s-f*-o,e[3]=t[3],e}var Ovr=function(){let e=F3t();return function(t,r,n,i,a,o){let s,u;for(r||(r=4),n||(n=0),i?u=Math.min(i*r+n,t.length):u=t.length,s=n;s<u;s+=r)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],a(e,e,o),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}}();var H7;(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"})(H7||(H7={}));var B3t=45*Math.PI/180,O3t=1,G7=.1,z7=500,I3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends xv{static get IDENTITY(){return R3t()}static get ZERO(){return P3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return H7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,d,p,h,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=d,this[12]=p,this[13]=h,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,d,p,h,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=p,this[4]=r,this[5]=o,this[6]=l,this[7]=h,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=d,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(I3t)}fromObject(t){return this.check()}fromQuaternion(t){return L7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=G7,far:s=z7}=t;return s===1/0?j3t(this,r,n,i,a,o):M7(this,r,n,i,a,o,s),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:i=[0,1,0]}=t;return U7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=G7,far:s=z7}=t;return N7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=B3t,aspect:n=O3t,focalDistance:i=1,near:a=G7,far:o=z7}=t;C1e(r);let s=r/2,u=i*Math.tan(s),c=u*n;return this.ortho({left:-c,right:c,bottom:-u,top:u,near:a,far:o})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:i=.1,far:a=500}=t;return C1e(r),q7(this,r,n,i,a),this.check()}determinant(){return k7(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*i,t[5]=this[5]*a,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*i,t[9]=this[9]*a,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),i=1/n[0],a=1/n[1],o=1/n[2];return t[0]=this[0]*i,t[1]=this[1]*a,t[2]=this[2]*o,t[3]=this[4]*i,t[4]=this[5]*a,t[5]=this[6]*o,t[6]=this[8]*i,t[7]=this[9]*a,t[8]=this[10]*o,t}transpose(){return D7(this,this),this.check()}invert(){return F7(this,this),this.check()}multiplyLeft(t){return a_(this,t,this),this.check()}multiplyRight(t){return a_(this,this,t),this.check()}rotateX(t){return P7(this,this,t),this.check()}rotateY(t){return R7(this,this,t),this.check()}rotateZ(t){return j7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return I7(this,this,t,r),this.check()}scale(t){return O7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return B7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=S1e(r||[-0,-0,-0,-0],t,this),Ed(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=vC(r||[-0,-0],t,this);break;case 3:i=Ih(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ed(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=bC(r||[-0,-0],t,this);break;case 3:n=yC(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return Ed(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},DC,FC;function P3t(){return DC||(DC=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(DC)),DC}function R3t(){return FC||(FC=new Kr,Object.freeze(FC)),FC}function C1e(e){if(e>Math.PI*2)throw Error("expected radians")}function j3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,d=-2*a;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]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}function D1e(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function F1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function W7(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function V7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=r[0],u=r[1],c=r[2],l=r[3];return e[0]=n*l+o*s+i*c-a*u,e[1]=i*l+o*u+a*s-n*c,e[2]=a*l+o*c+n*u-i*s,e[3]=o*l-n*s-i*u-a*c,e}function k1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+o*s,e[1]=i*u+a*s,e[2]=a*u-i*s,e[3]=o*u-n*s,e}function B1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u-a*s,e[1]=i*u+o*s,e[2]=a*u+n*s,e[3]=o*u-i*s,e}function O1e(e,t,r){r*=.5;let n=t[0],i=t[1],a=t[2],o=t[3],s=Math.sin(r),u=Math.cos(r);return e[0]=n*u+i*s,e[1]=i*u-n*s,e[2]=a*u+o*s,e[3]=o*u-a*s,e}function I1e(e,t){let r=t[0],n=t[1],i=t[2];return e[0]=r,e[1]=n,e[2]=i,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-i*i)),e}function o_(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],d,p,h,b,g;return d=i*u+a*c+o*l+s*f,d<0&&(d=-d,u=-u,c=-c,l=-l,f=-f),1-d>1e-6?(p=Math.acos(d),g=Math.sin(p),h=Math.sin((1-n)*p)/g,b=Math.sin(n*p)/g):(h=1-n,b=n),e[0]=h*i+b*u,e[1]=h*a+b*c,e[2]=h*o+b*l,e[3]=h*s+b*f,e}function P1e(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a,s=o?1/o:0;return e[0]=-r*s,e[1]=-n*s,e[2]=-i*s,e[3]=a*s,e}function R1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function K7(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);let a=(i+1)%3,o=(i+2)%3;n=Math.sqrt(t[i*3+i]-t[a*3+a]-t[o*3+o]+1),e[i]=.5*n,n=.5/n,e[3]=(t[a*3+o]-t[o*3+a])*n,e[a]=(t[a*3+i]+t[i*3+a])*n,e[o]=(t[o*3+i]+t[i*3+o])*n}return e}var j1e=b1e;var L1e=y1e,M1e=E1e,q1e=A1e,N1e=x1e;var U1e=_1e;var G1e=w1e;var z1e=function(){let e=_C(),t=wC(1,0,0),r=wC(0,1,0);return function(n,i,a){let o=r_(i,a);return o<-.999999?(Oh(e,t,i),E7(e)<1e-6&&Oh(e,r,i),b7(e,e),W7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Oh(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,G1e(n,n))}}(),Vvr=function(){let e=D1e(),t=D1e();return function(r,n,i,a,o,s){return o_(e,n,o,s),o_(t,i,a,s),o_(r,e,t,2*s*(1-s)),r}}(),Kvr=function(){let e=a1e();return function(t,r,n,i){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],G1e(t,K7(t,e))}}();var L3t=[0,0,0,1],gs=class extends wd{constructor(t=0,r=0,n=0,i=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,i)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,i){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return K7(this,t),this.check()}fromAxisRotation(t,r){return W7(this,t,r),this.check()}identity(){return F1e(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=Ar(t)}get y(){return this[1]}set y(t){this[1]=Ar(t)}get z(){return this[2]}set z(t){this[2]=Ar(t)}get w(){return this[3]}set w(t){this[3]=Ar(t)}len(){return N1e(this)}lengthSquared(){return U1e(this)}dot(t){return M1e(this,t)}rotationTo(t,r){return z1e(this,t,r),this.check()}add(t){return j1e(this,this,t),this.check()}calculateW(){return I1e(this,this),this.check()}conjugate(){return R1e(this,this),this.check()}invert(){return P1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(q1e(this,t,r,n),this.check())}multiplyRight(t){return V7(this,this,t),this.check()}multiplyLeft(t){return V7(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return k1e(this,this,t),this.check()}rotateY(t){return B1e(this,this,t),this.check()}rotateZ(t){return O1e(this,this,t),this.check()}scale(t){return L1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=L3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return o_(this,i,a,o),this.check()}transformVector4(t,r=new ms){return T1e(r,t,this),Ed(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var mu={};da(mu,{EPSILON1:()=>M3t,EPSILON10:()=>K3t,EPSILON11:()=>$3t,EPSILON12:()=>Y3t,EPSILON13:()=>J3t,EPSILON14:()=>X3t,EPSILON15:()=>Q3t,EPSILON16:()=>Z3t,EPSILON17:()=>e8t,EPSILON18:()=>t8t,EPSILON19:()=>r8t,EPSILON2:()=>q3t,EPSILON20:()=>n8t,EPSILON3:()=>N3t,EPSILON4:()=>U3t,EPSILON5:()=>G3t,EPSILON6:()=>z3t,EPSILON7:()=>H3t,EPSILON8:()=>W3t,EPSILON9:()=>V3t,PI_OVER_FOUR:()=>a8t,PI_OVER_SIX:()=>o8t,PI_OVER_TWO:()=>i8t,TWO_PI:()=>s8t});var M3t=.1,q3t=.01,N3t=.001,U3t=1e-4,G3t=1e-5,z3t=1e-6,H3t=1e-7,W3t=1e-8,V3t=1e-9,K3t=1e-10,$3t=1e-11,Y3t=1e-12,J3t=1e-13,X3t=1e-14,Q3t=1e-15,Z3t=1e-16,e8t=1e-17,t8t=1e-18,r8t=1e-19,n8t=1e-20,i8t=Math.PI/2,a8t=Math.PI/4,o8t=Math.PI/6,s8t=Math.PI*2;var Ol=6356752314245179e-9,u8t={radii:[6378137,6378137,Ol],radiiSquared:[6378137*6378137,6378137*6378137,Ol*Ol],oneOverRadii:[1/6378137,1/6378137,1/Ol],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Ol*Ol)],maximumRadius:Math.max(6378137,6378137,Ol),centerToleranceSquared:.1};function kC(e){return e}var Abr=new ce;function c8t(e,t=[],r=kC){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function H1e(e,t=[]){return c8t(e,t,Sn._cartographicRadians?kC:h7)}function l8t(e,t,r=kC){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function W1e(e,t){return l8t(e,t,Sn._cartographicRadians?kC:m7)}var V1e=1e-14,f8t=new ce,K1e={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"}},$7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},s_={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},d8t=new ce,p8t=new ce,h8t=new ce;function Y7(e,t,r,n,i,a){let o=K1e[t]&&K1e[t][r];oa(o&&(!n||n===o));let s,u,c,l=f8t.copy(i);if(Po(l.x,0,V1e)&&Po(l.y,0,V1e)){let d=Math.sign(l.z);s=d8t.fromArray($7[t]),t!=="east"&&t!=="west"&&s.scale(d),u=p8t.fromArray($7[r]),r!=="east"&&r!=="west"&&u.scale(d),c=h8t.fromArray($7[n]),n!=="east"&&n!=="west"&&c.scale(d)}else{let{up:d,east:p,north:h}=s_;p.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),h.copy(d).cross(p);let{down:b,west:g,south:x}=s_;b.copy(d).scale(-1),g.copy(p).scale(-1),x.copy(h).scale(-1),s=s_[t],u=s_[r],c=s_[n]}return a[0]=s.x,a[1]=s.y,a[2]=s.z,a[3]=0,a[4]=u.x,a[5]=u.y,a[6]=u.z,a[7]=0,a[8]=c.x,a[9]=c.y,a[10]=c.z,a[11]=0,a[12]=l.x,a[13]=l.y,a[14]=l.z,a[15]=1,a}var _v=new ce,m8t=new ce,g8t=new ce;function $1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;_v.from(e);let o=_v.x,s=_v.y,u=_v.z,c=n.x,l=n.y,f=n.z,d=o*o*c*c,p=s*s*l*l,h=u*u*f*f,b=d+p+h,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=m8t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=g8t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*_v.len()/(.5*D.len()),k=0,N,C,I,P;do{j-=k,N=1/(1+j*E),C=1/(1+j*S),I=1/(1+j*F);let U=N*N,Y=C*C,J=I*I,re=U*N,ee=Y*C,ge=J*I;P=d*U+p*Y+h*J-1;let pe=-2*(d*re*E+p*ee*S+h*ge*F);k=P/pe}while(Math.abs(P)>mu.EPSILON12);return _v.scale([N,C,I]).to(r)}var BC=new ce,Y1e=new ce,y8t=new ce,gu=new ce,x8t=new ce,OC=new ce,or=class{constructor(t=0,r=0,n=0){zt(this,"radii",void 0),zt(this,"radiiSquared",void 0),zt(this,"radiiToTheFourth",void 0),zt(this,"oneOverRadii",void 0),zt(this,"oneOverRadiiSquared",void 0),zt(this,"minimumRadius",void 0),zt(this,"maximumRadius",void 0),zt(this,"centerToleranceSquared",mu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),oa(t>=0),oa(r>=0),oa(n>=0),this.radii=new ce(t,r,n),this.radiiSquared=new ce(t*t,r*r,n*n),this.radiiToTheFourth=new ce(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new ce(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new ce(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=Y1e,i=y8t,[,,a]=t;this.geodeticSurfaceNormalCartographic(t,n),i.copy(this.radiiSquared).scale(n);let o=Math.sqrt(n.dot(i));return i.scale(1/o),n.scale(a),i.add(n),i.to(r)}cartesianToCartographic(t,r=[0,0,0]){OC.from(t);let n=this.scaleToGeodeticSurface(OC,gu);if(!n)return;let i=this.geodeticSurfaceNormal(n,Y1e),a=x8t;a.copy(OC).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(yv.dot(a,OC))*yv.length(a);return W1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return Y7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return Y7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return BC.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=H1e(t),i=n[0],a=n[1],o=Math.cos(a);return BC.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),BC.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return BC.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return $1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){gu.from(t);let n=gu.x,i=gu.y,a=gu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return gu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return gu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return gu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){oa(Po(this.radii.x,this.radii.y,mu.EPSILON15)),oa(this.radii.z>0),gu.from(t);let i=gu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return gu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Ol));var sa={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var Wbr=new ce,Vbr=new ce;var u_=new ce,J1e=new ce,Xa=class{constructor(t=[0,0,0],r=0){zt(this,"center",void 0),zt(this,"radius",void 0),this.radius=-0,this.center=new ce,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=u_.from(r),this.center=new ce().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Xa(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=u_.copy(i).subtract(r),s=o.magnitude();if(n>=s+a)return this.clone();if(a>=s+n)return t.clone();let u=(n+s+a)*.5;return J1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(J1e),this.radius=u,this}expand(t){let n=u_.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=CC.getScaling(u_,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=u_.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,a=t.normal.dot(r)+t.distance;return a<-n?sa.OUTSIDE:a<n?sa.INTERSECTING:sa.INSIDE}};var _8t=new ce,w8t=new ce,IC=new ce,PC=new ce,RC=new ce,E8t=new ce,A8t=new ce,Il={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},ua=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){zt(this,"center",void 0),zt(this,"halfAxes",void 0),this.center=new ce().from(t),this.halfAxes=new Rr(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new ce(t).len(),new ce(r).len(),new ce(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),i=new ce(t).normalize(),a=new ce(r).normalize(),o=new ce(n).normalize();return new gs().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new gs(n),a=new Rr().fromQuaternion(i);return a[0]=a[0]*r[0],a[1]=a[1]*r[0],a[2]=a[2]*r[0],a[3]=a[3]*r[1],a[4]=a[4]*r[1],a[5]=a[5]*r[1],a[6]=a[6]*r[2],a[7]=a[7]*r[2],a[8]=a[8]*r[2],this.center=new ce().from(t),this.halfAxes=a,this}clone(){return new ua(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Xa){let r=this.halfAxes,n=r.getColumn(0,IC),i=r.getColumn(1,PC),a=r.getColumn(2,RC),o=_8t.copy(n).add(i).add(a);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,i=this.halfAxes,a=n.x,o=n.y,s=n.z,u=Math.abs(a*i[Il.COLUMN0ROW0]+o*i[Il.COLUMN0ROW1]+s*i[Il.COLUMN0ROW2])+Math.abs(a*i[Il.COLUMN1ROW0]+o*i[Il.COLUMN1ROW1]+s*i[Il.COLUMN1ROW2])+Math.abs(a*i[Il.COLUMN2ROW0]+o*i[Il.COLUMN2ROW1]+s*i[Il.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?sa.OUTSIDE:c>=u?sa.INSIDE:sa.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=w8t.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,IC),a=n.getColumn(1,PC),o=n.getColumn(2,RC),s=i.magnitude(),u=a.magnitude(),c=o.magnitude();i.normalize(),a.normalize(),o.normalize();let l=0,f;return f=Math.abs(r.dot(i))-s,f>0&&(l+=f*f),f=Math.abs(r.dot(a))-u,f>0&&(l+=f*f),f=Math.abs(r.dot(o))-c,f>0&&(l+=f*f),l}computePlaneDistances(t,r,n=[-0,-0]){let i=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,o=this.center,s=this.halfAxes,u=s.getColumn(0,IC),c=s.getColumn(1,PC),l=s.getColumn(2,RC),f=E8t.copy(u).add(c).add(l).add(o),d=A8t.copy(f).subtract(t),p=r.dot(d);return i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).add(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).add(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),f.copy(o).add(u).subtract(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).add(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).add(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).add(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),o.copy(f).subtract(u).subtract(c).subtract(l),d.copy(f).subtract(t),p=r.dot(d),i=Math.min(p,i),a=Math.max(p,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,IC);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,PC);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,RC);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var X1e=new ce,Q1e=new ce,Pl=class{constructor(t=[0,0,1],r=0){zt(this,"normal",void 0),zt(this,"distance",void 0),this.normal=new ce,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return oa(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=X1e.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,i){return this.normal.set(t,r,n),oa(Po(this.normal.len(),1)),this.distance=i,this}clone(){return new Pl(this.normal,this.distance)}equals(t){return Po(this.distance,t.distance)&&Po(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=Q1e.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=X1e.from(t),i=this.getPointDistance(n),a=Q1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var Z1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],e_e=new ce,S8t=new ce,vs=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*Z1e.length;let r=t.center,n=t.radius,i=0;for(let a of Z1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new Pl),s||(s=this.planes[i+1]=new Pl);let u=e_e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=e_e.copy(a).scale(n).add(r),l=S8t.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=sa.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case sa.OUTSIDE:return sa.OUTSIDE;case sa.INTERSECTING:r=sa.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(oa(Number.isFinite(r),"parentPlaneMask is required."),r===vs.MASK_OUTSIDE||r===vs.MASK_INSIDE)return r;let n=vs.MASK_INSIDE,i=this.planes;for(let a=0;a<this.planes.length;++a){let o=a<31?1<<a:0;if(a<31&&!(r&o))continue;let s=i[a],u=t.intersectPlane(s);if(u===sa.OUTSIDE)return vs.MASK_OUTSIDE;u===sa.INTERSECTING&&(n|=o)}return n}};zt(vs,"MASK_OUTSIDE",4294967295);zt(vs,"MASK_INSIDE",0);zt(vs,"MASK_INDETERMINATE",2147483647);var myr=new ce,gyr=new ce,vyr=new ce,byr=new ce,yyr=new ce;var C8t=new ce,D8t=new ce,F8t=new ce,k8t=new ce,B8t=new ce,O8t=new ce,I8t=new ce,wv=new ce,P8t=new ce,R8t=new ce,j8t=new ce,L8t=new ce;function J7(e,t=new Xa){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=I8t.copy(e[0]),n=C8t.copy(r),i=D8t.copy(r),a=F8t.copy(r),o=k8t.copy(r),s=B8t.copy(r),u=O8t.copy(r);for(let j of e){r.copy(j);let k=r.x,N=r.y,C=r.z;k<n.x&&n.copy(r),k>o.x&&o.copy(r),N<i.y&&i.copy(r),N>s.y&&s.copy(r),C<a.z&&a.copy(r),C>u.z&&u.copy(r)}let c=wv.copy(o).subtract(n).magnitudeSquared(),l=wv.copy(s).subtract(i).magnitudeSquared(),f=wv.copy(u).subtract(a).magnitudeSquared(),d=n,p=o,h=c;l>h&&(h=l,d=i,p=s),f>h&&(h=f,d=a,p=u);let b=P8t;b.x=(d.x+p.x)*.5,b.y=(d.y+p.y)*.5,b.z=(d.z+p.z)*.5;let g=wv.copy(p).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=R8t;E.x=n.x,E.y=i.y,E.z=a.z;let S=j8t;S.x=o.x,S.y=s.y,S.z=u.z;let F=L8t.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=wv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=wv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let I=C-x;b.x=(x*b.x+I*r.x)/C,b.y=(x*b.y+I*r.y)/C,b.z=(x*b.z+I*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var wc=new Rr,M8t=new Rr,q8t=new Rr,jC=new Rr,t_e=new Rr;function Z7(e,t={}){let r=mu.EPSILON20,n=10,i=0,a=0,o=M8t,s=q8t;o.identity(),s.copy(e);let u=r*N8t(s);for(;a<n&&U8t(s)>u;)G8t(s,jC),t_e.copy(jC).transpose(),s.multiplyRight(jC),s.multiplyLeft(t_e),o.multiplyRight(jC),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function N8t(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var X7=[1,0,0],Q7=[2,2,1];function U8t(e){let t=0;for(let r=0;r<3;++r){let n=e[wc.getElementIndex(Q7[r],X7[r])];t+=2*n*n}return Math.sqrt(t)}function G8t(e,t){let r=mu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[wc.getElementIndex(Q7[c],X7[c])]);l>n&&(i=c,n=l)}let a=X7[i],o=Q7[i],s=1,u=0;if(Math.abs(e[wc.getElementIndex(o,a)])>r){let c=e[wc.getElementIndex(o,o)],l=e[wc.getElementIndex(a,a)],f=e[wc.getElementIndex(o,a)],d=(c-l)/2/f,p;d<0?p=-1/(-d+Math.sqrt(1+d*d)):p=1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+p*p),u=p*s}return Rr.IDENTITY.to(t),t[wc.getElementIndex(a,a)]=t[wc.getElementIndex(o,o)]=s,t[wc.getElementIndex(o,a)]=u,t[wc.getElementIndex(a,o)]=-u,t}var Sd=new ce,H8t=new ce,W8t=new ce,V8t=new ce,K8t=new ce,$8t=new Rr,Y8t={diagonal:new Rr,unitary:new Rr};function c_(e,t=new ua){if(!e||e.length===0)return t.halfAxes=new Rr([0,0,0,0,0,0,0,0,0]),t.center=new ce,t;let r=e.length,n=new ce(0,0,0);for(let C of e)n.add(C);let i=1/r;n.multiplyByScalar(i);let a=0,o=0,s=0,u=0,c=0,l=0;for(let C of e){let I=Sd.copy(C).subtract(n);a+=I.x*I.x,o+=I.x*I.y,s+=I.x*I.z,u+=I.y*I.y,c+=I.y*I.z,l+=I.z*I.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=$8t;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:d}=Z7(f,Y8t),p=t.halfAxes.copy(d),h=p.getColumn(0,W8t),b=p.getColumn(1,V8t),g=p.getColumn(2,K8t),x=-Number.MAX_VALUE,E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)Sd.copy(C),x=Math.max(Sd.dot(h),x),E=Math.max(Sd.dot(b),E),S=Math.max(Sd.dot(g),S),F=Math.min(Sd.dot(h),F),D=Math.min(Sd.dot(b),D),j=Math.min(Sd.dot(g),j);h=h.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(h).add(b).add(g);let k=H8t.set(x-F,E-D,S-j).multiplyByScalar(.5),N=new Rr([k[0],0,0,0,k[1],0,0,0,k[2]]);return t.halfAxes.multiplyRight(N),t}function a_e(e){return e!=null}var Qyr=new ce,J8t=new ce,X8t=new ce,Q8t=new ce,Ph=new ce,r_e=new ce,n_e=new ce,i_e=new ce;function LC(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return o_e(e.box,t,r);if(e.region)return eCt(e.region);if(e.sphere)return Z8t(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function o_e(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=[];if(e.length===10){let c=e.slice(3,6),l=new gs;l.fromArray(e,6);let f=new ce([1,0,0]),d=new ce([0,1,0]),p=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),d.transformByQuaternion(l),d.scale(c[1]),p.transformByQuaternion(l),p.scale(c[2]),i=[...f.toArray(),...d.toArray(),...p.toArray()]}else i=[...e.slice(3,6),...e.slice(6,9),...e.slice(9,12)];let a=t.transformAsVector(i.slice(0,3)),o=t.transformAsVector(i.slice(3,6)),s=t.transformAsVector(i.slice(6,9)),u=new Rr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return a_e(r)?(r.center=n,r.halfAxes=u,r):new ua(n,u)}function Z8t(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(J8t),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return a_e(r)?(r.center=n,r.radius=o,r):new Xa(n,o)}function eCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Bl(t),Bl(i),a],X8t),u=or.WGS84.cartographicToCartesian([Bl(n),Bl(r),o],Q8t),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Ph),or.WGS84.cartographicToCartesian([Bl(n),Ph[1],Ph[2]],r_e),or.WGS84.cartographicToCartesian([Ph[0],Bl(i),Ph[2]],n_e),or.WGS84.cartographicToCartesian([Ph[0],Ph[1],o],i_e),o_e([...c,...r_e.subtract(c),...n_e.subtract(c),...i_e.subtract(c)],new Kr)}var Ev="4.1.0-alpha.7";var bs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},nxr=Object.keys(bs),Td={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function eq(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function s_e(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var MC="4.1.0-alpha.7";var u_e={name:"Draco",id:"draco",module:"draco",version:MC,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 l_e(e,t,r){let n=f_e(t.metadata),i=[],a=tCt(t.attributes);for(let o in e){let s=e[o],u=c_e(o,s,a[o]);i.push(u)}if(r){let o=c_e("indices",r);i.push(o)}return{fields:i,metadata:n}}function tCt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function c_e(e,t,r){let n=r?f_e(r.metadata):void 0;return d7(e,t,n)}function f_e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var d_e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},rCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},nCt=4,l_=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=f7(u.attributes),l=l_e(u.attributes,s,u.indices);return{loader:"draco",loaderData:s,header:{vertexCount:a.num_points(),boundingBox:c},...u,schema:l}}finally{this.draco.destroy(n),a&&this.draco.destroy(a)}}_getDracoLoaderData(t,r,n){let i=this._getTopLevelMetadata(t),a=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:i,attributes:a}}_getDracoAttributes(t,r){let n={};for(let i=0;i<t.num_attributes();i++){let a=this.decoder.GetAttribute(t,i),o=this._getAttributeMetadata(t,i);n[a.unique_id()]={unique_id:a.unique_id(),attribute_type:a.attribute_type(),data_type:a.data_type(),num_components:a.num_components(),byte_offset:a.byte_offset(),byte_stride:a.byte_stride(),normalized:a.normalized(),attribute_index:i,metadata:o};let s=this._getQuantizationTransform(a,r);s&&(n[a.unique_id()].quantization_transform=s);let u=this._getOctahedronTransform(a,r);u&&(n[a.unique_id()].octahedron_transform=u)}return n}_getMeshData(t,r,n){let i=this._getMeshAttributes(r,t,n);if(!i.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:i,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:i,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:i}}_getMeshAttributes(t,r,n){let i={};for(let a of Object.values(t.attributes)){let o=this._deduceAttributeName(a,n);a.name=o;let{value:s,size:u}=this._getAttributeValues(r,a);i[o]={value:s,size:u,byteOffset:a.byte_offset,byteStride:a.byte_stride,normalized:a.normalized}}return i}_getTriangleListIndices(t){let n=t.num_faces()*3,i=n*nCt,a=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,a),new Uint32Array(this.draco.HEAPF32.buffer,a,n).slice()}finally{this.draco._free(a)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),oCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=rCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=iCt(this.draco,n),c,l=this.draco._malloc(s);try{let f=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,f,u,s,l),c=new n(this.draco.HEAPF32.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:c,size:i}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[o,s]of Object.entries(r.extraAttributes||{}))if(s===n)return o;let i=t.attribute_type;for(let o in d_e)if(this.draco[o]===i)return d_e[o];let a=r.attributeNameEntry||"name";return t.metadata[a]?t.metadata[a].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let i=0;i<n;i++){let a=this.metadataQuerier.GetEntryName(t,i);r[a]=this._getDracoMetadataField(t,a)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let i=aCt(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:i}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,i=[...r,...n];for(let a of i)this.decoder.SkipAttributeTransform(this.draco[a])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))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(t,r){let{octahedronAttributes:n=[]}=r,i=t.attribute_type();if(n.map(o=>this.decoder[o]).includes(i)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(t))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}};function iCt(e,t){switch(t){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 aCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function oCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var sCt="1.5.6",uCt="1.4.1",tq=`https://www.gstatic.com/draco/versioned/decoders/${sCt}`,ai={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Cd={[ai.DECODER]:`${tq}/${ai.DECODER}`,[ai.DECODER_WASM]:`${tq}/${ai.DECODER_WASM}`,[ai.FALLBACK_DECODER]:`${tq}/${ai.FALLBACK_DECODER}`,[ai.ENCODER]:`https://raw.githubusercontent.com/google/draco/${uCt}/javascript/${ai.ENCODER}`},f_;async function p_e(e){let t=e.modules||{};return t.draco3d?f_=f_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):f_=f_||cCt(e),await f_}async function cCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await nc(Cd[ai.FALLBACK_DECODER],"draco",e,ai.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await nc(Cd[ai.DECODER],"draco",e,ai.DECODER),await nc(Cd[ai.DECODER_WASM],"draco",e,ai.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await lCt(t,r)}function lCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var rq={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:MC,worker:!0,options:{draco:{},source:null}};var Av={...u_e,parse:fCt};async function fCt(e,t){let{draco:r}=await p_e(t),n=new l_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var dCt={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},bi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Ht={...dCt,...bi};var nq={[bi.DOUBLE]:Float64Array,[bi.FLOAT]:Float32Array,[bi.UNSIGNED_SHORT]:Uint16Array,[bi.UNSIGNED_INT]:Uint32Array,[bi.UNSIGNED_BYTE]:Uint8Array,[bi.BYTE]:Int8Array,[bi.SHORT]:Int16Array,[bi.INT]:Int32Array},pCt={DOUBLE:bi.DOUBLE,FLOAT:bi.FLOAT,UNSIGNED_SHORT:bi.UNSIGNED_SHORT,UNSIGNED_INT:bi.UNSIGNED_INT,UNSIGNED_BYTE:bi.UNSIGNED_BYTE,BYTE:bi.BYTE,SHORT:bi.SHORT,INT:bi.INT},iq="Failed to convert GL type",Na=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in nq)if(nq[r]===t)return r;throw new Error(iq)}static fromName(t){let r=pCt[t];if(!r)throw new Error(iq);return r}static getArrayType(t){switch(t){case bi.UNSIGNED_SHORT_5_6_5:case bi.UNSIGNED_SHORT_4_4_4_4:case bi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=nq[t];if(!r)throw new Error(iq);return r}}static getByteSize(t){return Na.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(Na.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/Na.getByteSize(t));let a=Na.getArrayType(t);return new a(r,n,i)}};function h_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function aq(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,i=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=i<<3,t}var Bxr=1/256;var Oxr=new Bh,Ixr=new ce,Pxr=new Bh,Rxr=new Bh,jxr=new Uint8Array(1);function m_e(e,t=255){return g7(e,0,t)/t*2-1}function g_e(e){return e<0?-1:1}function v_e(e,t,r,n){if(h_e(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=m_e(e,r),n.y=m_e(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let i=n.x;n.x=(1-Math.abs(n.y))*g_e(i),n.y=(1-Math.abs(i))*g_e(n.y)}return n.normalize()}function oq(e,t,r){return v_e(e,t,255,r)}function qC(e){return(e%1+1)%1}var Rl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Ht.UNSIGNED_INT,n=1){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,i.byteOffset):i}getPropertyArray(t,r,n){let i=this.json[t];return i&&Number.isFinite(i.byteOffset)?("componentType"in i&&(r=Na.fromName(i.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,i.byteOffset)):this._getTypedArrayFromArray(t,r,i)}getProperty(t,r,n,i,a){let o=this.json[t];if(!o)return o;let s=this.getPropertyArray(t,r,n);if(n===1)return s[i];for(let u=0;u<n;++u)a[u]=s[n*i+u];return a}_getTypedArrayFromBinary(t,r,n,i,a){let o=this._cachedTypedArrays,s=o[t];return s||(s=Na.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+a,i*n),o[t]=s),s}_getTypedArrayFromArray(t,r,n){let i=this._cachedTypedArrays,a=i[t];return a||(a=Na.createTypedArray(r,n),i[t]=a),a}};var hCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},mCt={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},gCt={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function b_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?Na.fromName(i):i,o=hCt[e.type],s=mCt[e.type],u=gCt[e.type];return r+=e.byteOffset,{values:Na.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var Ec=e=>e!==void 0;function y_e(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),i=t.HIERARCHY;return i&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=i,n=i),n?vCt(n,r):null}function vCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;Ec(s.byteOffset)&&(s.componentType=defaultValue(s.componentType,GL.UNSIGNED_SHORT),s.type=AttributeType.SCALAR,i=getBinaryAccessor(s),s=i.createArrayBufferView(t.buffer,t.byteOffset+s.byteOffset,a));let f;if(Ec(u))for(Ec(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,i=getBinaryAccessor(u),u=i.createArrayBufferView(t.buffer,t.byteOffset+u.byteOffset,a)),f=new Uint16Array(a),l=0,r=0;r<a;++r)f[r]=l,l+=u[r];Ec(c)&&Ec(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let d=o.length;for(r=0;r<d;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let p=new Array(d).fill(0),h=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],h[r]=p[n],++p[n];let b={classes:o,classIds:s,classIndexes:h,parentCounts:u,parentIndexes:f,parentIds:c};return xCt(b),b}function Sv(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?bCt(e,t,r):yCt(e,t,r)}function bCt(e,t,r){let n=e.classIds,i=e.parentCounts,a=e.parentIds,o=e.parentIndexes,s=n.length,u=scratchVisited;u.length=Math.max(u.length,s);let c=++marker,l=scratchStack;for(l.length=0,l.push(t);l.length>0;){if(t=l.pop(),u[t]===c)continue;u[t]=c;let f=r(e,t);if(Ec(f))return f;let d=i[t],p=o[t];for(let h=0;h<d;++h){let b=a[p+h];b!==t&&l.push(b)}}return null}function yCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(Ec(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function xCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)x_e(e,i,stack)}function x_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!Ec(i))return;assert(t<s,`Parent index ${t} exceeds the total number of instances: ${s}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let u=Ec(n)?n[t]:1,c=Ec(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&x_e(e,f,r)}r.pop(t)}function go(e){return e!=null}var NC=(e,t)=>e,_Ct={HIERARCHY:!0,extensions:!0,extras:!0},Rh=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Qt(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=((a=this.json)==null?void 0:a.extensions)||{},this._properties={};for(let o in this.json)_Ct[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=y_e(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._hierarchy){let n=Sv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return go(n)}return!1}isExactClass(t,r){return Qt(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),Qt(typeof r=="string",r),go(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=go(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(go(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(go(n))return NC(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(go(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Qt(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(o){this._setBinaryProperty(o,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let a=this._properties[r];go(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=NC(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],i=this._initializeBinaryProperty(r,n);i&&(t=t||{},t[r]=i)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;Qt(this.binary,`Property ${t} requires a batch table binary.`),Qt(n.type,`Property ${t} requires a type.`);let i=b_e(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:i.values,componentCount:i.size,unpack:i.unpacker,pack:i.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=Sv(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return go(s[r])});return go(n)}_getPropertyNamesInHierarchy(t,r){Sv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a].instances;for(let s in o)o.hasOwnProperty(s)&&r.indexOf(s)===-1&&r.push(s)})}_getHierarchyProperty(t,r){return Sv(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return go(u)?go(u.typedArray)?this._getBinaryProperty(u,s):NC(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=Sv(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return go(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),go(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=NC(i,!0),!0):!1});return go(a)}};var sq=4;function Dd(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=sq,e.version=n.getUint32(r,!0),r+=sq,e.byteLength=n.getUint32(r,!0),r+=sq,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Tv=4,__e="b3dm tile in legacy format.";function Cv(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=Tv;let o=n.getUint32(r,!0);r+=Tv;let s=n.getUint32(r,!0);r+=Tv;let u=n.getUint32(r,!0);return r+=Tv,s>=570425344?(r-=Tv*2,i=a,s=o,u=0,a=0,o=0,console.warn(__e)):u>=570425344&&(r-=Tv,i=s,s=a,u=o,a=0,o=0,console.warn(__e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Dv(e,t,r,n){return r=wCt(e,t,r,n),r=ECt(e,t,r,n),r}function wCt(e,t,r,n){let{featureTableJsonByteLength:i,featureTableBinaryByteLength:a,batchLength:o}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:o||0},i&&i>0){let s=eq(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function ECt(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=eq(t,r,i);e.batchTableJson=JSON.parse(o),r+=i,a&&a>0&&(e.batchTableBinary=new Uint8Array(t,r,a),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=a)}return r}function uq(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:i,pointCount:a=0}=e;if(n&&r){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=n[s],l=r.getProperty(u,"dimensions").map(f=>f*255);o[s*3]=l[0],o[s*3+1]=l[1],o[s*3+2]=l[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}if(t&&i){let o=new Uint8ClampedArray(a*3);for(let s=0;s<a;s++){let u=aq(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Ht.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Ht.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Ht.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var w_e=new ce;function E_e(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)oq(t[n*2],t[n*2+1],w_e),w_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function A_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,ACt(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function ACt(e,t){let r=new ce,n=new Float32Array(e.pointCount*3);for(let i=0;i<e.pointCount;i++)r.set(t[i*3],t[i*3+1],t[i*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,i*3);return n}async function S_e(e,t,r,n,i){r=Dd(e,t,r),r=Cv(e,t,r),r=Dv(e,t,r,n),SCt(e);let{featureTable:a,batchTable:o}=TCt(e);return await BCt(e,a,o,n,i),CCt(e,a,n),DCt(e,a,o),FCt(e,a),r}function SCt(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function TCt(e){let t=new Rl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let n=kCt(e,t);return{featureTable:t,batchTable:n}}function CCt(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",Ht.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=A_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function DCt(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",Ht.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Ht.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Ht.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=uq(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function FCt(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",Ht.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Ht.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=E_e(e,r)}}function kCt(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Ht.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:i,batchTableBinary:a}=e;r=new Rh(i,a,n)}return r}async function BCt(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,d=c.byteLength;if(!o||!Number.isFinite(f)||!d)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+d),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await OCt(e,l,n,i)}async function OCt(e,t,r,n){if(!n)return;let i={...r,draco:{...r==null?void 0:r.draco,extraAttributes:t.batchTableProperties||{}}};delete i["3d-tiles"];let a=await Do(t.buffer,Av,i,n),o=a.attributes.POSITION&&a.attributes.POSITION.value,s=a.attributes.COLOR_0&&a.attributes.COLOR_0.value,u=a.attributes.NORMAL&&a.attributes.NORMAL.value,c=a.attributes.BATCH_ID&&a.attributes.BATCH_ID.value,l=o&&a.attributes.POSITION.value.quantization,f=u&&a.attributes.NORMAL.value.quantization;if(l){let p=a.POSITION.data.quantization,h=p.range;e.quantizedVolumeScale=new ce(h,h,h),e.quantizedVolumeOffset=new ce(p.minValues),e.quantizedRange=(1<<p.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let d={};if(t.batchTableProperties)for(let p of Object.keys(t.batchTableProperties))a.attributes[p]&&a.attributes[p].value&&(d[p.toLowerCase()]=a.attributes[p].value);e.attributes={positions:o,colors:uq(e,s,void 0),normals:u,batchIds:c,...d}}var vq={};da(vq,{decode:()=>vDt,name:()=>XC});var UC="4.1.0-alpha.7";var T_e,ICt=(T_e=globalThis.loaders)==null?void 0:T_e.parseImageNode,cq=typeof Image<"u",lq=typeof ImageBitmap<"u",PCt=Boolean(ICt),fq=gn?!0:PCt;function C_e(e){switch(e){case"auto":return lq||cq||fq;case"imagebitmap":return lq;case"image":return cq;case"data":return fq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function D_e(){if(lq)return"imagebitmap";if(cq)return"image";if(fq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function F_e(e){let t=RCt(e);if(!t)throw new Error("Not an image");return t}function dq(e){return Fv(e)}function Fv(e){switch(F_e(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function RCt(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 jCt=/^data:image\/svg\+xml/,LCt=/\.svg((\?|#).*)?$/;function GC(e){return e&&(jCt.test(e)||LCt.test(e))}function k_e(e,t){if(GC(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(a){throw new Error(a.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return pq(e,t)}function pq(e,t){if(GC(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function zC(e,t,r){let n=k_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await MCt(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function MCt(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,i)=>{try{r.onload=()=>n(r),r.onerror=a=>{let o=a instanceof Error?a.message:"error";i(new Error(o))}}catch(a){i(a)}})}var qCt={},B_e=!0;async function O_e(e,t,r){let n;GC(r)?n=await zC(e,t,r):n=pq(e,r);let i=t&&t.imagebitmap;return await NCt(n,i)}async function NCt(e,t=null){if((UCt(t)||!B_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),B_e=!1}return await createImageBitmap(e)}function UCt(e){for(let t in e||qCt)return!1;return!0}function I_e(e){return!WCt(e,"ftyp",4)||!(e[8]&96)?null:GCt(e)}function GCt(e){switch(zCt(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function zCt(e,t,r){return String.fromCharCode(...e.slice(t,r))}function HCt(e){return[...e].map(t=>t.charCodeAt(0))}function WCt(e,t,r=0){let n=HCt(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var Ac=!1,d_=!0;function jh(e){let t=p_(e);return KCt(t)||JCt(t)||$Ct(t)||YCt(t)||VCt(t)}function VCt(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=I_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function KCt(e){let t=p_(e);return t.byteLength>=24&&t.getUint32(0,Ac)===2303741511?{mimeType:"image/png",width:t.getUint32(16,Ac),height:t.getUint32(20,Ac)}:null}function $Ct(e){let t=p_(e);return t.byteLength>=10&&t.getUint32(0,Ac)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,d_),height:t.getUint16(8,d_)}:null}function YCt(e){let t=p_(e);return t.byteLength>=14&&t.getUint16(0,Ac)===16973&&t.getUint32(2,d_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,d_),height:t.getUint32(22,d_)}:null}function JCt(e){let t=p_(e);if(!(t.byteLength>=3&&t.getUint16(0,Ac)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=XCt(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,Ac);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,Ac),width:t.getUint16(a+7,Ac)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,Ac)}return null}function XCt(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function p_(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 P_e(e,t){var i;let{mimeType:r}=jh(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function R_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=QCt(i),s;switch(o){case"imagebitmap":s=await O_e(e,t,a);break;case"image":s=await zC(e,t,a);break;case"data":s=await P_e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Fv(s)),s}function QCt(e){switch(e){case"auto":case"data":return D_e();default:return C_e(e),e}}var ZCt=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],eDt=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],tDt={image:{type:"auto",decode:!0}},kv={id:"image",module:"images",name:"Images",version:UC,mimeTypes:eDt,extensions:ZCt,parse:R_e,tests:[e=>Boolean(jh(new DataView(e)))],options:tDt};var M_e,j_e=(M_e=globalThis.loaders)==null?void 0:M_e.encodeImageNode;async function q_e(e,t){return t=t||{},t.image=t.image||{},j_e?j_e(e,{type:t.image.mimeType}):rDt(e,t)}var L_e=!0;async function rDt(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=dq(e),o=document.createElement("canvas");o.width=i,o.height=a,nDt(e,o);let s=await new Promise(u=>{if(n&&L_e)try{o.toBlob(u,r,n);return}catch{L_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function nDt(e,t,r=0,n=0){if(r===0&&n===0&&typeof ImageBitmap<"u"&&e instanceof ImageBitmap){let a=t.getContext("bitmaprenderer");if(a)return a.transferFromImageBitmap(e),t}let i=t.getContext("2d");if(e.data){let a=new Uint8ClampedArray(e.data),o=new ImageData(a,e.width,e.height);return i.putImageData(o,0,0),t}return i.drawImage(e,0,0),t}var hq={name:"Images",id:"image",module:"images",version:UC,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:q_e};var mq={};function gq(e){if(mq[e]===void 0){let t=gn?aDt(e):iDt(e);mq[e]=t}return mq[e]}function iDt(e){var i,a;let t=["image/png","image/jpeg","image/gif"],r=((i=globalThis.loaders)==null?void 0:i.imageFormatsNode)||t,n=(a=globalThis.loaders)==null?void 0:a.parseImageNode;return Boolean(n)&&r.includes(e)}function aDt(e){switch(e){case"image/avif":case"image/webp":return oDt(e);default:return!0}}function oDt(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Gi(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var HC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},WC={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var sDt=1.33,N_e=["SCALAR","VEC2","VEC3","VEC4"],uDt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],cDt=new Map(uDt),lDt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},fDt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},dDt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function VC(e){return N_e[e-1]||N_e[0]}function Bv(e){let t=cDt.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Ov(e,t){let r=dDt[e.componentType],n=lDt[e.type],i=fDt[e.componentType],a=e.count*n,o=e.count*n*i;Gi(o>=0&&o<=t.byteLength);let s=WC[e.componentType],u=HC[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function h_(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(o=>o.bufferView);r=r.filter(o=>!n.includes(o));let i=r.reduce((o,s)=>o+s.byteLength,0),a=t.reduce((o,s)=>{let{width:u,height:c}=s.image;return o+u*c},0);return i+Math.ceil(4*a*sDt)}function U_e(e,t,r){let n=e.bufferViews[r];Gi(n);let i=n.buffer,a=t[i];Gi(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function G_e(e,t,r){var b,g;let n=typeof r=="number"?(b=e.accessors)==null?void 0:b[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let i=(g=e.bufferViews)==null?void 0:g[n.bufferView||0];if(!i)throw new Error(`No gltf buffer view for accessor ${i}`);let{arrayBuffer:a,byteOffset:o}=t[i.buffer],s=(o||0)+(n.byteOffset||0)+(i.byteOffset||0),{ArrayType:u,length:c,componentByteSize:l,numberOfComponentsInElement:f}=Ov(n,i),d=l*f,p=i.byteStride||d;if(typeof i.byteStride>"u"||i.byteStride===d)return new u(a,s,c);let h=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*p,f);h.set(E,x*f)}return h}function pDt(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var qr=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:(t==null?void 0:t.json)||pDt(),buffers:(t==null?void 0:t.buffers)||[],images:(t==null?void 0:t.images)||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.getRequiredExtensions().find(i=>i===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(i=>i===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];Gi(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return G_e(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),i=this.getBuffer(r.buffer).data,a=r.byteOffset||0;return new Uint8Array(i,a,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let i=t.extensions||{};i[r]=n}removeObjectExtension(t,r){let n=(t==null?void 0:t.extensions)||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let i=this.json.extensionsRemoved;i.includes(r)||i.push(r)}delete n[r]}addExtension(t,r={}){return Gi(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Gi(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){var r;if((r=this.json.extensions)!=null&&r[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let n=this.json.extensionsRemoved;n.includes(t)||n.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let i={mesh:r};return n&&(i.matrix=n),this.json.nodes.push(i),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:i,mode:a=4}=t,s={primitives:[{attributes:this._addAttributes(r),mode:a}]};if(n){let u=this._addIndices(n);s.primitives[0].indices=u}return Number.isFinite(i)&&(s.primitives[0].material=i),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=jh(t),i=r||(n==null?void 0:n.mimeType),o={bufferView:this.addBufferView(t),mimeType:i};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let i=t.byteLength;Gi(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=ko(i,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(a),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:VC(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),i={min:r.min,max:r.max};(!i.min||!i.max)&&(i=this._getAccessorMinMax(t,r.size));let a={size:r.size,componentType:Bv(t),count:Math.round(t.length/r.size),min:i.min,max:i.max};return this.addAccessor(n,Object.assign(a,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var a,o;this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;for(let s of this.sourceBuffers||[])i=ZI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};function z_e(e){return(e%1+1)%1}var H_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},hDt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},W_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function m_(e,t){return W_e[t]*H_e[e]}function Iv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=Pv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function Pv(e,t,r,n=1){let i=H_e[t],a=hDt[r],o=W_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Rv(e,t,r){var c,l,f,d,p;let n=`TEXCOORD_${t.texCoord||0}`,i=r.attributes[n],a=e.getTypedArrayForAccessor(i),o=e.gltf.json,s=t.index,u=(l=(c=o.textures)==null?void 0:c[s])==null?void 0:l.source;if(typeof u<"u"){let h=(d=(f=o.images)==null?void 0:f[u])==null?void 0:d.mimeType,b=(p=e.gltf.images)==null?void 0:p[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=mDt(b,h,a,x,t.channels);g.push(E)}return g}}return[]}function KC(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(d=>d===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Bv(o),count:o.length});i.attributes[t]=c}function mDt(e,t,r,n,i=[0]){let a={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=r[n],s=r[n+1],u=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(u=4);let c=gDt(o,s,e,u),l=0;for(let f of i){let d=typeof f=="number"?Object.values(a)[f]:a[f],p=c+d.offset,h=Fv(e);if(h.data.length<=p)throw new Error(`${h.data.length} <= ${p}`);let b=h.data[p];l|=b<<d.shift}return l}function gDt(e,t,r,n=1){let i=r.width,a=z_e(e)*(i-1),o=Math.round(a),s=r.height,u=z_e(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function $C(e,t,r,n,i){let a=[];for(let o=0;o<t;o++){let s=r[o],u=r[o+1]-r[o];if(u+s>n)break;let c=s/i,l=u/i;a.push(e.slice(c,c+l))}return a}function YC(e,t,r){let n=[];for(let i=0;i<t;i++){let a=i*r;n.push(e.slice(a,a+r))}return n}function JC(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let i=[],a=new TextDecoder("utf8"),o=0;for(let s=0;s<e;s++){let u=n[s+1]-n[s];if(u+o<=t.length){let c=t.subarray(o,u+o),l=a.decode(c);i.push(l),o+=u}}return i}return[]}var V_e="EXT_mesh_features",XC=V_e;async function vDt(e,t){let r=new qr(e);bDt(r,t)}function bDt(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)yDt(e,i,t)}function yDt(e,t,r){var a,o,s;if(!((a=r==null?void 0:r.gltf)!=null&&a.loadBuffers))return;let n=(o=t.extensions)==null?void 0:o[V_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Rv(e,u.texture,t):c=[];u.data=c}}var xq={};da(xq,{decode:()=>xDt,name:()=>jl});var bq="EXT_structural_metadata",jl=bq;async function xDt(e,t){let r=new qr(e);_Dt(r,t)}function _Dt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(bq);r&&((i=t.gltf)!=null&&i.loadImages&&wDt(e,r),EDt(e,r))}function wDt(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let i of n.meshes)for(let a of i.primitives)SDt(e,r,a,t)}function EDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.propertyTables;if(n&&i)for(let a in n){let o=ADt(i,a);o&&CDt(e,r,o)}}function ADt(e,t){for(let r of e)if(r.class===t)return r;return null}function SDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[bq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];TDt(e,u,r,n)}}function TDt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Rv(e,u,r);l!==null&&(KC(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function CDt(e,t,r){var a,o;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=DDt(e,t,u,i,c);c.data=l}}}function DDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=FDt(e,r,i,n),c=kDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=BDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=JC(n,s,u,c);break}case"ENUM":{a=ODt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function FDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Iv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function kDt(e,t,r){return typeof t.stringOffsets<"u"?Iv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function BDt(e,t,r,n){let i=e.array,a=e.count,o=m_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=Pv(r,e.type,e.componentType,s):u=r,i?n?$C(u,t,n,r.length,o):a?YC(u,t,a):[]:u}function ODt(e,t,r,n,i){var f;let a=t.enumType;if(!a)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=(f=e.enums)==null?void 0:f[a];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${a}`);let s=o.valueType||"UINT16",u=m_(t.type,s),c=n.byteLength/u,l=Pv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return IDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let d=t.count;return d?PDt(l,r,d,o):[]}return yq(l,0,r,o)}function IDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,d=l/a,p=yq(t,f,d,o);s.push(p)}return s}function PDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=yq(e,o,r,n);i.push(s)}return i}function yq(e,t,r,n){let i=[];for(let a=0;a<r;a++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)i.push("");else{let o=e[t+a],s=RDt(n,o);s?i.push(s.name):i.push("")}return i}function RDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var _q={};da(_q,{decode:()=>jDt,name:()=>ys});var K_e="EXT_feature_metadata",ys=K_e;async function jDt(e,t){let r=new qr(e);LDt(r,t)}function LDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(K_e);r&&((i=t.gltf)!=null&&i.loadImages&&MDt(e,r),qDt(e,r))}function MDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:i}=t;if(n&&i)for(let a in n){let o=n[a],s=UDt(i,a);s&&zDt(e,s,o)}}function qDt(e,t){let r=t.schema;if(!r)return;let n=r.classes,i=t.featureTables;if(n&&i)for(let a in n){let o=NDt(i,a);o&&GDt(e,r,o)}}function NDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function UDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function GDt(e,t,r){var a,o;if(!r.class)return;let n=(a=t.classes)==null?void 0:a[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let i=r.count;for(let s in n.properties){let u=n.properties[s],c=(o=r.properties)==null?void 0:o[s];if(c){let l=HDt(e,t,u,i,c);c.data=l}}}function zDt(e,t,r){var i;let n=t.class;for(let a in r.properties){let o=(i=t==null?void 0:t.properties)==null?void 0:i[a];if(o){let s=YDt(e,o,n);o.data=s}}}function HDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=WDt(e,r,i,n),c=VDt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=JC(n,s,u,c):KDt(r)&&(a=$Dt(r,n,s,u)),a}function WDt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Iv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function VDt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Iv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function KDt(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function $Dt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=m_(o,s),c=r.byteLength/u,l=Pv(r,o,s,c);return i?n?$C(l,t,n,r.length,u):a?YC(l,t,a):[]:l}function YDt(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let i=[];for(let a of n.meshes)for(let o of a.primitives)JDt(e,r,t,i,o);return i}function JDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Rv(e,a,i);o&&KC(e,t,o,n,i)}var QC="4.1.0-alpha.7";var jv="4.1.0-alpha.7";var Sc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},wq;async function Aq(e){let t=e.modules||{};return t.basis?t.basis:(wq=wq||XDt(e),await wq)}async function XDt(e){let t=null,r=null;return[t,r]=await Promise.all([await nc(Sc.TRANSCODER,"textures",e),await nc(Sc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await QDt(t,r)}function QDt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,initializeBasis:o}=i;o(),n({BasisFile:a})})})}var Eq;async function Sq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(Eq=Eq||ZDt(e),await Eq)}async function ZDt(e){let t=null,r=null;return[t,r]=await Promise.all([await nc(Sc.ENCODER,"textures",e),await nc(Sc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await e4t(t,r)}function e4t(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(i=>{let{BasisFile:a,KTX2File:o,initializeBasis:s,BasisEncoder:u}=i;s(),n({BasisFile:a,KTX2File:o,BasisEncoder:u})})})}var ke={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 t4t=["","WEBKIT_","MOZ_"],$_e={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"},ZC=null;function g_(e){if(!ZC){e=e||r4t()||void 0,ZC=new Set;for(let t of t4t)for(let r in $_e)if(e&&e.getExtension(`${t}${r}`)){let n=$_e[r];ZC.add(n)}}return ZC}function r4t(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var o2e=Wt(i2e(),1);function Lv(e,t){let r=new Array(t.mipMapLevels),n=t.width,i=t.height,a=0;for(let o=0;o<t.mipMapLevels;++o){let s=a4t(t,n,i,e,o),u=i4t(e,o,a,s);r[o]={compressed:!0,format:t.internalFormat,data:u,width:n,height:i,levelSize:s},n=Math.max(1,n>>1),i=Math.max(1,i>>1),a+=s}return r}function i4t(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function a4t(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var o4t={131:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,132:ke.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:ke.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:ke.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:ke.COMPRESSED_RED_RGTC1_EXT,140:ke.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:ke.COMPRESSED_RED_GREEN_RGTC2_EXT,142:ke.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:ke.COMPRESSED_RGB8_ETC2,148:ke.COMPRESSED_SRGB8_ETC2,149:ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:ke.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:ke.COMPRESSED_RGBA8_ETC2_EAC,152:ke.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:ke.COMPRESSED_R11_EAC,154:ke.COMPRESSED_SIGNED_R11_EAC,155:ke.COMPRESSED_RG11_EAC,156:ke.COMPRESSED_SIGNED_RG11_EAC,157:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,158:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,160:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,162:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,164:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,166:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,168:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,170:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,172:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,174:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,176:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,178:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,180:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,182:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:ke.COMPRESSED_RGBA_ASTC_12x12_KHR,184:ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:ke.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:ke.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:ke.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:ke.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:ke.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:ke.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:ke.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:ke.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:ke.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:ke.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:ke.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:ke.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:ke.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:ke.COMPRESSED_RGBA_ASTC_12x12_KHR};function a2e(e){return o4t[e]}var Ro=[171,75,84,88,32,50,48,187,13,10,26,10];function iD(e){let t=new Uint8Array(e);return!(t.byteLength<Ro.length||t[0]!==Ro[0]||t[1]!==Ro[1]||t[2]!==Ro[2]||t[3]!==Ro[3]||t[4]!==Ro[4]||t[5]!==Ro[5]||t[6]!==Ro[6]||t[7]!==Ro[7]||t[8]!==Ro[8]||t[9]!==Ro[9]||t[10]!==Ro[10]||t[11]!==Ro[11])}function s2e(e){let t=new Uint8Array(e),r=(0,o2e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=a2e(r.vkFormat);return Lv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var s4t={etc1:{basisFormat:0,compressed:!0,format:ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:ke.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:ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:ke.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 b_(e,t){if(t.basis.containerFormat==="auto"){if(iD(e)){let n=await Sq(t);return u2e(n.KTX2File,e,t)}let{BasisFile:r}=await Aq(t);return kq(r,e,t)}switch(t.basis.module){case"encoder":let r=await Sq(t);switch(t.basis.containerFormat){case"ktx2":return u2e(r.KTX2File,e,t);case"basis":default:return kq(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await Aq(t);return kq(n,e,t)}}function kq(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let i=n.getNumImages(),a=[];for(let o=0;o<i;o++){let s=n.getNumLevels(o),u=[];for(let c=0;c<s;c++)u.push(u4t(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function u4t(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=c2e(n,o),l=e.getImageTranscodedSizeInBytes(t,r,c),f=new Uint8Array(l);if(!e.transcodeImage(f,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:i,height:a,data:f,compressed:s,format:u,hasAlpha:o}}function u2e(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let i=n.getLevels(),a=[];for(let o=0;o<i;o++){a.push(c4t(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function c4t(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=c2e(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,u),l=new Uint8Array(c);if(!e.transcodeImage(l,t,0,0,u,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:a,height:i,data:l,compressed:o,levelSize:c,hasAlpha:n,format:s}}function c2e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Mv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),s4t[r]}function Mv(){let e=g_();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 l2e={name:"Basis",id:"basis",module:"textures",version:jv,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"}}},Lh={...l2e,parse:b_};var jo={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},l4t={DXT1:ke.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:ke.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:ke.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":ke.COMPRESSED_RGB_ATC_WEBGL,ATCA:ke.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:ke.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},f4t=p2e,d4t=aD,p4t=aD,h4t={DXT1:p2e,DXT3:aD,DXT5:aD,"ATC ":f4t,ATCA:d4t,ATCI:p4t};function f2e(e){return new Uint32Array(e,0,jo.HEADER_LENGTH)[jo.MAGIC_NUMBER_INDEX]===jo.MAGIC_NUMBER}function d2e(e){let t=new Int32Array(e,0,jo.HEADER_LENGTH),r=t[jo.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[jo.HEADER_PF_FLAGS_INDEX]&jo.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=m4t(r),i=l4t[n],a=h4t[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[jo.HEADER_FLAGS_INDEX]&jo.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[jo.MIPMAPCOUNT_INDEX]));let s=t[jo.HEADER_WIDTH_INDEX],u=t[jo.HEADER_HEIGHT_INDEX],c=t[jo.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Lv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function p2e(e,t){return(e+3>>2)*(t+3>>2)*8}function aD(e,t){return(e+3>>2)*(t+3>>2)*16}function m4t(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var xs={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},g4t={0:[ke.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[ke.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[ke.COMPRESSED_RGB_ETC1_WEBGL],7:[ke.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[ke.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[ke.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[ke.COMPRESSED_RGB8_ETC2],23:[ke.COMPRESSED_RGBA8_ETC2_EAC],24:[ke.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[ke.COMPRESSED_R11_EAC],26:[ke.COMPRESSED_RG11_EAC],27:[ke.COMPRESSED_RGBA_ASTC_4X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[ke.COMPRESSED_RGBA_ASTC_5X4_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[ke.COMPRESSED_RGBA_ASTC_5X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[ke.COMPRESSED_RGBA_ASTC_6X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[ke.COMPRESSED_RGBA_ASTC_6X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[ke.COMPRESSED_RGBA_ASTC_8X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[ke.COMPRESSED_RGBA_ASTC_8X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[ke.COMPRESSED_RGBA_ASTC_8X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[ke.COMPRESSED_RGBA_ASTC_10X5_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[ke.COMPRESSED_RGBA_ASTC_10X6_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[ke.COMPRESSED_RGBA_ASTC_10X8_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[ke.COMPRESSED_RGBA_ASTC_10X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[ke.COMPRESSED_RGBA_ASTC_12X10_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[ke.COMPRESSED_RGBA_ASTC_12X12_KHR,ke.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},v4t={0:h2e,1:h2e,2:m2e,3:m2e,6:y_,7:y_,9:x_,11:x_,22:y_,23:x_,24:y_,25:y_,26:x_,27:x_,28:b4t,29:y4t,30:x4t,31:_4t,32:w4t,33:E4t,34:A4t,35:S4t,36:T4t,37:C4t,38:D4t,39:F4t,40:k4t};function g2e(e){let r=new Uint32Array(e,0,xs.HEADER_LENGTH)[xs.MAGIC_NUMBER_INDEX];return r===xs.MAGIC_NUMBER||r===xs.MAGIC_NUMBER_EXTRA}function v2e(e){let t=new Uint32Array(e,0,xs.HEADER_LENGTH),r=t[xs.PIXEL_FORMAT_INDEX],n=t[xs.COLOUR_SPACE_INDEX],i=g4t[r]||[],a=i.length>1&&n?i[1]:i[0],o=v4t[r],s=t[xs.MIPMAPCOUNT_INDEX],u=t[xs.WIDTH_INDEX],c=t[xs.HEIGHT_INDEX],l=xs.HEADER_SIZE+t[xs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Lv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function h2e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function m2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function y_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function x_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function b4t(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function y4t(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function x4t(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function _4t(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function w4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function E4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function A4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function S4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function T4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function C4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function D4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function F4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function k4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function b2e(e){if(iD(e))return s2e(e);if(f2e(e))return d2e(e);if(g2e(e))return v2e(e);throw new Error("Texture container format not recognized")}var y2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:jv,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}}},oD={...y2e,parse:async(e,t)=>{var r;return(r=t==null?void 0:t["compressed-texture"])!=null&&r.useBasis?(t.basis={format:{alpha:"BC3",noAlpha:"BC1"},...t.basis,containerFormat:"ktx2",module:"encoder"},(await b_(e,t))[0]):b2e(e)}};var Bq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:jv,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var qv=!0,x2e=1735152710,Pq=12,sD=8,B4t=1313821514,O4t=5130562,I4t=0,P4t=0,R4t=1;function j4t(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function _2e(e,t=0,r={}){let n=new DataView(e),{magic:i=x2e}=r,a=n.getUint32(t,!1);return a===i||a===x2e}function w2e(e,t,r=0,n={}){let i=new DataView(t),a=j4t(i,r+0),o=i.getUint32(r+4,qv),s=i.getUint32(r+8,qv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Pq,e.version){case 1:return L4t(e,i,r);case 2:return M4t(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function L4t(e,t,r){Qt(e.header.byteLength>Pq+sD);let n=t.getUint32(r+0,qv),i=t.getUint32(r+4,qv);return r+=sD,Qt(i===I4t),Oq(e,t,r,n),r+=n,r+=Iq(e,t,r,e.header.byteLength),r}function M4t(e,t,r,n){return Qt(e.header.byteLength>Pq+sD),q4t(e,t,r,n),r+e.header.byteLength}function q4t(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,qv),a=t.getUint32(r+4,qv);switch(r+=sD,a){case B4t:Oq(e,t,r,i);break;case O4t:Iq(e,t,r,i);break;case P4t:n.strict||Oq(e,t,r,i);break;case R4t:n.strict||Iq(e,t,r,i);break;default:break}r+=ko(i,4)}return r}function Oq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),ko(n,4)}function Iq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),ko(n,4)}function Rq(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var Lq={};da(Lq,{decode:()=>X4t,name:()=>J4t});var N4t="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",U4t="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",G4t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),z4t=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),H4t={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},W4t={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function E2e(e,t,r,n,i,a="NONE"){let o=await V4t();Y4t(o,o.exports[W4t[i]],e,t,r,n,o.exports[H4t[a||"NONE"]])}var jq;async function V4t(){return jq||(jq=K4t()),jq}async function K4t(){let e=N4t;WebAssembly.validate(G4t)&&(e=U4t,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate($4t(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function $4t(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let i=e.charCodeAt(n);t[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?z4t[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function Y4t(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let d=t(c,n,i,l,a.length);if(d===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),d!==0)throw new Error(`Malformed buffer data: ${d}`)}var uD="EXT_meshopt_compression",J4t=uD;async function X4t(e,t){var i,a;let r=new qr(e);if(!((i=t==null?void 0:t.gltf)!=null&&i.decompressMeshes)||!((a=t.gltf)!=null&&a.loadBuffers))return;let n=[];for(let o of e.json.bufferViews||[])n.push(Q4t(r,o));await Promise.all(n),r.removeExtension(uD)}async function Q4t(e,t){let r=e.getObjectExtension(t,uD);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),d=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await E2e(d,o,a,f,s,u),e.removeObjectExtension(t,uD)}}var Mq={};da(Mq,{name:()=>Z4t,preprocess:()=>eFt});var Nv="EXT_texture_webp",Z4t=Nv;function eFt(e,t){let r=new qr(e);if(!gq("image/webp")){if(r.getRequiredExtensions().includes(Nv))throw new Error(`gltf: Required extension ${Nv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,Nv);a&&(i.source=a.source),r.removeObjectExtension(i,Nv)}r.removeExtension(Nv)}var qq={};da(qq,{name:()=>tFt,preprocess:()=>rFt});var cD="KHR_texture_basisu",tFt=cD;function rFt(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,cD);a&&(i.source=a.source,r.removeObjectExtension(i,cD))}r.removeExtension(cD)}var Uq={};da(Uq,{decode:()=>sFt,encode:()=>uFt,name:()=>aFt,preprocess:()=>oFt});function A2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Nq(n);t[r]=i}}return t}function Nq(e){let{buffer:t,size:r,count:n}=nFt(e);return{value:t,size:r,byteOffset:0,count:n,type:VC(r),componentType:Bv(t)}}function nFt(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=iFt(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function iFt(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Fd="KHR_draco_mesh_compression",aFt=Fd;function oFt(e,t,r){let n=new qr(e);for(let i of S2e(n))n.getObjectExtension(i,Fd)}async function sFt(e,t,r){var a;if(!((a=t==null?void 0:t.gltf)!=null&&a.decompressMeshes))return;let n=new qr(e),i=[];for(let o of S2e(n))n.getObjectExtension(o,Fd)&&i.push(cFt(n,o,t,r));await Promise.all(i),n.removeExtension(Fd)}function uFt(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])lFt(n,t),r.addRequiredExtension(Fd)}async function cFt(e,t,r,n){let i=e.getObjectExtension(t,Fd);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=$p(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await Do(o,Av,s,n),c=A2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let d=t.attributes[l],p=e.getAccessor(d);p!=null&&p.min&&(p!=null&&p.max)&&(f.min=p.min,f.max=p.max)}t.attributes=c,u.indices&&(t.indices=Nq(u.indices)),e.removeObjectExtension(t,Fd),fFt(t)}function lFt(e,t,r=4,n,i){var l;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let a=n.DracoWriter.encodeSync({attributes:e}),o=(l=i==null?void 0:i.parseSync)==null?void 0:l.call(i,{attributes:e}),s=n._addFauxAttributes(o.attributes),u=n.addBufferView(a);return{primitives:[{attributes:s,mode:r,extensions:{[Fd]:{bufferView:u,attributes:s}}}]}}function fFt(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*S2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var zq={};da(zq,{decode:()=>mFt,name:()=>dFt});var Gq="KHR_texture_transform",dFt=Gq,lD=new ce,pFt=new Rr,hFt=new Rr;async function mFt(e,t){var a;if(!new qr(e).hasExtension(Gq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)gFt(o,e)}function gFt(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&__(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&__(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&__(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&__(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&__(t,e,u,r)}function __(e,t,r,n){let i=vFt(r,n);if(!i)return;let a=e.json.meshes||[];for(let o of a)for(let s of o.primitives){let u=s.material;Number.isFinite(u)&&t===u&&bFt(e,s,i)}}function vFt(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Gq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=_Ft(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function bFt(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:d}=e.buffers[l.buffer],p=(d||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:h,length:b}=Ov(c,l),g=WC[c.componentType],x=HC[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new h(f,p+F*E,2);lD.set(D[0],D[1],1),lD.transformByMatrix3(a),S.set([lD[0],lD[1]],F*x)}n===i?yFt(c,l,e.buffers,S):xFt(i,c,t,e,S)}}}}function yFt(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function xFt(e,t,r,n,i){n.buffers.push({arrayBuffer:i.buffer,byteOffset:0,byteLength:i.buffer.byteLength});let a=n.json.bufferViews;if(!a)return;a.push({buffer:n.buffers.length-1,byteLength:i.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:(a==null?void 0:a.length)-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=o.length-1)}function _Ft(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Rr().set(1,0,0,0,1,0,t[0],t[1],1),a=pFt.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=hFt.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Hq={};da(Hq,{decode:()=>EFt,encode:()=>AFt,name:()=>wFt});var Mh="KHR_lights_punctual",wFt=Mh;async function EFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Mh);n&&(t.json.lights=n.lights,t.removeExtension(Mh));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Mh);a&&(i.light=a.light),t.removeObjectExtension(i,Mh)}}async function AFt(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Mh);Gi(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let i=n.node;t.addObjectExtension(i,Mh,n)}delete t.json.lights}}var Wq={};da(Wq,{decode:()=>TFt,encode:()=>CFt,name:()=>SFt});var w_="KHR_materials_unlit",SFt=w_;async function TFt(e){let t=new qr(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,w_);t.removeExtension(w_)}function CFt(e){let t=new qr(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,w_,{}),t.addExtension(w_))}var Vq={};da(Vq,{decode:()=>FFt,encode:()=>kFt,name:()=>DFt});var E_="KHR_techniques_webgl",DFt=E_;async function FFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(E_);if(n){let i=BFt(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,E_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=OFt(a.technique,t)),t.removeObjectExtension(a,E_)}t.removeExtension(E_)}}async function kFt(e,t){}function BFt(e,t){let{programs:r=[],shaders:n=[],techniques:i=[]}=e,a=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=a.decode(t.getTypedArrayForBufferView(o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),i.forEach(o=>{o.program=r[o.program]}),i}function OFt(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var T2e=[xq,vq,Lq,Mq,qq,Uq,Hq,Wq,Vq,zq,_q];function C2e(e,t={},r){var i;let n=T2e.filter(a=>F2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function D2e(e,t={},r){var i;let n=T2e.filter(a=>F2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function F2e(e,t){var i;let r=((i=t==null?void 0:t.gltf)==null?void 0:i.excludeExtensions)||{};return!(e in r&&!r[e])}var Kq="KHR_binary_glTF";function k2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Kq);i&&Object.assign(n,i),t.removeObjectExtension(n,Kq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Kq)}var B2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},PFt={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},$q=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),k2e(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in B2e)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let i in n){let a=n[i];a.id=a.id||i;let o=t[r].length;t[r].push(a),this.idToIndexMap[r][i]=o}}}_convertObjectIdsToArrayIndices(t){for(let r in B2e)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:i,material:a}=r;for(let o in n)n[o]=this._convertIdToIndex(n[o],"accessor");i&&(r.indices=this._convertIdToIndex(i,"accessor")),a&&(r.material=this._convertIdToIndex(a,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let i in n){let a=n[i],o=this._convertIdToIndex(a,i);n[i]=o}}_convertIdToIndex(t,r){let n=PFt[r];if(n in this.idToIndexMap){let i=this.idToIndexMap[n][t];if(!Number.isFinite(i))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return i}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){var r,n,i;for(let a of t.materials){a.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let o=((r=a.values)==null?void 0:r.tex)||((n=a.values)==null?void 0:n.texture2d_0)||((i=a.values)==null?void 0:i.diffuseTex),s=t.textures.findIndex(u=>u.id===o);s!==-1&&(a.pbrMetallicRoughness.baseColorTexture={index:s})}}};function O2e(e,t={}){return new $q().normalize(e,t)}async function I2e(e,t,r=0,n,i){var a,o,s;return RFt(e,t,r,n),O2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),C2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await jFt(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await LFt(e,n,i),await D2e(e,n,i),e}function RFt(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!_2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=QI(t);else if(t instanceof ArrayBuffer){let o={};r=w2e(o,t,r,n.glb),Gi(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Gi(!1,"GLTF: must be ArrayBuffer or string");let i=e.json.buffers||[];if(e.buffers=new Array(i.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:o}=e._glb;e.buffers[0]={arrayBuffer:o[0].arrayBuffer,byteOffset:o[0].byteOffset,byteLength:o[0].byteLength}}let a=e.json.images||[];e.images=new Array(a.length).fill({})}async function jFt(e,t,r){var i,a;let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:u}=r;Gi(u);let c=Rq(s.uri,t),l=await((i=r==null?void 0:r.fetch)==null?void 0:i.call(r,c)),f=await((a=l==null?void 0:l.arrayBuffer)==null?void 0:a.call(l));e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function LFt(e,t,r){let n=MFt(e),i=e.json.images||[],a=[];for(let o of n)a.push(qFt(e,i[o],o,t,r));return await Promise.all(a)}function MFt(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function qFt(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Rq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=U_e(e.json,e.buffers,t.bufferView);a=$p(s.buffer,s.byteOffset,s.byteLength)}Gi(a,"glTF image has no data");let o=await Do(a,[kv,Lh],{...n,mimeType:t.mimeType,basis:n.basis||{format:Mv()}},i);o&&o[0]&&(o={compressed:!0,mipmaps:!1,width:o[0].width,height:o[0].height,data:o[0]}),e.images=e.images||[],e.images[r]=o}var Ll={name:"glTF",id:"gltf",module:"gltf",version:QC,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:NFt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function NFt(e,t={},r){t={...Ll.options,...t},t.gltf={...Ll.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await I2e({},e,n,t,r)}var UFt=1179937895,GFt=1313821514,zFt=5130562,Tc=!0;function P2e(e,t,r=0,n={}){let{magic:i=UFt,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,Tc),t.setUint32(r+4,a,Tc),t.setUint32(r+8,0,Tc));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,Tc),t.setUint32(r+4,GFt,Tc)),r+=8;let f=JSON.stringify(o);if(r=Pm(t,r,f,4),t){let d=r-l-8;t.setUint32(l+0,d,Tc)}if(s){let d=r;if(t&&(t.setUint32(r+0,0,Tc),t.setUint32(r+4,zFt,Tc)),r+=8,r=NA(t,r,s,4),t){let p=r-d-8;t.setUint32(d+0,p,Tc)}}if(t){let d=r-u;t.setUint32(c,d,Tc)}return r}function Yq(e,t,r,n){return HFt(e),P2e(e,t,r,n)}function HFt(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Jq={name:"glTF",id:"gltf",module:"gltf",version:QC,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,options:{gltf:{}},encode:async(e,t={})=>R2e(e,t),encodeSync:R2e};function R2e(e,t={}){let{byteOffset:r=0}=t,n=Yq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Yq(e,a,r,t),i}var WFt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},VFt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},_s={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},KFt={magFilter:_s.TEXTURE_MAG_FILTER,minFilter:_s.TEXTURE_MIN_FILTER,wrapS:_s.TEXTURE_WRAP_S,wrapT:_s.TEXTURE_WRAP_T},$Ft={[_s.TEXTURE_MAG_FILTER]:_s.LINEAR,[_s.TEXTURE_MIN_FILTER]:_s.NEAREST_MIPMAP_LINEAR,[_s.TEXTURE_WRAP_S]:_s.REPEAT,[_s.TEXTURE_WRAP_T]:_s.REPEAT};function YFt(){return{id:"default-sampler",parameters:$Ft}}function JFt(e){return VFt[e]}function XFt(e){return WFt[e]}var Xq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Gi(n),this.baseUri=o,this.buffers=i,this.images=a,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((i,a)=>this._resolveBufferView(i,a))),t.images&&(n.images=t.images.map((i,a)=>this._resolveImage(i,a))),t.samplers&&(n.samplers=t.samplers.map((i,a)=>this._resolveSampler(i,a))),t.textures&&(n.textures=t.textures.map((i,a)=>this._resolveTexture(i,a))),t.accessors&&(n.accessors=t.accessors.map((i,a)=>this._resolveAccessor(i,a))),t.materials&&(n.materials=t.materials.map((i,a)=>this._resolveMaterial(i,a))),t.meshes&&(n.meshes=t.meshes.map((i,a)=>this._resolveMesh(i,a))),t.nodes&&(n.nodes=t.nodes.map((i,a)=>this._resolveNode(i,a)),n.nodes=n.nodes.map((i,a)=>this._resolveNodeChildren(i))),t.skins&&(n.skins=t.skins.map((i,a)=>this._resolveSkin(i,a))),t.scenes&&(n.scenes=t.scenes.map((i,a)=>this._resolveScene(i,a))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:(t==null?void 0:t.id)||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((i,a)=>{let o=this.getMesh(a);return i.id=o.id,i.primitives=i.primitives.concat(o.primitives),i},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(i=>{let a={...i,attributes:{},indices:void 0,material:void 0},o=i.attributes;for(let s in o)a.attributes[s]=this.getAccessor(o[s]);return i.indices!==void 0&&(a.indices=this.getAccessor(i.indices)),i.material!==void 0&&(a.material=this.getMaterial(i.material)),a})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let i=n.pbrMetallicRoughness;i.baseColorTexture&&(i.baseColorTexture={...i.baseColorTexture},i.baseColorTexture.texture=this.getTexture(i.baseColorTexture.index)),i.metallicRoughnessTexture&&(i.metallicRoughnessTexture={...i.metallicRoughnessTexture},i.metallicRoughnessTexture.texture=this.getTexture(i.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=JFt(t.componentType),i=XFt(t.type),a=n*i,o={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:i,bytesPerElement:a,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(o.bufferView=this.getBufferView(t.bufferView)),o.bufferView){let s=o.bufferView.buffer,{ArrayType:u,byteLength:c}=Ov(o,o.bufferView),l=(o.bufferView.byteOffset||0)+(o.byteOffset||0)+s.byteOffset,f=s.arrayBuffer.slice(l,l+c);o.bufferView.byteStride&&(f=this._getValueFromInterleavedBuffer(s,l,o.bufferView.byteStride,o.bytesPerElement,o.count)),o.value=new u(f)}return o}_getValueFromInterleavedBuffer(t,r,n,i,a){let o=new Uint8Array(a*i);for(let s=0;s<a;s++){let u=r+s*n;o.set(new Uint8Array(t.arrayBuffer.slice(u,u+i)),s*i)}return o.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):YFt(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let i in n){let a=this._enumSamplerParameter(i);a!==void 0&&(n.parameters[a]=n[i])}return n}_enumSamplerParameter(t){return KFt[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},i=this.images[r];return i&&(n.image=i),n}_resolveBufferView(t,r){let n=t.buffer,i=this.buffers[n].arrayBuffer,a=this.buffers[n].byteOffset||0;return t.byteOffset&&(a+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(i,a,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function A_(e,t){return new Xq().postProcess(e,t)}var fD={URI:0,EMBEDDED:1};function dD(e,t,r,n){e.rotateYtoZ=!0;let i=(e.byteOffset||0)+(e.byteLength||0)-r;if(i===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n!=null&&n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=$p(t,r,i),e.gltfByteOffset=0,e.gltfByteLength=i,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function pD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(QFt(e,t,r),i.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:a}=n,o=await a(e.gltfUrl,r);e.gltfArrayBuffer=await o.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let a=await Do(e.gltfArrayBuffer,Ll,r,n);e.gltf=A_(a),e.gpuMemoryUsageInBytes=h_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function QFt(e,t,r){switch(t){case fD.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),a=new TextDecoder().decode(n);e.gltfUrl=a.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case fD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function j2e(e,t,r,n,i){var o;r=ZFt(e,t,r,n,i),await pD(e,fD.EMBEDDED,n,i);let a=(o=e==null?void 0:e.gltf)==null?void 0:o.extensions;return a&&a.CESIUM_RTC&&(e.rtcCenter=a.CESIUM_RTC.center),r}function ZFt(e,t,r,n,i){r=Dd(e,t,r),r=Cv(e,t,r),r=Dv(e,t,r,n),r=dD(e,t,r,n);let a=new Rl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function L2e(e,t,r,n,i){return r=ekt(e,t,r,n,i),await pD(e,e.gltfFormat||0,n,i),r}function ekt(e,t,r,n,i){var c;if(r=Dd(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Cv(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Dv(e,t,r,n),r=dD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Rl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3);let u=new Rh(e.batchTableJson,e.batchTableBinary,s);return tkt(e,o,u,s),r}function tkt(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Rr,l=new gs,f=new ce,d={},p=new Kr,h=[],b=[],g=[],x=[];for(let E=0;E<n;E++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Ht.FLOAT,3,E,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Ht.UNSIGNED_SHORT,3,E,a);let I=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Ht.FLOAT,3);if(!I)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let P=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Ht.FLOAT,3);if(!P)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let U=65535;for(let Y=0;Y<3;Y++)S[Y]=S[Y]/U*P[Y]+I[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),d.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,h),e.normalRight=t.getProperty("NORMAL_RIGHT",Ht.FLOAT,3,E,b);let F=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",Ht.UNSIGNED_SHORT,2,E,h),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Ht.UNSIGNED_SHORT,2,E,b),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(or.WGS84.eastNorthUpToFixedFrame(a,p),p.getRotationMatrix3(c)):c.identity()}F&&(u.copy(o).cross(s).normalize(),c.setColumn(0,o),c.setColumn(1,s),c.setColumn(2,u)),l.fromMatrix3(c),d.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Ht.FLOAT,1,E,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Ht.FLOAT,3,E,h);j&&f.scale(j),d.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(d.rotation);p.identity(),p.translate(d.translation),p.multiplyRight(N),p.scale(d.scale);let C=p.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function M2e(e,t,r,n,i,a){r=Dd(e,t,r);let o=new DataView(t);for(e.tilesLength=o.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let s={shape:"tile3d"};e.tiles.push(s),r=await a(t,r,n,i,s)}return r}async function q2e(e,t,r,n){var i,a;if(e.rotateYtoZ=!0,e.gltfUpAxis=(i=r==null?void 0:r["3d-tiles"])!=null&&i.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",(a=r==null?void 0:r["3d-tiles"])!=null&&a.loadGLTF){if(!n)return t.byteLength;let o=await Do(t,Ll,r,n);e.gltf=A_(o),e.gpuMemoryUsageInBytes=h_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Qq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=s_e(e,t),i.type){case bs.COMPOSITE:return await M2e(i,e,t,r,n,Qq);case bs.BATCHED_3D_MODEL:return await j2e(i,e,t,r,n);case bs.GLTF:return await q2e(i,e,r,n);case bs.INSTANCED_3D_MODEL:return await L2e(i,e,t,r,n);case bs.POINT_CLOUD:return await S_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Zq(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let a=N2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=N2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await hD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let d of c.contentAvailability)await hD(c,d,f,r);else await hD(c,c.contentAvailability,f,r);return await hD(c,c.childSubtreeAvailability,f,r),c}async function hD(e,t,r,n){let i=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof i!="number")return;let a=e.bufferViews[i],o=e.buffers[a.buffer];if(!(n!=null&&n.baseUrl))throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(o.uri){let u=`${(n==null?void 0:n.baseUrl)||""}/${o.uri}`,l=await(await n.fetch(u)).arrayBuffer();t.explicitBitstream=new Uint8Array(l,a.byteOffset,a.byteLength);return}let s=e.buffers.slice(0,a.buffer).reduce((u,c)=>u+c.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(s,s+o.byteLength),a.byteOffset,a.byteLength)}function N2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var mD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Ev,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Zq,options:{}};function eN(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 t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function vu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||eN()}var rkt=globalThis.self||globalThis.window||globalThis.global,Uv=globalThis.window||globalThis.self||globalThis.global,nkt=globalThis.document||{},qh=globalThis.process||{},ikt=globalThis.console,FEr=globalThis.navigator||{};var gD="4.1.0-alpha.7",OEr=vu();function akt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var vD=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=akt(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function U2e(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function G2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function bD(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,i=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let a=e.width*r,o=e.height*r,s=["font-size:1px;","padding:".concat(Math.floor(o/2),"px ").concat(Math.floor(a/2),"px;"),"line-height:".concat(o,"px;"),"background:url(".concat(i,");"),"background-size:".concat(a,"px ").concat(o,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),s]}var yD;(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"})(yD||(yD={}));var okt=10;function z2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),yD[e]||yD.WHITE)}function H2e(e,t,r){if(!vu&&typeof e=="string"){if(t){let n=z2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=z2e(r);e="\x1B[".concat(n+okt,"m").concat(e,"\x1B[49m")}}return e}function W2e(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),i=e;for(let a of n){let o=i[a];typeof o=="function"&&(t.find(s=>a===s)||(i[a]=o.bind(e)))}}function Gv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Nh(){let e;if(vu()&&Uv.performance){var t,r;e=Uv===null||Uv===void 0||(t=Uv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in qh){var n;let i=qh===null||qh===void 0||(n=qh.hrtime)===null||n===void 0?void 0:n.call(qh);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var zv={debug:vu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},skt={enabled:!0,level:0};function ws(){}var V2e={},K2e={once:!0},S_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=gD,this._startTs=Nh(),this._deltaTs=Nh(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new vD("__probe-".concat(this.id,"__"),skt),this.timeStamp("".concat(this.id," started")),W2e(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Nh()-this._startTs).toPrecision(10))}getDelta(){return Number((Nh()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Gv(t,r)}warn(t){return this._getLogFunction(0,t,zv.warn,arguments,K2e)}error(t){return this._getLogFunction(0,t,zv.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,zv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,zv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,zv.debug||zv.info,arguments,K2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ws,n&&[n],{tag:fkt(r)}):ws}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?vu()?lkt({image:i,message:a,scale:o}):ckt({image:i,message:a,scale:o}):ws}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||ws)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=$2e({logLevel:t,message:r,opts:n}),{collapsed:a}=n;return i.method=(a?console.groupCollapsed:console.group)||console.info,this._getLogFunction(i)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||ws)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=Y2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=$2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Gv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Nh();let o=a.tag||a.message;if(a.once&&o)if(!V2e[o])V2e[o]=Nh();else return ws;return r=ukt(this.id,a.message,a),n.bind(console,r,...a.args)}return ws}};S_.VERSION=gD;function Y2e(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Gv(Number.isFinite(t)&&t>=0),t}function $2e(e){let{logLevel:t,message:r}=e;e.logLevel=Y2e(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let i=typeof e.message;return Gv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function ukt(e,t,r){if(typeof t=="string"){let n=r.time?G2e(U2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=H2e(t,r.color,r.background)}return t}function ckt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ws}function lkt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=bD(a,r,n);console.log(...o)},a.src=t,ws}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...bD(t,r,n)),ws;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...bD(a,r,n)),a.src=t.toDataURL(),ws}return ws}function fkt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var tN=new S_({id:"@probe.gl/log"});var Es=null;try{Es=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function kn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}kn.prototype.__isLong__;Object.defineProperty(kn.prototype,"__isLong__",{value:!0});function Ua(e){return(e&&e.__isLong__)===!0}function J2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Ua;var X2e={},Q2e={};function Uh(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=Q2e[e],n)?n:(r=$r(e,0,!0),i&&(Q2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=X2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(X2e[e]=r),r))}kn.fromInt=Uh;function As(e,t){if(isNaN(e))return t?Ml:bu;if(t){if(e<0)return Ml;if(e>=rwe)return awe}else{if(e<=-ewe)return vo;if(e+1>=ewe)return iwe}return e<0?As(-e,t).neg():$r(e%Wv|0,e/Wv|0,t)}kn.fromNumber=As;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var xD=Math.pow;function nN(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?Ml:bu;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return nN(e.substring(1),t,r).neg();for(var i=As(xD(r,8)),a=bu,o=0;o<e.length;o+=8){var s=Math.min(8,e.length-o),u=parseInt(e.substring(o,o+s),r);if(s<8){var c=As(xD(r,s));a=a.mul(c).add(As(u))}else a=a.mul(i),a=a.add(As(u))}return a.unsigned=t,a}kn.fromString=nN;function yu(e,t){return typeof e=="number"?As(e,t):typeof e=="string"?nN(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=yu;var Z2e=1<<16,dkt=1<<24,Wv=Z2e*Z2e,rwe=Wv*Wv,ewe=rwe/2,twe=Uh(dkt),bu=Uh(0);kn.ZERO=bu;var Ml=Uh(0,!0);kn.UZERO=Ml;var Hv=Uh(1);kn.ONE=Hv;var nwe=Uh(1,!0);kn.UONE=nwe;var rN=Uh(-1);kn.NEG_ONE=rN;var iwe=$r(-1,2147483647,!1);kn.MAX_VALUE=iwe;var awe=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=awe;var vo=$r(0,-2147483648,!1);kn.MIN_VALUE=vo;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Wv+(this.low>>>0):this.high*Wv+(this.low>>>0)};Ke.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(vo)){var r=As(t),n=this.div(r),i=n.mul(r).sub(this);return n.toString(t)+i.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var a=As(xD(t,6),this.unsigned),o=this,s="";;){var u=o.div(a),c=o.sub(u.mul(a)).toInt()>>>0,l=c.toString(t);if(o=u,o.isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}};Ke.getHighBits=function(){return this.high};Ke.getHighBitsUnsigned=function(){return this.high>>>0};Ke.getLowBits=function(){return this.low};Ke.getLowBitsUnsigned=function(){return this.low>>>0};Ke.getNumBitsAbs=function(){if(this.isNegative())return this.eq(vo)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};Ke.isZero=function(){return this.high===0&&this.low===0};Ke.eqz=Ke.isZero;Ke.isNegative=function(){return!this.unsigned&&this.high<0};Ke.isPositive=function(){return this.unsigned||this.high>=0};Ke.isOdd=function(){return(this.low&1)===1};Ke.isEven=function(){return(this.low&1)===0};Ke.equals=function(t){return Ua(t)||(t=yu(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};Ke.eq=Ke.equals;Ke.notEquals=function(t){return!this.eq(t)};Ke.neq=Ke.notEquals;Ke.ne=Ke.notEquals;Ke.lessThan=function(t){return this.comp(t)<0};Ke.lt=Ke.lessThan;Ke.lessThanOrEqual=function(t){return this.comp(t)<=0};Ke.lte=Ke.lessThanOrEqual;Ke.le=Ke.lessThanOrEqual;Ke.greaterThan=function(t){return this.comp(t)>0};Ke.gt=Ke.greaterThan;Ke.greaterThanOrEqual=function(t){return this.comp(t)>=0};Ke.gte=Ke.greaterThanOrEqual;Ke.ge=Ke.greaterThanOrEqual;Ke.compare=function(t){if(Ua(t)||(t=yu(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};Ke.comp=Ke.compare;Ke.negate=function(){return!this.unsigned&&this.eq(vo)?vo:this.not().add(Hv)};Ke.neg=Ke.negate;Ke.add=function(t){Ua(t)||(t=yu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,d=0,p=0;return p+=a+c,d+=p>>>16,p&=65535,d+=i+u,f+=d>>>16,d&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(d<<16|p,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Ua(t)||(t=yu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Ua(t)||(t=yu(t)),Es){var r=Es.mul(this.low,this.high,t.low,t.high);return $r(r,Es.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Ml:bu;if(this.eq(vo))return t.isOdd()?vo:bu;if(t.eq(vo))return this.isOdd()?vo:bu;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(twe)&&t.lt(twe))return As(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,d=0,p=0,h=0;return h+=o*l,p+=h>>>16,h&=65535,p+=a*l,d+=p>>>16,p&=65535,p+=o*c,d+=p>>>16,p&=65535,d+=i*l,f+=d>>>16,d&=65535,d+=a*c,f+=d>>>16,d&=65535,d+=o*u,f+=d>>>16,d&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(p<<16|h,f<<16|d,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Ua(t)||(t=yu(t)),t.isZero())throw Error("division by zero");if(Es){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Es.div_u:Es.div_s)(this.low,this.high,t.low,t.high);return $r(r,Es.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Ml:bu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Ml;if(t.gt(this.shru(1)))return nwe;a=Ml}else{if(this.eq(vo)){if(t.eq(Hv)||t.eq(rN))return vo;if(t.eq(vo))return Hv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(bu)?t.isNegative()?Hv:rN:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(vo))return this.unsigned?Ml:bu;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=bu}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:xD(2,s-48),c=As(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=As(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Hv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Ua(t)||(t=yu(t)),Es){var r=(this.unsigned?Es.rem_u:Es.rem_s)(this.low,this.high,t.low,t.high);return $r(r,Es.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return $r(~this.low,~this.high,this.unsigned)};Ke.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};Ke.clz=Ke.countLeadingZeros;Ke.countTrailingZeros=function(){return this.low?J2e(this.low):J2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Ua(t)||(t=yu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Ua(t)||(t=yu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Ua(t)||(t=yu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):$r(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):$r(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?$r(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?$r(this.high,0,this.unsigned):$r(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,$r(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};Ke.rotl=Ke.rotateLeft;Ke.rotateRight=function(t){var r;return Ua(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?$r(this.high,this.low,this.unsigned):t<32?(r=32-t,$r(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,$r(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?$r(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:$r(this.low,this.high,!0)};Ke.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};Ke.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};Ke.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};kn.fromBytes=function(t,r,n){return n?kn.fromBytesLE(t,r):kn.fromBytesBE(t,r)};kn.fromBytesLE=function(t,r){return new kn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};kn.fromBytesBE=function(t,r){return new kn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var Vv=kn;var pkt=16;function T_(e){e==="X"&&(e="");let t=e.padEnd(pkt,"0");return Vv.fromString(t,!0,16)}function iN(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let a=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-a.length).join("0")+a}function aN(e,t){let r=hkt(e).shiftRightUnsigned(2);return e.add(Vv.fromNumber(2*t+1-4).multiply(r))}function hkt(e){return e.and(e.not().add(1))}var mkt=3,gkt=30,vkt=2*gkt+1,owe=180/Math.PI;function uwe(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],i=n.length,a=0,o=[0,0];for(let s=i-1;s>=0;s--){a=i-s;let u=n[s],c=0,l=0;u==="1"?l=1:u==="2"?(c=1,l=1):u==="3"&&(c=1);let f=Math.pow(2,a-1);bkt(f,o,c,l),o[0]+=f*c,o[1]+=f*l}if(r%2===1){let s=o[0];o[0]=o[1],o[1]=s}return{face:r,ij:o,level:a}}function cwe(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<mkt+vkt;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=Vv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Vv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function oN(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function swe(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function sN(e){return[swe(e[0]),swe(e[1])]}function uN(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function cN([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*owe,n*owe]}function bkt(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let i=t[0];t[0]=t[1],t[1]=i}}function lwe(e){let t=oN(e.ij,e.level,[.5,.5]),r=sN(t),n=uN(e.face,r);return cN(n)}var ykt=100;function lN(e){let{face:t,ij:r,level:n}=e,i=[[0,0],[0,1],[1,1],[1,0],[0,0]],a=Math.max(1,Math.ceil(ykt*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],d=(f[0]-l[0])/a,p=(f[1]-l[1])/a;for(let h=0;h<a;h++){l[0]+=d,l[1]+=p;let b=oN(r,n,l),g=sN(b),x=uN(t,g),E=cN(x);Math.abs(E[1])>89.999&&(E[0]=u);let S=E[0]-u;E[0]+=S>180?-360:S<-180?360:0,o[s++]=E[0],o[s++]=E[1],u=E[0]}}return o[s++]=o[0],o[s++]=o[1],o}function Kv(e){let t=xkt(e);return uwe(t)}function xkt(e){if(e.indexOf("/")>0)return e;let t=T_(e);return cwe(t)}function fN(e){let t=Kv(e);return lwe(t)}function dwe(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let i=0;i<4;i++){let a=`${e.face}/${i}`,o=Kv(a),s=lN(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=fwe(r)}else{let r=lN(e);t=fwe(r)}return t}function fwe(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,i)=>n-i),r.sort((n,i)=>n-i),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function dN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=Kv(e),a=dwe(i),o=a.west,s=a.south,u=a.east,c=a.north,l=[];return l.push(new ce(o,c,r)),l.push(new ce(u,c,r)),l.push(new ce(u,s,r)),l.push(new ce(o,s,r)),l.push(new ce(o,c,n)),l.push(new ce(u,c,n)),l.push(new ce(u,s,n)),l.push(new ce(o,s,n)),l}function _D(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=dN(t,r),i=fN(t),a=i[0],o=i[1],s=or.WGS84.cartographicToCartesian([a,o,r.maximumHeight]),u=new ce(s[0],s[1],s[2]);n.push(u);let c=c_(n);return[...c.center,...c.halfAxes]}var _kt=4,wkt=8,Ekt={QUADTREE:_kt,OCTREE:wkt};function Akt(e,t,r){if(e!=null&&e.box){let n=T_(e.s2VolumeInfo.token),i=aN(n,t),a=iN(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,d=c.minimumHeight+l/2;c.minimumHeight=d-f,c.maximumHeight=d+f;break;default:break}return{box:_D(o),s2VolumeInfo:o}}}async function hN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:i,loaderOptions:a}=e,{subtree:o,level:s=0,globalData:u={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:d,subtreesUriTemplate:p,basePath:h}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return tN.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${d} won't be loaded...`),b;let g=s+u.level;if(g>f)return b;let x=Ekt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**s-1)/(x-1),k=Gh(r.mortonIndex,n,E),N=j+k,C=Gh(r.x,S,1),I=Gh(r.y,F,1),P=Gh(r.z,D,1),U=!1;s>=l&&(U=pN(o.childSubtreeAvailability,k));let Y=Gh(u.x,C,s),J=Gh(u.y,I,s),re=Gh(u.z,P,s);if(U){let Te=`${h}/${p}`,$e=wD(Te,g,Y,J,re);o=await An($e,mD,a),u={mortonIndex:k,x:C,y:I,z:P,level:s},k=0,N=0,C=0,I=0,P=0,s=0}if(!pN(o.tileAvailability,N))return b;pN(o.contentAvailability,N)&&(b.contentUrl=wD(d,g,Y,J,re));let ye=s+1,pe={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=Akt(i,Te,c),We=await hN({subtree:o,implicitOptions:t,loaderOptions:a,parentData:pe,childIndex:Te,level:ye,globalData:{...u},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=Skt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,i);b.children.push(ne)}}return b}function pN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&tN.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?Dkt(t,r.explicitBitstream):!1}function Skt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,d=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),p=l/2**t,h=i!=null&&i.box?{box:i.box}:f,b=Tkt(t,h,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:p,geometricError:p,transform:e.transform,boundingVolume:b}}function Tkt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,d=2**e,p=(u-o)/d,h=(c-s)/d,b=(f-l)/d,[g,x]=[o+p*n,o+p*(n+1)],[E,S]=[s+h*i,s+h*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,E,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Gh(e,t,r){return(e<<r)+t}function wD(e,t,r,n,i){let a=Ckt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function Ckt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function Dkt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function gN(e,t=""){if(!t)return"empty";let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return"pointcloud";case"i3dm":case"b3dm":case"glb":case"gltf":return"scenegraph";default:return n||"empty"}}function vN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function mN(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return nu.resolve(t,e)}function pwe(e,t){var i;if(!e)return null;let r;if(e.content){let a=e.content.uri||((i=e.content)==null?void 0:i.url);typeof a<"u"&&(r=mN(a,t))}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:gN(e,r),refine:vN(e.refine)}}async function gwe(e,t,r){let n=null,i=mwe(e.root);i&&e.root?n=await hwe(e.root,e,t,i,r):n=pwe(e.root,t);let a=[];for(a.push(n);a.length>0;){let o=a.pop()||{},s=o.children||[],u=[];for(let c of s){let l=mwe(c),f;l?f=await hwe(c,e,t,l,r):f=pwe(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function hwe(e,t,r,n,i){var F,D,j;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=wD(c,0,0,0,0),f=mN(l,r),d=await An(f,mD,i),p=(F=e.content)==null?void 0:F.uri,h=p?mN(p,r):"",b=(D=t==null?void 0:t.root)==null?void 0:D.refine,g=e.geometricError,x=(j=e.boundingVolume.extensions)==null?void 0:j["3DTILES_bounding_volume_S2"];if(x){let N={box:_D(x),s2VolumeInfo:x};e.boundingVolume=N}let E=e.boundingVolume,S={contentUrlTemplate:h,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:b,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:g,rootBoundingVolume:E,getTileType:gN,getRefine:vN};return await Fkt(e,r,d,S,i)}async function Fkt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await hN({subtree:r,implicitOptions:n,loaderOptions:i}),s,u=null;return o&&(s=o,u={uri:o.replace(`${t}/`,"")}),{...e,id:s,contentUrl:s,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:gN(e,s),refine:vN(e.refine),content:u||e.content,children:a}}function mwe(e){var t;return((t=e==null?void 0:e.extensions)==null?void 0:t["3DTILES_implicit_tiling"])||(e==null?void 0:e.implicitTiling)}var Cc={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Ev,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:kkt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function kkt(e,t={},r){let n=t["3d-tiles"]||{},i;return n.isTileset==="auto"?i=(r==null?void 0:r.url)&&r.url.indexOf(".json")!==-1:i=n.isTileset,i?Bkt(e,t,r):Okt(e,t,r)}async function Bkt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=Ikt(i),o=await gwe(n,a,t||{});return{...n,shape:"tileset3d",loader:Cc,url:i,queryString:(r==null?void 0:r.queryString)||"",basePath:a,root:o||n.root,type:"TILES3D",lodMetricType:"geometricError",lodMetricValue:((u=n.root)==null?void 0:u.geometricError)||0}}async function Okt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Qq(e,0,t,r,n.content),n.content}function Ikt(e){return nu.dirname(e)}var vwe="https://api.cesium.com/v1/assets";async function bwe(e,t){if(!t){let a=await Pkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await Rkt(e,t),{type:n,url:i}=r;return Qt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function Pkt(e){Qt(e);let t=vwe,r={Authorization:`Bearer ${e}`},n=await Oo(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function Rkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${vwe}/${t}`,i=await Oo(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await Oo(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function jkt(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let i=e.match(/\/([0-9]+)\/tileset.json/);n=i&&i[1]}return bwe(r,n)}var ED={...Cc,id:"cesium-ion",name:"Cesium Ion",preload:jkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=ED,Cc.parse(e,t,r)),options:{"cesium-ion":{...Cc.options["3d-tiles"],accessToken:null}}};var TTe=Wt(iG(),1),rPt="4.1.0-alpha.7",aG={id:"zip",module:"zip",name:"Zip Archive",version:rPt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:nPt};async function nPt(e,t={}){let r=[],n={};try{let i=new TTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=iPt(i,u,t).then(l=>{n[o]=l});r.push(c)}),await Promise.all(r),n}catch(i){throw t.log.error(`Unable to read zip archive: ${i}`),i}}async function iPt(e,t,r={}){try{return await e.file(t).async(r.dataType||"arraybuffer")}catch(n){return r.log.error(`Unable to read ${t} from zip archive: ${n}`),n}}var c2=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let i=e.length-4n;i>-1;i--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(i),r.every((a,o)=>a===t[o])){n=i;break}return n};var aPt=new Uint8Array([1,0]);function h4(e){let t={...e,zip64Length:(e.offset?1:0)*8+(e.size?1:0)*16},r=[];for(let n of oPt){if(!t[n.name??""]&&!n.default)continue;let i=new DataView(new ArrayBuffer(n.size));CTe[n.size](i,0,t[n.name??""]??n.default),r.push(i.buffer)}return Di(...r)}function yo(e,t,r,n){CTe[t](e,Number(r),n)}var CTe={2:(e,t,r)=>{e.setUint16(t,Number(r),!0)},4:(e,t,r)=>{e.setUint32(t,Number(r),!0)},8:(e,t,r)=>{e.setBigUint64(t,BigInt(r),!0)}},oPt=[{size:2,default:new DataView(aPt.buffer).getUint16(0,!0)},{size:2,name:"zip64Length"},{size:8,name:"size"},{size:8,name:"size"},{size:8,name:"offset"}];var sPt=new Uint8Array([80,75,5,6]),uPt=new Uint8Array([80,75,6,7]),cPt=new Uint8Array([80,75,6,6]),DTe=8n,lPt=10n,fPt=12n,FTe=16n,kTe=8n,BTe=24n,dPt=32n,pPt=40n,OTe=48n,m4=async e=>{let t=await c2(e,sPt),r=BigInt(await e.getUint16(t+DTe)),n=BigInt(await e.getUint32(t+FTe)),i=t-20n,a=0n,o=await e.slice(i,i+4n);if(ic(o,uPt)){a=await e.getBigUint64(i+kTe);let s=await e.slice(a,a+4n);if(!ic(s,cPt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(a+BTe),n=await e.getBigUint64(a+OTe)}else i=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:a,zip64EoCDLocatorOffset:i,zipEoCDOffset:t}}};async function ITe(e,t,r,n,i){let a=new DataView(e),o=t.zip64EoCDOffset?t.zipEoCDOffset-t.zip64EoCDOffset:0n;if(Number(i)<=65535&&(yo(a,2,o+DTe,i),yo(a,2,o+lPt,i)),n-r<=4294967295&&yo(a,4,o+fPt,n-r),r<4294967295&&yo(a,4,o+FTe,r),t.zip64EoCDLocatorOffset&&t.zip64EoCDOffset){let s=t.zip64EoCDLocatorOffset-t.zip64EoCDOffset;yo(a,8,s+kTe,n),yo(a,8,OTe,r),yo(a,8,BTe,i),yo(a,8,dPt,i),yo(a,8,pPt,n-r)}return new Uint8Array(a.buffer)}var hPt=20n,mPt=24n,gPt=28n,vPt=30n,bPt=32n,yPt=42n,g4=46n,f2=new Uint8Array([80,75,1,2]),l2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ic(r,f2.buffer))return null;let n=BigInt(await t.getUint32(e+hPt)),i=BigInt(await t.getUint32(e+mPt)),a=await t.getUint16(e+vPt),o=BigInt(await t.getUint16(e+bPt)),s=await t.getUint16(e+gPt),u=await t.slice(e+g4,e+g4+BigInt(s)),c=new TextDecoder().decode(u),l=e+g4+BigInt(s),f=await t.getUint32(e+yPt),d=BigInt(f),p=new DataView(await t.slice(l,l+BigInt(a))),h={uncompressedSize:i,compressedSize:n,localHeaderOffset:d,startDisk:o},b=xPt(h,p);return{...h,...b,extraFieldLength:a,fileNameLength:s,fileName:c,extraOffset:l}};async function*yb(e){let{cdStartOffset:t}=await m4(e),r=await l2(t,e);for(;r;)yield r,r=await l2(r.extraOffset+BigInt(r.extraFieldLength),e)}var PTe=(...e)=>e[0]+e[1]*16,xPt=(e,t)=>{let r=_Pt(e),n={};if(r.length>0){let i=r.reduce((s,u)=>s+u.length,0),a=new Uint8Array(t.buffer).findIndex((s,u,c)=>PTe(c[u],c[u+1])===1&&PTe(c[u+2],c[u+3])===i),o=0;for(let s of r){let u=o;n[s.name]=t.getBigUint64(a+4+u,!0),o=u+s.length}}return n},_Pt=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};function oG(e){let t={...e,fnlength:e.fileName.length,extraLength:0},r=new ArrayBuffer(0),n={};t.offset>=4294967295&&(n.offset=t.offset,t.offset=BigInt(4294967295)),t.length>=4294967295&&(n.size=t.length,t.length=4294967295),Object.keys(n).length&&(r=h4(n),t.extraLength=r.byteLength);let i=new DataView(new ArrayBuffer(Number(g4)));for(let s of wPt)yo(i,s.size,s.offset,t[s.name??""]??s.default??0);let a=new TextEncoder().encode(t.fileName);return Di(i.buffer,a,r)}var wPt=[{offset:0,size:4,default:new DataView(f2.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var EPt=8n,APt=18n,SPt=22n,TPt=26n,CPt=28n,d2=30n,sG=new Uint8Array([80,75,3,4]),n0=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ic(r,sG))return null;let n=await t.getUint16(e+TPt),i=new TextDecoder().decode(await t.slice(e+d2,e+d2+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+CPt),o=e+d2+BigInt(n+a),s=await t.getUint16(e+EPt),u=BigInt(await t.getUint32(e+APt)),c=BigInt(await t.getUint32(e+SPt)),l=e+d2+BigInt(n),f=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(l+f),f+=8n),u===BigInt(4294967295)&&(u=await t.getBigUint64(l+f),f+=8n),o===BigInt(4294967295)&&(o=await t.getBigUint64(l+f)),{fileNameLength:n,fileName:i,extraFieldLength:a,fileDataOffset:o,compressedSize:u,compressionMethod:s}};function uG(e){let t={...e,extraLength:0,fnlength:e.fileName.length},r=new ArrayBuffer(0),n={};t.length>=4294967295&&(n.size=t.length,t.length=4294967295),Object.keys(n).length&&(r=h4(n),t.extraLength=r.byteLength);let i=new DataView(new ArrayBuffer(Number(d2)));for(let s of DPt)yo(i,s.size,s.offset,t[s.name??""]??s.default??0);let a=new TextEncoder().encode(t.fileName);return Di(i.buffer,a,r)}var DPt=[{offset:0,size:4,default:new DataView(sG.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];async function FPt(e){let t=await m4(e),r=t.cdStartOffset,n=Number(t.offsets.zip64EoCDOffset?t.offsets.zip64EoCDOffset-r:t.offsets.zipEoCDOffset-r),i=await e.slice(r,e.length);await e.truncate(Number(r));let a=i.slice(0,n),o=i.slice(n,i.byteLength);return[a,o,t]}async function kPt(e,t,r){let n=parseInt(await new qx().hash(t,"hex"),16),i=uG({crc32:n,fileName:e,length:t.byteLength}),a=oG({crc32:n,fileName:e,offset:r,length:t.byteLength});return[new Uint8Array(Di(i,t)),new Uint8Array(a)]}async function p2(e,t,r){let n=new iu(e,!0),[i,a,o]=await FPt(n),s=n.length,[u,c]=await kPt(r,t,s);await n.append(u);let l=Di(i,c),f=n.length;await n.append(new Uint8Array(l));let d=n.length;await n.append(await ITe(a,o.offsets,f,d,o.cdRecordsNumber+1n))}function cG(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let i=t.getBigUint64(n+16,!0),a=BPt(e,n,16);r[a]=i}return r}function BPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function RTe(e){let t=yb(e),r=new Qp,n=new TextEncoder,i={};for await(let a of t){let o=a.fileName.split("\\").join("/").toLocaleLowerCase(),s=n.encode(o).buffer,u=await r.hash(s,"hex");i[u]=a.localHeaderOffset}return i}async function h2(e){let t=await RTe(e),r=Object.entries(t).map(([n,i])=>Di(IPt(n),PPt(i))).sort(OPt);return Di(...r)}function OPt(e,t){let r=new BigUint64Array(e),n=new BigUint64Array(t);return Number(r[0]===n[0]?r[1]-n[1]:r[0]-n[0])}function IPt(e){var r;let t=(r=e.match(/../g))==null?void 0:r.map(n=>parseInt(n,16));return new Uint8Array(t??new Array(16)).buffer}function PPt(e){return new BigUint64Array([e]).buffer}var xb=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Yp(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var m2=class extends xb{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var i0=Wt(WU(),1),Yl=Wt(require("zlib"),1);var a0=class extends xb{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Rm(Yl.default.gzip)(t):await Rm(Yl.default.deflate)(t);return pl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!gn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Rm(Yl.default.gunzip)(t):await Rm(Yl.default.inflate)(t);return pl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Yl.default.gzipSync(t):Yl.default.deflateSync(t);return pl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?i0.default.deflateRaw:i0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!gn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Yl.default.gunzipSync(t):Yl.default.inflateSync(t);return pl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?i0.default.inflateRaw:i0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new i0.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new i0.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let o of r){let s=new Uint8Array(o);if(!t.push(s,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),i=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var RPt={0:async e=>e,8:async e=>await new a0({raw:!0}).decompress(e)},g2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new iu(t);else throw new Error("Cannot open file for random access in a WEB browser");else aP(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=yb(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=await this.getCDFileHeader(t),n=await n0(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=RPt[n.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(n.fileDataOffset,n.fileDataOffset+n.compressedSize),o=await i(a),s=new Response(o);return Object.defineProperty(s,"url",{value:`${this.fileName||""}/${t}`}),s}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=yb(this.fileProvider),n=null;for await(let i of r)if(i.fileName===t){n=i;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var jPt={0:e=>new m2().decompress(e),8:e=>new a0({raw:!0}).decompress(e)},v4=class{fileProvider;hashTable;constructor(t,r){this.fileProvider=t,this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r=new TextEncoder().encode(t).buffer,n=await new Qp().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await n0(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=jPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var v2=class extends g2{hashTable;constructor(t){super(t)}async fetch(t){let r=this.fileProvider;if(!r)throw new Error("No data detected in the zip archive");if(await this.parseHashTable(),this.hashTable){let i=await new v4(r,this.hashTable).getFile(t),a=new Response(i);return Object.defineProperty(a,"url",{value:`${this.fileName||""}/${t}`}),a}return super.fetch(t)}async parseHashTable(){if(this.hashTable!==void 0)return;let t=this.fileProvider;if(!t)throw new Error("No data detected in the zip archive");let r=await c2(t,f2),n=await l2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await n0(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=cG(o)}else this.hashTable=null}};function Ud(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Qt(Array.isArray(i)&&Number.isFinite(a)&&Number.isFinite(o)),t.setUint8(r+0,i[0]),t.setUint8(r+1,i[1]),t.setUint8(r+2,i[2]),t.setUint8(r+3,i[3]),t.setUint32(r+4,a,!0),t.setUint32(r+8,o,!0),r+=12,r}function Gd(e,t,r){e&&e.setUint32(t+8,r,!0)}function jTe(e,t,r,n,i){e={magic:Td.COMPOSITE,tiles:[],...e};let a=r;r+=Ud(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let o=0;o<e.tiles.length;++o)r+=i(e.tiles[o],t,r,n);return Gd(t,a,r-a),r}function LTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=ko(s.length,8),l=u?ko(u.length,8):0;e={magic:Td.BATCHED_MODEL,...e};let f=r;r=Ud(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,l,!0),t.setUint32(24,0,!0)),r+=16,r=Pm(t,r,s,8),a&&(r=Pm(t,r,u,8));let d=e.gltfEncoded;return d&&(r=jx(t,r,d,d.byteLength)),Gd(t,f,r-f),r}function MTe(e,t,r,n){let{featuresLength:i=1,gltfFormat:a=1,gltfUri:o=""}=e,s=o.length,u={INSTANCES_LENGTH:i,POSITION:new Array(i*3).fill(0)},c=JSON.stringify(u),l=c.length;e={magic:Td.INSTANCED_MODEL,...e};let f=r;return r=Ud(e,t,0),t&&(t.setUint32(12,l,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,a,!0)),r+=20,r+=Im(t,r,c,l),r+=Im(t,r,o,s),Gd(t,f,r-f),r}var LPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function qTe(e,t,r,n){let{featureTableJson:i=LPt}=e,a=JSON.stringify(i);a=eP(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:Td.POINT_CLOUD,...e};let c=r;return r+=Ud(e,t,0),t&&(t.setUint32(r+0,o,!0),t.setUint32(r+4,u,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=Im(t,r,a,o),r+=jx(t,r,s,u),Gd(t,c,r-c),r}function fG(e,t){let r=lG(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return lG(e,i,0,t),n}function lG(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case bs.COMPOSITE:return jTe(e,t,r,n,lG);case bs.POINT_CLOUD:return qTe(e,t,r,n);case bs.BATCHED_3D_MODEL:return LTe(e,t,r,n);case bs.INSTANCED_3D_MODEL:return MTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var dG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Ev,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>NTe(e,t),encodeSync:NTe};function NTe(e,t){return fG(e,t)}var za=require("path");var UTe=Wt(require("crypto")),y4=new Uint8Array(256),b4=y4.length;function pG(){return b4>y4.length-16&&(UTe.default.randomFillSync(y4),b4=0),y4.slice(b4,b4+=16)}var Sa=[];for(let e=0;e<256;++e)Sa.push((e+256).toString(16).slice(1));function GTe(e,t=0){return(Sa[e[t+0]]+Sa[e[t+1]]+Sa[e[t+2]]+Sa[e[t+3]]+"-"+Sa[e[t+4]]+Sa[e[t+5]]+"-"+Sa[e[t+6]]+Sa[e[t+7]]+"-"+Sa[e[t+8]]+Sa[e[t+9]]+"-"+Sa[e[t+10]]+Sa[e[t+11]]+Sa[e[t+12]]+Sa[e[t+13]]+Sa[e[t+14]]+Sa[e[t+15]]).toLowerCase()}var zTe=Wt(require("crypto")),hG={randomUUID:zTe.default.randomUUID};function MPt(e,t,r){if(hG.randomUUID&&!t&&!e)return hG.randomUUID();e=e||{};let n=e.random||(e.rng||pG)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){r=r||0;for(let i=0;i<16;++i)t[r+i]=n[i];return t}return GTe(n)}var Rc=MPt;var B0=Wt(require("process"),1),hk=Wt(Su(),1),aV=Wt(bG(),1);var ty=require("path"),zke=Wt(Su(),1);var e6e=()=>({folderPattern:{path:"folderPattern",default:"BASIC"},archiveCompressionType:{path:"archiveCompressionType",default:"STORE"},resourceCompressionType:{path:"resourceCompressionType",default:"GZIP"},I3SVersion:{path:"I3SVersion",default:"1.8"},nodeCount:{path:"nodeCount"}});var Zb=require("fs"),ey=require("path");var qke=require("zlib"),Nke=require("path"),gw=require("fs"),lKt=Wt(Mke(),1);var fKt=Wt(iG(),1);var dKt=Wt(mG(),1);function nk(e){let t=`${e}.gz`,r=(0,qke.createGzip)(),n=(0,gw.createReadStream)(e),i=(0,gw.createWriteStream)(t);return new Promise((a,o)=>{n.on("end",()=>{console.log(`${t} compressed and saved.`),a(t)}),n.on("error",s=>{console.log(`${t}: compression error!`),o(s)}),n.pipe(r).pipe(i)})}async function Uke(e,t,r,n,i){process.platform==="win32"?await hKt(e,t,r,n,i):await pKt(e,t,r,n)}async function pKt(e,t,r=0,n="."){let i=vw(t),a=[`-${r}`,"-r",i,n];await new dl().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function hKt(e,t,r=0,n=(0,Nke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=vw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new dl().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Bi(e,t,r="index.json"){let n;t instanceof Promise?n=new Uint8Array(await t):t instanceof ArrayBuffer?n=new Uint8Array(t):n=t,await Zb.promises.mkdir(e,{recursive:!0});let i=(0,ey.join)(e,r);try{await Zb.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function Gc(e,t,r="index.json",n=!0,i){let a=await Bi(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await nk(a);return await WW(a),o}}return a}async function ik(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,ey.join)(e,t);An(o,nP).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function Gke(e){try{return await Zb.promises.stat(e),!0}catch{return!1}}function bw(e){return Zb.promises.rm(e,{recursive:!0})}function WW(e){return Zb.promises.unlink(e)}function vw(e){return(0,ey.isAbsolute)(e)?e:(0,ey.join)(process.cwd(),e)}var to=class{nodesPerPage;nodesCounter;writeFile;converter;nodePages;length=0;constructor(t,r,n){this.nodesPerPage=r,this.nodesCounter=0,this.nodePages=[{}],this.nodePages[0].nodes=[],this.writeFile=t,this.converter=n,this.length=0}useWriteFunction(t){this.writeFile=t}getNodePageFileName(t){let r,n;return this.converter.options.slpk?(r=(0,ty.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,ty.join)(this.converter.layers0Path,"nodepages",t.toString()),n="index.json"),{filePath:r,fileName:n}}async loadNodePage(t){let{filePath:r,fileName:n}=this.getNodePageFileName(t),i=(0,ty.join)(r,n);return await Gke(i)?(console.log(`load ${i}.`),await ik(r,n)):{nodes:[]}}getPageIndexByNodeId(t){return Math.floor(t/this.nodesPerPage)}async getPageByNodeId(t){let r=this.getPageIndexByNodeId(t);return this.converter.options.instantNodeWriting?await this.loadNodePage(r):this.nodePages[r]}async getNodeById(t,r){let n=t%this.nodesPerPage;return r=r||await this.getPageByNodeId(t),r.nodes[n]}async addChildRelation(t,r){var i;if(t==null)return;let n=await this.getNodeById(t);(i=n.children)==null||i.push(r),await this.saveNode(n)}async push(t,r){if(t.index=this.nodesCounter++,!this.converter.options.instantNodeWriting){let n=this.nodePages[this.nodePages.length-1];n.nodes.length===this.nodesPerPage&&(n={nodes:[]},this.nodePages.push(n)),n.nodes.push(t)}return await this.addChildRelation(r,t.index),to.updateResourceInMesh(t),await this.saveNode(t),t}async saveNode(t){if(this.converter.options.instantNodeWriting){let r=this.getPageIndexByNodeId(t.index),n=await this.getPageByNodeId(t.index),{filePath:i,fileName:a}=this.getNodePageFileName(r),o=await this.getNodeById(t.index,n);o?to.updateAll(o,t):n.nodes.push(t);let s=JSON.stringify(n);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${r.toString()}.json.gz`,writePromise:()=>this.writeFile(i,s,a,!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,s)},!0)}else return}async saveMetadata(){let t=(0,zke.default)({nodeCount:this.nodesCounter},e6e()),r=!1;await this.converter.writeQueue.enqueue({archiveKey:"metadata.json",writePromise:()=>this.writeFile(this.converter.layers0Path,JSON.stringify(t),"metadata.json",r)})}async save(){if(this.converter.options.instantNodeWriting){await this.saveMetadata();return}if(this.converter.options.slpk){for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,ty.join)(this.converter.layers0Path,"nodepages");await this.converter.writeQueue.enqueue({archiveKey:`nodePages/${t.toString()}.json.gz`,writePromise:()=>this.writeFile(i,n,`${t.toString()}.json`)})}await this.saveMetadata()}else for(let[t,r]of this.nodePages.entries()){let n=JSON.stringify(r),i=(0,ty.join)(this.converter.layers0Path,"nodepages",t.toString());await this.converter.writeQueue.enqueue({writePromise:()=>this.writeFile(i,n)})}}static updateResourceInMesh(t){t.mesh&&isFinite(t.index)&&(t.mesh.geometry.resource=t.index)}static updateAll(t,r){return Object.assign(t,r,{index:t.index}),to.updateResourceInMesh(t),t}static updateMaterialByNodeId(t,r){t.mesh&&(t.mesh.material={definition:r,resource:t.index})}static updateVertexCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.vertexCount=r)}static updateNodeAttributeByNodeId(t){!t.mesh||!t.index||(t.mesh.attribute.resource=t.index)}static updateFeatureCountByNodeId(t,r){t.mesh&&(t.mesh.geometry.featureCount=r)}static updateTexelCountHintByNodeId(t,r){!t.mesh||!t.mesh.material||(t.mesh.material.texelCountHint=r)}};var yw=require("path"),ak=require("fs");function ry(e){if(typeof e=="number"){let r=Math.floor(e/1e3),n=e-r*1e3;return Hke(r,n)}else{let r=e[0],n=e[1]/1e6;return Hke(r,n)}}function Hke(e,t){let r=Math.floor(e/3600);e=e-r*3600;let n=Math.floor(e/60);e=e-n*60;let i=Math.floor(e),a="";return r&&(a+=`${r}h `),n&&(a+=`${n}m `),i&&(a+=`${i}s`),a||(a+=`${t}ms`),a}async function ok(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=vw(r);try{if(t){let s=(0,yw.join)(i,`${n}.slpk`);return(await ak.promises.stat(s)).size}let a=(0,yw.join)(i,n);return await Wke(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function Wke(e){let t=0,r=await ak.promises.readdir(e);for(let n of r){let i=await ak.promises.stat((0,yw.join)(e,n));i.isDirectory()?t+=await Wke((0,yw.join)(e,n)):t+=i.size}return t}var cBe=Wt(bG(),1);var k0=3,ny=9;function Kke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/ny;if(!o.length)return{faceRange:new Uint32Array([0,s-1]),featureIds:[0],featureCount:1,positions:t,normals:r,texCoords:n,colors:i,uvRegions:a};let u=mKt(o),c=gKt({...u,...e}),l=vKt(c);return bKt(l,u.featureCount)}function mKt(e){let t=1,r=1,n=Vke(e.slice(0,k0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=k0;c<e.length;c+=k0){let l=Vke(e.slice(c,c+k0));n!==l&&(i[t]=c/k0-1,i[t+1]=c/k0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/k0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Vke(e){let t={},r=e[0],n=1;for(let i of e)t[i]=(t[i]||0)+1,n=n>t[i]?n:t[i],r=n>t[i]?r:i;return r}function gKt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),d=new Float32Array(o),p=new Uint16Array(a),h=0,b=0,g=0,x=0,E=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=xw("positions",F,D),k=xw("normals",F,D),N=xw("colors",F,D),C=xw("uvRegions",F,D),I=xw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(h,h+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:p.subarray(x,x+C),texCoords:d.subarray(E,E+I)}),h+=j,b+=k,g+=N,x+=C,E+=I}return u}function xw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*ny;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function vKt(e){let t=[];for(let n of e){let i=t.find(a=>a.featureId===n.featureId);i?i.attributes.push(n):t.push({featureId:n.featureId,attributes:[n]})}let r=[];for(let n of t){let i=$ke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function bKt(e,t){let n=[e[0].featureId||0],i=[0],a=0,o=0;for(let c=1;c<e.length;c++){let l=e[c];n.push(l.featureId||0);let f=e[a];i.push(f.positions.length/ny-1+o),i.push(f.positions.length/ny+o),o+=f.positions.length/ny,a+=1}let s=$ke(e);return i.push(s.positions.length/ny-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function $ke(e){let t=e.map(({positions:f})=>f),r=t.length>1?Fo(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?Fo(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?Fo(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?Fo(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?Fo(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function VW(e,t){let r,n,i,a=or.WGS84.cartesianToCartographic(e.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),e instanceof ua?(n=e.halfSize,r=new ce(n[0],n[1],n[2]).len(),i=e.quaternion):(r=e.radius,n=[r,r,r],i=new gs().fromMatrix3(new Rr([n[0],0,0,0,n[1],0,0,0,n[2]])).normalize()),{mbs:[a[0],a[1],a[2],r],obb:{center:[a[0],a[1],a[2]],halfSize:n,quaternion:i}}}function Yke(e,t){let r=yKt(e),n=c_(r),i=J7(r),a=or.WGS84.cartesianToCartographic(i.center,new ce),o=or.WGS84.cartesianToCartographic(n.center,new ce);return a[2]=a[2]-t.getHeight(a[1],a[0]),o[2]=o[2]-t.getHeight(o[1],o[0]),{mbs:[a[0],a[1],a[2],i.radius],obb:{center:o,halfSize:n.halfSize,quaternion:n.quaternion}}}function yKt(e){let t=[];for(let r=0;r<e.length;r+=3){let n=new ce([e[r],e[r+1],e[r+2]]);t.push(n)}return t}function Jke(e){let t;e instanceof Xa?t=e:t=e.getBoundingSphere();let r=t.center,n=t.radius,i=or.WGS84.cartesianToCartographic(new ce(r[0]+n,r[1]+n,r[2]+n),new ce),a=or.WGS84.cartesianToCartographic(new ce(r[0]-n,r[1]-n,r[2]-n),new ce);return{xmin:Math.min(a[0],i[0]),xmax:Math.max(a[0],i[0]),ymin:Math.min(a[1],i[1]),ymax:Math.max(a[1],i[1]),zmin:Math.min(a[2],i[2]),zmax:Math.max(a[2],i[2])}}function KW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Rr([t,0,0,0,t,0,0,0,t]);return new ua(r,n)}function Xke(e,t,r){var s,u,c,l,f,d,p,h;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((d=e.gltf)==null?void 0:d.nodes)||[],i=((h=(p=e.gltf)==null?void 0:p.images)==null?void 0:h.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let E=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(E.length);return S.set(E),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];Qke(n);let{cartographicOrigin:a,modelMatrix:o}=_Kt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function xKt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function _Kt(e,t,r){let{rtcCenter:n,gltfUpAxis:i}=e,{center:a}=r,o=new Kr(t);switch(n&&o.translate(n),i){case"Z":break;case"Y":let c=new Kr().rotateX(Math.PI/2);o=o.multiplyRight(c);break;case"X":let l=new Kr().rotateY(-Math.PI/2);o=o.multiplyRight(l);break;default:break}let s=new ce(a),u=or.WGS84.cartesianToCartographic(s,new ce);return{modelMatrix:o,cartographicOrigin:u}}function Qke(e){var t;for(let r=0;r<e.length;r++){let n=e[r];n.mesh&&(e[r]={...n,mesh:{...n.mesh,primitives:(t=n.mesh)==null?void 0:t.primitives.map(i=>{var a,o,s;return{...i,indices:{value:(a=i==null?void 0:i.indices)==null?void 0:a.value},attributes:xKt(i.attributes),material:{id:(o=i==null?void 0:i.material)==null?void 0:o.id,uniqueId:(s=i==null?void 0:i.material)==null?void 0:s.uniqueId}}})}}),n.children&&Qke(n.children)}}function Zke(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[ys];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function eBe(e,t,r,n){let i=t==null?void 0:t.extensions;if(!i)return[];for(let[a,o]of Object.entries(i||{}))switch(a){case ys:return EKt(e,o,r,n);case XC:return wKt(e,o);default:return[]}return[]}function wKt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function EKt(e,t,r,n){var o,s,u,c,l,f,d;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let p=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return AKt(p,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let h=`TEXCOORD_${((d=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:d.texCoord)||0}`,b=e[h].value;return SKt(a,b,r)}return n?e[n].value:[]}function AKt(e,t=0,r=0){let n=[];if(r>0){let i=t,a=r;for(let o=0;o<e;o++)n.push(i),a-=1,a===0&&(i++,a=r)}else n=Array(e).fill(t,0,e);return n}function SKt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let d=0;d<t.length;d+=2){let p=t[d],h=t[d+1],b=Math.min(qC(p)*o.width|0,o.width-1),x=(Math.min(qC(h)*o.height|0,o.height-1)*o.width+b)*o.components+u,E=new Uint8Array(o.data)[x];s.push(E)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function tBe(e,t){let r={};for(let n in t){let i=t[n];r[n]=TKt(i,e)}return r}function TKt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function rBe(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}function CKt(e){return typeof e=="string"||typeof e=="bigint"?Ln.STRING_TYPE:typeof e=="number"?Number.isInteger(e)?Ln.SHORT_INT_TYPE:Ln.DOUBLE_TYPE:Ln.STRING_TYPE}function nBe(e){let t={};for(let r in e){let n=e[r][0],i=CKt(n);t[r]=i}return t}var iBe=(e,t)=>{var a,o,s,u,c,l,f,d;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[ys])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let p in n.properties){let h=n.properties[p],b=DKt(h);r[p]=b}return r}let i=(d=(f=(l=(c=e.extensions)==null?void 0:c[jl])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:d[t];if(i){for(let p in i.properties){let h=i.properties[p],b=FKt(h);r[p]=b}return r}return null},DKt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t},FKt=e=>{let t;if(e.array)t=Ln.STRING_TYPE;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=Ln.SHORT_INT_TYPE;break;case"FLOAT32":case"FLOAT64":t=Ln.DOUBLE_TYPE;break;case"INT64":case"UINT64":t=Ln.STRING_TYPE;break;default:t=Ln.STRING_TYPE;break}return t};var sk=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var kKt=1,BKt=1,Cu=3,_w=2,OKt=4,IKt="string",PKt="Int32",RKt="Float64",jKt="Oid32",aBe=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],wp=new ce;async function $W(e,t,r,n,i,a,o,s,u,c,l,f,d){var S;let p=u,h=await XKt((S=e.gltf)==null?void 0:S.materials,c),b=Xke(e,t,r),g=Zke(e,d),x=await qKt(b,h,p,g);u&&LKt(x,l);let E=[];for(let F of h){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:k,texture:N}=F,C=await n();E.push(await MKt({convertedAttributes:j,material:k,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return E.length?E:null}function LKt(e,t){for(let r of e.values()){let n=Yke(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Cu){let o=r.positions.subarray(a,a+Cu);or.WGS84.cartesianToCartographic(Array.from(o),wp),wp[2]=wp[2]-t.getHeight(wp[1],wp[0]),wp=wp.subtract(i),r.positions.set(wp,a)}}}async function MKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var I;let l=e.boundingVolumes,f=e.positions.length/Cu,{faceRange:d,featureIds:p,positions:h,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=Kke(e),F={};o&&(F=u$t(p,e.featureIndices,a,o));let D=new Uint32Array(2),j=v$t(p);D.set([f,S],0);let k=new Uint8Array(Di(D.buffer,h.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,d.buffer)),N=u?b$t(f,e,{positions:h,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:p,faceRange:d},c):null,C=[];return s&&o&&(C=d$t(p,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:n$t(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function qKt(e,t,r,n){let{nodes:i,images:a,cartographicOrigin:o,cartesianModelMatrix:s}=e,u=new Map;for(let c of t){let l={positions:new Float32Array(0),normals:new Float32Array(0),texCoords:new Float32Array(0),colors:new Uint8Array(0),uvRegions:new Uint16Array(0),featureIndicesGroups:[],featureIndices:[],boundingVolumes:null,mergedMaterials:c.mergedMaterials};for(let f of c.mergedMaterials)u.set(f.originalMaterialId,l)}lBe(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,d)=>f.concat(d)),delete l.featureIndicesGroups)}}return u}function lBe(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){if(e)for(let u of e)UKt(u,t,r,n,i,a,o,s)}function NKt(e,t){let r=t,{matrix:n,rotation:i,scale:a,translation:o}=e;return n&&(r=t.multiplyRight(n)),o&&(r=r.translate(o)),i&&(r=r.rotateXYZ(i)),a&&(r=r.scale(a)),r}function UKt(e,t,r,n,i,a,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){let u=NKt(e,o),c=e.mesh;c&&GKt(c,t,r,n,i,a,u,s),lBe(e.children||[],t,r,n,i,a,u,s)}function GKt(e,t,r,n,i,a=!1,o=new Kr([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),s){var u;for(let c of e.primitives){let l=null,f;c.material?(l=i.get(c.material.id),f=(u=l==null?void 0:l.mergedMaterials.find(({originalMaterialId:h})=>{var b;return h===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Qt(l!==null,"Primitive - material mapping failed"),Qt(c.mode===void 0||c.mode===Ht.TRIANGLES||c.mode===Ht.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let d=c.attributes;if(!l)continue;let p=zKt(c);l.positions=Fo(l.positions,oBe({vertices:d.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:HKt,useCartesianPositions:a})),l.normals=Fo(l.normals,oBe({vertices:d.NORMAL&&d.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:p,attributeSpecificTransformation:WKt,useCartesianPositions:!1})),l.texCoords=Fo(l.texCoords,VKt(d.TEXCOORD_0&&d.TEXCOORD_0.value,p)),l.colors=Fo(l.colors,KKt(d.COLOR_0,p)),f&&(l.uvRegions=Fo(l.uvRegions,$Kt(f,p))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(YKt(JKt(d,c,t,s),p))}}function zKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return sk(n.length/Cu)}if(t&&e.mode===Ht.TRIANGLE_STRIP){let n=t.constructor,i=new n((t.length-2)*3),a=0,o=t.slice(0,3);i.set(o,0);for(let s=1;s+2<t.length;s++)a+=3,o=t.slice(s,s+3),s%2===0?i.set(o,a):i.set(o.reverse(),a);t=i}return t}function oBe(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Cu);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Cu,s=t.subarray(o,o+Cu),u=new ce(Array.from(s));u=n(u,e),i[a*Cu]=u.x,i[a*Cu+1]=u.y,i[a*Cu+2]=u.z}return i}function HKt(e,t){let{cartesianModelMatrix:r,cartographicOrigin:n,nodeMatrix:i,useCartesianPositions:a}=t;return i&&(e=e.transform(i)),e=e.transform(r),a||(or.WGS84.cartesianToCartographic([e[0],e[1],e[2]],e),e=e.subtract(n)),e}function WKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function VKt(e,t){let r=new Float32Array(t.length*_w);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*_w,a=e.subarray(i,i+_w);r[n*_w]=a[0],r[n*_w+1]=a[1]}return r}function KKt(e,t){let r=(e==null?void 0:e.components)||OKt,n=new Uint8Array(t.length*r);if(!e)return n.fill(255),n;let i=e.value;for(let a=0;a<t.length;a++){let o=t[a]*r,s=i.subarray(o,o+r),u=new Uint8Array(r);for(let c=0;c<s.length;c++)u[c]=s[c]*255;n.set(u,a*r)}return n}function $Kt(e,t){let r=new Uint16Array(t.length*4);for(let n=0;n<r.length;n+=4)r.set(e,n);return r}function YKt(e,t){if(!e.length||!t.length)return[];let r=[];for(let n=0;n<t.length;n++){let i=t[n];r.push(e[i])}return r}function JKt(e,t,r,n){let i=eBe(e,t,r,n);if(i.length)return i;for(let a=0;a<aBe.length;a++){let o=aBe[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function XKt(e=[],t){let r=[];for(let n of e)r.push(e$t(n));return t&&(r=await QKt(r)),r}async function QKt(e){var r,n;let t=[];for(;e.length>0;){let i=e.splice(0,1)[0],a=[];for(let o=0;o<e.length;o++){let s=e[o];(i.texture&&s.texture||!i.texture&&!s.texture)&&(i=await ZKt(i,s),a.push(o))}if(i.texture&&a.length){let o=(r=i.mergedMaterials)==null?void 0:r.reduce((c,{textureSize:l})=>c+((l==null?void 0:l.width)||0),0),s=(n=i.mergedMaterials)==null?void 0:n.reduce((c,{textureSize:l})=>Math.max(c,(l==null?void 0:l.height)||0),0),u=-1;for(let c of i.mergedMaterials)if(c.textureSize){let l=u+1+c.textureSize.width/o*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1;c.uvRegion=new Uint16Array([u+1,0,l,c.textureSize.height/s*2**(Uint16Array.BYTES_PER_ELEMENT*8)-1]),u=l}i.texture.image.width=o,i.texture.image.height=s}for(let o of a.reverse())e.splice(o,1);t.push(i)}return t.length||t.push({material:r$t(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function ZKt(e,t){var r,n;if((r=e.texture)!=null&&r.bufferView&&((n=t.texture)!=null&&n.bufferView)&&e.mergedMaterials&&t.mergedMaterials){let i=Buffer.from(e.texture.bufferView.data),a=Buffer.from(t.texture.bufferView.data);try{let{joinImages:o}=await import("join-images"),s=await o([i,a],{direction:"horizontal"});e.texture.bufferView.data=await s.toFormat(e.texture.mimeType==="image/png"?"png":"jpeg").toBuffer()}catch(o){throw console.log("Join images into a texture atlas has failed. Consider usage `--split-nodes` option. (See documentation https://loaders.gl/modules/tile-converter/docs/cli-reference/tile-converter)"),o}e.material.pbrMetallicRoughness.baseColorTexture.textureSetDefinitionId=1}return e.mergedMaterials=e.mergedMaterials.concat(t.mergedMaterials),e}function e$t(e){var i,a,o,s,u;let t={doubleSided:e.doubleSided,emissiveFactor:(i=e.emissiveFactor)==null?void 0:i.map(c=>Math.round(c*255)),alphaMode:t$t(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||kKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||BKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Rc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function t$t(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function r$t(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function n$t(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=i$t(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function i$t(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=o$t(r.texture,t));let{baseColorFactor:i,metallicFactor:a}=(e==null?void 0:e.pbrMetallicRoughness)||{},o=i;return(!i||i[3]===0)&&e.emissiveFactor&&(o=e.emissiveFactor,o[3]=o[3]||1),{materialDefinitionInfo:a$t(o||[1,1,1,1],a),textureDefinitionInfo:n}}function a$t(e,t=1){let r=.00015686274509803922,n=new ms(0,0,0,1),i=new ms(1,1,1,1),a=new ms(r,r,r,0),o=new ms(e),s=i.subtract(a).multiply(o),u=s.lerp(s,n,t);a[3]=1;let c=a.lerp(a,o,t);return{params:{diffuse:u.toArray(),specular:c.toArray(),renderMode:"solid"}}}function o$t(e,t){var r,n,i,a;return{encoding:(r=e==null?void 0:e.source)!=null&&r.mimeType?[e.source.mimeType]:void 0,images:[{id:s$t(e,t),size:(n=e.source)==null?void 0:n.image.width,length:(i=e.source)!=null&&i.image.data.length?[(a=e.source)==null?void 0:a.image.data.length]:void 0}]}}function s$t(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,d=n-1<<0,p=c+l+f+d;return BigInt(`0b${p.toString(2)}${u}`).toString()}function u$t(e,t,r,n){let i=c$t(e,n,r);return sBe(t,i),sBe(e,i),i}function c$t(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=f$t(i,t,r);n[a.toString()]=o}return n}function l$t(e,t){let r="";for(let n in e)r+=e[n][t];return r}function f$t(e,t,r){let n=l$t(t,e),i=(0,cBe.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function sBe(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function d$t(e,t,r,n){let i=[],o=rBe(e,r)?tBe(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=h$t(u,n);if(c){let l=s[u],f=p$t(c,l);i.push(f)}}return i}function p$t(e,t){let r;switch(e){case jKt:case PKt:r=m$t(t);break;case RKt:r=g$t(t);break;case IKt:r=uBe(t);break;default:r=uBe(t)}return r}function h$t(e,t){let r=t.find(n=>n.name===e);return r?r.attributeValues?r.attributeValues.valueType:(console.error(`attributeValues is null, attribute=${r}`),""):(console.error(`attribute is null, key=${e}, attributeStorageInfo=${JSON.stringify(t,null,2)}`),"")}function m$t(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return Di(t.buffer,r.buffer)}function g$t(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return Di(t.buffer,r.buffer,n.buffer)}function uBe(e){let t=new Uint32Array([e.length]),r=0,n=new Uint32Array(e.length),i=[];for(let o=0;o<e.length;o++){let s=`${String(e[o])}\0`,u=Buffer.from(s),c=u.length;r+=c,n[o]=c,i.push(u)}let a=new Uint32Array([r]);return Di(t.buffer,a.buffer,n.buffer,...i)}function v$t(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function b$t(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let d=new Uint32Array(t.featureIndices.length?t.featureIndices:e),p=y$t(d,l),h={positions:i,normals:a,colors:s,"feature-index":p};o.length&&(h.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(h["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),gv({attributes:h,indices:f},rq,{...rq.options,reuseWorkers:!0,_nodeWorkers:!0,modules:n,useLocalLibraries:!0,draco:{method:"MESH_SEQUENTIAL_ENCODING",attributesMetadata:b},["draco-writer"]:{workerUrl:"./modules/draco/dist/draco-writer-worker-node.js"}})}function y$t(e,t){let r=new Uint32Array(e.length),n=0,i=0;for(let a=1;a<t.length;a+=2){let o=(t[a]+1)*Cu;r.fill(n,i,o),n++,i=o+1}return r}function fBe(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=w$t(e);switch(i){case jl:return r=x$t(a,t),r;case ys:return r=_$t(a,t),r;default:return null}}function x$t(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return uk(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return uk(r)}return null}function _$t(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return uk(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return uk(n)}return null}function uk(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function w$t(e){var a,o,s,u;let t=[ys,jl];if(!((a=e==null?void 0:e.gltf)==null?void 0:a.extensionsUsed))return{extensionName:null,extension:null};let n="";for(let c of((o=e==null?void 0:e.gltf)==null?void 0:o.extensionsUsed)||[])if(t.includes(c)){n=c;break}if(!n)return{extensionName:null,extension:null};let i=(u=(s=e==null?void 0:e.gltf)==null?void 0:s.extensions)==null?void 0:u[n];return{extensionName:n,extension:i}}var pBe=Wt(Su(),1),hBe=require("path");var dBe=()=>({serviceItemId:{path:"serviceItemId"},serviceName:{path:"layerName"},name:{path:"layerName"},currentVersion:{path:"currentVersion",default:10.7},serviceVersion:{path:"serviceVersion",default:"1.8"},supportedBindings:{path:"supportedBindings",default:["REST"]},layers:{path:"layers0",transform:e=>[e]}});async function mBe(e,t,r){let n={serviceItemId:Rc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,pBe.default)(n,dBe()),a=(0,hBe.join)(r,"SceneServer");await Bi(a,JSON.stringify(i))}var YW=16;function gBe(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*YW/i},o={metricType:"maxScreenThresholdSQ",maxError:Math.PI*.25*a.maxError*a.maxError};return n.constructor.name==="OrientedBoundingBox"?(r.push(o),r.push(a)):(r.push(a),r.push(o)),r}function JW(e){var n,i;let t=(n=e.lodSelection)==null?void 0:n.find(a=>a.metricType==="maxScreenThreshold"),r=t==null?void 0:t.maxError;if(!r){let a=(i=e.lodSelection)==null?void 0:i.find(o=>o.metricType==="maxScreenThresholdSQ");a&&(r=Math.sqrt(a.maxError/(Math.PI*.25)))}return r||(r=YW),e.mbs[3]*2*YW/r}var E$t=240,A$t=[9,-18,-88,0,96,90,0,0,-60,-20,-9,18,8,0,-96,30,0,0,60,-20,9,-88,-18,90,96,0,-20,-60,0,0,186,-42,-42,-150,-96,-150,60,60,60,60,54,162,-78,30,-24,-90,-60,60,-60,60,-9,-32,18,30,24,0,20,-60,0,0,-9,8,18,30,-96,0,-20,60,0,0,54,-78,162,-90,-24,30,60,-60,60,-60,-54,78,78,90,144,90,-60,-60,-60,-60,9,-8,-18,-30,-24,0,20,60,0,0,-9,18,-32,0,24,30,0,0,-60,20,9,-18,-8,0,-24,-30,0,0,60,20],S$t=372,T$t=[0,0,-131,0,138,144,0,0,-102,-31,0,0,7,0,-138,42,0,0,102,-31,62,0,-31,0,0,-62,0,0,0,31,124,0,-62,0,0,-124,0,0,0,62,124,0,-62,0,0,-124,0,0,0,62,62,0,-31,0,0,-62,0,0,0,31,0,0,45,0,-183,-9,0,93,18,0,0,0,216,0,33,87,0,-93,12,-93,0,0,156,0,153,99,0,-93,-12,-93,0,0,-45,0,-3,9,0,93,-18,0,0,0,-55,0,48,42,0,0,-84,31,0,0,-7,0,-48,-42,0,0,84,31],C$t=372,D$t=[18,-36,-122,0,120,135,0,0,-84,-31,-18,36,-2,0,-120,51,0,0,84,-31,36,-165,-27,93,147,-9,0,-93,18,0,210,45,-111,-93,-57,-192,0,93,12,93,162,141,-75,-93,-129,-180,0,93,-12,93,-36,-21,27,93,39,9,0,-93,-18,0,0,0,62,0,0,31,0,0,0,-31,0,0,124,0,0,62,0,0,0,-62,0,0,124,0,0,62,0,0,0,-62,0,0,62,0,0,31,0,0,0,-31,-18,36,-64,0,66,51,0,0,-102,31,18,-36,2,0,-66,-51,0,0,102,31],F$t=12,XW=(3+1)*(3+2)/2,k$t=2,iy=class{constructor(t){zt(this,"_v00",0),zt(this,"_v01",0),zt(this,"_v10",0),zt(this,"_v11",0),zt(this,"_t",[]),zt(this,"_ix",void 0),zt(this,"_iy",void 0),zt(this,"options",void 0),this.options=t,this._ix=this.options._width,this._iy=this.options._height}getHeight(t,r){if(t=Math.abs(t)>90?NaN:t,isNaN(t)||isNaN(r))return NaN;let n=B$t(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,d=new Array(XW);if(o===this._ix&&s===this._iy)this.options.cubic?d=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let h=[this._rawval(o,s-1),this._rawval(o+1,s-1),this._rawval(o-1,s),this._rawval(o,s),this._rawval(o+1,s),this._rawval(o+2,s),this._rawval(o-1,s+1),this._rawval(o,s+1),this._rawval(o+1,s+1),this._rawval(o+2,s+1),this._rawval(o,s+2),this._rawval(o+1,s+2)],b=T$t;s!==0&&(b=s===this.options._height-2?D$t:A$t);let g=S$t;s!==0&&(g=s===this.options._height-2?C$t:E$t);for(let x=0;x<XW;++x){d[x]=0;for(let E=0;E<F$t;++E)d[x]+=h[E]*b[XW*E+x];d[x]/=g}}if(!this.options.cubic){let h=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*h+a*b,x=this.options._offset+this.options._scale*g;return this._ix=o,this._iy=s,this._v00=u,this._v01=c,this._v10=l,this._v11=f,x}let p=d[0]+i*(d[1]+i*(d[3]+i*d[6]))+a*(d[2]+i*(d[4]+i*d[7])+a*(d[5]+i*d[8]+a*d[9]));return p=this.options._offset+this.options._scale*p,this._ix=o,this._iy=s,this._t=d,p}_rawval(t,r){t<0?t+=this.options._width:t>=this.options._width&&(t-=this.options._width),(r<0||r>=this.options._height)&&(r=r<0?-r:2*(this.options._height-1)-r,t+=(t<this.options._width/2?1:-1)*this.options._width/2);let n=this.options._datastart+k$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function B$t(e,t){t=Math.abs(t);let r=vBe(e,t);return 2*Math.abs(r)===t?r-=vBe(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function vBe(e,t){return e-Math.floor(e/t)*t}var O$t=10,I$t=65535;function QW(e,t){let r=P$t(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,d=null,p=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let E=x.split(" "),S=E[0],F=E[1];if(S!=="#"||!F)continue;let D=E.length>2?E.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!E[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(E[2],10)}else if(F==="Scale"){if(!E[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(E[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(E[2]))&&(o=parseFloat(E[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(E[2]))&&(s=parseFloat(E[2]))}else{let E=x.split(" ");if(E=E.filter(S=>S!==""),l=parseInt(E[0],10),f=parseInt(E[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let h=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(h!==I$t)throw new Error("Geoid model file: Incorrect value of maxval");if(d=n.value.offset,p=l,i===Number.MAX_VALUE)throw new Error("Geoid model file: Offset not set");if(a===0)throw new Error("Geoid model file: Scale not set");if(a<0)throw new Error("Geoid model file: Scale must be positive");if(f<2||l<2)throw new Error("Geoid model file: Raster size too small");if(l&1)throw new Error("Geoid model file: Raster width is odd");if(!(f&1))throw new Error("Geoid model file: Raster height is even");let b=l/360,g=(f-1)/180;return new iy({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:p,_datastart:d,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*P$t(e){let t=0;do{let r=e.indexOf(O$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:bBe(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:bBe(n)}}}while(t<e.length);return{offset:t,line:""}}function bBe(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var R$t="4.1.0-alpha.7";var ck={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:R$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>QW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var ay=Wt(Su(),1);var yBe={id:{path:"id",transform:e=>e.toUpperCase()},profile:{path:"profile",default:"meshpyramids"},version:{path:"version",default:"1.8"},resourcePattern:{path:"resourcePattern",default:["3dNodeIndexDocument","Attributes","SharedResource","Geometry"]},rootNode:{path:"rootNode",default:"./nodes/root"},extent:{path:"extent"},indexCRS:{path:"indexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},vertexCRS:{path:"vertexCRS",default:"http://www.opengis.net/def/crs/EPSG/0/4326"},normalReferenceFrame:{path:"normalReferenceFrame",default:"east-north-up"},attributeEncoding:{path:"attributeEncoding",default:"application/octet-stream; version=1.6"},textureEncoding:{path:"textureEncoding",default:["image/jpeg","image/ktx2"]},lodType:{path:"lodType",default:"MeshPyramid"},lodModel:{path:"lodModel",default:"node-switching"},defaultGeometrySchema:{path:"defaultGeometrySchema",default:{geometryType:"triangles",header:[{property:"vertexCount",type:"UInt32"},{property:"featureCount",type:"UInt32"}],topology:"PerAttributeArray",ordering:["position","normal","uv0","color"],vertexAttributes:{position:{valueType:"Float32",valuesPerElement:3},normal:{valueType:"Float32",valuesPerElement:3},uv0:{valueType:"Float32",valuesPerElement:2},color:{valueType:"UInt8",valuesPerElement:4}},featureAttributeOrder:["id","faceRange"],featureAttributes:{id:{valueType:"UInt64",valuesPerElement:1},faceRange:{valueType:"UInt32",valuesPerElement:2}}}}};var j$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),L$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),M$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),q$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),xBe=()=>({version:{path:"version",transform:e=>e.toUpperCase()},id:{path:"id",default:0},name:{path:"name"},href:{path:"href",default:"./layers/0"},layerType:{path:"layerType",default:"IntegratedMesh"},spatialReference:{path:"spatialReference",transform:e=>(0,ay.default)(e,j$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,ay.default)(e,yBe)},fullExtent:{path:"fullExtent",transform:e=>(0,ay.default)(e,q$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,ay.default)(e,L$t())},nodePages:{path:"nodePages",transform:e=>(0,ay.default)(e,M$t())},materialDefinitions:{path:"materialDefinitions",default:[]},textureSetDefinitions:{path:"textureSetDefinitions",default:[]},geometryDefinitions:{path:"geometryDefinitions",default:[]},attributeStorageInfo:{path:"attributeStorageInfo",default:[]},fields:{path:"fields",default:[]},popupInfo:{path:"popupInfo",default:null}});var ZW=Wt(Su(),1),N$t=()=>({offset:{default:8},position:{default:{type:"Float32",component:3}},normal:{default:{type:"Float32",component:3}},uv0:{path:"hasTexture",transform:e=>e&&{type:"Float32",component:2}||!1,omitValues:[!1]},color:{default:{type:"UInt8",component:4}},uvRegion:{path:"hasUvRegions",transform:e=>e&&{type:"UInt16",component:4}||!1,omitValues:[!1]},featureId:{default:{binding:"per-feature",type:"UInt64",component:1}},faceRange:{default:{binding:"per-feature",type:"UInt32",component:2}}}),U$t=()=>({"compressedAttributes.encoding":{default:"draco"},"compressedAttributes.attributes":{path:"geometryConfig",transform:e=>{let t=["position","normal"];return e.hasTexture&&t.push("uv0"),t.push("color"),e.hasUvRegions&&t.push("uv-region"),t.push("feature-index"),t}}}),_Be=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,ZW.default)(e,N$t())];return e.draco&&t.push((0,ZW.default)({geometryConfig:e},U$t())),t}}});var ww=Wt(Su(),1),G$t=()=>({renderMode:{path:"renderMode",default:"solid"},shininess:{path:"shininess",default:1},reflectivity:{path:"reflectivity",default:0},ambient:{path:"ambient",default:[1,1,1]},diffuse:{path:"diffuse",default:[1,1,1]},specular:{path:"specular",default:[0,0,0]},useVertexColorAlpha:{path:"useVertexColorAlpha",default:!1},vertexRegions:{path:"vertexRegions",default:!1},vertexColors:{path:"vertexColors",default:!0}}),z$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,ww.default)(r,G$t())}}),H$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),W$t=()=>({encoding:{path:"encoding"},wrap:{path:"wrap",default:["none"]},atlas:{path:"atlas",default:!1},uvSet:{path:"uvSet",default:"uv0"},channels:{path:"channels",default:"rgb"},images:{path:"images",transform:(e,t,r)=>e.map(n=>(0,ww.default)(n,H$t()))}}),wBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:V$t},textureDefinitions:{path:"textureDefinitionInfos",transform:K$t}});function V$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,ww.default)(a,z$t());return n}function K$t(e,t,r){if(!e)return null;let n={};for(let[i,a]of e.entries()){let o=`${r.nodePath}${i}`;a.imageIndex=o,n[o]=(0,ww.default)(a,W$t())}return n}var $$t=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]);function ABe(e){var r,n;if(!((r=e==null?void 0:e.parentNode)!=null&&r.obb)||!((n=e==null?void 0:e.parentNode)!=null&&n.mbs))return[];let t=[];return Y$t(t,e),J$t(t,e),t}function Y$t(e,t){var o;let r=X$t(t.parentNode.obb),n=Q$t(t);if(Z$t(r,n))return;let a=`OBB of Tile (${t.id}) doesn't fit into Parent (${(o=t.parentNode)==null?void 0:o.id}) tile OBB`;e.push(a)}function J$t(e,t){var a;let r=EBe(t.mbs),n=EBe(t.parentNode.mbs);if(r.center.distanceTo(n.center)+r.radius>n.radius){let o=`MBS of Tile (${t.id}) doesn't fit into Parent (${(a=t.parentNode)==null?void 0:a.id}) tile MBS`;e.push(o)}}function EBe(e){return new Xa([e[0],e[1],e[2]],e[3])}function X$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new ua().fromCenterHalfSizeQuaternion(t,r,n)}function Q$t(e){let t=e.obb.halfSize,r=$$t,n=or.WGS84.cartographicToCartesian(e.obb.center),i=[];for(let a=0;a<r.length;a+=3){let s=new ce(r[a]*=t[0],r[a+1]*=t[1],r[a+2]*=t[2]).transformByQuaternion(e.obb.quaternion).add(n);i=i.concat(s)}return i}function Z$t(e,t){let r=!0;for(let n=0;n<t.length/3;n+=3){let i=[t[n],t[n+1],t[n+2]],a=or.WGS84.cartesianToCartographic(i);if(e.distanceTo(a)>0){r=!1;break}}return r}var lk=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var SBe=Wt(require("process"),1),eYt=4*1024*1024*1024,oy=class extends lk{intervalId;writePromise=null;fileMap={};listeningInterval;writeConcurrency;constructor(t=2e3,r=400){super(),this.listeningInterval=t,this.writeConcurrency=r}async enqueue(t,r=!1){if(r){let{archiveKey:n,writePromise:i}=t,a=await i();n&&a&&(this.fileMap[n]=a)}else super.enqueue(t),SBe.default.memoryUsage().rss>eYt&&await this.startWrite()}startListening(){this.intervalId=setInterval(this.startWrite.bind(this),this.listeningInterval)}stopListening(){this.intervalId&&clearInterval(this.intervalId)}async startWrite(){this.writePromise||(this.writePromise=this.doWrite()),await this.writePromise,this.writePromise=null}async finalize(){this.stopListening(),await this.startWrite()}async doWrite(){for(;this.length;){let t=[],r=[];for(let i=0;i<this.writeConcurrency;i++){let a=this.dequeue();if(!a)break;let{archiveKey:o,writePromise:s}=a;r.push(o);let u=s();t.push(u)}let n=await Promise.allSettled(t);this.updateFileMap(r,n)}}updateFileMap(t,r){for(let n=0;n<t.length;n++){let i=t[n];i&&"value"in r[n]&&(this.fileMap[i]=r[n].value)}}};var sy="Tile converter does not work in browser, only in node js environment";var tV=require("path"),rV=Wt(Su(),1);var TBe=Wt(Su(),1),CBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),tYt=()=>({href:{path:"href"}}),rYt=()=>({id:{path:"id"},...tYt(),...CBe()}),eV=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...CBe(),lodSelection:{path:"lodSelection",default:[{metricType:"maxScreenThresholdSQ",maxError:196349.54374999998},{metricType:"maxScreenThreshold",maxError:999.9999999999999}]},children:{path:"children",default:null},neighbors:{path:"neighbors",default:null},parentNode:{path:"parentNode",transform:e=>(0,TBe.default)(e,rYt()),default:null},sharedResource:{path:"sharedResource",default:null},featureData:{path:"featureData",default:null},geometryData:{path:"geometryData",default:null},textureData:{path:"textureData",default:null},attributeData:{path:"attributeData",default:null}});var Du=class{id;inPageId;data=null;children=[];converter;_finalized=!1;get finalized(){return this._finalized}constructor(t,r){this.inPageId=t,this.id=t===0?"root":t.toString(),this.converter=r}async addData(t){return this.converter.options.instantNodeWriting?await this.write(t):this.data=t,this}async addChildren(t){let r=[];for(let i of t){let a=await i.load();r.push({id:i.id,href:`../${i.id}`,obb:a.obb,mbs:a.mbs})}this.children=this.children.concat(t);let n=this.data;this.converter.options.instantNodeWriting&&(n=await this.load()),n&&(n.children=n.children??[],n.children=n.children.concat(r)),this.converter.options.instantNodeWriting&&n&&await this.write(n)}async addNeighbors(){var r;if(this.finalized)return;let t=await this.load();for(let n of this.children){let i=await n.load();if(i.neighbors=i.neighbors??[],Number((r=t==null?void 0:t.children)==null?void 0:r.length)<1e3)for(let a of t.children||[])n.id!==a.id&&i.neighbors.push({...a});else console.warn(`Node ${n.id}: neighbors attribute is omited because of large number of neigbors`),delete i.neighbors;this.converter.options.instantNodeWriting&&i&&await n.write(i),await n.save()}this.finalize()}async save(){this.data&&await this.write(this.data)}finalize(){this._finalized=!0;for(let t of this.children)t.flush()}async write(t){let r=(0,tV.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Gc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Bi(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,tV.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await ik(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Du.createRootNodeIndexDocument(t);return await new Du(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Du.createNodeIndexDocument(t,r,n,i,a);return await new Du(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Rc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,rV.default)(r,eV())}static async createNodeIndexDocument(t,r,n,i,a){var d,p;let{texture:o,attributes:s}=a,u=i.index,c=await t.load(),l={version:c.version,id:u.toString(),level:c.level+1,...r,lodSelection:n,parentNode:{id:t.id,href:`../${t.id}`,mbs:c.mbs,obb:c.obb},children:[],neighbors:[]},f=(0,rV.default)(l,eV());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((p=(d=t.converter.layers0)==null?void 0:d.attributeStorageInfo)!=null&&p.length))){f.attributeData=[];let h=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<h;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var nV=async(e,t,r)=>{let n=Ew(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await fk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},iV=async(e,t,r)=>{let n=Ew(t);if(!e||!t.contentUrl||n)return null;let i={...r,[e.loader.id]:{...r[e.loader.id]||{},isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}};return await fk(t.contentUrl,e.loader,i)};async function fk(e,t,r){let n=e.split(".3tz"),i;if(n.length===1)i=null;else if(n.length===2)i=n[1].slice(1),i===""&&(i="tileset.json");else throw new Error("Unexpected URL format");if(i){let a=`${n[0]}.3tz`,o=new v2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function Ew(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var dk=async(e,t,r,n,i,a=0)=>{if(i&&a>i)return;let o=[],s=await r(e,t);o.push(s);for(let u of e.children)await dk(u,s,r,n,i,a+1);n&&await n(o,t)};var nYt=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],DBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Io(e.gltfArrayBuffer,Ll,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=iYt(n),a=aYt(n);return{meshTopologyTypes:i,metadataClasses:a}},iYt=e=>{let t=new Set;for(let r of e.meshes||[])for(let n of r.primitives){let{mode:i}=n;typeof i!="number"&&(i=4),t.add(nYt[i])}return t},aYt=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[ys])==null?void 0:a.schema)==null?void 0:o.classes;if(r)for(let l of Object.keys(r))t.add(l);let n=(c=(u=(s=e.extensions)==null?void 0:s[jl])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},FBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var kBe=Wt(require("process"),1);var oYt=.2,pk=class{_stepsTotal=0;_stepsDone=0;startTime=0;stopTime=0;timeOfUpdatingStepsDone=0;milliSecForOneStep=0;trust=!1;numberOfDigitsInPercentage=0;threshold;getTime;constructor(t={}){this.getTime=t.getTime||kBe.default.hrtime.bigint,this.threshold=t.threshold||oYt}get stepsTotal(){return this._stepsTotal}set stepsTotal(t){this._stepsTotal=t,this.numberOfDigitsInPercentage=this.stepsTotal>100?Math.ceil(Math.log10(this.stepsTotal))-2:0}get stepsDone(){return this._stepsDone}set stepsDone(t){if(this._stepsDone=t,this.timeOfUpdatingStepsDone=this.getCurrentTimeInMilliSeconds(),this._stepsDone){let n=(this.timeOfUpdatingStepsDone-this.startTime)/this._stepsDone;this.trust=this.isVelocityTrust(n,this.milliSecForOneStep),this.milliSecForOneStep=n}}startMonitoring(){this.startTime=this.getCurrentTimeInMilliSeconds(),this.milliSecForOneStep=0,this.trust=!1,this.timeOfUpdatingStepsDone=0,this.stopTime=0,this.stepsDone=0}stopMonitoring(){this.stopTime=this.getCurrentTimeInMilliSeconds()}getPercent(){return this._stepsTotal?this._stepsDone/this._stepsTotal*100:null}getPercentString(){let t=this.getPercent();return t!==null?t.toFixed(this.numberOfDigitsInPercentage):""}getTimeCurrentlyElapsed(){return(this.stopTime?this.stopTime:this.getCurrentTimeInMilliSeconds())-this.startTime}getTimeRemaining(){return!this._stepsDone||!this.startTime?null:{timeRemaining:(this._stepsTotal-this._stepsDone)*this.milliSecForOneStep,trust:this.trust}}getTimeRemainingString(){let t=this.getTimeRemaining();return t!=null&&t.trust?ry(t.timeRemaining):""}isVelocityTrust(t,r){return r?Math.abs((t-r)/r)<this.threshold:!1}getCurrentTimeInMilliSeconds(){return Number(this.getTime()/BigInt(1e6))}};var OBe,sYt=(OBe=B0.default.env)==null?void 0:OBe.IonToken,BBe=64,uYt="3DTILES",cYt="3DObject",lYt=1800,fYt="https://",Ep="phase1-count",uy=class{attributeMetadataInfo;nodePages;options;layers0Path;materialMap;materialDefinitions;geometryMap;geometryConfigs;vertexCounter;layers0;featuresHashArray;refinementCounter;validate;boundingVolumeWarnings=[];conversionStartTime=[0,0];refreshTokenTime=[0,0];sourceTileset=null;loadOptions={_nodeWorkers:!0,reuseWorkers:!0,useLocalLibraries:!0,basis:{format:"rgba32",workerUrl:"./modules/textures/dist/basis-worker-node.js"},draco:{workerUrl:"./modules/draco/dist/draco-worker-node.js"},fetch:{},modules:{}};geoidHeightModel=null;Loader=Cc;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new oy;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};progresses={};constructor(){this.attributeMetadataInfo=new aC,this.nodePages=new to(Bi,BBe,this),this.options={},this.layers0Path="",this.materialMap=new Map,this.materialDefinitions=[],this.geometryMap=new Map,this.geometryConfigs=[],this.vertexCounter=0,this.layers0=null,this.featuresHashArray=[],this.refinementCounter={tilesCount:0,tilesWithAddRefineCount:0},this.validate=!1,this.generateTextures=!1,this.generateBoundingVolumes=!1,this.layersHasTexture=!1,this.compressList=null}async convert(t){if(gn)return console.log(sy),sy;this.conversionStartTime=B0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:d,generateBoundingVolumes:p,instantNodeWriting:h=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:E=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:h,mergeMaterials:b,inquirer:g,metadataClass:x},this.progresses[Ep]=new pk,this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(fYt)!==-1?ED:Cc,this.generateTextures=Boolean(d),this.generateBoundingVolumes=Boolean(p),this.writeQueue=new oy,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,ck),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(Gc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await fk(F,this.Loader,this.loadOptions),(this.Loader===Cc||E?await this.preprocessConversion():!0)&&!E&&await this.selectMetadataClass()&&(await this._createAndSaveTileset(s,r),await this._finishConversion({slpk:Boolean(n),outputPath:s,tilesetName:r}))}catch(S){throw S}finally{await this.writeQueue.finalize(),Ma.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await dk(t,null,this.analyzeTile.bind(this),void 0,this.options.maxDepth);let{meshTopologyTypes:r,metadataClasses:n}=this.preprocessData;return console.log("------------------------------------------------"),console.log("Preprocess results:"),console.log(`Tile count: ${this.progresses[Ep].stepsTotal}`),console.log(`glTF mesh topology types: ${Array.from(r).join(", ")}`),n.size?console.log(`Feature metadata classes have been found: ${Array.from(n).join(", ")}`):console.log("Feature metadata classes have not been found"),console.log("------------------------------------------------"),!r.has("TRIANGLES")&&!r.has("TRIANGLE_STRIP")?(console.log("The tileset is of unsupported mesh topology types. The conversion will be interrupted."),console.log("------------------------------------------------"),!1):!0}async analyzeTile(t,r){if(Ew(t))return await nV(this.sourceTileset,t,this.loadOptions),null;t.id&&(this.progresses[Ep].stepsTotal+=1,console.log(`[analyze]: ${t.id}`));let i=null;try{i=await iV(this.sourceTileset,t,{...this.loadOptions,"3d-tiles":{...this.loadOptions["3d-tiles"],loadGLTF:!1}})}catch{console.log(`[warning]: Failed to load ${t.contentUrl}. An I3S tile with empty content will be added to the output tileset`)}let a=await DBe(i);return FBe(this.preprocessData,a),null}async selectMetadataClass(){var r;let{metadataClasses:t}=this.preprocessData;if(t.size>1)if((r=this.options.metadataClass)!=null&&r.length)console.log(`${this.options.metadataClass} has been selected`);else if(this.options.inquirer){let n=await this.options.inquirer.prompt([{name:"metadataClass",type:"list",message:"Select feature metadata data class to convert...",choices:Array.from(t)}]);this.options.metadataClass=n.metadataClass,console.log(`${n.metadataClass} has been selected`)}else return console.log(`A feature metadata class has not been selected. Start the converter with option "--metadata-class". For example, "npx tile-converter ... --metadata-class ${Array.from(t)[0]}"`),console.log("------------------------------------------------"),!1;return!0}async _createAndSaveTileset(t,r){var u,c,l;let n=(0,za.join)(`${t}`,`${r}`);try{await bw(n)}catch{}this.layers0Path=(0,za.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=LC(i.boundingVolume,new Kr(i.transform),null);this._formLayers0(r,a,(l=(c=(u=this.sourceTileset)==null?void 0:u.root)==null?void 0:c.boundingVolume)==null?void 0:l.region);let o=VW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]}),this.progresses[Ep].startMonitoring();let s=await Du.createRootNode(o,this);await dk(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.progresses[Ep].stopMonitoring(),console.log("[finalizing conversion]"),this.layers0.attributeStorageInfo=this.attributeMetadataInfo.attributeStorageInfo,this.layers0.fields=this.attributeMetadataInfo.fields,this.layers0.popupInfo=this.attributeMetadataInfo.popupInfo,this.attributeMetadataInfo.attributeStorageInfo.length&&(this.layers0.layerType=cYt),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,hk.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),_Be()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),mBe(r,this.layers0,n);for(let f of this.compressList||[])await nk(f),await WW(f);await this.nodePages.save(),await this.writeQueue.finalize(),await this._createSlpk(n)}_formLayers0(t,r,n){var s;if(!((s=this.sourceTileset)!=null&&s.root))return;let i=Jke(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Rc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Rc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:BBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,hk.default)(o,xBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Gc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Bi(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,za.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await Uke(r,n,0,".",this.options.sevenZipExe);let i=await h2(new iu(n));await p2(n,i,"@specialIndexFileHASH128@");try{await bw(t)}catch{}}}async convertTile(t,r){let n=Ew(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await nV(this.sourceTileset,t,this.loadOptions)),r;t.id&&console.log(`[convert]: ${t.id}`);let{parentNodes:i,transform:a}=r,o=a.clone();t.transform&&(o=o.multiplyRight(t.transform));let s=i[0],u=await this._createNode(s,t,o);await s.addChildren(u);let c={transform:o,parentNodes:u};if(t.id){this.progresses[Ep].stepsDone+=1;let l="Calculating time left...",f=this.progresses[Ep].getTimeRemainingString();f&&(l=`${f} left`);let d=this.progresses[Ep].getPercentString();console.log(`[converted ${d}%, ${l}]: ${t.id}`)}return c}async finalizeTile(t,r){for(let n of t)for(let i of n.parentNodes)await i.addNeighbors();for(let n of r.parentNodes)await n.save()}async _createNode(t,r,n){this._checkAddRefinementTypeForTile(r),await this._updateTilesetOptions();let i=null;try{i=await iV(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=LC(r.boundingVolume,n,null),o=VW(a,this.geoidHeightModel),s=fBe(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],d={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let p of u||[d]){this.layersHasTexture=this.layersHasTexture||Boolean(p.texture),this.generateBoundingVolumes&&p.boundingVolumes&&(o=p.boundingVolumes);let h=gBe(r,o),b=h.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,p),x=await Du.createNodeIndexDocument(t,o,h,g,p),E=await new Du(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(p,E.id),this.validate&&(this.boundingVolumeWarnings=ABe(x),this.boundingVolumeWarnings&&this.boundingVolumeWarnings.length&&console.warn("Bounding Volume Warnings: ",...this.boundingVolumeWarnings)),l.push(g.index),f.push(g)}return c}async _convertResources(t,r,n,i,a,o){if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await $W(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,this.attributeMetadataInfo.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,d={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(d.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let p=a.nodeId,h;if(p?h=await this.nodePages.getNodeById(p):h=await this.nodePages.push(d,i),d.mesh||console.log(`[warning]: node ${h.index} is created with empty content`),to.updateAll(h,d),o&&to.updateMaterialByNodeId(h,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;to.updateTexelCountHintByNodeId(h,b)}return u&&(this.vertexCounter+=u,to.updateVertexCountByNodeId(h,u)),to.updateNodeAttributeByNodeId(h),c&&to.updateFeatureCountByNodeId(h,c),this.nodePages.saveNode(h),h}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,za.join)(this.layers0Path,"nodes",r),c=(0,za.join)("nodes",r);await this._writeGeometries(n,i,u,c),await this._writeShared(o,u,c,r),await this._writeTexture(a,u,c),await this._writeAttributes(s,u,c)}async _writeGeometries(t,r,n,i){if(this.options.slpk){let a=(0,za.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>Gc(a,t,"0.bin")})}else{let a=(0,za.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Bi(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,za.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>Gc(a,r,"1.bin")})}else{let a=(0,za.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Bi(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,hk.default)(t,wBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,za.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>Gc(s,o,"sharedResource.json")})}else{let s=(0,za.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Bi(s,o)})}}async _writeTexture(t,r,n){if(t){let i=this._getFormatByMimeType(t==null?void 0:t.mimeType),a=[],o=t.bufferView.data;switch(i){case"jpg":case"png":{if(a.push({name:"0",format:i}),await this.writeTextureFile(o,"0",i,r,n),this.generateTextures){a.push({name:"1",format:"ktx2"});let s=t.image.data.subarray(),u=new Uint8Array(s),c=gv({...t.image,data:u},Bq,{...Bq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=gv(t.image.data[0],hq);await this.writeTextureFile(s,"0","jpg",r,n)}}this.layers0.textureSetDefinitions.length||(this.layers0.textureSetDefinitions.push({formats:a}),this.layers0.textureSetDefinitions.push({formats:a,atlas:!0}))}}async writeTextureFile(t,r,n,i,a){if(this.options.slpk){let o=(0,za.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>Gc(o,t,`${r}.${n}`,s)})}else{let o=(0,za.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Bi(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){if(t!=null&&t.length&&this.attributeMetadataInfo.attributeStorageInfo.length){let i=t.length<this.attributeMetadataInfo.attributeStorageInfo.length?t.length:this.attributeMetadataInfo.attributeStorageInfo.length;for(let a=0;a<i;a++){let o=this.attributeMetadataInfo.attributeStorageInfo[a].key,s=new Uint8Array(t[a]);if(this.options.slpk){let u=(0,za.join)(r,"attributes",o);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${o}.bin.gz`,writePromise:()=>Gc(u,s,"0.bin")})}else{let u=(0,za.join)(r,`attributes/${o}/0`);await this.writeQueue.enqueue({writePromise:()=>Bi(u,s,"index.bin")})}}}}_getFormatByMimeType(t){switch(t){case"image/jpeg":return"jpg";case"image/png":return"png";case"image/ktx2":return"ktx2";default:return"jpg"}}_findOrCreateMaterial(t){let r=(0,aV.default)(JSON.stringify(t));if(this.materialMap.has(r))return this.materialMap.get(r)||0;let n=this.materialDefinitions.push(t)-1;return this.materialMap.set(r,n),n}findOrCreateGeometryDefinition(t,r){let n={hasTexture:t,hasUvRegions:r},i=(0,aV.default)(JSON.stringify(n));if(this.geometryMap.has(i))return this.geometryMap.get(i)||0;let a=this.geometryConfigs.push(n)-1;return this.geometryMap.set(i,a),a}createAttributeStorageInfo(t,r){let n=null;this.options.metadataClass?!this.attributeMetadataInfo.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=iBe(t.gltf,this.options.metadataClass)):r&&(n=nBe(r)),n&&this.attributeMetadataInfo.addMetadataInfo(n)}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await ok(t),o=B0.default.hrtime(this.conversionStartTime),s=ry(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${uYt}`),console.log(`Total conversion time: ${s}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",a," bytes"),console.log('Percentage of tiles with "ADD" refinement type:',i,"%"),console.log("------------------------------------------------")}async _fetchPreloadOptions(){if(!this.Loader.preload)return{};let t={"cesium-ion":{accessToken:this.options.token||sYt}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=B0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(B0.default.hrtime(this.refreshTokenTime)[0]<lYt)return;this.refreshTokenTime=B0.default.hrtime();let r=await this._fetchPreloadOptions();r.headers&&(this.loadOptions.fetch={...this.loadOptions.fetch,headers:r.headers},console.log("Authorization Bearer token has been updated"))}_checkAddRefinementTypeForTile(t){t.refine===1&&(this.refinementCounter.tilesWithAddRefineCount+=1,console.warn('This tile uses "ADD" type of refinement')),this.refinementCounter.tilesCount+=1}isContentSupported(t){return["b3dm","glTF","scenegraph"].includes(t.type||"")}};var t5e=require("path"),lV=Wt(require("process"),1),r5e=Wt(Su(),1);function oV(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 IBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function cy(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 PBe="String",RBe="Oid32",jBe="Float64",LBe="Int16";function mk(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function ly(e,t=null){return t?`${e}?token=${t}`:e}function MBe(e,t){let{attributeData:r=[]}=t,n=[];for(let i=0;i<r.length;i++){let a=r[i].href.replace("./","");n.push(`${e}/${a}`)}return n}function qBe(e,t,r){let n=[],{attributeStorageInfo:i=[]}=e;for(let a=0;a<i.length;a++){let o=i[a].key;n.push(`${t}/nodes/${r}/attributes/${o}/0`)}return n}var gk=new ce([0,0,0]);function pYt(e){switch(e){case"ktx-etc2":case"dds":return oD;case"ktx2":return Lh;case"jpg":case"png":default:return kv}}var hYt="i3s-attribute-type";async function zBe(e,t,r,n,i){var o;let a={attributes:{},indices:null,featureIds:[],vertexCount:0,modelMatrix:new Kr,coordinateSystem:0,byteLength:0,texture:null};if(t.textureUrl){let s=ly(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=pYt(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===kv){let d={...t.textureLoaderOptions,image:{type:"data"}};try{let p=await Do(f,[],d,i);a.texture=p}catch{let h=await Io(f,u,d,i);a.texture=h}}else if(u===oD||u===Lh){let d=await An(f,u,t.textureLoaderOptions);u===Lh&&(d=d[0]),a.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else a.texture=f}return a.material=EYt(t.materialDefinition,a.texture),a.material&&(a.texture=null),await mYt(e,a,t,r,n)}async function mYt(e,t,r,n,i){var f,d;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let p=await Io(e,Av,{draco:{attributeNameEntry:hYt}});s=p.header.vertexCount,l=(f=p.indices)==null?void 0:f.value;let{POSITION:h,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=p.attributes;o={position:h,normal:b,color:g,uv0:x,uvRegion:S,id:E},gYt(o,p);let F=CYt(E);F&&TYt(o,F)}else{let{vertexAttributes:p,ordering:h,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=bYt(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=UBe(e,u,p,s,h),{attributes:F}=UBe(e,S,b,c,g);SYt(F),o=vYt(E,F)}if(!((d=i==null?void 0:i.i3s)!=null&&d.coordinateSystem)||i.i3s.coordinateSystem===2){let p=xYt(o.position,r);t.modelMatrix=p.invert(),t.coordinateSystem=2}else t.modelMatrix=wYt(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:NBe(o.color),texCoords:o.uv0,uvRegions:NBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let p in t.attributes)t.attributes[p]||delete t.attributes[p];return t.vertexCount=s,t.byteLength=a,t}function gYt(e,t){for(let r in t.loaderData.attributes){let n=t.loaderData.attributes[r];switch(n.name){case"POSITION":e.position.metadata=n.metadata;break;case"feature-index":e.id.metadata=n.metadata;break;default:break}}}function vYt(e,t){return{...e,...t}}function NBe(e){return e&&(e.normalized=!0,e)}function bYt(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=oV(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=cy(o);break;case"featureCount":i=new s(e,4,4)[0],r+=cy(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function UBe(e,t,r,n,i){let a={};for(let o of i)if(r[o]){let{valueType:s,valuesPerElement:u}=r[o];if(t+n*u*cy(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=yYt(c,n*u,cy(s));else{let f=oV(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:IBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*cy(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function yYt(e,t,r){let n=[],i=new DataView(e),a=0;for(let o=0;o<t;o++){let s=i.getUint32(a,!0),u=i.getUint32(a+4,!0),c=s+2**32*u;n.push(c),a+=r}return new Uint32Array(n)}function xYt(e,t){let r=t.mbs,n=e.value,i=e.metadata,a=new Kr,o=new ce(r[0],r[1],r[2]),s=new ce;return or.WGS84.cartographicToCartesian(o,s),or.WGS84.eastNorthUpToFixedFrame(s,a),e.value=_Yt(n,i,o),a}function _Yt(e,t={},r){let n=new Float64Array(e.length),i=t["i3s-scale_x"]&&t["i3s-scale_x"].double||1,a=t["i3s-scale_y"]&&t["i3s-scale_y"].double||1;for(let o=0;o<n.length;o+=3)n[o]=e[o]*i+r.x,n[o+1]=e[o+1]*a+r.y,n[o+2]=e[o+2]+r.z;for(let o=0;o<n.length;o+=3)or.WGS84.cartographicToCartesian(n.subarray(o,o+3),gk),n[o]=gk.x,n[o+1]=gk.y,n[o+2]=gk.z;return n}function wYt(e){var a,o;let t=e.metadata,r=((a=t==null?void 0:t["i3s-scale_x"])==null?void 0:a.double)||1,n=((o=t==null?void 0:t["i3s-scale_y"])==null?void 0:o.double)||1,i=new Kr;return i[0]=r,i[5]=n,i}function EYt(e,t){let r;return e?r={...e,pbrMetallicRoughness:e.pbrMetallicRoughness?{...e.pbrMetallicRoughness}:{baseColorFactor:[255,255,255,255]}}:(r={pbrMetallicRoughness:{}},t?r.pbrMetallicRoughness.baseColorTexture={texCoord:0}:r.pbrMetallicRoughness.baseColorFactor=[255,255,255,255]),r.alphaCutoff=r.alphaCutoff||.25,r.alphaMode&&(r.alphaMode=r.alphaMode.toUpperCase()),r.emissiveFactor&&(r.emissiveFactor=GBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=GBe(r.pbrMetallicRoughness.baseColorFactor)),t&&AYt(r,t),r}function GBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function AYt(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function SYt(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],d=i[c-1],p=f-d+1,h=u+p*3;o.fill(l,u,h),s++,u=h}e.id.value=o}function TYt(e,t){let r=e.id.value,n=new Float32Array(r.length);for(let i=0;i<r.length;i++)n[i]=t[r[i]];e.id.value=n}function CYt(e){var t,r;return(r=(t=e==null?void 0:e.metadata)==null?void 0:t["i3s-feature-ids"])==null?void 0:r.intArray}var DYt="4.1.0-alpha.7",HBe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:DYt,mimeTypes:["application/octet-stream"],parse:FYt,extensions:["bin"],options:{"i3s-content":{}}};async function FYt(e,t,r){let{tile:n,_tileOptions:i,tileset:a,_tilesetOptions:o}=(t==null?void 0:t.i3s)||{},s=i||n,u=o||a;return!s||!u?null:await zBe(e,s,u,t,r)}var kYt="4.1.0-alpha.7",WBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:kYt,mimeTypes:["application/json"],parse:BYt,extensions:["json"],options:{i3s:{}}};async function BYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var Aw=class{tileset;nodePages=[];pendingNodePages=[];nodesPerPage;options;lodSelectionMetricType;textureDefinitionsSelectedFormats=[];nodesInNodePages;url;textureLoaderOptions={};constructor(t,r="",n){var i,a;this.tileset={...t},this.url=r,this.nodesPerPage=((i=t.nodePages)==null?void 0:i.nodesPerPage)||64,this.lodSelectionMetricType=(a=t.nodePages)==null?void 0:a.lodSelectionMetricType,this.options=n,this.nodesInNodePages=0,this.initSelectedFormatsForTextureDefinitions(t)}async getNodeById(t){var i;let r=Math.floor(t/this.nodesPerPage);if(!this.nodePages[r]&&!this.pendingNodePages[r]){let a=ly(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,WBe,this.options)},this.nodePages[r]=await this.pendingNodePages[r].promise,this.nodesInNodePages+=this.nodePages[r].nodes.length,this.pendingNodePages[r].status="Done"}this.pendingNodePages[r].status==="Pending"&&(this.nodePages[r]=await this.pendingNodePages[r].promise);let n=t%this.nodesPerPage;return this.nodePages[r].nodes[n]}async formTileFromNodePages(t){let r=await this.getNodeById(t),n=[],i=[];for(let p of r.children||[])i.push(this.getNodeById(p));let a=await Promise.all(i);for(let p of a)n.push({id:p.index.toString(),obb:p.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:p,isDracoGeometry:h}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=p,f=h;let{textureData:b,materialDefinition:g}=this.getInformationFromMaterial(r.mesh.material);u=g,c=b.format||c,b.name&&(s=`${this.url}/nodes/${r.mesh.material.resource}/textures/${b.name}`),this.tileset.attributeStorageInfo&&(l=qBe(this.tileset,this.url,r.mesh.attribute.resource))}let d=this.getLodSelection(r);return sV({id:t.toString(),lodSelection:d,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Mv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=g_();r.has("etc2")&&t.push("ktx-etc2"),r.has("dxt")&&t.push("dds"),t.push("ktx2")}return t.push("jpg"),t.push("png"),t}};function VBe(e,t){let r=t.url||"",n;e.geometryData&&(n=`${r}/${e.geometryData[0].href}`);let i;e.textureData&&(i=`${r}/${e.textureData[0].href}`);let a;e.attributeData&&(a=MBe(r,e));let o=e.children||[];return sV({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function sV(e){var s,u;let t={},r=[0,0,0,1];if(e.mbs)r=e.mbs,t.sphere=[...or.WGS84.cartographicToCartesian(e.mbs.slice(0,3)),e.mbs[3]];else if(e.obb){t.box=[...or.WGS84.cartographicToCartesian(e.obb.center),...e.obb.halfSize,...e.obb.quaternion];let l=new ua().fromCenterHalfSizeQuaternion(t.box.slice(0,3),e.obb.halfSize,e.obb.quaternion).getBoundingSphere();t.sphere=[...l.center,l.radius],r=[...e.obb.center,l.radius]}let n=(s=e.lodSelection)==null?void 0:s[0].metricType,i=(u=e.lodSelection)==null?void 0:u[0].maxError,a="mesh",o=2;return{...e,mbs:r,boundingVolume:t,lodMetricType:n,lodMetricValue:i,type:a,refine:o}}async function KBe(e,t,r){let n=mk(r.url||""),i,a;if(e.nodePages)i=new Aw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=ly(`${n}/nodes/root`,o.token);a=await An(s,nf,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:nf,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var OYt="4.1.0-alpha.7",IYt=/layers\/[0-9]+$/,PYt=/nodes\/([0-9-]+|root)$/,RYt="504b0304",jYt="PointCloud",nf={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:OYt,mimeTypes:["application/octet-stream"],parse:LYt,extensions:["bin"],options:{i3s:{token:null,isTileset:"auto",isTileHeader:"auto",tile:null,tileset:null,_tileOptions:null,_tilesetOptions:null,useDracoGeometry:!0,useCompressedTextures:!0,decodeTextures:!0,coordinateSystem:2}}};async function LYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},UYt(e)===RYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=mk(n),o;t.i3s.isTileset==="auto"?o=IYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=PYt.test(a):s=t.i3s.isTileHeader,o?e=await qYt(e,t,r):s?e=await NYt(e,r):e=await MYt(e,t),e}async function MYt(e,t){return await Io(e,HBe,t)}async function qYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===jYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await KBe(n,t,r)}async function NYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),VBe(e,t)}function UYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function YBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?GYt(n,e):null}:{}}function GYt(e,t){switch(e){case PBe:return WYt(t);case RBe:return $Be(t);case jBe:return HYt(t);case LBe:return zYt(t);default:return $Be(t)}}function $Be(e){return new Uint32Array(e,4)}function zYt(e){return new Int16Array(e,4)}function HYt(e){return new Float64Array(e,8)}function WYt(e){let i=[];try{let a=new DataView(e,0,4).getUint32(0,!0),o=new Uint32Array(e,8,a),s=8+a*4;for(let u of o){let c=new TextDecoder("utf-8"),l=new Uint8Array(e,s,u);i.push(c.decode(l)),s+=u}}catch(a){console.error("Parse string attribute error: ",a.message)}return i}var VYt="4.1.0-alpha.7";var uV={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:VYt,mimeTypes:["application/binary"],parse:async(e,t)=>YBe(e,t),extensions:["bin"],options:{},binary:!0};function cV(e,t){let r=[e.center[0],e.center[1],e.center[2]+t.getHeight(e.center[1],e.center[0])],n=or.WGS84.cartographicToCartesian(r,new ce),i=new ua().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var vk=Wt(Su(),1),KYt=()=>({version:{path:"version",default:"1.0"}}),JBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,vk.default)(t,JBe()))}}),XBe=()=>({asset:{path:"asset",transform:e=>(0,vk.default)(e,KYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,vk.default)(e,JBe())}});function QBe(e,t){let r=new Float32Array(e.length),n=YYt(t);for(let i=0;i<e.length;i+=2){let a=e.subarray(i,i+2),o=n.slice(i*2,i*2+4),s=$Yt([a[0],a[1]]),u=[o[2]-o[0],o[3]-o[1]],c=[s[0]*u[0],s[1]*u[1]],l=[c[0]+o[0],c[1]+o[1]];r[i]=l[0],r[i+1]=l[1]}return r}function $Yt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function YYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var JYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),ZBe=new ce,Sw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return mC({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},dG)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),d=this._convertI3sMaterialToGLTFMaterial(o,f),p=l.addMaterial(d),h=s.positions,b=h.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=QBe(s.texCoords.value,s.uvRegions.value));let g=new ce(a),x=or.WGS84.cartesianToCartographic(g,new ce);s.positions.value=this._normalizePositions(b,g,x,c),this._createBatchIds(n,r),s.normals&&!this._checkNormals(s.normals.value)&&delete s.normals;let E=u||sk(b.length/h.size),S=l.addMesh({attributes:s,indices:E,material:p,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),mC(l.gltf,Jq)}async _addI3sTextureToGLTF(t,r,n){let{texture:i,material:a,attributes:o}=t,s=null,u=i;if(!i&&a&&(u=a.pbrMetallicRoughness&&a.pbrMetallicRoughness.baseColorTexture&&a.pbrMetallicRoughness.baseColorTexture.texture.source.image),u){let c=this._deduceMimeTypeFromFormat(r),l=n.addImage(u,c);s=n.addTexture({imageIndex:l}),delete o.colors}return s}_normalizePositions(t,r,n,i){let a=new Float32Array(t.length);for(let o=0;o<t.length;o+=3){let s=t.subarray(o,o+3),u=new ce(r),c=new ce(Array.from(s)).transform(i).add(n);or.WGS84.cartographicToCartesian(c,ZBe),c=ZBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(JYt)}_createBatchIds(t,r){let{featureIds:n}=t,{OBJECTID:i}=r||{};if(!(!n||!i)){for(let a=0;a<n.length;a++){let o=n[a],s=i.indexOf(o);n[a]=s}t.attributes._BATCHID={size:1,byteOffset:0,value:n}}}_deduceMimeTypeFromFormat(t){switch(t){case"jpg":return"image/jpeg";case"png":return"image/png";case"ktx2":return"image/ktx2";default:return console.warn(`Unexpected texture format in I3S: ${t}`),"image/jpeg"}}_convertI3sMaterialToGLTFMaterial(t,r){let n=r!==null;return t?(r!==null&&(t=this._setGLTFTexture(t,r)),t):(t={alphaMode:"OPAQUE",doubleSided:!1,pbrMetallicRoughness:{metallicFactor:0,roughnessFactor:1}},n?t.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,1],t)}_setGLTFTexture(t,r){let n={...t,pbrMetallicRoughness:{...t.pbrMetallicRoughness}};return t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture?n.pbrMetallicRoughness.baseColorTexture={index:r,texCoord:0}:t.emissiveTexture?n.emissiveTexture={index:r,texCoord:0}:t.pbrMetallicRoughness&&t.pbrMetallicRoughness.metallicRoughnessTexture?n.pbrMetallicRoughness.metallicRoughnessTexture={index:r,texCoord:0}:t.normalTexture?n.normalTexture={index:r,texCoord:0}:t.occlusionTexture&&(n.occlusionTexture={index:r,texCoord:0}),n}_getFeaturesLength(t){if(!t)return 0;let r=Object.keys(t)[0];return r?t[r].length:0}_checkNormals(t){return t.find(r=>r)}};var e5e=async(e,t,r)=>{if(!e||!t.contentUrl)return null;let n={...r,i3s:{...r.i3s,isTileset:!1,isTileHeader:!1,_tileOptions:{attributeUrls:t.attributeUrls,textureUrl:t.textureUrl,textureFormat:t.textureFormat,textureLoaderOptions:t.textureLoaderOptions,materialDefinition:t.materialDefinition,isDracoGeometry:t.isDracoGeometry,mbs:t.mbs},_tilesetOptions:{store:e.store,attributeStorageInfo:e.attributeStorageInfo,fields:e.fields}}};return await An(t.contentUrl,nf,n)};var XYt="I3S",fy=class{options;tilesetPath;vertexCounter;conversionStartTime;geoidHeightModel;sourceTileset;attributeStorageInfo;workerSource={};loaderOptions={_nodeWorkers:!0,reuseWorkers:!0,i3s:{coordinateSystem:3,decodeTextures:!1},"i3s-content":{workerUrl:"./modules/i3s/dist/i3s-content-worker-node.js"}};constructor(){this.options={},this.tilesetPath="",this.vertexCounter=0,this.conversionStartTime=[0,0],this.geoidHeightModel=null,this.sourceTileset=null,this.attributeStorageInfo=null,this.workerSource={}}async convert(t){var f;if(gn)return console.log(sy),sy;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=lV.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,ck),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,nf,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=KW(s.mbs)),this.tilesetPath=(0,t5e.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await bw(this.tilesetPath)}catch{}let u={boundingVolume:{box:cV(s.obb,this.geoidHeightModel)},geometricError:JW(s),children:[]};await this._addChildren(s,u,1);let c=(0,r5e.default)({root:u},XBe());await Bi(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),Ma.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await e5e(this.sourceTileset,a,this.loaderOptions);if(!o){await this._addChildren(a,r,n+1);return}this.vertexCounter+=(o==null?void 0:o.vertexCount)||0;let s=null;this.attributeStorageInfo&&(s=await this._loadChildAttributes(a,this.attributeStorageInfo)),a.obb||(a.obb=KW(a.mbs));let u={box:cV(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:JW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},d=await new Sw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Bi(this.tilesetPath,new Uint8Array(d),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(this.options.maxDepth&&n>this.options.maxDepth)return;let i=[];for(let a of t.children||[])i.push(this.convertChildNode(t,r,n,a));await Promise.all(i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await An(a,nf,o)}return n}_relativeUrlToFullUrl(t="",r){let n=t.split("/"),i=r.split("/");for(let a of i)switch(a){case".":continue;case"..":n=n.slice(0,-1);break;default:n.push(a)}return n.join("/")}async _loadChildAttributes(t,r){let n=[],{attributeUrls:i=[]}=t;for(let o=0;o<i.length;o++){let s=i[o],u=r[o],c={attributeName:u.name,attributeType:this._getAttributeType(u)};n.push(An(s,uV,c))}let a=await Promise.all(n);return this._replaceNestedArrays(a),Object.assign({},...a)}_getAttributeType(t){return t.attributeValues?t.attributeValues.valueType:t.objectIds?"Oid32":""}_replaceNestedArrays(t){for(let r=0;r<t.length;r++){let n=t[r];for(let i in n)n[i]=Array.from(n[i])}}async _finishConversion(t){let r=await ok(t),n=lV.default.hrtime(this.conversionStartTime),i=ry(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${XYt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var bk=require("path");var QYt="4.1.0-alpha.7",ZYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",yk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(ZYt,aG,{}),n=process.cwd();t&&(n=(0,bk.join)(n,t)),await Bi(n,new Uint8Array(r["geoids/egm2008-5.pgm"]),"egm2008-5.pgm"),console.log('Installing "I3S Content Loader" worker'),await this.installFromNpm("i3s","i3s-content-worker-node.js"),console.log('Installing "Draco Loader" worker'),await this.installFromNpm("draco","draco-worker-node.js"),console.log('Installing "Draco Writer" worker'),await this.installFromNpm("draco","draco-writer-worker-node.js"),console.log('Installing "Basis Loader" worker'),await this.installFromNpm("textures","basis-worker-node.js"),console.log('Installing "KTX2 Basis Writer" worker'),await this.installFromNpm("textures","ktx2-basis-writer-worker-node.js"),console.log('Installing "Draco decoder" library'),await this.installFromUrl(Cd[ai.DECODER],"draco",ai.DECODER),await this.installFromUrl(Cd[ai.DECODER_WASM],"draco",ai.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Cd[ai.ENCODER],"draco",ai.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",Sc.TRANSCODER,"libs"),await this.installFromNpm("textures",Sc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",Sc.ENCODER,"libs"),await this.installFromNpm("textures",Sc.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new dl().start({command:process.platform==="win32"?"npm.cmd":"npm",arguments:["install","sharp@0.30.4","join-images@1.1.3"],wait:0,ignoreStderr:!0}),console.log("All dependencies were installed succesfully.")}async installFromNpm(t,r,n=""){let a=await(await Oo(`https://unpkg.com/@loaders.gl/${t}@${QYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,bk.join)(process.cwd(),"modules",t,"dist",n);await Bi(o,a,r)}async installFromUrl(t,r,n){let a=await(await Oo(t)).arrayBuffer();if(!a)return;let o=(0,bk.join)(process.cwd(),"modules",r,"dist","libs");await Bi(o,a,n)}};function Fu(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function n5e(e,t){let r=Fu(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function i5e(e){return e.reduce((t,r)=>{let n=r.indexOf("="),i=r.slice(0,n),a=r.slice(n+1,r.length);return r.includes("=")&&r.startsWith("--")&&a?t.concat(i,a):t.concat(r)},[])}function a5e(e,t){let r=Fu(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function ku(e,t){let r=Fu(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var u5e=require("fs/promises"),fV={I3S:"I3S",_3DTILES:"3DTILES"};async function eJt(){let[,,...e]=process.argv;e.length===0&&pV();let t=i5e(e),r=rJt(t);if(r.installDependencies){new yk().install("deps");return}if(r.addHash){let i=o5e(r,!0),a=i.tileset;if(i.output==="data"){let s=i.tileset.substring(0,i.tileset.length-5);(await dV.default.prompt([{name:"isNewFileRequired",type:"list",message:"What would you like to do?",choices:[{name:"Add hash file to the current SLPK file",value:!1},{name:`Create a new file ${s}-hash.slpk with hash file inside`,value:!0}]}])).isNewFileRequired&&(a=`${s}-hash.slpk`)}else a=i.output;a!==i.tileset&&await(0,u5e.copyFile)(i.tileset,a);let o=await h2(new iu(a));await p2(a,o,"@specialIndexFileHASH128@");return}let n=o5e(r);await tJt(n)}eJt().catch(e=>{console.log(e),process.exit(1)});function pV(){console.log("cli: converter 3dTiles to I3S or I3S to 3dTiles..."),console.log('--install-dependencies [Run the script for installing dependencies. Run this options separate from others. Now "*.pgm" file installation is implemented]'),console.log("--max-depth [Maximal depth of hierarchical tiles tree traversal, default: infinite]"),console.log("--name [Tileset name]"),console.log('--output [Output folder, default: "data" folder]'),console.log("--instant-node-writing [Keep created 3DNodeIndexDocument files on disk instead of memory. This option reduce memory usage but decelerates conversion speed]"),console.log("--split-nodes [Prevent to merge similar materials that could lead to incorrect visualization (I3S to 3DTiles conversion only)]"),console.log("--slpk [Generate slpk (Scene Layer Packages) I3S output file]"),console.log("--tileset [tileset.json file (3DTiles) / http://..../SceneServer/layers/0 resource (I3S)]"),console.log("--input-type [tileset input type: I3S or 3DTILES]"),console.log('--7zExe [location of 7z.exe archiver to create slpk on Windows, default: "C:\\Program Files\\7-Zip\\7z.exe"]'),console.log('--egm [location of Earth Gravity Model *.pgm file to convert heights from ellipsoidal to gravity-related format. A model file can be loaded from GeographicLib https://geographiclib.sourceforge.io/html/geoid.html], default: "./deps/egm2008-5.zip"'),console.log("--token [Token for Cesium ION tilesets authentication]"),console.log("--no-draco [Disable draco compression for geometry]"),console.log("--generate-textures [Enable KTX2 textures generation if only one of (JPG, PNG) texture is provided or generate JPG texture if only KTX2 is provided]"),console.log("--generate-bounding-volumes [Generate obb and mbs bounding volumes from geometry]"),console.log("--analyze [Analyze the input tileset content without conversion, default: false]"),console.log('--metadata-class [One of the list of feature metadata classes, detected by converter on "analyze" stage, default: not set]'),console.log("--validate [Enable validation]"),process.exit(0)}async function tJt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case fV.I3S:new fy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case fV._3DTILES:await new uy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,slpk:e.slpk,sevenZipExe:e.sevenZipExe,egmFilePath:e.egm,token:e.token,draco:e.draco,mergeMaterials:e.mergeMaterials,generateTextures:e.generateTextures,generateBoundingVolumes:e.generateBoundingVolumes,validate:e.validate,instantNodeWriting:e.instantNodeWriting,metadataClass:e.metadataClass,analyze:e.analyze,inquirer:dV.default});break;default:pV()}}function o5e(e,t){let r={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:i=>t||Boolean(i)||Boolean(e.analyze)},output:{getMessage:()=>console.log("Missed: --output [Output path name]")},sevenZipExe:{getMessage:()=>console.log("Missed: --7zExe [7z archiver executable path]")},egm:{getMessage:()=>console.log("Missed: --egm [*.pgm earth gravity model file path]")},tileset:{getMessage:()=>console.log("Missed: --tileset [tileset.json file]")},inputType:{getMessage:()=>console.log("Missed/Incorrect: --input-type [tileset input type: I3S or 3DTILES]"),condition:i=>t||Boolean(i)&&Object.values(fV).includes(i.toUpperCase())}},n=[];for(let i in r){let a=e[i],o=r[i].condition;(o?o(a):a)||n.push(r[i].getMessage)}return n.length&&(n.forEach(i=>i()),process.exit(1)),e}function rJt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,s5e.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1,addHash:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Fu(n,e);break;case"--tileset":t.tileset=n5e(n,e);break;case"--name":t.name=Fu(n,e);break;case"--output":t.output=Fu(n,e);break;case"--instant-node-writing":t.instantNodeWriting=ku(n,e);break;case"--split-nodes":t.mergeMaterials=ku(n,e);break;case"--max-depth":t.maxDepth=a5e(n,e);break;case"--slpk":t.slpk=ku(n,e);break;case"--add-hash":t.addHash=ku(n,e);break;case"--7zExe":t.sevenZipExe=Fu(n,e);break;case"--egm":t.egm=Fu(n,e);break;case"--token":t.token=Fu(n,e);break;case"--no-draco":t.draco=ku(n,e);break;case"--validate":t.validate=ku(n,e);break;case"--install-dependencies":t.installDependencies=ku(n,e);break;case"--generate-textures":t.generateTextures=ku(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=ku(n,e);break;case"--analyze":t.analyze=ku(n,e);break;case"--metadata-class":t.metadataClass=Fu(n,e);break;case"--help":pV();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
|
|
180
180
|
/*! Bundled license information:
|
|
181
181
|
|
|
182
182
|
is-buffer/index.js:
|