@loaders.gl/tile-converter 4.1.0-alpha.3 → 4.1.0-alpha.4
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 zi(e,t).found}f
|
|
|
170
170
|
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof zi))return new zi(e,t);if(zLt(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()}zi.prototype._finish=function(){if(N3e.ok(this instanceof zi),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=GLt.realpathSync(i,e.realpathCache);n[a]=!0}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=!0;else throw o}})}s0.finish(this)};zi.prototype._process=function(e,t,r){N3e.ok(this instanceof zi);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=".":((j4(i)||j4(e.map(function(c){return typeof c=="string"?c:"[*]"}).join("/")))&&(!i||!j4(i))&&(i="/"+i),o=i);var s=this._makeAbs(o);if(!HLt(this,o)){var u=a[0]===q3e.GLOBSTAR;u?this._processGlobStar(i,o,s,a,t,r):this._processReaddir(i,o,s,a,t,r)}};zi.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=[],p=0;p<o.length;p++){var h=o[p];if(h.charAt(0)!=="."||l){var d;u&&!e?d=!h.match(s):d=h.match(s),d&&f.push(h)}}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 p=0;p<b;p++){var h=f[p];e&&(e.slice(-1)!=="/"?h=e+"/"+h:h=e+h),h.charAt(0)==="/"&&!this.nomount&&(h=XG.join(this.root,h)),this._emitMatch(i,h)}return}n.shift();for(var p=0;p<b;p++){var h=f[p],g;e?g=[e,h]:g=[h],this._process(g.concat(n),i,a)}}}};zi.prototype._emitMatch=function(e,t){if(!WLt(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)}}};zi.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};zi.prototype._readdir=function(e,t){var r;if(t&&!QG(this.symlinks,e))return this._readdirInGlobStar(e);if(QG(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}};zi.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};zi.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}};zi.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 p=0;p<l;p++){var h=o[p];if(!(h.charAt(0)==="."&&!this.dot)){var d=u.concat(o[p],s);this._process(d,i,!0);var b=u.concat(o[p],n);this._process(b,i,!0)}}}};zi.prototype._processSimple=function(e,t){var r=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),!!r){if(e&&j4(e)&&!this.nomount){var n=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=XG.join(this.root,e):(e=XG.resolve(this.root,e),n&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}};zi.prototype._stat=function(e){var t=this._makeAbs(e),r=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&QG(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};zi.prototype._mark=function(e){return s0.mark(this,e)};zi.prototype._makeAbs=function(e){return s0.makeAbs(this,e)}});var ez=v((o3r,W3e)=>{W3e.exports=H3e;function H3e(e,t){if(e&&t)return H3e(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 M4=v((s3r,tz)=>{var V3e=ez();tz.exports=V3e(L4);tz.exports.strict=V3e(K3e);L4.proto=L4(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return L4(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return K3e(this)},configurable:!0})});function L4(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function K3e(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 Y3e=v((u3r,$3e)=>{var VLt=ez(),x2=Object.create(null),KLt=M4();$3e.exports=VLt($Lt);function $Lt(e,t){return x2[e]?(x2[e].push(t),null):(x2[e]=[t],YLt(e))}function YLt(e){return KLt(function t(){var r=x2[e],n=r.length,i=JLt(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 x2[e]}})}function JLt(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}});var ZG=v((f3r,X3e)=>{X3e.exports=u0;var XLt=zG(),J3e=I4(),c3r=J3e.Minimatch,QLt=tr(),ZLt=require("events").EventEmitter,rz=require("path"),nz=require("assert"),_2=R4(),az=z3e(),c0=JG(),eMt=c0.setopts,iz=c0.ownProp,oz=Y3e(),l3r=require("util"),tMt=c0.childrenIgnored,rMt=c0.isIgnored,nMt=M4();function u0(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 az(e,t)}return new on(e,t,r)}u0.sync=az;var iMt=u0.GlobSync=az.GlobSync;u0.glob=u0;function aMt(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}u0.hasMagic=function(e,t){var r=aMt({},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};u0.Glob=on;QLt(on,ZLt);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 iMt(e,t)}if(!(this instanceof on))return new on(e,t,r);eMt(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),typeof r=="function"&&(r=nMt(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(nz(this instanceof on),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();c0.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),XLt.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 c0.mark(this,e)};on.prototype._makeAbs=function(e){return c0.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(nz(this instanceof on),nz(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=".":((_2(a)||_2(e.map(function(l){return typeof l=="string"?l:"[*]"}).join("/")))&&(!a||!_2(a))&&(a="/"+a),s=a);var u=this._makeAbs(s);if(tMt(this,s))return n();var c=o[0]===J3e.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)===".",p=[],h=0;h<o.length;h++){var d=o[h];if(d.charAt(0)!=="."||f){var b;c&&!e?b=!d.match(u):b=d.match(u),b&&p.push(d)}}var g=p.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 h=0;h<g;h++){var d=p[h];e&&(e!=="/"?d=e+"/"+d:d=e+d),d.charAt(0)==="/"&&!this.nomount&&(d=rz.join(this.root,d)),this._emitMatch(i,d)}return s()}n.shift();for(var h=0;h<g;h++){var d=p[h],x;e&&(e!=="/"?d=e+"/"+d:d=e+d),this._process([d].concat(n),i,a,s)}s()};on.prototype._emitMatch=function(e,t){if(!this.aborted&&!rMt(this,t)){if(this.paused){this._emitQueue.push([e,t]);return}var r=_2(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=oz(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=oz("readdir\0"+e+"\0"+t,r),!!r)){if(t&&!iz(this.symlinks,e))return this._readdirInGlobStar(e,r);if(iz(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,oMt(this,e,r))}};function oMt(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],p=o.length;if(f&&a)return s();for(var h=0;h<p;h++){var d=o[h];if(!(d.charAt(0)==="."&&!this.dot)){var b=c.concat(o[h],u);this._process(b,i,!0,s);var g=c.concat(o[h],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&&_2(e)&&!this.nomount){var a=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=rz.join(this.root,e):(e=rz.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&&iz(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=oz("stat\0"+r,l);c&&u.fs.lstat(r,c);function l(f,p){if(p&&p.isSymbolicLink())return u.fs.stat(r,function(h,d){h?u._stat2(e,r,null,p,t):u._stat2(e,r,h,d,t)});u._stat2(e,r,f,p,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 tCe=v((p3r,eCe)=>{var Z3e=EG(),Sb=require("path"),sz=M6e(),sMt=J6e(),uMt=c3e(),cMt=h3e(),lMt=ZG(),l0=eCe.exports={},Q3e=/[\/\\]/g,fMt=function(e,t){var r=[];return sz(e).forEach(function(n){var i=n.indexOf("!")===0;i&&(n=n.slice(1));var a=t(n);i?r=sMt(r,a):r=uMt(r,a)}),r};l0.exists=function(){var e=Sb.join.apply(Sb,arguments);return Z3e.existsSync(e)};l0.expand=function(...e){var t=cMt(e[0])?e.shift():{},r=Array.isArray(e[0])?e[0]:e;if(r.length===0)return[];var n=fMt(r,function(i){return lMt.sync(i,t)});return t.filter&&(n=n.filter(function(i){i=Sb.join(t.cwd||"",i);try{return typeof t.filter=="function"?t.filter(i):Z3e.statSync(i)[t.filter]()}catch{return!1}})),n};l0.expandMapping=function(e,t,r){r=Object.assign({rename:function(a,o){return Sb.join(a||"",o)}},r);var n=[],i={};return l0.expand(r,e).forEach(function(a){var o=a;r.flatten&&(o=Sb.basename(o)),r.ext&&(o=o.replace(/(\.[^\/]*)?$/,r.ext));var s=r.rename(t,o,r);r.cwd&&(a=Sb.join(r.cwd,a)),s=s.replace(Q3e,"/"),a=a.replace(Q3e,"/"),i[s]?i[s].src.push(a):(n.push({src:[a],dest:s}),i[s]=n[n.length-1])}),n};l0.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=sz(r.src):r.src=[r.src])}).map(function(r){var n=Object.assign({},r);if(delete n.src,delete n.dest,r.expand)return l0.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)?sz(o):[o],a.result=l0.expand(n,o)),a.result}}),"dest"in i&&(i.dest=r.dest),i}).flatten().value(),t)}});var Tb=v((d3r,iCe)=>{var uz=EG(),rCe=require("path"),h3r=require("util"),pMt=E6e(),nCe=AG(),hMt=O6e(),dMt=require("stream").Stream,mMt=O_().PassThrough,No=iCe.exports={};No.file=tCe();No.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)})};No.dateify=function(e){return e=e||new Date,e instanceof Date?e=e:typeof e=="string"?e=new Date(e):e=new Date,e};No.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},hMt(...n)};No.isStream=function(e){return e instanceof dMt};No.lazyReadStream=function(e){return new pMt.Readable(function(){return uz.createReadStream(e)})};No.normalizeInputSource=function(e){if(e===null)return new Buffer(0);if(typeof e=="string")return new Buffer(e);if(No.isStream(e)&&!e._readableState){var t=new mMt;return e.pipe(t),t}return e};No.sanitizePath=function(e){return nCe(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};No.trailingSlashIt=function(e){return e.slice(-1)!=="/"?e+"/":e};No.unixifyPath=function(e){return nCe(e,!1).replace(/^\w+:/,"")};No.walkdir=function(e,t,r){var n=[];typeof t=="function"&&(r=t,t=e),uz.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=rCe.join(e,s),uz.stat(u,function(l,f){n.push({path:u,relative:rCe.relative(t,u).replace(/\\/g,"/"),stats:f}),f&&f.isDirectory()?No.walkdir(u,t,function(p,h){h.forEach(function(d){n.push(d)}),c()}):c()})})()})}});var uCe=v((oCe,sCe)=>{var gMt=require("util"),vMt={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 aCe(e,t){Error.captureStackTrace(this,this.constructor),this.message=vMt[e]||e,this.code=e,this.data=t}gMt.inherits(aCe,Error);oCe=sCe.exports=aCe});var cz=v((m3r,cCe)=>{cCe.exports=require("stream")});var mCe=v((g3r,dCe)=>{"use strict";function lCe(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 fCe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?lCe(Object(r),!0).forEach(function(n){bMt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):lCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function bMt(e,t,r){return t=hCe(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 pCe(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,hCe(n.key),n)}}function xMt(e,t,r){return t&&pCe(e.prototype,t),r&&pCe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hCe(e){var t=_Mt(e,"string");return typeof t=="symbol"?t:String(t)}function _Mt(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 wMt=require("buffer"),q4=wMt.Buffer,EMt=require("util"),lz=EMt.inspect,AMt=lz&&lz.custom||"inspect";function SMt(e,t,r){q4.prototype.copy.call(e,t,r)}dCe.exports=function(){function e(){yMt(this,e),this.head=null,this.tail=null,this.length=0}return xMt(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 q4.alloc(0);for(var n=q4.allocUnsafe(r>>>0),i=this.head,a=0;i;)SMt(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=q4.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:AMt,value:function(r,n){return lz(this,fCe(fCe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var pz=v((v3r,vCe)=>{"use strict";function TMt(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(fz,this,e)):process.nextTick(fz,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(N4,r):(r._writableState.errorEmitted=!0,process.nextTick(gCe,r,a)):process.nextTick(gCe,r,a):t?(process.nextTick(N4,r),t(a)):process.nextTick(N4,r)}),this)}function gCe(e,t){fz(e,t),N4(e)}function N4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function CMt(){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 fz(e,t){e.emit("error",t)}function DMt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}vCe.exports={destroy:TMt,undestroy:CMt,errorOrDestroy:DMt}});var Kp=v((b3r,xCe)=>{"use strict";var yCe={};function Cs(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,yCe[e]=i}function bCe(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 FMt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function kMt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function BMt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Cs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Cs("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&FMt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(kMt(e," argument"))i=`The ${e} ${n} ${bCe(t,"type")}`;else{let a=BMt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${bCe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Cs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Cs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Cs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Cs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Cs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Cs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Cs("ERR_STREAM_WRITE_AFTER_END","write after end");Cs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Cs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Cs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");xCe.exports.codes=yCe});var hz=v((y3r,_Ce)=>{"use strict";var OMt=Kp().codes.ERR_INVALID_OPT_VALUE;function IMt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function PMt(e,t,r,n){var i=IMt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new OMt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}_Ce.exports={getHighWaterMark:PMt}});var gz=v((x3r,CCe)=>{"use strict";CCe.exports=oi;function ECe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){s7t(t,e)}}var Cb;oi.WritableState=E2;var RMt={deprecate:pd()},ACe=cz(),G4=require("buffer").Buffer,jMt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function LMt(e){return G4.from(e)}function MMt(e){return G4.isBuffer(e)||e instanceof jMt}var mz=pz(),qMt=hz(),NMt=qMt.getHighWaterMark,$p=Kp().codes,UMt=$p.ERR_INVALID_ARG_TYPE,GMt=$p.ERR_METHOD_NOT_IMPLEMENTED,zMt=$p.ERR_MULTIPLE_CALLBACK,HMt=$p.ERR_STREAM_CANNOT_PIPE,WMt=$p.ERR_STREAM_DESTROYED,VMt=$p.ERR_STREAM_NULL_VALUES,KMt=$p.ERR_STREAM_WRITE_AFTER_END,$Mt=$p.ERR_UNKNOWN_ENCODING,Db=mz.errorOrDestroy;tr()(oi,ACe);function YMt(){}function E2(e,t,r){Cb=Cb||f0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Cb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=NMt(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){r7t(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 ECe(this)}E2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(E2.prototype,"buffer",{get:RMt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var U4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(U4=Function.prototype[Symbol.hasInstance],Object.defineProperty(oi,Symbol.hasInstance,{value:function(t){return U4.call(this,t)?!0:this!==oi?!1:t&&t._writableState instanceof E2}})):U4=function(t){return t instanceof this};function oi(e){Cb=Cb||f0();var t=this instanceof Cb;if(!t&&!U4.call(oi,this))return new oi(e);this._writableState=new E2(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)),ACe.call(this)}oi.prototype.pipe=function(){Db(this,new HMt)};function JMt(e,t){var r=new KMt;Db(e,r),process.nextTick(t,r)}function XMt(e,t,r,n){var i;return r===null?i=new VMt:typeof r!="string"&&!t.objectMode&&(i=new UMt("chunk",["string","Buffer"],r)),i?(Db(e,i),process.nextTick(n,i),!1):!0}oi.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&MMt(e);return a&&!G4.isBuffer(e)&&(e=LMt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=YMt),n.ending?JMt(this,r):(a||XMt(this,n,e,r))&&(n.pendingcb++,i=ZMt(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&&SCe(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 $Mt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(oi.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function QMt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=G4.from(t,r)),t}Object.defineProperty(oi.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ZMt(e,t,r,n,i,a){if(!r){var o=QMt(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 dz(e,t,!1,s,n,i,a);return u}function dz(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new WMt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function e7t(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(w2,e,t),e._writableState.errorEmitted=!0,Db(e,n)):(i(n),e._writableState.errorEmitted=!0,Db(e,n),w2(e,t))}function t7t(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function r7t(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new zMt;if(t7t(r),t)e7t(e,r,n,t,i);else{var a=TCe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&SCe(e,r),n?process.nextTick(wCe,e,r,a,i):wCe(e,r,a,i)}}function wCe(e,t,r,n){r||n7t(e,t),t.pendingcb--,n(),w2(e,t)}function n7t(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function SCe(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,dz(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 ECe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(dz(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 GMt("_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||o7t(this,n,r),this};Object.defineProperty(oi.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function TCe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function i7t(e,t){e._final(function(r){t.pendingcb--,r&&Db(e,r),t.prefinished=!0,e.emit("prefinish"),w2(e,t)})}function a7t(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(i7t,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function w2(e,t){var r=TCe(t);if(r&&(a7t(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 o7t(e,t,r){t.ending=!0,w2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function s7t(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=mz.destroy;oi.prototype._undestroy=mz.undestroy;oi.prototype._destroy=function(e,t){t(e)}});var f0=v((_3r,FCe)=>{"use strict";var u7t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};FCe.exports=Ic;var DCe=yz(),bz=gz();tr()(Ic,DCe);for(vz=u7t(bz.prototype),z4=0;z4<vz.length;z4++)H4=vz[z4],Ic.prototype[H4]||(Ic.prototype[H4]=bz.prototype[H4]);var vz,H4,z4;function Ic(e){if(!(this instanceof Ic))return new Ic(e);DCe.call(this,e),bz.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",c7t)))}Object.defineProperty(Ic.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ic.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ic.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function c7t(){this._writableState.ended||process.nextTick(l7t,this)}function l7t(e){e.end()}Object.defineProperty(Ic.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 wz=v(BCe=>{"use strict";var _z=Gs().Buffer,kCe=_z.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 f7t(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 p7t(e){var t=f7t(e);if(typeof t!="string"&&(_z.isEncoding===kCe||!kCe(e)))throw new Error("Unknown encoding: "+e);return t||e}BCe.StringDecoder=A2;function A2(e){this.encoding=p7t(e);var t;switch(this.encoding){case"utf16le":this.text=b7t,this.end=y7t,t=4;break;case"utf8":this.fillLast=m7t,t=4;break;case"base64":this.text=x7t,this.end=_7t,t=3;break;default:this.write=w7t,this.end=E7t;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=_z.allocUnsafe(t)}A2.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||""};A2.prototype.end=v7t;A2.prototype.text=g7t;A2.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 xz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function h7t(e,t,r){var n=t.length-1;if(n<r)return 0;var i=xz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=xz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=xz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function d7t(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 m7t(e){var t=this.lastTotal-this.lastNeed,r=d7t(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 g7t(e,t){var r=h7t(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 v7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function b7t(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 x7t(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 _7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function w7t(e){return e.toString(this.encoding)}function E7t(e){return e&&e.length?this.write(e):""}});var W4=v((E3r,PCe)=>{"use strict";var OCe=Kp().codes.ERR_STREAM_PREMATURE_CLOSE;function A7t(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 S7t(){}function T7t(e){return e.setHeader&&typeof e.abort=="function"}function ICe(e,t,r){if(typeof t=="function")return ICe(e,null,t);t||(t={}),r=A7t(r||S7t);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(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new OCe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new OCe),r.call(e,d)},p=function(){e.req.on("finish",s)};return T7t(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):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",p),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)}}PCe.exports=ICe});var jCe=v((A3r,RCe)=>{"use strict";var V4;function Yp(e,t,r){return t=C7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function C7t(e){var t=D7t(e,"string");return typeof t=="symbol"?t:String(t)}function D7t(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 F7t=W4(),Jp=Symbol("lastResolve"),p0=Symbol("lastReject"),S2=Symbol("error"),K4=Symbol("ended"),h0=Symbol("lastPromise"),Ez=Symbol("handlePromise"),d0=Symbol("stream");function Xp(e,t){return{value:e,done:t}}function k7t(e){var t=e[Jp];if(t!==null){var r=e[d0].read();r!==null&&(e[h0]=null,e[Jp]=null,e[p0]=null,t(Xp(r,!1)))}}function B7t(e){process.nextTick(k7t,e)}function O7t(e,t){return function(r,n){e.then(function(){if(t[K4]){r(Xp(void 0,!0));return}t[Ez](r,n)},n)}}var I7t=Object.getPrototypeOf(function(){}),P7t=Object.setPrototypeOf((V4={get stream(){return this[d0]},next:function(){var t=this,r=this[S2];if(r!==null)return Promise.reject(r);if(this[K4])return Promise.resolve(Xp(void 0,!0));if(this[d0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[S2]?s(t[S2]):o(Xp(void 0,!0))})});var n=this[h0],i;if(n)i=new Promise(O7t(n,this));else{var a=this[d0].read();if(a!==null)return Promise.resolve(Xp(a,!1));i=new Promise(this[Ez])}return this[h0]=i,i}},Yp(V4,Symbol.asyncIterator,function(){return this}),Yp(V4,"return",function(){var t=this;return new Promise(function(r,n){t[d0].destroy(null,function(i){if(i){n(i);return}r(Xp(void 0,!0))})})}),V4),I7t),R7t=function(t){var r,n=Object.create(P7t,(r={},Yp(r,d0,{value:t,writable:!0}),Yp(r,Jp,{value:null,writable:!0}),Yp(r,p0,{value:null,writable:!0}),Yp(r,S2,{value:null,writable:!0}),Yp(r,K4,{value:t._readableState.endEmitted,writable:!0}),Yp(r,Ez,{value:function(a,o){var s=n[d0].read();s?(n[h0]=null,n[Jp]=null,n[p0]=null,a(Xp(s,!1))):(n[Jp]=a,n[p0]=o)},writable:!0}),r));return n[h0]=null,F7t(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[p0];a!==null&&(n[h0]=null,n[Jp]=null,n[p0]=null,a(i)),n[S2]=i;return}var o=n[Jp];o!==null&&(n[h0]=null,n[Jp]=null,n[p0]=null,o(Xp(void 0,!0))),n[K4]=!0}),t.on("readable",B7t.bind(null,n)),n};RCe.exports=R7t});var NCe=v((S3r,qCe)=>{"use strict";function LCe(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 j7t(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){LCe(a,n,i,o,s,"next",u)}function s(u){LCe(a,n,i,o,s,"throw",u)}o(void 0)})}}function MCe(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 L7t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?MCe(Object(r),!0).forEach(function(n){M7t(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):MCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function M7t(e,t,r){return t=q7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function q7t(e){var t=N7t(e,"string");return typeof t=="symbol"?t:String(t)}function N7t(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 U7t=Kp().codes.ERR_INVALID_ARG_TYPE;function G7t(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 U7t("iterable",["Iterable"],t);var i=new e(L7t({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=j7t(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}qCe.exports=G7t});var yz=v((C3r,JCe)=>{"use strict";JCe.exports=Nr;var Fb;Nr.ReadableState=HCe;var T3r=require("events").EventEmitter,zCe=function(t,r){return t.listeners(r).length},C2=cz(),$4=require("buffer").Buffer,z7t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function H7t(e){return $4.from(e)}function W7t(e){return $4.isBuffer(e)||e instanceof z7t}var Az=require("util"),gr;Az&&Az.debuglog?gr=Az.debuglog("stream"):gr=function(){};var V7t=mCe(),Bz=pz(),K7t=hz(),$7t=K7t.getHighWaterMark,Y4=Kp().codes,Y7t=Y4.ERR_INVALID_ARG_TYPE,J7t=Y4.ERR_STREAM_PUSH_AFTER_EOF,X7t=Y4.ERR_METHOD_NOT_IMPLEMENTED,Q7t=Y4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,kb,Sz,Tz;tr()(Nr,C2);var T2=Bz.errorOrDestroy,Cz=["error","close","destroy","pause","resume"];function Z7t(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 HCe(e,t,r){Fb=Fb||f0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Fb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=$7t(this,e,"readableHighWaterMark",r),this.buffer=new V7t,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&&(kb||(kb=wz().StringDecoder),this.decoder=new kb(e.encoding),this.encoding=e.encoding)}function Nr(e){if(Fb=Fb||f0(),!(this instanceof Nr))return new Nr(e);var t=this instanceof Fb;this._readableState=new HCe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),C2.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=Bz.destroy;Nr.prototype._undestroy=Bz.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=$4.from(e,t),t=""),n=!0),WCe(this,e,t,!1,n)};Nr.prototype.unshift=function(e){return WCe(this,e,null,!0,!1)};function WCe(e,t,r,n,i){gr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,rqt(e,a);else{var o;if(i||(o=eqt(a,t)),o)T2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==$4.prototype&&(t=H7t(t)),n)a.endEmitted?T2(e,new Q7t):Dz(e,a,t,!0);else if(a.ended)T2(e,new J7t);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Dz(e,a,t,!1):kz(e,a)):Dz(e,a,t,!1)}else n||(a.reading=!1,kz(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Dz(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&&J4(e)),kz(e,t)}function eqt(e,t){var r;return!W7t(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Y7t("chunk",["string","Buffer","Uint8Array"],t)),r}Nr.prototype.isPaused=function(){return this._readableState.flowing===!1};Nr.prototype.setEncoding=function(e){kb||(kb=wz().StringDecoder);var t=new kb(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 UCe=1073741824;function tqt(e){return e>=UCe?e=UCe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function GCe(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=tqt(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?Fz(this):J4(this),null;if(e=GCe(e,t),e===0&&t.ended)return t.length===0&&Fz(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=GCe(r,t)));var i;return e>0?i=$Ce(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&&Fz(this)),i!==null&&this.emit("data",i),i};function rqt(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?J4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,VCe(e)))}}function J4(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(VCe,e))}function VCe(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,Oz(e)}function kz(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(nqt,e,t))}function nqt(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){T2(this,new X7t("_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=iqt(r);e.on("drain",u);var c=!1;function l(){gr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),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&&YCe(n.pipes,e)!==-1)&&!c&&(gr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){gr("onerror",g),b(),e.removeListener("error",p),zCe(e,"error")===0&&T2(e,g)}Z7t(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){gr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){gr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(gr("pipe resume"),r.resume()),e};function iqt(e){return function(){var r=e._readableState;gr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&zCe(e,"data")&&(r.flowing=!0,Oz(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=YCe(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=C2.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?J4(this):n.reading||process.nextTick(aqt,this)),r};Nr.prototype.addListener=Nr.prototype.on;Nr.prototype.removeListener=function(e,t){var r=C2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(KCe,this),r};Nr.prototype.removeAllListeners=function(e){var t=C2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(KCe,this),t};function KCe(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 aqt(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,oqt(this,e)),e.paused=!1,this};function oqt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(sqt,e,t))}function sqt(e,t){gr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Oz(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 Oz(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<Cz.length;a++)e.on(Cz[a],this.emit.bind(this,Cz[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 Sz===void 0&&(Sz=jCe()),Sz(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=$Ce;Object.defineProperty(Nr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function $Ce(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 Fz(e){var t=e._readableState;gr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(uqt,t,e))}function uqt(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 Tz===void 0&&(Tz=NCe()),Tz(Nr,e,t)});function YCe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var Iz=v((D3r,QCe)=>{"use strict";QCe.exports=$l;var X4=Kp().codes,cqt=X4.ERR_METHOD_NOT_IMPLEMENTED,lqt=X4.ERR_MULTIPLE_CALLBACK,fqt=X4.ERR_TRANSFORM_ALREADY_TRANSFORMING,pqt=X4.ERR_TRANSFORM_WITH_LENGTH_0,Q4=f0();tr()($l,Q4);function hqt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new lqt);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 $l(e){if(!(this instanceof $l))return new $l(e);Q4.call(this,e),this._transformState={afterTransform:hqt.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",dqt)}function dqt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){XCe(e,t,r)}):XCe(this,null,null)}$l.prototype.push=function(e,t){return this._transformState.needTransform=!1,Q4.prototype.push.call(this,e,t)};$l.prototype._transform=function(e,t,r){r(new cqt("_transform()"))};$l.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)}};$l.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};$l.prototype._destroy=function(e,t){Q4.prototype._destroy.call(this,e,function(r){t(r)})};function XCe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new pqt;if(e._transformState.transforming)throw new fqt;return e.push(null)}});var t8e=v((F3r,e8e)=>{"use strict";e8e.exports=D2;var ZCe=Iz();tr()(D2,ZCe);function D2(e){if(!(this instanceof D2))return new D2(e);ZCe.call(this,e)}D2.prototype._transform=function(e,t,r){r(null,e)}});var o8e=v((k3r,a8e)=>{"use strict";var Pz;function mqt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i8e=Kp().codes,gqt=i8e.ERR_MISSING_ARGS,vqt=i8e.ERR_STREAM_DESTROYED;function r8e(e){if(e)throw e}function bqt(e){return e.setHeader&&typeof e.abort=="function"}function yqt(e,t,r,n){n=mqt(n);var i=!1;e.on("close",function(){i=!0}),Pz===void 0&&(Pz=W4()),Pz(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,bqt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new vqt("pipe"))}}}function n8e(e){e()}function xqt(e,t){return e.pipe(t)}function _qt(e){return!e.length||typeof e[e.length-1]!="function"?r8e:e.pop()}function wqt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=_qt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new gqt("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(n8e),!u&&(a.forEach(n8e),n(i))})});return t.reduce(xqt)}a8e.exports=wqt});var Rz=v((Ds,k2)=>{var F2=require("stream");process.env.READABLE_STREAM==="disable"&&F2?(k2.exports=F2.Readable,Object.assign(k2.exports,F2),k2.exports.Stream=F2):(Ds=k2.exports=yz(),Ds.Stream=F2||Ds,Ds.Readable=Ds,Ds.Writable=gz(),Ds.Duplex=f0(),Ds.Transform=Iz(),Ds.PassThrough=t8e(),Ds.finished=W4(),Ds.pipeline=o8e())});var f8e=v((B3r,l8e)=>{var Mz=require("fs"),u8e=a6e(),s8e=s6e(),jz=require("path"),Pc=Tb(),Eqt=require("util").inherits,si=uCe(),c8e=Rz().Transform,Lz=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=Pc.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),c8e.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=s8e.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=s8e.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=[]};Eqt(Jr,c8e);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 Mz.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=Pc.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=Pc.sanitizePath(e.name),e.type!=="symlink"&&e.name.slice(-1)==="/"?(r=!0,e.type="directory"):r&&(e.name+="/")),typeof e.mode=="number"?Lz?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(Lz?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,Lz&&r&&(e.mode=493)):e.mode===null&&(e.mode=r?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=Pc.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}Mz.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=Pc.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports("directory"))e.data.name=Pc.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=Pc.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports("symlink")){var r=Mz.readlinkSync(e.filepath),n=jz.dirname(e.filepath);e.data.type="symlink",e.data.linkname=jz.relative(n,jz.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=Pc.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType="buffer";else if(Pc.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(p){this.emit("error",p);return}if(l){u.resume();return}this._append(c.absolute,f)}var u=u8e(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=Pc.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=u8e(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};l8e.exports=Jr});var eF=v((O3r,p8e)=>{var Z4=p8e.exports=function(){};Z4.prototype.getName=function(){};Z4.prototype.getSize=function(){};Z4.prototype.getLastModifiedDate=function(){};Z4.prototype.isDirectory=function(){}});var tF=v((I3r,h8e)=>{var Fs=h8e.exports={};Fs.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};Fs.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)};Fs.fromDosTime=function(e){return Fs.dosToDate(e.readUInt32LE(0))};Fs.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t};Fs.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t};Fs.getShortBytesValue=function(e,t){return e.readUInt16LE(t)};Fs.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t};Fs.getLongBytesValue=function(e,t){return e.readUInt32LE(t)};Fs.toDosTime=function(e){return Fs.getLongBytes(Fs.dateToDos(e))}});var qz=v((P3r,y8e)=>{var d8e=tF(),m8e=1<<3,g8e=1<<0,Aqt=1<<2,Sqt=1<<1,v8e=1<<6,b8e=1<<11,Ca=y8e.exports=function(){return this instanceof Ca?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new Ca};Ca.prototype.encode=function(){return d8e.getShortBytes((this.descriptor?m8e:0)|(this.utf8?b8e:0)|(this.encryption?g8e:0)|(this.strongEncryption?v8e:0))};Ca.prototype.parse=function(e,t){var r=d8e.getShortBytesValue(e,t),n=new Ca;return n.useDataDescriptor((r&m8e)!==0),n.useUTF8ForNames((r&b8e)!==0),n.useStrongEncryption((r&v8e)!==0),n.useEncryption((r&g8e)!==0),n.setSlidingDictionarySize(r&Sqt?8192:4096),n.setNumberOfShannonFanoTrees(r&Aqt?3:2),n};Ca.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e};Ca.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};Ca.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e};Ca.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};Ca.prototype.useDataDescriptor=function(e){this.descriptor=e};Ca.prototype.usesDataDescriptor=function(){return this.descriptor};Ca.prototype.useEncryption=function(e){this.encryption=e};Ca.prototype.usesEncryption=function(){return this.encryption};Ca.prototype.useStrongEncryption=function(e){this.strongEncryption=e};Ca.prototype.usesStrongEncryption=function(){return this.strongEncryption};Ca.prototype.useUTF8ForNames=function(e){this.utf8=e};Ca.prototype.usesUTF8ForNames=function(){return this.utf8}});var _8e=v((R3r,x8e)=>{x8e.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 Nz=v((j3r,w8e)=>{w8e.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 Uz=v((L3r,C8e)=>{var Tqt=require("util").inherits,Cqt=AG(),A8e=eF(),S8e=qz(),E8e=_8e(),Za=Nz(),T8e=tF(),vr=C8e.exports=function(e){if(!(this instanceof vr))return new vr(e);A8e.call(this),this.platform=Za.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new S8e,this.crc=0,this.time=-1,this.minver=Za.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};Tqt(vr,A8e);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:Za.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?T8e.dosToDate(this.time):-1};vr.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};vr.prototype.getUnixMode=function(){return this.platform!==Za.PLATFORM_UNIX?0:this.getExternalAttributes()>>Za.SHORT_SHIFT&Za.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 S8e))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=Cqt(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=T8e.dateToDos(e,t)};vr.prototype.setUnixMode=function(e){e|=this.isDirectory()?Za.S_IFDIR:Za.S_IFREG;var t=0;t|=e<<Za.SHORT_SHIFT|(this.isDirectory()?Za.S_DOS_D:Za.S_DOS_A),this.setExternalAttributes(t),this.mode=e&Za.MODE_MASK,this.platform=Za.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()&E8e.FILE_TYPE_FLAG)===E8e.LINK_FLAG};vr.prototype.isZip64=function(){return this.csize>Za.ZIP64_MAGIC||this.size>Za.ZIP64_MAGIC}});var Gz=v((M3r,D8e)=>{D8e.exports=require("stream")});var P8e=v((q3r,I8e)=>{"use strict";function F8e(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 k8e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?F8e(Object(r),!0).forEach(function(n){Dqt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):F8e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Dqt(e,t,r){return t=O8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fqt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function B8e(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,O8e(n.key),n)}}function kqt(e,t,r){return t&&B8e(e.prototype,t),r&&B8e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function O8e(e){var t=Bqt(e,"string");return typeof t=="symbol"?t:String(t)}function Bqt(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 Oqt=require("buffer"),rF=Oqt.Buffer,Iqt=require("util"),zz=Iqt.inspect,Pqt=zz&&zz.custom||"inspect";function Rqt(e,t,r){rF.prototype.copy.call(e,t,r)}I8e.exports=function(){function e(){Fqt(this,e),this.head=null,this.tail=null,this.length=0}return kqt(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 rF.alloc(0);for(var n=rF.allocUnsafe(r>>>0),i=this.head,a=0;i;)Rqt(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=rF.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:Pqt,value:function(r,n){return zz(this,k8e(k8e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var Wz=v((N3r,j8e)=>{"use strict";function jqt(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(Hz,this,e)):process.nextTick(Hz,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(nF,r):(r._writableState.errorEmitted=!0,process.nextTick(R8e,r,a)):process.nextTick(R8e,r,a):t?(process.nextTick(nF,r),t(a)):process.nextTick(nF,r)}),this)}function R8e(e,t){Hz(e,t),nF(e)}function nF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Lqt(){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 Hz(e,t){e.emit("error",t)}function Mqt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}j8e.exports={destroy:jqt,undestroy:Lqt,errorOrDestroy:Mqt}});var Qp=v((U3r,q8e)=>{"use strict";var M8e={};function ks(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,M8e[e]=i}function L8e(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 qqt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function Nqt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Uqt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}ks("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);ks("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&qqt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(Nqt(e," argument"))i=`The ${e} ${n} ${L8e(t,"type")}`;else{let a=Uqt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${L8e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);ks("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ks("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});ks("ERR_STREAM_PREMATURE_CLOSE","Premature close");ks("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});ks("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ks("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ks("ERR_STREAM_WRITE_AFTER_END","write after end");ks("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ks("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);ks("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");q8e.exports.codes=M8e});var Vz=v((G3r,N8e)=>{"use strict";var Gqt=Qp().codes.ERR_INVALID_OPT_VALUE;function zqt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Hqt(e,t,r,n){var i=zqt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new Gqt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}N8e.exports={getHighWaterMark:Hqt}});var Yz=v((z3r,V8e)=>{"use strict";V8e.exports=ui;function G8e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){vNt(t,e)}}var Bb;ui.WritableState=O2;var Wqt={deprecate:pd()},z8e=Gz(),aF=require("buffer").Buffer,Vqt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function Kqt(e){return aF.from(e)}function $qt(e){return aF.isBuffer(e)||e instanceof Vqt}var $z=Wz(),Yqt=Vz(),Jqt=Yqt.getHighWaterMark,Zp=Qp().codes,Xqt=Zp.ERR_INVALID_ARG_TYPE,Qqt=Zp.ERR_METHOD_NOT_IMPLEMENTED,Zqt=Zp.ERR_MULTIPLE_CALLBACK,eNt=Zp.ERR_STREAM_CANNOT_PIPE,tNt=Zp.ERR_STREAM_DESTROYED,rNt=Zp.ERR_STREAM_NULL_VALUES,nNt=Zp.ERR_STREAM_WRITE_AFTER_END,iNt=Zp.ERR_UNKNOWN_ENCODING,Ob=$z.errorOrDestroy;tr()(ui,z8e);function aNt(){}function O2(e,t,r){Bb=Bb||m0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Bb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Jqt(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){pNt(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 G8e(this)}O2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(O2.prototype,"buffer",{get:Wqt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var iF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(iF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ui,Symbol.hasInstance,{value:function(t){return iF.call(this,t)?!0:this!==ui?!1:t&&t._writableState instanceof O2}})):iF=function(t){return t instanceof this};function ui(e){Bb=Bb||m0();var t=this instanceof Bb;if(!t&&!iF.call(ui,this))return new ui(e);this._writableState=new O2(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)),z8e.call(this)}ui.prototype.pipe=function(){Ob(this,new eNt)};function oNt(e,t){var r=new nNt;Ob(e,r),process.nextTick(t,r)}function sNt(e,t,r,n){var i;return r===null?i=new rNt:typeof r!="string"&&!t.objectMode&&(i=new Xqt("chunk",["string","Buffer"],r)),i?(Ob(e,i),process.nextTick(n,i),!1):!0}ui.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&$qt(e);return a&&!aF.isBuffer(e)&&(e=Kqt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=aNt),n.ending?oNt(this,r):(a||sNt(this,n,e,r))&&(n.pendingcb++,i=cNt(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&&H8e(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 iNt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ui.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function uNt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=aF.from(t,r)),t}Object.defineProperty(ui.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cNt(e,t,r,n,i,a){if(!r){var o=uNt(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 Kz(e,t,!1,s,n,i,a);return u}function Kz(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new tNt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function lNt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(B2,e,t),e._writableState.errorEmitted=!0,Ob(e,n)):(i(n),e._writableState.errorEmitted=!0,Ob(e,n),B2(e,t))}function fNt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function pNt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new Zqt;if(fNt(r),t)lNt(e,r,n,t,i);else{var a=W8e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&H8e(e,r),n?process.nextTick(U8e,e,r,a,i):U8e(e,r,a,i)}}function U8e(e,t,r,n){r||hNt(e,t),t.pendingcb--,n(),B2(e,t)}function hNt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function H8e(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,Kz(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 G8e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(Kz(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 Qqt("_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||gNt(this,n,r),this};Object.defineProperty(ui.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function W8e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function dNt(e,t){e._final(function(r){t.pendingcb--,r&&Ob(e,r),t.prefinished=!0,e.emit("prefinish"),B2(e,t)})}function mNt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(dNt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function B2(e,t){var r=W8e(t);if(r&&(mNt(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 gNt(e,t,r){t.ending=!0,B2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function vNt(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=$z.destroy;ui.prototype._undestroy=$z.undestroy;ui.prototype._destroy=function(e,t){t(e)}});var m0=v((H3r,$8e)=>{"use strict";var bNt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};$8e.exports=Rc;var K8e=Qz(),Xz=Yz();tr()(Rc,K8e);for(Jz=bNt(Xz.prototype),oF=0;oF<Jz.length;oF++)sF=Jz[oF],Rc.prototype[sF]||(Rc.prototype[sF]=Xz.prototype[sF]);var Jz,sF,oF;function Rc(e){if(!(this instanceof Rc))return new Rc(e);K8e.call(this,e),Xz.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(Rc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Rc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Rc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function yNt(){this._writableState.ended||process.nextTick(xNt,this)}function xNt(e){e.end()}Object.defineProperty(Rc.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 tH=v(J8e=>{"use strict";var eH=Gs().Buffer,Y8e=eH.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 _Nt(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 wNt(e){var t=_Nt(e);if(typeof t!="string"&&(eH.isEncoding===Y8e||!Y8e(e)))throw new Error("Unknown encoding: "+e);return t||e}J8e.StringDecoder=I2;function I2(e){this.encoding=wNt(e);var t;switch(this.encoding){case"utf16le":this.text=DNt,this.end=FNt,t=4;break;case"utf8":this.fillLast=SNt,t=4;break;case"base64":this.text=kNt,this.end=BNt,t=3;break;default:this.write=ONt,this.end=INt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=eH.allocUnsafe(t)}I2.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||""};I2.prototype.end=CNt;I2.prototype.text=TNt;I2.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 Zz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function ENt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Zz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=Zz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=Zz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function ANt(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 SNt(e){var t=this.lastTotal-this.lastNeed,r=ANt(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 TNt(e,t){var r=ENt(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 CNt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function DNt(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 FNt(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 kNt(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 BNt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function ONt(e){return e.toString(this.encoding)}function INt(e){return e&&e.length?this.write(e):""}});var uF=v((V3r,Z8e)=>{"use strict";var X8e=Qp().codes.ERR_STREAM_PREMATURE_CLOSE;function PNt(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 RNt(){}function jNt(e){return e.setHeader&&typeof e.abort=="function"}function Q8e(e,t,r){if(typeof t=="function")return Q8e(e,null,t);t||(t={}),r=PNt(r||RNt);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(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new X8e),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new X8e),r.call(e,d)},p=function(){e.req.on("finish",s)};return jNt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):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",p),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)}}Z8e.exports=Q8e});var tDe=v((K3r,eDe)=>{"use strict";var cF;function eh(e,t,r){return t=LNt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LNt(e){var t=MNt(e,"string");return typeof t=="symbol"?t:String(t)}function MNt(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 qNt=uF(),th=Symbol("lastResolve"),g0=Symbol("lastReject"),P2=Symbol("error"),lF=Symbol("ended"),v0=Symbol("lastPromise"),rH=Symbol("handlePromise"),b0=Symbol("stream");function rh(e,t){return{value:e,done:t}}function NNt(e){var t=e[th];if(t!==null){var r=e[b0].read();r!==null&&(e[v0]=null,e[th]=null,e[g0]=null,t(rh(r,!1)))}}function UNt(e){process.nextTick(NNt,e)}function GNt(e,t){return function(r,n){e.then(function(){if(t[lF]){r(rh(void 0,!0));return}t[rH](r,n)},n)}}var zNt=Object.getPrototypeOf(function(){}),HNt=Object.setPrototypeOf((cF={get stream(){return this[b0]},next:function(){var t=this,r=this[P2];if(r!==null)return Promise.reject(r);if(this[lF])return Promise.resolve(rh(void 0,!0));if(this[b0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[P2]?s(t[P2]):o(rh(void 0,!0))})});var n=this[v0],i;if(n)i=new Promise(GNt(n,this));else{var a=this[b0].read();if(a!==null)return Promise.resolve(rh(a,!1));i=new Promise(this[rH])}return this[v0]=i,i}},eh(cF,Symbol.asyncIterator,function(){return this}),eh(cF,"return",function(){var t=this;return new Promise(function(r,n){t[b0].destroy(null,function(i){if(i){n(i);return}r(rh(void 0,!0))})})}),cF),zNt),WNt=function(t){var r,n=Object.create(HNt,(r={},eh(r,b0,{value:t,writable:!0}),eh(r,th,{value:null,writable:!0}),eh(r,g0,{value:null,writable:!0}),eh(r,P2,{value:null,writable:!0}),eh(r,lF,{value:t._readableState.endEmitted,writable:!0}),eh(r,rH,{value:function(a,o){var s=n[b0].read();s?(n[v0]=null,n[th]=null,n[g0]=null,a(rh(s,!1))):(n[th]=a,n[g0]=o)},writable:!0}),r));return n[v0]=null,qNt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[g0];a!==null&&(n[v0]=null,n[th]=null,n[g0]=null,a(i)),n[P2]=i;return}var o=n[th];o!==null&&(n[v0]=null,n[th]=null,n[g0]=null,o(rh(void 0,!0))),n[lF]=!0}),t.on("readable",UNt.bind(null,n)),n};eDe.exports=WNt});var aDe=v(($3r,iDe)=>{"use strict";function rDe(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 VNt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){rDe(a,n,i,o,s,"next",u)}function s(u){rDe(a,n,i,o,s,"throw",u)}o(void 0)})}}function nDe(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 KNt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?nDe(Object(r),!0).forEach(function(n){$Nt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nDe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function $Nt(e,t,r){return t=YNt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function YNt(e){var t=JNt(e,"string");return typeof t=="symbol"?t:String(t)}function JNt(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 XNt=Qp().codes.ERR_INVALID_ARG_TYPE;function QNt(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 XNt("iterable",["Iterable"],t);var i=new e(KNt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=VNt(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}iDe.exports=QNt});var Qz=v((J3r,mDe)=>{"use strict";mDe.exports=Ur;var Ib;Ur.ReadableState=cDe;var Y3r=require("events").EventEmitter,uDe=function(t,r){return t.listeners(r).length},j2=Gz(),fF=require("buffer").Buffer,ZNt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function eUt(e){return fF.from(e)}function tUt(e){return fF.isBuffer(e)||e instanceof ZNt}var nH=require("util"),br;nH&&nH.debuglog?br=nH.debuglog("stream"):br=function(){};var rUt=P8e(),lH=Wz(),nUt=Vz(),iUt=nUt.getHighWaterMark,pF=Qp().codes,aUt=pF.ERR_INVALID_ARG_TYPE,oUt=pF.ERR_STREAM_PUSH_AFTER_EOF,sUt=pF.ERR_METHOD_NOT_IMPLEMENTED,uUt=pF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Pb,iH,aH;tr()(Ur,j2);var R2=lH.errorOrDestroy,oH=["error","close","destroy","pause","resume"];function cUt(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 cDe(e,t,r){Ib=Ib||m0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Ib),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=iUt(this,e,"readableHighWaterMark",r),this.buffer=new rUt,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&&(Pb||(Pb=tH().StringDecoder),this.decoder=new Pb(e.encoding),this.encoding=e.encoding)}function Ur(e){if(Ib=Ib||m0(),!(this instanceof Ur))return new Ur(e);var t=this instanceof Ib;this._readableState=new cDe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),j2.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=lH.destroy;Ur.prototype._undestroy=lH.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=fF.from(e,t),t=""),n=!0),lDe(this,e,t,!1,n)};Ur.prototype.unshift=function(e){return lDe(this,e,null,!0,!1)};function lDe(e,t,r,n,i){br("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,pUt(e,a);else{var o;if(i||(o=lUt(a,t)),o)R2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==fF.prototype&&(t=eUt(t)),n)a.endEmitted?R2(e,new uUt):sH(e,a,t,!0);else if(a.ended)R2(e,new oUt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?sH(e,a,t,!1):cH(e,a)):sH(e,a,t,!1)}else n||(a.reading=!1,cH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function sH(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&&hF(e)),cH(e,t)}function lUt(e,t){var r;return!tUt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new aUt("chunk",["string","Buffer","Uint8Array"],t)),r}Ur.prototype.isPaused=function(){return this._readableState.flowing===!1};Ur.prototype.setEncoding=function(e){Pb||(Pb=tH().StringDecoder);var t=new Pb(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 oDe=1073741824;function fUt(e){return e>=oDe?e=oDe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function sDe(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=fUt(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?uH(this):hF(this),null;if(e=sDe(e,t),e===0&&t.ended)return t.length===0&&uH(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=sDe(r,t)));var i;return e>0?i=hDe(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&&uH(this)),i!==null&&this.emit("data",i),i};function pUt(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?hF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,fDe(e)))}}function hF(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(fDe,e))}function fDe(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,fH(e)}function cH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(hUt,e,t))}function hUt(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){R2(this,new sUt("_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=dUt(r);e.on("drain",u);var c=!1;function l(){br("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),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&&dDe(n.pipes,e)!==-1)&&!c&&(br("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){br("onerror",g),b(),e.removeListener("error",p),uDe(e,"error")===0&&R2(e,g)}cUt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){br("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){br("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(br("pipe resume"),r.resume()),e};function dUt(e){return function(){var r=e._readableState;br("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&uDe(e,"data")&&(r.flowing=!0,fH(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=dDe(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=j2.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?hF(this):n.reading||process.nextTick(mUt,this)),r};Ur.prototype.addListener=Ur.prototype.on;Ur.prototype.removeListener=function(e,t){var r=j2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(pDe,this),r};Ur.prototype.removeAllListeners=function(e){var t=j2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(pDe,this),t};function pDe(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 mUt(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,gUt(this,e)),e.paused=!1,this};function gUt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(vUt,e,t))}function vUt(e,t){br("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),fH(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 fH(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<oH.length;a++)e.on(oH[a],this.emit.bind(this,oH[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 iH===void 0&&(iH=tDe()),iH(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=hDe;Object.defineProperty(Ur.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function hDe(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 uH(e){var t=e._readableState;br("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(bUt,t,e))}function bUt(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 aH===void 0&&(aH=aDe()),aH(Ur,e,t)});function dDe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var pH=v((X3r,vDe)=>{"use strict";vDe.exports=Yl;var dF=Qp().codes,yUt=dF.ERR_METHOD_NOT_IMPLEMENTED,xUt=dF.ERR_MULTIPLE_CALLBACK,_Ut=dF.ERR_TRANSFORM_ALREADY_TRANSFORMING,wUt=dF.ERR_TRANSFORM_WITH_LENGTH_0,mF=m0();tr()(Yl,mF);function EUt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new xUt);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 Yl(e){if(!(this instanceof Yl))return new Yl(e);mF.call(this,e),this._transformState={afterTransform:EUt.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",AUt)}function AUt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){gDe(e,t,r)}):gDe(this,null,null)}Yl.prototype.push=function(e,t){return this._transformState.needTransform=!1,mF.prototype.push.call(this,e,t)};Yl.prototype._transform=function(e,t,r){r(new yUt("_transform()"))};Yl.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)}};Yl.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};Yl.prototype._destroy=function(e,t){mF.prototype._destroy.call(this,e,function(r){t(r)})};function gDe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new wUt;if(e._transformState.transforming)throw new _Ut;return e.push(null)}});var xDe=v((Q3r,yDe)=>{"use strict";yDe.exports=L2;var bDe=pH();tr()(L2,bDe);function L2(e){if(!(this instanceof L2))return new L2(e);bDe.call(this,e)}L2.prototype._transform=function(e,t,r){r(null,e)}});var SDe=v((Z3r,ADe)=>{"use strict";var hH;function SUt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var EDe=Qp().codes,TUt=EDe.ERR_MISSING_ARGS,CUt=EDe.ERR_STREAM_DESTROYED;function _De(e){if(e)throw e}function DUt(e){return e.setHeader&&typeof e.abort=="function"}function FUt(e,t,r,n){n=SUt(n);var i=!1;e.on("close",function(){i=!0}),hH===void 0&&(hH=uF()),hH(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,DUt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new CUt("pipe"))}}}function wDe(e){e()}function kUt(e,t){return e.pipe(t)}function BUt(e){return!e.length||typeof e[e.length-1]!="function"?_De:e.pop()}function OUt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=BUt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new TUt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return FUt(o,u,c,function(l){i||(i=l),l&&a.forEach(wDe),!u&&(a.forEach(wDe),n(i))})});return t.reduce(kUt)}ADe.exports=OUt});var dH=v((Bs,q2)=>{var M2=require("stream");process.env.READABLE_STREAM==="disable"&&M2?(q2.exports=M2.Readable,Object.assign(q2.exports,M2),q2.exports.Stream=M2):(Bs=q2.exports=Qz(),Bs.Stream=M2||Bs,Bs.Readable=Bs,Bs.Writable=Yz(),Bs.Duplex=m0(),Bs.Transform=pH(),Bs.PassThrough=xDe(),Bs.finished=uF(),Bs.pipeline=SDe())});var gH=v((eCr,TDe)=>{var IUt=require("stream").Stream,PUt=dH().PassThrough,mH=TDe.exports={};mH.isStream=function(e){return e instanceof IUt};mH.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e=="string")return Buffer.from(e);if(mH.isStream(e)&&!e._readableState){var t=new PUt;return e.pipe(t),t}return e}});var bH=v((tCr,DDe)=>{var RUt=require("util").inherits,vH=dH().Transform,jUt=eF(),CDe=gH(),Uo=DDe.exports=function(e){if(!(this instanceof Uo))return new Uo(e);vH.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};RUt(Uo,vH);Uo.prototype._appendBuffer=function(e,t,r){};Uo.prototype._appendStream=function(e,t,r){};Uo.prototype._emitErrorCallback=function(e){e&&this.emit("error",e)};Uo.prototype._finish=function(e){};Uo.prototype._normalizeEntry=function(e){};Uo.prototype._transform=function(e,t,r){r(null,e)};Uo.prototype.entry=function(e,t,r){if(t=t||null,typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),!(e instanceof jUt)){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=CDe.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,r);else if(CDe.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};Uo.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()};Uo.prototype.getBytesWritten=function(){return this.offset};Uo.prototype.write=function(e,t){return e&&(this.offset+=e.length),vH.prototype.write.call(this,e,t)}});var wH=v((rCr,kDe)=>{var nh=require("buffer").Buffer,yH=[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"&&(yH=new Int32Array(yH));function FDe(e){if(nh.isBuffer(e))return e;var t=typeof nh.alloc=="function"&&typeof nh.from=="function";if(typeof e=="number")return t?nh.alloc(e):new nh(e);if(typeof e=="string")return t?nh.from(e):new nh(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function LUt(e){var t=FDe(4);return t.writeInt32BE(e,0),t}function xH(e,t){e=FDe(e),nh.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,n=0;n<e.length;n++)r=yH[(r^e[n])&255]^r>>>8;return r^-1}function _H(){return LUt(xH.apply(null,arguments))}_H.signed=function(){return xH.apply(null,arguments)};_H.unsigned=function(){return xH.apply(null,arguments)>>>0};kDe.exports=_H});var EH=v((nCr,BDe)=>{BDe.exports=require("stream")});var LDe=v((iCr,jDe)=>{"use strict";function ODe(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 IDe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ODe(Object(r),!0).forEach(function(n){MUt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ODe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function MUt(e,t,r){return t=RDe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qUt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function PDe(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,RDe(n.key),n)}}function NUt(e,t,r){return t&&PDe(e.prototype,t),r&&PDe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function RDe(e){var t=UUt(e,"string");return typeof t=="symbol"?t:String(t)}function UUt(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 GUt=require("buffer"),gF=GUt.Buffer,zUt=require("util"),AH=zUt.inspect,HUt=AH&&AH.custom||"inspect";function WUt(e,t,r){gF.prototype.copy.call(e,t,r)}jDe.exports=function(){function e(){qUt(this,e),this.head=null,this.tail=null,this.length=0}return NUt(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 gF.alloc(0);for(var n=gF.allocUnsafe(r>>>0),i=this.head,a=0;i;)WUt(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=gF.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:HUt,value:function(r,n){return AH(this,IDe(IDe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var TH=v((aCr,qDe)=>{"use strict";function VUt(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(SH,this,e)):process.nextTick(SH,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(vF,r):(r._writableState.errorEmitted=!0,process.nextTick(MDe,r,a)):process.nextTick(MDe,r,a):t?(process.nextTick(vF,r),t(a)):process.nextTick(vF,r)}),this)}function MDe(e,t){SH(e,t),vF(e)}function vF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function KUt(){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 SH(e,t){e.emit("error",t)}function $Ut(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}qDe.exports={destroy:VUt,undestroy:KUt,errorOrDestroy:$Ut}});var ih=v((oCr,GDe)=>{"use strict";var UDe={};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,UDe[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 YUt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function JUt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function XUt(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"&&YUt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(JUt(e," argument"))i=`The ${e} ${n} ${NDe(t,"type")}`;else{let a=XUt(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");GDe.exports.codes=UDe});var CH=v((sCr,zDe)=>{"use strict";var QUt=ih().codes.ERR_INVALID_OPT_VALUE;function ZUt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function eGt(e,t,r,n){var i=ZUt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new QUt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}zDe.exports={getHighWaterMark:eGt}});var kH=v((uCr,YDe)=>{"use strict";YDe.exports=ci;function WDe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){CGt(t,e)}}var Rb;ci.WritableState=U2;var tGt={deprecate:pd()},VDe=EH(),yF=require("buffer").Buffer,rGt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function nGt(e){return yF.from(e)}function iGt(e){return yF.isBuffer(e)||e instanceof rGt}var FH=TH(),aGt=CH(),oGt=aGt.getHighWaterMark,ah=ih().codes,sGt=ah.ERR_INVALID_ARG_TYPE,uGt=ah.ERR_METHOD_NOT_IMPLEMENTED,cGt=ah.ERR_MULTIPLE_CALLBACK,lGt=ah.ERR_STREAM_CANNOT_PIPE,fGt=ah.ERR_STREAM_DESTROYED,pGt=ah.ERR_STREAM_NULL_VALUES,hGt=ah.ERR_STREAM_WRITE_AFTER_END,dGt=ah.ERR_UNKNOWN_ENCODING,jb=FH.errorOrDestroy;tr()(ci,VDe);function mGt(){}function U2(e,t,r){Rb=Rb||y0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Rb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=oGt(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){wGt(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 WDe(this)}U2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(U2.prototype,"buffer",{get:tGt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var bF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(bF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ci,Symbol.hasInstance,{value:function(t){return bF.call(this,t)?!0:this!==ci?!1:t&&t._writableState instanceof U2}})):bF=function(t){return t instanceof this};function ci(e){Rb=Rb||y0();var t=this instanceof Rb;if(!t&&!bF.call(ci,this))return new ci(e);this._writableState=new U2(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)),VDe.call(this)}ci.prototype.pipe=function(){jb(this,new lGt)};function gGt(e,t){var r=new hGt;jb(e,r),process.nextTick(t,r)}function vGt(e,t,r,n){var i;return r===null?i=new pGt:typeof r!="string"&&!t.objectMode&&(i=new sGt("chunk",["string","Buffer"],r)),i?(jb(e,i),process.nextTick(n,i),!1):!0}ci.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&iGt(e);return a&&!yF.isBuffer(e)&&(e=nGt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=mGt),n.ending?gGt(this,r):(a||vGt(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&&KDe(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 dGt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ci.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function bGt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=yF.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=bGt(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 DH(e,t,!1,s,n,i,a);return u}function DH(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new fGt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function xGt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(N2,e,t),e._writableState.errorEmitted=!0,jb(e,n)):(i(n),e._writableState.errorEmitted=!0,jb(e,n),N2(e,t))}function _Gt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function wGt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new cGt;if(_Gt(r),t)xGt(e,r,n,t,i);else{var a=$De(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&KDe(e,r),n?process.nextTick(HDe,e,r,a,i):HDe(e,r,a,i)}}function HDe(e,t,r,n){r||EGt(e,t),t.pendingcb--,n(),N2(e,t)}function EGt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function KDe(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,DH(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 WDe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(DH(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 uGt("_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||TGt(this,n,r),this};Object.defineProperty(ci.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function $De(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function AGt(e,t){e._final(function(r){t.pendingcb--,r&&jb(e,r),t.prefinished=!0,e.emit("prefinish"),N2(e,t)})}function SGt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(AGt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function N2(e,t){var r=$De(t);if(r&&(SGt(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 TGt(e,t,r){t.ending=!0,N2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function CGt(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=FH.destroy;ci.prototype._undestroy=FH.undestroy;ci.prototype._destroy=function(e,t){t(e)}});var y0=v((cCr,XDe)=>{"use strict";var DGt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};XDe.exports=jc;var JDe=IH(),OH=kH();tr()(jc,JDe);for(BH=DGt(OH.prototype),xF=0;xF<BH.length;xF++)_F=BH[xF],jc.prototype[_F]||(jc.prototype[_F]=OH.prototype[_F]);var BH,_F,xF;function jc(e){if(!(this instanceof jc))return new jc(e);JDe.call(this,e),OH.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",FGt)))}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 FGt(){this._writableState.ended||process.nextTick(kGt,this)}function kGt(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 jH=v(ZDe=>{"use strict";var RH=Gs().Buffer,QDe=RH.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 BGt(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 OGt(e){var t=BGt(e);if(typeof t!="string"&&(RH.isEncoding===QDe||!QDe(e)))throw new Error("Unknown encoding: "+e);return t||e}ZDe.StringDecoder=G2;function G2(e){this.encoding=OGt(e);var t;switch(this.encoding){case"utf16le":this.text=MGt,this.end=qGt,t=4;break;case"utf8":this.fillLast=RGt,t=4;break;case"base64":this.text=NGt,this.end=UGt,t=3;break;default:this.write=GGt,this.end=zGt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=RH.allocUnsafe(t)}G2.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||""};G2.prototype.end=LGt;G2.prototype.text=jGt;G2.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 PH(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function IGt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=PH(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=PH(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=PH(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function PGt(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 RGt(e){var t=this.lastTotal-this.lastNeed,r=PGt(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 jGt(e,t){var r=IGt(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 LGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function MGt(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 qGt(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 NGt(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 UGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function GGt(e){return e.toString(this.encoding)}function zGt(e){return e&&e.length?this.write(e):""}});var wF=v((fCr,r4e)=>{"use strict";var e4e=ih().codes.ERR_STREAM_PREMATURE_CLOSE;function HGt(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 WGt(){}function VGt(e){return e.setHeader&&typeof e.abort=="function"}function t4e(e,t,r){if(typeof t=="function")return t4e(e,null,t);t||(t={}),r=HGt(r||WGt);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(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new e4e),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new e4e),r.call(e,d)},p=function(){e.req.on("finish",s)};return VGt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):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",p),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)}}r4e.exports=t4e});var i4e=v((pCr,n4e)=>{"use strict";var EF;function oh(e,t,r){return t=KGt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function KGt(e){var t=$Gt(e,"string");return typeof t=="symbol"?t:String(t)}function $Gt(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 YGt=wF(),sh=Symbol("lastResolve"),x0=Symbol("lastReject"),z2=Symbol("error"),AF=Symbol("ended"),_0=Symbol("lastPromise"),LH=Symbol("handlePromise"),w0=Symbol("stream");function uh(e,t){return{value:e,done:t}}function JGt(e){var t=e[sh];if(t!==null){var r=e[w0].read();r!==null&&(e[_0]=null,e[sh]=null,e[x0]=null,t(uh(r,!1)))}}function XGt(e){process.nextTick(JGt,e)}function QGt(e,t){return function(r,n){e.then(function(){if(t[AF]){r(uh(void 0,!0));return}t[LH](r,n)},n)}}var ZGt=Object.getPrototypeOf(function(){}),ezt=Object.setPrototypeOf((EF={get stream(){return this[w0]},next:function(){var t=this,r=this[z2];if(r!==null)return Promise.reject(r);if(this[AF])return Promise.resolve(uh(void 0,!0));if(this[w0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[z2]?s(t[z2]):o(uh(void 0,!0))})});var n=this[_0],i;if(n)i=new Promise(QGt(n,this));else{var a=this[w0].read();if(a!==null)return Promise.resolve(uh(a,!1));i=new Promise(this[LH])}return this[_0]=i,i}},oh(EF,Symbol.asyncIterator,function(){return this}),oh(EF,"return",function(){var t=this;return new Promise(function(r,n){t[w0].destroy(null,function(i){if(i){n(i);return}r(uh(void 0,!0))})})}),EF),ZGt),tzt=function(t){var r,n=Object.create(ezt,(r={},oh(r,w0,{value:t,writable:!0}),oh(r,sh,{value:null,writable:!0}),oh(r,x0,{value:null,writable:!0}),oh(r,z2,{value:null,writable:!0}),oh(r,AF,{value:t._readableState.endEmitted,writable:!0}),oh(r,LH,{value:function(a,o){var s=n[w0].read();s?(n[_0]=null,n[sh]=null,n[x0]=null,a(uh(s,!1))):(n[sh]=a,n[x0]=o)},writable:!0}),r));return n[_0]=null,YGt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[x0];a!==null&&(n[_0]=null,n[sh]=null,n[x0]=null,a(i)),n[z2]=i;return}var o=n[sh];o!==null&&(n[_0]=null,n[sh]=null,n[x0]=null,o(uh(void 0,!0))),n[AF]=!0}),t.on("readable",XGt.bind(null,n)),n};n4e.exports=tzt});var u4e=v((hCr,s4e)=>{"use strict";function a4e(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 rzt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){a4e(a,n,i,o,s,"next",u)}function s(u){a4e(a,n,i,o,s,"throw",u)}o(void 0)})}}function o4e(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 nzt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?o4e(Object(r),!0).forEach(function(n){izt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function izt(e,t,r){return t=azt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function azt(e){var t=ozt(e,"string");return typeof t=="symbol"?t:String(t)}function ozt(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=ih().codes.ERR_INVALID_ARG_TYPE;function uzt(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 szt("iterable",["Iterable"],t);var i=new e(nzt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=rzt(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}s4e.exports=uzt});var IH=v((mCr,b4e)=>{"use strict";b4e.exports=Gr;var Lb;Gr.ReadableState=p4e;var dCr=require("events").EventEmitter,f4e=function(t,r){return t.listeners(r).length},W2=EH(),SF=require("buffer").Buffer,czt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function lzt(e){return SF.from(e)}function fzt(e){return SF.isBuffer(e)||e instanceof czt}var MH=require("util"),yr;MH&&MH.debuglog?yr=MH.debuglog("stream"):yr=function(){};var pzt=LDe(),WH=TH(),hzt=CH(),dzt=hzt.getHighWaterMark,TF=ih().codes,mzt=TF.ERR_INVALID_ARG_TYPE,gzt=TF.ERR_STREAM_PUSH_AFTER_EOF,vzt=TF.ERR_METHOD_NOT_IMPLEMENTED,bzt=TF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Mb,qH,NH;tr()(Gr,W2);var H2=WH.errorOrDestroy,UH=["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 p4e(e,t,r){Lb=Lb||y0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Lb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=dzt(this,e,"readableHighWaterMark",r),this.buffer=new pzt,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&&(Mb||(Mb=jH().StringDecoder),this.decoder=new Mb(e.encoding),this.encoding=e.encoding)}function Gr(e){if(Lb=Lb||y0(),!(this instanceof Gr))return new Gr(e);var t=this instanceof Lb;this._readableState=new p4e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),W2.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=WH.destroy;Gr.prototype._undestroy=WH.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=SF.from(e,t),t=""),n=!0),h4e(this,e,t,!1,n)};Gr.prototype.unshift=function(e){return h4e(this,e,null,!0,!1)};function h4e(e,t,r,n,i){yr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,wzt(e,a);else{var o;if(i||(o=xzt(a,t)),o)H2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==SF.prototype&&(t=lzt(t)),n)a.endEmitted?H2(e,new bzt):GH(e,a,t,!0);else if(a.ended)H2(e,new gzt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?GH(e,a,t,!1):HH(e,a)):GH(e,a,t,!1)}else n||(a.reading=!1,HH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function GH(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&&CF(e)),HH(e,t)}function xzt(e,t){var r;return!fzt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new mzt("chunk",["string","Buffer","Uint8Array"],t)),r}Gr.prototype.isPaused=function(){return this._readableState.flowing===!1};Gr.prototype.setEncoding=function(e){Mb||(Mb=jH().StringDecoder);var t=new Mb(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 c4e=1073741824;function _zt(e){return e>=c4e?e=c4e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function l4e(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=_zt(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):CF(this),null;if(e=l4e(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=l4e(r,t)));var i;return e>0?i=g4e(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 wzt(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?CF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,d4e(e)))}}function CF(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(d4e,e))}function d4e(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,VH(e)}function HH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Ezt,e,t))}function Ezt(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){H2(this,new vzt("_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=Azt(r);e.on("drain",u);var c=!1;function l(){yr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),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&&v4e(n.pipes,e)!==-1)&&!c&&(yr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){yr("onerror",g),b(),e.removeListener("error",p),f4e(e,"error")===0&&H2(e,g)}yzt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){yr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){yr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(yr("pipe resume"),r.resume()),e};function Azt(e){return function(){var r=e._readableState;yr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&f4e(e,"data")&&(r.flowing=!0,VH(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=v4e(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=W2.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?CF(this):n.reading||process.nextTick(Szt,this)),r};Gr.prototype.addListener=Gr.prototype.on;Gr.prototype.removeListener=function(e,t){var r=W2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(m4e,this),r};Gr.prototype.removeAllListeners=function(e){var t=W2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(m4e,this),t};function m4e(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 Szt(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,Tzt(this,e)),e.paused=!1,this};function Tzt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Czt,e,t))}function Czt(e,t){yr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),VH(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 VH(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<UH.length;a++)e.on(UH[a],this.emit.bind(this,UH[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 qH===void 0&&(qH=i4e()),qH(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=g4e;Object.defineProperty(Gr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function g4e(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(Dzt,t,e))}function Dzt(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 NH===void 0&&(NH=u4e()),NH(Gr,e,t)});function v4e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var KH=v((gCr,x4e)=>{"use strict";x4e.exports=Jl;var DF=ih().codes,Fzt=DF.ERR_METHOD_NOT_IMPLEMENTED,kzt=DF.ERR_MULTIPLE_CALLBACK,Bzt=DF.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ozt=DF.ERR_TRANSFORM_WITH_LENGTH_0,FF=y0();tr()(Jl,FF);function Izt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new kzt);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 Jl(e){if(!(this instanceof Jl))return new Jl(e);FF.call(this,e),this._transformState={afterTransform:Izt.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",Pzt)}function Pzt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){y4e(e,t,r)}):y4e(this,null,null)}Jl.prototype.push=function(e,t){return this._transformState.needTransform=!1,FF.prototype.push.call(this,e,t)};Jl.prototype._transform=function(e,t,r){r(new Fzt("_transform()"))};Jl.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)}};Jl.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};Jl.prototype._destroy=function(e,t){FF.prototype._destroy.call(this,e,function(r){t(r)})};function y4e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Ozt;if(e._transformState.transforming)throw new Bzt;return e.push(null)}});var E4e=v((vCr,w4e)=>{"use strict";w4e.exports=V2;var _4e=KH();tr()(V2,_4e);function V2(e){if(!(this instanceof V2))return new V2(e);_4e.call(this,e)}V2.prototype._transform=function(e,t,r){r(null,e)}});var D4e=v((bCr,C4e)=>{"use strict";var $H;function Rzt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var T4e=ih().codes,jzt=T4e.ERR_MISSING_ARGS,Lzt=T4e.ERR_STREAM_DESTROYED;function A4e(e){if(e)throw e}function Mzt(e){return e.setHeader&&typeof e.abort=="function"}function qzt(e,t,r,n){n=Rzt(n);var i=!1;e.on("close",function(){i=!0}),$H===void 0&&($H=wF()),$H(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,Mzt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Lzt("pipe"))}}}function S4e(e){e()}function Nzt(e,t){return e.pipe(t)}function Uzt(e){return!e.length||typeof e[e.length-1]!="function"?A4e:e.pop()}function Gzt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Uzt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new jzt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return qzt(o,u,c,function(l){i||(i=l),l&&a.forEach(S4e),!u&&(a.forEach(S4e),n(i))})});return t.reduce(Nzt)}C4e.exports=Gzt});var F4e=v((Is,$2)=>{var K2=require("stream");process.env.READABLE_STREAM==="disable"&&K2?($2.exports=K2.Readable,Object.assign($2.exports,K2),$2.exports.Stream=K2):(Is=$2.exports=IH(),Is.Stream=K2||Is,Is.Readable=Is,Is.Writable=kH(),Is.Duplex=y0(),Is.Transform=KH(),Is.PassThrough=E4e(),Is.finished=wF(),Is.pipeline=D4e())});var JH=v(YH=>{var k4e;(function(e){typeof DO_NOT_EXPORT_CRC>"u"?typeof YH=="object"?e(YH):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(k4e={}):e(k4e={})})(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],p=i[7],h=i[8],d=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++]]^d[k[P++]]^h[k[P++]]^p[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 O4e=v((xCr,B4e)=>{"use strict";var{Transform:zzt}=F4e(),Hzt=JH(),XH=class extends zzt{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(t,r,n){t&&(this.checksum=Hzt.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}};B4e.exports=XH});var P4e=v((_Cr,I4e)=>{"use strict";var{DeflateRaw:Wzt}=require("zlib"),Vzt=JH(),QH=class extends Wzt{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=Vzt.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}};I4e.exports=QH});var ZH=v((wCr,R4e)=>{"use strict";R4e.exports={CRC32Stream:O4e(),DeflateCRC32Stream:P4e()}});var M4e=v((TCr,L4e)=>{var Kzt=require("util").inherits,$zt=wH(),{CRC32Stream:Yzt}=ZH(),{DeflateCRC32Stream:Jzt}=ZH(),j4e=bH(),ECr=Uz(),ACr=qz(),sr=Nz(),SCr=gH(),Ut=tF(),ua=L4e.exports=function(e){if(!(this instanceof ua))return new ua(e);e=this.options=this._defaults(e),j4e.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}};Kzt(ua,j4e);ua.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()};ua.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($zt.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}};ua.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)};ua.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};ua.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()};ua.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}};ua.prototype._smartStream=function(e,t){var r=e.getMethod()===sr.METHOD_DEFLATED,n=r?new Jzt(this.options.zlib):new Yzt,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};ua.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)};ua.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))};ua.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)};ua.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())))};ua.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};ua.prototype.getComment=function(e){return this._archive.comment!==null?this._archive.comment:""};ua.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};ua.prototype.setComment=function(e){this._archive.comment=e}});var eW=v((CCr,q4e)=>{q4e.exports={ArchiveEntry:eF(),ZipArchiveEntry:Uz(),ArchiveOutputStream:bH(),ZipArchiveOutputStream:M4e()}});var U4e=v((DCr,N4e)=>{var Xzt=require("util").inherits,rW=eW().ZipArchiveOutputStream,Qzt=eW().ZipArchiveEntry,tW=Tb(),qb=N4e.exports=function(e){if(!(this instanceof qb))return new qb(e);e=this.options=e||{},e.zlib=e.zlib||{},rW.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)};Xzt(qb,rW);qb.prototype._normalizeFileData=function(e){e=tW.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=tW.sanitizePath(e.name),!r&&e.name.slice(-1)==="/"?(t=!0,e.type="directory"):t&&(e.name+="/")),(t||r)&&(e.store=!0),e.date=tW.dateify(e.date),e};qb.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 Qzt(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)),rW.prototype.entry.call(this,n,e,r)};qb.prototype.finalize=function(){this.finish()}});var z4e=v((FCr,G4e)=>{var Zzt=U4e(),eHt=Tb(),ch=function(e){if(!(this instanceof ch))return new ch(e);e=this.options=eHt.defaults(e,{comment:"",forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new Zzt(e)};ch.prototype.append=function(e,t,r){this.engine.entry(e,t,r)};ch.prototype.finalize=function(){this.engine.finalize()};ch.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};ch.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};ch.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};G4e.exports=ch});var aW=v(Ub=>{var tHt=Buffer.alloc,rHt="0000000000000000000",nHt="7777777777777777777",H4e="0".charCodeAt(0),W4e=Buffer.from("ustar\0","binary"),iHt=Buffer.from("00","binary"),aHt=Buffer.from("ustar ","binary"),oHt=Buffer.from(" \0","binary"),sHt=parseInt("7777",8),Y2=257,iW=263,uHt=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},cHt=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},lHt=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},V4e=function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},K4e=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},lh=function(e,t){return e=e.toString(8),e.length>t?nHt.slice(0,t)+" ":rHt.slice(0,t-e.length)+e+" "};function fHt(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 fh=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return fHt(e);for(;t<e.length&&e[t]===32;)t++;for(var n=uHt(V4e(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)},Nb=function(e,t,r,n){return e.slice(t,V4e(e,0,t,t+r)).toString(n)},nW=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};Ub.decodeLongPath=function(e,t){return Nb(e,0,e.length,t)};Ub.encodePax=function(e){var t="";e.name&&(t+=nW(" path="+e.name+`
|
|
171
171
|
`)),e.linkname&&(t+=nW(" linkpath="+e.linkname+`
|
|
172
172
|
`));var r=e.pax;if(r)for(var n in r)t+=nW(" "+n+"="+r[n]+`
|
|
173
|
-
`);return Buffer.from(t)};Ub.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};Ub.encode=function(e){var t=tHt(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(lh(e.mode&sHt,6),100),t.write(lh(e.uid,6),108),t.write(lh(e.gid,6),116),t.write(lh(e.size,11),124),t.write(lh(e.mtime.getTime()/1e3|0,11),136),t[156]=H4e+lHt(e.type),e.linkname&&t.write(e.linkname,157),W4e.copy(t,Y2),iHt.copy(t,iW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(lh(e.devmajor||0,6),329),t.write(lh(e.devminor||0,6),337),n&&t.write(n,345),t.write(lh(K4e(t),6),148),t)};Ub.decode=function(e,t,r){var n=e[156]===0?0:e[156]-H4e,i=Nb(e,0,100,t),a=fh(e,100,8),o=fh(e,108,8),s=fh(e,116,8),u=fh(e,124,12),c=fh(e,136,12),l=cHt(n),f=e[157]===0?null:Nb(e,157,100,t),p=Nb(e,265,32),h=Nb(e,297,32),d=fh(e,329,8),b=fh(e,337,8),g=K4e(e);if(g===8*32)return null;if(g!==fh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(W4e.compare(e,Y2,Y2+6)===0)e[345]&&(i=Nb(e,345,155,t)+"/"+i);else if(!(aHt.compare(e,Y2,Y2+6)===0&&oHt.compare(e,iW,iW+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:p,gname:h,devmajor:d,devminor:b}}});var oW=v((BCr,$4e)=>{$4e.exports=require("stream")});var eFe=v((OCr,Z4e)=>{"use strict";function Y4e(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 J4e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y4e(Object(r),!0).forEach(function(n){pHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pHt(e,t,r){return t=Q4e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X4e(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,Q4e(n.key),n)}}function dHt(e,t,r){return t&&X4e(e.prototype,t),r&&X4e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q4e(e){var t=mHt(e,"string");return typeof t=="symbol"?t:String(t)}function mHt(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 gHt=require("buffer"),kF=gHt.Buffer,vHt=require("util"),sW=vHt.inspect,bHt=sW&&sW.custom||"inspect";function yHt(e,t,r){kF.prototype.copy.call(e,t,r)}Z4e.exports=function(){function e(){hHt(this,e),this.head=null,this.tail=null,this.length=0}return dHt(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 kF.alloc(0);for(var n=kF.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=kF.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:bHt,value:function(r,n){return sW(this,J4e(J4e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var cW=v((ICr,rFe)=>{"use strict";function xHt(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(uW,this,e)):process.nextTick(uW,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(BF,r):(r._writableState.errorEmitted=!0,process.nextTick(tFe,r,a)):process.nextTick(tFe,r,a):t?(process.nextTick(BF,r),t(a)):process.nextTick(BF,r)}),this)}function tFe(e,t){uW(e,t),BF(e)}function BF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function _Ht(){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 uW(e,t){e.emit("error",t)}function wHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}rFe.exports={destroy:xHt,undestroy:_Ht,errorOrDestroy:wHt}});var ph=v((PCr,aFe)=>{"use strict";var iFe={};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,iFe[e]=i}function nFe(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 EHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function AHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function SHt(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"&&EHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(AHt(e," argument"))i=`The ${e} ${n} ${nFe(t,"type")}`;else{let a=SHt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${nFe(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");aFe.exports.codes=iFe});var lW=v((RCr,oFe)=>{"use strict";var THt=ph().codes.ERR_INVALID_OPT_VALUE;function CHt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function DHt(e,t,r,n){var i=CHt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new THt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}oFe.exports={getHighWaterMark:DHt}});var hW=v((jCr,pFe)=>{"use strict";pFe.exports=li;function uFe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){tWt(t,e)}}var Gb;li.WritableState=X2;var FHt={deprecate:pd()},cFe=oW(),IF=require("buffer").Buffer,kHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function BHt(e){return IF.from(e)}function OHt(e){return IF.isBuffer(e)||e instanceof kHt}var pW=cW(),IHt=lW(),PHt=IHt.getHighWaterMark,hh=ph().codes,RHt=hh.ERR_INVALID_ARG_TYPE,jHt=hh.ERR_METHOD_NOT_IMPLEMENTED,LHt=hh.ERR_MULTIPLE_CALLBACK,MHt=hh.ERR_STREAM_CANNOT_PIPE,qHt=hh.ERR_STREAM_DESTROYED,NHt=hh.ERR_STREAM_NULL_VALUES,UHt=hh.ERR_STREAM_WRITE_AFTER_END,GHt=hh.ERR_UNKNOWN_ENCODING,zb=pW.errorOrDestroy;tr()(li,cFe);function zHt(){}function X2(e,t,r){Gb=Gb||E0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Gb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=PHt(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){JHt(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 uFe(this)}X2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(X2.prototype,"buffer",{get:FHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var OF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(OF=Function.prototype[Symbol.hasInstance],Object.defineProperty(li,Symbol.hasInstance,{value:function(t){return OF.call(this,t)?!0:this!==li?!1:t&&t._writableState instanceof X2}})):OF=function(t){return t instanceof this};function li(e){Gb=Gb||E0();var t=this instanceof Gb;if(!t&&!OF.call(li,this))return new li(e);this._writableState=new X2(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)),cFe.call(this)}li.prototype.pipe=function(){zb(this,new MHt)};function HHt(e,t){var r=new UHt;zb(e,r),process.nextTick(t,r)}function WHt(e,t,r,n){var i;return r===null?i=new NHt:typeof r!="string"&&!t.objectMode&&(i=new RHt("chunk",["string","Buffer"],r)),i?(zb(e,i),process.nextTick(n,i),!1):!0}li.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&OHt(e);return a&&!IF.isBuffer(e)&&(e=BHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=zHt),n.ending?HHt(this,r):(a||WHt(this,n,e,r))&&(n.pendingcb++,i=KHt(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&&lFe(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 GHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(li.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function VHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=IF.from(t,r)),t}Object.defineProperty(li.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function KHt(e,t,r,n,i,a){if(!r){var o=VHt(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 fW(e,t,!1,s,n,i,a);return u}function fW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new qHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function $Ht(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(J2,e,t),e._writableState.errorEmitted=!0,zb(e,n)):(i(n),e._writableState.errorEmitted=!0,zb(e,n),J2(e,t))}function YHt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function JHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new LHt;if(YHt(r),t)$Ht(e,r,n,t,i);else{var a=fFe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&lFe(e,r),n?process.nextTick(sFe,e,r,a,i):sFe(e,r,a,i)}}function sFe(e,t,r,n){r||XHt(e,t),t.pendingcb--,n(),J2(e,t)}function XHt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function lFe(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,fW(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 uFe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(fW(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 jHt("_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||eWt(this,n,r),this};Object.defineProperty(li.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fFe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function QHt(e,t){e._final(function(r){t.pendingcb--,r&&zb(e,r),t.prefinished=!0,e.emit("prefinish"),J2(e,t)})}function ZHt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(QHt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function J2(e,t){var r=fFe(t);if(r&&(ZHt(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 eWt(e,t,r){t.ending=!0,J2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function tWt(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=pW.destroy;li.prototype._undestroy=pW.undestroy;li.prototype._destroy=function(e,t){t(e)}});var E0=v((LCr,dFe)=>{"use strict";var rWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};dFe.exports=Lc;var hFe=gW(),mW=hW();tr()(Lc,hFe);for(dW=rWt(mW.prototype),PF=0;PF<dW.length;PF++)RF=dW[PF],Lc.prototype[RF]||(Lc.prototype[RF]=mW.prototype[RF]);var dW,RF,PF;function Lc(e){if(!(this instanceof Lc))return new Lc(e);hFe.call(this,e),mW.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",nWt)))}Object.defineProperty(Lc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function nWt(){this._writableState.ended||process.nextTick(iWt,this)}function iWt(e){e.end()}Object.defineProperty(Lc.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 yW=v(gFe=>{"use strict";var bW=Gs().Buffer,mFe=bW.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 aWt(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 oWt(e){var t=aWt(e);if(typeof t!="string"&&(bW.isEncoding===mFe||!mFe(e)))throw new Error("Unknown encoding: "+e);return t||e}gFe.StringDecoder=Q2;function Q2(e){this.encoding=oWt(e);var t;switch(this.encoding){case"utf16le":this.text=pWt,this.end=hWt,t=4;break;case"utf8":this.fillLast=cWt,t=4;break;case"base64":this.text=dWt,this.end=mWt,t=3;break;default:this.write=gWt,this.end=vWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=bW.allocUnsafe(t)}Q2.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||""};Q2.prototype.end=fWt;Q2.prototype.text=lWt;Q2.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 vW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function sWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=vW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=vW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=vW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function uWt(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 cWt(e){var t=this.lastTotal-this.lastNeed,r=uWt(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 lWt(e,t){var r=sWt(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 fWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function pWt(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 hWt(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 dWt(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 mWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function gWt(e){return e.toString(this.encoding)}function vWt(e){return e&&e.length?this.write(e):""}});var jF=v((qCr,yFe)=>{"use strict";var vFe=ph().codes.ERR_STREAM_PREMATURE_CLOSE;function bWt(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 xWt(e){return e.setHeader&&typeof e.abort=="function"}function bFe(e,t,r){if(typeof t=="function")return bFe(e,null,t);t||(t={}),r=bWt(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(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new vFe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new vFe),r.call(e,d)},p=function(){e.req.on("finish",s)};return xWt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):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",p),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)}}yFe.exports=bFe});var _Fe=v((NCr,xFe)=>{"use strict";var LF;function dh(e,t,r){return t=_Wt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _Wt(e){var t=wWt(e,"string");return typeof t=="symbol"?t:String(t)}function wWt(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 EWt=jF(),mh=Symbol("lastResolve"),A0=Symbol("lastReject"),Z2=Symbol("error"),MF=Symbol("ended"),S0=Symbol("lastPromise"),xW=Symbol("handlePromise"),T0=Symbol("stream");function gh(e,t){return{value:e,done:t}}function AWt(e){var t=e[mh];if(t!==null){var r=e[T0].read();r!==null&&(e[S0]=null,e[mh]=null,e[A0]=null,t(gh(r,!1)))}}function SWt(e){process.nextTick(AWt,e)}function TWt(e,t){return function(r,n){e.then(function(){if(t[MF]){r(gh(void 0,!0));return}t[xW](r,n)},n)}}var CWt=Object.getPrototypeOf(function(){}),DWt=Object.setPrototypeOf((LF={get stream(){return this[T0]},next:function(){var t=this,r=this[Z2];if(r!==null)return Promise.reject(r);if(this[MF])return Promise.resolve(gh(void 0,!0));if(this[T0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[Z2]?s(t[Z2]):o(gh(void 0,!0))})});var n=this[S0],i;if(n)i=new Promise(TWt(n,this));else{var a=this[T0].read();if(a!==null)return Promise.resolve(gh(a,!1));i=new Promise(this[xW])}return this[S0]=i,i}},dh(LF,Symbol.asyncIterator,function(){return this}),dh(LF,"return",function(){var t=this;return new Promise(function(r,n){t[T0].destroy(null,function(i){if(i){n(i);return}r(gh(void 0,!0))})})}),LF),CWt),FWt=function(t){var r,n=Object.create(DWt,(r={},dh(r,T0,{value:t,writable:!0}),dh(r,mh,{value:null,writable:!0}),dh(r,A0,{value:null,writable:!0}),dh(r,Z2,{value:null,writable:!0}),dh(r,MF,{value:t._readableState.endEmitted,writable:!0}),dh(r,xW,{value:function(a,o){var s=n[T0].read();s?(n[S0]=null,n[mh]=null,n[A0]=null,a(gh(s,!1))):(n[mh]=a,n[A0]=o)},writable:!0}),r));return n[S0]=null,EWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[A0];a!==null&&(n[S0]=null,n[mh]=null,n[A0]=null,a(i)),n[Z2]=i;return}var o=n[mh];o!==null&&(n[S0]=null,n[mh]=null,n[A0]=null,o(gh(void 0,!0))),n[MF]=!0}),t.on("readable",SWt.bind(null,n)),n};xFe.exports=FWt});var SFe=v((UCr,AFe)=>{"use strict";function wFe(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 kWt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){wFe(a,n,i,o,s,"next",u)}function s(u){wFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function EFe(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 BWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EFe(Object(r),!0).forEach(function(n){OWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OWt(e,t,r){return t=IWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IWt(e){var t=PWt(e,"string");return typeof t=="symbol"?t:String(t)}function PWt(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 RWt=ph().codes.ERR_INVALID_ARG_TYPE;function jWt(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 RWt("iterable",["Iterable"],t);var i=new e(BWt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=kWt(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}AFe.exports=jWt});var gW=v((zCr,RFe)=>{"use strict";RFe.exports=zr;var Hb;zr.ReadableState=FFe;var GCr=require("events").EventEmitter,DFe=function(t,r){return t.listeners(r).length},tw=oW(),qF=require("buffer").Buffer,LWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function MWt(e){return qF.from(e)}function qWt(e){return qF.isBuffer(e)||e instanceof LWt}var _W=require("util"),xr;_W&&_W.debuglog?xr=_W.debuglog("stream"):xr=function(){};var NWt=eFe(),DW=cW(),UWt=lW(),GWt=UWt.getHighWaterMark,NF=ph().codes,zWt=NF.ERR_INVALID_ARG_TYPE,HWt=NF.ERR_STREAM_PUSH_AFTER_EOF,WWt=NF.ERR_METHOD_NOT_IMPLEMENTED,VWt=NF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Wb,wW,EW;tr()(zr,tw);var ew=DW.errorOrDestroy,AW=["error","close","destroy","pause","resume"];function KWt(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 FFe(e,t,r){Hb=Hb||E0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Hb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=GWt(this,e,"readableHighWaterMark",r),this.buffer=new NWt,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&&(Wb||(Wb=yW().StringDecoder),this.decoder=new Wb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Hb=Hb||E0(),!(this instanceof zr))return new zr(e);var t=this instanceof Hb;this._readableState=new FFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),tw.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=DW.destroy;zr.prototype._undestroy=DW.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=qF.from(e,t),t=""),n=!0),kFe(this,e,t,!1,n)};zr.prototype.unshift=function(e){return kFe(this,e,null,!0,!1)};function kFe(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,JWt(e,a);else{var o;if(i||(o=$Wt(a,t)),o)ew(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==qF.prototype&&(t=MWt(t)),n)a.endEmitted?ew(e,new VWt):SW(e,a,t,!0);else if(a.ended)ew(e,new HWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?SW(e,a,t,!1):CW(e,a)):SW(e,a,t,!1)}else n||(a.reading=!1,CW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function SW(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&&UF(e)),CW(e,t)}function $Wt(e,t){var r;return!qWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new zWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Wb||(Wb=yW().StringDecoder);var t=new Wb(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 TFe=1073741824;function YWt(e){return e>=TFe?e=TFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function CFe(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=YWt(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?TW(this):UF(this),null;if(e=CFe(e,t),e===0&&t.ended)return t.length===0&&TW(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=CFe(r,t)));var i;return e>0?i=IFe(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&&TW(this)),i!==null&&this.emit("data",i),i};function JWt(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?UF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,BFe(e)))}}function UF(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(BFe,e))}function BFe(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,FW(e)}function CW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(XWt,e,t))}function XWt(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){ew(this,new WWt("_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=QWt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),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&&PFe(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){xr("onerror",g),b(),e.removeListener("error",p),DFe(e,"error")===0&&ew(e,g)}KWt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){xr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function QWt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&DFe(e,"data")&&(r.flowing=!0,FW(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=PFe(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=tw.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?UF(this):n.reading||process.nextTick(ZWt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=tw.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(OFe,this),r};zr.prototype.removeAllListeners=function(e){var t=tw.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(OFe,this),t};function OFe(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 ZWt(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,eVt(this,e)),e.paused=!1,this};function eVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(tVt,e,t))}function tVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),FW(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 FW(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<AW.length;a++)e.on(AW[a],this.emit.bind(this,AW[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 wW===void 0&&(wW=_Fe()),wW(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=IFe;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function IFe(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 TW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(rVt,t,e))}function rVt(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 EW===void 0&&(EW=SFe()),EW(zr,e,t)});function PFe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var kW=v((HCr,LFe)=>{"use strict";LFe.exports=Xl;var GF=ph().codes,nVt=GF.ERR_METHOD_NOT_IMPLEMENTED,iVt=GF.ERR_MULTIPLE_CALLBACK,aVt=GF.ERR_TRANSFORM_ALREADY_TRANSFORMING,oVt=GF.ERR_TRANSFORM_WITH_LENGTH_0,zF=E0();tr()(Xl,zF);function sVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new iVt);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);zF.call(this,e),this._transformState={afterTransform:sVt.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",uVt)}function uVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){jFe(e,t,r)}):jFe(this,null,null)}Xl.prototype.push=function(e,t){return this._transformState.needTransform=!1,zF.prototype.push.call(this,e,t)};Xl.prototype._transform=function(e,t,r){r(new nVt("_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){zF.prototype._destroy.call(this,e,function(r){t(r)})};function jFe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new oVt;if(e._transformState.transforming)throw new aVt;return e.push(null)}});var NFe=v((WCr,qFe)=>{"use strict";qFe.exports=rw;var MFe=kW();tr()(rw,MFe);function rw(e){if(!(this instanceof rw))return new rw(e);MFe.call(this,e)}rw.prototype._transform=function(e,t,r){r(null,e)}});var WFe=v((VCr,HFe)=>{"use strict";var BW;function cVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var zFe=ph().codes,lVt=zFe.ERR_MISSING_ARGS,fVt=zFe.ERR_STREAM_DESTROYED;function UFe(e){if(e)throw e}function pVt(e){return e.setHeader&&typeof e.abort=="function"}function hVt(e,t,r,n){n=cVt(n);var i=!1;e.on("close",function(){i=!0}),BW===void 0&&(BW=jF()),BW(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,pVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new fVt("pipe"))}}}function GFe(e){e()}function dVt(e,t){return e.pipe(t)}function mVt(e){return!e.length||typeof e[e.length-1]!="function"?UFe:e.pop()}function gVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=mVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new lVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return hVt(o,u,c,function(l){i||(i=l),l&&a.forEach(GFe),!u&&(a.forEach(GFe),n(i))})});return t.reduce(dVt)}HFe.exports=gVt});var aw=v((Rs,iw)=>{var nw=require("stream");process.env.READABLE_STREAM==="disable"&&nw?(iw.exports=nw.Readable,Object.assign(iw.exports,nw),iw.exports.Stream=nw):(Rs=iw.exports=gW(),Rs.Stream=nw||Rs,Rs.Readable=Rs,Rs.Writable=hW(),Rs.Duplex=E0(),Rs.Transform=kW(),Rs.PassThrough=NFe(),Rs.finished=jF(),Rs.pipeline=WFe())});var QFe=v((KCr,XFe)=>{var KFe=require("util"),vVt=OL(),ow=aW(),$Fe=aw().Writable,YFe=aw().PassThrough,JFe=function(){},VFe=function(e){return e&=511,e&&512-e},bVt=function(e,t){var r=new HF(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},HF=function(e,t){this._parent=e,this.offset=t,YFe.call(this,{autoDestroy:!1})};KFe.inherits(HF,YFe);HF.prototype.destroy=function(e){this._parent.destroy(e)};var Ql=function(e){if(!(this instanceof Ql))return new Ql(e);$Fe.call(this,e),e=e||{},this._offset=0,this._buffer=vVt(),this._missing=0,this._partial=!1,this._onparse=JFe,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(p){if(t._locked=!1,p)return t.destroy(p);t._stream||n()},a=function(){t._stream=null;var p=VFe(t._header.size);p?t._parse(p,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(VFe(t._header.size)),t._parse(512,f),n()},s=function(){var p=t._header.size;t._paxGlobal=ow.decodePax(r.slice(0,p)),r.consume(p),a()},u=function(){var p=t._header.size;t._pax=ow.decodePax(r.slice(0,p)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(p),a()},c=function(){var p=t._header.size;this._gnuLongPath=ow.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},l=function(){var p=t._header.size;this._gnuLongLinkPath=ow.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},f=function(){var p=t._offset,h;try{h=t._header=ow.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(d){t.emit("error",d)}if(r.consume(512),!h){t._parse(512,f),n();return}if(h.type==="gnu-long-path"){t._parse(h.size,c),n();return}if(h.type==="gnu-long-link-path"){t._parse(h.size,l),n();return}if(h.type==="pax-global-header"){t._parse(h.size,s),n();return}if(h.type==="pax-header"){t._parse(h.size,u),n();return}if(t._gnuLongPath&&(h.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(h.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=h=yVt(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,f),t.emit("entry",h,bVt(t,p),i);return}t._stream=new HF(t,p),t.emit("entry",h,t._stream,i),t._parse(h.size,a),n()};this._onheader=f,this._parse(512,f)};KFe.inherits(Ql,$Fe);Ql.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Ql.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Ql.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=JFe,this._overflow?this._write(this._overflow,void 0,e):e()}};Ql.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()}};Ql.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};XFe.exports=Ql});var eke=v(($Cr,ZFe)=>{ZFe.exports=require("fs").constants||require("constants")});var nke=v((YCr,rke)=>{var xVt=M4(),_Vt=function(){},wVt=function(e){return e.setHeader&&typeof e.abort=="function"},EVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},tke=function(e,t,r){if(typeof t=="function")return tke(e,null,t);t||(t={}),r=xVt(r||_Vt);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)},p=function(g){r.call(e,g)},h=function(){process.nextTick(d)},d=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 wVt(e)?(e.on("complete",c),e.on("abort",h),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),EVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",p),e.on("close",h),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",h),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",p),e.removeListener("close",h)}};rke.exports=tke});var uke=v((JCr,ske)=>{var Vb=eke(),ike=nke(),VF=tr(),AVt=Buffer.alloc,ake=aw().Readable,Kb=aw().Writable,SVt=require("string_decoder").StringDecoder,WF=aW(),TVt=parseInt("755",8),CVt=parseInt("644",8),oke=AVt(1024),IW=function(){},OW=function(e,t){t&=511,t&&e.push(oke.slice(0,512-t))};function DVt(e){switch(e&Vb.S_IFMT){case Vb.S_IFBLK:return"block-device";case Vb.S_IFCHR:return"character-device";case Vb.S_IFDIR:return"directory";case Vb.S_IFIFO:return"fifo";case Vb.S_IFLNK:return"symlink"}return"file"}var KF=function(e){Kb.call(this),this.written=0,this._to=e,this._destroyed=!1};VF(KF,Kb);KF.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};KF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var $F=function(){Kb.call(this),this.linkname="",this._decoder=new SVt("utf-8"),this._destroyed=!1};VF($F,Kb);$F.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};$F.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var sw=function(){Kb.call(this),this._destroyed=!1};VF(sw,Kb);sw.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};sw.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Mc=function(e){if(!(this instanceof Mc))return new Mc(e);ake.call(this,e),this._drain=IW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};VF(Mc,ake);Mc.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=IW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=DVt(e.mode)),e.mode||(e.mode=e.type==="directory"?TVt:CVt),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 OW(n,e.size),i?process.nextTick(r):this._drain=r,new sw}if(e.type==="symlink"&&!e.linkname){var a=new $F;return ike(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 sw;var o=new KF(this);return this._stream=o,ike(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"));OW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Mc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(oke),this.push(null))};Mc.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())};Mc.prototype._encode=function(e){if(!e.pax){var t=WF.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Mc.prototype._encodePax=function(e){var t=WF.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(WF.encode(r)),this.push(t),OW(this,t.length),r.size=e.size,r.type=e.type,this.push(WF.encode(r))};Mc.prototype._read=function(e){var t=this._drain;this._drain=IW,t()};ske.exports=Mc});var cke=v(PW=>{PW.extract=QFe();PW.pack=uke()});var pke=v((QCr,fke)=>{var FVt=require("zlib"),kVt=cke(),lke=Tb(),Zl=function(e){if(!(this instanceof Zl))return new Zl(e);e=this.options=lke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=kVt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=FVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Zl.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Zl.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"&&lke.collectStream(e,i)};Zl.prototype.finalize=function(){this.engine.finalize()};Zl.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Zl.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)};Zl.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};fke.exports=Zl});var gke=v((ZCr,mke)=>{var BVt=require("util").inherits,hke=Rz().Transform,OVt=wH(),dke=Tb(),vh=function(e){if(!(this instanceof vh))return new vh(e);e=this.options=dke.defaults(e,{}),hke.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};BVt(vh,hke);vh.prototype._transform=function(e,t,r){r(null,e)};vh.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};vh.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=OVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&dke.collectStream(e,i)};vh.prototype.finalize=function(){this._writeStringified(),this.end()};mke.exports=vh});var bke=v((e8r,vke)=>{var IVt=f8e(),uw={},bh=function(e,t){return bh.create(e,t)};bh.create=function(e,t){if(uw[e]){var r=new IVt(e,t);return r.setFormat(e),r.setModule(new uw[e](t)),r}else throw new Error("create("+e+"): format not registered")};bh.registerFormat=function(e,t){if(uw[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");uw[e]=t};bh.isRegisteredFormat=function(e){return!!uw[e]};bh.registerFormat("zip",z4e());bh.registerFormat("tar",pke());bh.registerFormat("json",gke());vke.exports=bh});var AV=typeof process!="object"||String(process)!=="[object process]"||process.browser;var SV={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"]=SV||{};function er(e,t,r){return t<=e&&e<=r}function SOe(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function Rw(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function TOe(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 COe(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 Wo(e){return 0<=e&&e<=127}var Ho=Wo,Fr=-1;function Sk(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Sk.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 qs(e){throw TypeError("The code point "+e+" could not be encoded.")}function DOe(){}DOe.prototype={handler:function(e,t){}};function FOe(){}FOe.prototype={handler:function(e,t){}};function Ek(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ak,e)?Ak[e]:null}var TV=[{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"}],Ak={};TV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){Ak[r]=t})})});var ro={},no={};function M0(e,t){return t&&t[e]||null}function q0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ha(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 kOe(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Ha("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 BOe(e){if(e===59335)return 7457;var t=0,r=0,n=Ha("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 OOe(e){_k=_k||Ha("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=_k;return t.indexOf(e)}var _k;function IOe(e){wk=wk||Ha("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=wk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):q0(e,t)}var wk,CV="utf-8";function Eh(e,t){if(!(this instanceof Eh))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):CV,t=Rw(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=Ek(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!no[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(Eh.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Eh.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Eh.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Eh.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=Rw(r),this._do_not_flush||(this._decoder=no[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new Sk(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 SOe(["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)),COe(c)}return u.call(this,a)};function yy(e,t){if(!(this instanceof yy))throw TypeError("Called as a function. Did you forget 'new'?");t=Rw(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):CV;var n=Ek(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=Ek("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(yy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});yy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Rw(r),this._do_not_flush||(this._encoder=ro[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new Sk(TOe(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 POe(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(Ho(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}}ro["UTF-8"]=function(e){return new ROe(e)};no["UTF-8"]=function(e){return new POe(e)};function jOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Wo(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function LOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;var a=q0(i,e);return a===null&&qs(i),a+128}}(function(){"encoding-indexes"in globalThis&&TV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ha(r.toLowerCase());no[r]=function(i){return new jOe(n,i)},ro[r]=function(i){return new LOe(n,i)}})})})();no.GBK=function(e){return new DV(e)};ro.GBK=function(e){return new FV(e,!0)};function DV(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=kOe((((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:M0(l,Ha("gb18030")),s===null&&Wo(o)&&a.prepend(o),s===null?Dr(t):s}return Wo(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function FV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;if(i===58853)return qs(i);if(t&&i===8364)return 128;var a=q0(i,Ha("gb18030"));if(a!==null){var o=Kc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return qs(i);a=BOe(i);var c=Kc(a/10/126/10);a=a-c*10*126*10;var l=Kc(a/10/126);a=a-l*10*126;var f=Kc(a/10),p=a-f*10;return[c+129,l+48,f+129,p+48]}}ro.gb18030=function(e){return new FV(e)};no.gb18030=function(e){return new DV(e)};function MOe(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:M0(o,Ha("big5"));return u===null&&Wo(i)&&n.prepend(i),u===null?Dr(t):u}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function qOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=IOe(n);if(i===null)return qs(n);var a=Kc(i/157)+129;if(a<161)return qs(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}ro.Big5=function(e){return new qOe(e)};no.Big5=function(e){return new MOe(e)};function NOe(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=M0((o-161)*94+(a-161),Ha(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Wo(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(Ho(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=q0(n,Ha("jis0208"));if(i===null)return qs(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}ro["EUC-JP"]=function(e){return new UOe(e)};no["EUC-JP"]=function(e){return new NOe(e)};function GOe(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=M0(c,Ha("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 p=null;if(f===40&&u===66&&(p=r.ASCII),f===40&&u===74&&(p=r.Roman),f===40&&u===73&&(p=r.Katakana),f===36&&(u===64||u===66)&&(p=r.LeadByte),p!==null){n=n=p;var h=o;return o=!0,h?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function zOe(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 qs(65533);if(n===r.ASCII&&Ho(a))return a;if(n===r.Roman&&(Ho(a)&&a!==92&&a!==126||a==165||a==8254)){if(Ho(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Ho(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=q0(a,Ha("jis0208"));if(o===null)return qs(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Kc(o/94)+33,u=o%94+33;return[s,u]}}ro["ISO-2022-JP"]=function(e){return new zOe(e)};no["ISO-2022-JP"]=function(e){return new GOe(e)};function HOe(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:M0(o,Ha("jis0208"));return c===null&&Wo(i)&&n.prepend(i),c===null?Dr(t):c}return Wo(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 WOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(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=OOe(n);if(i===null)return qs(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}ro.Shift_JIS=function(e){return new WOe(e)};no.Shift_JIS=function(e){return new HOe(e)};function VOe(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:M0(o,Ha("euc-kr"));return o===null&&Wo(i)&&n.prepend(i),s===null?Dr(t):s}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function KOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=q0(n,Ha("euc-kr"));if(i===null)return qs(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}ro["EUC-KR"]=function(e){return new KOe(e)};no["EUC-KR"]=function(e){return new VOe(e)};function Pw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function kV(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(Pw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function BV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Pw(i,e);var a=Pw((i-65536>>10)+55296,e),o=Pw((i-65536&1023)+56320,e);return a.concat(o)}}ro["UTF-16BE"]=function(e){return new BV(!0,e)};no["UTF-16BE"]=function(e){return new kV(!0,e)};ro["UTF-16LE"]=function(e){return new BV(!1,e)};no["UTF-16LE"]=function(e){return new kV(!1,e)};function $Oe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Wo(n)?n:63360+n-128}}function YOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ho(n)?n:er(n,63360,63487)?n-63360+128:qs(n)}}ro["x-user-defined"]=function(e){return new YOe(e)};no["x-user-defined"]=function(e){return new $Oe(e)};function xy(e){return Buffer.from(e).toString("base64")}function Tk(e){return Buffer.from(e,"base64").toString("ascii")}var SY=Wt(EY(),1),TY=Wt(Dy(),1);function AY(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function cRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,TY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,SY.default)(n,r,t)}function CY(e,t){let r=cRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(AY(a))})})}var oae=Wt(aae(),1),FI=["image/png","image/jpeg","image/gif"];async function kI(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 _We(r,t)}function _We(e,t){return new Promise(r=>(0,oae.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 To(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 Xu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},uae=Xu.self||Xu.window||Xu.global||{},cae=Xu.window||Xu.self||Xu.global||{},lae=Xu.global||Xu.self||Xu.window||{},fae=Xu.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var sae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),wWe=sae&&parseFloat(sae[1])||0;function BI(e,t){return pae(e||{},t)}function pae(e,t){let r={...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=pae(r[n]||{},t[n]):r[n]=t[n];return r}var hae="latest";function EWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.1.0-alpha.3"),globalThis._loadersgl_.version}var Gh=EWe();function ma(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Qu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ctr=Qu.self||Qu.window||Qu.global||{},Dtr=Qu.window||Qu.self||Qu.global||{},Ftr=Qu.global||Qu.self||Qu.window||{},ktr=Qu.document||{};var ta=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ax=typeof importScripts=="function",mae=typeof window<"u"&&typeof window.orientation<"u",dae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Btr=dae&&parseFloat(dae[1])||0;var Sx=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){ma(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ma(this.isRunning),this.isRunning=!1,this._reject(t)}};var zh={};fa(zh,{NodeWorker:()=>Cx,parentPort:()=>AWe});var Tx=Wt(require("worker_threads"),1);by(zh,require("worker_threads"));var AWe=Tx==null?void 0:Tx.parentPort,Cx=Tx.Worker;var OI=new Map;function gae(e){ma(e.source&&!e.url||!e.source&&e.url);let t=OI.get(e.source||e.url);return t||(e.url&&(t=SWe(e.url),OI.set(e.url,t)),e.source&&(t=vae(e.source),OI.set(e.source,t))),ma(t),t}function SWe(e){if(!e.startsWith("http"))return e;let t=TWe(e);return vae(t)}function vae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function TWe(e){return`try {
|
|
173
|
+
`);return Buffer.from(t)};Ub.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};Ub.encode=function(e){var t=tHt(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(lh(e.mode&sHt,6),100),t.write(lh(e.uid,6),108),t.write(lh(e.gid,6),116),t.write(lh(e.size,11),124),t.write(lh(e.mtime.getTime()/1e3|0,11),136),t[156]=H4e+lHt(e.type),e.linkname&&t.write(e.linkname,157),W4e.copy(t,Y2),iHt.copy(t,iW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(lh(e.devmajor||0,6),329),t.write(lh(e.devminor||0,6),337),n&&t.write(n,345),t.write(lh(K4e(t),6),148),t)};Ub.decode=function(e,t,r){var n=e[156]===0?0:e[156]-H4e,i=Nb(e,0,100,t),a=fh(e,100,8),o=fh(e,108,8),s=fh(e,116,8),u=fh(e,124,12),c=fh(e,136,12),l=cHt(n),f=e[157]===0?null:Nb(e,157,100,t),p=Nb(e,265,32),h=Nb(e,297,32),d=fh(e,329,8),b=fh(e,337,8),g=K4e(e);if(g===8*32)return null;if(g!==fh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(W4e.compare(e,Y2,Y2+6)===0)e[345]&&(i=Nb(e,345,155,t)+"/"+i);else if(!(aHt.compare(e,Y2,Y2+6)===0&&oHt.compare(e,iW,iW+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:p,gname:h,devmajor:d,devminor:b}}});var oW=v((BCr,$4e)=>{$4e.exports=require("stream")});var eFe=v((OCr,Z4e)=>{"use strict";function Y4e(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 J4e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Y4e(Object(r),!0).forEach(function(n){pHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pHt(e,t,r){return t=Q4e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X4e(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,Q4e(n.key),n)}}function dHt(e,t,r){return t&&X4e(e.prototype,t),r&&X4e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q4e(e){var t=mHt(e,"string");return typeof t=="symbol"?t:String(t)}function mHt(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 gHt=require("buffer"),kF=gHt.Buffer,vHt=require("util"),sW=vHt.inspect,bHt=sW&&sW.custom||"inspect";function yHt(e,t,r){kF.prototype.copy.call(e,t,r)}Z4e.exports=function(){function e(){hHt(this,e),this.head=null,this.tail=null,this.length=0}return dHt(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 kF.alloc(0);for(var n=kF.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=kF.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:bHt,value:function(r,n){return sW(this,J4e(J4e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var cW=v((ICr,rFe)=>{"use strict";function xHt(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(uW,this,e)):process.nextTick(uW,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(BF,r):(r._writableState.errorEmitted=!0,process.nextTick(tFe,r,a)):process.nextTick(tFe,r,a):t?(process.nextTick(BF,r),t(a)):process.nextTick(BF,r)}),this)}function tFe(e,t){uW(e,t),BF(e)}function BF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function _Ht(){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 uW(e,t){e.emit("error",t)}function wHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}rFe.exports={destroy:xHt,undestroy:_Ht,errorOrDestroy:wHt}});var ph=v((PCr,aFe)=>{"use strict";var iFe={};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,iFe[e]=i}function nFe(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 EHt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function AHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function SHt(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"&&EHt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(AHt(e," argument"))i=`The ${e} ${n} ${nFe(t,"type")}`;else{let a=SHt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${nFe(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");aFe.exports.codes=iFe});var lW=v((RCr,oFe)=>{"use strict";var THt=ph().codes.ERR_INVALID_OPT_VALUE;function CHt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function DHt(e,t,r,n){var i=CHt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new THt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}oFe.exports={getHighWaterMark:DHt}});var hW=v((jCr,pFe)=>{"use strict";pFe.exports=li;function uFe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){tWt(t,e)}}var Gb;li.WritableState=X2;var FHt={deprecate:pd()},cFe=oW(),IF=require("buffer").Buffer,kHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function BHt(e){return IF.from(e)}function OHt(e){return IF.isBuffer(e)||e instanceof kHt}var pW=cW(),IHt=lW(),PHt=IHt.getHighWaterMark,hh=ph().codes,RHt=hh.ERR_INVALID_ARG_TYPE,jHt=hh.ERR_METHOD_NOT_IMPLEMENTED,LHt=hh.ERR_MULTIPLE_CALLBACK,MHt=hh.ERR_STREAM_CANNOT_PIPE,qHt=hh.ERR_STREAM_DESTROYED,NHt=hh.ERR_STREAM_NULL_VALUES,UHt=hh.ERR_STREAM_WRITE_AFTER_END,GHt=hh.ERR_UNKNOWN_ENCODING,zb=pW.errorOrDestroy;tr()(li,cFe);function zHt(){}function X2(e,t,r){Gb=Gb||E0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Gb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=PHt(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){JHt(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 uFe(this)}X2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(X2.prototype,"buffer",{get:FHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var OF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(OF=Function.prototype[Symbol.hasInstance],Object.defineProperty(li,Symbol.hasInstance,{value:function(t){return OF.call(this,t)?!0:this!==li?!1:t&&t._writableState instanceof X2}})):OF=function(t){return t instanceof this};function li(e){Gb=Gb||E0();var t=this instanceof Gb;if(!t&&!OF.call(li,this))return new li(e);this._writableState=new X2(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)),cFe.call(this)}li.prototype.pipe=function(){zb(this,new MHt)};function HHt(e,t){var r=new UHt;zb(e,r),process.nextTick(t,r)}function WHt(e,t,r,n){var i;return r===null?i=new NHt:typeof r!="string"&&!t.objectMode&&(i=new RHt("chunk",["string","Buffer"],r)),i?(zb(e,i),process.nextTick(n,i),!1):!0}li.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&OHt(e);return a&&!IF.isBuffer(e)&&(e=BHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=zHt),n.ending?HHt(this,r):(a||WHt(this,n,e,r))&&(n.pendingcb++,i=KHt(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&&lFe(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 GHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(li.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function VHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=IF.from(t,r)),t}Object.defineProperty(li.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function KHt(e,t,r,n,i,a){if(!r){var o=VHt(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 fW(e,t,!1,s,n,i,a);return u}function fW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new qHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function $Ht(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(J2,e,t),e._writableState.errorEmitted=!0,zb(e,n)):(i(n),e._writableState.errorEmitted=!0,zb(e,n),J2(e,t))}function YHt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function JHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new LHt;if(YHt(r),t)$Ht(e,r,n,t,i);else{var a=fFe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&lFe(e,r),n?process.nextTick(sFe,e,r,a,i):sFe(e,r,a,i)}}function sFe(e,t,r,n){r||XHt(e,t),t.pendingcb--,n(),J2(e,t)}function XHt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function lFe(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,fW(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 uFe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(fW(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 jHt("_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||eWt(this,n,r),this};Object.defineProperty(li.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function fFe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function QHt(e,t){e._final(function(r){t.pendingcb--,r&&zb(e,r),t.prefinished=!0,e.emit("prefinish"),J2(e,t)})}function ZHt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(QHt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function J2(e,t){var r=fFe(t);if(r&&(ZHt(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 eWt(e,t,r){t.ending=!0,J2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function tWt(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=pW.destroy;li.prototype._undestroy=pW.undestroy;li.prototype._destroy=function(e,t){t(e)}});var E0=v((LCr,dFe)=>{"use strict";var rWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};dFe.exports=Lc;var hFe=gW(),mW=hW();tr()(Lc,hFe);for(dW=rWt(mW.prototype),PF=0;PF<dW.length;PF++)RF=dW[PF],Lc.prototype[RF]||(Lc.prototype[RF]=mW.prototype[RF]);var dW,RF,PF;function Lc(e){if(!(this instanceof Lc))return new Lc(e);hFe.call(this,e),mW.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",nWt)))}Object.defineProperty(Lc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Lc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Lc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function nWt(){this._writableState.ended||process.nextTick(iWt,this)}function iWt(e){e.end()}Object.defineProperty(Lc.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 yW=v(gFe=>{"use strict";var bW=Gs().Buffer,mFe=bW.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 aWt(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 oWt(e){var t=aWt(e);if(typeof t!="string"&&(bW.isEncoding===mFe||!mFe(e)))throw new Error("Unknown encoding: "+e);return t||e}gFe.StringDecoder=Q2;function Q2(e){this.encoding=oWt(e);var t;switch(this.encoding){case"utf16le":this.text=pWt,this.end=hWt,t=4;break;case"utf8":this.fillLast=cWt,t=4;break;case"base64":this.text=dWt,this.end=mWt,t=3;break;default:this.write=gWt,this.end=vWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=bW.allocUnsafe(t)}Q2.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||""};Q2.prototype.end=fWt;Q2.prototype.text=lWt;Q2.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 vW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function sWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=vW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=vW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=vW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function uWt(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 cWt(e){var t=this.lastTotal-this.lastNeed,r=uWt(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 lWt(e,t){var r=sWt(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 fWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function pWt(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 hWt(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 dWt(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 mWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function gWt(e){return e.toString(this.encoding)}function vWt(e){return e&&e.length?this.write(e):""}});var jF=v((qCr,yFe)=>{"use strict";var vFe=ph().codes.ERR_STREAM_PREMATURE_CLOSE;function bWt(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 xWt(e){return e.setHeader&&typeof e.abort=="function"}function bFe(e,t,r){if(typeof t=="function")return bFe(e,null,t);t||(t={}),r=bWt(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(d){r.call(e,d)},f=function(){var d;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(d=new vFe),r.call(e,d);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(d=new vFe),r.call(e,d)},p=function(){e.req.on("finish",s)};return xWt(e)?(e.on("complete",s),e.on("abort",f),e.req?p():e.on("request",p)):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",p),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)}}yFe.exports=bFe});var _Fe=v((NCr,xFe)=>{"use strict";var LF;function dh(e,t,r){return t=_Wt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _Wt(e){var t=wWt(e,"string");return typeof t=="symbol"?t:String(t)}function wWt(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 EWt=jF(),mh=Symbol("lastResolve"),A0=Symbol("lastReject"),Z2=Symbol("error"),MF=Symbol("ended"),S0=Symbol("lastPromise"),xW=Symbol("handlePromise"),T0=Symbol("stream");function gh(e,t){return{value:e,done:t}}function AWt(e){var t=e[mh];if(t!==null){var r=e[T0].read();r!==null&&(e[S0]=null,e[mh]=null,e[A0]=null,t(gh(r,!1)))}}function SWt(e){process.nextTick(AWt,e)}function TWt(e,t){return function(r,n){e.then(function(){if(t[MF]){r(gh(void 0,!0));return}t[xW](r,n)},n)}}var CWt=Object.getPrototypeOf(function(){}),DWt=Object.setPrototypeOf((LF={get stream(){return this[T0]},next:function(){var t=this,r=this[Z2];if(r!==null)return Promise.reject(r);if(this[MF])return Promise.resolve(gh(void 0,!0));if(this[T0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[Z2]?s(t[Z2]):o(gh(void 0,!0))})});var n=this[S0],i;if(n)i=new Promise(TWt(n,this));else{var a=this[T0].read();if(a!==null)return Promise.resolve(gh(a,!1));i=new Promise(this[xW])}return this[S0]=i,i}},dh(LF,Symbol.asyncIterator,function(){return this}),dh(LF,"return",function(){var t=this;return new Promise(function(r,n){t[T0].destroy(null,function(i){if(i){n(i);return}r(gh(void 0,!0))})})}),LF),CWt),FWt=function(t){var r,n=Object.create(DWt,(r={},dh(r,T0,{value:t,writable:!0}),dh(r,mh,{value:null,writable:!0}),dh(r,A0,{value:null,writable:!0}),dh(r,Z2,{value:null,writable:!0}),dh(r,MF,{value:t._readableState.endEmitted,writable:!0}),dh(r,xW,{value:function(a,o){var s=n[T0].read();s?(n[S0]=null,n[mh]=null,n[A0]=null,a(gh(s,!1))):(n[mh]=a,n[A0]=o)},writable:!0}),r));return n[S0]=null,EWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[A0];a!==null&&(n[S0]=null,n[mh]=null,n[A0]=null,a(i)),n[Z2]=i;return}var o=n[mh];o!==null&&(n[S0]=null,n[mh]=null,n[A0]=null,o(gh(void 0,!0))),n[MF]=!0}),t.on("readable",SWt.bind(null,n)),n};xFe.exports=FWt});var SFe=v((UCr,AFe)=>{"use strict";function wFe(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 kWt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){wFe(a,n,i,o,s,"next",u)}function s(u){wFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function EFe(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 BWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?EFe(Object(r),!0).forEach(function(n){OWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function OWt(e,t,r){return t=IWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function IWt(e){var t=PWt(e,"string");return typeof t=="symbol"?t:String(t)}function PWt(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 RWt=ph().codes.ERR_INVALID_ARG_TYPE;function jWt(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 RWt("iterable",["Iterable"],t);var i=new e(BWt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=kWt(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}AFe.exports=jWt});var gW=v((zCr,RFe)=>{"use strict";RFe.exports=zr;var Hb;zr.ReadableState=FFe;var GCr=require("events").EventEmitter,DFe=function(t,r){return t.listeners(r).length},tw=oW(),qF=require("buffer").Buffer,LWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function MWt(e){return qF.from(e)}function qWt(e){return qF.isBuffer(e)||e instanceof LWt}var _W=require("util"),xr;_W&&_W.debuglog?xr=_W.debuglog("stream"):xr=function(){};var NWt=eFe(),DW=cW(),UWt=lW(),GWt=UWt.getHighWaterMark,NF=ph().codes,zWt=NF.ERR_INVALID_ARG_TYPE,HWt=NF.ERR_STREAM_PUSH_AFTER_EOF,WWt=NF.ERR_METHOD_NOT_IMPLEMENTED,VWt=NF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Wb,wW,EW;tr()(zr,tw);var ew=DW.errorOrDestroy,AW=["error","close","destroy","pause","resume"];function KWt(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 FFe(e,t,r){Hb=Hb||E0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Hb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=GWt(this,e,"readableHighWaterMark",r),this.buffer=new NWt,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&&(Wb||(Wb=yW().StringDecoder),this.decoder=new Wb(e.encoding),this.encoding=e.encoding)}function zr(e){if(Hb=Hb||E0(),!(this instanceof zr))return new zr(e);var t=this instanceof Hb;this._readableState=new FFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),tw.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=DW.destroy;zr.prototype._undestroy=DW.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=qF.from(e,t),t=""),n=!0),kFe(this,e,t,!1,n)};zr.prototype.unshift=function(e){return kFe(this,e,null,!0,!1)};function kFe(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,JWt(e,a);else{var o;if(i||(o=$Wt(a,t)),o)ew(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==qF.prototype&&(t=MWt(t)),n)a.endEmitted?ew(e,new VWt):SW(e,a,t,!0);else if(a.ended)ew(e,new HWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?SW(e,a,t,!1):CW(e,a)):SW(e,a,t,!1)}else n||(a.reading=!1,CW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function SW(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&&UF(e)),CW(e,t)}function $Wt(e,t){var r;return!qWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new zWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Wb||(Wb=yW().StringDecoder);var t=new Wb(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 TFe=1073741824;function YWt(e){return e>=TFe?e=TFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function CFe(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=YWt(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?TW(this):UF(this),null;if(e=CFe(e,t),e===0&&t.ended)return t.length===0&&TW(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=CFe(r,t)));var i;return e>0?i=IFe(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&&TW(this)),i!==null&&this.emit("data",i),i};function JWt(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?UF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,BFe(e)))}}function UF(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(BFe,e))}function BFe(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,FW(e)}function CW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(XWt,e,t))}function XWt(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){ew(this,new WWt("_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=QWt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",h),e.removeListener("finish",d),e.removeListener("drain",u),e.removeListener("error",p),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&&PFe(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(g){xr("onerror",g),b(),e.removeListener("error",p),DFe(e,"error")===0&&ew(e,g)}KWt(e,"error",p);function h(){e.removeListener("finish",d),b()}e.once("close",h);function d(){xr("onfinish"),e.removeListener("close",h),b()}e.once("finish",d);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function QWt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&DFe(e,"data")&&(r.flowing=!0,FW(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=PFe(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=tw.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?UF(this):n.reading||process.nextTick(ZWt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=tw.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(OFe,this),r};zr.prototype.removeAllListeners=function(e){var t=tw.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(OFe,this),t};function OFe(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 ZWt(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,eVt(this,e)),e.paused=!1,this};function eVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(tVt,e,t))}function tVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),FW(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 FW(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<AW.length;a++)e.on(AW[a],this.emit.bind(this,AW[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 wW===void 0&&(wW=_Fe()),wW(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=IFe;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function IFe(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 TW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(rVt,t,e))}function rVt(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 EW===void 0&&(EW=SFe()),EW(zr,e,t)});function PFe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var kW=v((HCr,LFe)=>{"use strict";LFe.exports=Xl;var GF=ph().codes,nVt=GF.ERR_METHOD_NOT_IMPLEMENTED,iVt=GF.ERR_MULTIPLE_CALLBACK,aVt=GF.ERR_TRANSFORM_ALREADY_TRANSFORMING,oVt=GF.ERR_TRANSFORM_WITH_LENGTH_0,zF=E0();tr()(Xl,zF);function sVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new iVt);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);zF.call(this,e),this._transformState={afterTransform:sVt.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",uVt)}function uVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){jFe(e,t,r)}):jFe(this,null,null)}Xl.prototype.push=function(e,t){return this._transformState.needTransform=!1,zF.prototype.push.call(this,e,t)};Xl.prototype._transform=function(e,t,r){r(new nVt("_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){zF.prototype._destroy.call(this,e,function(r){t(r)})};function jFe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new oVt;if(e._transformState.transforming)throw new aVt;return e.push(null)}});var NFe=v((WCr,qFe)=>{"use strict";qFe.exports=rw;var MFe=kW();tr()(rw,MFe);function rw(e){if(!(this instanceof rw))return new rw(e);MFe.call(this,e)}rw.prototype._transform=function(e,t,r){r(null,e)}});var WFe=v((VCr,HFe)=>{"use strict";var BW;function cVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var zFe=ph().codes,lVt=zFe.ERR_MISSING_ARGS,fVt=zFe.ERR_STREAM_DESTROYED;function UFe(e){if(e)throw e}function pVt(e){return e.setHeader&&typeof e.abort=="function"}function hVt(e,t,r,n){n=cVt(n);var i=!1;e.on("close",function(){i=!0}),BW===void 0&&(BW=jF()),BW(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,pVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new fVt("pipe"))}}}function GFe(e){e()}function dVt(e,t){return e.pipe(t)}function mVt(e){return!e.length||typeof e[e.length-1]!="function"?UFe:e.pop()}function gVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=mVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new lVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return hVt(o,u,c,function(l){i||(i=l),l&&a.forEach(GFe),!u&&(a.forEach(GFe),n(i))})});return t.reduce(dVt)}HFe.exports=gVt});var aw=v((Rs,iw)=>{var nw=require("stream");process.env.READABLE_STREAM==="disable"&&nw?(iw.exports=nw.Readable,Object.assign(iw.exports,nw),iw.exports.Stream=nw):(Rs=iw.exports=gW(),Rs.Stream=nw||Rs,Rs.Readable=Rs,Rs.Writable=hW(),Rs.Duplex=E0(),Rs.Transform=kW(),Rs.PassThrough=NFe(),Rs.finished=jF(),Rs.pipeline=WFe())});var QFe=v((KCr,XFe)=>{var KFe=require("util"),vVt=OL(),ow=aW(),$Fe=aw().Writable,YFe=aw().PassThrough,JFe=function(){},VFe=function(e){return e&=511,e&&512-e},bVt=function(e,t){var r=new HF(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},HF=function(e,t){this._parent=e,this.offset=t,YFe.call(this,{autoDestroy:!1})};KFe.inherits(HF,YFe);HF.prototype.destroy=function(e){this._parent.destroy(e)};var Ql=function(e){if(!(this instanceof Ql))return new Ql(e);$Fe.call(this,e),e=e||{},this._offset=0,this._buffer=vVt(),this._missing=0,this._partial=!1,this._onparse=JFe,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(p){if(t._locked=!1,p)return t.destroy(p);t._stream||n()},a=function(){t._stream=null;var p=VFe(t._header.size);p?t._parse(p,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(VFe(t._header.size)),t._parse(512,f),n()},s=function(){var p=t._header.size;t._paxGlobal=ow.decodePax(r.slice(0,p)),r.consume(p),a()},u=function(){var p=t._header.size;t._pax=ow.decodePax(r.slice(0,p)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(p),a()},c=function(){var p=t._header.size;this._gnuLongPath=ow.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},l=function(){var p=t._header.size;this._gnuLongLinkPath=ow.decodeLongPath(r.slice(0,p),e.filenameEncoding),r.consume(p),a()},f=function(){var p=t._offset,h;try{h=t._header=ow.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(d){t.emit("error",d)}if(r.consume(512),!h){t._parse(512,f),n();return}if(h.type==="gnu-long-path"){t._parse(h.size,c),n();return}if(h.type==="gnu-long-link-path"){t._parse(h.size,l),n();return}if(h.type==="pax-global-header"){t._parse(h.size,s),n();return}if(h.type==="pax-header"){t._parse(h.size,u),n();return}if(t._gnuLongPath&&(h.name=t._gnuLongPath,t._gnuLongPath=null),t._gnuLongLinkPath&&(h.linkname=t._gnuLongLinkPath,t._gnuLongLinkPath=null),t._pax&&(t._header=h=yVt(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,f),t.emit("entry",h,bVt(t,p),i);return}t._stream=new HF(t,p),t.emit("entry",h,t._stream,i),t._parse(h.size,a),n()};this._onheader=f,this._parse(512,f)};KFe.inherits(Ql,$Fe);Ql.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Ql.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Ql.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=JFe,this._overflow?this._write(this._overflow,void 0,e):e()}};Ql.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()}};Ql.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};XFe.exports=Ql});var eke=v(($Cr,ZFe)=>{ZFe.exports=require("fs").constants||require("constants")});var nke=v((YCr,rke)=>{var xVt=M4(),_Vt=function(){},wVt=function(e){return e.setHeader&&typeof e.abort=="function"},EVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},tke=function(e,t,r){if(typeof t=="function")return tke(e,null,t);t||(t={}),r=xVt(r||_Vt);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)},p=function(g){r.call(e,g)},h=function(){process.nextTick(d)},d=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 wVt(e)?(e.on("complete",c),e.on("abort",h),e.req?b():e.on("request",b)):o&&!n&&(e.on("end",u),e.on("close",u)),EVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",p),e.on("close",h),function(){s=!0,e.removeListener("complete",c),e.removeListener("abort",h),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",p),e.removeListener("close",h)}};rke.exports=tke});var uke=v((JCr,ske)=>{var Vb=eke(),ike=nke(),VF=tr(),AVt=Buffer.alloc,ake=aw().Readable,Kb=aw().Writable,SVt=require("string_decoder").StringDecoder,WF=aW(),TVt=parseInt("755",8),CVt=parseInt("644",8),oke=AVt(1024),IW=function(){},OW=function(e,t){t&=511,t&&e.push(oke.slice(0,512-t))};function DVt(e){switch(e&Vb.S_IFMT){case Vb.S_IFBLK:return"block-device";case Vb.S_IFCHR:return"character-device";case Vb.S_IFDIR:return"directory";case Vb.S_IFIFO:return"fifo";case Vb.S_IFLNK:return"symlink"}return"file"}var KF=function(e){Kb.call(this),this.written=0,this._to=e,this._destroyed=!1};VF(KF,Kb);KF.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};KF.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var $F=function(){Kb.call(this),this.linkname="",this._decoder=new SVt("utf-8"),this._destroyed=!1};VF($F,Kb);$F.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};$F.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var sw=function(){Kb.call(this),this._destroyed=!1};VF(sw,Kb);sw.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};sw.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Mc=function(e){if(!(this instanceof Mc))return new Mc(e);ake.call(this,e),this._drain=IW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};VF(Mc,ake);Mc.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=IW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=DVt(e.mode)),e.mode||(e.mode=e.type==="directory"?TVt:CVt),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 OW(n,e.size),i?process.nextTick(r):this._drain=r,new sw}if(e.type==="symlink"&&!e.linkname){var a=new $F;return ike(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 sw;var o=new KF(this);return this._stream=o,ike(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"));OW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Mc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(oke),this.push(null))};Mc.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())};Mc.prototype._encode=function(e){if(!e.pax){var t=WF.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Mc.prototype._encodePax=function(e){var t=WF.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(WF.encode(r)),this.push(t),OW(this,t.length),r.size=e.size,r.type=e.type,this.push(WF.encode(r))};Mc.prototype._read=function(e){var t=this._drain;this._drain=IW,t()};ske.exports=Mc});var cke=v(PW=>{PW.extract=QFe();PW.pack=uke()});var pke=v((QCr,fke)=>{var FVt=require("zlib"),kVt=cke(),lke=Tb(),Zl=function(e){if(!(this instanceof Zl))return new Zl(e);e=this.options=lke.defaults(e,{gzip:!1}),typeof e.gzipOptions!="object"&&(e.gzipOptions={}),this.supports={directory:!0,symlink:!0},this.engine=kVt.pack(e),this.compressor=!1,e.gzip&&(this.compressor=FVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Zl.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Zl.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"&&lke.collectStream(e,i)};Zl.prototype.finalize=function(){this.engine.finalize()};Zl.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Zl.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)};Zl.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};fke.exports=Zl});var gke=v((ZCr,mke)=>{var BVt=require("util").inherits,hke=Rz().Transform,OVt=wH(),dke=Tb(),vh=function(e){if(!(this instanceof vh))return new vh(e);e=this.options=dke.defaults(e,{}),hke.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};BVt(vh,hke);vh.prototype._transform=function(e,t,r){r(null,e)};vh.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};vh.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=OVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&dke.collectStream(e,i)};vh.prototype.finalize=function(){this._writeStringified(),this.end()};mke.exports=vh});var bke=v((e8r,vke)=>{var IVt=f8e(),uw={},bh=function(e,t){return bh.create(e,t)};bh.create=function(e,t){if(uw[e]){var r=new IVt(e,t);return r.setFormat(e),r.setModule(new uw[e](t)),r}else throw new Error("create("+e+"): format not registered")};bh.registerFormat=function(e,t){if(uw[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");uw[e]=t};bh.isRegisteredFormat=function(e){return!!uw[e]};bh.registerFormat("zip",z4e());bh.registerFormat("tar",pke());bh.registerFormat("json",gke());vke.exports=bh});var AV=typeof process!="object"||String(process)!=="[object process]"||process.browser;var SV={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"]=SV||{};function er(e,t,r){return t<=e&&e<=r}function SOe(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function Rw(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function TOe(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 COe(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 Wo(e){return 0<=e&&e<=127}var Ho=Wo,Fr=-1;function Sk(e){this.tokens=[].slice.call(e),this.tokens.reverse()}Sk.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 qs(e){throw TypeError("The code point "+e+" could not be encoded.")}function DOe(){}DOe.prototype={handler:function(e,t){}};function FOe(){}FOe.prototype={handler:function(e,t){}};function Ek(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Ak,e)?Ak[e]:null}var TV=[{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"}],Ak={};TV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){Ak[r]=t})})});var ro={},no={};function M0(e,t){return t&&t[e]||null}function q0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ha(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 kOe(e){if(e>39419&&e<189e3||e>1237575)return null;if(e===7457)return 59335;var t=0,r=0,n=Ha("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 BOe(e){if(e===59335)return 7457;var t=0,r=0,n=Ha("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 OOe(e){_k=_k||Ha("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=_k;return t.indexOf(e)}var _k;function IOe(e){wk=wk||Ha("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=wk;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):q0(e,t)}var wk,CV="utf-8";function Eh(e,t){if(!(this instanceof Eh))throw TypeError("Called as a function. Did you forget 'new'?");e=e!==void 0?String(e):CV,t=Rw(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=Ek(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!no[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(Eh.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(Eh.prototype,"fatal",{get:function(){return this._error_mode==="fatal"}}),Object.defineProperty(Eh.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}}));Eh.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=Rw(r),this._do_not_flush||(this._decoder=no[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new Sk(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 SOe(["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)),COe(c)}return u.call(this,a)};function yy(e,t){if(!(this instanceof yy))throw TypeError("Called as a function. Did you forget 'new'?");t=Rw(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):CV;var n=Ek(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=Ek("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(yy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});yy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=Rw(r),this._do_not_flush||(this._encoder=ro[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new Sk(TOe(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 POe(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(Ho(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}}ro["UTF-8"]=function(e){return new ROe(e)};no["UTF-8"]=function(e){return new POe(e)};function jOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Wo(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function LOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;var a=q0(i,e);return a===null&&qs(i),a+128}}(function(){"encoding-indexes"in globalThis&&TV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ha(r.toLowerCase());no[r]=function(i){return new jOe(n,i)},ro[r]=function(i){return new LOe(n,i)}})})})();no.GBK=function(e){return new DV(e)};ro.GBK=function(e){return new FV(e,!0)};function DV(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=kOe((((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:M0(l,Ha("gb18030")),s===null&&Wo(o)&&a.prepend(o),s===null?Dr(t):s}return Wo(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function FV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(Ho(i))return i;if(i===58853)return qs(i);if(t&&i===8364)return 128;var a=q0(i,Ha("gb18030"));if(a!==null){var o=Kc(a/190)+129,s=a%190,u=s<63?64:65;return[o,s+u]}if(t)return qs(i);a=BOe(i);var c=Kc(a/10/126/10);a=a-c*10*126*10;var l=Kc(a/10/126);a=a-l*10*126;var f=Kc(a/10),p=a-f*10;return[c+129,l+48,f+129,p+48]}}ro.gb18030=function(e){return new FV(e)};no.gb18030=function(e){return new DV(e)};function MOe(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:M0(o,Ha("big5"));return u===null&&Wo(i)&&n.prepend(i),u===null?Dr(t):u}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function qOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=IOe(n);if(i===null)return qs(n);var a=Kc(i/157)+129;if(a<161)return qs(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}ro.Big5=function(e){return new qOe(e)};no.Big5=function(e){return new MOe(e)};function NOe(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=M0((o-161)*94+(a-161),Ha(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Wo(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(Ho(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=q0(n,Ha("jis0208"));if(i===null)return qs(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}ro["EUC-JP"]=function(e){return new UOe(e)};no["EUC-JP"]=function(e){return new NOe(e)};function GOe(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=M0(c,Ha("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 p=null;if(f===40&&u===66&&(p=r.ASCII),f===40&&u===74&&(p=r.Roman),f===40&&u===73&&(p=r.Katakana),f===36&&(u===64||u===66)&&(p=r.LeadByte),p!==null){n=n=p;var h=o;return o=!0,h?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function zOe(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 qs(65533);if(n===r.ASCII&&Ho(a))return a;if(n===r.Roman&&(Ho(a)&&a!==92&&a!==126||a==165||a==8254)){if(Ho(a))return a;if(a===165)return 92;if(a===8254)return 126}if(Ho(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=q0(a,Ha("jis0208"));if(o===null)return qs(a);if(n!==r.jis0208)return i.prepend(a),n=r.jis0208,[27,36,66];var s=Kc(o/94)+33,u=o%94+33;return[s,u]}}ro["ISO-2022-JP"]=function(e){return new zOe(e)};no["ISO-2022-JP"]=function(e){return new GOe(e)};function HOe(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:M0(o,Ha("jis0208"));return c===null&&Wo(i)&&n.prepend(i),c===null?Dr(t):c}return Wo(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 WOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(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=OOe(n);if(i===null)return qs(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}ro.Shift_JIS=function(e){return new WOe(e)};no.Shift_JIS=function(e){return new HOe(e)};function VOe(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:M0(o,Ha("euc-kr"));return o===null&&Wo(i)&&n.prepend(i),s===null?Dr(t):s}return Wo(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function KOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return xn;if(Ho(n))return n;var i=q0(n,Ha("euc-kr"));if(i===null)return qs(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}ro["EUC-KR"]=function(e){return new KOe(e)};no["EUC-KR"]=function(e){return new VOe(e)};function Pw(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function kV(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(Pw(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function BV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return xn;if(er(i,0,65535))return Pw(i,e);var a=Pw((i-65536>>10)+55296,e),o=Pw((i-65536&1023)+56320,e);return a.concat(o)}}ro["UTF-16BE"]=function(e){return new BV(!0,e)};no["UTF-16BE"]=function(e){return new kV(!0,e)};ro["UTF-16LE"]=function(e){return new BV(!1,e)};no["UTF-16LE"]=function(e){return new kV(!1,e)};function $Oe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Wo(n)?n:63360+n-128}}function YOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?xn:Ho(n)?n:er(n,63360,63487)?n-63360+128:qs(n)}}ro["x-user-defined"]=function(e){return new YOe(e)};no["x-user-defined"]=function(e){return new $Oe(e)};function xy(e){return Buffer.from(e).toString("base64")}function Tk(e){return Buffer.from(e,"base64").toString("ascii")}var SY=Wt(EY(),1),TY=Wt(Dy(),1);function AY(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function cRe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,TY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,SY.default)(n,r,t)}function CY(e,t){let r=cRe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(AY(a))})})}var oae=Wt(aae(),1),FI=["image/png","image/jpeg","image/gif"];async function kI(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 _We(r,t)}function _We(e,t){return new Promise(r=>(0,oae.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 To(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 Xu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},uae=Xu.self||Xu.window||Xu.global||{},cae=Xu.window||Xu.self||Xu.global||{},lae=Xu.global||Xu.self||Xu.window||{},fae=Xu.document||{};var gn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var sae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),wWe=sae&&parseFloat(sae[1])||0;function BI(e,t){return pae(e||{},t)}function pae(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]=pae(n[i]||{},t[i],r+1):n[i]=t[i];return n}var hae="latest";function EWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.1.0-alpha.4"),globalThis._loadersgl_.version}var Gh=EWe();function ma(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Qu={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Ctr=Qu.self||Qu.window||Qu.global||{},Dtr=Qu.window||Qu.self||Qu.global||{},Ftr=Qu.global||Qu.self||Qu.window||{},ktr=Qu.document||{};var ta=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ax=typeof importScripts=="function",mae=typeof window<"u"&&typeof window.orientation<"u",dae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Btr=dae&&parseFloat(dae[1])||0;var Sx=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){ma(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ma(this.isRunning),this.isRunning=!1,this._reject(t)}};var zh={};fa(zh,{NodeWorker:()=>Cx,parentPort:()=>AWe});var Tx=Wt(require("worker_threads"),1);by(zh,require("worker_threads"));var AWe=Tx==null?void 0:Tx.parentPort,Cx=Tx.Worker;var OI=new Map;function gae(e){ma(e.source&&!e.url||!e.source&&e.url);let t=OI.get(e.source||e.url);return t||(e.url&&(t=SWe(e.url),OI.set(e.url,t)),e.source&&(t=vae(e.source),OI.set(e.source,t))),ma(t),t}function SWe(e){if(!e.startsWith("http"))return e;let t=TWe(e);return vae(t)}function vae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function TWe(e){return`try {
|
|
174
174
|
importScripts('${e}');
|
|
175
175
|
} catch (error) {
|
|
176
176
|
console.error(error);
|
|
177
177
|
throw error;
|
|
178
178
|
}`}function II(e,t=!0,r){let n=r||new Set;if(e){if(bae(e))n.add(e);else if(bae(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)II(e[i],t,n)}}return r===void 0?Array.from(n):[]}function bae(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 PI(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]=PI(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var RI=()=>{},jf=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&ta||typeof Cx<"u"&&!ta}constructor(t){let{name:r,source:n,url:i}=t;ma(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=RI,this.onError=a=>console.log(a),this.worker=ta?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=RI,this.onError=RI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||II(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=gae({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 Cx(n,{eval:!1})}else if(this.source)t=new Cx(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 Dx=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return jf.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 Sx(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){!ta||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 jf({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return mae?this.maxMobileConcurrency:this.maxConcurrency}};var CWe={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Hh=class{props;workerPools=new Map;static isSupported(){return jf.isSupported()}static getWorkerFarm(t={}){return Hh._workerFarm=Hh._workerFarm||new Hh({}),Hh._workerFarm.setProps(t),Hh._workerFarm}constructor(t){this.props={...CWe},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 Dx({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}}},La=Hh;EV(La,"_workerFarm");function yae(e){let t=e.version!==Gh?` (worker-utils@${Gh})`:"";return`${e.name}@${e.version}${t}`}function Fx(e,t={}){let r=t[e.id]||{},n=ta?`${e.id}-worker.js`:`${e.id}-worker-node.js`,i=r.workerUrl;if(!i&&e.id==="compression"&&(i=t.workerUrl),t._workerType==="test"&&(ta?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=hae);let o=a?`@${a}`:"";i=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return ma(i),i}async function jI(e,t,r={},n={}){let i=yae(e),a=La.getWorkerFarm(r),{source:o}=r,s={name:i,source:o};o||(s.url=Fx(e,r));let u=a.getWorkerPool(s),c=r.jobName||e.name,l=await u.startJob(c,DWe.bind(null,n)),f=PI(r);return l.postMessage("process",{input:t,options:f}),(await l.result).result}async function DWe(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 LI(e,t=Gh){ma(e,"no worker provided");let r=e.version;return!(!t||!r)}var qI={};fa(qI,{readFileAsArrayBuffer:()=>kA,readFileAsText:()=>BA,requireFromFile:()=>OA,requireFromString:()=>Fm});var MI=Wt(require("module"),1),xae=Wt(require("path"),1),kx=Wt(require("fs"),1);async function kA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():kx.readFileSync(e).buffer}async function BA(e){return e.startsWith("http")?await(await fetch(e)).text():kx.readFileSync(e,"utf8")}async function OA(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return Fm(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await kx.promises.readFile(e,"utf8");return Fm(t)}function Fm(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=MI.default._nodeModulePaths(xae.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new MI.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 NI={};async function Zu(e,t=null,r={},n=null){return t&&(e=_ae(e,t,r,n)),NI[e]=NI[e]||FWe(e),await NI[e]}function _ae(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]:ta?r.CDN?(ma(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Gh}/dist/libs/${n}`):Ax?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function FWe(e){if(e.endsWith("wasm"))return await BWe(e);if(!ta)try{return qI&&OA&&await OA(e)}catch(r){return console.error(r),null}if(Ax)return importScripts(e);let t=await OWe(e);return kWe(t,e)}function kWe(e,t){if(!ta)return Fm&&Fm(e,t);if(Ax)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 BWe(e){return ta||!kA||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await kA(e)}async function OWe(e){return ta||!BA||e.startsWith("http")?await(await fetch(e)).text():await BA(e)}var Sae=Wt(require("child_process"),1);var wae=Wt(require("child_process"),1);function Eae(e=3e3){return new Promise(t=>{wae.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 Aae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...Aae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Aae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await Eae(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=Sae.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 UI(e,t){return!La.isSupported()||!ta&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function GI(e,t,r,n,i){let a=e.id,o=Fx(e,r),u=La.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",IWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function IWe(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 zI(e,t){return!La.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Cae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Tae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Tae(e,0,t):""}function Tae(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 HI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Cae(e)}"`)}}function ec(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 tc(...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 Co(...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 Wh(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 Do(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function WI(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+Do(n.byteLength,4)}function VI(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 km(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Bx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function IA(e,t,r,n){let i=Do(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 Bm(e,t,r,n){let a=new TextEncoder().encode(r);return t=IA(e,t,a,n),t}async function Vh(e){let t=[];for await(let r of e)t.push(r);return tc(...t)}function Lf(e){return Lf=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},Lf(e)}function KI(e,t){if(Lf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Lf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $I(e){var t=KI(e,"string");return Lf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=$I(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var PWe="",Dae={};function rc(e){for(let t in Dae)if(e.startsWith(t)){let r=Dae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${PWe}${e}`),e}var RWe="4.1.0-alpha.3",YI={name:"JSON",id:"json",module:"json",version:RWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Fae,parse:async e=>Fae(new TextDecoder().decode(e)),options:{}};function Fae(e){return JSON.parse(e)}function kae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Bae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(Bae(e))return kae(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 Om(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var tu={};fa(tu,{dirname:()=>MWe,filename:()=>LWe,join:()=>qWe,resolve:()=>NWe});function Oae(){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 LWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function MWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function qWe(...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 NWe(...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=Oae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Ox)}return r=UWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Ox=47,JI=46;function UWe(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===Ox)break;a=Ox}if(a===Ox){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==JI||r.charCodeAt(r.length-2)!==JI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Ox;--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===JI&&i!==-1?++i:i=-1}return r}var Ix=new Error("Not implemented"),Kh=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 Ix}async write(t,r,n){throw Ix}async stat(){throw Ix}async truncate(t){throw Ix}async append(t){throw Ix}async close(){}};var XI=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Px=class{file;constructor(t,r=!1){this.file=new Kh(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 pl=Wt(require("fs"),1),$h=class{handle;size;bigsize;url;constructor(t,r,n){t=rc(t),this.handle=pl.default.openSync(t,r,n);let i=pl.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)=>{pl.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{pl.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)=>{pl.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)=>pl.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 zWe(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);pl.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function zWe(e,t,r,n,i){return await new Promise((a,o)=>pl.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var LA=Wt(require("fs/promises"),1);var ZI=Wt(require("fs"),1),QI=require("stream");var PA=Wt(require("zlib"),1),HWe=e=>e&&e instanceof ArrayBuffer,WWe=e=>e&&e instanceof Buffer;function RA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(PA.default.createBrotliDecompress());case"gzip":return e.pipe(PA.default.createGunzip());case"deflate":return e.pipe(PA.default.createDeflate());default:return e}}async function Iae(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(KWe(i))}),e.on("end",()=>{let i=VWe(t);r(i)})})}function VWe(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 KWe(e){if(HWe(e))return e;if(WWe(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 $We=e=>typeof e=="boolean",Pae=e=>typeof e=="function",YWe=e=>e!==null&&typeof e=="object",JWe=e=>YWe(e)&&Pae(e.read)&&Pae(e.pipe)&&$We(e.readable);async function jA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=rc(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,p)=>{let h=ZI.default.createReadStream(n,{encoding:null});h.once("readable",()=>f(h)),h.on("error",d=>p(d))}),o=a;JWe(a)?o=RA(a,i):typeof a=="string"?o=QI.Readable.from([new TextEncoder().encode(a)]):o=QI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=XWe(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 XWe(e){let t={};if(!t["content-length"]){let r=ZI.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 MA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await LA.default.readdir(t,r)}async stat(t){let r=await LA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await LA.default.unlink(t)}async fetch(t,r){return await jA(t,r)}async openReadableFile(t,r="r"){return new $h(t,r)}async openWritableFile(t,r="w",n){return new $h(t,r,n)}};var Yh=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 Vh(t)}};function Rae(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+=QWe(n[i])}return t}function QWe(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 jae(e,t){switch(t){case"hex":return e;case"base64":return ZWe(e);default:throw new Error(t)}}function ZWe(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Rae(r)||""}var Mae=typeof atob=="function"?atob:typeof Buffer=="function"?oVe:Nae,eVe=Mae("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="),eP=WebAssembly&&Mae!==Nae?aVe(eVe).buffer:!1,nc=sVe(),tP=240*16*16,qae=Math.floor(tP*16*1.066666667),tVe=268435456-65536,Lae="Parameter must be Buffer, ArrayBuffer or Uint8Array",rVe="Parameter exceeds max size of 255.9 Mbytes";eP||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function rP(e){var t,r,n,i,a,o,s,u,c,l;let f=iVe(),p=nVe(),h={},d=new Date().getTime();return h.then=function(E){return s=E,g(),h},h.catch=function(E){return u=E,h},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(Lae)):x(new TypeError(Lae)),o&&(a=o.length,eP&&a>qae?a>tVe?x(new Error(rVe)):(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(eP,n).then(b)):g(f(o))),h;function b(E){g(p(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-d),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function nVe(){var e,t,r,n,i,a,o,s,u,c,l,f,p,h=function(d){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,he,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=d.length*8,ft;for(ft=Ie(d,p),p[at>>>5]|=128<<at%32,p[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,he=p;Ge<ft;)ft>Ge+qae?(n(oe),a(V),s(ne),c(se),t(tP),Ge=Ge+tP*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=he[Ge+0]>>>0,g=he[Ge+1]>>>0,x=he[Ge+2]>>>0,E=he[Ge+3]>>>0,S=he[Ge+4]>>>0,F=he[Ge+5]>>>0,D=he[Ge+6]>>>0,j=he[Ge+7]>>>0,k=he[Ge+8]>>>0,N=he[Ge+9]>>>0,C=he[Ge+10]>>>0,I=he[Ge+11]>>>0,P=he[Ge+12]>>>0,U=he[Ge+13]>>>0,Y=he[Ge+14]>>>0,J=he[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 nc.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,pe,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],pe=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|pe<<8|Xe<<16|ct<<24;return _t+1}};return function(d,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,p=g,E=nc.wordsToBytes(h(d)),x&&x.asBytes?E:nc.bytesconvertNumberToHex(E)}}function iVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,p,h,d,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=nc.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,p=k[re+9]>>>0,h=k[re+10]>>>0,d=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)+p-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+h-42063)+U,I=ee(22,10,I+(P&U|~P&C)+d-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)+d+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)+h+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)+p+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)+d+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)+h-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)+p-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))+h-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))+d-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+p-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return nc.endian([C,I,P,U]);function ee(ge,ye,he){return he<<ge|he>>>ye}};return function(t,r){var n=nc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:nc.bytesconvertNumberToHex(n);return i}}function aVe(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 oVe(e){return Buffer.from(e,"base64").toString("binary")}function Nae(e){return e}function sVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return nc.rotl(t,8)&16711935|nc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=nc.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 Rx=class extends Yh{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>rP(t).then(a).catch(o));return jae(i,r)}};var jx=Wt(require("crypto"),1),qA=class extends Yh{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(!jx.createHash)throw new Error("crypto.createHash not available");let u=(s=jx.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(!jx.createHash)throw new Error("crypto.createHash not available");let n=(u=jx.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 p of t){let h=new Uint8Array(p);n.update(h),yield p}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 toe=require("process");var Uae=Wt(require("stream"),1),nP=class{},uVe=Uae.Readable||nP;function aP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new iP(r,t)}var iP=class extends uVe{_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 Hae=Wt(zae(),1);delete globalThis.ReadableStream;var UA=class extends Hae.ReadableStream{};var GA=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 zA=class extends UA{_chunks;constructor(t){super(new GA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Jh=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 Jh)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=cVe(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 Jh([],{type:n});if(u===0)return c;let l=0,f=[];for(let p of a){let{byteLength:h}=p;if(o>0&&h<=o)o-=h,s-=h;else{let d=p.subarray(o,Math.min(h,s));if(f.push(d),l+=d.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 zA(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 cVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function lVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Jh),globalThis.Blob}var fVe=lVe();var HA=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,${xy(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var WA=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 Wae(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=HA),typeof File>"u"&&!globalThis.File&&(globalThis.File=WA),global}var pVe=Wae();var oP=Wt(require("module"),1),Vae=Wt(require("path"),1),KA=Wt(require("fs"),1);async function Kae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():KA.default.readFileSync(e).buffer}async function $ae(e){return e.startsWith("http")?await(await fetch(e)).text():KA.default.readFileSync(e,"utf8")}async function Yae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return VA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await KA.default.readFileSync(e,"utf8");return VA(t)}function VA(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=oP.default._nodeModulePaths(Vae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new oP.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 ru=class{map;constructor(t){this.map={},t instanceof ru?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=Lx(t),r=Jae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Lx(t)]}get(t){return t=Lx(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Lx(t))}set(t,r){this.map[Lx(t)]=Jae(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)}),sP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),sP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),sP(t)}*[Symbol.iterator](){yield*this.entries()}};function Lx(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 Jae(e){return typeof e!="string"&&(e=String(e)),e}function sP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function uP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var lP=Wt(require("stream"),1),hVe=e=>typeof e=="boolean",Xae=e=>typeof e=="function",dVe=e=>e!==null&&typeof e=="object",cP=e=>dVe(e)&&Xae(e.read)&&Xae(e.pipe)&&hVe(e.readable),hl=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 ru((r==null?void 0:r.headers)||{}),cP(t)?this._body=RA(t,n):typeof t=="string"?this._body=lP.Readable.from([new TextEncoder().encode(t)]):this._body=lP.Readable.from([t||new ArrayBuffer(0)])}get body(){return uP(!this.bodyUsed),uP(cP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return cP(this._body)?await Iae(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 Zae=Wt(require("http"),1),eoe=Wt(require("https"),1);var mVe=e=>e&&e instanceof ArrayBuffer,gVe=e=>e&&e instanceof Buffer;function Qae(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:vVe(r),mimeType:n}}function vVe(e){if(mVe(e))return e;if(gVe(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 fP=e=>e.startsWith("data:"),bVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Mx(e,t){try{if(globalThis.fetch!==Mx&&(bVe(e)||fP(e)))return await fetch(e,t);if(fP(e)){let{arrayBuffer:c,mimeType:l}=Qae(e);return new hl(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 yVe(n,t),a=EVe(e,i,r),{status:o,statusText:s}=wVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=xVe(e,a.get("location"));return await Mx(c,t)}return new hl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new hl(null,{status:400,statusText:String(r),url:e})}}async function yVe(e,t){return await new Promise((r,n)=>{let i=_Ve(e,t),a=e.startsWith("https:")?eoe.default.request(i,o=>r(o)):Zae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function xVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function _Ve(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 wVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function EVe(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=AVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new ru(n)}function AVe(e){return fP(e)?e.length-5:null}var SVe=parseInt(toe.versions.node.split(".")[0]);AV&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=aP;globalThis.loaders.NodeFile=$h;globalThis.loaders.NodeFileSystem=MA;globalThis.loaders.fetchNode=jA;globalThis.loaders.NodeHash=qA;globalThis.TextEncoder||(globalThis.TextEncoder=yy);globalThis.TextDecoder||(globalThis.TextDecoder=Eh);!("atob"in globalThis)&&xy&&(globalThis.atob=xy);!("btoa"in globalThis)&&Tk&&(globalThis.btoa=Tk);globalThis.loaders.encodeImageNode=CY;globalThis.loaders.parseImageNode=kI;globalThis.loaders.imageFormatsNode=FI;globalThis._parseImageNode=kI;globalThis._imageFormatsNode=FI;globalThis.loaders.readFileAsArrayBuffer=Kae;globalThis.loaders.readFileAsText=$ae;globalThis.loaders.requireFromFile=Yae;globalThis.loaders.requireFromString=VA;SVe<18&&(!("Headers"in globalThis)&&ru&&(globalThis.Headers=ru),!("Response"in globalThis)&&hl&&(globalThis.Response=hl),!("fetch"in globalThis)&&Mx&&(globalThis.fetch=Mx));var NBe=require("path"),UBe=Wt(Vye(),1);var Ln={OBJECT_ID_TYPE:"OBJECTID",STRING_TYPE:"string",DOUBLE_TYPE:"double",SHORT_INT_TYPE:"Int32"};var QC=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 iTt=e=>typeof e=="boolean",$1=e=>typeof e=="function",Ad=e=>e!==null&&typeof e=="object",VM=e=>Ad(e)&&e.constructor==={}.constructor;var Kye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",$ye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var cs=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ls=e=>typeof Blob<"u"&&e instanceof Blob,Yye=e=>e&&typeof e=="object"&&e.isBuffer;var aTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ad(e)&&$1(e.tee)&&$1(e.cancel)&&$1(e.getReader);var oTt=e=>Ad(e)&&$1(e.read)&&$1(e.pipe)&&iTt(e.readable),ZC=e=>aTt(e)||oTt(e);var sTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,uTt=/^([-\w.]+\/[-\w.+]+)/;function Jye(e){let t=uTt.exec(e);return t?t[1]:e}function KM(e){let t=sTt.exec(e);return t?t[1]:""}var Xye=/\?.*/;function Qye(e){let t=e.match(Xye);return t&&t[0]}function sv(e){return e.replace(Xye,"")}function Sd(e){return cs(e)?e.url:ls(e)?e.name||"":typeof e=="string"?e:""}function Y1(e){if(cs(e)){let t=e,r=t.headers.get("content-type")||"",n=sv(t.url);return Jye(r)||KM(n)}return ls(e)?e.type||"":typeof e=="string"?KM(e):""}function Zye(e){return cs(e)?e.headers["content-length"]||-1:ls(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function e8(e){if(cs(e))return e;let t={},r=Zye(e);r>=0&&(t["content-length"]=String(r));let n=Sd(e),i=Y1(e);i&&(t["content-type"]=i);let a=await lTt(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 exe(e){if(!e.ok){let t=await cTt(e);throw new Error(t)}}async function cTt(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 lTt(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,${fTt(r)}`}return null}function fTt(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!hTt(e)&&!dTt(e)}function hTt(e){return e.startsWith("http:")||e.startsWith("https:")}function dTt(e){return e.startsWith("data:")}async function ko(e,t){var r,n;if(typeof e=="string"){let i=rc(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 e8(e)}function $M(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 fu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||$M()}var mTt=globalThis.self||globalThis.window||globalThis.global,uv=globalThis.window||globalThis.self||globalThis.global,gTt=globalThis.document||{},Td=globalThis.process||{},vTt=globalThis.console,$dr=globalThis.navigator||{};var t8="4.1.0-alpha.3",Xdr=fu();function bTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var r8=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=bTt(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 txe(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 rxe(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 n8(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 i8;(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"})(i8||(i8={}));var yTt=10;function nxe(e){return typeof e!="string"?e:(e=e.toUpperCase(),i8[e]||i8.WHITE)}function ixe(e,t,r){if(!fu&&typeof e=="string"){if(t){let n=nxe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=nxe(r);e="\x1B[".concat(n+yTt,"m").concat(e,"\x1B[49m")}}return e}function axe(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 cv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Cd(){let e;if(fu()&&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 Td){var n;let i=Td===null||Td===void 0||(n=Td.hrtime)===null||n===void 0?void 0:n.call(Td);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var lv={debug:fu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},xTt={enabled:!0,level:0};function fs(){}var oxe={},sxe={once:!0},bc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",t8),zt(this,"_startTs",Cd()),zt(this,"_deltaTs",Cd()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new r8("__probe-".concat(this.id,"__"),xTt),this.timeStamp("".concat(this.id," started")),axe(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((Cd()-this._startTs).toPrecision(10))}getDelta(){return Number((Cd()-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){cv(t,r)}warn(t){return this._getLogFunction(0,t,lv.warn,arguments,sxe)}error(t){return this._getLogFunction(0,t,lv.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,lv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,lv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,lv.debug||lv.info,arguments,sxe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||fs,n&&[n],{tag:ATt(r)}):fs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?fu()?ETt({image:i,message:a,scale:o}):wTt({image:i,message:a,scale:o}):fs}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||fs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=uxe({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||fs)}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()>=cxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=uxe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,cv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Cd();let o=a.tag||a.message;if(a.once&&o)if(!oxe[o])oxe[o]=Cd();else return fs;return r=_Tt(this.id,a.message,a),n.bind(console,r,...a.args)}return fs}};zt(bc,"VERSION",t8);function cxe(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 cv(Number.isFinite(t)&&t>=0),t}function uxe(e){let{logLevel:t,message:r}=e;e.logLevel=cxe(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 cv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function _Tt(e,t,r){if(typeof t=="string"){let n=r.time?rxe(txe(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=ixe(t,r.color,r.background)}return t}function wTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),fs}function ETt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=n8(a,r,n);console.log(...o)},a.src=t,fs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...n8(t,r,n)),fs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...n8(a,r,n)),a.src=t.toDataURL(),fs}return fs}function ATt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var A0r=new bc({id:"@probe.gl/log"});var YM=new bc({id:"loaders.gl"}),a8=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},o8=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 JM={fetch:null,mimeType:void 0,nothrow:!1,log:new o8,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:[]},lxe={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 XM(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function fv(){let e=XM();return e.globalOptions=e.globalOptions||{...JM},e.globalOptions}function hxe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],STt(e,r),CTt(t,e,n)}function STt(e,t){fxe(e,null,JM,lxe,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]||{};fxe(n,r.id,i,a,t)}}function fxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ad(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)YM.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=TTt(s,i);YM.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function TTt(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 CTt(e,t,r){let i={...e.options||{}};return DTt(i,r),i.log===null&&(i.log=new a8),pxe(i,fv()),pxe(i,t),i}function pxe(e,t){for(let r in t)if(r in t){let n=t[r];VM(n)&&VM(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function DTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function J1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function QM(e){Qt(e,"null loader"),Qt(J1(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 FTt=()=>{let e=XM();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function dxe(){return FTt()}var mxe=new bc({id:"loaders.gl"});var kTt=/\.([^.]+)$/;async function bxe(e,t=[],r,n){if(!yxe(e))return null;let i=gxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(ls(e)&&(e=await e.slice(0,10).arrayBuffer(),i=gxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(xxe(e));return i}function gxe(e,t=[],r,n){if(!yxe(e))return null;if(t&&!Array.isArray(t))return QM(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...dxe()),OTt(i);let a=BTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(xxe(e));return a}function BTt(e,t,r,n){let i=Sd(e),a=Y1(e),o=sv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=ZM(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||ITt(t,o),u=u||(s?`matched url ${o}`:""),s=s||ZM(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||RTt(t,e),u=u||(s?`matched initial data ${_xe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||ZM(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&mxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function yxe(e){return!(e instanceof Response&&e.status===204)}function xxe(e){let t=Sd(e),r=Y1(e),n="No valid loader found (";n+=t?`${tu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?_xe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function OTt(e){for(let t of e)QM(t)}function ITt(e,t){let r=t&&kTt.exec(t),n=r&&r[1];return n?PTt(e,n):null}function PTt(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 ZM(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function RTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(jTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(vxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&vxe(t,0,r))return r;return null}function jTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function vxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>LTt(e,t,r,i))}function LTt(e,t,r,n){if(n instanceof ArrayBuffer)return ec(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=e7(e,t,n.length);return n===i;default:return!1}}function _xe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?e7(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?e7(e,0,t):""}function e7(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*wxe(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*Exe(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*Axe(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 t7(e,t){return gn?MTt(e,t):qTt(e,t)}async function*MTt(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 fl(o)}}catch{r.releaseLock()}}async function*qTt(e,t){for await(let r of e)yield fl(r)}function Sxe(e,t){if(typeof e=="string")return wxe(e,t);if(e instanceof ArrayBuffer)return Exe(e,t);if(ls(e))return Axe(e,t);if(ZC(e))return t7(e,t);if(cs(e))return t7(e.body,t);throw new Error("makeIterator")}var Txe="Cannot convert supplied data type";function NTt(e,t,r){if(t.text&&typeof e=="string")return e;if(Yye(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(Txe)}async function Cxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return NTt(e,t,r);if(ls(e)&&(e=await e8(e)),cs(e)){let i=e;return await exe(i),t.binary?await i.arrayBuffer():await i.text()}if(ZC(e)&&(e=Sxe(e,r)),Kye(e)||$ye(e))return Vh(e);throw new Error(Txe)}function s8(e,t){let r=fv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ad(n.fetch)?i=>ko(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:ko}function Dxe(e,t,r){if(r)return r;let n={fetch:s8(t,e),...e};if(n.url){let i=sv(n.url);n.baseUrl=i,n.queryString=Qye(n.url),n.filename=tu.filename(i),n.baseUrl=tu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Fxe(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 Bo(e,t,r,n){t&&!Array.isArray(t)&&!J1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Sd(e),o=Fxe(t,n),s=await bxe(e,o,r);return s?(r=hxe(r,s,o,i),n=Dxe({url:i,_parse:Bo,loaders:o},r,n||null),await UTt(s,e,r,n)):null}async function UTt(e,t,r,n){if(LI(e),r=BI(e.options,r),cs(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,p=Object.fromEntries(a.headers.entries());n.response={headers:p,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Cxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(UI(e,r))return await GI(e,t,r,n,Bo);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw ma(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function kxe(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 r7(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],p=s[c+2];t=l<t?l:t,r=f<r?f:r,n=p<n?p:n,i=l>i?l:i,a=f>a?f:a,o=p>o?p:o}return[[t,r,n],[i,a,o]]}function n7(e,t,r){let n=kxe(t.value),i=r||Bxe(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function Bxe(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)&&!J1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=s8(a),s=e;return typeof e=="string"&&(s=await o(e)),ls(e)&&(s=await o(e)),Array.isArray(i)?await Bo(s,i,a):await Bo(s,i,a)}async function pv(e,t,r){return r={...fv(),...r},t.encodeURLtoURL?GTt(t,e,r):zI(t,r)?await jI(t,e,r):await t.encode(e,r)}function u8(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 Ixe(e,t,r,n){if(e=rc(e),t=rc(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}async function GTt(e,t,r){if(gn)throw new Error(`Writer ${e.name} not supported in browser`);let n=Oxe("input");await new Kh(n,"w").write(t);let a=Oxe("output"),o=await Ixe(n,a,e,r);return(await ko(o)).arrayBuffer()}function Oxe(e){return`/tmp/${e}`}var zTt=1/Math.PI*180,HTt=1/180*Math.PI,WTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...WTt}};var Sn=globalThis.mathgl.config;function i7(e,{precision:t=Sn.precision}={}){return e=VTt(e),"".concat(parseFloat(e.toPrecision(t)))}function ps(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a7(e){return Pxe(e)}function o7(e){return Dl(e)}function Pxe(e,t){return u7(e,r=>r*HTt,t)}function Dl(e,t){return u7(e,r=>r*zTt,t)}function s7(e,t,r){return u7(e,n=>Math.max(t,Math.min(r,n)))}function Oo(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(ps(e)&&ps(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Oo(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 VTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function KTt(e){return e.clone?e.clone():new Array(e.length)}function u7(e,t,r){if(ps(e)){let n=e;r=r||KTt(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 $Tt(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 yp=class extends $Tt(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:ps(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?", ":"")+i7(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(!Oo(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 YTt(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 xp(e,t,r=""){if(Sn.debug&&!YTt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function aa(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var _p=class extends yp{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 aa(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return aa(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,X1=Math.random;function hv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var bgr=Math.PI/180;function JTt(){let e=new Mn(2);return Mn!=Float32Array&&(e[0]=0,e[1]=0),e}function Rxe(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 jxe(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 c8(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 l8(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 ygr=function(){let e=JTt();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 f8(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 p8(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 Lxe(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 Mxe(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 h8(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 Dd=class extends _p{constructor(t=0,r=0){super(2),ps(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 l8(this,this,t),this.check()}transformAsVector(t){return f8(this,this,t),this.check()}transformByMatrix3(t){return c8(this,this,t),this.check()}transformByMatrix2x3(t){return jxe(this,this,t),this.check()}transformByMatrix2(t){return Rxe(this,this,t),this.check()}};var mv={};fa(mv,{add:()=>e6t,angle:()=>h7,bezier:()=>h6t,ceil:()=>t6t,clone:()=>XTt,copy:()=>QTt,create:()=>d8,cross:()=>Fd,dist:()=>w6t,distance:()=>zxe,div:()=>_6t,divide:()=>Gxe,dot:()=>Q1,equals:()=>b6t,exactEquals:()=>v6t,floor:()=>r6t,forEach:()=>S6t,fromValues:()=>m8,hermite:()=>p6t,inverse:()=>c6t,len:()=>d7,length:()=>qxe,lerp:()=>l6t,max:()=>i6t,min:()=>n6t,mul:()=>x6t,multiply:()=>Uxe,negate:()=>u6t,normalize:()=>c7,random:()=>d6t,rotateX:()=>l7,rotateY:()=>f7,rotateZ:()=>p7,round:()=>a6t,scale:()=>o6t,scaleAndAdd:()=>s6t,set:()=>ZTt,slerp:()=>f6t,sqrDist:()=>E6t,sqrLen:()=>A6t,squaredDistance:()=>Hxe,squaredLength:()=>Wxe,str:()=>g6t,sub:()=>y6t,subtract:()=>Nxe,transformMat3:()=>Z1,transformMat4:()=>kd,transformQuat:()=>e_,zero:()=>m6t});function d8(){let e=new Mn(3);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function XTt(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 m8(e,t,r){let n=new Mn(3);return n[0]=e,n[1]=t,n[2]=r,n}function QTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ZTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function e6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Nxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Uxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Gxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function t6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function r6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function n6t(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 i6t(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 a6t(e,t){return e[0]=hv(t[0]),e[1]=hv(t[1]),e[2]=hv(t[2]),e}function o6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function s6t(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 zxe(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 Hxe(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 Wxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function u6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function c6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function c7(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 Q1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fd(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 l6t(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 f6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(Q1(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 h6t(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,p=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*p,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*p,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*p,e}function d6t(e,t){t=t===void 0?1:t;let r=X1()*2*Math.PI,n=X1()*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 kd(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 Z1(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 e_(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,p=n*u-i*s,h=i*p-a*f,d=a*l-n*p,b=n*f-i*l,g=o*2;return l*=g,f*=g,p*=g,h*=2,d*=2,b*=2,e[0]=s+l+h,e[1]=u+f+d,e[2]=c+p+b,e}function l7(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 f7(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 p7(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 h7(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&&Q1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function m6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function g6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function v6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function b6t(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 y6t=Nxe,x6t=Uxe,_6t=Gxe,w6t=zxe,E6t=Hxe,d7=qxe,A6t=Wxe,S6t=function(){let e=d8();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 m7=[0,0,0],g8,ce=class extends _p{static get ZERO(){return g8||(g8=new ce(0,0,0),Object.freeze(g8)),g8}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&ps(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 h7(this,t)}cross(t){return Fd(this,this,t),this.check()}rotateX({radians:t,origin:r=m7}){return l7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=m7}){return f7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=m7}){return p7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return kd(this,this,t),this.check()}transformAsVector(t){return p8(this,this,t),this.check()}transformByMatrix3(t){return Z1(this,this,t),this.check()}transformByMatrix2(t){return Lxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}};var v8,hs=class extends _p{static get ZERO(){return v8||(v8=new hs(0,0,0,0),Object.freeze(v8)),v8}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),ps(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 kd(this,this,t),this.check()}transformByMatrix3(t){return h8(this,this,t),this.check()}transformByMatrix2(t){return Mxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gv=class extends yp{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 Vxe(){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 Kxe(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 $xe(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,p=-l*a+s*u,h=c*a-o*u,d=r*f+n*p+i*h;return d?(d=1/d,e[0]=f*d,e[1]=(-l*n+i*c)*d,e[2]=(s*n-i*o)*d,e[3]=p*d,e[4]=(l*r-i*u)*d,e[5]=(-s*r+i*a)*d,e[6]=h*d,e[7]=(-c*r+n*u)*d,e[8]=(o*r-n*a)*d,e):null}function Yxe(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 g7(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],p=r[0],h=r[1],d=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=p*n+h*o+d*c,e[1]=p*i+h*s+d*l,e[2]=p*a+h*u+d*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 Jxe(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],p=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=p*n+h*o+c,e[7]=p*i+h*s+l,e[8]=p*a+h*u+f,e}function Xxe(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],p=Math.sin(r),h=Math.cos(r);return e[0]=h*n+p*o,e[1]=h*i+p*s,e[2]=h*a+p*u,e[3]=h*o-p*n,e[4]=h*s-p*i,e[5]=h*u-p*a,e[6]=c,e[7]=l,e[8]=f,e}function v7(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 Qxe(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,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[3]=l-x,e[6]=p+g,e[1]=l+x,e[4]=1-c-d,e[7]=h-b,e[2]=p-g,e[5]=h+b,e[8]=1-c-f,e}var b7;(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"})(b7||(b7={}));var C6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends gv{static get IDENTITY(){return F6t()}static get ZERO(){return D6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return b7}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(C6t)}fromObject(t){return this.check()}fromQuaternion(t){return Qxe(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 Yxe(this)}transpose(){return Kxe(this,this),this.check()}invert(){return $xe(this,this),this.check()}multiplyLeft(t){return g7(this,t,this),this.check()}multiplyRight(t){return g7(this,this,t),this.check()}rotate(t){return Xxe(this,this,t),this.check()}scale(t){return Array.isArray(t)?v7(this,this,t):v7(this,this,[t,t]),this.check()}translate(t){return Jxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=c8(r||[-0,-0],t,this);break;case 3:n=Z1(r||[-0,-0,-0],t,this);break;case 4:n=h8(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return xp(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)}},b8,y8=null;function D6t(){return b8||(b8=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(b8)),b8}function F6t(){return y8||(y8=new Rr,Object.freeze(y8)),y8}var x8={};fa(x8,{add:()=>e3t,adjoint:()=>R6t,clone:()=>B6t,copy:()=>O6t,create:()=>k6t,decompose:()=>W6t,determinant:()=>_7,equals:()=>i3t,exactEquals:()=>n3t,frob:()=>Z6t,fromQuat:()=>D7,fromQuat2:()=>G6t,fromRotation:()=>M6t,fromRotationTranslation:()=>e1e,fromRotationTranslationScale:()=>V6t,fromRotationTranslationScaleOrigin:()=>K6t,fromScaling:()=>L6t,fromTranslation:()=>j6t,fromValues:()=>I6t,fromXRotation:()=>q6t,fromYRotation:()=>N6t,fromZRotation:()=>U6t,frustum:()=>F7,getRotation:()=>H6t,getScaling:()=>t1e,getTranslation:()=>z6t,identity:()=>Zxe,invert:()=>x7,lookAt:()=>O7,mul:()=>a3t,multiply:()=>t_,multiplyScalar:()=>t3t,multiplyScalarAndAdd:()=>r3t,ortho:()=>B7,orthoNO:()=>n1e,orthoZO:()=>J6t,perspective:()=>k7,perspectiveFromFieldOfView:()=>Y6t,perspectiveNO:()=>r1e,perspectiveZO:()=>$6t,rotate:()=>A7,rotateX:()=>S7,rotateY:()=>T7,rotateZ:()=>C7,scale:()=>E7,set:()=>P6t,str:()=>Q6t,sub:()=>o3t,subtract:()=>i1e,targetTo:()=>X6t,translate:()=>w7,transpose:()=>y7});function k6t(){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 B6t(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 O6t(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 I6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,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]=p,g[13]=h,g[14]=d,g[15]=b,g}function P6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,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]=p,e[12]=h,e[13]=d,e[14]=b,e[15]=g,e}function Zxe(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 y7(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 x7(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],p=t[10],h=t[11],d=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*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*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]=(p*j-f*k-h*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-d*k-x*S)*J,e[7]=(l*k-p*F+h*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(d*j-b*F+x*E)*J,e[11]=(f*F-l*j-h*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-d*D-g*E)*J,e[15]=(l*D-f*S+p*E)*J,e):null}function R6t(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],p=t[10],h=t[11],d=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*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*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]=p*j-f*k-h*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-d*k-x*S,e[7]=l*k-p*F+h*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=d*j-b*F+x*E,e[11]=f*F-l*j-h*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-d*D-g*E,e[15]=l*D-f*S+p*E,e}function _7(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],p=e[11],h=e[12],d=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*d-l*h,D=c*b-f*h,j=l*b-f*d,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=h*S-d*E+b*x;return u*k-i*N+g*C-p*I}function t_(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],p=t[9],h=t[10],d=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*p+j*g,e[2]=S*a+F*c+D*h+j*x,e[3]=S*o+F*l+D*d+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*p+j*g,e[6]=S*a+F*c+D*h+j*x,e[7]=S*o+F*l+D*d+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*p+j*g,e[10]=S*a+F*c+D*h+j*x,e[11]=S*o+F*l+D*d+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*p+j*g,e[14]=S*a+F*c+D*h+j*x,e[15]=S*o+F*l+D*d+j*E,e}function w7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,p,h,d,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],p=t[6],h=t[7],d=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]=p,e[7]=h,e[8]=d,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+d*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+p*i+g*a+t[14],e[15]=c*n+h*i+x*a+t[15]),e}function E7(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 A7(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,p,h,d,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],p=t[1],h=t[2],d=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]=p*k+g*N+F*C,e[2]=h*k+x*N+D*C,e[3]=d*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=p*I+g*P+F*U,e[6]=h*I+x*P+D*U,e[7]=d*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=p*Y+g*J+F*re,e[10]=h*Y+x*J+D*re,e[11]=d*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 S7(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],p=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+p*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=p*i-u*n,e}function T7(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],p=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-p*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+p*i,e}function C7(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],p=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+p*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=p*i-u*n,e}function j6t(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 L6t(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 M6t(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 q6t(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 N6t(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 U6t(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 e1e(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,p=n*c,h=i*u,d=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(h+b),e[1]=f+E,e[2]=p-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=d+g,e[7]=0,e[8]=p+x,e[9]=d-g,e[10]=1-(l+h),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function G6t(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),e1e(e,t,r),e}function z6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function t1e(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 H6t(e,t){let r=new Mn(3);t1e(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,p=t[8]*n,h=t[9]*i,d=t[10]*a,b=o+l+d,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(p-u)/g,e[2]=(s-c)/g):o>l&&o>d?(g=Math.sqrt(1+o-l-d)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(p+u)/g):l>d?(g=Math.sqrt(1+l-o-d)*2,e[3]=(p-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+d-o-l)*2,e[3]=(s-c)/g,e[0]=(p+u)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function W6t(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],p=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+p*p);let h=1/r[0],d=1/r[1],b=1/r[2],g=i*h,x=a*d,E=o*b,S=s*h,F=u*d,D=c*b,j=l*h,k=f*d,N=p*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 V6t(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,p=i*c,h=i*l,d=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-(d+g))*F,e[1]=(p+S)*F,e[2]=(h-E)*F,e[3]=0,e[4]=(p-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(h+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+d))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function K6t(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,p=a*c,h=a*l,d=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=(h+F)*D,Y=(d-S)*D,J=(h-F)*j,re=(1-(p+x))*j,ee=(g+E)*j,ge=(d+S)*k,ye=(g-E)*k,he=(1-(p+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]=he,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+he*I),e[15]=1,e}function D7(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,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[1]=l+x,e[2]=p-g,e[3]=0,e[4]=l-x,e[5]=1-c-d,e[6]=h+b,e[7]=0,e[8]=p+g,e[9]=h-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function F7(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 r1e(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 k7=r1e;function $6t(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 Y6t(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 n1e(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 B7=n1e;function J6t(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 O7(e,t,r,n){let i,a,o,s,u,c,l,f,p,h,d=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(d-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?Zxe(e):(f=d-F,p=b-D,h=g-j,i=1/Math.sqrt(f*f+p*p+h*h),f*=i,p*=i,h*=i,a=E*h-S*p,o=S*f-x*h,s=x*p-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=p*s-h*o,c=h*a-f*s,l=f*o-p*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]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=h,e[11]=0,e[12]=-(a*d+o*b+s*g),e[13]=-(u*d+c*b+l*g),e[14]=-(f*d+p*b+h*g),e[15]=1,e)}function X6t(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],p=o-r[2],h=l*l+f*f+p*p;h>0&&(h=1/Math.sqrt(h),l*=h,f*=h,p*=h);let d=u*p-c*f,b=c*l-s*p,g=s*f-u*l;return h=d*d+b*b+g*g,h>0&&(h=1/Math.sqrt(h),d*=h,b*=h,g*=h),e[0]=d,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-p*b,e[5]=p*d-l*g,e[6]=l*b-f*d,e[7]=0,e[8]=l,e[9]=f,e[10]=p,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function Q6t(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 Z6t(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 e3t(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 i1e(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 t3t(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 r3t(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 n3t(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 i3t(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],p=e[10],h=e[11],d=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(p-U)<=1e-6*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(h-Y)<=1e-6*Math.max(1,Math.abs(h),Math.abs(Y))&&Math.abs(d-J)<=1e-6*Math.max(1,Math.abs(d),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 a3t=t_,o3t=i1e;function s3t(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function a1e(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 o1e(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 s1e(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 u1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function c1e(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 l1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function f1e(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 p1e(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 h1e(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,p=c*a+o*i-s*n,h=-o*n-s*i-u*a;return e[0]=l*c+h*-o+f*-u-p*-s,e[1]=f*c+h*-s+p*-o-l*-u,e[2]=p*c+h*-u+l*-s-f*-o,e[3]=t[3],e}var Xgr=function(){let e=s3t();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 R7;(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"})(R7||(R7={}));var c3t=45*Math.PI/180,l3t=1,I7=.1,P7=500,f3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends gv{static get IDENTITY(){return h3t()}static get ZERO(){return p3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return R7}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,p,h,d,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]=p,this[12]=h,this[13]=d,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=h,this[4]=r,this[5]=o,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=p,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(f3t)}fromObject(t){return this.check()}fromQuaternion(t){return D7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return s===1/0?d3t(this,r,n,i,a,o):F7(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 O7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return B7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=c3t,aspect:n=l3t,focalDistance:i=1,near:a=I7,far:o=P7}=t;d1e(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 d1e(r),k7(this,r,n,i,a),this.check()}determinant(){return _7(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 y7(this,this),this.check()}invert(){return x7(this,this),this.check()}multiplyLeft(t){return t_(this,t,this),this.check()}multiplyRight(t){return t_(this,this,t),this.check()}rotateX(t){return S7(this,this,t),this.check()}rotateY(t){return T7(this,this,t),this.check()}rotateZ(t){return C7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return A7(this,this,t,r),this.check()}scale(t){return E7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return w7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=p1e(r||[-0,-0,-0,-0],t,this),xp(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=l8(r||[-0,-0],t,this);break;case 3:i=kd(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return xp(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=f8(r||[-0,-0],t,this);break;case 3:n=p8(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return xp(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])}},_8,w8;function p3t(){return _8||(_8=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(_8)),_8}function h3t(){return w8||(w8=new Kr,Object.freeze(w8)),w8}function d1e(e){if(e>Math.PI*2)throw Error("expected radians")}function d3t(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,p=-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]=p,e[15]=0,e}function m1e(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function g1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function j7(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 L7(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 v1e(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 y1e(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 x1e(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 r_(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],p,h,d,b,g;return p=i*u+a*c+o*l+s*f,p<0&&(p=-p,u=-u,c=-c,l=-l,f=-f),1-p>1e-6?(h=Math.acos(p),g=Math.sin(h),d=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(d=1-n,b=n),e[0]=d*i+b*u,e[1]=d*a+b*c,e[2]=d*o+b*l,e[3]=d*s+b*f,e}function _1e(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 w1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function M7(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 E1e=a1e;var A1e=o1e,S1e=l1e,T1e=f1e,C1e=s1e;var D1e=u1e;var F1e=c1e;var k1e=function(){let e=d8(),t=m8(1,0,0),r=m8(0,1,0);return function(n,i,a){let o=Q1(i,a);return o<-.999999?(Fd(e,t,i),d7(e)<1e-6&&Fd(e,r,i),c7(e,e),j7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Fd(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,F1e(n,n))}}(),fvr=function(){let e=m1e(),t=m1e();return function(r,n,i,a,o,s){return r_(e,n,o,s),r_(t,i,a,s),r_(r,e,t,2*s*(1-s)),r}}(),pvr=function(){let e=Vxe();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],F1e(t,M7(t,e))}}();var m3t=[0,0,0,1],ds=class extends yp{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 M7(this,t),this.check()}fromAxisRotation(t,r){return j7(this,t,r),this.check()}identity(){return g1e(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 C1e(this)}lengthSquared(){return D1e(this)}dot(t){return S1e(this,t)}rotationTo(t,r){return k1e(this,t,r),this.check()}add(t){return E1e(this,this,t),this.check()}calculateW(){return x1e(this,this),this.check()}conjugate(){return w1e(this,this),this.check()}invert(){return _1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(T1e(this,t,r,n),this.check())}multiplyRight(t){return L7(this,this,t),this.check()}multiplyLeft(t){return L7(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 v1e(this,this,t),this.check()}rotateY(t){return b1e(this,this,t),this.check()}rotateZ(t){return y1e(this,this,t),this.check()}scale(t){return A1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=m3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return r_(this,i,a,o),this.check()}transformVector4(t,r=new hs){return h1e(r,t,this),xp(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 pu={};fa(pu,{EPSILON1:()=>g3t,EPSILON10:()=>S3t,EPSILON11:()=>T3t,EPSILON12:()=>C3t,EPSILON13:()=>D3t,EPSILON14:()=>F3t,EPSILON15:()=>k3t,EPSILON16:()=>B3t,EPSILON17:()=>O3t,EPSILON18:()=>I3t,EPSILON19:()=>P3t,EPSILON2:()=>v3t,EPSILON20:()=>R3t,EPSILON3:()=>b3t,EPSILON4:()=>y3t,EPSILON5:()=>x3t,EPSILON6:()=>_3t,EPSILON7:()=>w3t,EPSILON8:()=>E3t,EPSILON9:()=>A3t,PI_OVER_FOUR:()=>L3t,PI_OVER_SIX:()=>M3t,PI_OVER_TWO:()=>j3t,TWO_PI:()=>q3t});var g3t=.1,v3t=.01,b3t=.001,y3t=1e-4,x3t=1e-5,_3t=1e-6,w3t=1e-7,E3t=1e-8,A3t=1e-9,S3t=1e-10,T3t=1e-11,C3t=1e-12,D3t=1e-13,F3t=1e-14,k3t=1e-15,B3t=1e-16,O3t=1e-17,I3t=1e-18,P3t=1e-19,R3t=1e-20,j3t=Math.PI/2,L3t=Math.PI/4,M3t=Math.PI/6,q3t=Math.PI*2;var Fl=6356752314245179e-9,N3t={radii:[6378137,6378137,Fl],radiiSquared:[6378137*6378137,6378137*6378137,Fl*Fl],oneOverRadii:[1/6378137,1/6378137,1/Fl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Fl*Fl)],maximumRadius:Math.max(6378137,6378137,Fl),centerToleranceSquared:.1};function E8(e){return e}var zvr=new ce;function U3t(e,t=[],r=E8){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 B1e(e,t=[]){return U3t(e,t,Sn._cartographicRadians?E8:a7)}function G3t(e,t,r=E8){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 O1e(e,t){return G3t(e,t,Sn._cartographicRadians?E8:o7)}var I1e=1e-14,z3t=new ce,P1e={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"}},q7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},n_={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},H3t=new ce,W3t=new ce,V3t=new ce;function N7(e,t,r,n,i,a){let o=P1e[t]&&P1e[t][r];aa(o&&(!n||n===o));let s,u,c,l=z3t.copy(i);if(Oo(l.x,0,I1e)&&Oo(l.y,0,I1e)){let p=Math.sign(l.z);s=H3t.fromArray(q7[t]),t!=="east"&&t!=="west"&&s.scale(p),u=W3t.fromArray(q7[r]),r!=="east"&&r!=="west"&&u.scale(p),c=V3t.fromArray(q7[n]),n!=="east"&&n!=="west"&&c.scale(p)}else{let{up:p,east:h,north:d}=n_;h.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),d.copy(p).cross(h);let{down:b,west:g,south:x}=n_;b.copy(p).scale(-1),g.copy(h).scale(-1),x.copy(d).scale(-1),s=n_[t],u=n_[r],c=n_[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 vv=new ce,K3t=new ce,$3t=new ce;function R1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;vv.from(e);let o=vv.x,s=vv.y,u=vv.z,c=n.x,l=n.y,f=n.z,p=o*o*c*c,h=s*s*l*l,d=u*u*f*f,b=p+h+d,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=K3t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=$3t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*vv.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=p*U+h*Y+d*J-1;let he=-2*(p*re*E+h*ee*S+d*ge*F);k=P/he}while(Math.abs(P)>pu.EPSILON12);return vv.scale([N,C,I]).to(r)}var A8=new ce,j1e=new ce,X3t=new ce,hu=new ce,Q3t=new ce,S8=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",pu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),aa(t>=0),aa(r>=0),aa(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=j1e,i=X3t,[,,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]){S8.from(t);let n=this.scaleToGeodeticSurface(S8,hu);if(!n)return;let i=this.geodeticSurfaceNormal(n,j1e),a=Q3t;a.copy(S8).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(mv.dot(a,S8))*mv.length(a);return O1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return N7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return N7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return A8.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=B1e(t),i=n[0],a=n[1],o=Math.cos(a);return A8.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),A8.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return A8.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return R1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){hu.from(t);let n=hu.x,i=hu.y,a=hu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return hu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){aa(Oo(this.radii.x,this.radii.y,pu.EPSILON15)),aa(this.radii.z>0),hu.from(t);let i=hu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return hu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Fl));var oa={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var lbr=new ce,fbr=new ce;var i_=new ce,L1e=new ce,Ja=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=i_.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 Ja(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=i_.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 L1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(L1e),this.radius=u,this}expand(t){let n=i_.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=x8.getScaling(i_,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=i_.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?oa.OUTSIDE:a<n?oa.INTERSECTING:oa.INSIDE}};var Z3t=new ce,eCt=new ce,T8=new ce,C8=new ce,D8=new ce,tCt=new ce,rCt=new ce,kl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},sa=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 ds().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new ds(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 sa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ja){let r=this.halfAxes,n=r.getColumn(0,T8),i=r.getColumn(1,C8),a=r.getColumn(2,D8),o=Z3t.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[kl.COLUMN0ROW0]+o*i[kl.COLUMN0ROW1]+s*i[kl.COLUMN0ROW2])+Math.abs(a*i[kl.COLUMN1ROW0]+o*i[kl.COLUMN1ROW1]+s*i[kl.COLUMN1ROW2])+Math.abs(a*i[kl.COLUMN2ROW0]+o*i[kl.COLUMN2ROW1]+s*i[kl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?oa.OUTSIDE:c>=u?oa.INSIDE:oa.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=eCt.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,T8),a=n.getColumn(1,C8),o=n.getColumn(2,D8),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,T8),c=s.getColumn(1,C8),l=s.getColumn(2,D8),f=tCt.copy(u).add(c).add(l).add(o),p=rCt.copy(f).subtract(t),h=r.dot(p);return i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,T8);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,C8);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,D8);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var M1e=new ce,q1e=new ce,Bl=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 aa(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=M1e.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),aa(Oo(this.normal.len(),1)),this.distance=i,this}clone(){return new Bl(this.normal,this.distance)}equals(t){return Oo(this.distance,t.distance)&&Oo(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=M1e.from(t),i=this.getPointDistance(n),a=q1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var N1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],U1e=new ce,nCt=new ce,ms=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*N1e.length;let r=t.center,n=t.radius,i=0;for(let a of N1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new Bl),s||(s=this.planes[i+1]=new Bl);let u=U1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=U1e.copy(a).scale(n).add(r),l=nCt.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=oa.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case oa.OUTSIDE:return oa.OUTSIDE;case oa.INTERSECTING:r=oa.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(aa(Number.isFinite(r),"parentPlaneMask is required."),r===ms.MASK_OUTSIDE||r===ms.MASK_INSIDE)return r;let n=ms.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===oa.OUTSIDE)return ms.MASK_OUTSIDE;u===oa.INTERSECTING&&(n|=o)}return n}};zt(ms,"MASK_OUTSIDE",4294967295);zt(ms,"MASK_INSIDE",0);zt(ms,"MASK_INDETERMINATE",2147483647);var Pbr=new ce,Rbr=new ce,jbr=new ce,Lbr=new ce,Mbr=new ce;var aCt=new ce,oCt=new ce,sCt=new ce,uCt=new ce,cCt=new ce,lCt=new ce,fCt=new ce,bv=new ce,pCt=new ce,hCt=new ce,dCt=new ce,mCt=new ce;function U7(e,t=new Ja){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=fCt.copy(e[0]),n=aCt.copy(r),i=oCt.copy(r),a=sCt.copy(r),o=uCt.copy(r),s=cCt.copy(r),u=lCt.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=bv.copy(o).subtract(n).magnitudeSquared(),l=bv.copy(s).subtract(i).magnitudeSquared(),f=bv.copy(u).subtract(a).magnitudeSquared(),p=n,h=o,d=c;l>d&&(d=l,p=i,h=s),f>d&&(d=f,p=a,h=u);let b=pCt;b.x=(p.x+h.x)*.5,b.y=(p.y+h.y)*.5,b.z=(p.z+h.z)*.5;let g=bv.copy(h).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=hCt;E.x=n.x,E.y=i.y,E.z=a.z;let S=dCt;S.x=o.x,S.y=s.y,S.z=u.z;let F=mCt.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=bv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=bv.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 yc=new Rr,gCt=new Rr,vCt=new Rr,F8=new Rr,G1e=new Rr;function H7(e,t={}){let r=pu.EPSILON20,n=10,i=0,a=0,o=gCt,s=vCt;o.identity(),s.copy(e);let u=r*bCt(s);for(;a<n&&yCt(s)>u;)xCt(s,F8),G1e.copy(F8).transpose(),s.multiplyRight(F8),s.multiplyLeft(G1e),o.multiplyRight(F8),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function bCt(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var G7=[1,0,0],z7=[2,2,1];function yCt(e){let t=0;for(let r=0;r<3;++r){let n=e[yc.getElementIndex(z7[r],G7[r])];t+=2*n*n}return Math.sqrt(t)}function xCt(e,t){let r=pu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[yc.getElementIndex(z7[c],G7[c])]);l>n&&(i=c,n=l)}let a=G7[i],o=z7[i],s=1,u=0;if(Math.abs(e[yc.getElementIndex(o,a)])>r){let c=e[yc.getElementIndex(o,o)],l=e[yc.getElementIndex(a,a)],f=e[yc.getElementIndex(o,a)],p=(c-l)/2/f,h;p<0?h=-1/(-p+Math.sqrt(1+p*p)):h=1/(p+Math.sqrt(1+p*p)),s=1/Math.sqrt(1+h*h),u=h*s}return Rr.IDENTITY.to(t),t[yc.getElementIndex(a,a)]=t[yc.getElementIndex(o,o)]=s,t[yc.getElementIndex(o,a)]=u,t[yc.getElementIndex(a,o)]=-u,t}var wp=new ce,wCt=new ce,ECt=new ce,ACt=new ce,SCt=new ce,TCt=new Rr,CCt={diagonal:new Rr,unitary:new Rr};function a_(e,t=new sa){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=wp.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=TCt;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:p}=H7(f,CCt),h=t.halfAxes.copy(p),d=h.getColumn(0,ECt),b=h.getColumn(1,ACt),g=h.getColumn(2,SCt),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)wp.copy(C),x=Math.max(wp.dot(d),x),E=Math.max(wp.dot(b),E),S=Math.max(wp.dot(g),S),F=Math.min(wp.dot(d),F),D=Math.min(wp.dot(b),D),j=Math.min(wp.dot(g),j);d=d.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(d).add(b).add(g);let k=wCt.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 V1e(e){return e!=null}var vyr=new ce,DCt=new ce,FCt=new ce,kCt=new ce,Bd=new ce,z1e=new ce,H1e=new ce,W1e=new ce;function k8(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return K1e(e.box,t,r);if(e.region)return OCt(e.region);if(e.sphere)return BCt(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function K1e(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 ds;l.fromArray(e,6);let f=new ce([1,0,0]),p=new ce([0,1,0]),h=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),p.transformByQuaternion(l),p.scale(c[1]),h.transformByQuaternion(l),h.scale(c[2]),i=[...f.toArray(),...p.toArray(),...h.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 V1e(r)?(r.center=n,r.halfAxes=u,r):new sa(n,u)}function BCt(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(DCt),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return V1e(r)?(r.center=n,r.radius=o,r):new Ja(n,o)}function OCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Dl(t),Dl(i),a],FCt),u=or.WGS84.cartographicToCartesian([Dl(n),Dl(r),o],kCt),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Bd),or.WGS84.cartographicToCartesian([Dl(n),Bd[1],Bd[2]],z1e),or.WGS84.cartographicToCartesian([Bd[0],Dl(i),Bd[2]],H1e),or.WGS84.cartographicToCartesian([Bd[0],Bd[1],o],W1e),K1e([...c,...z1e.subtract(c),...H1e.subtract(c),...W1e.subtract(c)],new Kr)}var yv="4.1.0-alpha.3";var gs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},wyr=Object.keys(gs),Ep={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function W7(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function $1e(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 B8="4.1.0-alpha.3";var Y1e={name:"Draco",id:"draco",module:"draco",version:B8,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 X1e(e,t,r){let n=Q1e(t.metadata),i=[],a=ICt(t.attributes);for(let o in e){let s=e[o],u=J1e(o,s,a[o]);i.push(u)}if(r){let o=J1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function ICt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function J1e(e,t,r){let n=r?Q1e(r.metadata):void 0;return n7(e,t,n)}function Q1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Z1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},PCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},RCt=4,o_=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 p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=r7(u.attributes),l=X1e(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*RCt,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),MCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=PCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=jCt(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 Z1e)if(this.draco[o]===i)return Z1e[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=LCt(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 jCt(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 LCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function MCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var qCt="1.5.6",NCt="1.4.1",V7=`https://www.gstatic.com/draco/versioned/decoders/${qCt}`,ai={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Ap={[ai.DECODER]:`${V7}/${ai.DECODER}`,[ai.DECODER_WASM]:`${V7}/${ai.DECODER_WASM}`,[ai.FALLBACK_DECODER]:`${V7}/${ai.FALLBACK_DECODER}`,[ai.ENCODER]:`https://raw.githubusercontent.com/google/draco/${NCt}/javascript/${ai.ENCODER}`},s_;async function e_e(e){let t=e.modules||{};return t.draco3d?s_=s_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):s_=s_||UCt(e),await s_}async function UCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Zu(Ap[ai.FALLBACK_DECODER],"draco",e,ai.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Zu(Ap[ai.DECODER],"draco",e,ai.DECODER),await Zu(Ap[ai.DECODER_WASM],"draco",e,ai.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await GCt(t,r)}function GCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var K7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:B8,worker:!0,options:{draco:{},source:null}};var xv={...Y1e,parse:zCt};async function zCt(e,t){let{draco:r}=await e_e(t),n=new o_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var HCt={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={...HCt,...bi};var $7={[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},WCt={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},Y7="Failed to convert GL type",qa=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in $7)if($7[r]===t)return r;throw new Error(Y7)}static fromName(t){let r=WCt[t];if(!r)throw new Error(Y7);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=$7[t];if(!r)throw new Error(Y7);return r}}static getByteSize(t){return qa.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(qa.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/qa.getByteSize(t));let a=qa.getArrayType(t);return new a(r,n,i)}};function t_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function J7(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 Jyr=1/256;var Xyr=new Dd,Qyr=new ce,Zyr=new Dd,exr=new Dd,txr=new Uint8Array(1);function r_e(e,t=255){return s7(e,0,t)/t*2-1}function n_e(e){return e<0?-1:1}function i_e(e,t,r,n){if(t_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=r_e(e,r),n.y=r_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))*n_e(i),n.y=(1-Math.abs(i))*n_e(n.y)}return n.normalize()}function X7(e,t,r){return i_e(e,t,255,r)}function O8(e){return(e%1+1)%1}var Ol=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=qa.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=qa.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=qa.createTypedArray(r,n),i[t]=a),a}};var VCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},KCt={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]]},$Ct={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 a_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?qa.fromName(i):i,o=VCt[e.type],s=KCt[e.type],u=$Ct[e.type];return r+=e.byteOffset,{values:qa.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var xc=e=>e!==void 0;function o_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?YCt(n,r):null}function YCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;xc(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(xc(u))for(xc(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];xc(c)&&xc(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 p=o.length;for(r=0;r<p;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let h=new Array(p).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],d[r]=h[n],++h[n];let b={classes:o,classIds:s,classIndexes:d,parentCounts:u,parentIndexes:f,parentIds:c};return QCt(b),b}function _v(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?JCt(e,t,r):XCt(e,t,r)}function JCt(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(xc(f))return f;let p=i[t],h=o[t];for(let d=0;d<p;++d){let b=a[h+d];b!==t&&l.push(b)}}return null}function XCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(xc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function QCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)s_e(e,i,stack)}function s_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!xc(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=xc(n)?n[t]:1,c=xc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&s_e(e,f,r)}r.pop(t)}function mo(e){return e!=null}var I8=(e,t)=>e,ZCt={HIERARCHY:!0,extensions:!0,extras:!0},Od=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)ZCt[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=o_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=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return mo(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),mo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=mo(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(mo(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(mo(n))return I8(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(mo(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];mo(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=I8(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=a_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=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return mo(s[r])});return mo(n)}_getPropertyNamesInHierarchy(t,r){_v(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 _v(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return mo(u)?mo(u.typedArray)?this._getBinaryProperty(u,s):I8(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=_v(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return mo(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),mo(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=I8(i,!0),!0):!1});return mo(a)}};var Q7=4;function Sp(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=Q7,e.version=n.getUint32(r,!0),r+=Q7,e.byteLength=n.getUint32(r,!0),r+=Q7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var wv=4,u_e="b3dm tile in legacy format.";function Ev(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=wv;let o=n.getUint32(r,!0);r+=wv;let s=n.getUint32(r,!0);r+=wv;let u=n.getUint32(r,!0);return r+=wv,s>=570425344?(r-=wv*2,i=a,s=o,u=0,a=0,o=0,console.warn(u_e)):u>=570425344&&(r-=wv,i=s,s=a,u=o,a=0,o=0,console.warn(u_e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Av(e,t,r,n){return r=e8t(e,t,r,n),r=t8t(e,t,r,n),r}function e8t(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=W7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function t8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=W7(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 Z7(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=J7(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 c_e=new ce;function l_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++)X7(t[n*2],t[n*2+1],c_e),c_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function f_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,r8t(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function r8t(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 p_e(e,t,r,n,i){r=Sp(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),n8t(e);let{featureTable:a,batchTable:o}=i8t(e);return await c8t(e,a,o,n,i),a8t(e,a,n),o8t(e,a,o),s8t(e,a),r}function n8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function i8t(e){let t=new Ol(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=u8t(e,t);return{featureTable:t,batchTable:n}}function a8t(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=f_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function o8t(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=Z7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function s8t(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=l_e(e,r)}}function u8t(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 Od(i,a,n)}return r}async function c8t(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,p=c.byteLength;if(!o||!Number.isFinite(f)||!p)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+p),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 l8t(e,l,n,i)}async function l8t(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 To(t.buffer,xv,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 h=a.POSITION.data.quantization,d=h.range;e.quantizedVolumeScale=new ce(d,d,d),e.quantizedVolumeOffset=new ce(h.minValues),e.quantizedRange=(1<<h.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let p={};if(t.batchTableProperties)for(let h of Object.keys(t.batchTableProperties))a.attributes[h]&&a.attributes[h].value&&(p[h.toLowerCase()]=a.attributes[h].value);e.attributes={positions:o,colors:Z7(e,s,void 0),normals:u,batchIds:c,...p}}var uq={};fa(uq,{decode:()=>Y8t,name:()=>H8});var P8="4.1.0-alpha.3";var h_e,f8t=(h_e=globalThis.loaders)==null?void 0:h_e.parseImageNode,eq=typeof Image<"u",tq=typeof ImageBitmap<"u",p8t=Boolean(f8t),rq=gn?!0:p8t;function d_e(e){switch(e){case"auto":return tq||eq||rq;case"imagebitmap":return tq;case"image":return eq;case"data":return rq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function m_e(){if(tq)return"imagebitmap";if(eq)return"image";if(rq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function g_e(e){let t=h8t(e);if(!t)throw new Error("Not an image");return t}function nq(e){return Sv(e)}function Sv(e){switch(g_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 h8t(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 d8t=/^data:image\/svg\+xml/,m8t=/\.svg((\?|#).*)?$/;function R8(e){return e&&(d8t.test(e)||m8t.test(e))}function v_e(e,t){if(R8(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 iq(e,t)}function iq(e,t){if(R8(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function j8(e,t,r){let n=v_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await g8t(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function g8t(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 v8t={},b_e=!0;async function y_e(e,t,r){let n;R8(r)?n=await j8(e,t,r):n=iq(e,r);let i=t&&t.imagebitmap;return await b8t(n,i)}async function b8t(e,t=null){if((y8t(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 y8t(e){for(let t in e||v8t)return!1;return!0}function x_e(e){return!E8t(e,"ftyp",4)||!(e[8]&96)?null:x8t(e)}function x8t(e){switch(_8t(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function _8t(e,t,r){return String.fromCharCode(...e.slice(t,r))}function w8t(e){return[...e].map(t=>t.charCodeAt(0))}function E8t(e,t,r=0){let n=w8t(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var _c=!1,u_=!0;function Id(e){let t=c_(e);return S8t(t)||D8t(t)||T8t(t)||C8t(t)||A8t(t)}function A8t(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=x_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function S8t(e){let t=c_(e);return t.byteLength>=24&&t.getUint32(0,_c)===2303741511?{mimeType:"image/png",width:t.getUint32(16,_c),height:t.getUint32(20,_c)}:null}function T8t(e){let t=c_(e);return t.byteLength>=10&&t.getUint32(0,_c)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,u_),height:t.getUint16(8,u_)}:null}function C8t(e){let t=c_(e);return t.byteLength>=14&&t.getUint16(0,_c)===16973&&t.getUint32(2,u_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,u_),height:t.getUint32(22,u_)}:null}function D8t(e){let t=c_(e);if(!(t.byteLength>=3&&t.getUint16(0,_c)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=F8t(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,_c);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,_c),width:t.getUint16(a+7,_c)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,_c)}return null}function F8t(){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 c_(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 __e(e,t){var i;let{mimeType:r}=Id(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function w_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=k8t(i),s;switch(o){case"imagebitmap":s=await y_e(e,t,a);break;case"image":s=await j8(e,t,a);break;case"data":s=await __e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Sv(s)),s}function k8t(e){switch(e){case"auto":case"data":return m_e();default:return d_e(e),e}}var B8t=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],O8t=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],I8t={image:{type:"auto",decode:!0}},Tv={id:"image",module:"images",name:"Images",version:P8,mimeTypes:O8t,extensions:B8t,parse:w_e,tests:[e=>Boolean(Id(new DataView(e)))],options:I8t};var S_e,E_e=(S_e=globalThis.loaders)==null?void 0:S_e.encodeImageNode;async function T_e(e,t){return t=t||{},t.image=t.image||{},E_e?E_e(e,{type:t.image.mimeType}):P8t(e,t)}var A_e=!0;async function P8t(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=nq(e),o=document.createElement("canvas");o.width=i,o.height=a,R8t(e,o);let s=await new Promise(u=>{if(n&&A_e)try{o.toBlob(u,r,n);return}catch{A_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function R8t(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 aq={name:"Images",id:"image",module:"images",version:P8,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:T_e};var oq={};function sq(e){if(oq[e]===void 0){let t=gn?L8t(e):j8t(e);oq[e]=t}return oq[e]}function j8t(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 L8t(e){switch(e){case"image/avif":case"image/webp":return M8t(e);default:return!0}}function M8t(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ui(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var L8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},M8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var q8t=1.33,C_e=["SCALAR","VEC2","VEC3","VEC4"],N8t=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],U8t=new Map(N8t),G8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},z8t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},H8t={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function q8(e){return C_e[e-1]||C_e[0]}function Cv(e){let t=U8t.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Dv(e,t){let r=H8t[e.componentType],n=G8t[e.type],i=z8t[e.componentType],a=e.count*n,o=e.count*n*i;Ui(o>=0&&o<=t.byteLength);let s=M8[e.componentType],u=L8[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function l_(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*q8t)}function D_e(e,t,r){let n=e.bufferViews[r];Ui(n);let i=n.buffer,a=t[i];Ui(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function F_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}=Dv(n,i),p=l*f,h=i.byteStride||p;if(typeof i.byteStride>"u"||i.byteStride===p)return new u(a,s,c);let d=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*h,f);d.set(E,x*f)}return d}function W8t(){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)||W8t(),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];Ui(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return F_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 Ui(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ui(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=Id(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;Ui(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Do(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:q8(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:Cv(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=WI(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 k_e(e){return(e%1+1)%1}var B_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},V8t={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},O_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function f_(e,t){return O_e[t]*B_e[e]}function Fv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=kv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function kv(e,t,r,n=1){let i=B_e[t],a=V8t[r],o=O_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 Bv(e,t,r){var c,l,f,p,h;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 d=(p=(f=o.images)==null?void 0:f[u])==null?void 0:p.mimeType,b=(h=e.gltf.images)==null?void 0:h[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=K8t(b,d,a,x,t.channels);g.push(E)}return g}}return[]}function N8(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(p=>p===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:Cv(o),count:o.length});i.attributes[t]=c}function K8t(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=$8t(o,s,e,u),l=0;for(let f of i){let p=typeof f=="number"?Object.values(a)[f]:a[f],h=c+p.offset,d=Sv(e);if(d.data.length<=h)throw new Error(`${d.data.length} <= ${h}`);let b=d.data[h];l|=b<<p.shift}return l}function $8t(e,t,r,n=1){let i=r.width,a=k_e(e)*(i-1),o=Math.round(a),s=r.height,u=k_e(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function U8(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 G8(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 z8(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 I_e="EXT_mesh_features",H8=I_e;async function Y8t(e,t){let r=new qr(e);J8t(r,t)}function J8t(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)X8t(e,i,t)}function X8t(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[I_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=Bv(e,u.texture,t):c=[];u.data=c}}var fq={};fa(fq,{decode:()=>Q8t,name:()=>Il});var cq="EXT_structural_metadata",Il=cq;async function Q8t(e,t){let r=new qr(e);Z8t(r,t)}function Z8t(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(cq);r&&((i=t.gltf)!=null&&i.loadImages&&eDt(e,r),tDt(e,r))}function eDt(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)nDt(e,r,a,t)}function tDt(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=rDt(i,a);o&&aDt(e,r,o)}}function rDt(e,t){for(let r of e)if(r.class===t)return r;return null}function nDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[cq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];iDt(e,u,r,n)}}function iDt(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=Bv(e,u,r);l!==null&&(N8(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function aDt(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=oDt(e,t,u,i,c);c.data=l}}}function oDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=sDt(e,r,i,n),c=uDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=cDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=z8(n,s,u,c);break}case"ENUM":{a=lDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function sDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Fv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function uDt(e,t,r){return typeof t.stringOffsets<"u"?Fv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function cDt(e,t,r,n){let i=e.array,a=e.count,o=f_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=kv(r,e.type,e.componentType,s):u=r,i?n?U8(u,t,n,r.length,o):a?G8(u,t,a):[]:u}function lDt(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=f_(t.type,s),c=n.byteLength/u,l=kv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return fDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let p=t.count;return p?pDt(l,r,p,o):[]}return lq(l,0,r,o)}function fDt(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,p=l/a,h=lq(t,f,p,o);s.push(h)}return s}function pDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=lq(e,o,r,n);i.push(s)}return i}function lq(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=hDt(n,o);s?i.push(s.name):i.push("")}return i}function hDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var pq={};fa(pq,{decode:()=>dDt,name:()=>vs});var P_e="EXT_feature_metadata",vs=P_e;async function dDt(e,t){let r=new qr(e);mDt(r,t)}function mDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(P_e);r&&((i=t.gltf)!=null&&i.loadImages&&gDt(e,r),vDt(e,r))}function gDt(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=yDt(i,a);s&&_Dt(e,s,o)}}function vDt(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=bDt(i,a);o&&xDt(e,r,o)}}function bDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function yDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function xDt(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=wDt(e,t,u,i,c);c.data=l}}}function _Dt(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=CDt(e,o,n);o.data=s}}}function wDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=EDt(e,r,i,n),c=ADt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=z8(n,s,u,c):SDt(r)&&(a=TDt(r,n,s,u)),a}function EDt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Fv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function ADt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Fv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function SDt(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 TDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=f_(o,s),c=r.byteLength/u,l=kv(r,o,s,c);return i?n?U8(l,t,n,r.length,u):a?G8(l,t,a):[]:l}function CDt(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)DDt(e,r,t,i,o);return i}function DDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Bv(e,a,i);o&&N8(e,t,o,n,i)}var W8="4.1.0-alpha.3";var Ov="4.1.0-alpha.3";var wc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},hq;async function mq(e){let t=e.modules||{};return t.basis?t.basis:(hq=hq||FDt(e),await hq)}async function FDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.TRANSCODER,"textures",e),await Zu(wc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await kDt(t,r)}function kDt(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 dq;async function gq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(dq=dq||BDt(e),await dq)}async function BDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.ENCODER,"textures",e),await Zu(wc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await ODt(t,r)}function ODt(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 IDt=["","WEBKIT_","MOZ_"],R_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"},V8=null;function p_(e){if(!V8){e=e||PDt()||void 0,V8=new Set;for(let t of IDt)for(let r in R_e)if(e&&e.getExtension(`${t}${r}`)){let n=R_e[r];V8.add(n)}}return V8}function PDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var K_e=Wt(W_e(),1);function Iv(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=LDt(t,n,i,e,o),u=jDt(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 jDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function LDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var MDt={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 V_e(e){return MDt[e]}var Io=[171,75,84,88,32,50,48,187,13,10,26,10];function X8(e){let t=new Uint8Array(e);return!(t.byteLength<Io.length||t[0]!==Io[0]||t[1]!==Io[1]||t[2]!==Io[2]||t[3]!==Io[3]||t[4]!==Io[4]||t[5]!==Io[5]||t[6]!==Io[6]||t[7]!==Io[7]||t[8]!==Io[8]||t[9]!==Io[9]||t[10]!==Io[10]||t[11]!==Io[11])}function $_e(e){let t=new Uint8Array(e),r=(0,K_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=V_e(r.vkFormat);return Iv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var qDt={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 d_(e,t){if(t.basis.containerFormat==="auto"){if(X8(e)){let n=await gq(t);return Y_e(n.KTX2File,e,t)}let{BasisFile:r}=await mq(t);return _q(r,e,t)}switch(t.basis.module){case"encoder":let r=await gq(t);switch(t.basis.containerFormat){case"ktx2":return Y_e(r.KTX2File,e,t);case"basis":default:return _q(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await mq(t);return _q(n,e,t)}}function _q(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(NDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function NDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=J_e(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 Y_e(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(UDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function UDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=J_e(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 J_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Pv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),qDt[r]}function Pv(){let e=p_();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 X_e={name:"Basis",id:"basis",module:"textures",version:Ov,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"}}},Pd={...X_e,parse:d_};var Po={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},GDt={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},zDt=e2e,HDt=Q8,WDt=Q8,VDt={DXT1:e2e,DXT3:Q8,DXT5:Q8,"ATC ":zDt,ATCA:HDt,ATCI:WDt};function Q_e(e){return new Uint32Array(e,0,Po.HEADER_LENGTH)[Po.MAGIC_NUMBER_INDEX]===Po.MAGIC_NUMBER}function Z_e(e){let t=new Int32Array(e,0,Po.HEADER_LENGTH),r=t[Po.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[Po.HEADER_PF_FLAGS_INDEX]&Po.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=KDt(r),i=GDt[n],a=VDt[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Po.HEADER_FLAGS_INDEX]&Po.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Po.MIPMAPCOUNT_INDEX]));let s=t[Po.HEADER_WIDTH_INDEX],u=t[Po.HEADER_HEIGHT_INDEX],c=t[Po.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Iv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function e2e(e,t){return(e+3>>2)*(t+3>>2)*8}function Q8(e,t){return(e+3>>2)*(t+3>>2)*16}function KDt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bs={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},$Dt={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]},YDt={0:t2e,1:t2e,2:r2e,3:r2e,6:m_,7:m_,9:g_,11:g_,22:m_,23:g_,24:m_,25:m_,26:g_,27:g_,28:JDt,29:XDt,30:QDt,31:ZDt,32:e4t,33:t4t,34:r4t,35:n4t,36:i4t,37:a4t,38:o4t,39:s4t,40:u4t};function n2e(e){let r=new Uint32Array(e,0,bs.HEADER_LENGTH)[bs.MAGIC_NUMBER_INDEX];return r===bs.MAGIC_NUMBER||r===bs.MAGIC_NUMBER_EXTRA}function i2e(e){let t=new Uint32Array(e,0,bs.HEADER_LENGTH),r=t[bs.PIXEL_FORMAT_INDEX],n=t[bs.COLOUR_SPACE_INDEX],i=$Dt[r]||[],a=i.length>1&&n?i[1]:i[0],o=YDt[r],s=t[bs.MIPMAPCOUNT_INDEX],u=t[bs.WIDTH_INDEX],c=t[bs.HEIGHT_INDEX],l=bs.HEADER_SIZE+t[bs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Iv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function t2e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function r2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function m_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function g_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function JDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function XDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function QDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function ZDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function e4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function t4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function r4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function n4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function i4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function a4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function o4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function s4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function u4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function a2e(e){if(X8(e))return $_e(e);if(Q_e(e))return Z_e(e);if(n2e(e))return i2e(e);throw new Error("Texture container format not recognized")}var o2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Ov,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}}},Z8={...o2e,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 d_(e,t))[0]):a2e(e)}};var wq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:Ov,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var Rv=!0,s2e=1735152710,Sq=12,eD=8,c4t=1313821514,l4t=5130562,f4t=0,p4t=0,h4t=1;function d4t(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 u2e(e,t=0,r={}){let n=new DataView(e),{magic:i=s2e}=r,a=n.getUint32(t,!1);return a===i||a===s2e}function c2e(e,t,r=0,n={}){let i=new DataView(t),a=d4t(i,r+0),o=i.getUint32(r+4,Rv),s=i.getUint32(r+8,Rv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Sq,e.version){case 1:return m4t(e,i,r);case 2:return g4t(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function m4t(e,t,r){Qt(e.header.byteLength>Sq+eD);let n=t.getUint32(r+0,Rv),i=t.getUint32(r+4,Rv);return r+=eD,Qt(i===f4t),Eq(e,t,r,n),r+=n,r+=Aq(e,t,r,e.header.byteLength),r}function g4t(e,t,r,n){return Qt(e.header.byteLength>Sq+eD),v4t(e,t,r,n),r+e.header.byteLength}function v4t(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,Rv),a=t.getUint32(r+4,Rv);switch(r+=eD,a){case c4t:Eq(e,t,r,i);break;case l4t:Aq(e,t,r,i);break;case p4t:n.strict||Eq(e,t,r,i);break;case h4t:n.strict||Aq(e,t,r,i);break;default:break}r+=Do(i,4)}return r}function Eq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Do(n,4)}function Aq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Do(n,4)}function Tq(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 Dq={};fa(Dq,{decode:()=>F4t,name:()=>D4t});var b4t="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",y4t="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",x4t=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]),_4t=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]),w4t={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},E4t={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function l2e(e,t,r,n,i,a="NONE"){let o=await A4t();C4t(o,o.exports[E4t[i]],e,t,r,n,o.exports[w4t[a||"NONE"]])}var Cq;async function A4t(){return Cq||(Cq=S4t()),Cq}async function S4t(){let e=b4t;WebAssembly.validate(x4t)&&(e=y4t,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(T4t(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function T4t(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?_4t[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function C4t(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 p=t(c,n,i,l,a.length);if(p===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),p!==0)throw new Error(`Malformed buffer data: ${p}`)}var tD="EXT_meshopt_compression",D4t=tD;async function F4t(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(k4t(r,o));await Promise.all(n),r.removeExtension(tD)}async function k4t(e,t){let r=e.getObjectExtension(t,tD);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),p=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await l2e(p,o,a,f,s,u),e.removeObjectExtension(t,tD)}}var Fq={};fa(Fq,{name:()=>B4t,preprocess:()=>O4t});var jv="EXT_texture_webp",B4t=jv;function O4t(e,t){let r=new qr(e);if(!sq("image/webp")){if(r.getRequiredExtensions().includes(jv))throw new Error(`gltf: Required extension ${jv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,jv);a&&(i.source=a.source),r.removeObjectExtension(i,jv)}r.removeExtension(jv)}var kq={};fa(kq,{name:()=>I4t,preprocess:()=>P4t});var rD="KHR_texture_basisu",I4t=rD;function P4t(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,rD);a&&(i.source=a.source,r.removeObjectExtension(i,rD))}r.removeExtension(rD)}var Oq={};fa(Oq,{decode:()=>q4t,encode:()=>N4t,name:()=>L4t,preprocess:()=>M4t});function f2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Bq(n);t[r]=i}}return t}function Bq(e){let{buffer:t,size:r,count:n}=R4t(e);return{value:t,size:r,byteOffset:0,count:n,type:q8(r),componentType:Cv(t)}}function R4t(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=j4t(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function j4t(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Tp="KHR_draco_mesh_compression",L4t=Tp;function M4t(e,t,r){let n=new qr(e);for(let i of p2e(n))n.getObjectExtension(i,Tp)}async function q4t(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 p2e(n))n.getObjectExtension(o,Tp)&&i.push(U4t(n,o,t,r));await Promise.all(i),n.removeExtension(Tp)}function N4t(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])G4t(n,t),r.addRequiredExtension(Tp)}async function U4t(e,t,r,n){let i=e.getObjectExtension(t,Tp);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=Wh(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await To(o,xv,s,n),c=f2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let p=t.attributes[l],h=e.getAccessor(p);h!=null&&h.min&&(h!=null&&h.max)&&(f.min=h.min,f.max=h.max)}t.attributes=c,u.indices&&(t.indices=Bq(u.indices)),e.removeObjectExtension(t,Tp),z4t(t)}function G4t(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:{[Tp]:{bufferView:u,attributes:s}}}]}}function z4t(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*p2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Pq={};fa(Pq,{decode:()=>K4t,name:()=>H4t});var Iq="KHR_texture_transform",H4t=Iq,nD=new ce,W4t=new Rr,V4t=new Rr;async function K4t(e,t){var a;if(!new qr(e).hasExtension(Iq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)$4t(o,e)}function $4t(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&&v_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&v_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&v_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&v_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&v_(t,e,u,r)}function v_(e,t,r,n){let i=Y4t(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&&J4t(e,s,i)}}function Y4t(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Iq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=Z4t(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function J4t(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:p}=e.buffers[l.buffer],h=(p||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:d,length:b}=Dv(c,l),g=M8[c.componentType],x=L8[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new d(f,h+F*E,2);nD.set(D[0],D[1],1),nD.transformByMatrix3(a),S.set([nD[0],nD[1]],F*x)}n===i?X4t(c,l,e.buffers,S):Q4t(i,c,t,e,S)}}}}function X4t(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 Q4t(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 Z4t(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=W4t.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=V4t.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Rq={};fa(Rq,{decode:()=>tFt,encode:()=>rFt,name:()=>eFt});var Rd="KHR_lights_punctual",eFt=Rd;async function tFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Rd);n&&(t.json.lights=n.lights,t.removeExtension(Rd));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Rd);a&&(i.light=a.light),t.removeObjectExtension(i,Rd)}}async function rFt(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Rd);Ui(!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,Rd,n)}delete t.json.lights}}var jq={};fa(jq,{decode:()=>iFt,encode:()=>aFt,name:()=>nFt});var b_="KHR_materials_unlit",nFt=b_;async function iFt(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,b_);t.removeExtension(b_)}function aFt(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,b_,{}),t.addExtension(b_))}var Lq={};fa(Lq,{decode:()=>sFt,encode:()=>uFt,name:()=>oFt});var y_="KHR_techniques_webgl",oFt=y_;async function sFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(y_);if(n){let i=cFt(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,y_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=lFt(a.technique,t)),t.removeObjectExtension(a,y_)}t.removeExtension(y_)}}async function uFt(e,t){}function cFt(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 lFt(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 h2e=[fq,uq,Dq,Fq,kq,Oq,Rq,jq,Lq,Pq,pq];function d2e(e,t={},r){var i;let n=h2e.filter(a=>g2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function m2e(e,t={},r){var i;let n=h2e.filter(a=>g2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function g2e(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 Mq="KHR_binary_glTF";function v2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Mq);i&&Object.assign(n,i),t.removeObjectExtension(n,Mq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Mq)}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"},qq=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),v2e(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 y2e(e,t={}){return new qq().normalize(e,t)}async function x2e(e,t,r=0,n,i){var a,o,s;return hFt(e,t,r,n),y2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),d2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await dFt(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await mFt(e,n,i),await m2e(e,n,i),e}function hFt(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!u2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=HI(t);else if(t instanceof ArrayBuffer){let o={};r=c2e(o,t,r,n.glb),Ui(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ui(!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 dFt(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;Ui(u);let c=Tq(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 mFt(e,t,r){let n=gFt(e),i=e.json.images||[],a=[];for(let o of n)a.push(vFt(e,i[o],o,t,r));return await Promise.all(a)}function gFt(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 vFt(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Tq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=D_e(e.json,e.buffers,t.bufferView);a=Wh(s.buffer,s.byteOffset,s.byteLength)}Ui(a,"glTF image has no data");let o=await To(a,[Tv,Pd],{...n,mimeType:t.mimeType,basis:n.basis||{format:Pv()}},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 Pl={name:"glTF",id:"gltf",module:"gltf",version:W8,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:bFt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function bFt(e,t={},r){t={...Pl.options,...t},t.gltf={...Pl.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await x2e({},e,n,t,r)}var yFt=1179937895,xFt=1313821514,_Ft=5130562,Ec=!0;function _2e(e,t,r=0,n={}){let{magic:i=yFt,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,Ec),t.setUint32(r+4,a,Ec),t.setUint32(r+8,0,Ec));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,xFt,Ec)),r+=8;let f=JSON.stringify(o);if(r=Bm(t,r,f,4),t){let p=r-l-8;t.setUint32(l+0,p,Ec)}if(s){let p=r;if(t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,_Ft,Ec)),r+=8,r=IA(t,r,s,4),t){let h=r-p-8;t.setUint32(p+0,h,Ec)}}if(t){let p=r-u;t.setUint32(c,p,Ec)}return r}function Nq(e,t,r,n){return wFt(e),_2e(e,t,r,n)}function wFt(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Uq={name:"glTF",id:"gltf",module:"gltf",version:W8,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,options:{gltf:{}},encode:async(e,t={})=>w2e(e,t),encodeSync:w2e};function w2e(e,t={}){let{byteOffset:r=0}=t,n=Nq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Nq(e,a,r,t),i}var EFt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},AFt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ys={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},SFt={magFilter:ys.TEXTURE_MAG_FILTER,minFilter:ys.TEXTURE_MIN_FILTER,wrapS:ys.TEXTURE_WRAP_S,wrapT:ys.TEXTURE_WRAP_T},TFt={[ys.TEXTURE_MAG_FILTER]:ys.LINEAR,[ys.TEXTURE_MIN_FILTER]:ys.NEAREST_MIPMAP_LINEAR,[ys.TEXTURE_WRAP_S]:ys.REPEAT,[ys.TEXTURE_WRAP_T]:ys.REPEAT};function CFt(){return{id:"default-sampler",parameters:TFt}}function DFt(e){return AFt[e]}function FFt(e){return EFt[e]}var Gq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ui(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=DFt(t.componentType),i=FFt(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}=Dv(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):CFt(),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 SFt[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 x_(e,t){return new Gq().postProcess(e,t)}var iD={URI:0,EMBEDDED:1};function aD(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=Wh(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 oD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(kFt(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 To(e.gltfArrayBuffer,Pl,r,n);e.gltf=x_(a),e.gpuMemoryUsageInBytes=l_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function kFt(e,t,r){switch(t){case iD.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 iD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function E2e(e,t,r,n,i){var o;r=BFt(e,t,r,n,i),await oD(e,iD.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 BFt(e,t,r,n,i){r=Sp(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),r=aD(e,t,r,n);let a=new Ol(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function A2e(e,t,r,n,i){return r=OFt(e,t,r,n,i),await oD(e,e.gltfFormat||0,n,i),r}function OFt(e,t,r,n,i){var c;if(r=Sp(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Ev(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Av(e,t,r,n),r=aD(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 Ol(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 Od(e.batchTableJson,e.batchTableBinary,s);return IFt(e,o,u,s),r}function IFt(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 ds,f=new ce,p={},h=new Kr,d=[],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),p.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,d),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,d),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,h),h.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),p.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,d);j&&f.scale(j),p.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(p.rotation);h.identity(),h.translate(p.translation),h.multiplyRight(N),h.scale(p.scale);let C=h.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function S2e(e,t,r,n,i,a){r=Sp(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 T2e(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 To(t,Pl,r,n);e.gltf=x_(o),e.gpuMemoryUsageInBytes=l_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function zq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=$1e(e,t),i.type){case gs.COMPOSITE:return await S2e(i,e,t,r,n,zq);case gs.BATCHED_3D_MODEL:return await E2e(i,e,t,r,n);case gs.GLTF:return await T2e(i,e,r,n);case gs.INSTANCED_3D_MODEL:return await A2e(i,e,t,r,n);case gs.POINT_CLOUD:return await p_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Hq(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=C2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=C2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await sD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let p of c.contentAvailability)await sD(c,p,f,r);else await sD(c,c.contentAvailability,f,r);return await sD(c,c.childSubtreeAvailability,f,r),c}async function sD(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 s=`${(n==null?void 0:n.baseUrl)||""}/${o.uri}`,c=await(await n.fetch(s)).arrayBuffer();t.explicitBitstream=new Uint8Array(c,a.byteOffset,a.byteLength);return}t.explicitBitstream=new Uint8Array(r,a.byteOffset,a.byteLength)}function C2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var uD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:yv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Hq,options:{}};function Wq(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 du(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Wq()}var PFt=globalThis.self||globalThis.window||globalThis.global,Lv=globalThis.window||globalThis.self||globalThis.global,RFt=globalThis.document||{},jd=globalThis.process||{},jFt=globalThis.console,$wr=globalThis.navigator||{};var cD="4.1.0-alpha.3",Xwr=du();function LFt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var lD=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=LFt(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 D2e(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 F2e(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 fD(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 pD;(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"})(pD||(pD={}));var MFt=10;function k2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),pD[e]||pD.WHITE)}function B2e(e,t,r){if(!du&&typeof e=="string"){if(t){let n=k2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=k2e(r);e="\x1B[".concat(n+MFt,"m").concat(e,"\x1B[49m")}}return e}function O2e(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 Mv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Ld(){let e;if(du()&&Lv.performance){var t,r;e=Lv===null||Lv===void 0||(t=Lv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in jd){var n;let i=jd===null||jd===void 0||(n=jd.hrtime)===null||n===void 0?void 0:n.call(jd);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var qv={debug:du()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},qFt={enabled:!0,level:0};function xs(){}var I2e={},P2e={once:!0},__=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=cD,this._startTs=Ld(),this._deltaTs=Ld(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new lD("__probe-".concat(this.id,"__"),qFt),this.timeStamp("".concat(this.id," started")),O2e(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((Ld()-this._startTs).toPrecision(10))}getDelta(){return Number((Ld()-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){Mv(t,r)}warn(t){return this._getLogFunction(0,t,qv.warn,arguments,P2e)}error(t){return this._getLogFunction(0,t,qv.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,qv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,qv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,qv.debug||qv.info,arguments,P2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||xs,n&&[n],{tag:zFt(r)}):xs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?du()?GFt({image:i,message:a,scale:o}):UFt({image:i,message:a,scale:o}):xs}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||xs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=R2e({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||xs)}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()>=j2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=R2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Mv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Ld();let o=a.tag||a.message;if(a.once&&o)if(!I2e[o])I2e[o]=Ld();else return xs;return r=NFt(this.id,a.message,a),n.bind(console,r,...a.args)}return xs}};__.VERSION=cD;function j2e(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 Mv(Number.isFinite(t)&&t>=0),t}function R2e(e){let{logLevel:t,message:r}=e;e.logLevel=j2e(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 Mv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function NFt(e,t,r){if(typeof t=="string"){let n=r.time?F2e(D2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=B2e(t,r.color,r.background)}return t}function UFt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),xs}function GFt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=fD(a,r,n);console.log(...o)},a.src=t,xs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...fD(t,r,n)),xs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...fD(a,r,n)),a.src=t.toDataURL(),xs}return xs}function zFt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Vq=new __({id:"@probe.gl/log"});var _s=null;try{_s=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 Na(e){return(e&&e.__isLong__)===!0}function L2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Na;var M2e={},q2e={};function Md(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=M2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(M2e[e]=r),r))}kn.fromInt=Md;function ws(e,t){if(isNaN(e))return t?Rl:mu;if(t){if(e<0)return Rl;if(e>=z2e)return V2e}else{if(e<=-U2e)return go;if(e+1>=U2e)return W2e}return e<0?ws(-e,t).neg():$r(e%Uv|0,e/Uv|0,t)}kn.fromNumber=ws;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var hD=Math.pow;function $q(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?Rl:mu;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 $q(e.substring(1),t,r).neg();for(var i=ws(hD(r,8)),a=mu,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=ws(hD(r,s));a=a.mul(c).add(ws(u))}else a=a.mul(i),a=a.add(ws(u))}return a.unsigned=t,a}kn.fromString=$q;function gu(e,t){return typeof e=="number"?ws(e,t):typeof e=="string"?$q(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=gu;var N2e=1<<16,HFt=1<<24,Uv=N2e*N2e,z2e=Uv*Uv,U2e=z2e/2,G2e=Md(HFt),mu=Md(0);kn.ZERO=mu;var Rl=Md(0,!0);kn.UZERO=Rl;var Nv=Md(1);kn.ONE=Nv;var H2e=Md(1,!0);kn.UONE=H2e;var Kq=Md(-1);kn.NEG_ONE=Kq;var W2e=$r(-1,2147483647,!1);kn.MAX_VALUE=W2e;var V2e=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=V2e;var go=$r(0,-2147483648,!1);kn.MIN_VALUE=go;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Uv+(this.low>>>0):this.high*Uv+(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(go)){var r=ws(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=ws(hD(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(go)?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 Na(t)||(t=gu(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(Na(t)||(t=gu(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(go)?go:this.not().add(Nv)};Ke.neg=Ke.negate;Ke.add=function(t){Na(t)||(t=gu(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,p=0,h=0;return h+=a+c,p+=h>>>16,h&=65535,p+=i+u,f+=p>>>16,p&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(p<<16|h,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Na(t)||(t=gu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Na(t)||(t=gu(t)),_s){var r=_s.mul(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Rl:mu;if(this.eq(go))return t.isOdd()?go:mu;if(t.eq(go))return this.isOdd()?go:mu;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(G2e)&&t.lt(G2e))return ws(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,p=0,h=0,d=0;return d+=o*l,h+=d>>>16,d&=65535,h+=a*l,p+=h>>>16,h&=65535,h+=o*c,p+=h>>>16,h&=65535,p+=i*l,f+=p>>>16,p&=65535,p+=a*c,f+=p>>>16,p&=65535,p+=o*u,f+=p>>>16,p&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(h<<16|d,f<<16|p,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Na(t)||(t=gu(t)),t.isZero())throw Error("division by zero");if(_s){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?_s.div_u:_s.div_s)(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Rl:mu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Rl;if(t.gt(this.shru(1)))return H2e;a=Rl}else{if(this.eq(go)){if(t.eq(Nv)||t.eq(Kq))return go;if(t.eq(go))return Nv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(mu)?t.isNegative()?Nv:Kq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(go))return this.unsigned?Rl:mu;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=mu}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:hD(2,s-48),c=ws(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=ws(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Nv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Na(t)||(t=gu(t)),_s){var r=(this.unsigned?_s.rem_u:_s.rem_s)(this.low,this.high,t.low,t.high);return $r(r,_s.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?L2e(this.low):L2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Na(t)||(t=gu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Na(t)||(t=gu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Na(t)||(t=gu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Na(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 Na(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 Na(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 Na(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 Na(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 Gv=kn;var WFt=16;function w_(e){e==="X"&&(e="");let t=e.padEnd(WFt,"0");return Gv.fromString(t,!0,16)}function Yq(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 Jq(e,t){let r=VFt(e).shiftRightUnsigned(2);return e.add(Gv.fromNumber(2*t+1-4).multiply(r))}function VFt(e){return e.and(e.not().add(1))}var KFt=3,$Ft=30,YFt=2*$Ft+1,K2e=180/Math.PI;function Y2e(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);JFt(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 J2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<KFt+YFt;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=Gv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Gv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function Xq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function $2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Qq(e){return[$2e(e[0]),$2e(e[1])]}function Zq(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 eN([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*K2e,n*K2e]}function JFt(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 X2e(e){let t=Xq(e.ij,e.level,[.5,.5]),r=Qq(t),n=Zq(e.face,r);return eN(n)}var XFt=100;function tN(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(XFt*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],p=(f[0]-l[0])/a,h=(f[1]-l[1])/a;for(let d=0;d<a;d++){l[0]+=p,l[1]+=h;let b=Xq(r,n,l),g=Qq(b),x=Zq(t,g),E=eN(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 zv(e){let t=QFt(e);return Y2e(t)}function QFt(e){if(e.indexOf("/")>0)return e;let t=w_(e);return J2e(t)}function rN(e){let t=zv(e);return X2e(t)}function Z2e(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=zv(a),s=tN(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=Q2e(r)}else{let r=tN(e);t=Q2e(r)}return t}function Q2e(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 nN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=zv(e),a=Z2e(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 dD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=nN(t,r),i=rN(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=a_(n);return[...c.center,...c.halfAxes]}var ZFt=4,ekt=8,tkt={QUADTREE:ZFt,OCTREE:ekt};function rkt(e,t,r){if(e!=null&&e.box){let n=w_(e.s2VolumeInfo.token),i=Jq(n,t),a=Yq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,p=c.minimumHeight+l/2;c.minimumHeight=p-f,c.maximumHeight=p+f;break;default:break}return{box:dD(o),s2VolumeInfo:o}}}async function aN(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:p,subtreesUriTemplate:h,basePath:d}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Vq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${p} won't be loaded...`),b;let g=s+u.level;if(g>f)return b;let x=tkt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**s-1)/(x-1),k=qd(r.mortonIndex,n,E),N=j+k,C=qd(r.x,S,1),I=qd(r.y,F,1),P=qd(r.z,D,1),U=!1;s>=l&&(U=iN(o.childSubtreeAvailability,k));let Y=qd(u.x,C,s),J=qd(u.y,I,s),re=qd(u.z,P,s);if(U){let Te=`${d}/${h}`,$e=mD(Te,g,Y,J,re);o=await An($e,uD,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(!iN(o.tileAvailability,N))return b;iN(o.contentAvailability,N)&&(b.contentUrl=mD(p,g,Y,J,re));let ye=s+1,he={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=rkt(i,Te,c),We=await aN({subtree:o,implicitOptions:t,loaderOptions:a,parentData:he,childIndex:Te,level:ye,globalData:{...u},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=nkt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,i);b.children.push(ne)}}return b}function iN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Vq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?okt(t,r.explicitBitstream):!1}function nkt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,p=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),h=l/2**t,d=i!=null&&i.box?{box:i.box}:f,b=ikt(t,d,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:p},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:h,geometricError:h,transform:e.transform,boundingVolume:b}}function ikt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,p=2**e,h=(u-o)/p,d=(c-s)/p,b=(f-l)/p,[g,x]=[o+h*n,o+h*(n+1)],[E,S]=[s+d*i,s+d*(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 qd(e,t,r){return(e<<r)+t}function mD(e,t,r,n,i){let a=akt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function akt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function okt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function sN(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 uN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function oN(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 tu.resolve(t,e)}function ewe(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=oN(a,t))}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:sN(e,r),refine:uN(e.refine)}}async function nwe(e,t,r){let n=null,i=rwe(e.root);i&&e.root?n=await twe(e.root,e,t,i,r):n=ewe(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=rwe(c),f;l?f=await twe(c,e,t,l,r):f=ewe(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function twe(e,t,r,n,i){var F,D,j;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=mD(c,0,0,0,0),f=oN(l,r),p=await An(f,uD,i),h=(F=e.content)==null?void 0:F.uri,d=h?oN(h,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:dD(x),s2VolumeInfo:x};e.boundingVolume=N}let E=e.boundingVolume,S={contentUrlTemplate:d,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:b,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:g,rootBoundingVolume:E,getTileType:sN,getRefine:uN};return await skt(e,r,p,S,i)}async function skt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await aN({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:sN(e,s),refine:uN(e.refine),content:u||e.content,children:a}}function rwe(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 Ac={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:ukt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function ukt(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?ckt(e,t,r):lkt(e,t,r)}async function ckt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=fkt(i),o=await nwe(n,a,t||{});return{...n,shape:"tileset3d",loader:Ac,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 lkt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await zq(e,0,t,r,n.content),n.content}function fkt(e){return tu.dirname(e)}var iwe="https://api.cesium.com/v1/assets";async function awe(e,t){if(!t){let a=await pkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await hkt(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=iwe,r={Authorization:`Bearer ${e}`},n=await ko(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function hkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${iwe}/${t}`,i=await ko(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await ko(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function dkt(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 awe(r,n)}var gD={...Ac,id:"cesium-ion",name:"Cesium Ion",preload:dkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=gD,Ac.parse(e,t,r)),options:{"cesium-ion":{...Ac.options["3d-tiles"],accessToken:null}}};var hTe=Wt(YU(),1),PIt="4.1.0-alpha.3",JU={id:"zip",module:"zip",name:"Zip Archive",version:PIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:RIt};async function RIt(e,t={}){let r=[],n={};try{let i=new hTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=jIt(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 jIt(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 a2=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 LIt=new Uint8Array([80,75,5,6]),MIt=new Uint8Array([80,75,6,7]),qIt=new Uint8Array([80,75,6,6]),NIt=8n,UIt=16n,GIt=8n,zIt=24n,HIt=48n,dTe=async e=>{let t=await a2(e,LIt),r=BigInt(await e.getUint16(t+NIt)),n=BigInt(await e.getUint32(t+UIt));if(n===BigInt(4294967295)||r===BigInt(4294967295)){let i=t-20n,a=await e.slice(i,i+4n);if(!ec(a,MIt))throw new Error("zip64 EoCD locator not found");let o=await e.getBigUint64(i+GIt),s=await e.slice(o,o+4n);if(!ec(s,qIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+zIt),n=await e.getBigUint64(o+HIt)}return{cdRecordsNumber:r,cdStartOffset:n}};var WIt=20n,VIt=24n,KIt=28n,$It=30n,YIt=32n,JIt=42n,XU=46n,s2=new Uint8Array([80,75,1,2]),o2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,s2.buffer))return null;let n=BigInt(await t.getUint32(e+WIt)),i=BigInt(await t.getUint32(e+VIt)),a=await t.getUint16(e+$It),o=BigInt(await t.getUint16(e+YIt)),s=await t.getUint16(e+KIt),u=await t.slice(e+XU,e+XU+BigInt(s)),c=new TextDecoder().decode(u),l=e+XU+BigInt(s),f=await t.getUint32(e+JIt),p=BigInt(f),h=new DataView(await t.slice(l,l+BigInt(a))),d={uncompressedSize:i,compressedSize:n,localHeaderOffset:p,startDisk:o},b=XIt(d,h);return{...d,...b,extraFieldLength:a,fileNameLength:s,fileName:c,extraOffset:l}};async function*s4(e){let{cdStartOffset:t}=await dTe(e),r=await o2(t,e);for(;r;)yield r,r=await o2(r.extraOffset+BigInt(r.extraFieldLength),e)}var mTe=(...e)=>e[0]+e[1]*16,XIt=(e,t)=>{let r=QIt(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)=>mTe(c[u],c[u+1])===1&&mTe(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},QIt=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};var WSr=[{offset:0,size:4,default:new DataView(s2.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 ZIt=8n,ePt=18n,tPt=22n,rPt=26n,nPt=28n,u4=30n,QU=new Uint8Array([80,75,3,4]),e0=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,QU))return null;let n=await t.getUint16(e+rPt),i=new TextDecoder().decode(await t.slice(e+u4,e+u4+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+nPt),o=e+u4+BigInt(n+a),s=await t.getUint16(e+ZIt),u=BigInt(await t.getUint32(e+ePt)),c=BigInt(await t.getUint32(e+tPt)),l=e+u4+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}};var YSr=[{offset:0,size:4,default:new DataView(QU.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"}];function ZU(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=iPt(e,n,16);r[a]=i}return r}function iPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var mb=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 Vh(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var u2=class extends mb{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 t0=Wt(jU(),1),Vl=Wt(require("zlib"),1);var r0=class extends mb{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 Om(Vl.default.gzip)(t):await Om(Vl.default.deflate)(t);return fl(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 Om(Vl.default.gunzip)(t):await Om(Vl.default.inflate)(t);return fl(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?Vl.default.gzipSync(t):Vl.default.deflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?t0.default.deflateRaw:t0.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?Vl.default.gunzipSync(t):Vl.default.inflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?t0.default.inflateRaw:t0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new t0.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 t0.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 aPt={0:async e=>e,8:async e=>await new r0({raw:!0}).decompress(e)},c2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new Px(t);else throw new Error("Cannot open file for random access in a WEB browser");else XI(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=s4(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 e0(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=aPt[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=s4(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 oPt={0:e=>new u2().decompress(e),8:e=>new r0({raw:!0}).decompress(e)},c4=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 Rx().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await e0(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=oPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var l2=class extends c2{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 c4(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 a2(t,s2),n=await o2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await e0(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=ZU(o)}else this.hashTable=null}};function Mp(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 qp(e,t,r){e&&e.setUint32(t+8,r,!0)}function gTe(e,t,r,n,i){e={magic:Ep.COMPOSITE,tiles:[],...e};let a=r;r+=Mp(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 qp(t,a,r-a),r}function vTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Do(s.length,8),l=u?Do(u.length,8):0;e={magic:Ep.BATCHED_MODEL,...e};let f=r;r=Mp(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=Bm(t,r,s,8),a&&(r=Bm(t,r,u,8));let p=e.gltfEncoded;return p&&(r=Bx(t,r,p,p.byteLength)),qp(t,f,r-f),r}function bTe(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:Ep.INSTANCED_MODEL,...e};let f=r;return r=Mp(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+=km(t,r,c,l),r+=km(t,r,o,s),qp(t,f,r-f),r}var sPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function yTe(e,t,r,n){let{featureTableJson:i=sPt}=e,a=JSON.stringify(i);a=VI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:Ep.POINT_CLOUD,...e};let c=r;return r+=Mp(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+=km(t,r,a,o),r+=Bx(t,r,s,u),qp(t,c,r-c),r}function tG(e,t){let r=eG(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return eG(e,i,0,t),n}function eG(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case gs.COMPOSITE:return gTe(e,t,r,n,eG);case gs.POINT_CLOUD:return yTe(e,t,r,n);case gs.BATCHED_3D_MODEL:return vTe(e,t,r,n);case gs.INSTANCED_3D_MODEL:return bTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var rG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>xTe(e,t),encodeSync:xTe};function xTe(e,t){return tG(e,t)}var Ga=require("path");var _Te=Wt(require("crypto")),f4=new Uint8Array(256),l4=f4.length;function nG(){return l4>f4.length-16&&(_Te.default.randomFillSync(f4),l4=0),f4.slice(l4,l4+=16)}var Aa=[];for(let e=0;e<256;++e)Aa.push((e+256).toString(16).slice(1));function wTe(e,t=0){return(Aa[e[t+0]]+Aa[e[t+1]]+Aa[e[t+2]]+Aa[e[t+3]]+"-"+Aa[e[t+4]]+Aa[e[t+5]]+"-"+Aa[e[t+6]]+Aa[e[t+7]]+"-"+Aa[e[t+8]]+Aa[e[t+9]]+"-"+Aa[e[t+10]]+Aa[e[t+11]]+Aa[e[t+12]]+Aa[e[t+13]]+Aa[e[t+14]]+Aa[e[t+15]]).toLowerCase()}var ETe=Wt(require("crypto")),iG={randomUUID:ETe.default.randomUUID};function uPt(e,t,r){if(iG.randomUUID&&!t&&!e)return iG.randomUUID();e=e||{};let n=e.random||(e.rng||nG)();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 wTe(n)}var Oc=uPt;var D0=Wt(require("process"),1),ok=Wt(wu(),1),YW=Wt(uG(),1);var Jb=require("path"),Eke=Wt(wu(),1);var PTe=()=>({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 $b=require("fs"),Yb=require("path");var yke=require("zlib"),xke=require("path"),cw=require("fs"),PVt=Wt(bke(),1);var RVt=Wt(YU(),1);var jVt=Wt(aG(),1);function YF(e){let t=`${e}.gz`,r=(0,yke.createGzip)(),n=(0,cw.createReadStream)(e),i=(0,cw.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 _ke(e,t,r,n,i){process.platform==="win32"?await MVt(e,t,r,n,i):await LVt(e,t,r,n)}async function LVt(e,t,r=0,n="."){let i=lw(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function MVt(e,t,r=0,n=(0,xke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=lw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function ki(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 $b.promises.mkdir(e,{recursive:!0});let i=(0,Yb.join)(e,r);try{await $b.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function qc(e,t,r="index.json",n=!0,i){let a=await ki(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await YF(a);return await RW(a),o}}return a}async function JF(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,Yb.join)(e,t);An(o,YI).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function wke(e){try{return await $b.promises.stat(e),!0}catch{return!1}}function fw(e){return $b.promises.rm(e,{recursive:!0})}function RW(e){return $b.promises.unlink(e)}function lw(e){return(0,Yb.isAbsolute)(e)?e:(0,Yb.join)(process.cwd(),e)}var eo=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,Jb.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,Jb.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,Jb.join)(r,n);return await wke(i)?(console.log(`load ${i}.`),await JF(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),eo.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?eo.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,Eke.default)({nodeCount:this.nodesCounter},PTe()),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,Jb.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,Jb.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}),eo.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 pw=require("path"),XF=require("fs");function Xb(e){if(typeof e=="number"){let r=Math.floor(e/1e3),n=e-r*1e3;return Ake(r,n)}else{let r=e[0],n=e[1]/1e6;return Ake(r,n)}}function Ake(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 QF(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=lw(r);try{if(t){let s=(0,pw.join)(i,`${n}.slpk`);return(await XF.promises.stat(s)).size}let a=(0,pw.join)(i,n);return await Ske(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function Ske(e){let t=0,r=await XF.promises.readdir(e);for(let n of r){let i=await XF.promises.stat((0,pw.join)(e,n));i.isDirectory()?t+=await Ske((0,pw.join)(e,n)):t+=i.size}return t}var zke=Wt(uG(),1);var C0=3,Qb=9;function Cke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Qb;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=qVt(o),c=NVt({...u,...e}),l=UVt(c);return GVt(l,u.featureCount)}function qVt(e){let t=1,r=1,n=Tke(e.slice(0,C0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=C0;c<e.length;c+=C0){let l=Tke(e.slice(c,c+C0));n!==l&&(i[t]=c/C0-1,i[t+1]=c/C0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/C0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Tke(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 NVt(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),p=new Float32Array(o),h=new Uint16Array(a),d=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=hw("positions",F,D),k=hw("normals",F,D),N=hw("colors",F,D),C=hw("uvRegions",F,D),I=hw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(d,d+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:h.subarray(x,x+C),texCoords:p.subarray(E,E+I)}),d+=j,b+=k,g+=N,x+=C,E+=I}return u}function hw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Qb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function UVt(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=Dke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function GVt(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/Qb-1+o),i.push(f.positions.length/Qb+o),o+=f.positions.length/Qb,a+=1}let s=Dke(e);return i.push(s.positions.length/Qb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function Dke(e){let t=e.map(({positions:f})=>f),r=t.length>1?Co(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?Co(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?Co(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?Co(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?Co(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function jW(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 sa?(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 ds().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 Fke(e,t){let r=zVt(e),n=a_(r),i=U7(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 zVt(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 kke(e){let t;e instanceof Ja?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 LW(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 sa(r,n)}function Bke(e,t,r){var s,u,c,l,f,p,h,d;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)||((p=e.gltf)==null?void 0:p.nodes)||[],i=((d=(h=e.gltf)==null?void 0:h.images)==null?void 0:d.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}}}))||[];Oke(n);let{cartographicOrigin:a,modelMatrix:o}=WVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function HVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function WVt(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 Oke(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:HVt(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&&Oke(n.children)}}function Ike(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[vs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function Pke(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 vs:return KVt(e,o,r,n);case H8:return VVt(e,o);default:return[]}return[]}function VVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function KVt(e,t,r,n){var o,s,u,c,l,f,p;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 h=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return $Vt(h,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let d=`TEXCOORD_${((p=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:p.texCoord)||0}`,b=e[d].value;return YVt(a,b,r)}return n?e[n].value:[]}function $Vt(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 YVt(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 p=0;p<t.length;p+=2){let h=t[p],d=t[p+1],b=Math.min(O8(h)*o.width|0,o.width-1),x=(Math.min(O8(d)*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 Rke(e,t){let r={};for(let n in t){let i=t[n];r[n]=JVt(i,e)}return r}function JVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function jke(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}function XVt(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 Lke(e){let t={};for(let r in e){let n=e[r][0],i=XVt(n);t[r]=i}return t}var Mke=(e,t)=>{var a,o,s,u,c,l,f,p;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[vs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let h in n.properties){let d=n.properties[h],b=QVt(d);r[h]=b}return r}let i=(p=(f=(l=(c=e.extensions)==null?void 0:c[Il])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:p[t];if(i){for(let h in i.properties){let d=i.properties[h],b=ZVt(d);r[h]=b}return r}return null},QVt=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},ZVt=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 ZF=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var eKt=1,tKt=1,Au=3,dw=2,rKt=4,nKt="string",iKt="Int32",aKt="Float64",oKt="Oid32",qke=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],yh=new ce;async function MW(e,t,r,n,i,a,o,s,u,c,l,f,p){var S;let h=u,d=await _Kt((S=e.gltf)==null?void 0:S.materials,c),b=Bke(e,t,r),g=Ike(e,p),x=await cKt(b,d,h,g);u&&sKt(x,l);let E=[];for(let F of d){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 uKt({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 sKt(e,t){for(let r of e.values()){let n=Fke(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Au){let o=r.positions.subarray(a,a+Au);or.WGS84.cartesianToCartographic(Array.from(o),yh),yh[2]=yh[2]-t.getHeight(yh[1],yh[0]),yh=yh.subtract(i),r.positions.set(yh,a)}}}async function uKt({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/Au,{faceRange:p,featureIds:h,positions:d,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=Cke(e),F={};o&&(F=OKt(h,e.featureIndices,a,o));let D=new Uint32Array(2),j=UKt(h);D.set([f,S],0);let k=new Uint8Array(tc(D.buffer,d.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,p.buffer)),N=u?GKt(f,e,{positions:d,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:h,faceRange:p},c):null,C=[];return s&&o&&(C=jKt(h,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:CKt(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function cKt(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)}Hke(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,p)=>f.concat(p)),delete l.featureIndicesGroups)}}return u}function Hke(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)fKt(u,t,r,n,i,a,o,s)}function lKt(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 fKt(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=lKt(e,o),c=e.mesh;c&&pKt(c,t,r,n,i,a,u,s),Hke(e.children||[],t,r,n,i,a,u,s)}function pKt(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:d})=>{var b;return d===((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 p=c.attributes;if(!l)continue;let h=hKt(c);l.positions=Co(l.positions,Nke({vertices:p.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:dKt,useCartesianPositions:a})),l.normals=Co(l.normals,Nke({vertices:p.NORMAL&&p.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:mKt,useCartesianPositions:!1})),l.texCoords=Co(l.texCoords,gKt(p.TEXCOORD_0&&p.TEXCOORD_0.value,h)),l.colors=Co(l.colors,vKt(p.COLOR_0,h)),f&&(l.uvRegions=Co(l.uvRegions,bKt(f,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(yKt(xKt(p,c,t,s),h))}}function hKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return ZF(n.length/Au)}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 Nke(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Au);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Au,s=t.subarray(o,o+Au),u=new ce(Array.from(s));u=n(u,e),i[a*Au]=u.x,i[a*Au+1]=u.y,i[a*Au+2]=u.z}return i}function dKt(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 mKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function gKt(e,t){let r=new Float32Array(t.length*dw);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*dw,a=e.subarray(i,i+dw);r[n*dw]=a[0],r[n*dw+1]=a[1]}return r}function vKt(e,t){let r=(e==null?void 0:e.components)||rKt,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 bKt(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 xKt(e,t,r,n){let i=Pke(e,t,r,n);if(i.length)return i;for(let a=0;a<qke.length;a++){let o=qke[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function _Kt(e=[],t){let r=[];for(let n of e)r.push(AKt(n));return t&&(r=await wKt(r)),r}async function wKt(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 EKt(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:TKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function EKt(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 AKt(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:SKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||eKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||tKt}},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:Oc();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 SKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function TKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function CKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=DKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function DKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=kKt(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:FKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function FKt(e,t=1){let r=.00015686274509803922,n=new hs(0,0,0,1),i=new hs(1,1,1,1),a=new hs(r,r,r,0),o=new hs(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 kKt(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:BKt(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 BKt(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,p=n-1<<0,h=c+l+f+p;return BigInt(`0b${h.toString(2)}${u}`).toString()}function OKt(e,t,r,n){let i=IKt(e,n,r);return Uke(t,i),Uke(e,i),i}function IKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=RKt(i,t,r);n[a.toString()]=o}return n}function PKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function RKt(e,t,r){let n=PKt(t,e),i=(0,zke.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function Uke(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function jKt(e,t,r,n){let i=[],o=jke(e,r)?Rke(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=MKt(u,n);if(c){let l=s[u],f=LKt(c,l);i.push(f)}}return i}function LKt(e,t){let r;switch(e){case oKt:case iKt:r=qKt(t);break;case aKt:r=NKt(t);break;case nKt:r=Gke(t);break;default:r=Gke(t)}return r}function MKt(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 qKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return tc(t.buffer,r.buffer)}function NKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return tc(t.buffer,r.buffer,n.buffer)}function Gke(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 tc(t.buffer,a.buffer,n.buffer,...i)}function UKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function GKt(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 p=new Uint32Array(t.featureIndices.length?t.featureIndices:e),h=zKt(p,l),d={positions:i,normals:a,colors:s,"feature-index":h};o.length&&(d.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(d["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),pv({attributes:d,indices:f},K7,{...K7.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 zKt(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)*Au;r.fill(n,i,o),n++,i=o+1}return r}function Wke(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=VKt(e);switch(i){case Il:return r=HKt(a,t),r;case vs:return r=WKt(a,t),r;default:return null}}function HKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return ek(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return ek(r)}return null}function WKt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return ek(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return ek(n)}return null}function ek(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function VKt(e){var a,o,s,u;let t=[vs,Il];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 Kke=Wt(wu(),1),$ke=require("path");var Vke=()=>({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 Yke(e,t,r){let n={serviceItemId:Oc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,Kke.default)(n,Vke()),a=(0,$ke.join)(r,"SceneServer");await ki(a,JSON.stringify(i))}var qW=16;function Jke(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*qW/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 NW(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=qW),e.mbs[3]*2*qW/r}var KKt=240,$Kt=[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],YKt=372,JKt=[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],XKt=372,QKt=[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],ZKt=12,UW=(3+1)*(3+2)/2,e$t=2,Zb=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=t$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,p=new Array(UW);if(o===this._ix&&s===this._iy)this.options.cubic?p=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 d=[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=JKt;s!==0&&(b=s===this.options._height-2?QKt:$Kt);let g=YKt;s!==0&&(g=s===this.options._height-2?XKt:KKt);for(let x=0;x<UW;++x){p[x]=0;for(let E=0;E<ZKt;++E)p[x]+=d[E]*b[UW*E+x];p[x]/=g}}if(!this.options.cubic){let d=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*d+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 h=p[0]+i*(p[1]+i*(p[3]+i*p[6]))+a*(p[2]+i*(p[4]+i*p[7])+a*(p[5]+i*p[8]+a*p[9]));return h=this.options._offset+this.options._scale*h,this._ix=o,this._iy=s,this._t=p,h}_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+e$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function t$t(e,t){t=Math.abs(t);let r=Xke(e,t);return 2*Math.abs(r)===t?r-=Xke(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Xke(e,t){return e-Math.floor(e/t)*t}var r$t=10,n$t=65535;function GW(e,t){let r=i$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,p=null,h=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 d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(d!==n$t)throw new Error("Geoid model file: Incorrect value of maxval");if(p=n.value.offset,h=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 Zb({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:h,_datastart:p,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*i$t(e){let t=0;do{let r=e.indexOf(r$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:Qke(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Qke(n)}}}while(t<e.length);return{offset:t,line:""}}function Qke(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var a$t="4.1.0-alpha.3";var tk={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:a$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>GW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var ey=Wt(wu(),1);var Zke={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 o$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),s$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),u$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),c$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),eBe=()=>({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,ey.default)(e,o$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,ey.default)(e,Zke)},fullExtent:{path:"fullExtent",transform:e=>(0,ey.default)(e,c$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,ey.default)(e,s$t())},nodePages:{path:"nodePages",transform:e=>(0,ey.default)(e,u$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(wu(),1),l$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}}}),f$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}}}),tBe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,zW.default)(e,l$t())];return e.draco&&t.push((0,zW.default)({geometryConfig:e},f$t())),t}}});var mw=Wt(wu(),1),p$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}}),h$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,mw.default)(r,p$t())}}),d$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),m$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,mw.default)(n,d$t()))}}),rBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:g$t},textureDefinitions:{path:"textureDefinitionInfos",transform:v$t}});function g$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,mw.default)(a,h$t());return n}function v$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,mw.default)(a,m$t())}return n}var b$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 iBe(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),x$t(t,e),t}function y$t(e,t){var o;let r=_$t(t.parentNode.obb),n=w$t(t);if(E$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 x$t(e,t){var a;let r=nBe(t.mbs),n=nBe(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 nBe(e){return new Ja([e[0],e[1],e[2]],e[3])}function _$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new sa().fromCenterHalfSizeQuaternion(t,r,n)}function w$t(e){let t=e.obb.halfSize,r=b$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 E$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 rk=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var aBe=Wt(require("process"),1),A$t=4*1024*1024*1024,ty=class extends rk{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),aBe.default.memoryUsage().rss>A$t&&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 ry="Tile converter does not work in browser, only in node js environment";var WW=require("path"),VW=Wt(wu(),1);var oBe=Wt(wu(),1),sBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),S$t=()=>({href:{path:"href"}}),T$t=()=>({id:{path:"id"},...S$t(),...sBe()}),HW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...sBe(),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,oBe.default)(e,T$t()),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 Su=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,WW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>qc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>ki(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,WW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await JF(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Su.createRootNodeIndexDocument(t);return await new Su(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Su.createNodeIndexDocument(t,r,n,i,a);return await new Su(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Oc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,VW.default)(r,HW())}static async createNodeIndexDocument(t,r,n,i,a){var p,h;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,VW.default)(l,HW());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((h=(p=t.converter.layers0)==null?void 0:p.attributeStorageInfo)!=null&&h.length))){f.attributeData=[];let d=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<d;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var KW=async(e,t,r)=>{let n=gw(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await nk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},$W=async(e,t,r)=>{let n=gw(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 nk(t.contentUrl,e.loader,i)};async function nk(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 l2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function gw(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var ik=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 ik(u,s,r,n,i,a+1);n&&await n(o,t)};var C$t=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],uBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Bo(e.gltfArrayBuffer,Pl,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=D$t(n),a=F$t(n);return{meshTopologyTypes:i,metadataClasses:a}},D$t=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(C$t[i])}return t},F$t=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[vs])==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[Il])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},cBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var lBe=Wt(require("process"),1);var k$t=.2,ak=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||lBe.default.hrtime.bigint,this.threshold=t.threshold||k$t}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?Xb(t.timeRemaining):""}isVelocityTrust(t,r){return r?Math.abs((t-r)/r)<this.threshold:!1}getCurrentTimeInMilliSeconds(){return Number(this.getTime()/BigInt(1e6))}};var pBe,B$t=(pBe=D0.default.env)==null?void 0:pBe.IonToken,fBe=64,O$t="3DTILES",I$t="3DObject",P$t=1800,R$t="https://",xh="phase1-count",ny=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=Ac;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ty;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};progresses={};constructor(){this.attributeMetadataInfo=new QC,this.nodePages=new eo(ki,fBe,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(ry),ry;this.conversionStartTime=D0.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:p,generateBoundingVolumes:h,instantNodeWriting:d=!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:d,mergeMaterials:b,inquirer:g,metadataClass:x},this.progresses[xh]=new ak,this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(R$t)!==-1?gD:Ac,this.generateTextures=Boolean(p),this.generateBoundingVolumes=Boolean(h),this.writeQueue=new ty,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,tk),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(qc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await nk(F,this.Loader,this.loadOptions),(this.Loader===Ac||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(),La.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await ik(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[xh].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(gw(t))return await KW(this.sourceTileset,t,this.loadOptions),null;t.id&&(this.progresses[xh].stepsTotal+=1,console.log(`[analyze]: ${t.id}`));let i=null;try{i=await $W(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 uBe(i);return cBe(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,Ga.join)(`${t}`,`${r}`);try{await fw(n)}catch{}this.layers0Path=(0,Ga.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=k8(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=jW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]}),this.progresses[xh].startMonitoring();let s=await Su.createRootNode(o,this);await ik(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.progresses[xh].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=I$t),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,ok.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),tBe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Yke(r,this.layers0,n);for(let f of this.compressList||[])await YF(f),await RW(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=kke(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Oc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Oc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:fBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,ok.default)(o,eBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>qc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>ki(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Ga.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await _ke(r,n,0,".",this.options.sevenZipExe);try{await fw(t)}catch{}}}async convertTile(t,r){let n=gw(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await KW(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[xh].stepsDone+=1;let l="Calculating time left...",f=this.progresses[xh].getTimeRemainingString();f&&(l=`${f} left`);let p=this.progresses[xh].getPercentString();console.log(`[converted ${p}%, ${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 $W(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=k8(r.boundingVolume,n,null),o=jW(a,this.geoidHeightModel),s=Wke(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],p={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let h of u||[p]){this.layersHasTexture=this.layersHasTexture||Boolean(h.texture),this.generateBoundingVolumes&&h.boundingVolumes&&(o=h.boundingVolumes);let d=Jke(r,o),b=d.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,h),x=await Su.createNodeIndexDocument(t,o,d,g,h),E=await new Su(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(h,E.id),this.validate&&(this.boundingVolumeWarnings=iBe(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 MW(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,p={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(p.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let h=a.nodeId,d;if(h?d=await this.nodePages.getNodeById(h):d=await this.nodePages.push(p,i),p.mesh||console.log(`[warning]: node ${d.index} is created with empty content`),eo.updateAll(d,p),o&&eo.updateMaterialByNodeId(d,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;eo.updateTexelCountHintByNodeId(d,b)}return u&&(this.vertexCounter+=u,eo.updateVertexCountByNodeId(d,u)),eo.updateNodeAttributeByNodeId(d),c&&eo.updateFeatureCountByNodeId(d,c),this.nodePages.saveNode(d),d}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Ga.join)(this.layers0Path,"nodes",r),c=(0,Ga.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,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>qc(a,t,"0.bin")})}else{let a=(0,Ga.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>ki(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>qc(a,r,"1.bin")})}else{let a=(0,Ga.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>ki(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,ok.default)(t,rBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Ga.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>qc(s,o,"sharedResource.json")})}else{let s=(0,Ga.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>ki(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=pv({...t.image,data:u},wq,{...wq.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=pv(t.image.data[0],aq);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,Ga.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>qc(o,t,`${r}.${n}`,s)})}else{let o=(0,Ga.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>ki(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,Ga.join)(r,"attributes",o);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${o}.bin.gz`,writePromise:()=>qc(u,s,"0.bin")})}else{let u=(0,Ga.join)(r,`attributes/${o}/0`);await this.writeQueue.enqueue({writePromise:()=>ki(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,YW.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,YW.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=Mke(t.gltf,this.options.metadataClass)):r&&(n=Lke(r)),n&&this.attributeMetadataInfo.addMetadataInfo(n)}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await QF(t),o=D0.default.hrtime(this.conversionStartTime),s=Xb(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${O$t}`),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||B$t}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=D0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(D0.default.hrtime(this.refreshTokenTime)[0]<P$t)return;this.refreshTokenTime=D0.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 RBe=require("path"),eV=Wt(require("process"),1),jBe=Wt(wu(),1);function JW(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 hBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function iy(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 dBe="String",mBe="Oid32",gBe="Float64",vBe="Int16";function sk(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function ay(e,t=null){return t?`${e}?token=${t}`:e}function bBe(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 yBe(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 uk=new ce([0,0,0]);function L$t(e){switch(e){case"ktx-etc2":case"dds":return Z8;case"ktx2":return Pd;case"jpg":case"png":default:return Tv}}var M$t="i3s-attribute-type";async function EBe(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=ay(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=L$t(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Tv){let p={...t.textureLoaderOptions,image:{type:"data"}};try{let h=await To(f,[],p,i);a.texture=h}catch{let d=await Bo(f,u,p,i);a.texture=d}}else if(u===Z8||u===Pd){let p=await An(f,u,t.textureLoaderOptions);u===Pd&&(p=p[0]),a.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else a.texture=f}return a.material=K$t(t.materialDefinition,a.texture),a.material&&(a.texture=null),await q$t(e,a,t,r,n)}async function q$t(e,t,r,n,i){var f,p;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let h=await Bo(e,xv,{draco:{attributeNameEntry:M$t}});s=h.header.vertexCount,l=(f=h.indices)==null?void 0:f.value;let{POSITION:d,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=h.attributes;o={position:d,normal:b,color:g,uv0:x,uvRegion:S,id:E},N$t(o,h);let F=X$t(E);F&&J$t(o,F)}else{let{vertexAttributes:h,ordering:d,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=G$t(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=_Be(e,u,h,s,d),{attributes:F}=_Be(e,S,b,c,g);Y$t(F),o=U$t(E,F)}if(!((p=i==null?void 0:i.i3s)!=null&&p.coordinateSystem)||i.i3s.coordinateSystem===2){let h=H$t(o.position,r);t.modelMatrix=h.invert(),t.coordinateSystem=2}else t.modelMatrix=V$t(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:xBe(o.color),texCoords:o.uv0,uvRegions:xBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let h in t.attributes)t.attributes[h]||delete t.attributes[h];return t.vertexCount=s,t.byteLength=a,t}function N$t(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 U$t(e,t){return{...e,...t}}function xBe(e){return e&&(e.normalized=!0,e)}function G$t(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=JW(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=iy(o);break;case"featureCount":i=new s(e,4,4)[0],r+=iy(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function _Be(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*iy(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=z$t(c,n*u,iy(s));else{let f=JW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:hBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*iy(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function z$t(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 H$t(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=W$t(n,i,o),a}function W$t(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),uk),n[o]=uk.x,n[o+1]=uk.y,n[o+2]=uk.z;return n}function V$t(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 K$t(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=wBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=wBe(r.pbrMetallicRoughness.baseColorFactor)),t&&$$t(r,t),r}function wBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function $$t(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 Y$t(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],p=i[c-1],h=f-p+1,d=u+h*3;o.fill(l,u,d),s++,u=d}e.id.value=o}function J$t(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 X$t(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 Q$t="4.1.0-alpha.3",ABe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Q$t,mimeTypes:["application/octet-stream"],parse:Z$t,extensions:["bin"],options:{"i3s-content":{}}};async function Z$t(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 EBe(e,s,u,t,r)}var eYt="4.1.0-alpha.3",SBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:eYt,mimeTypes:["application/json"],parse:tYt,extensions:["json"],options:{i3s:{}}};async function tYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var vw=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=ay(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,SBe,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 h of r.children||[])i.push(this.getNodeById(h));let a=await Promise.all(i);for(let h of a)n.push({id:h.index.toString(),obb:h.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:d}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=h,f=d;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=yBe(this.tileset,this.url,r.mesh.attribute.resource))}let p=this.getLodSelection(r);return XW({id:t.toString(),lodSelection:p,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:Pv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=p_();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 TBe(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=bBe(r,e));let o=e.children||[];return XW({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function XW(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 sa().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 CBe(e,t,r){let n=sk(r.url||""),i,a;if(e.nodePages)i=new vw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=ay(`${n}/nodes/root`,o.token);a=await An(s,ef,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:ef,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var rYt="4.1.0-alpha.3",nYt=/layers\/[0-9]+$/,iYt=/nodes\/([0-9-]+|root)$/,aYt="504b0304",oYt="PointCloud",ef={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:rYt,mimeTypes:["application/octet-stream"],parse:sYt,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 sYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},fYt(e)===aYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=sk(n),o;t.i3s.isTileset==="auto"?o=nYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=iYt.test(a):s=t.i3s.isTileHeader,o?e=await cYt(e,t,r):s?e=await lYt(e,r):e=await uYt(e,t),e}async function uYt(e,t){return await Bo(e,ABe,t)}async function cYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===oYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await CBe(n,t,r)}async function lYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),TBe(e,t)}function fYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function FBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?pYt(n,e):null}:{}}function pYt(e,t){switch(e){case dBe:return mYt(t);case mBe:return DBe(t);case gBe:return dYt(t);case vBe:return hYt(t);default:return DBe(t)}}function DBe(e){return new Uint32Array(e,4)}function hYt(e){return new Int16Array(e,4)}function dYt(e){return new Float64Array(e,8)}function mYt(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 gYt="4.1.0-alpha.3";var QW={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:gYt,mimeTypes:["application/binary"],parse:async(e,t)=>FBe(e,t),extensions:["bin"],options:{},binary:!0};function ZW(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 sa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var ck=Wt(wu(),1),vYt=()=>({version:{path:"version",default:"1.0"}}),kBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,ck.default)(t,kBe()))}}),BBe=()=>({asset:{path:"asset",transform:e=>(0,ck.default)(e,vYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,ck.default)(e,kBe())}});function OBe(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=bYt([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 bYt(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 xYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),IBe=new ce,bw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return u8({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},rG)}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),p=this._convertI3sMaterialToGLTFMaterial(o,f),h=l.addMaterial(p),d=s.positions,b=d.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=OBe(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||ZF(b.length/d.size),S=l.addMesh({attributes:s,indices:E,material:h,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),u8(l.gltf,Uq)}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,IBe),c=IBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(xYt)}_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 PBe=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,ef,n)};var _Yt="I3S",oy=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(ry),ry;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=eV.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,tk),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,ef,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=LW(s.mbs)),this.tilesetPath=(0,RBe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await fw(this.tilesetPath)}catch{}let u={boundingVolume:{box:ZW(s.obb,this.geoidHeightModel)},geometricError:NW(s),children:[]};await this._addChildren(s,u,1);let c=(0,jBe.default)({root:u},BBe());await ki(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),La.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await PBe(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=LW(a.mbs));let u={box:ZW(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:NW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},p=await new bw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await ki(this.tilesetPath,new Uint8Array(p),`${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,ef,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,QW,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 QF(t),n=eV.default.hrtime(this.conversionStartTime),i=Xb(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${_Yt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var lk=require("path");var wYt="4.1.0-alpha.3",EYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",fk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(EYt,JU,{}),n=process.cwd();t&&(n=(0,lk.join)(n,t)),await ki(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(Ap[ai.DECODER],"draco",ai.DECODER),await this.installFromUrl(Ap[ai.DECODER_WASM],"draco",ai.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Ap[ai.ENCODER],"draco",ai.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",wc.TRANSCODER,"libs"),await this.installFromNpm("textures",wc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",wc.ENCODER,"libs"),await this.installFromNpm("textures",wc.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new ll().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 ko(`https://unpkg.com/@loaders.gl/${t}@${wYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,lk.join)(process.cwd(),"modules",t,"dist",n);await ki(o,a,r)}async installFromUrl(t,r,n){let a=await(await ko(t)).arrayBuffer();if(!a)return;let o=(0,lk.join)(process.cwd(),"modules",r,"dist","libs");await ki(o,a,n)}};function Tu(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function LBe(e,t){let r=Tu(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function MBe(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 qBe(e,t){let r=Tu(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Tu(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var tV={I3S:"I3S",_3DTILES:"3DTILES"};async function AYt(){let[,,...e]=process.argv;e.length===0&&rV();let t=MBe(e),r=CYt(t);if(r.installDependencies){new fk().install("deps");return}let n=TYt(r);await SYt(n)}AYt().catch(e=>{console.log(e),process.exit(1)});function rV(){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 SYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case tV.I3S:new oy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case tV._3DTILES:await new ny().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:UBe.default});break;default:rV()}}function TYt(e){let t={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:n=>Boolean(n)||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:n=>Boolean(n)&&Object.values(tV).includes(n.toUpperCase())}},r=[];for(let n in t){let i=e[n],a=t[n].condition;(a?a(i):i)||r.push(t[n].getMessage)}return r.length&&(r.forEach(n=>n()),process.exit(1)),e}function CYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,NBe.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Tu(n,e);break;case"--tileset":t.tileset=LBe(n,e);break;case"--name":t.name=Tu(n,e);break;case"--output":t.output=Tu(n,e);break;case"--instant-node-writing":t.instantNodeWriting=Nc(n,e);break;case"--split-nodes":t.mergeMaterials=Nc(n,e);break;case"--max-depth":t.maxDepth=qBe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Tu(n,e);break;case"--egm":t.egm=Tu(n,e);break;case"--token":t.token=Tu(n,e);break;case"--no-draco":t.draco=Nc(n,e);break;case"--validate":t.validate=Nc(n,e);break;case"--install-dependencies":t.installDependencies=Nc(n,e);break;case"--generate-textures":t.generateTextures=Nc(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Nc(n,e);break;case"--analyze":t.analyze=Nc(n,e);break;case"--metadata-class":t.metadataClass=Tu(n,e);break;case"--help":rV();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 Aae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...Aae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Aae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await Eae(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=Sae.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 UI(e,t){return!La.isSupported()||!ta&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function GI(e,t,r,n,i){let a=e.id,o=Fx(e,r),u=La.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",IWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function IWe(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 zI(e,t){return!La.isSupported()||!gn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Cae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Tae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Tae(e,0,t):""}function Tae(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 HI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Cae(e)}"`)}}function ec(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 tc(...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 Co(...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 Wh(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 Do(e,t){return Qt(e>=0),Qt(t>0),e+(t-1)&~(t-1)}function WI(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+Do(n.byteLength,4)}function VI(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 km(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Bx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function IA(e,t,r,n){let i=Do(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 Bm(e,t,r,n){let a=new TextEncoder().encode(r);return t=IA(e,t,a,n),t}async function Vh(e){let t=[];for await(let r of e)t.push(r);return tc(...t)}function Lf(e){return Lf=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},Lf(e)}function KI(e,t){if(Lf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(Lf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function $I(e){var t=KI(e,"string");return Lf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=$I(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var PWe="",Dae={};function rc(e){for(let t in Dae)if(e.startsWith(t)){let r=Dae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${PWe}${e}`),e}var RWe="4.1.0-alpha.4",YI={name:"JSON",id:"json",module:"json",version:RWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Fae,parse:async e=>Fae(new TextDecoder().decode(e)),options:{}};function Fae(e){return JSON.parse(e)}function kae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Bae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(Bae(e))return kae(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 Om(e){return t=>new Promise((r,n)=>e(t,(i,a)=>i?n(i):r(a)))}var tu={};fa(tu,{dirname:()=>MWe,filename:()=>LWe,join:()=>qWe,resolve:()=>NWe});function Oae(){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 LWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function MWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function qWe(...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 NWe(...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=Oae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Ox)}return r=UWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Ox=47,JI=46;function UWe(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===Ox)break;a=Ox}if(a===Ox){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==JI||r.charCodeAt(r.length-2)!==JI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Ox;--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===JI&&i!==-1?++i:i=-1}return r}var Ix=new Error("Not implemented"),Kh=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 Ix}async write(t,r,n){throw Ix}async stat(){throw Ix}async truncate(t){throw Ix}async append(t){throw Ix}async close(){}};var XI=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Px=class{file;constructor(t,r=!1){this.file=new Kh(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 pl=Wt(require("fs"),1),$h=class{handle;size;bigsize;url;constructor(t,r,n){t=rc(t),this.handle=pl.default.openSync(t,r,n);let i=pl.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)=>{pl.default.close(this.handle,n=>n?r(n):t())})}async truncate(t){return new Promise((r,n)=>{pl.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)=>{pl.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)=>pl.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 zWe(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);pl.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function zWe(e,t,r,n,i){return await new Promise((a,o)=>pl.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var LA=Wt(require("fs/promises"),1);var ZI=Wt(require("fs"),1),QI=require("stream");var PA=Wt(require("zlib"),1),HWe=e=>e&&e instanceof ArrayBuffer,WWe=e=>e&&e instanceof Buffer;function RA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(PA.default.createBrotliDecompress());case"gzip":return e.pipe(PA.default.createGunzip());case"deflate":return e.pipe(PA.default.createDeflate());default:return e}}async function Iae(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(KWe(i))}),e.on("end",()=>{let i=VWe(t);r(i)})})}function VWe(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 KWe(e){if(HWe(e))return e;if(WWe(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 $We=e=>typeof e=="boolean",Pae=e=>typeof e=="function",YWe=e=>e!==null&&typeof e=="object",JWe=e=>YWe(e)&&Pae(e.read)&&Pae(e.pipe)&&$We(e.readable);async function jA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=rc(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,p)=>{let h=ZI.default.createReadStream(n,{encoding:null});h.once("readable",()=>f(h)),h.on("error",d=>p(d))}),o=a;JWe(a)?o=RA(a,i):typeof a=="string"?o=QI.Readable.from([new TextEncoder().encode(a)]):o=QI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=XWe(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 XWe(e){let t={};if(!t["content-length"]){let r=ZI.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 MA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await LA.default.readdir(t,r)}async stat(t){let r=await LA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await LA.default.unlink(t)}async fetch(t,r){return await jA(t,r)}async openReadableFile(t,r="r"){return new $h(t,r)}async openWritableFile(t,r="w",n){return new $h(t,r,n)}};var Yh=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 Vh(t)}};function Rae(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+=QWe(n[i])}return t}function QWe(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 jae(e,t){switch(t){case"hex":return e;case"base64":return ZWe(e);default:throw new Error(t)}}function ZWe(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Rae(r)||""}var Mae=typeof atob=="function"?atob:typeof Buffer=="function"?oVe:Nae,eVe=Mae("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="),eP=WebAssembly&&Mae!==Nae?aVe(eVe).buffer:!1,nc=sVe(),tP=240*16*16,qae=Math.floor(tP*16*1.066666667),tVe=268435456-65536,Lae="Parameter must be Buffer, ArrayBuffer or Uint8Array",rVe="Parameter exceeds max size of 255.9 Mbytes";eP||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function rP(e){var t,r,n,i,a,o,s,u,c,l;let f=iVe(),p=nVe(),h={},d=new Date().getTime();return h.then=function(E){return s=E,g(),h},h.catch=function(E){return u=E,h},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(Lae)):x(new TypeError(Lae)),o&&(a=o.length,eP&&a>qae?a>tVe?x(new Error(rVe)):(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(eP,n).then(b)):g(f(o))),h;function b(E){g(p(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-d),s=u=null):Boolean(E)&&(c=E)}function x(E){typeof u=="function"&&u(E)}}function nVe(){var e,t,r,n,i,a,o,s,u,c,l,f,p,h=function(d){var b,g,x,E,S,F,D,j,k,N,C,I,P,U,Y,J,re,ee,ge,ye,he,Te,$e=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=d.length*8,ft;for(ft=Ie(d,p),p[at>>>5]|=128<<at%32,p[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,he=p;Ge<ft;)ft>Ge+qae?(n(oe),a(V),s(ne),c(se),t(tP),Ge=Ge+tP*16,oe=r(),V=i(),ne=o(),se=u(),We++):(re=oe,ee=V,ge=ne,ye=se,b=he[Ge+0]>>>0,g=he[Ge+1]>>>0,x=he[Ge+2]>>>0,E=he[Ge+3]>>>0,S=he[Ge+4]>>>0,F=he[Ge+5]>>>0,D=he[Ge+6]>>>0,j=he[Ge+7]>>>0,k=he[Ge+8]>>>0,N=he[Ge+9]>>>0,C=he[Ge+10]>>>0,I=he[Ge+11]>>>0,P=he[Ge+12]>>>0,U=he[Ge+13]>>>0,Y=he[Ge+14]>>>0,J=he[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 nc.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,pe,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],pe=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|pe<<8|Xe<<16|ct<<24;return _t+1}};return function(d,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,p=g,E=nc.wordsToBytes(h(d)),x&&x.asBytes?E:nc.bytesconvertNumberToHex(E)}}function iVe(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,p,h,d,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=nc.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,p=k[re+9]>>>0,h=k[re+10]>>>0,d=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)+p-1958414417)+C,P=ee(17,15,P+(U&C|~U&I)+h-42063)+U,I=ee(22,10,I+(P&U|~P&C)+d-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)+d+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)+h+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)+p+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)+d+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)+h-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)+p-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))+h-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))+d-1120210379)+C,P=ee(15,17,P+(C^(U|~I))+a+718787259)+U,I=ee(21,11,I+(U^(P|~C))+p-343485551)+P,C=C+S>>>0,I=I+F>>>0,P=P+D>>>0,U=U+j>>>0;return nc.endian([C,I,P,U]);function ee(ge,ye,he){return he<<ge|he>>>ye}};return function(t,r){var n=nc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:nc.bytesconvertNumberToHex(n);return i}}function aVe(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 oVe(e){return Buffer.from(e,"base64").toString("binary")}function Nae(e){return e}function sVe(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return nc.rotl(t,8)&16711935|nc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=nc.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 Rx=class extends Yh{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>rP(t).then(a).catch(o));return jae(i,r)}};var jx=Wt(require("crypto"),1),qA=class extends Yh{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(!jx.createHash)throw new Error("crypto.createHash not available");let u=(s=jx.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(!jx.createHash)throw new Error("crypto.createHash not available");let n=(u=jx.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 p of t){let h=new Uint8Array(p);n.update(h),yield p}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 toe=require("process");var Uae=Wt(require("stream"),1),nP=class{},uVe=Uae.Readable||nP;function aP(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new iP(r,t)}var iP=class extends uVe{_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 Hae=Wt(zae(),1);delete globalThis.ReadableStream;var UA=class extends Hae.ReadableStream{};var GA=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 zA=class extends UA{_chunks;constructor(t){super(new GA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Jh=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 Jh)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=cVe(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 Jh([],{type:n});if(u===0)return c;let l=0,f=[];for(let p of a){let{byteLength:h}=p;if(o>0&&h<=o)o-=h,s-=h;else{let d=p.subarray(o,Math.min(h,s));if(f.push(d),l+=d.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 zA(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 cVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function lVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Jh),globalThis.Blob}var fVe=lVe();var HA=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,${xy(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var WA=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 Wae(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=HA),typeof File>"u"&&!globalThis.File&&(globalThis.File=WA),global}var pVe=Wae();var oP=Wt(require("module"),1),Vae=Wt(require("path"),1),KA=Wt(require("fs"),1);async function Kae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():KA.default.readFileSync(e).buffer}async function $ae(e){return e.startsWith("http")?await(await fetch(e)).text():KA.default.readFileSync(e,"utf8")}async function Yae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return VA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await KA.default.readFileSync(e,"utf8");return VA(t)}function VA(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=oP.default._nodeModulePaths(Vae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new oP.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 ru=class{map;constructor(t){this.map={},t instanceof ru?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=Lx(t),r=Jae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Lx(t)]}get(t){return t=Lx(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Lx(t))}set(t,r){this.map[Lx(t)]=Jae(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)}),sP(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),sP(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),sP(t)}*[Symbol.iterator](){yield*this.entries()}};function Lx(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 Jae(e){return typeof e!="string"&&(e=String(e)),e}function sP(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function uP(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var lP=Wt(require("stream"),1),hVe=e=>typeof e=="boolean",Xae=e=>typeof e=="function",dVe=e=>e!==null&&typeof e=="object",cP=e=>dVe(e)&&Xae(e.read)&&Xae(e.pipe)&&hVe(e.readable),hl=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 ru((r==null?void 0:r.headers)||{}),cP(t)?this._body=RA(t,n):typeof t=="string"?this._body=lP.Readable.from([new TextEncoder().encode(t)]):this._body=lP.Readable.from([t||new ArrayBuffer(0)])}get body(){return uP(!this.bodyUsed),uP(cP(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return cP(this._body)?await Iae(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 Zae=Wt(require("http"),1),eoe=Wt(require("https"),1);var mVe=e=>e&&e instanceof ArrayBuffer,gVe=e=>e&&e instanceof Buffer;function Qae(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:vVe(r),mimeType:n}}function vVe(e){if(mVe(e))return e;if(gVe(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 fP=e=>e.startsWith("data:"),bVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Mx(e,t){try{if(globalThis.fetch!==Mx&&(bVe(e)||fP(e)))return await fetch(e,t);if(fP(e)){let{arrayBuffer:c,mimeType:l}=Qae(e);return new hl(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 yVe(n,t),a=EVe(e,i,r),{status:o,statusText:s}=wVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=xVe(e,a.get("location"));return await Mx(c,t)}return new hl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new hl(null,{status:400,statusText:String(r),url:e})}}async function yVe(e,t){return await new Promise((r,n)=>{let i=_Ve(e,t),a=e.startsWith("https:")?eoe.default.request(i,o=>r(o)):Zae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function xVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function _Ve(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 wVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function EVe(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=AVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new ru(n)}function AVe(e){return fP(e)?e.length-5:null}var SVe=parseInt(toe.versions.node.split(".")[0]);AV&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=aP;globalThis.loaders.NodeFile=$h;globalThis.loaders.NodeFileSystem=MA;globalThis.loaders.fetchNode=jA;globalThis.loaders.NodeHash=qA;globalThis.TextEncoder||(globalThis.TextEncoder=yy);globalThis.TextDecoder||(globalThis.TextDecoder=Eh);!("atob"in globalThis)&&xy&&(globalThis.atob=xy);!("btoa"in globalThis)&&Tk&&(globalThis.btoa=Tk);globalThis.loaders.encodeImageNode=CY;globalThis.loaders.parseImageNode=kI;globalThis.loaders.imageFormatsNode=FI;globalThis._parseImageNode=kI;globalThis._imageFormatsNode=FI;globalThis.loaders.readFileAsArrayBuffer=Kae;globalThis.loaders.readFileAsText=$ae;globalThis.loaders.requireFromFile=Yae;globalThis.loaders.requireFromString=VA;SVe<18&&(!("Headers"in globalThis)&&ru&&(globalThis.Headers=ru),!("Response"in globalThis)&&hl&&(globalThis.Response=hl),!("fetch"in globalThis)&&Mx&&(globalThis.fetch=Mx));var NBe=require("path"),UBe=Wt(Vye(),1);var Ln={OBJECT_ID_TYPE:"OBJECTID",STRING_TYPE:"string",DOUBLE_TYPE:"double",SHORT_INT_TYPE:"Int32"};var QC=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 iTt=e=>typeof e=="boolean",$1=e=>typeof e=="function",Ad=e=>e!==null&&typeof e=="object",VM=e=>Ad(e)&&e.constructor==={}.constructor;var Kye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",$ye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var cs=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var ls=e=>typeof Blob<"u"&&e instanceof Blob,Yye=e=>e&&typeof e=="object"&&e.isBuffer;var aTt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ad(e)&&$1(e.tee)&&$1(e.cancel)&&$1(e.getReader);var oTt=e=>Ad(e)&&$1(e.read)&&$1(e.pipe)&&iTt(e.readable),ZC=e=>aTt(e)||oTt(e);var sTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,uTt=/^([-\w.]+\/[-\w.+]+)/;function Jye(e){let t=uTt.exec(e);return t?t[1]:e}function KM(e){let t=sTt.exec(e);return t?t[1]:""}var Xye=/\?.*/;function Qye(e){let t=e.match(Xye);return t&&t[0]}function sv(e){return e.replace(Xye,"")}function Sd(e){return cs(e)?e.url:ls(e)?e.name||"":typeof e=="string"?e:""}function Y1(e){if(cs(e)){let t=e,r=t.headers.get("content-type")||"",n=sv(t.url);return Jye(r)||KM(n)}return ls(e)?e.type||"":typeof e=="string"?KM(e):""}function Zye(e){return cs(e)?e.headers["content-length"]||-1:ls(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function e8(e){if(cs(e))return e;let t={},r=Zye(e);r>=0&&(t["content-length"]=String(r));let n=Sd(e),i=Y1(e);i&&(t["content-type"]=i);let a=await lTt(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 exe(e){if(!e.ok){let t=await cTt(e);throw new Error(t)}}async function cTt(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 lTt(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,${fTt(r)}`}return null}function fTt(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!hTt(e)&&!dTt(e)}function hTt(e){return e.startsWith("http:")||e.startsWith("https:")}function dTt(e){return e.startsWith("data:")}async function ko(e,t){var r,n;if(typeof e=="string"){let i=rc(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 e8(e)}function $M(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 fu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||$M()}var mTt=globalThis.self||globalThis.window||globalThis.global,uv=globalThis.window||globalThis.self||globalThis.global,gTt=globalThis.document||{},Td=globalThis.process||{},vTt=globalThis.console,$dr=globalThis.navigator||{};var t8="4.1.0-alpha.4",Xdr=fu();function bTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var r8=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=bTt(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 txe(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 rxe(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 n8(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 i8;(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"})(i8||(i8={}));var yTt=10;function nxe(e){return typeof e!="string"?e:(e=e.toUpperCase(),i8[e]||i8.WHITE)}function ixe(e,t,r){if(!fu&&typeof e=="string"){if(t){let n=nxe(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=nxe(r);e="\x1B[".concat(n+yTt,"m").concat(e,"\x1B[49m")}}return e}function axe(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 cv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Cd(){let e;if(fu()&&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 Td){var n;let i=Td===null||Td===void 0||(n=Td.hrtime)===null||n===void 0?void 0:n.call(Td);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var lv={debug:fu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},xTt={enabled:!0,level:0};function fs(){}var oxe={},sxe={once:!0},bc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",t8),zt(this,"_startTs",Cd()),zt(this,"_deltaTs",Cd()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new r8("__probe-".concat(this.id,"__"),xTt),this.timeStamp("".concat(this.id," started")),axe(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((Cd()-this._startTs).toPrecision(10))}getDelta(){return Number((Cd()-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){cv(t,r)}warn(t){return this._getLogFunction(0,t,lv.warn,arguments,sxe)}error(t){return this._getLogFunction(0,t,lv.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,lv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,lv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,lv.debug||lv.info,arguments,sxe)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||fs,n&&[n],{tag:ATt(r)}):fs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?fu()?ETt({image:i,message:a,scale:o}):wTt({image:i,message:a,scale:o}):fs}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||fs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=uxe({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||fs)}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()>=cxe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=uxe({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,cv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Cd();let o=a.tag||a.message;if(a.once&&o)if(!oxe[o])oxe[o]=Cd();else return fs;return r=_Tt(this.id,a.message,a),n.bind(console,r,...a.args)}return fs}};zt(bc,"VERSION",t8);function cxe(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 cv(Number.isFinite(t)&&t>=0),t}function uxe(e){let{logLevel:t,message:r}=e;e.logLevel=cxe(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 cv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function _Tt(e,t,r){if(typeof t=="string"){let n=r.time?rxe(txe(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=ixe(t,r.color,r.background)}return t}function wTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),fs}function ETt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=n8(a,r,n);console.log(...o)},a.src=t,fs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...n8(t,r,n)),fs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...n8(a,r,n)),a.src=t.toDataURL(),fs}return fs}function ATt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var A0r=new bc({id:"@probe.gl/log"});var YM=new bc({id:"loaders.gl"}),a8=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},o8=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 JM={fetch:null,mimeType:void 0,nothrow:!1,log:new o8,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:[]},lxe={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 XM(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function fv(){let e=XM();return e.globalOptions=e.globalOptions||{...JM},e.globalOptions}function hxe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],STt(e,r),CTt(t,e,n)}function STt(e,t){fxe(e,null,JM,lxe,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]||{};fxe(n,r.id,i,a,t)}}function fxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ad(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)YM.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=TTt(s,i);YM.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function TTt(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 CTt(e,t,r){let i={...e.options||{}};return DTt(i,r),i.log===null&&(i.log=new a8),pxe(i,fv()),pxe(i,t),i}function pxe(e,t){for(let r in t)if(r in t){let n=t[r];VM(n)&&VM(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function DTt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function J1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function QM(e){Qt(e,"null loader"),Qt(J1(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 FTt=()=>{let e=XM();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function dxe(){return FTt()}var mxe=new bc({id:"loaders.gl"});var kTt=/\.([^.]+)$/;async function bxe(e,t=[],r,n){if(!yxe(e))return null;let i=gxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(ls(e)&&(e=await e.slice(0,10).arrayBuffer(),i=gxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(xxe(e));return i}function gxe(e,t=[],r,n){if(!yxe(e))return null;if(t&&!Array.isArray(t))return QM(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...dxe()),OTt(i);let a=BTt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(xxe(e));return a}function BTt(e,t,r,n){let i=Sd(e),a=Y1(e),o=sv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=ZM(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||ITt(t,o),u=u||(s?`matched url ${o}`:""),s=s||ZM(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||RTt(t,e),u=u||(s?`matched initial data ${_xe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||ZM(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&mxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function yxe(e){return!(e instanceof Response&&e.status===204)}function xxe(e){let t=Sd(e),r=Y1(e),n="No valid loader found (";n+=t?`${tu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?_xe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function OTt(e){for(let t of e)QM(t)}function ITt(e,t){let r=t&&kTt.exec(t),n=r&&r[1];return n?PTt(e,n):null}function PTt(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 ZM(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function RTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(jTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(vxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&vxe(t,0,r))return r;return null}function jTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function vxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>LTt(e,t,r,i))}function LTt(e,t,r,n){if(n instanceof ArrayBuffer)return ec(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=e7(e,t,n.length);return n===i;default:return!1}}function _xe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?e7(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?e7(e,0,t):""}function e7(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*wxe(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*Exe(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*Axe(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 t7(e,t){return gn?MTt(e,t):qTt(e,t)}async function*MTt(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 fl(o)}}catch{r.releaseLock()}}async function*qTt(e,t){for await(let r of e)yield fl(r)}function Sxe(e,t){if(typeof e=="string")return wxe(e,t);if(e instanceof ArrayBuffer)return Exe(e,t);if(ls(e))return Axe(e,t);if(ZC(e))return t7(e,t);if(cs(e))return t7(e.body,t);throw new Error("makeIterator")}var Txe="Cannot convert supplied data type";function NTt(e,t,r){if(t.text&&typeof e=="string")return e;if(Yye(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(Txe)}async function Cxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return NTt(e,t,r);if(ls(e)&&(e=await e8(e)),cs(e)){let i=e;return await exe(i),t.binary?await i.arrayBuffer():await i.text()}if(ZC(e)&&(e=Sxe(e,r)),Kye(e)||$ye(e))return Vh(e);throw new Error(Txe)}function s8(e,t){let r=fv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ad(n.fetch)?i=>ko(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:ko}function Dxe(e,t,r){if(r)return r;let n={fetch:s8(t,e),...e};if(n.url){let i=sv(n.url);n.baseUrl=i,n.queryString=Qye(n.url),n.filename=tu.filename(i),n.baseUrl=tu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function Fxe(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 Bo(e,t,r,n){t&&!Array.isArray(t)&&!J1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=Sd(e),o=Fxe(t,n),s=await bxe(e,o,r);return s?(r=hxe(r,s,o,i),n=Dxe({url:i,_parse:Bo,loaders:o},r,n||null),await UTt(s,e,r,n)):null}async function UTt(e,t,r,n){if(LI(e),r=BI(e.options,r),cs(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,p=Object.fromEntries(a.headers.entries());n.response={headers:p,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await Cxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(UI(e,r))return await GI(e,t,r,n,Bo);if(i.parseText&&typeof t=="string")return await i.parseText(t,r,n);if(i.parse)return await i.parse(t,r,n);throw ma(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}function kxe(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 r7(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],p=s[c+2];t=l<t?l:t,r=f<r?f:r,n=p<n?p:n,i=l>i?l:i,a=f>a?f:a,o=p>o?p:o}return[[t,r,n],[i,a,o]]}function n7(e,t,r){let n=kxe(t.value),i=r||Bxe(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function Bxe(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)&&!J1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=s8(a),s=e;return typeof e=="string"&&(s=await o(e)),ls(e)&&(s=await o(e)),Array.isArray(i)?await Bo(s,i,a):await Bo(s,i,a)}async function pv(e,t,r){return r={...fv(),...r},t.encodeURLtoURL?GTt(t,e,r):zI(t,r)?await jI(t,e,r):await t.encode(e,r)}function u8(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 Ixe(e,t,r,n){if(e=rc(e),t=rc(t),gn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}async function GTt(e,t,r){if(gn)throw new Error(`Writer ${e.name} not supported in browser`);let n=Oxe("input");await new Kh(n,"w").write(t);let a=Oxe("output"),o=await Ixe(n,a,e,r);return(await ko(o)).arrayBuffer()}function Oxe(e){return`/tmp/${e}`}var zTt=1/Math.PI*180,HTt=1/180*Math.PI,WTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...WTt}};var Sn=globalThis.mathgl.config;function i7(e,{precision:t=Sn.precision}={}){return e=VTt(e),"".concat(parseFloat(e.toPrecision(t)))}function ps(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function a7(e){return Pxe(e)}function o7(e){return Dl(e)}function Pxe(e,t){return u7(e,r=>r*HTt,t)}function Dl(e,t){return u7(e,r=>r*zTt,t)}function s7(e,t,r){return u7(e,n=>Math.max(t,Math.min(r,n)))}function Oo(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(ps(e)&&ps(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Oo(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 VTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function KTt(e){return e.clone?e.clone():new Array(e.length)}function u7(e,t,r){if(ps(e)){let n=e;r=r||KTt(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 $Tt(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 yp=class extends $Tt(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:ps(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?", ":"")+i7(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(!Oo(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 YTt(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 xp(e,t,r=""){if(Sn.debug&&!YTt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function aa(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var _p=class extends yp{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 aa(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return aa(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,X1=Math.random;function hv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var bgr=Math.PI/180;function JTt(){let e=new Mn(2);return Mn!=Float32Array&&(e[0]=0,e[1]=0),e}function Rxe(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 jxe(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 c8(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 l8(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 ygr=function(){let e=JTt();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 f8(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 p8(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 Lxe(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 Mxe(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 h8(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 Dd=class extends _p{constructor(t=0,r=0){super(2),ps(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 l8(this,this,t),this.check()}transformAsVector(t){return f8(this,this,t),this.check()}transformByMatrix3(t){return c8(this,this,t),this.check()}transformByMatrix2x3(t){return jxe(this,this,t),this.check()}transformByMatrix2(t){return Rxe(this,this,t),this.check()}};var mv={};fa(mv,{add:()=>e6t,angle:()=>h7,bezier:()=>h6t,ceil:()=>t6t,clone:()=>XTt,copy:()=>QTt,create:()=>d8,cross:()=>Fd,dist:()=>w6t,distance:()=>zxe,div:()=>_6t,divide:()=>Gxe,dot:()=>Q1,equals:()=>b6t,exactEquals:()=>v6t,floor:()=>r6t,forEach:()=>S6t,fromValues:()=>m8,hermite:()=>p6t,inverse:()=>c6t,len:()=>d7,length:()=>qxe,lerp:()=>l6t,max:()=>i6t,min:()=>n6t,mul:()=>x6t,multiply:()=>Uxe,negate:()=>u6t,normalize:()=>c7,random:()=>d6t,rotateX:()=>l7,rotateY:()=>f7,rotateZ:()=>p7,round:()=>a6t,scale:()=>o6t,scaleAndAdd:()=>s6t,set:()=>ZTt,slerp:()=>f6t,sqrDist:()=>E6t,sqrLen:()=>A6t,squaredDistance:()=>Hxe,squaredLength:()=>Wxe,str:()=>g6t,sub:()=>y6t,subtract:()=>Nxe,transformMat3:()=>Z1,transformMat4:()=>kd,transformQuat:()=>e_,zero:()=>m6t});function d8(){let e=new Mn(3);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function XTt(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 m8(e,t,r){let n=new Mn(3);return n[0]=e,n[1]=t,n[2]=r,n}function QTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ZTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function e6t(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Nxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Uxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Gxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function t6t(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function r6t(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function n6t(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 i6t(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 a6t(e,t){return e[0]=hv(t[0]),e[1]=hv(t[1]),e[2]=hv(t[2]),e}function o6t(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function s6t(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 zxe(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 Hxe(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 Wxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function u6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function c6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function c7(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 Q1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Fd(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 l6t(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 f6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(Q1(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 h6t(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,p=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*p,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*p,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*p,e}function d6t(e,t){t=t===void 0?1:t;let r=X1()*2*Math.PI,n=X1()*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 kd(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 Z1(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 e_(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,p=n*u-i*s,h=i*p-a*f,d=a*l-n*p,b=n*f-i*l,g=o*2;return l*=g,f*=g,p*=g,h*=2,d*=2,b*=2,e[0]=s+l+h,e[1]=u+f+d,e[2]=c+p+b,e}function l7(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 f7(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 p7(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 h7(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&&Q1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function m6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function g6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function v6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function b6t(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 y6t=Nxe,x6t=Uxe,_6t=Gxe,w6t=zxe,E6t=Hxe,d7=qxe,A6t=Wxe,S6t=function(){let e=d8();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 m7=[0,0,0],g8,ce=class extends _p{static get ZERO(){return g8||(g8=new ce(0,0,0),Object.freeze(g8)),g8}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&ps(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 h7(this,t)}cross(t){return Fd(this,this,t),this.check()}rotateX({radians:t,origin:r=m7}){return l7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=m7}){return f7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=m7}){return p7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return kd(this,this,t),this.check()}transformAsVector(t){return p8(this,this,t),this.check()}transformByMatrix3(t){return Z1(this,this,t),this.check()}transformByMatrix2(t){return Lxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}};var v8,hs=class extends _p{static get ZERO(){return v8||(v8=new hs(0,0,0,0),Object.freeze(v8)),v8}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),ps(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 kd(this,this,t),this.check()}transformByMatrix3(t){return h8(this,this,t),this.check()}transformByMatrix2(t){return Mxe(this,this,t),this.check()}transformByQuaternion(t){return e_(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gv=class extends yp{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 Vxe(){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 Kxe(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 $xe(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,p=-l*a+s*u,h=c*a-o*u,d=r*f+n*p+i*h;return d?(d=1/d,e[0]=f*d,e[1]=(-l*n+i*c)*d,e[2]=(s*n-i*o)*d,e[3]=p*d,e[4]=(l*r-i*u)*d,e[5]=(-s*r+i*a)*d,e[6]=h*d,e[7]=(-c*r+n*u)*d,e[8]=(o*r-n*a)*d,e):null}function Yxe(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 g7(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],p=r[0],h=r[1],d=r[2],b=r[3],g=r[4],x=r[5],E=r[6],S=r[7],F=r[8];return e[0]=p*n+h*o+d*c,e[1]=p*i+h*s+d*l,e[2]=p*a+h*u+d*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 Jxe(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],p=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=p*n+h*o+c,e[7]=p*i+h*s+l,e[8]=p*a+h*u+f,e}function Xxe(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],p=Math.sin(r),h=Math.cos(r);return e[0]=h*n+p*o,e[1]=h*i+p*s,e[2]=h*a+p*u,e[3]=h*o-p*n,e[4]=h*s-p*i,e[5]=h*u-p*a,e[6]=c,e[7]=l,e[8]=f,e}function v7(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 Qxe(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,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[3]=l-x,e[6]=p+g,e[1]=l+x,e[4]=1-c-d,e[7]=h-b,e[2]=p-g,e[5]=h+b,e[8]=1-c-f,e}var b7;(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"})(b7||(b7={}));var C6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Rr=class extends gv{static get IDENTITY(){return F6t()}static get ZERO(){return D6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return b7}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(C6t)}fromObject(t){return this.check()}fromQuaternion(t){return Qxe(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 Yxe(this)}transpose(){return Kxe(this,this),this.check()}invert(){return $xe(this,this),this.check()}multiplyLeft(t){return g7(this,t,this),this.check()}multiplyRight(t){return g7(this,this,t),this.check()}rotate(t){return Xxe(this,this,t),this.check()}scale(t){return Array.isArray(t)?v7(this,this,t):v7(this,this,[t,t]),this.check()}translate(t){return Jxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=c8(r||[-0,-0],t,this);break;case 3:n=Z1(r||[-0,-0,-0],t,this);break;case 4:n=h8(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return xp(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)}},b8,y8=null;function D6t(){return b8||(b8=new Rr([0,0,0,0,0,0,0,0,0]),Object.freeze(b8)),b8}function F6t(){return y8||(y8=new Rr,Object.freeze(y8)),y8}var x8={};fa(x8,{add:()=>e3t,adjoint:()=>R6t,clone:()=>B6t,copy:()=>O6t,create:()=>k6t,decompose:()=>W6t,determinant:()=>_7,equals:()=>i3t,exactEquals:()=>n3t,frob:()=>Z6t,fromQuat:()=>D7,fromQuat2:()=>G6t,fromRotation:()=>M6t,fromRotationTranslation:()=>e1e,fromRotationTranslationScale:()=>V6t,fromRotationTranslationScaleOrigin:()=>K6t,fromScaling:()=>L6t,fromTranslation:()=>j6t,fromValues:()=>I6t,fromXRotation:()=>q6t,fromYRotation:()=>N6t,fromZRotation:()=>U6t,frustum:()=>F7,getRotation:()=>H6t,getScaling:()=>t1e,getTranslation:()=>z6t,identity:()=>Zxe,invert:()=>x7,lookAt:()=>O7,mul:()=>a3t,multiply:()=>t_,multiplyScalar:()=>t3t,multiplyScalarAndAdd:()=>r3t,ortho:()=>B7,orthoNO:()=>n1e,orthoZO:()=>J6t,perspective:()=>k7,perspectiveFromFieldOfView:()=>Y6t,perspectiveNO:()=>r1e,perspectiveZO:()=>$6t,rotate:()=>A7,rotateX:()=>S7,rotateY:()=>T7,rotateZ:()=>C7,scale:()=>E7,set:()=>P6t,str:()=>Q6t,sub:()=>o3t,subtract:()=>i1e,targetTo:()=>X6t,translate:()=>w7,transpose:()=>y7});function k6t(){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 B6t(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 O6t(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 I6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,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]=p,g[13]=h,g[14]=d,g[15]=b,g}function P6t(e,t,r,n,i,a,o,s,u,c,l,f,p,h,d,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]=p,e[12]=h,e[13]=d,e[14]=b,e[15]=g,e}function Zxe(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 y7(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 x7(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],p=t[10],h=t[11],d=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*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*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]=(p*j-f*k-h*D)*J,e[4]=(u*I-o*Y-c*C)*J,e[5]=(r*Y-i*I+a*C)*J,e[6]=(g*F-d*k-x*S)*J,e[7]=(l*k-p*F+h*S)*J,e[8]=(o*U-s*I+c*N)*J,e[9]=(n*I-r*U-a*N)*J,e[10]=(d*j-b*F+x*E)*J,e[11]=(f*F-l*j-h*E)*J,e[12]=(s*C-o*P-u*N)*J,e[13]=(r*P-n*C+i*N)*J,e[14]=(b*S-d*D-g*E)*J,e[15]=(l*D-f*S+p*E)*J,e):null}function R6t(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],p=t[10],h=t[11],d=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*d,C=l*g-p*d,I=l*x-h*d,P=f*g-p*b,U=f*x-h*b,Y=p*x-h*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]=p*j-f*k-h*D,e[4]=u*I-o*Y-c*C,e[5]=r*Y-i*I+a*C,e[6]=g*F-d*k-x*S,e[7]=l*k-p*F+h*S,e[8]=o*U-s*I+c*N,e[9]=n*I-r*U-a*N,e[10]=d*j-b*F+x*E,e[11]=f*F-l*j-h*E,e[12]=s*C-o*P-u*N,e[13]=r*P-n*C+i*N,e[14]=b*S-d*D-g*E,e[15]=l*D-f*S+p*E,e}function _7(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],p=e[11],h=e[12],d=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*d-l*h,D=c*b-f*h,j=l*b-f*d,k=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*E+f*x,I=h*S-d*E+b*x;return u*k-i*N+g*C-p*I}function t_(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],p=t[9],h=t[10],d=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*p+j*g,e[2]=S*a+F*c+D*h+j*x,e[3]=S*o+F*l+D*d+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*p+j*g,e[6]=S*a+F*c+D*h+j*x,e[7]=S*o+F*l+D*d+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*p+j*g,e[10]=S*a+F*c+D*h+j*x,e[11]=S*o+F*l+D*d+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*p+j*g,e[14]=S*a+F*c+D*h+j*x,e[15]=S*o+F*l+D*d+j*E,e}function w7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,p,h,d,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],p=t[6],h=t[7],d=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]=p,e[7]=h,e[8]=d,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+d*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+p*i+g*a+t[14],e[15]=c*n+h*i+x*a+t[15]),e}function E7(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 A7(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,p,h,d,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],p=t[1],h=t[2],d=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]=p*k+g*N+F*C,e[2]=h*k+x*N+D*C,e[3]=d*k+E*N+j*C,e[4]=f*I+b*P+S*U,e[5]=p*I+g*P+F*U,e[6]=h*I+x*P+D*U,e[7]=d*I+E*P+j*U,e[8]=f*Y+b*J+S*re,e[9]=p*Y+g*J+F*re,e[10]=h*Y+x*J+D*re,e[11]=d*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 S7(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],p=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+p*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=p*i-u*n,e}function T7(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],p=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-p*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+p*i,e}function C7(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],p=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+p*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=p*i-u*n,e}function j6t(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 L6t(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 M6t(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 q6t(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 N6t(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 U6t(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 e1e(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,p=n*c,h=i*u,d=i*c,b=a*c,g=o*s,x=o*u,E=o*c;return e[0]=1-(h+b),e[1]=f+E,e[2]=p-x,e[3]=0,e[4]=f-E,e[5]=1-(l+b),e[6]=d+g,e[7]=0,e[8]=p+x,e[9]=d-g,e[10]=1-(l+h),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function G6t(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),e1e(e,t,r),e}function z6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function t1e(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 H6t(e,t){let r=new Mn(3);t1e(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,p=t[8]*n,h=t[9]*i,d=t[10]*a,b=o+l+d,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(p-u)/g,e[2]=(s-c)/g):o>l&&o>d?(g=Math.sqrt(1+o-l-d)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(p+u)/g):l>d?(g=Math.sqrt(1+l-o-d)*2,e[3]=(p-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+d-o-l)*2,e[3]=(s-c)/g,e[0]=(p+u)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function W6t(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],p=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+p*p);let h=1/r[0],d=1/r[1],b=1/r[2],g=i*h,x=a*d,E=o*b,S=s*h,F=u*d,D=c*b,j=l*h,k=f*d,N=p*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 V6t(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,p=i*c,h=i*l,d=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-(d+g))*F,e[1]=(p+S)*F,e[2]=(h-E)*F,e[3]=0,e[4]=(p-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(h+E)*j,e[9]=(b-x)*j,e[10]=(1-(f+d))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function K6t(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,p=a*c,h=a*l,d=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=(h+F)*D,Y=(d-S)*D,J=(h-F)*j,re=(1-(p+x))*j,ee=(g+E)*j,ge=(d+S)*k,ye=(g-E)*k,he=(1-(p+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]=he,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+he*I),e[15]=1,e}function D7(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,p=i*o,h=i*s,d=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-d,e[1]=l+x,e[2]=p-g,e[3]=0,e[4]=l-x,e[5]=1-c-d,e[6]=h+b,e[7]=0,e[8]=p+g,e[9]=h-b,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function F7(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 r1e(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 k7=r1e;function $6t(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 Y6t(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 n1e(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 B7=n1e;function J6t(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 O7(e,t,r,n){let i,a,o,s,u,c,l,f,p,h,d=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(d-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?Zxe(e):(f=d-F,p=b-D,h=g-j,i=1/Math.sqrt(f*f+p*p+h*h),f*=i,p*=i,h*=i,a=E*h-S*p,o=S*f-x*h,s=x*p-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=p*s-h*o,c=h*a-f*s,l=f*o-p*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]=p,e[7]=0,e[8]=s,e[9]=l,e[10]=h,e[11]=0,e[12]=-(a*d+o*b+s*g),e[13]=-(u*d+c*b+l*g),e[14]=-(f*d+p*b+h*g),e[15]=1,e)}function X6t(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],p=o-r[2],h=l*l+f*f+p*p;h>0&&(h=1/Math.sqrt(h),l*=h,f*=h,p*=h);let d=u*p-c*f,b=c*l-s*p,g=s*f-u*l;return h=d*d+b*b+g*g,h>0&&(h=1/Math.sqrt(h),d*=h,b*=h,g*=h),e[0]=d,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-p*b,e[5]=p*d-l*g,e[6]=l*b-f*d,e[7]=0,e[8]=l,e[9]=f,e[10]=p,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function Q6t(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 Z6t(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 e3t(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 i1e(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 t3t(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 r3t(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 n3t(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 i3t(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],p=e[10],h=e[11],d=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(p-U)<=1e-6*Math.max(1,Math.abs(p),Math.abs(U))&&Math.abs(h-Y)<=1e-6*Math.max(1,Math.abs(h),Math.abs(Y))&&Math.abs(d-J)<=1e-6*Math.max(1,Math.abs(d),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 a3t=t_,o3t=i1e;function s3t(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function a1e(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 o1e(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 s1e(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 u1e(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function c1e(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 l1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function f1e(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 p1e(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 h1e(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,p=c*a+o*i-s*n,h=-o*n-s*i-u*a;return e[0]=l*c+h*-o+f*-u-p*-s,e[1]=f*c+h*-s+p*-o-l*-u,e[2]=p*c+h*-u+l*-s-f*-o,e[3]=t[3],e}var Xgr=function(){let e=s3t();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 R7;(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"})(R7||(R7={}));var c3t=45*Math.PI/180,l3t=1,I7=.1,P7=500,f3t=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Kr=class extends gv{static get IDENTITY(){return h3t()}static get ZERO(){return p3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return R7}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,p,h,d,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]=p,this[12]=h,this[13]=d,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,p,h,d,b,g){return this[0]=t,this[1]=a,this[2]=c,this[3]=h,this[4]=r,this[5]=o,this[6]=l,this[7]=d,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=p,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(f3t)}fromObject(t){return this.check()}fromQuaternion(t){return D7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return s===1/0?d3t(this,r,n,i,a,o):F7(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 O7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=I7,far:s=P7}=t;return B7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=c3t,aspect:n=l3t,focalDistance:i=1,near:a=I7,far:o=P7}=t;d1e(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 d1e(r),k7(this,r,n,i,a),this.check()}determinant(){return _7(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 y7(this,this),this.check()}invert(){return x7(this,this),this.check()}multiplyLeft(t){return t_(this,t,this),this.check()}multiplyRight(t){return t_(this,this,t),this.check()}rotateX(t){return S7(this,this,t),this.check()}rotateY(t){return T7(this,this,t),this.check()}rotateZ(t){return C7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return A7(this,this,t,r),this.check()}scale(t){return E7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return w7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=p1e(r||[-0,-0,-0,-0],t,this),xp(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=l8(r||[-0,-0],t,this);break;case 3:i=kd(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return xp(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=f8(r||[-0,-0],t,this);break;case 3:n=p8(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return xp(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])}},_8,w8;function p3t(){return _8||(_8=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(_8)),_8}function h3t(){return w8||(w8=new Kr,Object.freeze(w8)),w8}function d1e(e){if(e>Math.PI*2)throw Error("expected radians")}function d3t(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,p=-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]=p,e[15]=0,e}function m1e(){let e=new Mn(4);return Mn!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function g1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function j7(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 L7(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 v1e(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 y1e(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 x1e(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 r_(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],p,h,d,b,g;return p=i*u+a*c+o*l+s*f,p<0&&(p=-p,u=-u,c=-c,l=-l,f=-f),1-p>1e-6?(h=Math.acos(p),g=Math.sin(h),d=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(d=1-n,b=n),e[0]=d*i+b*u,e[1]=d*a+b*c,e[2]=d*o+b*l,e[3]=d*s+b*f,e}function _1e(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 w1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function M7(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 E1e=a1e;var A1e=o1e,S1e=l1e,T1e=f1e,C1e=s1e;var D1e=u1e;var F1e=c1e;var k1e=function(){let e=d8(),t=m8(1,0,0),r=m8(0,1,0);return function(n,i,a){let o=Q1(i,a);return o<-.999999?(Fd(e,t,i),d7(e)<1e-6&&Fd(e,r,i),c7(e,e),j7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Fd(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,F1e(n,n))}}(),fvr=function(){let e=m1e(),t=m1e();return function(r,n,i,a,o,s){return r_(e,n,o,s),r_(t,i,a,s),r_(r,e,t,2*s*(1-s)),r}}(),pvr=function(){let e=Vxe();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],F1e(t,M7(t,e))}}();var m3t=[0,0,0,1],ds=class extends yp{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 M7(this,t),this.check()}fromAxisRotation(t,r){return j7(this,t,r),this.check()}identity(){return g1e(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 C1e(this)}lengthSquared(){return D1e(this)}dot(t){return S1e(this,t)}rotationTo(t,r){return k1e(this,t,r),this.check()}add(t){return E1e(this,this,t),this.check()}calculateW(){return x1e(this,this),this.check()}conjugate(){return w1e(this,this),this.check()}invert(){return _1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(T1e(this,t,r,n),this.check())}multiplyRight(t){return L7(this,this,t),this.check()}multiplyLeft(t){return L7(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 v1e(this,this,t),this.check()}rotateY(t){return b1e(this,this,t),this.check()}rotateZ(t){return y1e(this,this,t),this.check()}scale(t){return A1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=m3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return r_(this,i,a,o),this.check()}transformVector4(t,r=new hs){return h1e(r,t,this),xp(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 pu={};fa(pu,{EPSILON1:()=>g3t,EPSILON10:()=>S3t,EPSILON11:()=>T3t,EPSILON12:()=>C3t,EPSILON13:()=>D3t,EPSILON14:()=>F3t,EPSILON15:()=>k3t,EPSILON16:()=>B3t,EPSILON17:()=>O3t,EPSILON18:()=>I3t,EPSILON19:()=>P3t,EPSILON2:()=>v3t,EPSILON20:()=>R3t,EPSILON3:()=>b3t,EPSILON4:()=>y3t,EPSILON5:()=>x3t,EPSILON6:()=>_3t,EPSILON7:()=>w3t,EPSILON8:()=>E3t,EPSILON9:()=>A3t,PI_OVER_FOUR:()=>L3t,PI_OVER_SIX:()=>M3t,PI_OVER_TWO:()=>j3t,TWO_PI:()=>q3t});var g3t=.1,v3t=.01,b3t=.001,y3t=1e-4,x3t=1e-5,_3t=1e-6,w3t=1e-7,E3t=1e-8,A3t=1e-9,S3t=1e-10,T3t=1e-11,C3t=1e-12,D3t=1e-13,F3t=1e-14,k3t=1e-15,B3t=1e-16,O3t=1e-17,I3t=1e-18,P3t=1e-19,R3t=1e-20,j3t=Math.PI/2,L3t=Math.PI/4,M3t=Math.PI/6,q3t=Math.PI*2;var Fl=6356752314245179e-9,N3t={radii:[6378137,6378137,Fl],radiiSquared:[6378137*6378137,6378137*6378137,Fl*Fl],oneOverRadii:[1/6378137,1/6378137,1/Fl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Fl*Fl)],maximumRadius:Math.max(6378137,6378137,Fl),centerToleranceSquared:.1};function E8(e){return e}var zvr=new ce;function U3t(e,t=[],r=E8){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 B1e(e,t=[]){return U3t(e,t,Sn._cartographicRadians?E8:a7)}function G3t(e,t,r=E8){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 O1e(e,t){return G3t(e,t,Sn._cartographicRadians?E8:o7)}var I1e=1e-14,z3t=new ce,P1e={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"}},q7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},n_={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},H3t=new ce,W3t=new ce,V3t=new ce;function N7(e,t,r,n,i,a){let o=P1e[t]&&P1e[t][r];aa(o&&(!n||n===o));let s,u,c,l=z3t.copy(i);if(Oo(l.x,0,I1e)&&Oo(l.y,0,I1e)){let p=Math.sign(l.z);s=H3t.fromArray(q7[t]),t!=="east"&&t!=="west"&&s.scale(p),u=W3t.fromArray(q7[r]),r!=="east"&&r!=="west"&&u.scale(p),c=V3t.fromArray(q7[n]),n!=="east"&&n!=="west"&&c.scale(p)}else{let{up:p,east:h,north:d}=n_;h.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,p),d.copy(p).cross(h);let{down:b,west:g,south:x}=n_;b.copy(p).scale(-1),g.copy(h).scale(-1),x.copy(d).scale(-1),s=n_[t],u=n_[r],c=n_[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 vv=new ce,K3t=new ce,$3t=new ce;function R1e(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:i,centerToleranceSquared:a}=t;vv.from(e);let o=vv.x,s=vv.y,u=vv.z,c=n.x,l=n.y,f=n.z,p=o*o*c*c,h=s*s*l*l,d=u*u*f*f,b=p+h+d,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=K3t;if(x.copy(e).scale(g),b<a)return x.to(r);let E=i.x,S=i.y,F=i.z,D=$3t;D.set(x.x*E*2,x.y*S*2,x.z*F*2);let j=(1-g)*vv.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=p*U+h*Y+d*J-1;let he=-2*(p*re*E+h*ee*S+d*ge*F);k=P/he}while(Math.abs(P)>pu.EPSILON12);return vv.scale([N,C,I]).to(r)}var A8=new ce,j1e=new ce,X3t=new ce,hu=new ce,Q3t=new ce,S8=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",pu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),aa(t>=0),aa(r>=0),aa(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=j1e,i=X3t,[,,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]){S8.from(t);let n=this.scaleToGeodeticSurface(S8,hu);if(!n)return;let i=this.geodeticSurfaceNormal(n,j1e),a=Q3t;a.copy(S8).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(mv.dot(a,S8))*mv.length(a);return O1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return N7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return N7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return A8.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=B1e(t),i=n[0],a=n[1],o=Math.cos(a);return A8.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),A8.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return A8.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return R1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){hu.from(t);let n=hu.x,i=hu.y,a=hu.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return hu.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return hu.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){aa(Oo(this.radii.x,this.radii.y,pu.EPSILON15)),aa(this.radii.z>0),hu.from(t);let i=hu.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return hu.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Fl));var oa={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var lbr=new ce,fbr=new ce;var i_=new ce,L1e=new ce,Ja=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=i_.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 Ja(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=i_.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 L1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(L1e),this.radius=u,this}expand(t){let n=i_.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=x8.getScaling(i_,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=i_.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?oa.OUTSIDE:a<n?oa.INTERSECTING:oa.INSIDE}};var Z3t=new ce,eCt=new ce,T8=new ce,C8=new ce,D8=new ce,tCt=new ce,rCt=new ce,kl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},sa=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 ds().fromMatrix3(new Rr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new ds(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 sa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ja){let r=this.halfAxes,n=r.getColumn(0,T8),i=r.getColumn(1,C8),a=r.getColumn(2,D8),o=Z3t.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[kl.COLUMN0ROW0]+o*i[kl.COLUMN0ROW1]+s*i[kl.COLUMN0ROW2])+Math.abs(a*i[kl.COLUMN1ROW0]+o*i[kl.COLUMN1ROW1]+s*i[kl.COLUMN1ROW2])+Math.abs(a*i[kl.COLUMN2ROW0]+o*i[kl.COLUMN2ROW1]+s*i[kl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?oa.OUTSIDE:c>=u?oa.INSIDE:oa.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=eCt.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,T8),a=n.getColumn(1,C8),o=n.getColumn(2,D8),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,T8),c=s.getColumn(1,C8),l=s.getColumn(2,D8),f=tCt.copy(u).add(c).add(l).add(o),p=rCt.copy(f).subtract(t),h=r.dot(p);return i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).add(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).subtract(l),p.copy(f).subtract(t),h=r.dot(p),i=Math.min(h,i),a=Math.max(h,a),n[0]=i,n[1]=a,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,T8);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,C8);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,D8);return i.transformAsPoint(t),this.halfAxes=new Rr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var M1e=new ce,q1e=new ce,Bl=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 aa(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=M1e.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),aa(Oo(this.normal.len(),1)),this.distance=i,this}clone(){return new Bl(this.normal,this.distance)}equals(t){return Oo(this.distance,t.distance)&&Oo(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=M1e.from(t),i=this.getPointDistance(n),a=q1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var N1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],U1e=new ce,nCt=new ce,ms=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*N1e.length;let r=t.center,n=t.radius,i=0;for(let a of N1e){let o=this.planes[i],s=this.planes[i+1];o||(o=this.planes[i]=new Bl),s||(s=this.planes[i+1]=new Bl);let u=U1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=U1e.copy(a).scale(n).add(r),l=nCt.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=oa.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case oa.OUTSIDE:return oa.OUTSIDE;case oa.INTERSECTING:r=oa.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(aa(Number.isFinite(r),"parentPlaneMask is required."),r===ms.MASK_OUTSIDE||r===ms.MASK_INSIDE)return r;let n=ms.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===oa.OUTSIDE)return ms.MASK_OUTSIDE;u===oa.INTERSECTING&&(n|=o)}return n}};zt(ms,"MASK_OUTSIDE",4294967295);zt(ms,"MASK_INSIDE",0);zt(ms,"MASK_INDETERMINATE",2147483647);var Pbr=new ce,Rbr=new ce,jbr=new ce,Lbr=new ce,Mbr=new ce;var aCt=new ce,oCt=new ce,sCt=new ce,uCt=new ce,cCt=new ce,lCt=new ce,fCt=new ce,bv=new ce,pCt=new ce,hCt=new ce,dCt=new ce,mCt=new ce;function U7(e,t=new Ja){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=fCt.copy(e[0]),n=aCt.copy(r),i=oCt.copy(r),a=sCt.copy(r),o=uCt.copy(r),s=cCt.copy(r),u=lCt.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=bv.copy(o).subtract(n).magnitudeSquared(),l=bv.copy(s).subtract(i).magnitudeSquared(),f=bv.copy(u).subtract(a).magnitudeSquared(),p=n,h=o,d=c;l>d&&(d=l,p=i,h=s),f>d&&(d=f,p=a,h=u);let b=pCt;b.x=(p.x+h.x)*.5,b.y=(p.y+h.y)*.5,b.z=(p.z+h.z)*.5;let g=bv.copy(h).subtract(b).magnitudeSquared(),x=Math.sqrt(g),E=hCt;E.x=n.x,E.y=i.y,E.z=a.z;let S=dCt;S.x=o.x,S.y=s.y,S.z=u.z;let F=mCt.copy(E).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let k=bv.copy(r).subtract(F).magnitude();k>D&&(D=k);let N=bv.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 yc=new Rr,gCt=new Rr,vCt=new Rr,F8=new Rr,G1e=new Rr;function H7(e,t={}){let r=pu.EPSILON20,n=10,i=0,a=0,o=gCt,s=vCt;o.identity(),s.copy(e);let u=r*bCt(s);for(;a<n&&yCt(s)>u;)xCt(s,F8),G1e.copy(F8).transpose(),s.multiplyRight(F8),s.multiplyLeft(G1e),o.multiplyRight(F8),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function bCt(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var G7=[1,0,0],z7=[2,2,1];function yCt(e){let t=0;for(let r=0;r<3;++r){let n=e[yc.getElementIndex(z7[r],G7[r])];t+=2*n*n}return Math.sqrt(t)}function xCt(e,t){let r=pu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[yc.getElementIndex(z7[c],G7[c])]);l>n&&(i=c,n=l)}let a=G7[i],o=z7[i],s=1,u=0;if(Math.abs(e[yc.getElementIndex(o,a)])>r){let c=e[yc.getElementIndex(o,o)],l=e[yc.getElementIndex(a,a)],f=e[yc.getElementIndex(o,a)],p=(c-l)/2/f,h;p<0?h=-1/(-p+Math.sqrt(1+p*p)):h=1/(p+Math.sqrt(1+p*p)),s=1/Math.sqrt(1+h*h),u=h*s}return Rr.IDENTITY.to(t),t[yc.getElementIndex(a,a)]=t[yc.getElementIndex(o,o)]=s,t[yc.getElementIndex(o,a)]=u,t[yc.getElementIndex(a,o)]=-u,t}var wp=new ce,wCt=new ce,ECt=new ce,ACt=new ce,SCt=new ce,TCt=new Rr,CCt={diagonal:new Rr,unitary:new Rr};function a_(e,t=new sa){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=wp.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=TCt;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:p}=H7(f,CCt),h=t.halfAxes.copy(p),d=h.getColumn(0,ECt),b=h.getColumn(1,ACt),g=h.getColumn(2,SCt),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)wp.copy(C),x=Math.max(wp.dot(d),x),E=Math.max(wp.dot(b),E),S=Math.max(wp.dot(g),S),F=Math.min(wp.dot(d),F),D=Math.min(wp.dot(b),D),j=Math.min(wp.dot(g),j);d=d.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+E)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(d).add(b).add(g);let k=wCt.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 V1e(e){return e!=null}var vyr=new ce,DCt=new ce,FCt=new ce,kCt=new ce,Bd=new ce,z1e=new ce,H1e=new ce,W1e=new ce;function k8(e,t,r){if(Qt(e,"3D Tile: boundingVolume must be defined"),e.box)return K1e(e.box,t,r);if(e.region)return OCt(e.region);if(e.sphere)return BCt(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function K1e(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 ds;l.fromArray(e,6);let f=new ce([1,0,0]),p=new ce([0,1,0]),h=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),p.transformByQuaternion(l),p.scale(c[1]),h.transformByQuaternion(l),h.scale(c[2]),i=[...f.toArray(),...p.toArray(),...h.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 V1e(r)?(r.center=n,r.halfAxes=u,r):new sa(n,u)}function BCt(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(DCt),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return V1e(r)?(r.center=n,r.radius=o,r):new Ja(n,o)}function OCt(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Dl(t),Dl(i),a],FCt),u=or.WGS84.cartographicToCartesian([Dl(n),Dl(r),o],kCt),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Bd),or.WGS84.cartographicToCartesian([Dl(n),Bd[1],Bd[2]],z1e),or.WGS84.cartographicToCartesian([Bd[0],Dl(i),Bd[2]],H1e),or.WGS84.cartographicToCartesian([Bd[0],Bd[1],o],W1e),K1e([...c,...z1e.subtract(c),...H1e.subtract(c),...W1e.subtract(c)],new Kr)}var yv="4.1.0-alpha.4";var gs={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},wyr=Object.keys(gs),Ep={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function W7(e,t,r){Qt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function $1e(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 B8="4.1.0-alpha.4";var Y1e={name:"Draco",id:"draco",module:"draco",version:B8,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 X1e(e,t,r){let n=Q1e(t.metadata),i=[],a=ICt(t.attributes);for(let o in e){let s=e[o],u=J1e(o,s,a[o]);i.push(u)}if(r){let o=J1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function ICt(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function J1e(e,t,r){let n=r?Q1e(r.metadata):void 0;return n7(e,t,n)}function Q1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Z1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},PCt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},RCt=4,o_=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 p=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(p)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=r7(u.attributes),l=X1e(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*RCt,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),MCt(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=PCt[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=jCt(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 Z1e)if(this.draco[o]===i)return Z1e[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=LCt(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 jCt(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 LCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function MCt(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var qCt="1.5.6",NCt="1.4.1",V7=`https://www.gstatic.com/draco/versioned/decoders/${qCt}`,ai={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Ap={[ai.DECODER]:`${V7}/${ai.DECODER}`,[ai.DECODER_WASM]:`${V7}/${ai.DECODER_WASM}`,[ai.FALLBACK_DECODER]:`${V7}/${ai.FALLBACK_DECODER}`,[ai.ENCODER]:`https://raw.githubusercontent.com/google/draco/${NCt}/javascript/${ai.ENCODER}`},s_;async function e_e(e){let t=e.modules||{};return t.draco3d?s_=s_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):s_=s_||UCt(e),await s_}async function UCt(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Zu(Ap[ai.FALLBACK_DECODER],"draco",e,ai.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Zu(Ap[ai.DECODER],"draco",e,ai.DECODER),await Zu(Ap[ai.DECODER_WASM],"draco",e,ai.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await GCt(t,r)}function GCt(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var K7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:B8,worker:!0,options:{draco:{},source:null}};var xv={...Y1e,parse:zCt};async function zCt(e,t){let{draco:r}=await e_e(t),n=new o_(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var HCt={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={...HCt,...bi};var $7={[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},WCt={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},Y7="Failed to convert GL type",qa=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in $7)if($7[r]===t)return r;throw new Error(Y7)}static fromName(t){let r=WCt[t];if(!r)throw new Error(Y7);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=$7[t];if(!r)throw new Error(Y7);return r}}static getByteSize(t){return qa.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(qa.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/qa.getByteSize(t));let a=qa.getArrayType(t);return new a(r,n,i)}};function t_e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function J7(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 Jyr=1/256;var Xyr=new Dd,Qyr=new ce,Zyr=new Dd,exr=new Dd,txr=new Uint8Array(1);function r_e(e,t=255){return s7(e,0,t)/t*2-1}function n_e(e){return e<0?-1:1}function i_e(e,t,r,n){if(t_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=r_e(e,r),n.y=r_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))*n_e(i),n.y=(1-Math.abs(i))*n_e(n.y)}return n.normalize()}function X7(e,t,r){return i_e(e,t,255,r)}function O8(e){return(e%1+1)%1}var Ol=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=qa.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=qa.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=qa.createTypedArray(r,n),i[t]=a),a}};var VCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},KCt={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]]},$Ct={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 a_e(e,t,r,n){let{componentType:i}=e;Qt(e.componentType);let a=typeof i=="string"?qa.fromName(i):i,o=VCt[e.type],s=KCt[e.type],u=$Ct[e.type];return r+=e.byteOffset,{values:qa.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var xc=e=>e!==void 0;function o_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?YCt(n,r):null}function YCt(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;xc(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(xc(u))for(xc(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];xc(c)&&xc(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 p=o.length;for(r=0;r<p;++r){let g=o[r].length,x=o[r].instances,E=getBinaryProperties(g,x,t);o[r].instances=combine(E,x)}let h=new Array(p).fill(0),d=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],d[r]=h[n],++h[n];let b={classes:o,classIds:s,classIndexes:d,parentCounts:u,parentIndexes:f,parentIds:c};return QCt(b),b}function _v(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?JCt(e,t,r):XCt(e,t,r)}function JCt(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(xc(f))return f;let p=i[t],h=o[t];for(let d=0;d<p;++d){let b=a[h+d];b!==t&&l.push(b)}}return null}function XCt(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(xc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function QCt(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)s_e(e,i,stack)}function s_e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!xc(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=xc(n)?n[t]:1,c=xc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&s_e(e,f,r)}r.pop(t)}function mo(e){return e!=null}var I8=(e,t)=>e,ZCt={HIERARCHY:!0,extensions:!0,extras:!0},Od=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)ZCt[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=o_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=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a];return i.classes[o].name===r});return mo(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),mo(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=mo(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(mo(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(mo(n))return I8(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(mo(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];mo(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=I8(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=a_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=_v(this._hierarchy,t,(i,a)=>{let o=i.classIds[a],s=i.classes[o].instances;return mo(s[r])});return mo(n)}_getPropertyNamesInHierarchy(t,r){_v(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 _v(this._hierarchy,t,(n,i)=>{let a=n.classIds[i],o=n.classes[a],s=n.classIndexes[i],u=o.instances[r];return mo(u)?mo(u.typedArray)?this._getBinaryProperty(u,s):I8(u[s],!0):null})}_setHierarchyProperty(t,r,n,i){let a=_v(this._hierarchy,r,(o,s)=>{let u=o.classIds[s],c=o.classes[u],l=o.classIndexes[s],f=c.instances[n];return mo(f)?(Qt(s===r,`Inherited property "${n}" is read-only.`),mo(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=I8(i,!0),!0):!1});return mo(a)}};var Q7=4;function Sp(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=Q7,e.version=n.getUint32(r,!0),r+=Q7,e.byteLength=n.getUint32(r,!0),r+=Q7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var wv=4,u_e="b3dm tile in legacy format.";function Ev(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=wv;let o=n.getUint32(r,!0);r+=wv;let s=n.getUint32(r,!0);r+=wv;let u=n.getUint32(r,!0);return r+=wv,s>=570425344?(r-=wv*2,i=a,s=o,u=0,a=0,o=0,console.warn(u_e)):u>=570425344&&(r-=wv,i=s,s=a,u=o,a=0,o=0,console.warn(u_e)),e.header.featureTableJsonByteLength=a,e.header.featureTableBinaryByteLength=o,e.header.batchTableJsonByteLength=s,e.header.batchTableBinaryByteLength=u,e.header.batchLength=i,r}function Av(e,t,r,n){return r=e8t(e,t,r,n),r=t8t(e,t,r,n),r}function e8t(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=W7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function t8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=W7(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 Z7(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=J7(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 c_e=new ce;function l_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++)X7(t[n*2],t[n*2+1],c_e),c_e.toArray(r,n*3);return{type:Ht.FLOAT,size:2,value:r}}return{type:Ht.FLOAT,size:2,value:t}}function f_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,r8t(e,t)):{type:Ht.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function r8t(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 p_e(e,t,r,n,i){r=Sp(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),n8t(e);let{featureTable:a,batchTable:o}=i8t(e);return await c8t(e,a,o,n,i),a8t(e,a,n),o8t(e,a,o),s8t(e,a),r}function n8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function i8t(e){let t=new Ol(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=u8t(e,t);return{featureTable:t,batchTable:n}}function a8t(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=f_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function o8t(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=Z7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Ht.UNSIGNED_BYTE,4))}function s8t(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=l_e(e,r)}}function u8t(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 Od(i,a,n)}return r}async function c8t(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,p=c.byteLength;if(!o||!Number.isFinite(f)||!p)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+p),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 l8t(e,l,n,i)}async function l8t(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 To(t.buffer,xv,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 h=a.POSITION.data.quantization,d=h.range;e.quantizedVolumeScale=new ce(d,d,d),e.quantizedVolumeOffset=new ce(h.minValues),e.quantizedRange=(1<<h.quantizationBits)-1,e.isQuantizedDraco=!0}f&&(e.octEncodedRange=(1<<a.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let p={};if(t.batchTableProperties)for(let h of Object.keys(t.batchTableProperties))a.attributes[h]&&a.attributes[h].value&&(p[h.toLowerCase()]=a.attributes[h].value);e.attributes={positions:o,colors:Z7(e,s,void 0),normals:u,batchIds:c,...p}}var uq={};fa(uq,{decode:()=>Y8t,name:()=>H8});var P8="4.1.0-alpha.4";var h_e,f8t=(h_e=globalThis.loaders)==null?void 0:h_e.parseImageNode,eq=typeof Image<"u",tq=typeof ImageBitmap<"u",p8t=Boolean(f8t),rq=gn?!0:p8t;function d_e(e){switch(e){case"auto":return tq||eq||rq;case"imagebitmap":return tq;case"image":return eq;case"data":return rq;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function m_e(){if(tq)return"imagebitmap";if(eq)return"image";if(rq)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function g_e(e){let t=h8t(e);if(!t)throw new Error("Not an image");return t}function nq(e){return Sv(e)}function Sv(e){switch(g_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 h8t(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 d8t=/^data:image\/svg\+xml/,m8t=/\.svg((\?|#).*)?$/;function R8(e){return e&&(d8t.test(e)||m8t.test(e))}function v_e(e,t){if(R8(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 iq(e,t)}function iq(e,t){if(R8(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function j8(e,t,r){let n=v_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await g8t(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function g8t(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 v8t={},b_e=!0;async function y_e(e,t,r){let n;R8(r)?n=await j8(e,t,r):n=iq(e,r);let i=t&&t.imagebitmap;return await b8t(n,i)}async function b8t(e,t=null){if((y8t(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 y8t(e){for(let t in e||v8t)return!1;return!0}function x_e(e){return!E8t(e,"ftyp",4)||!(e[8]&96)?null:x8t(e)}function x8t(e){switch(_8t(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function _8t(e,t,r){return String.fromCharCode(...e.slice(t,r))}function w8t(e){return[...e].map(t=>t.charCodeAt(0))}function E8t(e,t,r=0){let n=w8t(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var _c=!1,u_=!0;function Id(e){let t=c_(e);return S8t(t)||D8t(t)||T8t(t)||C8t(t)||A8t(t)}function A8t(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=x_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function S8t(e){let t=c_(e);return t.byteLength>=24&&t.getUint32(0,_c)===2303741511?{mimeType:"image/png",width:t.getUint32(16,_c),height:t.getUint32(20,_c)}:null}function T8t(e){let t=c_(e);return t.byteLength>=10&&t.getUint32(0,_c)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,u_),height:t.getUint16(8,u_)}:null}function C8t(e){let t=c_(e);return t.byteLength>=14&&t.getUint16(0,_c)===16973&&t.getUint32(2,u_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,u_),height:t.getUint32(22,u_)}:null}function D8t(e){let t=c_(e);if(!(t.byteLength>=3&&t.getUint16(0,_c)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=F8t(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,_c);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,_c),width:t.getUint16(a+7,_c)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,_c)}return null}function F8t(){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 c_(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 __e(e,t){var i;let{mimeType:r}=Id(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Qt(n),await n(e,r)}async function w_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=k8t(i),s;switch(o){case"imagebitmap":s=await y_e(e,t,a);break;case"image":s=await j8(e,t,a);break;case"data":s=await __e(e,t);break;default:Qt(!1)}return i==="data"&&(s=Sv(s)),s}function k8t(e){switch(e){case"auto":case"data":return m_e();default:return d_e(e),e}}var B8t=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],O8t=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],I8t={image:{type:"auto",decode:!0}},Tv={id:"image",module:"images",name:"Images",version:P8,mimeTypes:O8t,extensions:B8t,parse:w_e,tests:[e=>Boolean(Id(new DataView(e)))],options:I8t};var S_e,E_e=(S_e=globalThis.loaders)==null?void 0:S_e.encodeImageNode;async function T_e(e,t){return t=t||{},t.image=t.image||{},E_e?E_e(e,{type:t.image.mimeType}):P8t(e,t)}var A_e=!0;async function P8t(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=nq(e),o=document.createElement("canvas");o.width=i,o.height=a,R8t(e,o);let s=await new Promise(u=>{if(n&&A_e)try{o.toBlob(u,r,n);return}catch{A_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function R8t(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 aq={name:"Images",id:"image",module:"images",version:P8,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:T_e};var oq={};function sq(e){if(oq[e]===void 0){let t=gn?L8t(e):j8t(e);oq[e]=t}return oq[e]}function j8t(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 L8t(e){switch(e){case"image/avif":case"image/webp":return M8t(e);default:return!0}}function M8t(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ui(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var L8={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},M8={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var q8t=1.33,C_e=["SCALAR","VEC2","VEC3","VEC4"],N8t=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],U8t=new Map(N8t),G8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},z8t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},H8t={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function q8(e){return C_e[e-1]||C_e[0]}function Cv(e){let t=U8t.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Dv(e,t){let r=H8t[e.componentType],n=G8t[e.type],i=z8t[e.componentType],a=e.count*n,o=e.count*n*i;Ui(o>=0&&o<=t.byteLength);let s=M8[e.componentType],u=L8[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function l_(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*q8t)}function D_e(e,t,r){let n=e.bufferViews[r];Ui(n);let i=n.buffer,a=t[i];Ui(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function F_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}=Dv(n,i),p=l*f,h=i.byteStride||p;if(typeof i.byteStride>"u"||i.byteStride===p)return new u(a,s,c);let d=new u(c);for(let x=0;x<n.count;x++){let E=new u(a,s+x*h,f);d.set(E,x*f)}return d}function W8t(){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)||W8t(),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];Ui(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return F_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 Ui(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ui(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=Id(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;Ui(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Do(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:q8(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:Cv(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=WI(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 k_e(e){return(e%1+1)%1}var B_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},V8t={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},O_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function f_(e,t){return O_e[t]*B_e[e]}function Fv(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let i=e.getTypedArrayForBufferView(t),a=kv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function kv(e,t,r,n=1){let i=B_e[t],a=V8t[r],o=O_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 Bv(e,t,r){var c,l,f,p,h;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 d=(p=(f=o.images)==null?void 0:f[u])==null?void 0:p.mimeType,b=(h=e.gltf.images)==null?void 0:h[u];if(b&&typeof b.width<"u"){let g=[];for(let x=0;x<a.length;x+=2){let E=K8t(b,d,a,x,t.channels);g.push(E)}return g}}return[]}function N8(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(p=>p===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:Cv(o),count:o.length});i.attributes[t]=c}function K8t(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=$8t(o,s,e,u),l=0;for(let f of i){let p=typeof f=="number"?Object.values(a)[f]:a[f],h=c+p.offset,d=Sv(e);if(d.data.length<=h)throw new Error(`${d.data.length} <= ${h}`);let b=d.data[h];l|=b<<p.shift}return l}function $8t(e,t,r,n=1){let i=r.width,a=k_e(e)*(i-1),o=Math.round(a),s=r.height,u=k_e(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function U8(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 G8(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 z8(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 I_e="EXT_mesh_features",H8=I_e;async function Y8t(e,t){let r=new qr(e);J8t(r,t)}function J8t(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)X8t(e,i,t)}function X8t(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[I_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=Bv(e,u.texture,t):c=[];u.data=c}}var fq={};fa(fq,{decode:()=>Q8t,name:()=>Il});var cq="EXT_structural_metadata",Il=cq;async function Q8t(e,t){let r=new qr(e);Z8t(r,t)}function Z8t(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(cq);r&&((i=t.gltf)!=null&&i.loadImages&&eDt(e,r),tDt(e,r))}function eDt(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)nDt(e,r,a,t)}function tDt(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=rDt(i,a);o&&aDt(e,r,o)}}function rDt(e,t){for(let r of e)if(r.class===t)return r;return null}function nDt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[cq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];iDt(e,u,r,n)}}function iDt(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=Bv(e,u,r);l!==null&&(N8(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function aDt(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=oDt(e,t,u,i,c);c.data=l}}}function oDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=sDt(e,r,i,n),c=uDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=cDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=z8(n,s,u,c);break}case"ENUM":{a=lDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function sDt(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Fv(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function uDt(e,t,r){return typeof t.stringOffsets<"u"?Fv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function cDt(e,t,r,n){let i=e.array,a=e.count,o=f_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=kv(r,e.type,e.componentType,s):u=r,i?n?U8(u,t,n,r.length,o):a?G8(u,t,a):[]:u}function lDt(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=f_(t.type,s),c=n.byteLength/u,l=kv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return fDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let p=t.count;return p?pDt(l,r,p,o):[]}return lq(l,0,r,o)}function fDt(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,p=l/a,h=lq(t,f,p,o);s.push(h)}return s}function pDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=lq(e,o,r,n);i.push(s)}return i}function lq(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=hDt(n,o);s?i.push(s.name):i.push("")}return i}function hDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var pq={};fa(pq,{decode:()=>dDt,name:()=>vs});var P_e="EXT_feature_metadata",vs=P_e;async function dDt(e,t){let r=new qr(e);mDt(r,t)}function mDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(P_e);r&&((i=t.gltf)!=null&&i.loadImages&&gDt(e,r),vDt(e,r))}function gDt(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=yDt(i,a);s&&_Dt(e,s,o)}}function vDt(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=bDt(i,a);o&&xDt(e,r,o)}}function bDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function yDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function xDt(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=wDt(e,t,u,i,c);c.data=l}}}function _Dt(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=CDt(e,o,n);o.data=s}}}function wDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=EDt(e,r,i,n),c=ADt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=z8(n,s,u,c):SDt(r)&&(a=TDt(r,n,s,u)),a}function EDt(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Fv(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function ADt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Fv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function SDt(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 TDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=f_(o,s),c=r.byteLength/u,l=kv(r,o,s,c);return i?n?U8(l,t,n,r.length,u):a?G8(l,t,a):[]:l}function CDt(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)DDt(e,r,t,i,o);return i}function DDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Bv(e,a,i);o&&N8(e,t,o,n,i)}var W8="4.1.0-alpha.4";var Ov="4.1.0-alpha.4";var wc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},hq;async function mq(e){let t=e.modules||{};return t.basis?t.basis:(hq=hq||FDt(e),await hq)}async function FDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.TRANSCODER,"textures",e),await Zu(wc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await kDt(t,r)}function kDt(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 dq;async function gq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(dq=dq||BDt(e),await dq)}async function BDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Zu(wc.ENCODER,"textures",e),await Zu(wc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await ODt(t,r)}function ODt(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 IDt=["","WEBKIT_","MOZ_"],R_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"},V8=null;function p_(e){if(!V8){e=e||PDt()||void 0,V8=new Set;for(let t of IDt)for(let r in R_e)if(e&&e.getExtension(`${t}${r}`)){let n=R_e[r];V8.add(n)}}return V8}function PDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var K_e=Wt(W_e(),1);function Iv(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=LDt(t,n,i,e,o),u=jDt(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 jDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function LDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var MDt={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 V_e(e){return MDt[e]}var Io=[171,75,84,88,32,50,48,187,13,10,26,10];function X8(e){let t=new Uint8Array(e);return!(t.byteLength<Io.length||t[0]!==Io[0]||t[1]!==Io[1]||t[2]!==Io[2]||t[3]!==Io[3]||t[4]!==Io[4]||t[5]!==Io[5]||t[6]!==Io[6]||t[7]!==Io[7]||t[8]!==Io[8]||t[9]!==Io[9]||t[10]!==Io[10]||t[11]!==Io[11])}function $_e(e){let t=new Uint8Array(e),r=(0,K_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=V_e(r.vkFormat);return Iv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var qDt={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 d_(e,t){if(t.basis.containerFormat==="auto"){if(X8(e)){let n=await gq(t);return Y_e(n.KTX2File,e,t)}let{BasisFile:r}=await mq(t);return _q(r,e,t)}switch(t.basis.module){case"encoder":let r=await gq(t);switch(t.basis.containerFormat){case"ktx2":return Y_e(r.KTX2File,e,t);case"basis":default:return _q(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await mq(t);return _q(n,e,t)}}function _q(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(NDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function NDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=J_e(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 Y_e(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(UDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function UDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=J_e(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 J_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Pv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),qDt[r]}function Pv(){let e=p_();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 X_e={name:"Basis",id:"basis",module:"textures",version:Ov,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"}}},Pd={...X_e,parse:d_};var Po={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},GDt={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},zDt=e2e,HDt=Q8,WDt=Q8,VDt={DXT1:e2e,DXT3:Q8,DXT5:Q8,"ATC ":zDt,ATCA:HDt,ATCI:WDt};function Q_e(e){return new Uint32Array(e,0,Po.HEADER_LENGTH)[Po.MAGIC_NUMBER_INDEX]===Po.MAGIC_NUMBER}function Z_e(e){let t=new Int32Array(e,0,Po.HEADER_LENGTH),r=t[Po.HEADER_PF_FOURCC_INDEX];Qt(Boolean(t[Po.HEADER_PF_FLAGS_INDEX]&Po.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=KDt(r),i=GDt[n],a=VDt[n];Qt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[Po.HEADER_FLAGS_INDEX]&Po.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[Po.MIPMAPCOUNT_INDEX]));let s=t[Po.HEADER_WIDTH_INDEX],u=t[Po.HEADER_HEIGHT_INDEX],c=t[Po.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return Iv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function e2e(e,t){return(e+3>>2)*(t+3>>2)*8}function Q8(e,t){return(e+3>>2)*(t+3>>2)*16}function KDt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var bs={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},$Dt={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]},YDt={0:t2e,1:t2e,2:r2e,3:r2e,6:m_,7:m_,9:g_,11:g_,22:m_,23:g_,24:m_,25:m_,26:g_,27:g_,28:JDt,29:XDt,30:QDt,31:ZDt,32:e4t,33:t4t,34:r4t,35:n4t,36:i4t,37:a4t,38:o4t,39:s4t,40:u4t};function n2e(e){let r=new Uint32Array(e,0,bs.HEADER_LENGTH)[bs.MAGIC_NUMBER_INDEX];return r===bs.MAGIC_NUMBER||r===bs.MAGIC_NUMBER_EXTRA}function i2e(e){let t=new Uint32Array(e,0,bs.HEADER_LENGTH),r=t[bs.PIXEL_FORMAT_INDEX],n=t[bs.COLOUR_SPACE_INDEX],i=$Dt[r]||[],a=i.length>1&&n?i[1]:i[0],o=YDt[r],s=t[bs.MIPMAPCOUNT_INDEX],u=t[bs.WIDTH_INDEX],c=t[bs.HEIGHT_INDEX],l=bs.HEADER_SIZE+t[bs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return Iv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function t2e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function r2e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function m_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function g_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function JDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function XDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function QDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function ZDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function e4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function t4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function r4t(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function n4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function i4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function a4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function o4t(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function s4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function u4t(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function a2e(e){if(X8(e))return $_e(e);if(Q_e(e))return Z_e(e);if(n2e(e))return i2e(e);throw new Error("Texture container format not recognized")}var o2e={name:"Texture Containers",id:"compressed-texture",module:"textures",version:Ov,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}}},Z8={...o2e,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 d_(e,t))[0]):a2e(e)}};var wq={name:"Basis Universal Supercompressed GPU Texture",id:"ktx2-basis-writer",module:"textures",version:Ov,extensions:["ktx2"],worker:!0,options:{useSRGB:!1,qualityLevel:10,encodeUASTC:!1,mipmaps:!1}};var Rv=!0,s2e=1735152710,Sq=12,eD=8,c4t=1313821514,l4t=5130562,f4t=0,p4t=0,h4t=1;function d4t(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 u2e(e,t=0,r={}){let n=new DataView(e),{magic:i=s2e}=r,a=n.getUint32(t,!1);return a===i||a===s2e}function c2e(e,t,r=0,n={}){let i=new DataView(t),a=d4t(i,r+0),o=i.getUint32(r+4,Rv),s=i.getUint32(r+8,Rv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=Sq,e.version){case 1:return m4t(e,i,r);case 2:return g4t(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function m4t(e,t,r){Qt(e.header.byteLength>Sq+eD);let n=t.getUint32(r+0,Rv),i=t.getUint32(r+4,Rv);return r+=eD,Qt(i===f4t),Eq(e,t,r,n),r+=n,r+=Aq(e,t,r,e.header.byteLength),r}function g4t(e,t,r,n){return Qt(e.header.byteLength>Sq+eD),v4t(e,t,r,n),r+e.header.byteLength}function v4t(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,Rv),a=t.getUint32(r+4,Rv);switch(r+=eD,a){case c4t:Eq(e,t,r,i);break;case l4t:Aq(e,t,r,i);break;case p4t:n.strict||Eq(e,t,r,i);break;case h4t:n.strict||Aq(e,t,r,i);break;default:break}r+=Do(i,4)}return r}function Eq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Do(n,4)}function Aq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Do(n,4)}function Tq(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 Dq={};fa(Dq,{decode:()=>F4t,name:()=>D4t});var b4t="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",y4t="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",x4t=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]),_4t=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]),w4t={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},E4t={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function l2e(e,t,r,n,i,a="NONE"){let o=await A4t();C4t(o,o.exports[E4t[i]],e,t,r,n,o.exports[w4t[a||"NONE"]])}var Cq;async function A4t(){return Cq||(Cq=S4t()),Cq}async function S4t(){let e=b4t;WebAssembly.validate(x4t)&&(e=y4t,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(T4t(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function T4t(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?_4t[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function C4t(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 p=t(c,n,i,l,a.length);if(p===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),p!==0)throw new Error(`Malformed buffer data: ${p}`)}var tD="EXT_meshopt_compression",D4t=tD;async function F4t(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(k4t(r,o));await Promise.all(n),r.removeExtension(tD)}async function k4t(e,t){let r=e.getObjectExtension(t,tD);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),p=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await l2e(p,o,a,f,s,u),e.removeObjectExtension(t,tD)}}var Fq={};fa(Fq,{name:()=>B4t,preprocess:()=>O4t});var jv="EXT_texture_webp",B4t=jv;function O4t(e,t){let r=new qr(e);if(!sq("image/webp")){if(r.getRequiredExtensions().includes(jv))throw new Error(`gltf: Required extension ${jv} not supported by browser`);return}let{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,jv);a&&(i.source=a.source),r.removeObjectExtension(i,jv)}r.removeExtension(jv)}var kq={};fa(kq,{name:()=>I4t,preprocess:()=>P4t});var rD="KHR_texture_basisu",I4t=rD;function P4t(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,rD);a&&(i.source=a.source,r.removeObjectExtension(i,rD))}r.removeExtension(rD)}var Oq={};fa(Oq,{decode:()=>q4t,encode:()=>N4t,name:()=>L4t,preprocess:()=>M4t});function f2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Bq(n);t[r]=i}}return t}function Bq(e){let{buffer:t,size:r,count:n}=R4t(e);return{value:t,size:r,byteOffset:0,count:n,type:q8(r),componentType:Cv(t)}}function R4t(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=j4t(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function j4t(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Tp="KHR_draco_mesh_compression",L4t=Tp;function M4t(e,t,r){let n=new qr(e);for(let i of p2e(n))n.getObjectExtension(i,Tp)}async function q4t(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 p2e(n))n.getObjectExtension(o,Tp)&&i.push(U4t(n,o,t,r));await Promise.all(i),n.removeExtension(Tp)}function N4t(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])G4t(n,t),r.addRequiredExtension(Tp)}async function U4t(e,t,r,n){let i=e.getObjectExtension(t,Tp);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=Wh(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await To(o,xv,s,n),c=f2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let p=t.attributes[l],h=e.getAccessor(p);h!=null&&h.min&&(h!=null&&h.max)&&(f.min=h.min,f.max=h.max)}t.attributes=c,u.indices&&(t.indices=Bq(u.indices)),e.removeObjectExtension(t,Tp),z4t(t)}function G4t(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:{[Tp]:{bufferView:u,attributes:s}}}]}}function z4t(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*p2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Pq={};fa(Pq,{decode:()=>K4t,name:()=>H4t});var Iq="KHR_texture_transform",H4t=Iq,nD=new ce,W4t=new Rr,V4t=new Rr;async function K4t(e,t){var a;if(!new qr(e).hasExtension(Iq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)$4t(o,e)}function $4t(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&&v_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&v_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&v_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&v_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&v_(t,e,u,r)}function v_(e,t,r,n){let i=Y4t(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&&J4t(e,s,i)}}function Y4t(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Iq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=Z4t(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function J4t(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:p}=e.buffers[l.buffer],h=(p||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:d,length:b}=Dv(c,l),g=M8[c.componentType],x=L8[c.type],E=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new d(f,h+F*E,2);nD.set(D[0],D[1],1),nD.transformByMatrix3(a),S.set([nD[0],nD[1]],F*x)}n===i?X4t(c,l,e.buffers,S):Q4t(i,c,t,e,S)}}}}function X4t(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 Q4t(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 Z4t(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=W4t.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=V4t.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Rq={};fa(Rq,{decode:()=>tFt,encode:()=>rFt,name:()=>eFt});var Rd="KHR_lights_punctual",eFt=Rd;async function tFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Rd);n&&(t.json.lights=n.lights,t.removeExtension(Rd));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Rd);a&&(i.light=a.light),t.removeObjectExtension(i,Rd)}}async function rFt(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Rd);Ui(!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,Rd,n)}delete t.json.lights}}var jq={};fa(jq,{decode:()=>iFt,encode:()=>aFt,name:()=>nFt});var b_="KHR_materials_unlit",nFt=b_;async function iFt(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,b_);t.removeExtension(b_)}function aFt(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,b_,{}),t.addExtension(b_))}var Lq={};fa(Lq,{decode:()=>sFt,encode:()=>uFt,name:()=>oFt});var y_="KHR_techniques_webgl",oFt=y_;async function sFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(y_);if(n){let i=cFt(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,y_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=lFt(a.technique,t)),t.removeObjectExtension(a,y_)}t.removeExtension(y_)}}async function uFt(e,t){}function cFt(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 lFt(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 h2e=[fq,uq,Dq,Fq,kq,Oq,Rq,jq,Lq,Pq,pq];function d2e(e,t={},r){var i;let n=h2e.filter(a=>g2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function m2e(e,t={},r){var i;let n=h2e.filter(a=>g2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function g2e(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 Mq="KHR_binary_glTF";function v2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Mq);i&&Object.assign(n,i),t.removeObjectExtension(n,Mq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Mq)}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"},qq=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),v2e(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 y2e(e,t={}){return new qq().normalize(e,t)}async function x2e(e,t,r=0,n,i){var a,o,s;return hFt(e,t,r,n),y2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),d2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await dFt(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await mFt(e,n,i),await m2e(e,n,i),e}function hFt(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!u2e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=HI(t);else if(t instanceof ArrayBuffer){let o={};r=c2e(o,t,r,n.glb),Ui(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ui(!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 dFt(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;Ui(u);let c=Tq(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 mFt(e,t,r){let n=gFt(e),i=e.json.images||[],a=[];for(let o of n)a.push(vFt(e,i[o],o,t,r));return await Promise.all(a)}function gFt(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 vFt(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Tq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=D_e(e.json,e.buffers,t.bufferView);a=Wh(s.buffer,s.byteOffset,s.byteLength)}Ui(a,"glTF image has no data");let o=await To(a,[Tv,Pd],{...n,mimeType:t.mimeType,basis:n.basis||{format:Pv()}},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 Pl={name:"glTF",id:"gltf",module:"gltf",version:W8,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:bFt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function bFt(e,t={},r){t={...Pl.options,...t},t.gltf={...Pl.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await x2e({},e,n,t,r)}var yFt=1179937895,xFt=1313821514,_Ft=5130562,Ec=!0;function _2e(e,t,r=0,n={}){let{magic:i=yFt,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,Ec),t.setUint32(r+4,a,Ec),t.setUint32(r+8,0,Ec));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,xFt,Ec)),r+=8;let f=JSON.stringify(o);if(r=Bm(t,r,f,4),t){let p=r-l-8;t.setUint32(l+0,p,Ec)}if(s){let p=r;if(t&&(t.setUint32(r+0,0,Ec),t.setUint32(r+4,_Ft,Ec)),r+=8,r=IA(t,r,s,4),t){let h=r-p-8;t.setUint32(p+0,h,Ec)}}if(t){let p=r-u;t.setUint32(c,p,Ec)}return r}function Nq(e,t,r,n){return wFt(e),_2e(e,t,r,n)}function wFt(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Uq={name:"glTF",id:"gltf",module:"gltf",version:W8,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,options:{gltf:{}},encode:async(e,t={})=>w2e(e,t),encodeSync:w2e};function w2e(e,t={}){let{byteOffset:r=0}=t,n=Nq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return Nq(e,a,r,t),i}var EFt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},AFt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},ys={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},SFt={magFilter:ys.TEXTURE_MAG_FILTER,minFilter:ys.TEXTURE_MIN_FILTER,wrapS:ys.TEXTURE_WRAP_S,wrapT:ys.TEXTURE_WRAP_T},TFt={[ys.TEXTURE_MAG_FILTER]:ys.LINEAR,[ys.TEXTURE_MIN_FILTER]:ys.NEAREST_MIPMAP_LINEAR,[ys.TEXTURE_WRAP_S]:ys.REPEAT,[ys.TEXTURE_WRAP_T]:ys.REPEAT};function CFt(){return{id:"default-sampler",parameters:TFt}}function DFt(e){return AFt[e]}function FFt(e){return EFt[e]}var Gq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ui(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=DFt(t.componentType),i=FFt(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}=Dv(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):CFt(),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 SFt[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 x_(e,t){return new Gq().postProcess(e,t)}var iD={URI:0,EMBEDDED:1};function aD(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=Wh(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 oD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(kFt(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 To(e.gltfArrayBuffer,Pl,r,n);e.gltf=x_(a),e.gpuMemoryUsageInBytes=l_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function kFt(e,t,r){switch(t){case iD.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 iD.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function E2e(e,t,r,n,i){var o;r=BFt(e,t,r,n,i),await oD(e,iD.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 BFt(e,t,r,n,i){r=Sp(e,t,r),r=Ev(e,t,r),r=Av(e,t,r,n),r=aD(e,t,r,n);let a=new Ol(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Ht.FLOAT,3),r}async function A2e(e,t,r,n,i){return r=OFt(e,t,r,n,i),await oD(e,e.gltfFormat||0,n,i),r}function OFt(e,t,r,n,i){var c;if(r=Sp(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Ev(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Av(e,t,r,n),r=aD(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 Ol(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 Od(e.batchTableJson,e.batchTableBinary,s);return IFt(e,o,u,s),r}function IFt(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 ds,f=new ce,p={},h=new Kr,d=[],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),p.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Ht.FLOAT,3,E,d),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,d),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,h),h.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),p.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,d);j&&f.scale(j),p.scale=f;let k=t.getProperty("BATCH_ID",Ht.UNSIGNED_SHORT,1,E,x);k===void 0&&(k=E);let N=new Kr().fromQuaternion(p.rotation);h.identity(),h.translate(p.translation),h.multiplyRight(N),h.scale(p.scale);let C=h.clone();i[E]={modelMatrix:C,batchId:k}}e.instances=i}async function S2e(e,t,r,n,i,a){r=Sp(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 T2e(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 To(t,Pl,r,n);e.gltf=x_(o),e.gpuMemoryUsageInBytes=l_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function zq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=$1e(e,t),i.type){case gs.COMPOSITE:return await S2e(i,e,t,r,n,zq);case gs.BATCHED_3D_MODEL:return await E2e(i,e,t,r,n);case gs.GLTF:return await T2e(i,e,r,n);case gs.INSTANCED_3D_MODEL:return await A2e(i,e,t,r,n);case gs.POINT_CLOUD:return await p_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Hq(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=C2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=C2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await sD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let p of c.contentAvailability)await sD(c,p,f,r);else await sD(c,c.contentAvailability,f,r);return await sD(c,c.childSubtreeAvailability,f,r),c}async function sD(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 C2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var uD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:yv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Hq,options:{}};function Wq(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 du(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Wq()}var PFt=globalThis.self||globalThis.window||globalThis.global,Lv=globalThis.window||globalThis.self||globalThis.global,RFt=globalThis.document||{},jd=globalThis.process||{},jFt=globalThis.console,$wr=globalThis.navigator||{};var cD="4.1.0-alpha.4",Xwr=du();function LFt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var lD=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=LFt(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 D2e(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 F2e(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 fD(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 pD;(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"})(pD||(pD={}));var MFt=10;function k2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),pD[e]||pD.WHITE)}function B2e(e,t,r){if(!du&&typeof e=="string"){if(t){let n=k2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=k2e(r);e="\x1B[".concat(n+MFt,"m").concat(e,"\x1B[49m")}}return e}function O2e(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 Mv(e,t){if(!e)throw new Error(t||"Assertion failed")}function Ld(){let e;if(du()&&Lv.performance){var t,r;e=Lv===null||Lv===void 0||(t=Lv.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in jd){var n;let i=jd===null||jd===void 0||(n=jd.hrtime)===null||n===void 0?void 0:n.call(jd);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var qv={debug:du()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},qFt={enabled:!0,level:0};function xs(){}var I2e={},P2e={once:!0},__=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=cD,this._startTs=Ld(),this._deltaTs=Ld(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new lD("__probe-".concat(this.id,"__"),qFt),this.timeStamp("".concat(this.id," started")),O2e(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((Ld()-this._startTs).toPrecision(10))}getDelta(){return Number((Ld()-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){Mv(t,r)}warn(t){return this._getLogFunction(0,t,qv.warn,arguments,P2e)}error(t){return this._getLogFunction(0,t,qv.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,qv.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,qv.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,qv.debug||qv.info,arguments,P2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||xs,n&&[n],{tag:zFt(r)}):xs}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?du()?GFt({image:i,message:a,scale:o}):UFt({image:i,message:a,scale:o}):xs}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||xs)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=R2e({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||xs)}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()>=j2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=R2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Mv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Ld();let o=a.tag||a.message;if(a.once&&o)if(!I2e[o])I2e[o]=Ld();else return xs;return r=NFt(this.id,a.message,a),n.bind(console,r,...a.args)}return xs}};__.VERSION=cD;function j2e(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 Mv(Number.isFinite(t)&&t>=0),t}function R2e(e){let{logLevel:t,message:r}=e;e.logLevel=j2e(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 Mv(i==="string"||i==="object"),Object.assign(e,{args:n},e.opts)}function NFt(e,t,r){if(typeof t=="string"){let n=r.time?F2e(D2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=B2e(t,r.color,r.background)}return t}function UFt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),xs}function GFt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=fD(a,r,n);console.log(...o)},a.src=t,xs}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...fD(t,r,n)),xs;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...fD(a,r,n)),a.src=t.toDataURL(),xs}return xs}function zFt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Vq=new __({id:"@probe.gl/log"});var _s=null;try{_s=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 Na(e){return(e&&e.__isLong__)===!0}function L2e(e){var t=Math.clz32(e&-e);return e?31-t:t}kn.isLong=Na;var M2e={},q2e={};function Md(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=M2e[e],n)?n:(r=$r(e,e<0?-1:0,!1),i&&(M2e[e]=r),r))}kn.fromInt=Md;function ws(e,t){if(isNaN(e))return t?Rl:mu;if(t){if(e<0)return Rl;if(e>=z2e)return V2e}else{if(e<=-U2e)return go;if(e+1>=U2e)return W2e}return e<0?ws(-e,t).neg():$r(e%Uv|0,e/Uv|0,t)}kn.fromNumber=ws;function $r(e,t,r){return new kn(e,t,r)}kn.fromBits=$r;var hD=Math.pow;function $q(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?Rl:mu;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 $q(e.substring(1),t,r).neg();for(var i=ws(hD(r,8)),a=mu,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=ws(hD(r,s));a=a.mul(c).add(ws(u))}else a=a.mul(i),a=a.add(ws(u))}return a.unsigned=t,a}kn.fromString=$q;function gu(e,t){return typeof e=="number"?ws(e,t):typeof e=="string"?$q(e,t):$r(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}kn.fromValue=gu;var N2e=1<<16,HFt=1<<24,Uv=N2e*N2e,z2e=Uv*Uv,U2e=z2e/2,G2e=Md(HFt),mu=Md(0);kn.ZERO=mu;var Rl=Md(0,!0);kn.UZERO=Rl;var Nv=Md(1);kn.ONE=Nv;var H2e=Md(1,!0);kn.UONE=H2e;var Kq=Md(-1);kn.NEG_ONE=Kq;var W2e=$r(-1,2147483647,!1);kn.MAX_VALUE=W2e;var V2e=$r(-1,-1,!0);kn.MAX_UNSIGNED_VALUE=V2e;var go=$r(0,-2147483648,!1);kn.MIN_VALUE=go;var Ke=kn.prototype;Ke.toInt=function(){return this.unsigned?this.low>>>0:this.low};Ke.toNumber=function(){return this.unsigned?(this.high>>>0)*Uv+(this.low>>>0):this.high*Uv+(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(go)){var r=ws(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=ws(hD(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(go)?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 Na(t)||(t=gu(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(Na(t)||(t=gu(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(go)?go:this.not().add(Nv)};Ke.neg=Ke.negate;Ke.add=function(t){Na(t)||(t=gu(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,p=0,h=0;return h+=a+c,p+=h>>>16,h&=65535,p+=i+u,f+=p>>>16,p&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,$r(p<<16|h,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Na(t)||(t=gu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Na(t)||(t=gu(t)),_s){var r=_s.mul(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Rl:mu;if(this.eq(go))return t.isOdd()?go:mu;if(t.eq(go))return this.isOdd()?go:mu;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(G2e)&&t.lt(G2e))return ws(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,p=0,h=0,d=0;return d+=o*l,h+=d>>>16,d&=65535,h+=a*l,p+=h>>>16,h&=65535,h+=o*c,p+=h>>>16,h&=65535,p+=i*l,f+=p>>>16,p&=65535,p+=a*c,f+=p>>>16,p&=65535,p+=o*u,f+=p>>>16,p&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,$r(h<<16|d,f<<16|p,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Na(t)||(t=gu(t)),t.isZero())throw Error("division by zero");if(_s){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?_s.div_u:_s.div_s)(this.low,this.high,t.low,t.high);return $r(r,_s.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Rl:mu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Rl;if(t.gt(this.shru(1)))return H2e;a=Rl}else{if(this.eq(go)){if(t.eq(Nv)||t.eq(Kq))return go;if(t.eq(go))return Nv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(mu)?t.isNegative()?Nv:Kq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(go))return this.unsigned?Rl:mu;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=mu}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:hD(2,s-48),c=ws(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=ws(n,this.unsigned),l=c.mul(t);c.isZero()&&(c=Nv),a=a.add(c),i=i.sub(l)}return a};Ke.div=Ke.divide;Ke.modulo=function(t){if(Na(t)||(t=gu(t)),_s){var r=(this.unsigned?_s.rem_u:_s.rem_s)(this.low,this.high,t.low,t.high);return $r(r,_s.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?L2e(this.low):L2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Na(t)||(t=gu(t)),$r(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Na(t)||(t=gu(t)),$r(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Na(t)||(t=gu(t)),$r(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Na(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 Na(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 Na(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 Na(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 Na(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 Gv=kn;var WFt=16;function w_(e){e==="X"&&(e="");let t=e.padEnd(WFt,"0");return Gv.fromString(t,!0,16)}function Yq(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 Jq(e,t){let r=VFt(e).shiftRightUnsigned(2);return e.add(Gv.fromNumber(2*t+1-4).multiply(r))}function VFt(e){return e.and(e.not().add(1))}var KFt=3,$Ft=30,YFt=2*$Ft+1,K2e=180/Math.PI;function Y2e(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);JFt(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 J2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<KFt+YFt;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),i=t.substring(3,r),a=i.length/2,o=Gv.fromString(n,!0,2).toString(10),s="";if(a!==0)for(s=Gv.fromString(i,!0,2).toString(4);s.length<a;)s="0"+s;return`${o}/${s}`}function Xq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function $2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Qq(e){return[$2e(e[0]),$2e(e[1])]}function Zq(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 eN([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*K2e,n*K2e]}function JFt(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 X2e(e){let t=Xq(e.ij,e.level,[.5,.5]),r=Qq(t),n=Zq(e.face,r);return eN(n)}var XFt=100;function tN(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(XFt*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],p=(f[0]-l[0])/a,h=(f[1]-l[1])/a;for(let d=0;d<a;d++){l[0]+=p,l[1]+=h;let b=Xq(r,n,l),g=Qq(b),x=Zq(t,g),E=eN(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 zv(e){let t=QFt(e);return Y2e(t)}function QFt(e){if(e.indexOf("/")>0)return e;let t=w_(e);return J2e(t)}function rN(e){let t=zv(e);return X2e(t)}function Z2e(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=zv(a),s=tN(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=Q2e(r)}else{let r=tN(e);t=Q2e(r)}return t}function Q2e(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 nN(e,t){let r=(t==null?void 0:t.minimumHeight)||0,n=(t==null?void 0:t.maximumHeight)||0,i=zv(e),a=Z2e(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 dD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=nN(t,r),i=rN(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=a_(n);return[...c.center,...c.halfAxes]}var ZFt=4,ekt=8,tkt={QUADTREE:ZFt,OCTREE:ekt};function rkt(e,t,r){if(e!=null&&e.box){let n=w_(e.s2VolumeInfo.token),i=Jq(n,t),a=Yq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,p=c.minimumHeight+l/2;c.minimumHeight=p-f,c.maximumHeight=p+f;break;default:break}return{box:dD(o),s2VolumeInfo:o}}}async function aN(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:p,subtreesUriTemplate:h,basePath:d}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Vq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${p} won't be loaded...`),b;let g=s+u.level;if(g>f)return b;let x=tkt[c],E=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**s-1)/(x-1),k=qd(r.mortonIndex,n,E),N=j+k,C=qd(r.x,S,1),I=qd(r.y,F,1),P=qd(r.z,D,1),U=!1;s>=l&&(U=iN(o.childSubtreeAvailability,k));let Y=qd(u.x,C,s),J=qd(u.y,I,s),re=qd(u.z,P,s);if(U){let Te=`${d}/${h}`,$e=mD(Te,g,Y,J,re);o=await An($e,uD,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(!iN(o.tileAvailability,N))return b;iN(o.contentAvailability,N)&&(b.contentUrl=mD(p,g,Y,J,re));let ye=s+1,he={mortonIndex:k,x:C,y:I,z:P};for(let Te=0;Te<x;Te++){let $e=rkt(i,Te,c),We=await aN({subtree:o,implicitOptions:t,loaderOptions:a,parentData:he,childIndex:Te,level:ye,globalData:{...u},s2VolumeBox:$e});if(We.contentUrl||We.children.length){let oe=g+1,ne=nkt(We,oe,{childTileX:C,childTileY:I,childTileZ:P},t,i);b.children.push(ne)}}return b}function iN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Vq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?okt(t,r.explicitBitstream):!1}function nkt(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,p=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),h=l/2**t,d=i!=null&&i.box?{box:i.box}:f,b=ikt(t,d,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:p},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:h,geometricError:h,transform:e.transform,boundingVolume:b}}function ikt(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,p=2**e,h=(u-o)/p,d=(c-s)/p,b=(f-l)/p,[g,x]=[o+h*n,o+h*(n+1)],[E,S]=[s+d*i,s+d*(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 qd(e,t,r){return(e<<r)+t}function mD(e,t,r,n,i){let a=akt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function akt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function okt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function sN(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 uN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function oN(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 tu.resolve(t,e)}function ewe(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=oN(a,t))}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:sN(e,r),refine:uN(e.refine)}}async function nwe(e,t,r){let n=null,i=rwe(e.root);i&&e.root?n=await twe(e.root,e,t,i,r):n=ewe(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=rwe(c),f;l?f=await twe(c,e,t,l,r):f=ewe(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function twe(e,t,r,n,i){var F,D,j;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=mD(c,0,0,0,0),f=oN(l,r),p=await An(f,uD,i),h=(F=e.content)==null?void 0:F.uri,d=h?oN(h,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:dD(x),s2VolumeInfo:x};e.boundingVolume=N}let E=e.boundingVolume,S={contentUrlTemplate:d,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:b,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:g,rootBoundingVolume:E,getTileType:sN,getRefine:uN};return await skt(e,r,p,S,i)}async function skt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await aN({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:sN(e,s),refine:uN(e.refine),content:u||e.content,children:a}}function rwe(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 Ac={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:ukt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function ukt(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?ckt(e,t,r):lkt(e,t,r)}async function ckt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=fkt(i),o=await nwe(n,a,t||{});return{...n,shape:"tileset3d",loader:Ac,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 lkt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await zq(e,0,t,r,n.content),n.content}function fkt(e){return tu.dirname(e)}var iwe="https://api.cesium.com/v1/assets";async function awe(e,t){if(!t){let a=await pkt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await hkt(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=iwe,r={Authorization:`Bearer ${e}`},n=await ko(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function hkt(e,t){Qt(e,t);let r={Authorization:`Bearer ${e}`},n=`${iwe}/${t}`,i=await ko(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await ko(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function dkt(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 awe(r,n)}var gD={...Ac,id:"cesium-ion",name:"Cesium Ion",preload:dkt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=gD,Ac.parse(e,t,r)),options:{"cesium-ion":{...Ac.options["3d-tiles"],accessToken:null}}};var hTe=Wt(YU(),1),PIt="4.1.0-alpha.4",JU={id:"zip",module:"zip",name:"Zip Archive",version:PIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:RIt};async function RIt(e,t={}){let r=[],n={};try{let i=new hTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=jIt(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 jIt(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 a2=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 LIt=new Uint8Array([80,75,5,6]),MIt=new Uint8Array([80,75,6,7]),qIt=new Uint8Array([80,75,6,6]),NIt=8n;var UIt=16n,GIt=8n,zIt=24n;var HIt=48n,dTe=async e=>{let t=await a2(e,LIt),r=BigInt(await e.getUint16(t+NIt)),n=BigInt(await e.getUint32(t+UIt)),i=t-20n,a=0n,o=await e.slice(i,i+4n);if(ec(o,MIt)){a=await e.getBigUint64(i+GIt);let s=await e.slice(a,a+4n);if(!ec(s,qIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(a+zIt),n=await e.getBigUint64(a+HIt)}else i=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:a,zip64EoCDLocatorOffset:i,zipEoCDOffset:t}}};var WIt=20n,VIt=24n,KIt=28n,$It=30n,YIt=32n,JIt=42n,XU=46n,s2=new Uint8Array([80,75,1,2]),o2=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,s2.buffer))return null;let n=BigInt(await t.getUint32(e+WIt)),i=BigInt(await t.getUint32(e+VIt)),a=await t.getUint16(e+$It),o=BigInt(await t.getUint16(e+YIt)),s=await t.getUint16(e+KIt),u=await t.slice(e+XU,e+XU+BigInt(s)),c=new TextDecoder().decode(u),l=e+XU+BigInt(s),f=await t.getUint32(e+JIt),p=BigInt(f),h=new DataView(await t.slice(l,l+BigInt(a))),d={uncompressedSize:i,compressedSize:n,localHeaderOffset:p,startDisk:o},b=XIt(d,h);return{...d,...b,extraFieldLength:a,fileNameLength:s,fileName:c,extraOffset:l}};async function*s4(e){let{cdStartOffset:t}=await dTe(e),r=await o2(t,e);for(;r;)yield r,r=await o2(r.extraOffset+BigInt(r.extraFieldLength),e)}var mTe=(...e)=>e[0]+e[1]*16,XIt=(e,t)=>{let r=QIt(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)=>mTe(c[u],c[u+1])===1&&mTe(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},QIt=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};var WSr=[{offset:0,size:4,default:new DataView(s2.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 ZIt=8n,ePt=18n,tPt=22n,rPt=26n,nPt=28n,u4=30n,QU=new Uint8Array([80,75,3,4]),e0=async(e,t)=>{let r=await t.slice(e,e+4n);if(!ec(r,QU))return null;let n=await t.getUint16(e+rPt),i=new TextDecoder().decode(await t.slice(e+u4,e+u4+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+nPt),o=e+u4+BigInt(n+a),s=await t.getUint16(e+ZIt),u=BigInt(await t.getUint32(e+ePt)),c=BigInt(await t.getUint32(e+tPt)),l=e+u4+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}};var YSr=[{offset:0,size:4,default:new DataView(QU.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"}];function ZU(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=iPt(e,n,16);r[a]=i}return r}function iPt(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}var mb=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 Vh(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var u2=class extends mb{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 t0=Wt(jU(),1),Vl=Wt(require("zlib"),1);var r0=class extends mb{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 Om(Vl.default.gzip)(t):await Om(Vl.default.deflate)(t);return fl(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 Om(Vl.default.gunzip)(t):await Om(Vl.default.inflate)(t);return fl(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?Vl.default.gzipSync(t):Vl.default.deflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?t0.default.deflateRaw:t0.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?Vl.default.gunzipSync(t):Vl.default.inflateSync(t);return fl(c)}let r=((s=this.options)==null?void 0:s.deflate)||{},n=new Uint8Array(t);return((u=this.options)!=null&&u.raw?t0.default.inflateRaw:t0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new t0.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 t0.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 aPt={0:async e=>e,8:async e=>await new r0({raw:!0}).decompress(e)},c2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!gn)this.fileProvider=new Px(t);else throw new Error("Cannot open file for random access in a WEB browser");else XI(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=s4(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 e0(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=aPt[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=s4(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 oPt={0:e=>new u2().decompress(e),8:e=>new r0({raw:!0}).decompress(e)},c4=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 Rx().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await e0(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=oPt[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var l2=class extends c2{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 c4(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 a2(t,s2),n=await o2(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await e0(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=ZU(o)}else this.hashTable=null}};function Mp(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 qp(e,t,r){e&&e.setUint32(t+8,r,!0)}function gTe(e,t,r,n,i){e={magic:Ep.COMPOSITE,tiles:[],...e};let a=r;r+=Mp(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 qp(t,a,r-a),r}function vTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Do(s.length,8),l=u?Do(u.length,8):0;e={magic:Ep.BATCHED_MODEL,...e};let f=r;r=Mp(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=Bm(t,r,s,8),a&&(r=Bm(t,r,u,8));let p=e.gltfEncoded;return p&&(r=Bx(t,r,p,p.byteLength)),qp(t,f,r-f),r}function bTe(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:Ep.INSTANCED_MODEL,...e};let f=r;return r=Mp(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+=km(t,r,c,l),r+=km(t,r,o,s),qp(t,f,r-f),r}var sPt={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function yTe(e,t,r,n){let{featureTableJson:i=sPt}=e,a=JSON.stringify(i);a=VI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:Ep.POINT_CLOUD,...e};let c=r;return r+=Mp(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+=km(t,r,a,o),r+=Bx(t,r,s,u),qp(t,c,r-c),r}function tG(e,t){let r=eG(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return eG(e,i,0,t),n}function eG(e,t,r,n){switch(Qt(typeof e.type=="string"),e.type){case gs.COMPOSITE:return gTe(e,t,r,n,eG);case gs.POINT_CLOUD:return yTe(e,t,r,n);case gs.BATCHED_3D_MODEL:return vTe(e,t,r,n);case gs.INSTANCED_3D_MODEL:return bTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var rG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>xTe(e,t),encodeSync:xTe};function xTe(e,t){return tG(e,t)}var Ga=require("path");var _Te=Wt(require("crypto")),f4=new Uint8Array(256),l4=f4.length;function nG(){return l4>f4.length-16&&(_Te.default.randomFillSync(f4),l4=0),f4.slice(l4,l4+=16)}var Aa=[];for(let e=0;e<256;++e)Aa.push((e+256).toString(16).slice(1));function wTe(e,t=0){return(Aa[e[t+0]]+Aa[e[t+1]]+Aa[e[t+2]]+Aa[e[t+3]]+"-"+Aa[e[t+4]]+Aa[e[t+5]]+"-"+Aa[e[t+6]]+Aa[e[t+7]]+"-"+Aa[e[t+8]]+Aa[e[t+9]]+"-"+Aa[e[t+10]]+Aa[e[t+11]]+Aa[e[t+12]]+Aa[e[t+13]]+Aa[e[t+14]]+Aa[e[t+15]]).toLowerCase()}var ETe=Wt(require("crypto")),iG={randomUUID:ETe.default.randomUUID};function uPt(e,t,r){if(iG.randomUUID&&!t&&!e)return iG.randomUUID();e=e||{};let n=e.random||(e.rng||nG)();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 wTe(n)}var Oc=uPt;var D0=Wt(require("process"),1),ok=Wt(wu(),1),YW=Wt(uG(),1);var Jb=require("path"),Eke=Wt(wu(),1);var PTe=()=>({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 $b=require("fs"),Yb=require("path");var yke=require("zlib"),xke=require("path"),cw=require("fs"),PVt=Wt(bke(),1);var RVt=Wt(YU(),1);var jVt=Wt(aG(),1);function YF(e){let t=`${e}.gz`,r=(0,yke.createGzip)(),n=(0,cw.createReadStream)(e),i=(0,cw.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 _ke(e,t,r,n,i){process.platform==="win32"?await MVt(e,t,r,n,i):await LVt(e,t,r,n)}async function LVt(e,t,r=0,n="."){let i=lw(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function MVt(e,t,r=0,n=(0,xke.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=lw(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function ki(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 $b.promises.mkdir(e,{recursive:!0});let i=(0,Yb.join)(e,r);try{await $b.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function qc(e,t,r="index.json",n=!0,i){let a=await ki(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await YF(a);return await RW(a),o}}return a}async function JF(e,t){return new Promise((r,n)=>{let i=0;console.log(`load ${e}/${t}.`);let a=setInterval(()=>{let o=(0,Yb.join)(e,t);An(o,YI).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function wke(e){try{return await $b.promises.stat(e),!0}catch{return!1}}function fw(e){return $b.promises.rm(e,{recursive:!0})}function RW(e){return $b.promises.unlink(e)}function lw(e){return(0,Yb.isAbsolute)(e)?e:(0,Yb.join)(process.cwd(),e)}var eo=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,Jb.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,Jb.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,Jb.join)(r,n);return await wke(i)?(console.log(`load ${i}.`),await JF(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),eo.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?eo.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,Eke.default)({nodeCount:this.nodesCounter},PTe()),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,Jb.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,Jb.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}),eo.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 pw=require("path"),XF=require("fs");function Xb(e){if(typeof e=="number"){let r=Math.floor(e/1e3),n=e-r*1e3;return Ake(r,n)}else{let r=e[0],n=e[1]/1e6;return Ake(r,n)}}function Ake(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 QF(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=lw(r);try{if(t){let s=(0,pw.join)(i,`${n}.slpk`);return(await XF.promises.stat(s)).size}let a=(0,pw.join)(i,n);return await Ske(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function Ske(e){let t=0,r=await XF.promises.readdir(e);for(let n of r){let i=await XF.promises.stat((0,pw.join)(e,n));i.isDirectory()?t+=await Ske((0,pw.join)(e,n)):t+=i.size}return t}var zke=Wt(uG(),1);var C0=3,Qb=9;function Cke(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Qb;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=qVt(o),c=NVt({...u,...e}),l=UVt(c);return GVt(l,u.featureCount)}function qVt(e){let t=1,r=1,n=Tke(e.slice(0,C0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=C0;c<e.length;c+=C0){let l=Tke(e.slice(c,c+C0));n!==l&&(i[t]=c/C0-1,i[t+1]=c/C0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/C0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function Tke(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 NVt(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),p=new Float32Array(o),h=new Uint16Array(a),d=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=hw("positions",F,D),k=hw("normals",F,D),N=hw("colors",F,D),C=hw("uvRegions",F,D),I=hw("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(d,d+j),normals:l.subarray(b,b+k),colors:f.subarray(g,g+N),uvRegions:h.subarray(x,x+C),texCoords:p.subarray(E,E+I)}),d+=j,b+=k,g+=N,x+=C,E+=I}return u}function hw(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Qb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function UVt(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=Dke(n.attributes);r.push({featureId:n.featureId,...i})}return r}function GVt(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/Qb-1+o),i.push(f.positions.length/Qb+o),o+=f.positions.length/Qb,a+=1}let s=Dke(e);return i.push(s.positions.length/Qb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function Dke(e){let t=e.map(({positions:f})=>f),r=t.length>1?Co(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?Co(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?Co(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?Co(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?Co(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function jW(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 sa?(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 ds().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 Fke(e,t){let r=zVt(e),n=a_(r),i=U7(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 zVt(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 kke(e){let t;e instanceof Ja?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 LW(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 sa(r,n)}function Bke(e,t,r){var s,u,c,l,f,p,h,d;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)||((p=e.gltf)==null?void 0:p.nodes)||[],i=((d=(h=e.gltf)==null?void 0:h.images)==null?void 0:d.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}}}))||[];Oke(n);let{cartographicOrigin:a,modelMatrix:o}=WVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function HVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function WVt(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 Oke(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:HVt(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&&Oke(n.children)}}function Ike(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[vs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function Pke(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 vs:return KVt(e,o,r,n);case H8:return VVt(e,o);default:return[]}return[]}function VVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function KVt(e,t,r,n){var o,s,u,c,l,f,p;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 h=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return $Vt(h,i.featureIds.constant,i.featureIds.divisor)}let a=(t==null?void 0:t.featureIdTextures)&&(t==null?void 0:t.featureIdTextures[0]);if(a){let d=`TEXCOORD_${((p=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:p.texCoord)||0}`,b=e[d].value;return YVt(a,b,r)}return n?e[n].value:[]}function $Vt(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 YVt(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 p=0;p<t.length;p+=2){let h=t[p],d=t[p+1],b=Math.min(O8(h)*o.width|0,o.width-1),x=(Math.min(O8(d)*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 Rke(e,t){let r={};for(let n in t){let i=t[n];r[n]=JVt(i,e)}return r}function JVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function jke(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}function XVt(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 Lke(e){let t={};for(let r in e){let n=e[r][0],i=XVt(n);t[r]=i}return t}var Mke=(e,t)=>{var a,o,s,u,c,l,f,p;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[vs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let h in n.properties){let d=n.properties[h],b=QVt(d);r[h]=b}return r}let i=(p=(f=(l=(c=e.extensions)==null?void 0:c[Il])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:p[t];if(i){for(let h in i.properties){let d=i.properties[h],b=ZVt(d);r[h]=b}return r}return null},QVt=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},ZVt=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 ZF=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var eKt=1,tKt=1,Au=3,dw=2,rKt=4,nKt="string",iKt="Int32",aKt="Float64",oKt="Oid32",qke=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],yh=new ce;async function MW(e,t,r,n,i,a,o,s,u,c,l,f,p){var S;let h=u,d=await _Kt((S=e.gltf)==null?void 0:S.materials,c),b=Bke(e,t,r),g=Ike(e,p),x=await cKt(b,d,h,g);u&&sKt(x,l);let E=[];for(let F of d){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 uKt({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 sKt(e,t){for(let r of e.values()){let n=Fke(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=Au){let o=r.positions.subarray(a,a+Au);or.WGS84.cartesianToCartographic(Array.from(o),yh),yh[2]=yh[2]-t.getHeight(yh[1],yh[0]),yh=yh.subtract(i),r.positions.set(yh,a)}}}async function uKt({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/Au,{faceRange:p,featureIds:h,positions:d,normals:b,colors:g,uvRegions:x,texCoords:E,featureCount:S}=Cke(e),F={};o&&(F=OKt(h,e.featureIndices,a,o));let D=new Uint32Array(2),j=UKt(h);D.set([f,S],0);let k=new Uint8Array(tc(D.buffer,d.buffer,b.buffer,r?E.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,p.buffer)),N=u?GKt(f,e,{positions:d,normals:b,texCoords:r?E:new Float32Array(0),colors:g,uvRegions:x,featureIds:h,faceRange:p},c):null,C=[];return s&&o&&(C=jKt(h,F,o,s)),{nodeId:i,geometry:k,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:CKt(((I=n.gltf)==null?void 0:I.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function cKt(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)}Hke(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,p)=>f.concat(p)),delete l.featureIndicesGroups)}}return u}function Hke(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)fKt(u,t,r,n,i,a,o,s)}function lKt(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 fKt(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=lKt(e,o),c=e.mesh;c&&pKt(c,t,r,n,i,a,u,s),Hke(e.children||[],t,r,n,i,a,u,s)}function pKt(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:d})=>{var b;return d===((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 p=c.attributes;if(!l)continue;let h=hKt(c);l.positions=Co(l.positions,Nke({vertices:p.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:dKt,useCartesianPositions:a})),l.normals=Co(l.normals,Nke({vertices:p.NORMAL&&p.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:mKt,useCartesianPositions:!1})),l.texCoords=Co(l.texCoords,gKt(p.TEXCOORD_0&&p.TEXCOORD_0.value,h)),l.colors=Co(l.colors,vKt(p.COLOR_0,h)),f&&(l.uvRegions=Co(l.uvRegions,bKt(f,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(yKt(xKt(p,c,t,s),h))}}function hKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return ZF(n.length/Au)}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 Nke(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*Au);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*Au,s=t.subarray(o,o+Au),u=new ce(Array.from(s));u=n(u,e),i[a*Au]=u.x,i[a*Au+1]=u.y,i[a*Au+2]=u.z}return i}function dKt(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 mKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function gKt(e,t){let r=new Float32Array(t.length*dw);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*dw,a=e.subarray(i,i+dw);r[n*dw]=a[0],r[n*dw+1]=a[1]}return r}function vKt(e,t){let r=(e==null?void 0:e.components)||rKt,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 bKt(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 xKt(e,t,r,n){let i=Pke(e,t,r,n);if(i.length)return i;for(let a=0;a<qke.length;a++){let o=qke[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function _Kt(e=[],t){let r=[];for(let n of e)r.push(AKt(n));return t&&(r=await wKt(r)),r}async function wKt(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 EKt(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:TKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function EKt(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 AKt(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:SKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||eKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||tKt}},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:Oc();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 SKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function TKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function CKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=DKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function DKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=kKt(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:FKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function FKt(e,t=1){let r=.00015686274509803922,n=new hs(0,0,0,1),i=new hs(1,1,1,1),a=new hs(r,r,r,0),o=new hs(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 kKt(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:BKt(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 BKt(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,p=n-1<<0,h=c+l+f+p;return BigInt(`0b${h.toString(2)}${u}`).toString()}function OKt(e,t,r,n){let i=IKt(e,n,r);return Uke(t,i),Uke(e,i),i}function IKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=RKt(i,t,r);n[a.toString()]=o}return n}function PKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function RKt(e,t,r){let n=PKt(t,e),i=(0,zke.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function Uke(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function jKt(e,t,r,n){let i=[],o=jke(e,r)?Rke(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=MKt(u,n);if(c){let l=s[u],f=LKt(c,l);i.push(f)}}return i}function LKt(e,t){let r;switch(e){case oKt:case iKt:r=qKt(t);break;case aKt:r=NKt(t);break;case nKt:r=Gke(t);break;default:r=Gke(t)}return r}function MKt(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 qKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return tc(t.buffer,r.buffer)}function NKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return tc(t.buffer,r.buffer,n.buffer)}function Gke(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 tc(t.buffer,a.buffer,n.buffer,...i)}function UKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function GKt(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 p=new Uint32Array(t.featureIndices.length?t.featureIndices:e),h=zKt(p,l),d={positions:i,normals:a,colors:s,"feature-index":h};o.length&&(d.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(d["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),pv({attributes:d,indices:f},K7,{...K7.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 zKt(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)*Au;r.fill(n,i,o),n++,i=o+1}return r}function Wke(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=VKt(e);switch(i){case Il:return r=HKt(a,t),r;case vs:return r=WKt(a,t),r;default:return null}}function HKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return ek(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return ek(r)}return null}function WKt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return ek(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return ek(n)}return null}function ek(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function VKt(e){var a,o,s,u;let t=[vs,Il];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 Kke=Wt(wu(),1),$ke=require("path");var Vke=()=>({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 Yke(e,t,r){let n={serviceItemId:Oc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,Kke.default)(n,Vke()),a=(0,$ke.join)(r,"SceneServer");await ki(a,JSON.stringify(i))}var qW=16;function Jke(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*qW/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 NW(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=qW),e.mbs[3]*2*qW/r}var KKt=240,$Kt=[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],YKt=372,JKt=[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],XKt=372,QKt=[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],ZKt=12,UW=(3+1)*(3+2)/2,e$t=2,Zb=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=t$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,p=new Array(UW);if(o===this._ix&&s===this._iy)this.options.cubic?p=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 d=[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=JKt;s!==0&&(b=s===this.options._height-2?QKt:$Kt);let g=YKt;s!==0&&(g=s===this.options._height-2?XKt:KKt);for(let x=0;x<UW;++x){p[x]=0;for(let E=0;E<ZKt;++E)p[x]+=d[E]*b[UW*E+x];p[x]/=g}}if(!this.options.cubic){let d=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*d+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 h=p[0]+i*(p[1]+i*(p[3]+i*p[6]))+a*(p[2]+i*(p[4]+i*p[7])+a*(p[5]+i*p[8]+a*p[9]));return h=this.options._offset+this.options._scale*h,this._ix=o,this._iy=s,this._t=p,h}_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+e$t*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function t$t(e,t){t=Math.abs(t);let r=Xke(e,t);return 2*Math.abs(r)===t?r-=Xke(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function Xke(e,t){return e-Math.floor(e/t)*t}var r$t=10,n$t=65535;function GW(e,t){let r=i$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,p=null,h=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 d=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(d!==n$t)throw new Error("Geoid model file: Incorrect value of maxval");if(p=n.value.offset,h=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 Zb({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:h,_datastart:p,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*i$t(e){let t=0;do{let r=e.indexOf(r$t,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:Qke(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:Qke(n)}}}while(t<e.length);return{offset:t,line:""}}function Qke(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var a$t="4.1.0-alpha.4";var tk={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:a$t,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>GW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var ey=Wt(wu(),1);var Zke={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 o$t=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),s$t=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),u$t=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),c$t=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),eBe=()=>({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,ey.default)(e,o$t())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,ey.default)(e,Zke)},fullExtent:{path:"fullExtent",transform:e=>(0,ey.default)(e,c$t())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,ey.default)(e,s$t())},nodePages:{path:"nodePages",transform:e=>(0,ey.default)(e,u$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(wu(),1),l$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}}}),f$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}}}),tBe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,zW.default)(e,l$t())];return e.draco&&t.push((0,zW.default)({geometryConfig:e},f$t())),t}}});var mw=Wt(wu(),1),p$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}}),h$t=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,mw.default)(r,p$t())}}),d$t=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),m$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,mw.default)(n,d$t()))}}),rBe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:g$t},textureDefinitions:{path:"textureDefinitionInfos",transform:v$t}});function g$t(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,mw.default)(a,h$t());return n}function v$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,mw.default)(a,m$t())}return n}var b$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 iBe(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),x$t(t,e),t}function y$t(e,t){var o;let r=_$t(t.parentNode.obb),n=w$t(t);if(E$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 x$t(e,t){var a;let r=nBe(t.mbs),n=nBe(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 nBe(e){return new Ja([e[0],e[1],e[2]],e[3])}function _$t(e){let{center:t,halfSize:r,quaternion:n}=e;return new sa().fromCenterHalfSizeQuaternion(t,r,n)}function w$t(e){let t=e.obb.halfSize,r=b$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 E$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 rk=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var aBe=Wt(require("process"),1),A$t=4*1024*1024*1024,ty=class extends rk{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),aBe.default.memoryUsage().rss>A$t&&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 ry="Tile converter does not work in browser, only in node js environment";var WW=require("path"),VW=Wt(wu(),1);var oBe=Wt(wu(),1),sBe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),S$t=()=>({href:{path:"href"}}),T$t=()=>({id:{path:"id"},...S$t(),...sBe()}),HW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...sBe(),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,oBe.default)(e,T$t()),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 Su=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,WW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>qc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>ki(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,WW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await JF(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Su.createRootNodeIndexDocument(t);return await new Su(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Su.createNodeIndexDocument(t,r,n,i,a);return await new Su(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Oc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,VW.default)(r,HW())}static async createNodeIndexDocument(t,r,n,i,a){var p,h;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,VW.default)(l,HW());if(i.mesh&&(f.geometryData=[{href:"./geometries/0"}],f.sharedResource={href:"./shared"},o&&(f.textureData=[{href:"./textures/0"},{href:"./textures/1"}]),s&&s.length&&((h=(p=t.converter.layers0)==null?void 0:p.attributeStorageInfo)!=null&&h.length))){f.attributeData=[];let d=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<d;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var KW=async(e,t,r)=>{let n=gw(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await nk(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},$W=async(e,t,r)=>{let n=gw(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 nk(t.contentUrl,e.loader,i)};async function nk(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 l2(a),s=await An(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await An(e,t,r)}function gw(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var ik=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 ik(u,s,r,n,i,a+1);n&&await n(o,t)};var C$t=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],uBe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Bo(e.gltfArrayBuffer,Pl,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=D$t(n),a=F$t(n);return{meshTopologyTypes:i,metadataClasses:a}},D$t=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(C$t[i])}return t},F$t=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[vs])==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[Il])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},cBe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var lBe=Wt(require("process"),1);var k$t=.2,ak=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||lBe.default.hrtime.bigint,this.threshold=t.threshold||k$t}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?Xb(t.timeRemaining):""}isVelocityTrust(t,r){return r?Math.abs((t-r)/r)<this.threshold:!1}getCurrentTimeInMilliSeconds(){return Number(this.getTime()/BigInt(1e6))}};var pBe,B$t=(pBe=D0.default.env)==null?void 0:pBe.IonToken,fBe=64,O$t="3DTILES",I$t="3DObject",P$t=1800,R$t="https://",xh="phase1-count",ny=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=Ac;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ty;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};progresses={};constructor(){this.attributeMetadataInfo=new QC,this.nodePages=new eo(ki,fBe,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(ry),ry;this.conversionStartTime=D0.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:p,generateBoundingVolumes:h,instantNodeWriting:d=!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:d,mergeMaterials:b,inquirer:g,metadataClass:x},this.progresses[xh]=new ak,this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(R$t)!==-1?gD:Ac,this.generateTextures=Boolean(p),this.generateBoundingVolumes=Boolean(h),this.writeQueue=new ty,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await An(i,tk),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(qc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await nk(F,this.Loader,this.loadOptions),(this.Loader===Ac||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(),La.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await ik(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[xh].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(gw(t))return await KW(this.sourceTileset,t,this.loadOptions),null;t.id&&(this.progresses[xh].stepsTotal+=1,console.log(`[analyze]: ${t.id}`));let i=null;try{i=await $W(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 uBe(i);return cBe(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,Ga.join)(`${t}`,`${r}`);try{await fw(n)}catch{}this.layers0Path=(0,Ga.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=k8(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=jW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]}),this.progresses[xh].startMonitoring();let s=await Su.createRootNode(o,this);await ik(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.progresses[xh].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=I$t),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,ok.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),tBe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),Yke(r,this.layers0,n);for(let f of this.compressList||[])await YF(f),await RW(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=kke(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Oc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Oc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:fBe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,ok.default)(o,eBe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>qc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>ki(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Ga.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await _ke(r,n,0,".",this.options.sevenZipExe);try{await fw(t)}catch{}}}async convertTile(t,r){let n=gw(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await KW(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[xh].stepsDone+=1;let l="Calculating time left...",f=this.progresses[xh].getTimeRemainingString();f&&(l=`${f} left`);let p=this.progresses[xh].getPercentString();console.log(`[converted ${p}%, ${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 $W(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=k8(r.boundingVolume,n,null),o=jW(a,this.geoidHeightModel),s=Wke(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],p={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let h of u||[p]){this.layersHasTexture=this.layersHasTexture||Boolean(h.texture),this.generateBoundingVolumes&&h.boundingVolumes&&(o=h.boundingVolumes);let d=Jke(r,o),b=d.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,h),x=await Su.createNodeIndexDocument(t,o,d,g,h),E=await new Su(g.index,this).addData(x);c.push(E),g.mesh&&await this._writeResources(h,E.id),this.validate&&(this.boundingVolumeWarnings=iBe(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 MW(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,p={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(p.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let h=a.nodeId,d;if(h?d=await this.nodePages.getNodeById(h):d=await this.nodePages.push(p,i),p.mesh||console.log(`[warning]: node ${d.index} is created with empty content`),eo.updateAll(d,p),o&&eo.updateMaterialByNodeId(d,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;eo.updateTexelCountHintByNodeId(d,b)}return u&&(this.vertexCounter+=u,eo.updateVertexCountByNodeId(d,u)),eo.updateNodeAttributeByNodeId(d),c&&eo.updateFeatureCountByNodeId(d,c),this.nodePages.saveNode(d),d}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Ga.join)(this.layers0Path,"nodes",r),c=(0,Ga.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,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>qc(a,t,"0.bin")})}else{let a=(0,Ga.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>ki(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Ga.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>qc(a,r,"1.bin")})}else{let a=(0,Ga.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>ki(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,ok.default)(t,rBe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Ga.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>qc(s,o,"sharedResource.json")})}else{let s=(0,Ga.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>ki(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=pv({...t.image,data:u},wq,{...wq.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=pv(t.image.data[0],aq);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,Ga.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>qc(o,t,`${r}.${n}`,s)})}else{let o=(0,Ga.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>ki(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,Ga.join)(r,"attributes",o);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${o}.bin.gz`,writePromise:()=>qc(u,s,"0.bin")})}else{let u=(0,Ga.join)(r,`attributes/${o}/0`);await this.writeQueue.enqueue({writePromise:()=>ki(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,YW.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,YW.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=Mke(t.gltf,this.options.metadataClass)):r&&(n=Lke(r)),n&&this.attributeMetadataInfo.addMetadataInfo(n)}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await QF(t),o=D0.default.hrtime(this.conversionStartTime),s=Xb(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${O$t}`),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||B$t}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=D0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(D0.default.hrtime(this.refreshTokenTime)[0]<P$t)return;this.refreshTokenTime=D0.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 RBe=require("path"),eV=Wt(require("process"),1),jBe=Wt(wu(),1);function JW(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 hBe={UInt8:Ht.UNSIGNED_BYTE,UInt16:Ht.UNSIGNED_SHORT,Float32:Ht.FLOAT,UInt32:Ht.UNSIGNED_INT,UInt64:Ht.DOUBLE};function iy(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 dBe="String",mBe="Oid32",gBe="Float64",vBe="Int16";function sk(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function ay(e,t=null){return t?`${e}?token=${t}`:e}function bBe(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 yBe(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 uk=new ce([0,0,0]);function L$t(e){switch(e){case"ktx-etc2":case"dds":return Z8;case"ktx2":return Pd;case"jpg":case"png":default:return Tv}}var M$t="i3s-attribute-type";async function EBe(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=ay(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=L$t(t.textureFormat),f=await(await((i==null?void 0:i.fetch)||fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Tv){let p={...t.textureLoaderOptions,image:{type:"data"}};try{let h=await To(f,[],p,i);a.texture=h}catch{let d=await Bo(f,u,p,i);a.texture=d}}else if(u===Z8||u===Pd){let p=await An(f,u,t.textureLoaderOptions);u===Pd&&(p=p[0]),a.texture={compressed:!0,mipmaps:!1,width:p[0].width,height:p[0].height,data:p}}}else a.texture=f}return a.material=K$t(t.materialDefinition,a.texture),a.material&&(a.texture=null),await q$t(e,a,t,r,n)}async function q$t(e,t,r,n,i){var f,p;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let h=await Bo(e,xv,{draco:{attributeNameEntry:M$t}});s=h.header.vertexCount,l=(f=h.indices)==null?void 0:f.value;let{POSITION:d,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:E,["uv-region"]:S}=h.attributes;o={position:d,normal:b,color:g,uv0:x,uvRegion:S,id:E},N$t(o,h);let F=X$t(E);F&&J$t(o,F)}else{let{vertexAttributes:h,ordering:d,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=G$t(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:E,byteOffset:S}=_Be(e,u,h,s,d),{attributes:F}=_Be(e,S,b,c,g);Y$t(F),o=U$t(E,F)}if(!((p=i==null?void 0:i.i3s)!=null&&p.coordinateSystem)||i.i3s.coordinateSystem===2){let h=H$t(o.position,r);t.modelMatrix=h.invert(),t.coordinateSystem=2}else t.modelMatrix=V$t(o.position),t.coordinateSystem=3;t.attributes={positions:o.position,normals:o.normal,colors:xBe(o.color),texCoords:o.uv0,uvRegions:xBe(o.uvRegion||o.region)},t.indices=l||null,o.id&&o.id.value&&(t.featureIds=o.id.value);for(let h in t.attributes)t.attributes[h]||delete t.attributes[h];return t.vertexCount=s,t.byteLength=a,t}function N$t(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 U$t(e,t){return{...e,...t}}function xBe(e){return e&&(e.normalized=!0,e)}function G$t(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=JW(o);switch(a){case"vertexCount":n=new s(e,0,4)[0],r+=iy(o);break;case"featureCount":i=new s(e,4,4)[0],r+=iy(o);break;default:break}}return{vertexCount:n,featureCount:i,byteOffset:r}}function _Be(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*iy(s)<=e.byteLength){let c=e.slice(t),l;if(s==="UInt64")l=z$t(c,n*u,iy(s));else{let f=JW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:hBe[s],size:u},o){case"color":a.color.normalized=!0;break;case"position":case"region":case"normal":default:}t=t+n*u*iy(s)}else if(o!=="uv0")break}return{attributes:a,byteOffset:t}}function z$t(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 H$t(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=W$t(n,i,o),a}function W$t(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),uk),n[o]=uk.x,n[o+1]=uk.y,n[o+2]=uk.z;return n}function V$t(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 K$t(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=wBe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=wBe(r.pbrMetallicRoughness.baseColorFactor)),t&&$$t(r,t),r}function wBe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function $$t(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 Y$t(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],p=i[c-1],h=f-p+1,d=u+h*3;o.fill(l,u,d),s++,u=d}e.id.value=o}function J$t(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 X$t(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 Q$t="4.1.0-alpha.4",ABe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:Q$t,mimeTypes:["application/octet-stream"],parse:Z$t,extensions:["bin"],options:{"i3s-content":{}}};async function Z$t(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 EBe(e,s,u,t,r)}var eYt="4.1.0-alpha.4",SBe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:eYt,mimeTypes:["application/json"],parse:tYt,extensions:["json"],options:{i3s:{}}};async function tYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var vw=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=ay(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:An(a,SBe,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 h of r.children||[])i.push(this.getNodeById(h));let a=await Promise.all(i);for(let h of a)n.push({id:h.index.toString(),obb:h.obb});let o,s,u,c="jpg",l=[],f=!1;if(r&&r.mesh){let{url:h,isDracoGeometry:d}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=h,f=d;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=yBe(this.tileset,this.url,r.mesh.attribute.resource))}let p=this.getLodSelection(r);return XW({id:t.toString(),lodSelection:p,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:Pv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=p_();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 TBe(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=bBe(r,e));let o=e.children||[];return XW({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function XW(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 sa().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 CBe(e,t,r){let n=sk(r.url||""),i,a;if(e.nodePages)i=new vw(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=ay(`${n}/nodes/root`,o.token);a=await An(s,ef,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:ef,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var rYt="4.1.0-alpha.4",nYt=/layers\/[0-9]+$/,iYt=/nodes\/([0-9-]+|root)$/,aYt="504b0304",oYt="PointCloud",ef={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:rYt,mimeTypes:["application/octet-stream"],parse:sYt,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 sYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},fYt(e)===aYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=sk(n),o;t.i3s.isTileset==="auto"?o=nYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=iYt.test(a):s=t.i3s.isTileHeader,o?e=await cYt(e,t,r):s?e=await lYt(e,r):e=await uYt(e,t),e}async function uYt(e,t){return await Bo(e,ABe,t)}async function cYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===oYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await CBe(n,t,r)}async function lYt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),TBe(e,t)}function fYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function FBe(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?pYt(n,e):null}:{}}function pYt(e,t){switch(e){case dBe:return mYt(t);case mBe:return DBe(t);case gBe:return dYt(t);case vBe:return hYt(t);default:return DBe(t)}}function DBe(e){return new Uint32Array(e,4)}function hYt(e){return new Int16Array(e,4)}function dYt(e){return new Float64Array(e,8)}function mYt(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 gYt="4.1.0-alpha.4";var QW={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:gYt,mimeTypes:["application/binary"],parse:async(e,t)=>FBe(e,t),extensions:["bin"],options:{},binary:!0};function ZW(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 sa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var ck=Wt(wu(),1),vYt=()=>({version:{path:"version",default:"1.0"}}),kBe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,ck.default)(t,kBe()))}}),BBe=()=>({asset:{path:"asset",transform:e=>(0,ck.default)(e,vYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,ck.default)(e,kBe())}});function OBe(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=bYt([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 bYt(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 xYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),IBe=new ce,bw=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return u8({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},rG)}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),p=this._convertI3sMaterialToGLTFMaterial(o,f),h=l.addMaterial(p),d=s.positions,b=d.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=OBe(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||ZF(b.length/d.size),S=l.addMesh({attributes:s,indices:E,material:h,mode:4}),F=this._generateTransformMatrix(g),D=l.addNode({meshIndex:S,matrix:F}),j=l.addScene({nodeIndices:[D]});return l.setDefaultScene(j),l.createBinaryChunk(),u8(l.gltf,Uq)}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,IBe),c=IBe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(xYt)}_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 PBe=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,ef,n)};var _Yt="I3S",oy=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(ry),ry;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=eV.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await An(o,tk),console.log("Loading egm file completed!"),this.sourceTileset=await An(r,ef,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=LW(s.mbs)),this.tilesetPath=(0,RBe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await fw(this.tilesetPath)}catch{}let u={boundingVolume:{box:ZW(s.obb,this.geoidHeightModel)},geometricError:NW(s),children:[]};await this._addChildren(s,u,1);let c=(0,jBe.default)({root:u},BBe());await ki(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),La.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await PBe(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=LW(a.mbs));let u={box:ZW(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:NW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},p=await new bw().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await ki(this.tilesetPath,new Uint8Array(p),`${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,ef,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,QW,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 QF(t),n=eV.default.hrtime(this.conversionStartTime),i=Xb(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${_Yt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var lk=require("path");var wYt="4.1.0-alpha.4",EYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",fk=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await An(EYt,JU,{}),n=process.cwd();t&&(n=(0,lk.join)(n,t)),await ki(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(Ap[ai.DECODER],"draco",ai.DECODER),await this.installFromUrl(Ap[ai.DECODER_WASM],"draco",ai.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(Ap[ai.ENCODER],"draco",ai.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",wc.TRANSCODER,"libs"),await this.installFromNpm("textures",wc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",wc.ENCODER,"libs"),await this.installFromNpm("textures",wc.ENCODER_WASM,"libs"),console.log('Installing "join-images" npm package'),await new ll().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 ko(`https://unpkg.com/@loaders.gl/${t}@${wYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,lk.join)(process.cwd(),"modules",t,"dist",n);await ki(o,a,r)}async installFromUrl(t,r,n){let a=await(await ko(t)).arrayBuffer();if(!a)return;let o=(0,lk.join)(process.cwd(),"modules",r,"dist","libs");await ki(o,a,n)}};function Tu(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function LBe(e,t){let r=Tu(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function MBe(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 qBe(e,t){let r=Tu(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Tu(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var tV={I3S:"I3S",_3DTILES:"3DTILES"};async function AYt(){let[,,...e]=process.argv;e.length===0&&rV();let t=MBe(e),r=CYt(t);if(r.installDependencies){new fk().install("deps");return}let n=TYt(r);await SYt(n)}AYt().catch(e=>{console.log(e),process.exit(1)});function rV(){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 SYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case tV.I3S:new oy().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case tV._3DTILES:await new ny().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:UBe.default});break;default:rV()}}function TYt(e){let t={name:{getMessage:()=>console.log("Missed: --name [Tileset name]"),condition:n=>Boolean(n)||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:n=>Boolean(n)&&Object.values(tV).includes(n.toUpperCase())}},r=[];for(let n in t){let i=e[n],a=t[n].condition;(a?a(i):i)||r.push(t[n].getMessage)}return r.length&&(r.forEach(n=>n()),process.exit(1)),e}function CYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,NBe.join)(process.cwd(),"deps","egm2008-5.pgm"),draco:!0,installDependencies:!1,generateTextures:!1,generateBoundingVolumes:!1,validate:!1,slpk:!1};return e.forEach((r,n)=>{if(r.indexOf("--")===0)switch(r){case"--input-type":t.inputType=Tu(n,e);break;case"--tileset":t.tileset=LBe(n,e);break;case"--name":t.name=Tu(n,e);break;case"--output":t.output=Tu(n,e);break;case"--instant-node-writing":t.instantNodeWriting=Nc(n,e);break;case"--split-nodes":t.mergeMaterials=Nc(n,e);break;case"--max-depth":t.maxDepth=qBe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Tu(n,e);break;case"--egm":t.egm=Tu(n,e);break;case"--token":t.token=Tu(n,e);break;case"--no-draco":t.draco=Nc(n,e);break;case"--validate":t.validate=Nc(n,e);break;case"--install-dependencies":t.installDependencies=Nc(n,e);break;case"--generate-textures":t.generateTextures=Nc(n,e);break;case"--generate-bounding-volumes":t.generateBoundingVolumes=Nc(n,e);break;case"--analyze":t.analyze=Nc(n,e);break;case"--metadata-class":t.metadataClass=Tu(n,e);break;case"--help":rV();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
|
|
180
180
|
/*! Bundled license information:
|
|
181
181
|
|
|
182
182
|
is-buffer/index.js:
|