@loaders.gl/tile-converter 4.0.0-beta.5 → 4.0.0-beta.6

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.
@@ -170,13 +170,13 @@ See: https://github.com/isaacs/node-glob/issues/167`);return new Gi(e,t).found}f
170
170
  See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Gi))return new Gi(e,t);if(VMt(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()}Gi.prototype._finish=function(){if(P3e.ok(this instanceof Gi),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=WMt.realpathSync(i,e.realpathCache);n[a]=!0}catch(o){if(o.syscall==="stat")n[e._makeAbs(i)]=!0;else throw o}})}o0.finish(this)};Gi.prototype._process=function(e,t,r){P3e.ok(this instanceof Gi);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=".":((kF(i)||kF(e.map(function(c){return typeof c=="string"?c:"[*]"}).join("/")))&&(!i||!kF(i))&&(i="/"+i),o=i);var s=this._makeAbs(o);if(!KMt(this,o)){var u=a[0]===I3e.GLOBSTAR;u?this._processGlobStar(i,o,s,a,t,r):this._processReaddir(i,o,s,a,t,r)}};Gi.prototype._processReaddir=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){for(var s=n[0],u=!!this.minimatch.negate,c=s._glob,l=this.dot||c.charAt(0)===".",f=[],d=0;d<o.length;d++){var h=o[d];if(h.charAt(0)!=="."||l){var p;u&&!e?p=!h.match(s):p=h.match(s),p&&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 d=0;d<b;d++){var h=f[d];e&&(e.slice(-1)!=="/"?h=e+"/"+h:h=e+h),h.charAt(0)==="/"&&!this.nomount&&(h=YG.join(this.root,h)),this._emitMatch(i,h)}return}n.shift();for(var d=0;d<b;d++){var h=f[d],g;e?g=[e,h]:g=[h],this._process(g.concat(n),i,a)}}}};Gi.prototype._emitMatch=function(e,t){if(!XMt(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)}}};Gi.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};Gi.prototype._readdir=function(e,t){var r;if(t&&!$G(this.symlinks,e))return this._readdirInGlobStar(e);if($G(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}};Gi.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};Gi.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}};Gi.prototype._processGlobStar=function(e,t,r,n,i,a){var o=this._readdir(r,a);if(o){var s=n.slice(1),u=e?[e]:[],c=u.concat(s);this._process(c,i,!1);var l=o.length,f=this.symlinks[r];if(!(f&&a))for(var d=0;d<l;d++){var h=o[d];if(!(h.charAt(0)==="."&&!this.dot)){var p=u.concat(o[d],s);this._process(p,i,!0);var b=u.concat(o[d],n);this._process(b,i,!0)}}}};Gi.prototype._processSimple=function(e,t){var r=this._stat(e);if(this.matches[t]||(this.matches[t]=Object.create(null)),!!r){if(e&&kF(e)&&!this.nomount){var n=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=YG.join(this.root,e):(e=YG.resolve(this.root,e),n&&(e+="/"))}process.platform==="win32"&&(e=e.replace(/\\/g,"/")),this._emitMatch(t,e)}};Gi.prototype._stat=function(e){var t=this._makeAbs(e),r=e.slice(-1)==="/";if(e.length>this.maxLength)return!1;if(!this.stat&&$G(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};Gi.prototype._mark=function(e){return o0.mark(this,e)};Gi.prototype._makeAbs=function(e){return o0.makeAbs(this,e)}});var QG=v((n3r,N3e)=>{N3e.exports=q3e;function q3e(e,t){if(e&&t)return q3e(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 PF=v((i3r,ZG)=>{var U3e=QG();ZG.exports=U3e(IF);ZG.exports.strict=U3e(G3e);IF.proto=IF(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return IF(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return G3e(this)},configurable:!0})});function IF(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function G3e(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 H3e=v((a3r,z3e)=>{var YMt=QG(),h2=Object.create(null),$Mt=PF();z3e.exports=YMt(JMt);function JMt(e,t){return h2[e]?(h2[e].push(t),null):(h2[e]=[t],QMt(e))}function QMt(e){return $Mt(function t(){var r=h2[e],n=r.length,i=ZMt(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 h2[e]}})}function ZMt(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n]=e[n];return r}});var JG=v((u3r,V3e)=>{V3e.exports=s0;var e9t=UG(),W3e=BF(),o3r=W3e.Minimatch,t9t=tr(),r9t=require("events").EventEmitter,ez=require("path"),tz=require("assert"),p2=OF(),nz=M3e(),u0=XG(),n9t=u0.setopts,rz=u0.ownProp,iz=H3e(),s3r=require("util"),i9t=u0.childrenIgnored,a9t=u0.isIgnored,o9t=PF();function s0(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 nz(e,t)}return new on(e,t,r)}s0.sync=nz;var s9t=s0.GlobSync=nz.GlobSync;s0.glob=s0;function u9t(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}s0.hasMagic=function(e,t){var r=u9t({},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};s0.Glob=on;t9t(on,r9t);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 s9t(e,t)}if(!(this instanceof on))return new on(e,t,r);n9t(this,e,t),this._didRealPath=!1;var n=this.minimatch.set.length;this.matches=new Array(n),typeof r=="function"&&(r=o9t(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(tz(this instanceof on),!this.aborted){if(this.realpath&&!this._didRealpath)return this._realpath();u0.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),e9t.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 u0.mark(this,e)};on.prototype._makeAbs=function(e){return u0.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(tz(this instanceof on),tz(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=".":((p2(a)||p2(e.map(function(l){return typeof l=="string"?l:"[*]"}).join("/")))&&(!a||!p2(a))&&(a="/"+a),s=a);var u=this._makeAbs(s);if(i9t(this,s))return n();var c=o[0]===W3e.GLOBSTAR;c?this._processGlobStar(a,s,u,o,t,r,n):this._processReaddir(a,s,u,o,t,r,n)}};on.prototype._processReaddir=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){return s._processReaddir2(e,t,r,n,i,a,c,o)})};on.prototype._processReaddir2=function(e,t,r,n,i,a,o,s){if(!o)return s();for(var u=n[0],c=!!this.minimatch.negate,l=u._glob,f=this.dot||l.charAt(0)===".",d=[],h=0;h<o.length;h++){var p=o[h];if(p.charAt(0)!=="."||f){var b;c&&!e?b=!p.match(u):b=p.match(u),b&&d.push(p)}}var g=d.length;if(g===0)return s();if(n.length===1&&!this.mark&&!this.stat){this.matches[i]||(this.matches[i]=Object.create(null));for(var h=0;h<g;h++){var p=d[h];e&&(e!=="/"?p=e+"/"+p:p=e+p),p.charAt(0)==="/"&&!this.nomount&&(p=ez.join(this.root,p)),this._emitMatch(i,p)}return s()}n.shift();for(var h=0;h<g;h++){var p=d[h],x;e&&(e!=="/"?p=e+"/"+p:p=e+p),this._process([p].concat(n),i,a,s)}s()};on.prototype._emitMatch=function(e,t){if(!this.aborted&&!a9t(this,t)){if(this.paused){this._emitQueue.push([e,t]);return}var r=p2(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=iz(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=iz("readdir\0"+e+"\0"+t,r),!!r)){if(t&&!rz(this.symlinks,e))return this._readdirInGlobStar(e,r);if(rz(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,c9t(this,e,r))}};function c9t(e,t,r){return function(n,i){n?e._readdirError(t,n,r):e._readdirEntries(t,i,r)}}on.prototype._readdirEntries=function(e,t,r){if(!this.aborted){if(!this.mark&&!this.stat)for(var n=0;n<t.length;n++){var i=t[n];e==="/"?i=e+i:i=e+"/"+i,this.cache[i]=!0}return this.cache[e]=t,r(null,t)}};on.prototype._readdirError=function(e,t,r){if(!this.aborted){switch(t.code){case"ENOTSUP":case"ENOTDIR":var n=this._makeAbs(e);if(this.cache[n]="FILE",n===this.cwdAbs){var i=new Error(t.code+" invalid cwd "+this.cwd);i.path=this.cwd,i.code=t.code,this.emit("error",i),this.abort()}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(e)]=!1;break;default:this.cache[this._makeAbs(e)]=!1,this.strict&&(this.emit("error",t),this.abort()),this.silent||console.error("glob error",t);break}return r()}};on.prototype._processGlobStar=function(e,t,r,n,i,a,o){var s=this;this._readdir(r,a,function(u,c){s._processGlobStar2(e,t,r,n,i,a,c,o)})};on.prototype._processGlobStar2=function(e,t,r,n,i,a,o,s){if(!o)return s();var u=n.slice(1),c=e?[e]:[],l=c.concat(u);this._process(l,i,!1,s);var f=this.symlinks[r],d=o.length;if(f&&a)return s();for(var h=0;h<d;h++){var p=o[h];if(!(p.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&&p2(e)&&!this.nomount){var a=/[\/\\]$/.test(e);e.charAt(0)==="/"?e=ez.join(this.root,e):(e=ez.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&&rz(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=iz("stat\0"+r,l);c&&u.fs.lstat(r,c);function l(f,d){if(d&&d.isSymbolicLink())return u.fs.stat(r,function(h,p){h?u._stat2(e,r,null,d,t):u._stat2(e,r,h,p,t)});u._stat2(e,r,f,d,t)}};on.prototype._stat2=function(e,t,r,n,i){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return this.statCache[t]=!1,i();var a=e.slice(-1)==="/";if(this.statCache[t]=n,t.slice(-1)==="/"&&n&&!n.isDirectory())return i(null,!1,n);var o=!0;return n&&(o=n.isDirectory()?"DIR":"FILE"),this.cache[t]=this.cache[t]||o,a&&o==="FILE"?i():i(null,o,n)}});var $3e=v((c3r,Y3e)=>{var X3e=_G(),Sb=require("path"),az=k6e(),l9t=W6e(),f9t=i3e(),d9t=u3e(),h9t=JG(),c0=Y3e.exports={},K3e=/[\/\\]/g,p9t=function(e,t){var r=[];return az(e).forEach(function(n){var i=n.indexOf("!")===0;i&&(n=n.slice(1));var a=t(n);i?r=l9t(r,a):r=f9t(r,a)}),r};c0.exists=function(){var e=Sb.join.apply(Sb,arguments);return X3e.existsSync(e)};c0.expand=function(...e){var t=d9t(e[0])?e.shift():{},r=Array.isArray(e[0])?e[0]:e;if(r.length===0)return[];var n=p9t(r,function(i){return h9t.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):X3e.statSync(i)[t.filter]()}catch{return!1}})),n};c0.expandMapping=function(e,t,r){r=Object.assign({rename:function(a,o){return Sb.join(a||"",o)}},r);var n=[],i={};return c0.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(K3e,"/"),a=a.replace(K3e,"/"),i[s]?i[s].src.push(a):(n.push({src:[a],dest:s}),i[s]=n[n.length-1])}),n};c0.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=az(r.src):r.src=[r.src])}).map(function(r){var n=Object.assign({},r);if(delete n.src,delete n.dest,r.expand)return c0.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)?az(o):[o],a.result=c0.expand(n,o)),a.result}}),"dest"in i&&(i.dest=r.dest),i}).flatten().value(),t)}});var Tb=v((f3r,Z3e)=>{var oz=_G(),J3e=require("path"),l3r=require("util"),m9t=b6e(),Q3e=EG(),g9t=C6e(),v9t=require("stream").Stream,b9t=S_().PassThrough,qo=Z3e.exports={};qo.file=$3e();qo.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)})};qo.dateify=function(e){return e=e||new Date,e instanceof Date?e=e:typeof e=="string"?e=new Date(e):e=new Date,e};qo.defaults=function(e,t,r){var n=arguments;return n[0]=n[0]||{},g9t(...n)};qo.isStream=function(e){return e instanceof v9t};qo.lazyReadStream=function(e){return new m9t.Readable(function(){return oz.createReadStream(e)})};qo.normalizeInputSource=function(e){if(e===null)return new Buffer(0);if(typeof e=="string")return new Buffer(e);if(qo.isStream(e)&&!e._readableState){var t=new b9t;return e.pipe(t),t}return e};qo.sanitizePath=function(e){return Q3e(e,!1).replace(/^\w+:/,"").replace(/^(\.\.\/|\/)+/,"")};qo.trailingSlashIt=function(e){return e.slice(-1)!=="/"?e+"/":e};qo.unixifyPath=function(e){return Q3e(e,!1).replace(/^\w+:/,"")};qo.walkdir=function(e,t,r){var n=[];typeof t=="function"&&(r=t,t=e),oz.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=J3e.join(e,s),oz.stat(u,function(l,f){n.push({path:u,relative:J3e.relative(t,u).replace(/\\/g,"/"),stats:f}),f&&f.isDirectory()?qo.walkdir(u,t,function(d,h){h.forEach(function(p){n.push(p)}),c()}):c()})})()})}});var n8e=v((t8e,r8e)=>{var y9t=require("util"),x9t={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 e8e(e,t){Error.captureStackTrace(this,this.constructor),this.message=x9t[e]||e,this.code=e,this.data=t}y9t.inherits(e8e,Error);t8e=r8e.exports=e8e});var sz=v((d3r,i8e)=>{i8e.exports=require("stream")});var l8e=v((h3r,c8e)=>{"use strict";function a8e(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 o8e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?a8e(Object(r),!0).forEach(function(n){_9t(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a8e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _9t(e,t,r){return t=u8e(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function E9t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s8e(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,u8e(n.key),n)}}function w9t(e,t,r){return t&&s8e(e.prototype,t),r&&s8e(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function u8e(e){var t=A9t(e,"string");return typeof t=="symbol"?t:String(t)}function A9t(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 S9t=require("buffer"),jF=S9t.Buffer,T9t=require("util"),uz=T9t.inspect,C9t=uz&&uz.custom||"inspect";function D9t(e,t,r){jF.prototype.copy.call(e,t,r)}c8e.exports=function(){function e(){E9t(this,e),this.head=null,this.tail=null,this.length=0}return w9t(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 jF.alloc(0);for(var n=jF.allocUnsafe(r>>>0),i=this.head,a=0;i;)D9t(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=jF.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:C9t,value:function(r,n){return uz(this,o8e(o8e({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var lz=v((p3r,d8e)=>{"use strict";function F9t(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(cz,this,e)):process.nextTick(cz,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(LF,r):(r._writableState.errorEmitted=!0,process.nextTick(f8e,r,a)):process.nextTick(f8e,r,a):t?(process.nextTick(LF,r),t(a)):process.nextTick(LF,r)}),this)}function f8e(e,t){cz(e,t),LF(e)}function LF(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function B9t(){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 cz(e,t){e.emit("error",t)}function R9t(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}d8e.exports={destroy:F9t,undestroy:B9t,errorOrDestroy:R9t}});var Vd=v((m3r,m8e)=>{"use strict";var p8e={};function Ts(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,p8e[e]=i}function h8e(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 O9t(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function k9t(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function I9t(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Ts("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Ts("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&O9t(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(k9t(e," argument"))i=`The ${e} ${n} ${h8e(t,"type")}`;else{let a=I9t(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${h8e(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Ts("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Ts("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Ts("ERR_STREAM_PREMATURE_CLOSE","Premature close");Ts("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Ts("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Ts("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Ts("ERR_STREAM_WRITE_AFTER_END","write after end");Ts("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Ts("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Ts("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");m8e.exports.codes=p8e});var fz=v((g3r,g8e)=>{"use strict";var P9t=Vd().codes.ERR_INVALID_OPT_VALUE;function j9t(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function L9t(e,t,r,n){var i=j9t(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new P9t(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}g8e.exports={getHighWaterMark:L9t}});var pz=v((v3r,E8e)=>{"use strict";E8e.exports=ai;function b8e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){l7t(t,e)}}var Cb;ai.WritableState=g2;var M9t={deprecate:lp()},y8e=sz(),qF=require("buffer").Buffer,q9t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function N9t(e){return qF.from(e)}function U9t(e){return qF.isBuffer(e)||e instanceof q9t}var hz=lz(),G9t=fz(),z9t=G9t.getHighWaterMark,Kd=Vd().codes,H9t=Kd.ERR_INVALID_ARG_TYPE,W9t=Kd.ERR_METHOD_NOT_IMPLEMENTED,V9t=Kd.ERR_MULTIPLE_CALLBACK,K9t=Kd.ERR_STREAM_CANNOT_PIPE,X9t=Kd.ERR_STREAM_DESTROYED,Y9t=Kd.ERR_STREAM_NULL_VALUES,$9t=Kd.ERR_STREAM_WRITE_AFTER_END,J9t=Kd.ERR_UNKNOWN_ENCODING,Db=hz.errorOrDestroy;tr()(ai,y8e);function Q9t(){}function g2(e,t,r){Cb=Cb||l0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Cb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=z9t(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){a7t(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 b8e(this)}g2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(g2.prototype,"buffer",{get:M9t.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var MF;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(MF=Function.prototype[Symbol.hasInstance],Object.defineProperty(ai,Symbol.hasInstance,{value:function(t){return MF.call(this,t)?!0:this!==ai?!1:t&&t._writableState instanceof g2}})):MF=function(t){return t instanceof this};function ai(e){Cb=Cb||l0();var t=this instanceof Cb;if(!t&&!MF.call(ai,this))return new ai(e);this._writableState=new g2(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)),y8e.call(this)}ai.prototype.pipe=function(){Db(this,new K9t)};function Z9t(e,t){var r=new $9t;Db(e,r),process.nextTick(t,r)}function e7t(e,t,r,n){var i;return r===null?i=new Y9t:typeof r!="string"&&!t.objectMode&&(i=new H9t("chunk",["string","Buffer"],r)),i?(Db(e,i),process.nextTick(n,i),!1):!0}ai.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&U9t(e);return a&&!qF.isBuffer(e)&&(e=N9t(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=Q9t),n.ending?Z9t(this,r):(a||e7t(this,n,e,r))&&(n.pendingcb++,i=r7t(this,n,a,e,t,r)),i};ai.prototype.cork=function(){this._writableState.corked++};ai.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&x8e(this,e))};ai.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 J9t(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ai.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function t7t(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=qF.from(t,r)),t}Object.defineProperty(ai.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function r7t(e,t,r,n,i,a){if(!r){var o=t7t(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 X9t("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function n7t(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(m2,e,t),e._writableState.errorEmitted=!0,Db(e,n)):(i(n),e._writableState.errorEmitted=!0,Db(e,n),m2(e,t))}function i7t(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function a7t(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new V9t;if(i7t(r),t)n7t(e,r,n,t,i);else{var a=_8e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&x8e(e,r),n?process.nextTick(v8e,e,r,a,i):v8e(e,r,a,i)}}function v8e(e,t,r,n){r||o7t(e,t),t.pendingcb--,n(),m2(e,t)}function o7t(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function x8e(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 b8e(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}ai.prototype._write=function(e,t,r){r(new W9t("_write()"))};ai.prototype._writev=null;ai.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||c7t(this,n,r),this};Object.defineProperty(ai.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function _8e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function s7t(e,t){e._final(function(r){t.pendingcb--,r&&Db(e,r),t.prefinished=!0,e.emit("prefinish"),m2(e,t)})}function u7t(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(s7t,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function m2(e,t){var r=_8e(t);if(r&&(u7t(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 c7t(e,t,r){t.ending=!0,m2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function l7t(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}Object.defineProperty(ai.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});ai.prototype.destroy=hz.destroy;ai.prototype._undestroy=hz.undestroy;ai.prototype._destroy=function(e,t){t(e)}});var l0=v((b3r,A8e)=>{"use strict";var f7t=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};A8e.exports=Oc;var w8e=vz(),gz=pz();tr()(Oc,w8e);for(mz=f7t(gz.prototype),NF=0;NF<mz.length;NF++)UF=mz[NF],Oc.prototype[UF]||(Oc.prototype[UF]=gz.prototype[UF]);var mz,UF,NF;function Oc(e){if(!(this instanceof Oc))return new Oc(e);w8e.call(this,e),gz.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",d7t)))}Object.defineProperty(Oc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Oc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Oc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function d7t(){this._writableState.ended||process.nextTick(h7t,this)}function h7t(e){e.end()}Object.defineProperty(Oc.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 xz=v(T8e=>{"use strict";var yz=Us().Buffer,S8e=yz.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 p7t(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 m7t(e){var t=p7t(e);if(typeof t!="string"&&(yz.isEncoding===S8e||!S8e(e)))throw new Error("Unknown encoding: "+e);return t||e}T8e.StringDecoder=v2;function v2(e){this.encoding=m7t(e);var t;switch(this.encoding){case"utf16le":this.text=_7t,this.end=E7t,t=4;break;case"utf8":this.fillLast=b7t,t=4;break;case"base64":this.text=w7t,this.end=A7t,t=3;break;default:this.write=S7t,this.end=T7t;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=yz.allocUnsafe(t)}v2.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||""};v2.prototype.end=x7t;v2.prototype.text=y7t;v2.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 bz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function g7t(e,t,r){var n=t.length-1;if(n<r)return 0;var i=bz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=bz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=bz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function v7t(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 b7t(e){var t=this.lastTotal-this.lastNeed,r=v7t(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 y7t(e,t){var r=g7t(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 x7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function _7t(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function E7t(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 w7t(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 A7t(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function S7t(e){return e.toString(this.encoding)}function T7t(e){return e&&e.length?this.write(e):""}});var GF=v((x3r,F8e)=>{"use strict";var C8e=Vd().codes.ERR_STREAM_PREMATURE_CLOSE;function C7t(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 D7t(){}function F7t(e){return e.setHeader&&typeof e.abort=="function"}function D8e(e,t,r){if(typeof t=="function")return D8e(e,null,t);t||(t={}),r=C7t(r||D7t);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(p){r.call(e,p)},f=function(){var p;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(p=new C8e),r.call(e,p);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(p=new C8e),r.call(e,p)},d=function(){e.req.on("finish",s)};return F7t(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}F8e.exports=D8e});var R8e=v((_3r,B8e)=>{"use strict";var zF;function Xd(e,t,r){return t=B7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function B7t(e){var t=R7t(e,"string");return typeof t=="symbol"?t:String(t)}function R7t(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 O7t=GF(),Yd=Symbol("lastResolve"),f0=Symbol("lastReject"),b2=Symbol("error"),HF=Symbol("ended"),d0=Symbol("lastPromise"),_z=Symbol("handlePromise"),h0=Symbol("stream");function $d(e,t){return{value:e,done:t}}function k7t(e){var t=e[Yd];if(t!==null){var r=e[h0].read();r!==null&&(e[d0]=null,e[Yd]=null,e[f0]=null,t($d(r,!1)))}}function I7t(e){process.nextTick(k7t,e)}function P7t(e,t){return function(r,n){e.then(function(){if(t[HF]){r($d(void 0,!0));return}t[_z](r,n)},n)}}var j7t=Object.getPrototypeOf(function(){}),L7t=Object.setPrototypeOf((zF={get stream(){return this[h0]},next:function(){var t=this,r=this[b2];if(r!==null)return Promise.reject(r);if(this[HF])return Promise.resolve($d(void 0,!0));if(this[h0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[b2]?s(t[b2]):o($d(void 0,!0))})});var n=this[d0],i;if(n)i=new Promise(P7t(n,this));else{var a=this[h0].read();if(a!==null)return Promise.resolve($d(a,!1));i=new Promise(this[_z])}return this[d0]=i,i}},Xd(zF,Symbol.asyncIterator,function(){return this}),Xd(zF,"return",function(){var t=this;return new Promise(function(r,n){t[h0].destroy(null,function(i){if(i){n(i);return}r($d(void 0,!0))})})}),zF),j7t),M7t=function(t){var r,n=Object.create(L7t,(r={},Xd(r,h0,{value:t,writable:!0}),Xd(r,Yd,{value:null,writable:!0}),Xd(r,f0,{value:null,writable:!0}),Xd(r,b2,{value:null,writable:!0}),Xd(r,HF,{value:t._readableState.endEmitted,writable:!0}),Xd(r,_z,{value:function(a,o){var s=n[h0].read();s?(n[d0]=null,n[Yd]=null,n[f0]=null,a($d(s,!1))):(n[Yd]=a,n[f0]=o)},writable:!0}),r));return n[d0]=null,O7t(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[f0];a!==null&&(n[d0]=null,n[Yd]=null,n[f0]=null,a(i)),n[b2]=i;return}var o=n[Yd];o!==null&&(n[d0]=null,n[Yd]=null,n[f0]=null,o($d(void 0,!0))),n[HF]=!0}),t.on("readable",I7t.bind(null,n)),n};B8e.exports=M7t});var P8e=v((E3r,I8e)=>{"use strict";function O8e(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 q7t(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){O8e(a,n,i,o,s,"next",u)}function s(u){O8e(a,n,i,o,s,"throw",u)}o(void 0)})}}function k8e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function N7t(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?k8e(Object(r),!0).forEach(function(n){U7t(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k8e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function U7t(e,t,r){return t=G7t(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function G7t(e){var t=z7t(e,"string");return typeof t=="symbol"?t:String(t)}function z7t(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 H7t=Vd().codes.ERR_INVALID_ARG_TYPE;function W7t(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 H7t("iterable",["Iterable"],t);var i=new e(N7t({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=q7t(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}I8e.exports=W7t});var vz=v((A3r,W8e)=>{"use strict";W8e.exports=Nr;var Fb;Nr.ReadableState=q8e;var w3r=require("events").EventEmitter,M8e=function(t,r){return t.listeners(r).length},x2=sz(),WF=require("buffer").Buffer,V7t=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function K7t(e){return WF.from(e)}function X7t(e){return WF.isBuffer(e)||e instanceof V7t}var Ez=require("util"),gr;Ez&&Ez.debuglog?gr=Ez.debuglog("stream"):gr=function(){};var Y7t=l8e(),Fz=lz(),$7t=fz(),J7t=$7t.getHighWaterMark,VF=Vd().codes,Q7t=VF.ERR_INVALID_ARG_TYPE,Z7t=VF.ERR_STREAM_PUSH_AFTER_EOF,eqt=VF.ERR_METHOD_NOT_IMPLEMENTED,tqt=VF.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Bb,wz,Az;tr()(Nr,x2);var y2=Fz.errorOrDestroy,Sz=["error","close","destroy","pause","resume"];function rqt(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 q8e(e,t,r){Fb=Fb||l0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Fb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=J7t(this,e,"readableHighWaterMark",r),this.buffer=new Y7t,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&&(Bb||(Bb=xz().StringDecoder),this.decoder=new Bb(e.encoding),this.encoding=e.encoding)}function Nr(e){if(Fb=Fb||l0(),!(this instanceof Nr))return new Nr(e);var t=this instanceof Fb;this._readableState=new q8e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),x2.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=Fz.destroy;Nr.prototype._undestroy=Fz.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=WF.from(e,t),t=""),n=!0),N8e(this,e,t,!1,n)};Nr.prototype.unshift=function(e){return N8e(this,e,null,!0,!1)};function N8e(e,t,r,n,i){gr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,aqt(e,a);else{var o;if(i||(o=nqt(a,t)),o)y2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==WF.prototype&&(t=K7t(t)),n)a.endEmitted?y2(e,new tqt):Tz(e,a,t,!0);else if(a.ended)y2(e,new Z7t);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?Tz(e,a,t,!1):Dz(e,a)):Tz(e,a,t,!1)}else n||(a.reading=!1,Dz(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function Tz(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&&KF(e)),Dz(e,t)}function nqt(e,t){var r;return!X7t(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new Q7t("chunk",["string","Buffer","Uint8Array"],t)),r}Nr.prototype.isPaused=function(){return this._readableState.flowing===!1};Nr.prototype.setEncoding=function(e){Bb||(Bb=xz().StringDecoder);var t=new Bb(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 j8e=1073741824;function iqt(e){return e>=j8e?e=j8e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function L8e(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=iqt(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?Cz(this):KF(this),null;if(e=L8e(e,t),e===0&&t.ended)return t.length===0&&Cz(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=L8e(r,t)));var i;return e>0?i=z8e(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&&Cz(this)),i!==null&&this.emit("data",i),i};function aqt(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?KF(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U8e(e)))}}function KF(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(U8e,e))}function U8e(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,Bz(e)}function Dz(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(oqt,e,t))}function oqt(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){y2(this,new eqt("_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=sqt(r);e.on("drain",u);var c=!1;function l(){gr("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){gr("ondata");var x=e.write(g);gr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&H8e(n.pipes,e)!==-1)&&!c&&(gr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){gr("onerror",g),b(),e.removeListener("error",d),M8e(e,"error")===0&&y2(e,g)}rqt(e,"error",d);function h(){e.removeListener("finish",p),b()}e.once("close",h);function p(){gr("onfinish"),e.removeListener("close",h),b()}e.once("finish",p);function b(){gr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(gr("pipe resume"),r.resume()),e};function sqt(e){return function(){var r=e._readableState;gr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&M8e(e,"data")&&(r.flowing=!0,Bz(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=H8e(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=x2.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?KF(this):n.reading||process.nextTick(uqt,this)),r};Nr.prototype.addListener=Nr.prototype.on;Nr.prototype.removeListener=function(e,t){var r=x2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(G8e,this),r};Nr.prototype.removeAllListeners=function(e){var t=x2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(G8e,this),t};function G8e(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 uqt(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,cqt(this,e)),e.paused=!1,this};function cqt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(lqt,e,t))}function lqt(e,t){gr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Bz(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 Bz(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<Sz.length;a++)e.on(Sz[a],this.emit.bind(this,Sz[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 wz===void 0&&(wz=R8e()),wz(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=z8e;Object.defineProperty(Nr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function z8e(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 Cz(e){var t=e._readableState;gr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(fqt,t,e))}function fqt(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 Az===void 0&&(Az=P8e()),Az(Nr,e,t)});function H8e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var Rz=v((S3r,K8e)=>{"use strict";K8e.exports=Kl;var XF=Vd().codes,dqt=XF.ERR_METHOD_NOT_IMPLEMENTED,hqt=XF.ERR_MULTIPLE_CALLBACK,pqt=XF.ERR_TRANSFORM_ALREADY_TRANSFORMING,mqt=XF.ERR_TRANSFORM_WITH_LENGTH_0,YF=l0();tr()(Kl,YF);function gqt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new hqt);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 Kl(e){if(!(this instanceof Kl))return new Kl(e);YF.call(this,e),this._transformState={afterTransform:gqt.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",vqt)}function vqt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){V8e(e,t,r)}):V8e(this,null,null)}Kl.prototype.push=function(e,t){return this._transformState.needTransform=!1,YF.prototype.push.call(this,e,t)};Kl.prototype._transform=function(e,t,r){r(new dqt("_transform()"))};Kl.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)}};Kl.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};Kl.prototype._destroy=function(e,t){YF.prototype._destroy.call(this,e,function(r){t(r)})};function V8e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new mqt;if(e._transformState.transforming)throw new pqt;return e.push(null)}});var $8e=v((T3r,Y8e)=>{"use strict";Y8e.exports=_2;var X8e=Rz();tr()(_2,X8e);function _2(e){if(!(this instanceof _2))return new _2(e);X8e.call(this,e)}_2.prototype._transform=function(e,t,r){r(null,e)}});var tCe=v((C3r,eCe)=>{"use strict";var Oz;function bqt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Z8e=Vd().codes,yqt=Z8e.ERR_MISSING_ARGS,xqt=Z8e.ERR_STREAM_DESTROYED;function J8e(e){if(e)throw e}function _qt(e){return e.setHeader&&typeof e.abort=="function"}function Eqt(e,t,r,n){n=bqt(n);var i=!1;e.on("close",function(){i=!0}),Oz===void 0&&(Oz=GF()),Oz(e,{readable:t,writable:r},function(o){if(o)return n(o);i=!0,n()});var a=!1;return function(o){if(!i&&!a){if(a=!0,_qt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new xqt("pipe"))}}}function Q8e(e){e()}function wqt(e,t){return e.pipe(t)}function Aqt(e){return!e.length||typeof e[e.length-1]!="function"?J8e:e.pop()}function Sqt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Aqt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new yqt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return Eqt(o,u,c,function(l){i||(i=l),l&&a.forEach(Q8e),!u&&(a.forEach(Q8e),n(i))})});return t.reduce(wqt)}eCe.exports=Sqt});var kz=v((Cs,w2)=>{var E2=require("stream");process.env.READABLE_STREAM==="disable"&&E2?(w2.exports=E2.Readable,Object.assign(w2.exports,E2),w2.exports.Stream=E2):(Cs=w2.exports=vz(),Cs.Stream=E2||Cs,Cs.Readable=Cs,Cs.Writable=pz(),Cs.Duplex=l0(),Cs.Transform=Rz(),Cs.PassThrough=$8e(),Cs.finished=GF(),Cs.pipeline=tCe())});var oCe=v((D3r,aCe)=>{var jz=require("fs"),nCe=e6e(),rCe=r6e(),Iz=require("path"),kc=Tb(),Tqt=require("util").inherits,oi=n8e(),iCe=kz().Transform,Pz=process.platform==="win32",$r=function(e,t){if(!(this instanceof $r))return new $r(e,t);typeof e!="string"&&(t=e,e="zip"),t=this.options=kc.defaults(t,{highWaterMark:1024*1024,statConcurrency:4}),iCe.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=rCe.queue(this._onQueueTask.bind(this),1),this._queue.drain(this._onQueueDrain.bind(this)),this._statQueue=rCe.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=[]};Tqt($r,iCe);$r.prototype._abort=function(){this._state.aborted=!0,this._queue.kill(),this._statQueue.kill(),this._queue.idle()&&this._shutdown()};$r.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 jz.Stats?(r=this._updateQueueTaskWithStats(r,t.stats),r&&(t.stats.size&&(this._fsEntriesTotalBytes+=t.stats.size),this._queue.push(r))):this._statQueue.push(r)};$r.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)};$r.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};$r.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))};$r.prototype._moduleFinalize=function(){typeof this._module.finalize=="function"?this._module.finalize():typeof this._module.end=="function"?this._module.end():this.emit("error",new oi("NOENDMETHOD"))};$r.prototype._modulePipe=function(){this._module.on("error",this._onModuleError.bind(this)),this._module.pipe(this),this._state.modulePiped=!0};$r.prototype._moduleSupports=function(e){return!this._module.supports||!this._module.supports[e]?!1:this._module.supports[e]};$r.prototype._moduleUnpipe=function(){this._module.unpipe(this),this._state.modulePiped=!1};$r.prototype._normalizeEntryData=function(e,t){e=kc.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=kc.sanitizePath(e.name),e.type!=="symlink"&&e.name.slice(-1)==="/"?(r=!0,e.type="directory"):r&&(e.name+="/")),typeof e.mode=="number"?Pz?e.mode&=511:e.mode&=4095:e.stats&&e.mode===null?(Pz?e.mode=e.stats.mode&511:e.mode=e.stats.mode&4095,Pz&&r&&(e.mode=493)):e.mode===null&&(e.mode=r?493:420),e.stats&&e.date===null?e.date=e.stats.mtime:e.date=kc.dateify(e.date),e};$r.prototype._onModuleError=function(e){this.emit("error",e)};$r.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()};$r.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)};$r.prototype._onStatQueueTask=function(e,t){if(this._state.finalizing||this._state.finalized||this._state.aborted){t();return}jz.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))};$r.prototype._shutdown=function(){this._moduleUnpipe(),this.end()};$r.prototype._transform=function(e,t,r){e&&(this._pointer+=e.length),r(null,e)};$r.prototype._updateQueueTaskWithStats=function(e,t){if(t.isFile())e.data.type="file",e.data.sourceType="stream",e.source=kc.lazyReadStream(e.filepath);else if(t.isDirectory()&&this._moduleSupports("directory"))e.data.name=kc.trailingSlashIt(e.data.name),e.data.type="directory",e.data.sourcePath=kc.trailingSlashIt(e.filepath),e.data.sourceType="buffer",e.source=Buffer.concat([]);else if(t.isSymbolicLink()&&this._moduleSupports("symlink")){var r=jz.readlinkSync(e.filepath),n=Iz.dirname(e.filepath);e.data.type="symlink",e.data.linkname=Iz.relative(n,Iz.resolve(n,r)),e.data.sourceType="buffer",e.source=Buffer.concat([])}else return t.isDirectory()?this.emit("warning",new oi("DIRECTORYNOTSUPPORTED",e.data)):t.isSymbolicLink()?this.emit("warning",new oi("SYMLINKNOTSUPPORTED",e.data)):this.emit("warning",new oi("ENTRYNOTSUPPORTED",e.data)),null;return e.data=this._normalizeEntryData(e.data,t),e};$r.prototype.abort=function(){return this._state.aborted||this._state.finalized?this:(this._abort(),this)};$r.prototype.append=function(e,t){if(this._state.finalize||this._state.aborted)return this.emit("error",new oi("QUEUECLOSED")),this;if(t=this._normalizeEntryData(t),typeof t.name!="string"||t.name.length===0)return this.emit("error",new oi("ENTRYNAMEREQUIRED")),this;if(t.type==="directory"&&!this._moduleSupports("directory"))return this.emit("error",new oi("DIRECTORYNOTSUPPORTED",{name:t.name})),this;if(e=kc.normalizeInputSource(e),Buffer.isBuffer(e))t.sourceType="buffer";else if(kc.isStream(e))t.sourceType="stream";else return this.emit("error",new oi("INPUTSTEAMBUFFERREQUIRED",{name:t.name})),this;return this._entriesCount++,this._queue.push({data:t,source:e}),this};$r.prototype.directory=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new oi("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new oi("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 oi("DIRECTORYFUNCTIONINVALIDDATA",{dirpath:e})}}catch(d){this.emit("error",d);return}if(l){u.resume();return}this._append(c.absolute,f)}var u=nCe(e,i);return u.on("error",o.bind(this)),u.on("match",s.bind(this)),u.on("end",a.bind(this)),this};$r.prototype.file=function(e,t){return this._state.finalize||this._state.aborted?(this.emit("error",new oi("QUEUECLOSED")),this):typeof e!="string"||e.length===0?(this.emit("error",new oi("FILEFILEPATHREQUIRED")),this):(this._append(e,t),this)};$r.prototype.glob=function(e,t,r){this._pending++,t=kc.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=nCe(t.cwd||".",t);return o.on("error",i.bind(this)),o.on("match",a.bind(this)),o.on("end",n.bind(this)),this};$r.prototype.finalize=function(){if(this._state.aborted){var e=new oi("ABORTED");return this.emit("error",e),Promise.reject(e)}if(this._state.finalize){var t=new oi("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)})})};$r.prototype.setFormat=function(e){return this._format?(this.emit("error",new oi("FORMATSET")),this):(this._format=e,this)};$r.prototype.setModule=function(e){return this._state.aborted?(this.emit("error",new oi("ABORTED")),this):this._state.module?(this.emit("error",new oi("MODULESET")),this):(this._module=e,this._modulePipe(),this)};$r.prototype.symlink=function(e,t,r){if(this._state.finalize||this._state.aborted)return this.emit("error",new oi("QUEUECLOSED")),this;if(typeof e!="string"||e.length===0)return this.emit("error",new oi("SYMLINKFILEPATHREQUIRED")),this;if(typeof t!="string"||t.length===0)return this.emit("error",new oi("SYMLINKTARGETREQUIRED",{filepath:e})),this;if(!this._moduleSupports("symlink"))return this.emit("error",new oi("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};$r.prototype.pointer=function(){return this._pointer};$r.prototype.use=function(e){return this._streams.push(e),this};aCe.exports=$r});var JF=v((F3r,sCe)=>{var $F=sCe.exports=function(){};$F.prototype.getName=function(){};$F.prototype.getSize=function(){};$F.prototype.getLastModifiedDate=function(){};$F.prototype.isDirectory=function(){}});var QF=v((B3r,uCe)=>{var Ds=uCe.exports={};Ds.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};Ds.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)};Ds.fromDosTime=function(e){return Ds.dosToDate(e.readUInt32LE(0))};Ds.getEightBytes=function(e){var t=Buffer.alloc(8);return t.writeUInt32LE(e%4294967296,0),t.writeUInt32LE(e/4294967296|0,4),t};Ds.getShortBytes=function(e){var t=Buffer.alloc(2);return t.writeUInt16LE((e&65535)>>>0,0),t};Ds.getShortBytesValue=function(e,t){return e.readUInt16LE(t)};Ds.getLongBytes=function(e){var t=Buffer.alloc(4);return t.writeUInt32LE((e&4294967295)>>>0,0),t};Ds.getLongBytesValue=function(e,t){return e.readUInt32LE(t)};Ds.toDosTime=function(e){return Ds.getLongBytes(Ds.dateToDos(e))}});var Lz=v((R3r,pCe)=>{var cCe=QF(),lCe=1<<3,fCe=1<<0,Cqt=1<<2,Dqt=1<<1,dCe=1<<6,hCe=1<<11,Sa=pCe.exports=function(){return this instanceof Sa?(this.descriptor=!1,this.encryption=!1,this.utf8=!1,this.numberOfShannonFanoTrees=0,this.strongEncryption=!1,this.slidingDictionarySize=0,this):new Sa};Sa.prototype.encode=function(){return cCe.getShortBytes((this.descriptor?lCe:0)|(this.utf8?hCe:0)|(this.encryption?fCe:0)|(this.strongEncryption?dCe:0))};Sa.prototype.parse=function(e,t){var r=cCe.getShortBytesValue(e,t),n=new Sa;return n.useDataDescriptor((r&lCe)!==0),n.useUTF8ForNames((r&hCe)!==0),n.useStrongEncryption((r&dCe)!==0),n.useEncryption((r&fCe)!==0),n.setSlidingDictionarySize(r&Dqt?8192:4096),n.setNumberOfShannonFanoTrees(r&Cqt?3:2),n};Sa.prototype.setNumberOfShannonFanoTrees=function(e){this.numberOfShannonFanoTrees=e};Sa.prototype.getNumberOfShannonFanoTrees=function(){return this.numberOfShannonFanoTrees};Sa.prototype.setSlidingDictionarySize=function(e){this.slidingDictionarySize=e};Sa.prototype.getSlidingDictionarySize=function(){return this.slidingDictionarySize};Sa.prototype.useDataDescriptor=function(e){this.descriptor=e};Sa.prototype.usesDataDescriptor=function(){return this.descriptor};Sa.prototype.useEncryption=function(e){this.encryption=e};Sa.prototype.usesEncryption=function(){return this.encryption};Sa.prototype.useStrongEncryption=function(e){this.strongEncryption=e};Sa.prototype.usesStrongEncryption=function(){return this.strongEncryption};Sa.prototype.useUTF8ForNames=function(e){this.utf8=e};Sa.prototype.usesUTF8ForNames=function(){return this.utf8}});var gCe=v((O3r,mCe)=>{mCe.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 Mz=v((k3r,vCe)=>{vCe.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 qz=v((I3r,ECe)=>{var Fqt=require("util").inherits,Bqt=EG(),yCe=JF(),xCe=Lz(),bCe=gCe(),Qa=Mz(),_Ce=QF(),vr=ECe.exports=function(e){if(!(this instanceof vr))return new vr(e);yCe.call(this),this.platform=Qa.PLATFORM_FAT,this.method=-1,this.name=null,this.size=0,this.csize=0,this.gpb=new xCe,this.crc=0,this.time=-1,this.minver=Qa.MIN_VERSION_INITIAL,this.mode=-1,this.extra=null,this.exattr=0,this.inattr=0,this.comment=null,e&&this.setName(e)};Fqt(vr,yCe);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:Qa.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?_Ce.dosToDate(this.time):-1};vr.prototype.getTimeDos=function(){return this.time!==-1?this.time:0};vr.prototype.getUnixMode=function(){return this.platform!==Qa.PLATFORM_UNIX?0:this.getExternalAttributes()>>Qa.SHORT_SHIFT&Qa.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 xCe))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=Bqt(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=_Ce.dateToDos(e,t)};vr.prototype.setUnixMode=function(e){e|=this.isDirectory()?Qa.S_IFDIR:Qa.S_IFREG;var t=0;t|=e<<Qa.SHORT_SHIFT|(this.isDirectory()?Qa.S_DOS_D:Qa.S_DOS_A),this.setExternalAttributes(t),this.mode=e&Qa.MODE_MASK,this.platform=Qa.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()&bCe.FILE_TYPE_FLAG)===bCe.LINK_FLAG};vr.prototype.isZip64=function(){return this.csize>Qa.ZIP64_MAGIC||this.size>Qa.ZIP64_MAGIC}});var Nz=v((P3r,wCe)=>{wCe.exports=require("stream")});var FCe=v((j3r,DCe)=>{"use strict";function ACe(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 SCe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ACe(Object(r),!0).forEach(function(n){Rqt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ACe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rqt(e,t,r){return t=CCe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Oqt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function TCe(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,CCe(n.key),n)}}function kqt(e,t,r){return t&&TCe(e.prototype,t),r&&TCe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function CCe(e){var t=Iqt(e,"string");return typeof t=="symbol"?t:String(t)}function Iqt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pqt=require("buffer"),ZF=Pqt.Buffer,jqt=require("util"),Uz=jqt.inspect,Lqt=Uz&&Uz.custom||"inspect";function Mqt(e,t,r){ZF.prototype.copy.call(e,t,r)}DCe.exports=function(){function e(){Oqt(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 ZF.alloc(0);for(var n=ZF.allocUnsafe(r>>>0),i=this.head,a=0;i;)Mqt(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=ZF.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:Lqt,value:function(r,n){return Uz(this,SCe(SCe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var zz=v((L3r,RCe)=>{"use strict";function qqt(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(Gz,this,e)):process.nextTick(Gz,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(e4,r):(r._writableState.errorEmitted=!0,process.nextTick(BCe,r,a)):process.nextTick(BCe,r,a):t?(process.nextTick(e4,r),t(a)):process.nextTick(e4,r)}),this)}function BCe(e,t){Gz(e,t),e4(e)}function e4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Nqt(){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 Gz(e,t){e.emit("error",t)}function Uqt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}RCe.exports={destroy:qqt,undestroy:Nqt,errorOrDestroy:Uqt}});var Jd=v((M3r,ICe)=>{"use strict";var kCe={};function Fs(e,t,r){r||(r=Error);function n(a,o,s){return typeof t=="string"?t:t(a,o,s)}class i extends r{constructor(o,s,u){super(n(o,s,u))}}i.prototype.name=r.name,i.prototype.code=e,kCe[e]=i}function OCe(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 Gqt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function zqt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Hqt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Fs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Fs("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&Gqt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(zqt(e," argument"))i=`The ${e} ${n} ${OCe(t,"type")}`;else{let a=Hqt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${OCe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Fs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Fs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Fs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Fs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Fs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Fs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Fs("ERR_STREAM_WRITE_AFTER_END","write after end");Fs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Fs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Fs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");ICe.exports.codes=kCe});var Hz=v((q3r,PCe)=>{"use strict";var Wqt=Jd().codes.ERR_INVALID_OPT_VALUE;function Vqt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Kqt(e,t,r,n){var i=Vqt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new Wqt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}PCe.exports={getHighWaterMark:Kqt}});var Kz=v((N3r,UCe)=>{"use strict";UCe.exports=si;function LCe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){xNt(t,e)}}var Rb;si.WritableState=S2;var Xqt={deprecate:lp()},MCe=Nz(),r4=require("buffer").Buffer,Yqt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function $qt(e){return r4.from(e)}function Jqt(e){return r4.isBuffer(e)||e instanceof Yqt}var Vz=zz(),Qqt=Hz(),Zqt=Qqt.getHighWaterMark,Qd=Jd().codes,eNt=Qd.ERR_INVALID_ARG_TYPE,tNt=Qd.ERR_METHOD_NOT_IMPLEMENTED,rNt=Qd.ERR_MULTIPLE_CALLBACK,nNt=Qd.ERR_STREAM_CANNOT_PIPE,iNt=Qd.ERR_STREAM_DESTROYED,aNt=Qd.ERR_STREAM_NULL_VALUES,oNt=Qd.ERR_STREAM_WRITE_AFTER_END,sNt=Qd.ERR_UNKNOWN_ENCODING,Ob=Vz.errorOrDestroy;tr()(si,MCe);function uNt(){}function S2(e,t,r){Rb=Rb||p0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Rb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=Zqt(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){mNt(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 LCe(this)}S2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(S2.prototype,"buffer",{get:Xqt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var t4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(t4=Function.prototype[Symbol.hasInstance],Object.defineProperty(si,Symbol.hasInstance,{value:function(t){return t4.call(this,t)?!0:this!==si?!1:t&&t._writableState instanceof S2}})):t4=function(t){return t instanceof this};function si(e){Rb=Rb||p0();var t=this instanceof Rb;if(!t&&!t4.call(si,this))return new si(e);this._writableState=new S2(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)),MCe.call(this)}si.prototype.pipe=function(){Ob(this,new nNt)};function cNt(e,t){var r=new oNt;Ob(e,r),process.nextTick(t,r)}function lNt(e,t,r,n){var i;return r===null?i=new aNt:typeof r!="string"&&!t.objectMode&&(i=new eNt("chunk",["string","Buffer"],r)),i?(Ob(e,i),process.nextTick(n,i),!1):!0}si.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&Jqt(e);return a&&!r4.isBuffer(e)&&(e=$qt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=uNt),n.ending?cNt(this,r):(a||lNt(this,n,e,r))&&(n.pendingcb++,i=dNt(this,n,a,e,t,r)),i};si.prototype.cork=function(){this._writableState.corked++};si.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,!e.writing&&!e.corked&&!e.bufferProcessing&&e.bufferedRequest&&qCe(this,e))};si.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 sNt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(si.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function fNt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=r4.from(t,r)),t}Object.defineProperty(si.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function dNt(e,t,r,n,i,a){if(!r){var o=fNt(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 Wz(e,t,!1,s,n,i,a);return u}function Wz(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new iNt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function hNt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(A2,e,t),e._writableState.errorEmitted=!0,Ob(e,n)):(i(n),e._writableState.errorEmitted=!0,Ob(e,n),A2(e,t))}function pNt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function mNt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new rNt;if(pNt(r),t)hNt(e,r,n,t,i);else{var a=NCe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&qCe(e,r),n?process.nextTick(jCe,e,r,a,i):jCe(e,r,a,i)}}function jCe(e,t,r,n){r||gNt(e,t),t.pendingcb--,n(),A2(e,t)}function gNt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function qCe(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,Wz(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 LCe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(Wz(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}si.prototype._write=function(e,t,r){r(new tNt("_write()"))};si.prototype._writev=null;si.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||yNt(this,n,r),this};Object.defineProperty(si.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function NCe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function vNt(e,t){e._final(function(r){t.pendingcb--,r&&Ob(e,r),t.prefinished=!0,e.emit("prefinish"),A2(e,t)})}function bNt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(vNt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function A2(e,t){var r=NCe(t);if(r&&(bNt(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 yNt(e,t,r){t.ending=!0,A2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function xNt(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(si.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}});si.prototype.destroy=Vz.destroy;si.prototype._undestroy=Vz.undestroy;si.prototype._destroy=function(e,t){t(e)}});var p0=v((U3r,zCe)=>{"use strict";var _Nt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};zCe.exports=Ic;var GCe=$z(),Yz=Kz();tr()(Ic,GCe);for(Xz=_Nt(Yz.prototype),n4=0;n4<Xz.length;n4++)i4=Xz[n4],Ic.prototype[i4]||(Ic.prototype[i4]=Yz.prototype[i4]);var Xz,i4,n4;function Ic(e){if(!(this instanceof Ic))return new Ic(e);GCe.call(this,e),Yz.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",ENt)))}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 ENt(){this._writableState.ended||process.nextTick(wNt,this)}function wNt(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 Zz=v(WCe=>{"use strict";var Qz=Us().Buffer,HCe=Qz.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 ANt(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 SNt(e){var t=ANt(e);if(typeof t!="string"&&(Qz.isEncoding===HCe||!HCe(e)))throw new Error("Unknown encoding: "+e);return t||e}WCe.StringDecoder=T2;function T2(e){this.encoding=SNt(e);var t;switch(this.encoding){case"utf16le":this.text=RNt,this.end=ONt,t=4;break;case"utf8":this.fillLast=DNt,t=4;break;case"base64":this.text=kNt,this.end=INt,t=3;break;default:this.write=PNt,this.end=jNt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Qz.allocUnsafe(t)}T2.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||""};T2.prototype.end=BNt;T2.prototype.text=FNt;T2.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 Jz(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function TNt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=Jz(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=Jz(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=Jz(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function CNt(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 DNt(e){var t=this.lastTotal-this.lastNeed,r=CNt(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 FNt(e,t){var r=TNt(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 BNt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function RNt(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 ONt(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 INt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function PNt(e){return e.toString(this.encoding)}function jNt(e){return e&&e.length?this.write(e):""}});var a4=v((z3r,XCe)=>{"use strict";var VCe=Jd().codes.ERR_STREAM_PREMATURE_CLOSE;function LNt(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 MNt(){}function qNt(e){return e.setHeader&&typeof e.abort=="function"}function KCe(e,t,r){if(typeof t=="function")return KCe(e,null,t);t||(t={}),r=LNt(r||MNt);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(p){r.call(e,p)},f=function(){var p;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(p=new VCe),r.call(e,p);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(p=new VCe),r.call(e,p)},d=function(){e.req.on("finish",s)};return qNt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}XCe.exports=KCe});var $Ce=v((H3r,YCe)=>{"use strict";var o4;function Zd(e,t,r){return t=NNt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function NNt(e){var t=UNt(e,"string");return typeof t=="symbol"?t:String(t)}function UNt(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 GNt=a4(),eh=Symbol("lastResolve"),m0=Symbol("lastReject"),C2=Symbol("error"),s4=Symbol("ended"),g0=Symbol("lastPromise"),eH=Symbol("handlePromise"),v0=Symbol("stream");function th(e,t){return{value:e,done:t}}function zNt(e){var t=e[eh];if(t!==null){var r=e[v0].read();r!==null&&(e[g0]=null,e[eh]=null,e[m0]=null,t(th(r,!1)))}}function HNt(e){process.nextTick(zNt,e)}function WNt(e,t){return function(r,n){e.then(function(){if(t[s4]){r(th(void 0,!0));return}t[eH](r,n)},n)}}var VNt=Object.getPrototypeOf(function(){}),KNt=Object.setPrototypeOf((o4={get stream(){return this[v0]},next:function(){var t=this,r=this[C2];if(r!==null)return Promise.reject(r);if(this[s4])return Promise.resolve(th(void 0,!0));if(this[v0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[C2]?s(t[C2]):o(th(void 0,!0))})});var n=this[g0],i;if(n)i=new Promise(WNt(n,this));else{var a=this[v0].read();if(a!==null)return Promise.resolve(th(a,!1));i=new Promise(this[eH])}return this[g0]=i,i}},Zd(o4,Symbol.asyncIterator,function(){return this}),Zd(o4,"return",function(){var t=this;return new Promise(function(r,n){t[v0].destroy(null,function(i){if(i){n(i);return}r(th(void 0,!0))})})}),o4),VNt),XNt=function(t){var r,n=Object.create(KNt,(r={},Zd(r,v0,{value:t,writable:!0}),Zd(r,eh,{value:null,writable:!0}),Zd(r,m0,{value:null,writable:!0}),Zd(r,C2,{value:null,writable:!0}),Zd(r,s4,{value:t._readableState.endEmitted,writable:!0}),Zd(r,eH,{value:function(a,o){var s=n[v0].read();s?(n[g0]=null,n[eh]=null,n[m0]=null,a(th(s,!1))):(n[eh]=a,n[m0]=o)},writable:!0}),r));return n[g0]=null,GNt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[m0];a!==null&&(n[g0]=null,n[eh]=null,n[m0]=null,a(i)),n[C2]=i;return}var o=n[eh];o!==null&&(n[g0]=null,n[eh]=null,n[m0]=null,o(th(void 0,!0))),n[s4]=!0}),t.on("readable",HNt.bind(null,n)),n};YCe.exports=XNt});var eDe=v((W3r,ZCe)=>{"use strict";function JCe(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 YNt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){JCe(a,n,i,o,s,"next",u)}function s(u){JCe(a,n,i,o,s,"throw",u)}o(void 0)})}}function QCe(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 $Nt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?QCe(Object(r),!0).forEach(function(n){JNt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):QCe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function JNt(e,t,r){return t=QNt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function QNt(e){var t=ZNt(e,"string");return typeof t=="symbol"?t:String(t)}function ZNt(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 eUt=Jd().codes.ERR_INVALID_ARG_TYPE;function tUt(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 eUt("iterable",["Iterable"],t);var i=new e($Nt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=YNt(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}ZCe.exports=tUt});var $z=v((K3r,lDe)=>{"use strict";lDe.exports=Ur;var kb;Ur.ReadableState=iDe;var V3r=require("events").EventEmitter,nDe=function(t,r){return t.listeners(r).length},F2=Nz(),u4=require("buffer").Buffer,rUt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function nUt(e){return u4.from(e)}function iUt(e){return u4.isBuffer(e)||e instanceof rUt}var tH=require("util"),br;tH&&tH.debuglog?br=tH.debuglog("stream"):br=function(){};var aUt=FCe(),uH=zz(),oUt=Hz(),sUt=oUt.getHighWaterMark,c4=Jd().codes,uUt=c4.ERR_INVALID_ARG_TYPE,cUt=c4.ERR_STREAM_PUSH_AFTER_EOF,lUt=c4.ERR_METHOD_NOT_IMPLEMENTED,fUt=c4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ib,rH,nH;tr()(Ur,F2);var D2=uH.errorOrDestroy,iH=["error","close","destroy","pause","resume"];function dUt(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 iDe(e,t,r){kb=kb||p0(),e=e||{},typeof r!="boolean"&&(r=t instanceof kb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=sUt(this,e,"readableHighWaterMark",r),this.buffer=new aUt,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&&(Ib||(Ib=Zz().StringDecoder),this.decoder=new Ib(e.encoding),this.encoding=e.encoding)}function Ur(e){if(kb=kb||p0(),!(this instanceof Ur))return new Ur(e);var t=this instanceof kb;this._readableState=new iDe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),F2.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=uH.destroy;Ur.prototype._undestroy=uH.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=u4.from(e,t),t=""),n=!0),aDe(this,e,t,!1,n)};Ur.prototype.unshift=function(e){return aDe(this,e,null,!0,!1)};function aDe(e,t,r,n,i){br("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,mUt(e,a);else{var o;if(i||(o=hUt(a,t)),o)D2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==u4.prototype&&(t=nUt(t)),n)a.endEmitted?D2(e,new fUt):aH(e,a,t,!0);else if(a.ended)D2(e,new cUt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?aH(e,a,t,!1):sH(e,a)):aH(e,a,t,!1)}else n||(a.reading=!1,sH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function aH(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&&l4(e)),sH(e,t)}function hUt(e,t){var r;return!iUt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new uUt("chunk",["string","Buffer","Uint8Array"],t)),r}Ur.prototype.isPaused=function(){return this._readableState.flowing===!1};Ur.prototype.setEncoding=function(e){Ib||(Ib=Zz().StringDecoder);var t=new Ib(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var tDe=1073741824;function pUt(e){return e>=tDe?e=tDe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function rDe(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=pUt(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?oH(this):l4(this),null;if(e=rDe(e,t),e===0&&t.ended)return t.length===0&&oH(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=rDe(r,t)));var i;return e>0?i=uDe(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&&oH(this)),i!==null&&this.emit("data",i),i};function mUt(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?l4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,oDe(e)))}}function l4(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(oDe,e))}function oDe(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,cH(e)}function sH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(gUt,e,t))}function gUt(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){D2(this,new lUt("_read()"))};Ur.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,br("pipe count=%d opts=%j",n.pipesCount,t);var i=(!t||t.end!==!1)&&e!==process.stdout&&e!==process.stderr,a=i?s:b;n.endEmitted?process.nextTick(a):r.once("end",a),e.on("unpipe",o);function o(g,x){br("onunpipe"),g===r&&x&&x.hasUnpiped===!1&&(x.hasUnpiped=!0,l())}function s(){br("onend"),e.end()}var u=vUt(r);e.on("drain",u);var c=!1;function l(){br("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){br("ondata");var x=e.write(g);br("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&cDe(n.pipes,e)!==-1)&&!c&&(br("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){br("onerror",g),b(),e.removeListener("error",d),nDe(e,"error")===0&&D2(e,g)}dUt(e,"error",d);function h(){e.removeListener("finish",p),b()}e.once("close",h);function p(){br("onfinish"),e.removeListener("close",h),b()}e.once("finish",p);function b(){br("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(br("pipe resume"),r.resume()),e};function vUt(e){return function(){var r=e._readableState;br("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&nDe(e,"data")&&(r.flowing=!0,cH(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=cDe(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=F2.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?l4(this):n.reading||process.nextTick(bUt,this)),r};Ur.prototype.addListener=Ur.prototype.on;Ur.prototype.removeListener=function(e,t){var r=F2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(sDe,this),r};Ur.prototype.removeAllListeners=function(e){var t=F2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(sDe,this),t};function sDe(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 bUt(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,yUt(this,e)),e.paused=!1,this};function yUt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(xUt,e,t))}function xUt(e,t){br("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),cH(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 cH(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<iH.length;a++)e.on(iH[a],this.emit.bind(this,iH[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 rH===void 0&&(rH=$Ce()),rH(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=uDe;Object.defineProperty(Ur.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function uDe(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 oH(e){var t=e._readableState;br("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(_Ut,t,e))}function _Ut(e,t){if(br("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&e.length===0&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}typeof Symbol=="function"&&(Ur.from=function(e,t){return nH===void 0&&(nH=eDe()),nH(Ur,e,t)});function cDe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var lH=v((X3r,dDe)=>{"use strict";dDe.exports=Xl;var f4=Jd().codes,EUt=f4.ERR_METHOD_NOT_IMPLEMENTED,wUt=f4.ERR_MULTIPLE_CALLBACK,AUt=f4.ERR_TRANSFORM_ALREADY_TRANSFORMING,SUt=f4.ERR_TRANSFORM_WITH_LENGTH_0,d4=p0();tr()(Xl,d4);function TUt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new wUt);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);d4.call(this,e),this._transformState={afterTransform:TUt.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",CUt)}function CUt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){fDe(e,t,r)}):fDe(this,null,null)}Xl.prototype.push=function(e,t){return this._transformState.needTransform=!1,d4.prototype.push.call(this,e,t)};Xl.prototype._transform=function(e,t,r){r(new EUt("_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){d4.prototype._destroy.call(this,e,function(r){t(r)})};function fDe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new SUt;if(e._transformState.transforming)throw new AUt;return e.push(null)}});var mDe=v((Y3r,pDe)=>{"use strict";pDe.exports=B2;var hDe=lH();tr()(B2,hDe);function B2(e){if(!(this instanceof B2))return new B2(e);hDe.call(this,e)}B2.prototype._transform=function(e,t,r){r(null,e)}});var xDe=v(($3r,yDe)=>{"use strict";var fH;function DUt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var bDe=Jd().codes,FUt=bDe.ERR_MISSING_ARGS,BUt=bDe.ERR_STREAM_DESTROYED;function gDe(e){if(e)throw e}function RUt(e){return e.setHeader&&typeof e.abort=="function"}function OUt(e,t,r,n){n=DUt(n);var i=!1;e.on("close",function(){i=!0}),fH===void 0&&(fH=a4()),fH(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,RUt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new BUt("pipe"))}}}function vDe(e){e()}function kUt(e,t){return e.pipe(t)}function IUt(e){return!e.length||typeof e[e.length-1]!="function"?gDe:e.pop()}function PUt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=IUt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new FUt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return OUt(o,u,c,function(l){i||(i=l),l&&a.forEach(vDe),!u&&(a.forEach(vDe),n(i))})});return t.reduce(kUt)}yDe.exports=PUt});var dH=v((Bs,O2)=>{var R2=require("stream");process.env.READABLE_STREAM==="disable"&&R2?(O2.exports=R2.Readable,Object.assign(O2.exports,R2),O2.exports.Stream=R2):(Bs=O2.exports=$z(),Bs.Stream=R2||Bs,Bs.Readable=Bs,Bs.Writable=Kz(),Bs.Duplex=p0(),Bs.Transform=lH(),Bs.PassThrough=mDe(),Bs.finished=a4(),Bs.pipeline=xDe())});var pH=v((J3r,_De)=>{var jUt=require("stream").Stream,LUt=dH().PassThrough,hH=_De.exports={};hH.isStream=function(e){return e instanceof jUt};hH.normalizeInputSource=function(e){if(e===null)return Buffer.alloc(0);if(typeof e=="string")return Buffer.from(e);if(hH.isStream(e)&&!e._readableState){var t=new LUt;return e.pipe(t),t}return e}});var gH=v((Q3r,wDe)=>{var MUt=require("util").inherits,mH=dH().Transform,qUt=JF(),EDe=pH(),No=wDe.exports=function(e){if(!(this instanceof No))return new No(e);mH.call(this,e),this.offset=0,this._archive={finish:!1,finished:!1,processing:!1}};MUt(No,mH);No.prototype._appendBuffer=function(e,t,r){};No.prototype._appendStream=function(e,t,r){};No.prototype._emitErrorCallback=function(e){e&&this.emit("error",e)};No.prototype._finish=function(e){};No.prototype._normalizeEntry=function(e){};No.prototype._transform=function(e,t,r){r(null,e)};No.prototype.entry=function(e,t,r){if(t=t||null,typeof r!="function"&&(r=this._emitErrorCallback.bind(this)),!(e instanceof qUt)){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=EDe.normalizeInputSource(t),Buffer.isBuffer(t))this._appendBuffer(e,t,r);else if(EDe.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};No.prototype.finish=function(){if(this._archive.processing){this._archive.finish=!0;return}this._finish()};No.prototype.getBytesWritten=function(){return this.offset};No.prototype.write=function(e,t){return e&&(this.offset+=e.length),mH.prototype.write.call(this,e,t)}});var xH=v((Z3r,SDe)=>{var rh=require("buffer").Buffer,vH=[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"&&(vH=new Int32Array(vH));function ADe(e){if(rh.isBuffer(e))return e;var t=typeof rh.alloc=="function"&&typeof rh.from=="function";if(typeof e=="number")return t?rh.alloc(e):new rh(e);if(typeof e=="string")return t?rh.from(e):new rh(e);throw new Error("input must be buffer, number, or string, received "+typeof e)}function NUt(e){var t=ADe(4);return t.writeInt32BE(e,0),t}function bH(e,t){e=ADe(e),rh.isBuffer(t)&&(t=t.readUInt32BE(0));for(var r=~~t^-1,n=0;n<e.length;n++)r=vH[(r^e[n])&255]^r>>>8;return r^-1}function yH(){return NUt(bH.apply(null,arguments))}yH.signed=function(){return bH.apply(null,arguments)};yH.unsigned=function(){return bH.apply(null,arguments)>>>0};SDe.exports=yH});var _H=v((e8r,TDe)=>{TDe.exports=require("stream")});var ODe=v((t8r,RDe)=>{"use strict";function CDe(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 DDe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?CDe(Object(r),!0).forEach(function(n){UUt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):CDe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function UUt(e,t,r){return t=BDe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function GUt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FDe(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,BDe(n.key),n)}}function zUt(e,t,r){return t&&FDe(e.prototype,t),r&&FDe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function BDe(e){var t=HUt(e,"string");return typeof t=="symbol"?t:String(t)}function HUt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var WUt=require("buffer"),h4=WUt.Buffer,VUt=require("util"),EH=VUt.inspect,KUt=EH&&EH.custom||"inspect";function XUt(e,t,r){h4.prototype.copy.call(e,t,r)}RDe.exports=function(){function e(){GUt(this,e),this.head=null,this.tail=null,this.length=0}return zUt(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 h4.alloc(0);for(var n=h4.allocUnsafe(r>>>0),i=this.head,a=0;i;)XUt(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=h4.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:KUt,value:function(r,n){return EH(this,DDe(DDe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var AH=v((r8r,IDe)=>{"use strict";function YUt(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(wH,this,e)):process.nextTick(wH,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(p4,r):(r._writableState.errorEmitted=!0,process.nextTick(kDe,r,a)):process.nextTick(kDe,r,a):t?(process.nextTick(p4,r),t(a)):process.nextTick(p4,r)}),this)}function kDe(e,t){wH(e,t),p4(e)}function p4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function $Ut(){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 wH(e,t){e.emit("error",t)}function JUt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}IDe.exports={destroy:YUt,undestroy:$Ut,errorOrDestroy:JUt}});var nh=v((n8r,LDe)=>{"use strict";var jDe={};function Rs(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,jDe[e]=i}function PDe(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 QUt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function ZUt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function eGt(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}Rs("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError);Rs("ERR_INVALID_ARG_TYPE",function(e,t,r){let n;typeof t=="string"&&QUt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(ZUt(e," argument"))i=`The ${e} ${n} ${PDe(t,"type")}`;else{let a=eGt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${PDe(t,"type")}`}return i+=`. Received type ${typeof r}`,i},TypeError);Rs("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");Rs("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});Rs("ERR_STREAM_PREMATURE_CLOSE","Premature close");Rs("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});Rs("ERR_MULTIPLE_CALLBACK","Callback called multiple times");Rs("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");Rs("ERR_STREAM_WRITE_AFTER_END","write after end");Rs("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Rs("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);Rs("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");LDe.exports.codes=jDe});var SH=v((i8r,MDe)=>{"use strict";var tGt=nh().codes.ERR_INVALID_OPT_VALUE;function rGt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function nGt(e,t,r,n){var i=rGt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new tGt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}MDe.exports={getHighWaterMark:nGt}});var DH=v((a8r,HDe)=>{"use strict";HDe.exports=ui;function NDe(e){var t=this;this.next=null,this.entry=null,this.finish=function(){BGt(t,e)}}var Pb;ui.WritableState=I2;var iGt={deprecate:lp()},UDe=_H(),g4=require("buffer").Buffer,aGt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function oGt(e){return g4.from(e)}function sGt(e){return g4.isBuffer(e)||e instanceof aGt}var CH=AH(),uGt=SH(),cGt=uGt.getHighWaterMark,ih=nh().codes,lGt=ih.ERR_INVALID_ARG_TYPE,fGt=ih.ERR_METHOD_NOT_IMPLEMENTED,dGt=ih.ERR_MULTIPLE_CALLBACK,hGt=ih.ERR_STREAM_CANNOT_PIPE,pGt=ih.ERR_STREAM_DESTROYED,mGt=ih.ERR_STREAM_NULL_VALUES,gGt=ih.ERR_STREAM_WRITE_AFTER_END,vGt=ih.ERR_UNKNOWN_ENCODING,jb=CH.errorOrDestroy;tr()(ui,UDe);function bGt(){}function I2(e,t,r){Pb=Pb||b0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Pb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=cGt(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){SGt(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 NDe(this)}I2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(I2.prototype,"buffer",{get:iGt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var m4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(m4=Function.prototype[Symbol.hasInstance],Object.defineProperty(ui,Symbol.hasInstance,{value:function(t){return m4.call(this,t)?!0:this!==ui?!1:t&&t._writableState instanceof I2}})):m4=function(t){return t instanceof this};function ui(e){Pb=Pb||b0();var t=this instanceof Pb;if(!t&&!m4.call(ui,this))return new ui(e);this._writableState=new I2(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)),UDe.call(this)}ui.prototype.pipe=function(){jb(this,new hGt)};function yGt(e,t){var r=new gGt;jb(e,r),process.nextTick(t,r)}function xGt(e,t,r,n){var i;return r===null?i=new mGt:typeof r!="string"&&!t.objectMode&&(i=new lGt("chunk",["string","Buffer"],r)),i?(jb(e,i),process.nextTick(n,i),!1):!0}ui.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&sGt(e);return a&&!g4.isBuffer(e)&&(e=oGt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=bGt),n.ending?yGt(this,r):(a||xGt(this,n,e,r))&&(n.pendingcb++,i=EGt(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&&GDe(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 vGt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ui.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function _Gt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=g4.from(t,r)),t}Object.defineProperty(ui.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function EGt(e,t,r,n,i,a){if(!r){var o=_Gt(t,n,i);n!==o&&(r=!0,i="buffer",n=o)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:a,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else TH(e,t,!1,s,n,i,a);return u}function TH(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new pGt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function wGt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(k2,e,t),e._writableState.errorEmitted=!0,jb(e,n)):(i(n),e._writableState.errorEmitted=!0,jb(e,n),k2(e,t))}function AGt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function SGt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new dGt;if(AGt(r),t)wGt(e,r,n,t,i);else{var a=zDe(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&GDe(e,r),n?process.nextTick(qDe,e,r,a,i):qDe(e,r,a,i)}}function qDe(e,t,r,n){r||TGt(e,t),t.pendingcb--,n(),k2(e,t)}function TGt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function GDe(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,TH(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 NDe(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(TH(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 fGt("_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||FGt(this,n,r),this};Object.defineProperty(ui.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function zDe(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function CGt(e,t){e._final(function(r){t.pendingcb--,r&&jb(e,r),t.prefinished=!0,e.emit("prefinish"),k2(e,t)})}function DGt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(CGt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function k2(e,t){var r=zDe(t);if(r&&(DGt(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 FGt(e,t,r){t.ending=!0,k2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function BGt(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=CH.destroy;ui.prototype._undestroy=CH.undestroy;ui.prototype._destroy=function(e,t){t(e)}});var b0=v((o8r,VDe)=>{"use strict";var RGt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};VDe.exports=Pc;var WDe=RH(),BH=DH();tr()(Pc,WDe);for(FH=RGt(BH.prototype),v4=0;v4<FH.length;v4++)b4=FH[v4],Pc.prototype[b4]||(Pc.prototype[b4]=BH.prototype[b4]);var FH,b4,v4;function Pc(e){if(!(this instanceof Pc))return new Pc(e);WDe.call(this,e),BH.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",OGt)))}Object.defineProperty(Pc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Pc.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Pc.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function OGt(){this._writableState.ended||process.nextTick(kGt,this)}function kGt(e){e.end()}Object.defineProperty(Pc.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 IH=v(XDe=>{"use strict";var kH=Us().Buffer,KDe=kH.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 IGt(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 PGt(e){var t=IGt(e);if(typeof t!="string"&&(kH.isEncoding===KDe||!KDe(e)))throw new Error("Unknown encoding: "+e);return t||e}XDe.StringDecoder=P2;function P2(e){this.encoding=PGt(e);var t;switch(this.encoding){case"utf16le":this.text=UGt,this.end=GGt,t=4;break;case"utf8":this.fillLast=MGt,t=4;break;case"base64":this.text=zGt,this.end=HGt,t=3;break;default:this.write=WGt,this.end=VGt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=kH.allocUnsafe(t)}P2.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||""};P2.prototype.end=NGt;P2.prototype.text=qGt;P2.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 OH(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function jGt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=OH(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=OH(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=OH(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function LGt(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 MGt(e){var t=this.lastTotal-this.lastNeed,r=LGt(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 qGt(e,t){var r=jGt(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 NGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function UGt(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 GGt(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 zGt(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 HGt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function WGt(e){return e.toString(this.encoding)}function VGt(e){return e&&e.length?this.write(e):""}});var y4=v((u8r,JDe)=>{"use strict";var YDe=nh().codes.ERR_STREAM_PREMATURE_CLOSE;function KGt(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 XGt(){}function YGt(e){return e.setHeader&&typeof e.abort=="function"}function $De(e,t,r){if(typeof t=="function")return $De(e,null,t);t||(t={}),r=KGt(r||XGt);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(p){r.call(e,p)},f=function(){var p;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(p=new YDe),r.call(e,p);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(p=new YDe),r.call(e,p)},d=function(){e.req.on("finish",s)};return YGt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}JDe.exports=$De});var ZDe=v((c8r,QDe)=>{"use strict";var x4;function ah(e,t,r){return t=$Gt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $Gt(e){var t=JGt(e,"string");return typeof t=="symbol"?t:String(t)}function JGt(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 QGt=y4(),oh=Symbol("lastResolve"),y0=Symbol("lastReject"),j2=Symbol("error"),_4=Symbol("ended"),x0=Symbol("lastPromise"),PH=Symbol("handlePromise"),_0=Symbol("stream");function sh(e,t){return{value:e,done:t}}function ZGt(e){var t=e[oh];if(t!==null){var r=e[_0].read();r!==null&&(e[x0]=null,e[oh]=null,e[y0]=null,t(sh(r,!1)))}}function ezt(e){process.nextTick(ZGt,e)}function tzt(e,t){return function(r,n){e.then(function(){if(t[_4]){r(sh(void 0,!0));return}t[PH](r,n)},n)}}var rzt=Object.getPrototypeOf(function(){}),nzt=Object.setPrototypeOf((x4={get stream(){return this[_0]},next:function(){var t=this,r=this[j2];if(r!==null)return Promise.reject(r);if(this[_4])return Promise.resolve(sh(void 0,!0));if(this[_0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[j2]?s(t[j2]):o(sh(void 0,!0))})});var n=this[x0],i;if(n)i=new Promise(tzt(n,this));else{var a=this[_0].read();if(a!==null)return Promise.resolve(sh(a,!1));i=new Promise(this[PH])}return this[x0]=i,i}},ah(x4,Symbol.asyncIterator,function(){return this}),ah(x4,"return",function(){var t=this;return new Promise(function(r,n){t[_0].destroy(null,function(i){if(i){n(i);return}r(sh(void 0,!0))})})}),x4),rzt),izt=function(t){var r,n=Object.create(nzt,(r={},ah(r,_0,{value:t,writable:!0}),ah(r,oh,{value:null,writable:!0}),ah(r,y0,{value:null,writable:!0}),ah(r,j2,{value:null,writable:!0}),ah(r,_4,{value:t._readableState.endEmitted,writable:!0}),ah(r,PH,{value:function(a,o){var s=n[_0].read();s?(n[x0]=null,n[oh]=null,n[y0]=null,a(sh(s,!1))):(n[oh]=a,n[y0]=o)},writable:!0}),r));return n[x0]=null,QGt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[y0];a!==null&&(n[x0]=null,n[oh]=null,n[y0]=null,a(i)),n[j2]=i;return}var o=n[oh];o!==null&&(n[x0]=null,n[oh]=null,n[y0]=null,o(sh(void 0,!0))),n[_4]=!0}),t.on("readable",ezt.bind(null,n)),n};QDe.exports=izt});var nFe=v((l8r,rFe)=>{"use strict";function eFe(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 azt(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(u){eFe(a,n,i,o,s,"next",u)}function s(u){eFe(a,n,i,o,s,"throw",u)}o(void 0)})}}function tFe(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 ozt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?tFe(Object(r),!0).forEach(function(n){szt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function szt(e,t,r){return t=uzt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uzt(e){var t=czt(e,"string");return typeof t=="symbol"?t:String(t)}function czt(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lzt=nh().codes.ERR_INVALID_ARG_TYPE;function fzt(e,t,r){var n;if(t&&typeof t.next=="function")n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new lzt("iterable",["Iterable"],t);var i=new e(ozt({objectMode:!0},r)),a=!1;i._read=function(){a||(a=!0,o())};function o(){return s.apply(this,arguments)}function s(){return s=azt(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}rFe.exports=fzt});var RH=v((d8r,hFe)=>{"use strict";hFe.exports=Gr;var Lb;Gr.ReadableState=sFe;var f8r=require("events").EventEmitter,oFe=function(t,r){return t.listeners(r).length},M2=_H(),E4=require("buffer").Buffer,dzt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function hzt(e){return E4.from(e)}function pzt(e){return E4.isBuffer(e)||e instanceof dzt}var jH=require("util"),yr;jH&&jH.debuglog?yr=jH.debuglog("stream"):yr=function(){};var mzt=ODe(),zH=AH(),gzt=SH(),vzt=gzt.getHighWaterMark,w4=nh().codes,bzt=w4.ERR_INVALID_ARG_TYPE,yzt=w4.ERR_STREAM_PUSH_AFTER_EOF,xzt=w4.ERR_METHOD_NOT_IMPLEMENTED,_zt=w4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Mb,LH,MH;tr()(Gr,M2);var L2=zH.errorOrDestroy,qH=["error","close","destroy","pause","resume"];function Ezt(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 sFe(e,t,r){Lb=Lb||b0(),e=e||{},typeof r!="boolean"&&(r=t instanceof Lb),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=vzt(this,e,"readableHighWaterMark",r),this.buffer=new mzt,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=IH().StringDecoder),this.decoder=new Mb(e.encoding),this.encoding=e.encoding)}function Gr(e){if(Lb=Lb||b0(),!(this instanceof Gr))return new Gr(e);var t=this instanceof Lb;this._readableState=new sFe(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),M2.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=zH.destroy;Gr.prototype._undestroy=zH.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=E4.from(e,t),t=""),n=!0),uFe(this,e,t,!1,n)};Gr.prototype.unshift=function(e){return uFe(this,e,null,!0,!1)};function uFe(e,t,r,n,i){yr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,Szt(e,a);else{var o;if(i||(o=wzt(a,t)),o)L2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==E4.prototype&&(t=hzt(t)),n)a.endEmitted?L2(e,new _zt):NH(e,a,t,!0);else if(a.ended)L2(e,new yzt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?NH(e,a,t,!1):GH(e,a)):NH(e,a,t,!1)}else n||(a.reading=!1,GH(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function NH(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&&A4(e)),GH(e,t)}function wzt(e,t){var r;return!pzt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new bzt("chunk",["string","Buffer","Uint8Array"],t)),r}Gr.prototype.isPaused=function(){return this._readableState.flowing===!1};Gr.prototype.setEncoding=function(e){Mb||(Mb=IH().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 iFe=1073741824;function Azt(e){return e>=iFe?e=iFe:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function aFe(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=Azt(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?UH(this):A4(this),null;if(e=aFe(e,t),e===0&&t.ended)return t.length===0&&UH(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=aFe(r,t)));var i;return e>0?i=fFe(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 Szt(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?A4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,cFe(e)))}}function A4(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(cFe,e))}function cFe(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,HH(e)}function GH(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(Tzt,e,t))}function Tzt(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){L2(this,new xzt("_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=Czt(r);e.on("drain",u);var c=!1;function l(){yr("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){yr("ondata");var x=e.write(g);yr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&dFe(n.pipes,e)!==-1)&&!c&&(yr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){yr("onerror",g),b(),e.removeListener("error",d),oFe(e,"error")===0&&L2(e,g)}Ezt(e,"error",d);function h(){e.removeListener("finish",p),b()}e.once("close",h);function p(){yr("onfinish"),e.removeListener("close",h),b()}e.once("finish",p);function b(){yr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(yr("pipe resume"),r.resume()),e};function Czt(e){return function(){var r=e._readableState;yr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&oFe(e,"data")&&(r.flowing=!0,HH(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=dFe(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=M2.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?A4(this):n.reading||process.nextTick(Dzt,this)),r};Gr.prototype.addListener=Gr.prototype.on;Gr.prototype.removeListener=function(e,t){var r=M2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(lFe,this),r};Gr.prototype.removeAllListeners=function(e){var t=M2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(lFe,this),t};function lFe(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 Dzt(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,Fzt(this,e)),e.paused=!1,this};function Fzt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Bzt,e,t))}function Bzt(e,t){yr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),HH(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 HH(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<qH.length;a++)e.on(qH[a],this.emit.bind(this,qH[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 LH===void 0&&(LH=ZDe()),LH(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=fFe;Object.defineProperty(Gr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function fFe(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;yr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Rzt,t,e))}function Rzt(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 MH===void 0&&(MH=nFe()),MH(Gr,e,t)});function dFe(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var WH=v((h8r,mFe)=>{"use strict";mFe.exports=Yl;var S4=nh().codes,Ozt=S4.ERR_METHOD_NOT_IMPLEMENTED,kzt=S4.ERR_MULTIPLE_CALLBACK,Izt=S4.ERR_TRANSFORM_ALREADY_TRANSFORMING,Pzt=S4.ERR_TRANSFORM_WITH_LENGTH_0,T4=b0();tr()(Yl,T4);function jzt(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 Yl(e){if(!(this instanceof Yl))return new Yl(e);T4.call(this,e),this._transformState={afterTransform:jzt.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",Lzt)}function Lzt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){pFe(e,t,r)}):pFe(this,null,null)}Yl.prototype.push=function(e,t){return this._transformState.needTransform=!1,T4.prototype.push.call(this,e,t)};Yl.prototype._transform=function(e,t,r){r(new Ozt("_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){T4.prototype._destroy.call(this,e,function(r){t(r)})};function pFe(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Pzt;if(e._transformState.transforming)throw new Izt;return e.push(null)}});var bFe=v((p8r,vFe)=>{"use strict";vFe.exports=q2;var gFe=WH();tr()(q2,gFe);function q2(e){if(!(this instanceof q2))return new q2(e);gFe.call(this,e)}q2.prototype._transform=function(e,t,r){r(null,e)}});var wFe=v((m8r,EFe)=>{"use strict";var VH;function Mzt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var _Fe=nh().codes,qzt=_Fe.ERR_MISSING_ARGS,Nzt=_Fe.ERR_STREAM_DESTROYED;function yFe(e){if(e)throw e}function Uzt(e){return e.setHeader&&typeof e.abort=="function"}function Gzt(e,t,r,n){n=Mzt(n);var i=!1;e.on("close",function(){i=!0}),VH===void 0&&(VH=y4()),VH(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,Uzt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new Nzt("pipe"))}}}function xFe(e){e()}function zzt(e,t){return e.pipe(t)}function Hzt(e){return!e.length||typeof e[e.length-1]!="function"?yFe:e.pop()}function Wzt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Hzt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new qzt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return Gzt(o,u,c,function(l){i||(i=l),l&&a.forEach(xFe),!u&&(a.forEach(xFe),n(i))})});return t.reduce(zzt)}EFe.exports=Wzt});var AFe=v((Os,U2)=>{var N2=require("stream");process.env.READABLE_STREAM==="disable"&&N2?(U2.exports=N2.Readable,Object.assign(U2.exports,N2),U2.exports.Stream=N2):(Os=U2.exports=RH(),Os.Stream=N2||Os,Os.Readable=Os,Os.Writable=DH(),Os.Duplex=b0(),Os.Transform=WH(),Os.PassThrough=bFe(),Os.finished=y4(),Os.pipeline=wFe())});var XH=v(KH=>{var SFe;(function(e){typeof DO_NOT_EXPORT_CRC>"u"?typeof KH=="object"?e(KH):typeof define=="function"&&define.amd?define(function(){var t={};return e(t),t}):e(SFe={}):e(SFe={})})(function(e){e.version="1.2.2";function t(){for(var B=0,N=new Array(256),C=0;C!=256;++C)B=C,B=B&1?-306674912^B>>>1:B>>>1,B=B&1?-306674912^B>>>1:B>>>1,B=B&1?-306674912^B>>>1:B>>>1,B=B&1?-306674912^B>>>1:B>>>1,B=B&1?-306674912^B>>>1:B>>>1,B=B&1?-306674912^B>>>1:B>>>1,B=B&1?-306674912^B>>>1:B>>>1,B=B&1?-306674912^B>>>1:B>>>1,N[C]=B;return typeof Int32Array<"u"?new Int32Array(N):N}var r=t();function n(B){var N=0,C=0,k=0,I=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(k=0;k!=256;++k)I[k]=B[k];for(k=0;k!=256;++k)for(C=B[k],N=256+k;N<4096;N+=256)C=I[N]=C>>>8^B[C&255];var U=[];for(k=1;k!=16;++k)U[k-1]=typeof Int32Array<"u"?I.subarray(k*256,k*256+256):I.slice(k*256,k*256+256);return U}var i=n(r),a=i[0],o=i[1],s=i[2],u=i[3],c=i[4],l=i[5],f=i[6],d=i[7],h=i[8],p=i[9],b=i[10],g=i[11],x=i[12],w=i[13],S=i[14];function F(B,N){for(var C=N^-1,k=0,I=B.length;k<I;)C=C>>>8^r[(C^B.charCodeAt(k++))&255];return~C}function D(B,N){for(var C=N^-1,k=B.length-15,I=0;I<k;)C=S[B[I++]^C&255]^w[B[I++]^C>>8&255]^x[B[I++]^C>>16&255]^g[B[I++]^C>>>24]^b[B[I++]]^p[B[I++]]^h[B[I++]]^d[B[I++]]^f[B[I++]]^l[B[I++]]^c[B[I++]]^u[B[I++]]^s[B[I++]]^o[B[I++]]^a[B[I++]]^r[B[I++]];for(k+=15;I<k;)C=C>>>8^r[(C^B[I++])&255];return~C}function j(B,N){for(var C=N^-1,k=0,I=B.length,U=0,Y=0;k<I;)U=B.charCodeAt(k++),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=B.charCodeAt(k++)&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 CFe=v((v8r,TFe)=>{"use strict";var{Transform:Vzt}=AFe(),Kzt=XH(),YH=class extends Vzt{constructor(t){super(t),this.checksum=Buffer.allocUnsafe(4),this.checksum.writeInt32BE(0,0),this.rawSize=0}_transform(t,r,n){t&&(this.checksum=Kzt.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}};TFe.exports=YH});var FFe=v((b8r,DFe)=>{"use strict";var{DeflateRaw:Xzt}=require("zlib"),Yzt=XH(),$H=class extends Xzt{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=Yzt.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}};DFe.exports=$H});var JH=v((y8r,BFe)=>{"use strict";BFe.exports={CRC32Stream:CFe(),DeflateCRC32Stream:FFe()}});var kFe=v((w8r,OFe)=>{var $zt=require("util").inherits,Jzt=xH(),{CRC32Stream:Qzt}=JH(),{DeflateCRC32Stream:Zzt}=JH(),RFe=gH(),x8r=qz(),_8r=Lz(),sr=Mz(),E8r=pH(),Ut=QF(),oa=OFe.exports=function(e){if(!(this instanceof oa))return new oa(e);e=this.options=this._defaults(e),RFe.call(this,e),this._entry=null,this._entries=[],this._archive={centralLength:0,centralOffset:0,comment:"",finish:!1,finished:!1,processing:!1,forceZip64:e.forceZip64,forceLocalTime:e.forceLocalTime}};$zt(oa,RFe);oa.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()};oa.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(Jzt.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}};oa.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)};oa.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};oa.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()};oa.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}};oa.prototype._smartStream=function(e,t){var r=e.getMethod()===sr.METHOD_DEFLATED,n=r?new Zzt(this.options.zlib):new Qzt,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};oa.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)};oa.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))};oa.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)};oa.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())))};oa.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};oa.prototype.getComment=function(e){return this._archive.comment!==null?this._archive.comment:""};oa.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};oa.prototype.setComment=function(e){this._archive.comment=e}});var QH=v((A8r,IFe)=>{IFe.exports={ArchiveEntry:JF(),ZipArchiveEntry:qz(),ArchiveOutputStream:gH(),ZipArchiveOutputStream:kFe()}});var jFe=v((S8r,PFe)=>{var eHt=require("util").inherits,eW=QH().ZipArchiveOutputStream,tHt=QH().ZipArchiveEntry,ZH=Tb(),qb=PFe.exports=function(e){if(!(this instanceof qb))return new qb(e);e=this.options=e||{},e.zlib=e.zlib||{},eW.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)};eHt(qb,eW);qb.prototype._normalizeFileData=function(e){e=ZH.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=ZH.sanitizePath(e.name),!r&&e.name.slice(-1)==="/"?(t=!0,e.type="directory"):t&&(e.name+="/")),(t||r)&&(e.store=!0),e.date=ZH.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 tHt(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)),eW.prototype.entry.call(this,n,e,r)};qb.prototype.finalize=function(){this.finish()}});var MFe=v((T8r,LFe)=>{var rHt=jFe(),nHt=Tb(),uh=function(e){if(!(this instanceof uh))return new uh(e);e=this.options=nHt.defaults(e,{comment:"",forceUTC:!1,namePrependSlash:!1,store:!1}),this.supports={directory:!0,symlink:!0},this.engine=new rHt(e)};uh.prototype.append=function(e,t,r){this.engine.entry(e,t,r)};uh.prototype.finalize=function(){this.engine.finalize()};uh.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};uh.prototype.pipe=function(){return this.engine.pipe.apply(this.engine,arguments)};uh.prototype.unpipe=function(){return this.engine.unpipe.apply(this.engine,arguments)};LFe.exports=uh});var nW=v(Ub=>{var iHt=Buffer.alloc,aHt="0000000000000000000",oHt="7777777777777777777",qFe="0".charCodeAt(0),NFe=Buffer.from("ustar\0","binary"),sHt=Buffer.from("00","binary"),uHt=Buffer.from("ustar ","binary"),cHt=Buffer.from(" \0","binary"),lHt=parseInt("7777",8),G2=257,rW=263,fHt=function(e,t,r){return typeof e!="number"?r:(e=~~e,e>=t?t:e>=0||(e+=t,e>=0)?e:0)},dHt=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},hHt=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},UFe=function(e,t,r,n){for(;r<n;r++)if(e[r]===t)return r;return n},GFe=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},ch=function(e,t){return e=e.toString(8),e.length>t?oHt.slice(0,t)+" ":aHt.slice(0,t-e.length)+e+" "};function pHt(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 lh=function(e,t,r){if(e=e.slice(t,t+r),t=0,e[t]&128)return pHt(e);for(;t<e.length&&e[t]===32;)t++;for(var n=fHt(UFe(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,UFe(e,0,t,t+r)).toString(n)},tW=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+=tW(" path="+e.name+`
171
171
  `)),e.linkname&&(t+=tW(" linkpath="+e.linkname+`
172
172
  `));var r=e.pax;if(r)for(var n in r)t+=tW(" "+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=iHt(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(ch(e.mode&lHt,6),100),t.write(ch(e.uid,6),108),t.write(ch(e.gid,6),116),t.write(ch(e.size,11),124),t.write(ch(e.mtime.getTime()/1e3|0,11),136),t[156]=qFe+hHt(e.type),e.linkname&&t.write(e.linkname,157),NFe.copy(t,G2),sHt.copy(t,rW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ch(e.devmajor||0,6),329),t.write(ch(e.devminor||0,6),337),n&&t.write(n,345),t.write(ch(GFe(t),6),148),t)};Ub.decode=function(e,t,r){var n=e[156]===0?0:e[156]-qFe,i=Nb(e,0,100,t),a=lh(e,100,8),o=lh(e,108,8),s=lh(e,116,8),u=lh(e,124,12),c=lh(e,136,12),l=dHt(n),f=e[157]===0?null:Nb(e,157,100,t),d=Nb(e,265,32),h=Nb(e,297,32),p=lh(e,329,8),b=lh(e,337,8),g=GFe(e);if(g===8*32)return null;if(g!==lh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(NFe.compare(e,G2,G2+6)===0)e[345]&&(i=Nb(e,345,155,t)+"/"+i);else if(!(uHt.compare(e,G2,G2+6)===0&&cHt.compare(e,rW,rW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:d,gname:h,devmajor:p,devminor:b}}});var iW=v((D8r,zFe)=>{zFe.exports=require("stream")});var YFe=v((F8r,XFe)=>{"use strict";function HFe(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 WFe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HFe(Object(r),!0).forEach(function(n){mHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mHt(e,t,r){return t=KFe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KFe(n.key),n)}}function vHt(e,t,r){return t&&VFe(e.prototype,t),r&&VFe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function KFe(e){var t=bHt(e,"string");return typeof t=="symbol"?t:String(t)}function bHt(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 yHt=require("buffer"),C4=yHt.Buffer,xHt=require("util"),aW=xHt.inspect,_Ht=aW&&aW.custom||"inspect";function EHt(e,t,r){C4.prototype.copy.call(e,t,r)}XFe.exports=function(){function e(){gHt(this,e),this.head=null,this.tail=null,this.length=0}return vHt(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 C4.alloc(0);for(var n=C4.allocUnsafe(r>>>0),i=this.head,a=0;i;)EHt(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=C4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:_Ht,value:function(r,n){return aW(this,WFe(WFe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var sW=v((B8r,JFe)=>{"use strict";function wHt(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(oW,this,e)):process.nextTick(oW,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(D4,r):(r._writableState.errorEmitted=!0,process.nextTick($Fe,r,a)):process.nextTick($Fe,r,a):t?(process.nextTick(D4,r),t(a)):process.nextTick(D4,r)}),this)}function $Fe(e,t){oW(e,t),D4(e)}function D4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function AHt(){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 oW(e,t){e.emit("error",t)}function SHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}JFe.exports={destroy:wHt,undestroy:AHt,errorOrDestroy:SHt}});var fh=v((R8r,e4e)=>{"use strict";var ZFe={};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,ZFe[e]=i}function QFe(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 THt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function CHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function DHt(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"&&THt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(CHt(e," argument"))i=`The ${e} ${n} ${QFe(t,"type")}`;else{let a=DHt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${QFe(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");e4e.exports.codes=ZFe});var uW=v((O8r,t4e)=>{"use strict";var FHt=fh().codes.ERR_INVALID_OPT_VALUE;function BHt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function RHt(e,t,r,n){var i=BHt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new FHt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}t4e.exports={getHighWaterMark:RHt}});var fW=v((k8r,s4e)=>{"use strict";s4e.exports=ci;function n4e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){iWt(t,e)}}var Gb;ci.WritableState=H2;var OHt={deprecate:lp()},i4e=iW(),B4=require("buffer").Buffer,kHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function IHt(e){return B4.from(e)}function PHt(e){return B4.isBuffer(e)||e instanceof kHt}var lW=sW(),jHt=uW(),LHt=jHt.getHighWaterMark,dh=fh().codes,MHt=dh.ERR_INVALID_ARG_TYPE,qHt=dh.ERR_METHOD_NOT_IMPLEMENTED,NHt=dh.ERR_MULTIPLE_CALLBACK,UHt=dh.ERR_STREAM_CANNOT_PIPE,GHt=dh.ERR_STREAM_DESTROYED,zHt=dh.ERR_STREAM_NULL_VALUES,HHt=dh.ERR_STREAM_WRITE_AFTER_END,WHt=dh.ERR_UNKNOWN_ENCODING,zb=lW.errorOrDestroy;tr()(ci,i4e);function VHt(){}function H2(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=LHt(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){ZHt(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 n4e(this)}H2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(H2.prototype,"buffer",{get:OHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var F4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F4=Function.prototype[Symbol.hasInstance],Object.defineProperty(ci,Symbol.hasInstance,{value:function(t){return F4.call(this,t)?!0:this!==ci?!1:t&&t._writableState instanceof H2}})):F4=function(t){return t instanceof this};function ci(e){Gb=Gb||E0();var t=this instanceof Gb;if(!t&&!F4.call(ci,this))return new ci(e);this._writableState=new H2(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)),i4e.call(this)}ci.prototype.pipe=function(){zb(this,new UHt)};function KHt(e,t){var r=new HHt;zb(e,r),process.nextTick(t,r)}function XHt(e,t,r,n){var i;return r===null?i=new zHt:typeof r!="string"&&!t.objectMode&&(i=new MHt("chunk",["string","Buffer"],r)),i?(zb(e,i),process.nextTick(n,i),!1):!0}ci.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&PHt(e);return a&&!B4.isBuffer(e)&&(e=IHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=VHt),n.ending?KHt(this,r):(a||XHt(this,n,e,r))&&(n.pendingcb++,i=$Ht(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&&a4e(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 WHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ci.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function YHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=B4.from(t,r)),t}Object.defineProperty(ci.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $Ht(e,t,r,n,i,a){if(!r){var o=YHt(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 cW(e,t,!1,s,n,i,a);return u}function cW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new GHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function JHt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(z2,e,t),e._writableState.errorEmitted=!0,zb(e,n)):(i(n),e._writableState.errorEmitted=!0,zb(e,n),z2(e,t))}function QHt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function ZHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new NHt;if(QHt(r),t)JHt(e,r,n,t,i);else{var a=o4e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&a4e(e,r),n?process.nextTick(r4e,e,r,a,i):r4e(e,r,a,i)}}function r4e(e,t,r,n){r||eWt(e,t),t.pendingcb--,n(),z2(e,t)}function eWt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function a4e(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,cW(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 n4e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(cW(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 qHt("_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||nWt(this,n,r),this};Object.defineProperty(ci.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o4e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function tWt(e,t){e._final(function(r){t.pendingcb--,r&&zb(e,r),t.prefinished=!0,e.emit("prefinish"),z2(e,t)})}function rWt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(tWt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function z2(e,t){var r=o4e(t);if(r&&(rWt(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 nWt(e,t,r){t.ending=!0,z2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function iWt(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=lW.destroy;ci.prototype._undestroy=lW.undestroy;ci.prototype._destroy=function(e,t){t(e)}});var E0=v((I8r,c4e)=>{"use strict";var aWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};c4e.exports=jc;var u4e=pW(),hW=fW();tr()(jc,u4e);for(dW=aWt(hW.prototype),R4=0;R4<dW.length;R4++)O4=dW[R4],jc.prototype[O4]||(jc.prototype[O4]=hW.prototype[O4]);var dW,O4,R4;function jc(e){if(!(this instanceof jc))return new jc(e);u4e.call(this,e),hW.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",oWt)))}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 oWt(){this._writableState.ended||process.nextTick(sWt,this)}function sWt(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 vW=v(f4e=>{"use strict";var gW=Us().Buffer,l4e=gW.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 uWt(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 cWt(e){var t=uWt(e);if(typeof t!="string"&&(gW.isEncoding===l4e||!l4e(e)))throw new Error("Unknown encoding: "+e);return t||e}f4e.StringDecoder=W2;function W2(e){this.encoding=cWt(e);var t;switch(this.encoding){case"utf16le":this.text=mWt,this.end=gWt,t=4;break;case"utf8":this.fillLast=dWt,t=4;break;case"base64":this.text=vWt,this.end=bWt,t=3;break;default:this.write=yWt,this.end=xWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=gW.allocUnsafe(t)}W2.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||""};W2.prototype.end=pWt;W2.prototype.text=hWt;W2.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 mW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function lWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=mW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=mW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=mW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function fWt(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 dWt(e){var t=this.lastTotal-this.lastNeed,r=fWt(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 hWt(e,t){var r=lWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function pWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function mWt(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 gWt(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 vWt(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 bWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function yWt(e){return e.toString(this.encoding)}function xWt(e){return e&&e.length?this.write(e):""}});var k4=v((j8r,p4e)=>{"use strict";var d4e=fh().codes.ERR_STREAM_PREMATURE_CLOSE;function _Wt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function EWt(){}function wWt(e){return e.setHeader&&typeof e.abort=="function"}function h4e(e,t,r){if(typeof t=="function")return h4e(e,null,t);t||(t={}),r=_Wt(r||EWt);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(p){r.call(e,p)},f=function(){var p;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(p=new d4e),r.call(e,p);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(p=new d4e),r.call(e,p)},d=function(){e.req.on("finish",s)};return wWt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}p4e.exports=h4e});var g4e=v((L8r,m4e)=>{"use strict";var I4;function hh(e,t,r){return t=AWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AWt(e){var t=SWt(e,"string");return typeof t=="symbol"?t:String(t)}function SWt(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 TWt=k4(),ph=Symbol("lastResolve"),w0=Symbol("lastReject"),V2=Symbol("error"),P4=Symbol("ended"),A0=Symbol("lastPromise"),bW=Symbol("handlePromise"),S0=Symbol("stream");function mh(e,t){return{value:e,done:t}}function CWt(e){var t=e[ph];if(t!==null){var r=e[S0].read();r!==null&&(e[A0]=null,e[ph]=null,e[w0]=null,t(mh(r,!1)))}}function DWt(e){process.nextTick(CWt,e)}function FWt(e,t){return function(r,n){e.then(function(){if(t[P4]){r(mh(void 0,!0));return}t[bW](r,n)},n)}}var BWt=Object.getPrototypeOf(function(){}),RWt=Object.setPrototypeOf((I4={get stream(){return this[S0]},next:function(){var t=this,r=this[V2];if(r!==null)return Promise.reject(r);if(this[P4])return Promise.resolve(mh(void 0,!0));if(this[S0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[V2]?s(t[V2]):o(mh(void 0,!0))})});var n=this[A0],i;if(n)i=new Promise(FWt(n,this));else{var a=this[S0].read();if(a!==null)return Promise.resolve(mh(a,!1));i=new Promise(this[bW])}return this[A0]=i,i}},hh(I4,Symbol.asyncIterator,function(){return this}),hh(I4,"return",function(){var t=this;return new Promise(function(r,n){t[S0].destroy(null,function(i){if(i){n(i);return}r(mh(void 0,!0))})})}),I4),BWt),OWt=function(t){var r,n=Object.create(RWt,(r={},hh(r,S0,{value:t,writable:!0}),hh(r,ph,{value:null,writable:!0}),hh(r,w0,{value:null,writable:!0}),hh(r,V2,{value:null,writable:!0}),hh(r,P4,{value:t._readableState.endEmitted,writable:!0}),hh(r,bW,{value:function(a,o){var s=n[S0].read();s?(n[A0]=null,n[ph]=null,n[w0]=null,a(mh(s,!1))):(n[ph]=a,n[w0]=o)},writable:!0}),r));return n[A0]=null,TWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[w0];a!==null&&(n[A0]=null,n[ph]=null,n[w0]=null,a(i)),n[V2]=i;return}var o=n[ph];o!==null&&(n[A0]=null,n[ph]=null,n[w0]=null,o(mh(void 0,!0))),n[P4]=!0}),t.on("readable",DWt.bind(null,n)),n};m4e.exports=OWt});var x4e=v((M8r,y4e)=>{"use strict";function v4e(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){v4e(a,n,i,o,s,"next",u)}function s(u){v4e(a,n,i,o,s,"throw",u)}o(void 0)})}}function b4e(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 IWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b4e(Object(r),!0).forEach(function(n){PWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PWt(e,t,r){return t=jWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jWt(e){var t=LWt(e,"string");return typeof t=="symbol"?t:String(t)}function LWt(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 MWt=fh().codes.ERR_INVALID_ARG_TYPE;function qWt(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 MWt("iterable",["Iterable"],t);var i=new e(IWt({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}y4e.exports=qWt});var pW=v((N8r,B4e)=>{"use strict";B4e.exports=zr;var Hb;zr.ReadableState=A4e;var q8r=require("events").EventEmitter,w4e=function(t,r){return t.listeners(r).length},X2=iW(),j4=require("buffer").Buffer,NWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function UWt(e){return j4.from(e)}function GWt(e){return j4.isBuffer(e)||e instanceof NWt}var yW=require("util"),xr;yW&&yW.debuglog?xr=yW.debuglog("stream"):xr=function(){};var zWt=YFe(),TW=sW(),HWt=uW(),WWt=HWt.getHighWaterMark,L4=fh().codes,VWt=L4.ERR_INVALID_ARG_TYPE,KWt=L4.ERR_STREAM_PUSH_AFTER_EOF,XWt=L4.ERR_METHOD_NOT_IMPLEMENTED,YWt=L4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Wb,xW,_W;tr()(zr,X2);var K2=TW.errorOrDestroy,EW=["error","close","destroy","pause","resume"];function $Wt(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 A4e(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=WWt(this,e,"readableHighWaterMark",r),this.buffer=new zWt,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=vW().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 A4e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),X2.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=TW.destroy;zr.prototype._undestroy=TW.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=j4.from(e,t),t=""),n=!0),S4e(this,e,t,!1,n)};zr.prototype.unshift=function(e){return S4e(this,e,null,!0,!1)};function S4e(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,ZWt(e,a);else{var o;if(i||(o=JWt(a,t)),o)K2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==j4.prototype&&(t=UWt(t)),n)a.endEmitted?K2(e,new YWt):wW(e,a,t,!0);else if(a.ended)K2(e,new KWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?wW(e,a,t,!1):SW(e,a)):wW(e,a,t,!1)}else n||(a.reading=!1,SW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function wW(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&&M4(e)),SW(e,t)}function JWt(e,t){var r;return!GWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new VWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Wb||(Wb=vW().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 _4e=1073741824;function QWt(e){return e>=_4e?e=_4e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function E4e(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=QWt(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?AW(this):M4(this),null;if(e=E4e(e,t),e===0&&t.ended)return t.length===0&&AW(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=E4e(r,t)));var i;return e>0?i=D4e(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&&AW(this)),i!==null&&this.emit("data",i),i};function ZWt(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?M4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T4e(e)))}}function M4(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(T4e,e))}function T4e(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,CW(e)}function SW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(eVt,e,t))}function eVt(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){K2(this,new XWt("_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=tVt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&F4e(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){xr("onerror",g),b(),e.removeListener("error",d),w4e(e,"error")===0&&K2(e,g)}$Wt(e,"error",d);function h(){e.removeListener("finish",p),b()}e.once("close",h);function p(){xr("onfinish"),e.removeListener("close",h),b()}e.once("finish",p);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function tVt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&w4e(e,"data")&&(r.flowing=!0,CW(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=F4e(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=X2.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?M4(this):n.reading||process.nextTick(rVt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=X2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(C4e,this),r};zr.prototype.removeAllListeners=function(e){var t=X2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(C4e,this),t};function C4e(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 rVt(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,nVt(this,e)),e.paused=!1,this};function nVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(iVt,e,t))}function iVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),CW(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 CW(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<EW.length;a++)e.on(EW[a],this.emit.bind(this,EW[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 xW===void 0&&(xW=g4e()),xW(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=D4e;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function D4e(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 AW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(aVt,t,e))}function aVt(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 _W===void 0&&(_W=x4e()),_W(zr,e,t)});function F4e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var DW=v((U8r,O4e)=>{"use strict";O4e.exports=$l;var q4=fh().codes,oVt=q4.ERR_METHOD_NOT_IMPLEMENTED,sVt=q4.ERR_MULTIPLE_CALLBACK,uVt=q4.ERR_TRANSFORM_ALREADY_TRANSFORMING,cVt=q4.ERR_TRANSFORM_WITH_LENGTH_0,N4=E0();tr()($l,N4);function lVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new sVt);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);N4.call(this,e),this._transformState={afterTransform:lVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",fVt)}function fVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){R4e(e,t,r)}):R4e(this,null,null)}$l.prototype.push=function(e,t){return this._transformState.needTransform=!1,N4.prototype.push.call(this,e,t)};$l.prototype._transform=function(e,t,r){r(new oVt("_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){N4.prototype._destroy.call(this,e,function(r){t(r)})};function R4e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new cVt;if(e._transformState.transforming)throw new uVt;return e.push(null)}});var P4e=v((G8r,I4e)=>{"use strict";I4e.exports=Y2;var k4e=DW();tr()(Y2,k4e);function Y2(e){if(!(this instanceof Y2))return new Y2(e);k4e.call(this,e)}Y2.prototype._transform=function(e,t,r){r(null,e)}});var N4e=v((z8r,q4e)=>{"use strict";var FW;function dVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var M4e=fh().codes,hVt=M4e.ERR_MISSING_ARGS,pVt=M4e.ERR_STREAM_DESTROYED;function j4e(e){if(e)throw e}function mVt(e){return e.setHeader&&typeof e.abort=="function"}function gVt(e,t,r,n){n=dVt(n);var i=!1;e.on("close",function(){i=!0}),FW===void 0&&(FW=k4()),FW(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,mVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new pVt("pipe"))}}}function L4e(e){e()}function vVt(e,t){return e.pipe(t)}function bVt(e){return!e.length||typeof e[e.length-1]!="function"?j4e:e.pop()}function yVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=bVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new hVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return gVt(o,u,c,function(l){i||(i=l),l&&a.forEach(L4e),!u&&(a.forEach(L4e),n(i))})});return t.reduce(vVt)}q4e.exports=yVt});var Q2=v((Is,J2)=>{var $2=require("stream");process.env.READABLE_STREAM==="disable"&&$2?(J2.exports=$2.Readable,Object.assign(J2.exports,$2),J2.exports.Stream=$2):(Is=J2.exports=pW(),Is.Stream=$2||Is,Is.Readable=Is,Is.Writable=fW(),Is.Duplex=E0(),Is.Transform=DW(),Is.PassThrough=P4e(),Is.finished=k4(),Is.pipeline=N4e())});var K4e=v((H8r,V4e)=>{var G4e=require("util"),xVt=FM(),Z2=nW(),z4e=Q2().Writable,H4e=Q2().PassThrough,W4e=function(){},U4e=function(e){return e&=511,e&&512-e},_Vt=function(e,t){var r=new U4(e,t);return r.end(),r},EVt=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},U4=function(e,t){this._parent=e,this.offset=t,H4e.call(this,{autoDestroy:!1})};G4e.inherits(U4,H4e);U4.prototype.destroy=function(e){this._parent.destroy(e)};var Jl=function(e){if(!(this instanceof Jl))return new Jl(e);z4e.call(this,e),e=e||{},this._offset=0,this._buffer=xVt(),this._missing=0,this._partial=!1,this._onparse=W4e,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(d){if(t._locked=!1,d)return t.destroy(d);t._stream||n()},a=function(){t._stream=null;var d=U4e(t._header.size);d?t._parse(d,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(U4e(t._header.size)),t._parse(512,f),n()},s=function(){var d=t._header.size;t._paxGlobal=Z2.decodePax(r.slice(0,d)),r.consume(d),a()},u=function(){var d=t._header.size;t._pax=Z2.decodePax(r.slice(0,d)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(d),a()},c=function(){var d=t._header.size;this._gnuLongPath=Z2.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},l=function(){var d=t._header.size;this._gnuLongLinkPath=Z2.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},f=function(){var d=t._offset,h;try{h=t._header=Z2.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(p){t.emit("error",p)}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=EVt(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,f),t.emit("entry",h,_Vt(t,d),i);return}t._stream=new U4(t,d),t.emit("entry",h,t._stream,i),t._parse(h.size,a),n()};this._onheader=f,this._parse(512,f)};G4e.inherits(Jl,z4e);Jl.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Jl.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Jl.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=W4e,this._overflow?this._write(this._overflow,void 0,e):e()}};Jl.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()}};Jl.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};V4e.exports=Jl});var Y4e=v((W8r,X4e)=>{X4e.exports=require("fs").constants||require("constants")});var Q4e=v((V8r,J4e)=>{var wVt=PF(),AVt=function(){},SVt=function(e){return e.setHeader&&typeof e.abort=="function"},TVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},$4e=function(e,t,r){if(typeof t=="function")return $4e(e,null,t);t||(t={}),r=wVt(r||AVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},d=function(g){r.call(e,g)},h=function(){process.nextTick(p)},p=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 SVt(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)),TVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",d),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",d),e.removeListener("close",h)}};J4e.exports=$4e});var nBe=v((K8r,rBe)=>{var Vb=Y4e(),Z4e=Q4e(),z4=tr(),CVt=Buffer.alloc,eBe=Q2().Readable,Kb=Q2().Writable,DVt=require("string_decoder").StringDecoder,G4=nW(),FVt=parseInt("755",8),BVt=parseInt("644",8),tBe=CVt(1024),RW=function(){},BW=function(e,t){t&=511,t&&e.push(tBe.slice(0,512-t))};function RVt(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 H4=function(e){Kb.call(this),this.written=0,this._to=e,this._destroyed=!1};z4(H4,Kb);H4.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};H4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var W4=function(){Kb.call(this),this.linkname="",this._decoder=new DVt("utf-8"),this._destroyed=!1};z4(W4,Kb);W4.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};W4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var eE=function(){Kb.call(this),this._destroyed=!1};z4(eE,Kb);eE.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};eE.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Lc=function(e){if(!(this instanceof Lc))return new Lc(e);eBe.call(this,e),this._drain=RW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};z4(Lc,eBe);Lc.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=RW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=RVt(e.mode)),e.mode||(e.mode=e.type==="directory"?FVt:BVt),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 BW(n,e.size),i?process.nextTick(r):this._drain=r,new eE}if(e.type==="symlink"&&!e.linkname){var a=new W4;return Z4e(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 eE;var o=new H4(this);return this._stream=o,Z4e(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"));BW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Lc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(tBe),this.push(null))};Lc.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())};Lc.prototype._encode=function(e){if(!e.pax){var t=G4.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Lc.prototype._encodePax=function(e){var t=G4.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(G4.encode(r)),this.push(t),BW(this,t.length),r.size=e.size,r.type=e.type,this.push(G4.encode(r))};Lc.prototype._read=function(e){var t=this._drain;this._drain=RW,t()};rBe.exports=Lc});var iBe=v(OW=>{OW.extract=K4e();OW.pack=nBe()});var sBe=v((Y8r,oBe)=>{var OVt=require("zlib"),kVt=iBe(),aBe=Tb(),Ql=function(e){if(!(this instanceof Ql))return new Ql(e);e=this.options=aBe.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=OVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Ql.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Ql.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"&&aBe.collectStream(e,i)};Ql.prototype.finalize=function(){this.engine.finalize()};Ql.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Ql.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)};Ql.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};oBe.exports=Ql});var fBe=v(($8r,lBe)=>{var IVt=require("util").inherits,uBe=kz().Transform,PVt=xH(),cBe=Tb(),gh=function(e){if(!(this instanceof gh))return new gh(e);e=this.options=cBe.defaults(e,{}),uBe.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};IVt(gh,uBe);gh.prototype._transform=function(e,t,r){r(null,e)};gh.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};gh.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=PVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&cBe.collectStream(e,i)};gh.prototype.finalize=function(){this._writeStringified(),this.end()};lBe.exports=gh});var hBe=v((J8r,dBe)=>{var jVt=oCe(),tE={},vh=function(e,t){return vh.create(e,t)};vh.create=function(e,t){if(tE[e]){var r=new jVt(e,t);return r.setFormat(e),r.setModule(new tE[e](t)),r}else throw new Error("create("+e+"): format not registered")};vh.registerFormat=function(e,t){if(tE[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");tE[e]=t};vh.isRegisteredFormat=function(e){return!!tE[e]};vh.registerFormat("zip",MFe());vh.registerFormat("tar",sBe());vh.registerFormat("json",fBe());dBe.exports=vh});var dRe=v(iB=>{"use strict";Object.defineProperty(iB,"__esModule",{value:!0});iB.default=void 0;var NXt={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,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:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795};iB.default=NXt});var _V=typeof process!="object"||String(process)!=="[object process]"||process.browser;var EV={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"]=EV||{};function er(e,t,r){return t<=e&&e<=r}function DOe(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function OE(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function FOe(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 BOe(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 Ho(e){return 0<=e&&e<=127}var zo=Ho,Fr=-1;function wB(e){this.tokens=[].slice.call(e),this.tokens.reverse()}wB.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 _n=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ms(e){throw TypeError("The code point "+e+" could not be encoded.")}function ROe(){}ROe.prototype={handler:function(e,t){}};function OOe(){}OOe.prototype={handler:function(e,t){}};function _B(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(EB,e)?EB[e]:null}var wV=[{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"}],EB={};wV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){EB[r]=t})})});var to={},ro={};function L0(e,t){return t&&t[e]||null}function M0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ga(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=Ga("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 IOe(e){if(e===59335)return 7457;var t=0,r=0,n=Ga("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 POe(e){yB=yB||Ga("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=yB;return t.indexOf(e)}var yB;function jOe(e){xB=xB||Ga("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=xB;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):M0(e,t)}var xB,AV="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):AV,t=OE(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=_B(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[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=OE(r),this._do_not_flush||(this._decoder=ro[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new wB(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===_n))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===_n)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return DOe(["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)),BOe(c)}return u.call(this,a)};function vy(e,t){if(!(this instanceof vy))throw TypeError("Called as a function. Did you forget 'new'?");t=OE(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):AV;var n=_B(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!to[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=_B("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(vy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});vy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=OE(r),this._do_not_flush||(this._encoder=to[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new wB(FOe(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===_n))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!==_n;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function LOe(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 _n;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 MOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(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}}to["UTF-8"]=function(e){return new MOe(e)};ro["UTF-8"]=function(e){return new LOe(e)};function qOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(Ho(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function NOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(zo(i))return i;var a=M0(i,e);return a===null&&Ms(i),a+128}}(function(){"encoding-indexes"in globalThis&&wV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ga(r.toLowerCase());ro[r]=function(i){return new qOe(n,i)},to[r]=function(i){return new NOe(n,i)}})})})();ro.GBK=function(e){return new SV(e)};to.GBK=function(e){return new TV(e,!0)};function SV(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 _n;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:L0(l,Ga("gb18030")),s===null&&Ho(o)&&a.prepend(o),s===null?Dr(t):s}return Ho(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function TV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(zo(i))return i;if(i===58853)return Ms(i);if(t&&i===8364)return 128;var a=M0(i,Ga("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 Ms(i);a=IOe(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),d=a-f*10;return[c+129,l+48,f+129,d+48]}}to.gb18030=function(e){return new TV(e)};ro.gb18030=function(e){return new SV(e)};function UOe(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 _n;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:L0(o,Ga("big5"));return u===null&&Ho(i)&&n.prepend(i),u===null?Dr(t):u}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function GOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(n))return n;var i=jOe(n);if(i===null)return Ms(n);var a=Kc(i/157)+129;if(a<161)return Ms(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}to.Big5=function(e){return new GOe(e)};ro.Big5=function(e){return new UOe(e)};function zOe(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 _n;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=L0((o-161)*94+(a-161),Ga(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Ho(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function HOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(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=M0(n,Ga("jis0208"));if(i===null)return Ms(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}to["EUC-JP"]=function(e){return new HOe(e)};ro["EUC-JP"]=function(e){return new zOe(e)};function WOe(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?_n:(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?_n:(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?_n:(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?_n:(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=L0(c,Ga("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var d=null;if(f===40&&u===66&&(d=r.ASCII),f===40&&u===74&&(d=r.Roman),f===40&&u===73&&(d=r.Katakana),f===36&&(u===64||u===66)&&(d=r.LeadByte),d!==null){n=n=d;var h=o;return o=!0,h?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function VOe(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 _n;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return Ms(65533);if(n===r.ASCII&&zo(a))return a;if(n===r.Roman&&(zo(a)&&a!==92&&a!==126||a==165||a==8254)){if(zo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(zo(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=M0(a,Ga("jis0208"));if(o===null)return Ms(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]}}to["ISO-2022-JP"]=function(e){return new VOe(e)};ro["ISO-2022-JP"]=function(e){return new WOe(e)};function KOe(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 _n;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:L0(o,Ga("jis0208"));return c===null&&Ho(i)&&n.prepend(i),c===null?Dr(t):c}return Ho(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 XOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(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=POe(n);if(i===null)return Ms(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}to.Shift_JIS=function(e){return new XOe(e)};ro.Shift_JIS=function(e){return new KOe(e)};function YOe(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 _n;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:L0(o,Ga("euc-kr"));return o===null&&Ho(i)&&n.prepend(i),s===null?Dr(t):s}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function $Oe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(n))return n;var i=M0(n,Ga("euc-kr"));if(i===null)return Ms(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}to["EUC-KR"]=function(e){return new $Oe(e)};ro["EUC-KR"]=function(e){return new YOe(e)};function RE(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function CV(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 _n;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(RE(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function DV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(er(i,0,65535))return RE(i,e);var a=RE((i-65536>>10)+55296,e),o=RE((i-65536&1023)+56320,e);return a.concat(o)}}to["UTF-16BE"]=function(e){return new DV(!0,e)};ro["UTF-16BE"]=function(e){return new CV(!0,e)};to["UTF-16LE"]=function(e){return new DV(!1,e)};ro["UTF-16LE"]=function(e){return new CV(!1,e)};function JOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?_n:Ho(n)?n:63360+n-128}}function QOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?_n:zo(n)?n:er(n,63360,63487)?n-63360+128:Ms(n)}}to["x-user-defined"]=function(e){return new QOe(e)};ro["x-user-defined"]=function(e){return new JOe(e)};function by(e){return Buffer.from(e).toString("base64")}function AB(e){return Buffer.from(e,"base64").toString("ascii")}var EY=Kt(xY(),1),wY=Kt(Ty(),1);function _Y(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function dPe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,wY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,EY.default)(n,r,t)}function AY(e,t){let r=dPe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(_Y(a))})})}var nae=Kt(rae(),1),CI=["image/png","image/jpeg","image/gif"];async function DI(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 AWe(r,t)}function AWe(e,t){return new Promise(r=>(0,nae.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 So(e,t,r,n){return n._parse(e,t,r,n)}function Jt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var $u={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},aae=$u.self||$u.window||$u.global||{},oae=$u.window||$u.self||$u.global||{},sae=$u.global||$u.self||$u.window||{},uae=$u.document||{};var vn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var iae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),SWe=iae&&parseFloat(iae[1])||0;function FI(e,t){return cae(e||{},t)}function cae(e,t){let r={...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=cae(r[n]||{},t[n]):r[n]=t[n];return r}var lae="beta";function TWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.0-beta.5"),globalThis._loadersgl_.version}var Uh=TWe();function ha(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Ju={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ktr=Ju.self||Ju.window||Ju.global||{},Itr=Ju.window||Ju.self||Ju.global||{},Ptr=Ju.global||Ju.self||Ju.window||{},jtr=Ju.document||{};var Xa=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ex=typeof importScripts=="function",dae=typeof window<"u"&&typeof window.orientation<"u",fae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Ltr=fae&&parseFloat(fae[1])||0;var wx=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){ha(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ha(this.isRunning),this.isRunning=!1,this._reject(t)}};var Dm={};ca(Dm,{NodeWorker:()=>Ax});var hae=Kt(require("worker_threads"),1);BE(Dm,require("worker_threads"));var Ax=hae.Worker;var BI=new Map;function pae(e){ha(e.source&&!e.url||!e.source&&e.url);let t=BI.get(e.source||e.url);return t||(e.url&&(t=CWe(e.url),BI.set(e.url,t)),e.source&&(t=mae(e.source),BI.set(e.source,t))),ha(t),t}function CWe(e){if(!e.startsWith("http"))return e;let t=DWe(e);return mae(t)}function mae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function DWe(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=iHt(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(ch(e.mode&lHt,6),100),t.write(ch(e.uid,6),108),t.write(ch(e.gid,6),116),t.write(ch(e.size,11),124),t.write(ch(e.mtime.getTime()/1e3|0,11),136),t[156]=qFe+hHt(e.type),e.linkname&&t.write(e.linkname,157),NFe.copy(t,G2),sHt.copy(t,rW),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(ch(e.devmajor||0,6),329),t.write(ch(e.devminor||0,6),337),n&&t.write(n,345),t.write(ch(GFe(t),6),148),t)};Ub.decode=function(e,t,r){var n=e[156]===0?0:e[156]-qFe,i=Nb(e,0,100,t),a=lh(e,100,8),o=lh(e,108,8),s=lh(e,116,8),u=lh(e,124,12),c=lh(e,136,12),l=dHt(n),f=e[157]===0?null:Nb(e,157,100,t),d=Nb(e,265,32),h=Nb(e,297,32),p=lh(e,329,8),b=lh(e,337,8),g=GFe(e);if(g===8*32)return null;if(g!==lh(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");if(NFe.compare(e,G2,G2+6)===0)e[345]&&(i=Nb(e,345,155,t)+"/"+i);else if(!(uHt.compare(e,G2,G2+6)===0&&cHt.compare(e,rW,rW+2)===0)){if(!r)throw new Error("Invalid tar header: unknown format.")}return n===0&&i&&i[i.length-1]==="/"&&(n=5),{name:i,mode:a,uid:o,gid:s,size:u,mtime:new Date(1e3*c),type:l,linkname:f,uname:d,gname:h,devmajor:p,devminor:b}}});var iW=v((D8r,zFe)=>{zFe.exports=require("stream")});var YFe=v((F8r,XFe)=>{"use strict";function HFe(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 WFe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?HFe(Object(r),!0).forEach(function(n){mHt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HFe(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function mHt(e,t,r){return t=KFe(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gHt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function VFe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,KFe(n.key),n)}}function vHt(e,t,r){return t&&VFe(e.prototype,t),r&&VFe(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function KFe(e){var t=bHt(e,"string");return typeof t=="symbol"?t:String(t)}function bHt(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 yHt=require("buffer"),C4=yHt.Buffer,xHt=require("util"),aW=xHt.inspect,_Ht=aW&&aW.custom||"inspect";function EHt(e,t,r){C4.prototype.copy.call(e,t,r)}XFe.exports=function(){function e(){gHt(this,e),this.head=null,this.tail=null,this.length=0}return vHt(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 C4.alloc(0);for(var n=C4.allocUnsafe(r>>>0),i=this.head,a=0;i;)EHt(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=C4.allocUnsafe(r),i=this.head,a=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var o=i.data,s=r>o.length?o.length:r;if(o.copy(n,n.length-r,0,s),r-=s,r===0){s===o.length?(++a,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(s));break}++a}return this.length-=a,n}},{key:_Ht,value:function(r,n){return aW(this,WFe(WFe({},n),{},{depth:0,customInspect:!1}))}}]),e}()});var sW=v((B8r,JFe)=>{"use strict";function wHt(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(oW,this,e)):process.nextTick(oW,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(D4,r):(r._writableState.errorEmitted=!0,process.nextTick($Fe,r,a)):process.nextTick($Fe,r,a):t?(process.nextTick(D4,r),t(a)):process.nextTick(D4,r)}),this)}function $Fe(e,t){oW(e,t),D4(e)}function D4(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function AHt(){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 oW(e,t){e.emit("error",t)}function SHt(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}JFe.exports={destroy:wHt,undestroy:AHt,errorOrDestroy:SHt}});var fh=v((R8r,e4e)=>{"use strict";var ZFe={};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,ZFe[e]=i}function QFe(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 THt(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function CHt(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function DHt(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"&&THt(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";let i;if(CHt(e," argument"))i=`The ${e} ${n} ${QFe(t,"type")}`;else{let a=DHt(e,".")?"property":"argument";i=`The "${e}" ${a} ${n} ${QFe(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");e4e.exports.codes=ZFe});var uW=v((O8r,t4e)=>{"use strict";var FHt=fh().codes.ERR_INVALID_OPT_VALUE;function BHt(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function RHt(e,t,r,n){var i=BHt(t,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var a=n?r:"highWaterMark";throw new FHt(a,i)}return Math.floor(i)}return e.objectMode?16:16*1024}t4e.exports={getHighWaterMark:RHt}});var fW=v((k8r,s4e)=>{"use strict";s4e.exports=ci;function n4e(e){var t=this;this.next=null,this.entry=null,this.finish=function(){iWt(t,e)}}var Gb;ci.WritableState=H2;var OHt={deprecate:lp()},i4e=iW(),B4=require("buffer").Buffer,kHt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function IHt(e){return B4.from(e)}function PHt(e){return B4.isBuffer(e)||e instanceof kHt}var lW=sW(),jHt=uW(),LHt=jHt.getHighWaterMark,dh=fh().codes,MHt=dh.ERR_INVALID_ARG_TYPE,qHt=dh.ERR_METHOD_NOT_IMPLEMENTED,NHt=dh.ERR_MULTIPLE_CALLBACK,UHt=dh.ERR_STREAM_CANNOT_PIPE,GHt=dh.ERR_STREAM_DESTROYED,zHt=dh.ERR_STREAM_NULL_VALUES,HHt=dh.ERR_STREAM_WRITE_AFTER_END,WHt=dh.ERR_UNKNOWN_ENCODING,zb=lW.errorOrDestroy;tr()(ci,i4e);function VHt(){}function H2(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=LHt(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){ZHt(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 n4e(this)}H2.prototype.getBuffer=function(){for(var t=this.bufferedRequest,r=[];t;)r.push(t),t=t.next;return r};(function(){try{Object.defineProperty(H2.prototype,"buffer",{get:OHt.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var F4;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(F4=Function.prototype[Symbol.hasInstance],Object.defineProperty(ci,Symbol.hasInstance,{value:function(t){return F4.call(this,t)?!0:this!==ci?!1:t&&t._writableState instanceof H2}})):F4=function(t){return t instanceof this};function ci(e){Gb=Gb||E0();var t=this instanceof Gb;if(!t&&!F4.call(ci,this))return new ci(e);this._writableState=new H2(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)),i4e.call(this)}ci.prototype.pipe=function(){zb(this,new UHt)};function KHt(e,t){var r=new HHt;zb(e,r),process.nextTick(t,r)}function XHt(e,t,r,n){var i;return r===null?i=new zHt:typeof r!="string"&&!t.objectMode&&(i=new MHt("chunk",["string","Buffer"],r)),i?(zb(e,i),process.nextTick(n,i),!1):!0}ci.prototype.write=function(e,t,r){var n=this._writableState,i=!1,a=!n.objectMode&&PHt(e);return a&&!B4.isBuffer(e)&&(e=IHt(e)),typeof t=="function"&&(r=t,t=null),a?t="buffer":t||(t=n.defaultEncoding),typeof r!="function"&&(r=VHt),n.ending?KHt(this,r):(a||XHt(this,n,e,r))&&(n.pendingcb++,i=$Ht(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&&a4e(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 WHt(t);return this._writableState.defaultEncoding=t,this};Object.defineProperty(ci.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function YHt(e,t,r){return!e.objectMode&&e.decodeStrings!==!1&&typeof t=="string"&&(t=B4.from(t,r)),t}Object.defineProperty(ci.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function $Ht(e,t,r,n,i,a){if(!r){var o=YHt(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 cW(e,t,!1,s,n,i,a);return u}function cW(e,t,r,n,i,a,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new GHt("write")):r?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function JHt(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(z2,e,t),e._writableState.errorEmitted=!0,zb(e,n)):(i(n),e._writableState.errorEmitted=!0,zb(e,n),z2(e,t))}function QHt(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function ZHt(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new NHt;if(QHt(r),t)JHt(e,r,n,t,i);else{var a=o4e(r)||e.destroyed;!a&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&a4e(e,r),n?process.nextTick(r4e,e,r,a,i):r4e(e,r,a,i)}}function r4e(e,t,r,n){r||eWt(e,t),t.pendingcb--,n(),z2(e,t)}function eWt(e,t){t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function a4e(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,cW(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 n4e(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,c=r.encoding,l=r.callback,f=t.objectMode?1:u.length;if(cW(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 qHt("_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||nWt(this,n,r),this};Object.defineProperty(ci.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function o4e(e){return e.ending&&e.length===0&&e.bufferedRequest===null&&!e.finished&&!e.writing}function tWt(e,t){e._final(function(r){t.pendingcb--,r&&zb(e,r),t.prefinished=!0,e.emit("prefinish"),z2(e,t)})}function rWt(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.pendingcb++,t.finalCalled=!0,process.nextTick(tWt,e,t)):(t.prefinished=!0,e.emit("prefinish")))}function z2(e,t){var r=o4e(t);if(r&&(rWt(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 nWt(e,t,r){t.ending=!0,z2(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function iWt(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=lW.destroy;ci.prototype._undestroy=lW.undestroy;ci.prototype._destroy=function(e,t){t(e)}});var E0=v((I8r,c4e)=>{"use strict";var aWt=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};c4e.exports=jc;var u4e=pW(),hW=fW();tr()(jc,u4e);for(dW=aWt(hW.prototype),R4=0;R4<dW.length;R4++)O4=dW[R4],jc.prototype[O4]||(jc.prototype[O4]=hW.prototype[O4]);var dW,O4,R4;function jc(e){if(!(this instanceof jc))return new jc(e);u4e.call(this,e),hW.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",oWt)))}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 oWt(){this._writableState.ended||process.nextTick(sWt,this)}function sWt(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 vW=v(f4e=>{"use strict";var gW=Us().Buffer,l4e=gW.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 uWt(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 cWt(e){var t=uWt(e);if(typeof t!="string"&&(gW.isEncoding===l4e||!l4e(e)))throw new Error("Unknown encoding: "+e);return t||e}f4e.StringDecoder=W2;function W2(e){this.encoding=cWt(e);var t;switch(this.encoding){case"utf16le":this.text=mWt,this.end=gWt,t=4;break;case"utf8":this.fillLast=dWt,t=4;break;case"base64":this.text=vWt,this.end=bWt,t=3;break;default:this.write=yWt,this.end=xWt;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=gW.allocUnsafe(t)}W2.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||""};W2.prototype.end=pWt;W2.prototype.text=hWt;W2.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 mW(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function lWt(e,t,r){var n=t.length-1;if(n<r)return 0;var i=mW(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||i===-2?0:(i=mW(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||i===-2?0:(i=mW(t[n]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function fWt(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 dWt(e){var t=this.lastTotal-this.lastNeed,r=fWt(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 hWt(e,t){var r=lWt(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function pWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}function mWt(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 gWt(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 vWt(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 bWt(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function yWt(e){return e.toString(this.encoding)}function xWt(e){return e&&e.length?this.write(e):""}});var k4=v((j8r,p4e)=>{"use strict";var d4e=fh().codes.ERR_STREAM_PREMATURE_CLOSE;function _Wt(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function EWt(){}function wWt(e){return e.setHeader&&typeof e.abort=="function"}function h4e(e,t,r){if(typeof t=="function")return h4e(e,null,t);t||(t={}),r=_Wt(r||EWt);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(p){r.call(e,p)},f=function(){var p;if(n&&!u)return(!e._readableState||!e._readableState.ended)&&(p=new d4e),r.call(e,p);if(i&&!o)return(!e._writableState||!e._writableState.ended)&&(p=new d4e),r.call(e,p)},d=function(){e.req.on("finish",s)};return wWt(e)?(e.on("complete",s),e.on("abort",f),e.req?d():e.on("request",d)):i&&!e._writableState&&(e.on("end",a),e.on("close",a)),e.on("end",c),e.on("finish",s),t.error!==!1&&e.on("error",l),e.on("close",f),function(){e.removeListener("complete",s),e.removeListener("abort",f),e.removeListener("request",d),e.req&&e.req.removeListener("finish",s),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",s),e.removeListener("end",c),e.removeListener("error",l),e.removeListener("close",f)}}p4e.exports=h4e});var g4e=v((L8r,m4e)=>{"use strict";var I4;function hh(e,t,r){return t=AWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function AWt(e){var t=SWt(e,"string");return typeof t=="symbol"?t:String(t)}function SWt(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 TWt=k4(),ph=Symbol("lastResolve"),w0=Symbol("lastReject"),V2=Symbol("error"),P4=Symbol("ended"),A0=Symbol("lastPromise"),bW=Symbol("handlePromise"),S0=Symbol("stream");function mh(e,t){return{value:e,done:t}}function CWt(e){var t=e[ph];if(t!==null){var r=e[S0].read();r!==null&&(e[A0]=null,e[ph]=null,e[w0]=null,t(mh(r,!1)))}}function DWt(e){process.nextTick(CWt,e)}function FWt(e,t){return function(r,n){e.then(function(){if(t[P4]){r(mh(void 0,!0));return}t[bW](r,n)},n)}}var BWt=Object.getPrototypeOf(function(){}),RWt=Object.setPrototypeOf((I4={get stream(){return this[S0]},next:function(){var t=this,r=this[V2];if(r!==null)return Promise.reject(r);if(this[P4])return Promise.resolve(mh(void 0,!0));if(this[S0].destroyed)return new Promise(function(o,s){process.nextTick(function(){t[V2]?s(t[V2]):o(mh(void 0,!0))})});var n=this[A0],i;if(n)i=new Promise(FWt(n,this));else{var a=this[S0].read();if(a!==null)return Promise.resolve(mh(a,!1));i=new Promise(this[bW])}return this[A0]=i,i}},hh(I4,Symbol.asyncIterator,function(){return this}),hh(I4,"return",function(){var t=this;return new Promise(function(r,n){t[S0].destroy(null,function(i){if(i){n(i);return}r(mh(void 0,!0))})})}),I4),BWt),OWt=function(t){var r,n=Object.create(RWt,(r={},hh(r,S0,{value:t,writable:!0}),hh(r,ph,{value:null,writable:!0}),hh(r,w0,{value:null,writable:!0}),hh(r,V2,{value:null,writable:!0}),hh(r,P4,{value:t._readableState.endEmitted,writable:!0}),hh(r,bW,{value:function(a,o){var s=n[S0].read();s?(n[A0]=null,n[ph]=null,n[w0]=null,a(mh(s,!1))):(n[ph]=a,n[w0]=o)},writable:!0}),r));return n[A0]=null,TWt(t,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var a=n[w0];a!==null&&(n[A0]=null,n[ph]=null,n[w0]=null,a(i)),n[V2]=i;return}var o=n[ph];o!==null&&(n[A0]=null,n[ph]=null,n[w0]=null,o(mh(void 0,!0))),n[P4]=!0}),t.on("readable",DWt.bind(null,n)),n};m4e.exports=OWt});var x4e=v((M8r,y4e)=>{"use strict";function v4e(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){v4e(a,n,i,o,s,"next",u)}function s(u){v4e(a,n,i,o,s,"throw",u)}o(void 0)})}}function b4e(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 IWt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?b4e(Object(r),!0).forEach(function(n){PWt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):b4e(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function PWt(e,t,r){return t=jWt(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function jWt(e){var t=LWt(e,"string");return typeof t=="symbol"?t:String(t)}function LWt(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 MWt=fh().codes.ERR_INVALID_ARG_TYPE;function qWt(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 MWt("iterable",["Iterable"],t);var i=new e(IWt({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}y4e.exports=qWt});var pW=v((N8r,B4e)=>{"use strict";B4e.exports=zr;var Hb;zr.ReadableState=A4e;var q8r=require("events").EventEmitter,w4e=function(t,r){return t.listeners(r).length},X2=iW(),j4=require("buffer").Buffer,NWt=(typeof global<"u"?global:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function UWt(e){return j4.from(e)}function GWt(e){return j4.isBuffer(e)||e instanceof NWt}var yW=require("util"),xr;yW&&yW.debuglog?xr=yW.debuglog("stream"):xr=function(){};var zWt=YFe(),TW=sW(),HWt=uW(),WWt=HWt.getHighWaterMark,L4=fh().codes,VWt=L4.ERR_INVALID_ARG_TYPE,KWt=L4.ERR_STREAM_PUSH_AFTER_EOF,XWt=L4.ERR_METHOD_NOT_IMPLEMENTED,YWt=L4.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Wb,xW,_W;tr()(zr,X2);var K2=TW.errorOrDestroy,EW=["error","close","destroy","pause","resume"];function $Wt(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 A4e(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=WWt(this,e,"readableHighWaterMark",r),this.buffer=new zWt,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=vW().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 A4e(e,this,t),this.readable=!0,e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy)),X2.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=TW.destroy;zr.prototype._undestroy=TW.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=j4.from(e,t),t=""),n=!0),S4e(this,e,t,!1,n)};zr.prototype.unshift=function(e){return S4e(this,e,null,!0,!1)};function S4e(e,t,r,n,i){xr("readableAddChunk",t);var a=e._readableState;if(t===null)a.reading=!1,ZWt(e,a);else{var o;if(i||(o=JWt(a,t)),o)K2(e,o);else if(a.objectMode||t&&t.length>0)if(typeof t!="string"&&!a.objectMode&&Object.getPrototypeOf(t)!==j4.prototype&&(t=UWt(t)),n)a.endEmitted?K2(e,new YWt):wW(e,a,t,!0);else if(a.ended)K2(e,new KWt);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||t.length!==0?wW(e,a,t,!1):SW(e,a)):wW(e,a,t,!1)}else n||(a.reading=!1,SW(e,a))}return!a.ended&&(a.length<a.highWaterMark||a.length===0)}function wW(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&&M4(e)),SW(e,t)}function JWt(e,t){var r;return!GWt(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(r=new VWt("chunk",["string","Buffer","Uint8Array"],t)),r}zr.prototype.isPaused=function(){return this._readableState.flowing===!1};zr.prototype.setEncoding=function(e){Wb||(Wb=vW().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 _4e=1073741824;function QWt(e){return e>=_4e?e=_4e:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function E4e(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=QWt(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?AW(this):M4(this),null;if(e=E4e(e,t),e===0&&t.ended)return t.length===0&&AW(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=E4e(r,t)));var i;return e>0?i=D4e(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&&AW(this)),i!==null&&this.emit("data",i),i};function ZWt(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?M4(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T4e(e)))}}function M4(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(T4e,e))}function T4e(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,CW(e)}function SW(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(eVt,e,t))}function eVt(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){K2(this,new XWt("_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=tVt(r);e.on("drain",u);var c=!1;function l(){xr("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),e.removeListener("drain",u),e.removeListener("error",d),e.removeListener("unpipe",o),r.removeListener("end",s),r.removeListener("end",b),r.removeListener("data",f),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}r.on("data",f);function f(g){xr("ondata");var x=e.write(g);xr("dest.write",x),x===!1&&((n.pipesCount===1&&n.pipes===e||n.pipesCount>1&&F4e(n.pipes,e)!==-1)&&!c&&(xr("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(g){xr("onerror",g),b(),e.removeListener("error",d),w4e(e,"error")===0&&K2(e,g)}$Wt(e,"error",d);function h(){e.removeListener("finish",p),b()}e.once("close",h);function p(){xr("onfinish"),e.removeListener("close",h),b()}e.once("finish",p);function b(){xr("unpipe"),r.unpipe(e)}return e.emit("pipe",r),n.flowing||(xr("pipe resume"),r.resume()),e};function tVt(e){return function(){var r=e._readableState;xr("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&w4e(e,"data")&&(r.flowing=!0,CW(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=F4e(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=X2.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?M4(this):n.reading||process.nextTick(rVt,this)),r};zr.prototype.addListener=zr.prototype.on;zr.prototype.removeListener=function(e,t){var r=X2.prototype.removeListener.call(this,e,t);return e==="readable"&&process.nextTick(C4e,this),r};zr.prototype.removeAllListeners=function(e){var t=X2.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&process.nextTick(C4e,this),t};function C4e(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 rVt(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,nVt(this,e)),e.paused=!1,this};function nVt(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(iVt,e,t))}function iVt(e,t){xr("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),CW(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 CW(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<EW.length;a++)e.on(EW[a],this.emit.bind(this,EW[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 xW===void 0&&(xW=g4e()),xW(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=D4e;Object.defineProperty(zr.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function D4e(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 AW(e){var t=e._readableState;xr("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(aVt,t,e))}function aVt(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 _W===void 0&&(_W=x4e()),_W(zr,e,t)});function F4e(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}});var DW=v((U8r,O4e)=>{"use strict";O4e.exports=$l;var q4=fh().codes,oVt=q4.ERR_METHOD_NOT_IMPLEMENTED,sVt=q4.ERR_MULTIPLE_CALLBACK,uVt=q4.ERR_TRANSFORM_ALREADY_TRANSFORMING,cVt=q4.ERR_TRANSFORM_WITH_LENGTH_0,N4=E0();tr()($l,N4);function lVt(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new sVt);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);N4.call(this,e),this._transformState={afterTransform:lVt.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",fVt)}function fVt(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){R4e(e,t,r)}):R4e(this,null,null)}$l.prototype.push=function(e,t){return this._transformState.needTransform=!1,N4.prototype.push.call(this,e,t)};$l.prototype._transform=function(e,t,r){r(new oVt("_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){N4.prototype._destroy.call(this,e,function(r){t(r)})};function R4e(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new cVt;if(e._transformState.transforming)throw new uVt;return e.push(null)}});var P4e=v((G8r,I4e)=>{"use strict";I4e.exports=Y2;var k4e=DW();tr()(Y2,k4e);function Y2(e){if(!(this instanceof Y2))return new Y2(e);k4e.call(this,e)}Y2.prototype._transform=function(e,t,r){r(null,e)}});var N4e=v((z8r,q4e)=>{"use strict";var FW;function dVt(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var M4e=fh().codes,hVt=M4e.ERR_MISSING_ARGS,pVt=M4e.ERR_STREAM_DESTROYED;function j4e(e){if(e)throw e}function mVt(e){return e.setHeader&&typeof e.abort=="function"}function gVt(e,t,r,n){n=dVt(n);var i=!1;e.on("close",function(){i=!0}),FW===void 0&&(FW=k4()),FW(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,mVt(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(o||new pVt("pipe"))}}}function L4e(e){e()}function vVt(e,t){return e.pipe(t)}function bVt(e){return!e.length||typeof e[e.length-1]!="function"?j4e:e.pop()}function yVt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=bVt(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new hVt("streams");var i,a=t.map(function(o,s){var u=s<t.length-1,c=s>0;return gVt(o,u,c,function(l){i||(i=l),l&&a.forEach(L4e),!u&&(a.forEach(L4e),n(i))})});return t.reduce(vVt)}q4e.exports=yVt});var Q2=v((Is,J2)=>{var $2=require("stream");process.env.READABLE_STREAM==="disable"&&$2?(J2.exports=$2.Readable,Object.assign(J2.exports,$2),J2.exports.Stream=$2):(Is=J2.exports=pW(),Is.Stream=$2||Is,Is.Readable=Is,Is.Writable=fW(),Is.Duplex=E0(),Is.Transform=DW(),Is.PassThrough=P4e(),Is.finished=k4(),Is.pipeline=N4e())});var K4e=v((H8r,V4e)=>{var G4e=require("util"),xVt=FM(),Z2=nW(),z4e=Q2().Writable,H4e=Q2().PassThrough,W4e=function(){},U4e=function(e){return e&=511,e&&512-e},_Vt=function(e,t){var r=new U4(e,t);return r.end(),r},EVt=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},U4=function(e,t){this._parent=e,this.offset=t,H4e.call(this,{autoDestroy:!1})};G4e.inherits(U4,H4e);U4.prototype.destroy=function(e){this._parent.destroy(e)};var Jl=function(e){if(!(this instanceof Jl))return new Jl(e);z4e.call(this,e),e=e||{},this._offset=0,this._buffer=xVt(),this._missing=0,this._partial=!1,this._onparse=W4e,this._header=null,this._stream=null,this._overflow=null,this._cb=null,this._locked=!1,this._destroyed=!1,this._pax=null,this._paxGlobal=null,this._gnuLongPath=null,this._gnuLongLinkPath=null;var t=this,r=t._buffer,n=function(){t._continue()},i=function(d){if(t._locked=!1,d)return t.destroy(d);t._stream||n()},a=function(){t._stream=null;var d=U4e(t._header.size);d?t._parse(d,o):t._parse(512,f),t._locked||n()},o=function(){t._buffer.consume(U4e(t._header.size)),t._parse(512,f),n()},s=function(){var d=t._header.size;t._paxGlobal=Z2.decodePax(r.slice(0,d)),r.consume(d),a()},u=function(){var d=t._header.size;t._pax=Z2.decodePax(r.slice(0,d)),t._paxGlobal&&(t._pax=Object.assign({},t._paxGlobal,t._pax)),r.consume(d),a()},c=function(){var d=t._header.size;this._gnuLongPath=Z2.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},l=function(){var d=t._header.size;this._gnuLongLinkPath=Z2.decodeLongPath(r.slice(0,d),e.filenameEncoding),r.consume(d),a()},f=function(){var d=t._offset,h;try{h=t._header=Z2.decode(r.slice(0,512),e.filenameEncoding,e.allowUnknownFormat)}catch(p){t.emit("error",p)}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=EVt(h,t._pax),t._pax=null),t._locked=!0,!h.size||h.type==="directory"){t._parse(512,f),t.emit("entry",h,_Vt(t,d),i);return}t._stream=new U4(t,d),t.emit("entry",h,t._stream,i),t._parse(h.size,a),n()};this._onheader=f,this._parse(512,f)};G4e.inherits(Jl,z4e);Jl.prototype.destroy=function(e){this._destroyed||(this._destroyed=!0,e&&this.emit("error",e),this.emit("close"),this._stream&&this._stream.emit("close"))};Jl.prototype._parse=function(e,t){this._destroyed||(this._offset+=e,this._missing=e,t===this._onheader&&(this._partial=!1),this._onparse=t)};Jl.prototype._continue=function(){if(!this._destroyed){var e=this._cb;this._cb=W4e,this._overflow?this._write(this._overflow,void 0,e):e()}};Jl.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()}};Jl.prototype._final=function(e){if(this._partial)return this.destroy(new Error("Unexpected end of data"));e()};V4e.exports=Jl});var Y4e=v((W8r,X4e)=>{X4e.exports=require("fs").constants||require("constants")});var Q4e=v((V8r,J4e)=>{var wVt=PF(),AVt=function(){},SVt=function(e){return e.setHeader&&typeof e.abort=="function"},TVt=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3},$4e=function(e,t,r){if(typeof t=="function")return $4e(e,null,t);t||(t={}),r=wVt(r||AVt);var n=e._writableState,i=e._readableState,a=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,s=!1,u=function(){e.writable||c()},c=function(){o=!1,a||r.call(e)},l=function(){a=!1,o||r.call(e)},f=function(g){r.call(e,g?new Error("exited with error code: "+g):null)},d=function(g){r.call(e,g)},h=function(){process.nextTick(p)},p=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 SVt(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)),TVt(e)&&e.on("exit",f),e.on("end",l),e.on("finish",c),t.error!==!1&&e.on("error",d),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",d),e.removeListener("close",h)}};J4e.exports=$4e});var nBe=v((K8r,rBe)=>{var Vb=Y4e(),Z4e=Q4e(),z4=tr(),CVt=Buffer.alloc,eBe=Q2().Readable,Kb=Q2().Writable,DVt=require("string_decoder").StringDecoder,G4=nW(),FVt=parseInt("755",8),BVt=parseInt("644",8),tBe=CVt(1024),RW=function(){},BW=function(e,t){t&=511,t&&e.push(tBe.slice(0,512-t))};function RVt(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 H4=function(e){Kb.call(this),this.written=0,this._to=e,this._destroyed=!1};z4(H4,Kb);H4.prototype._write=function(e,t,r){if(this.written+=e.length,this._to.push(e))return r();this._to._drain=r};H4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var W4=function(){Kb.call(this),this.linkname="",this._decoder=new DVt("utf-8"),this._destroyed=!1};z4(W4,Kb);W4.prototype._write=function(e,t,r){this.linkname+=this._decoder.write(e),r()};W4.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var eE=function(){Kb.call(this),this._destroyed=!1};z4(eE,Kb);eE.prototype._write=function(e,t,r){r(new Error("No body allowed for this entry"))};eE.prototype.destroy=function(){this._destroyed||(this._destroyed=!0,this.emit("close"))};var Lc=function(e){if(!(this instanceof Lc))return new Lc(e);eBe.call(this,e),this._drain=RW,this._finalized=!1,this._finalizing=!1,this._destroyed=!1,this._stream=null};z4(Lc,eBe);Lc.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=RW);var n=this;if((!e.size||e.type==="symlink")&&(e.size=0),e.type||(e.type=RVt(e.mode)),e.mode||(e.mode=e.type==="directory"?FVt:BVt),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 BW(n,e.size),i?process.nextTick(r):this._drain=r,new eE}if(e.type==="symlink"&&!e.linkname){var a=new W4;return Z4e(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 eE;var o=new H4(this);return this._stream=o,Z4e(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"));BW(n,e.size),n._finalizing&&n.finalize(),r()}),o}};Lc.prototype.finalize=function(){if(this._stream){this._finalizing=!0;return}this._finalized||(this._finalized=!0,this.push(tBe),this.push(null))};Lc.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())};Lc.prototype._encode=function(e){if(!e.pax){var t=G4.encode(e);if(t){this.push(t);return}}this._encodePax(e)};Lc.prototype._encodePax=function(e){var t=G4.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(G4.encode(r)),this.push(t),BW(this,t.length),r.size=e.size,r.type=e.type,this.push(G4.encode(r))};Lc.prototype._read=function(e){var t=this._drain;this._drain=RW,t()};rBe.exports=Lc});var iBe=v(OW=>{OW.extract=K4e();OW.pack=nBe()});var sBe=v((Y8r,oBe)=>{var OVt=require("zlib"),kVt=iBe(),aBe=Tb(),Ql=function(e){if(!(this instanceof Ql))return new Ql(e);e=this.options=aBe.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=OVt.createGzip(e.gzipOptions),this.compressor.on("error",this._onCompressorError.bind(this)))};Ql.prototype._onCompressorError=function(e){this.engine.emit("error",e)};Ql.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"&&aBe.collectStream(e,i)};Ql.prototype.finalize=function(){this.engine.finalize()};Ql.prototype.on=function(){return this.engine.on.apply(this.engine,arguments)};Ql.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)};Ql.prototype.unpipe=function(){return this.compressor?this.compressor.unpipe.apply(this.compressor,arguments):this.engine.unpipe.apply(this.engine,arguments)};oBe.exports=Ql});var fBe=v(($8r,lBe)=>{var IVt=require("util").inherits,uBe=kz().Transform,PVt=xH(),cBe=Tb(),gh=function(e){if(!(this instanceof gh))return new gh(e);e=this.options=cBe.defaults(e,{}),uBe.call(this,e),this.supports={directory:!0,symlink:!0},this.files=[]};IVt(gh,uBe);gh.prototype._transform=function(e,t,r){r(null,e)};gh.prototype._writeStringified=function(){var e=JSON.stringify(this.files);this.write(e)};gh.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=PVt.unsigned(o),n.files.push(t),r(null,t)}t.sourceType==="buffer"?i(null,e):t.sourceType==="stream"&&cBe.collectStream(e,i)};gh.prototype.finalize=function(){this._writeStringified(),this.end()};lBe.exports=gh});var hBe=v((J8r,dBe)=>{var jVt=oCe(),tE={},vh=function(e,t){return vh.create(e,t)};vh.create=function(e,t){if(tE[e]){var r=new jVt(e,t);return r.setFormat(e),r.setModule(new tE[e](t)),r}else throw new Error("create("+e+"): format not registered")};vh.registerFormat=function(e,t){if(tE[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");tE[e]=t};vh.isRegisteredFormat=function(e){return!!tE[e]};vh.registerFormat("zip",MFe());vh.registerFormat("tar",sBe());vh.registerFormat("json",fBe());dBe.exports=vh});var dRe=v(iB=>{"use strict";Object.defineProperty(iB,"__esModule",{value:!0});iB.default=void 0;var NXt={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,FUNC_ADD:32774,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,BLEND_COLOR:32773,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,VENDOR:7936,RENDERER:7937,VERSION:7938,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,BROWSER_DEFAULT_WEBGL:37444,STATIC_DRAW:35044,STREAM_DRAW:35040,DYNAMIC_DRAW:35048,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,CULL_FACE:2884,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,BLEND:3042,DEPTH_TEST:2929,DITHER:3024,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,SCISSOR_TEST:3089,STENCIL_TEST:2960,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CONTEXT_LOST_WEBGL:37442,CW:2304,CCW:2305,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,COMPILE_STATUS:35713,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_ATTRIBUTES:35721,ACTIVE_UNIFORMS:35718,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,ALWAYS:519,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,GEQUAL:518,NOTEQUAL:517,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,TEXTURE_WIDTH:4096,TEXTURE_HEIGHT:4097,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,MAX_3D_TEXTURE_SIZE:32883,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,MAX_TEXTURE_LOD_BIAS:34045,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,RASTERIZER_DISCARD:35977,VERTEX_ARRAY_BINDING:34229,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,MAX_ELEMENT_INDEX:36203,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,RGB9_E5:35901,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2UI:36975,TEXTURE_IMMUTABLE_FORMAT:37167,TEXTURE_IMMUTABLE_LEVELS:33503,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,UNSIGNED_INT_24_8:34042,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,INT_2_10_10_10_REV:36255,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,MAX_SAMPLES:36183,SAMPLER_BINDING:35097,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,UNSIGNED_NORMALIZED:35863,SIGNED_NORMALIZED:36764,VERTEX_ATTRIB_ARRAY_INTEGER:35069,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,DEPTH24_STENCIL8:35056,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,COLOR:6144,DEPTH:6145,STENCIL:6146,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,INVALID_INDEX:4294967295,TIMEOUT_IGNORED:-1,MAX_CLIENT_WAIT_TIMEOUT_WEBGL:37447,VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE:35070,UNMASKED_VENDOR_WEBGL:37445,UNMASKED_RENDERER_WEBGL:37446,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047,TEXTURE_MAX_ANISOTROPY_EXT:34046,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:35986,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,UNSIGNED_INT_24_8_WEBGL:34042,HALF_FLOAT_OES:36193,RGBA32F_EXT:34836,RGB32F_EXT:34837,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT:33297,UNSIGNED_NORMALIZED_EXT:35863,MIN_EXT:32775,MAX_EXT:32776,SRGB_EXT:35904,SRGB_ALPHA_EXT:35906,SRGB8_ALPHA8_EXT:35907,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT:33296,FRAGMENT_SHADER_DERIVATIVE_HINT_OES:35723,COLOR_ATTACHMENT0_WEBGL:36064,COLOR_ATTACHMENT1_WEBGL:36065,COLOR_ATTACHMENT2_WEBGL:36066,COLOR_ATTACHMENT3_WEBGL:36067,COLOR_ATTACHMENT4_WEBGL:36068,COLOR_ATTACHMENT5_WEBGL:36069,COLOR_ATTACHMENT6_WEBGL:36070,COLOR_ATTACHMENT7_WEBGL:36071,COLOR_ATTACHMENT8_WEBGL:36072,COLOR_ATTACHMENT9_WEBGL:36073,COLOR_ATTACHMENT10_WEBGL:36074,COLOR_ATTACHMENT11_WEBGL:36075,COLOR_ATTACHMENT12_WEBGL:36076,COLOR_ATTACHMENT13_WEBGL:36077,COLOR_ATTACHMENT14_WEBGL:36078,COLOR_ATTACHMENT15_WEBGL:36079,DRAW_BUFFER0_WEBGL:34853,DRAW_BUFFER1_WEBGL:34854,DRAW_BUFFER2_WEBGL:34855,DRAW_BUFFER3_WEBGL:34856,DRAW_BUFFER4_WEBGL:34857,DRAW_BUFFER5_WEBGL:34858,DRAW_BUFFER6_WEBGL:34859,DRAW_BUFFER7_WEBGL:34860,DRAW_BUFFER8_WEBGL:34861,DRAW_BUFFER9_WEBGL:34862,DRAW_BUFFER10_WEBGL:34863,DRAW_BUFFER11_WEBGL:34864,DRAW_BUFFER12_WEBGL:34865,DRAW_BUFFER13_WEBGL:34866,DRAW_BUFFER14_WEBGL:34867,DRAW_BUFFER15_WEBGL:34868,MAX_COLOR_ATTACHMENTS_WEBGL:36063,MAX_DRAW_BUFFERS_WEBGL:34852,VERTEX_ARRAY_BINDING_OES:34229,QUERY_COUNTER_BITS_EXT:34916,CURRENT_QUERY_EXT:34917,QUERY_RESULT_EXT:34918,QUERY_RESULT_AVAILABLE_EXT:34919,TIME_ELAPSED_EXT:35007,TIMESTAMP_EXT:36392,GPU_DISJOINT_EXT:36795};iB.default=NXt});var _V=typeof process!="object"||String(process)!=="[object process]"||process.browser;var EV={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"]=EV||{};function er(e,t,r){return t<=e&&e<=r}function DOe(e,t){return e.indexOf(t)!==-1}var Kc=Math.floor;function OE(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError("Could not convert argument to dictionary")}function FOe(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 BOe(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 Ho(e){return 0<=e&&e<=127}var zo=Ho,Fr=-1;function wB(e){this.tokens=[].slice.call(e),this.tokens.reverse()}wB.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 _n=-1;function Dr(e,t){if(e)throw TypeError("Decoder error");return t||65533}function Ms(e){throw TypeError("The code point "+e+" could not be encoded.")}function ROe(){}ROe.prototype={handler:function(e,t){}};function OOe(){}OOe.prototype={handler:function(e,t){}};function _B(e){return e=String(e).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(EB,e)?EB[e]:null}var wV=[{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"}],EB={};wV.forEach(function(e){e.encodings.forEach(function(t){t.labels.forEach(function(r){EB[r]=t})})});var to={},ro={};function L0(e,t){return t&&t[e]||null}function M0(e,t){var r=t.indexOf(e);return r===-1?null:r}function Ga(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=Ga("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 IOe(e){if(e===59335)return 7457;var t=0,r=0,n=Ga("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 POe(e){yB=yB||Ga("jis0208").map(function(r,n){return er(n,8272,8835)?null:r});var t=yB;return t.indexOf(e)}var yB;function jOe(e){xB=xB||Ga("big5").map(function(r,n){return n<(161-129)*157?null:r});var t=xB;return e===9552||e===9566||e===9569||e===9578||e===21313||e===21317?t.lastIndexOf(e):M0(e,t)}var xB,AV="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):AV,t=OE(t),this._encoding=null,this._decoder=null,this._ignoreBOM=!1,this._BOMseen=!1,this._error_mode="replacement",this._do_not_flush=!1;var r=_B(e);if(r===null||r.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!ro[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=OE(r),this._do_not_flush||(this._decoder=ro[this._encoding.name]({fatal:this._error_mode==="fatal"}),this._BOMseen=!1),this._do_not_flush=Boolean(r.stream);for(var i=new wB(n),a=[],o;;){var s=i.read();if(s===Fr||(o=this._decoder.handler(i,s),o===_n))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===_n)break;o!==null&&(Array.isArray(o)?a.push.apply(a,o):a.push(o))}while(!i.endOfStream());this._decoder=null}function u(c){return DOe(["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)),BOe(c)}return u.call(this,a)};function vy(e,t){if(!(this instanceof vy))throw TypeError("Called as a function. Did you forget 'new'?");t=OE(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):AV;var n=_B(e);if(n===null||n.name==="replacement")throw RangeError("Unknown encoding: "+e);if(!to[n.name])throw Error("Encoder not present. Did you forget to include encoding-indexes.js first?");r._encoding=n}else r._encoding=_B("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(vy.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}});vy.prototype.encode=function(t,r){t=t===void 0?"":String(t),r=OE(r),this._do_not_flush||(this._encoder=to[this._encoding.name]({fatal:this._fatal==="fatal"})),this._do_not_flush=Boolean(r.stream);for(var n=new wB(FOe(t)),i=[],a;;){var o=n.read();if(o===Fr||(a=this._encoder.handler(n,o),a===_n))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!==_n;)Array.isArray(a)?i.push.apply(i,a):i.push(a);this._encoder=null}return new Uint8Array(i)};function LOe(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 _n;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 MOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(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}}to["UTF-8"]=function(e){return new MOe(e)};ro["UTF-8"]=function(e){return new LOe(e)};function qOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(Ho(i))return i;var a=e[i-128];return a===null?Dr(r):a}}function NOe(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(zo(i))return i;var a=M0(i,e);return a===null&&Ms(i),a+128}}(function(){"encoding-indexes"in globalThis&&wV.forEach(function(e){e.heading==="Legacy single-byte encodings"&&e.encodings.forEach(function(t){var r=t.name,n=Ga(r.toLowerCase());ro[r]=function(i){return new qOe(n,i)},to[r]=function(i){return new NOe(n,i)}})})})();ro.GBK=function(e){return new SV(e)};to.GBK=function(e){return new TV(e,!0)};function SV(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 _n;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:L0(l,Ga("gb18030")),s===null&&Ho(o)&&a.prepend(o),s===null?Dr(t):s}return Ho(o)?o:o===128?8364:er(o,129,254)?(r=o,null):Dr(t)}}function TV(e,t){var r=e.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(zo(i))return i;if(i===58853)return Ms(i);if(t&&i===8364)return 128;var a=M0(i,Ga("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 Ms(i);a=IOe(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),d=a-f*10;return[c+129,l+48,f+129,d+48]}}to.gb18030=function(e){return new TV(e)};ro.gb18030=function(e){return new SV(e)};function UOe(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 _n;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:L0(o,Ga("big5"));return u===null&&Ho(i)&&n.prepend(i),u===null?Dr(t):u}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function GOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(n))return n;var i=jOe(n);if(i===null)return Ms(n);var a=Kc(i/157)+129;if(a<161)return Ms(n);var o=i%157,s=o<63?64:98;return[a,o+s]}}to.Big5=function(e){return new GOe(e)};ro.Big5=function(e){return new UOe(e)};function zOe(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 _n;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=L0((o-161)*94+(a-161),Ga(r?"jis0212":"jis0208"))),r=!1,er(a,161,254)||i.prepend(a),s===null?Dr(t):s}return Ho(a)?a:a===142||a===143||er(a,161,254)?(n=a,null):Dr(t)}}function HOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(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=M0(n,Ga("jis0208"));if(i===null)return Ms(n);var a=Kc(i/94)+161,o=i%94+161;return[a,o]}}to["EUC-JP"]=function(e){return new HOe(e)};ro["EUC-JP"]=function(e){return new zOe(e)};function WOe(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?_n:(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?_n:(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?_n:(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?_n:(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=L0(c,Ga("jis0208"));return l===null?Dr(t):l}return u===Fr?(n=r.LeadByte,s.prepend(u),Dr(t)):(n=r.LeadByte,Dr(t));case r.EscapeStart:return u===36||u===40?(a=u,n=r.Escape,null):(s.prepend(u),o=!1,n=i,Dr(t));case r.Escape:var f=a;a=0;var d=null;if(f===40&&u===66&&(d=r.ASCII),f===40&&u===74&&(d=r.Roman),f===40&&u===73&&(d=r.Katakana),f===36&&(u===64||u===66)&&(d=r.LeadByte),d!==null){n=n=d;var h=o;return o=!0,h?Dr(t):null}return s.prepend([f,u]),o=!1,n=i,Dr(t)}}}function VOe(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 _n;if((n===r.ASCII||n===r.Roman)&&(a===14||a===15||a===27))return Ms(65533);if(n===r.ASCII&&zo(a))return a;if(n===r.Roman&&(zo(a)&&a!==92&&a!==126||a==165||a==8254)){if(zo(a))return a;if(a===165)return 92;if(a===8254)return 126}if(zo(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=M0(a,Ga("jis0208"));if(o===null)return Ms(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]}}to["ISO-2022-JP"]=function(e){return new VOe(e)};ro["ISO-2022-JP"]=function(e){return new WOe(e)};function KOe(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 _n;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:L0(o,Ga("jis0208"));return c===null&&Ho(i)&&n.prepend(i),c===null?Dr(t):c}return Ho(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 XOe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(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=POe(n);if(i===null)return Ms(n);var a=Kc(i/188),o=a<31?129:193,s=i%188,u=s<63?64:65;return[a+o,s+u]}}to.Shift_JIS=function(e){return new XOe(e)};ro.Shift_JIS=function(e){return new KOe(e)};function YOe(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 _n;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:L0(o,Ga("euc-kr"));return o===null&&Ho(i)&&n.prepend(i),s===null?Dr(t):s}return Ho(i)?i:er(i,129,254)?(r=i,null):Dr(t)}}function $Oe(e){var t=e.fatal;this.handler=function(r,n){if(n===Fr)return _n;if(zo(n))return n;var i=M0(n,Ga("euc-kr"));if(i===null)return Ms(n);var a=Kc(i/190)+129,o=i%190+65;return[a,o]}}to["EUC-KR"]=function(e){return new $Oe(e)};ro["EUC-KR"]=function(e){return new YOe(e)};function RE(e,t){var r=e>>8,n=e&255;return t?[r,n]:[n,r]}function CV(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 _n;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(RE(s,e)),Dr(r))}return er(s,55296,56319)?(i=s,null):er(s,56320,57343)?Dr(r):s}}function DV(e,t){var r=t.fatal;this.handler=function(n,i){if(i===Fr)return _n;if(er(i,0,65535))return RE(i,e);var a=RE((i-65536>>10)+55296,e),o=RE((i-65536&1023)+56320,e);return a.concat(o)}}to["UTF-16BE"]=function(e){return new DV(!0,e)};ro["UTF-16BE"]=function(e){return new CV(!0,e)};to["UTF-16LE"]=function(e){return new DV(!1,e)};ro["UTF-16LE"]=function(e){return new CV(!1,e)};function JOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?_n:Ho(n)?n:63360+n-128}}function QOe(e){var t=e.fatal;this.handler=function(r,n){return n===Fr?_n:zo(n)?n:er(n,63360,63487)?n-63360+128:Ms(n)}}to["x-user-defined"]=function(e){return new QOe(e)};ro["x-user-defined"]=function(e){return new JOe(e)};function by(e){return Buffer.from(e).toString("base64")}function AB(e){return Buffer.from(e,"base64").toString("ascii")}var EY=Kt(xY(),1),wY=Kt(Ty(),1);function _Y(e){return Buffer.isBuffer(e)?new Uint8Array(e).buffer:e}function dPe(e,t){let r=t.type?t.type.replace("image/",""):"jpeg",n=(0,wY.default)(e.data,[e.width,e.height,4],[4,e.width*4,1],0);return(0,EY.default)(n,r,t)}function AY(e,t){let r=dPe(e,t);return new Promise(n=>{let i=[];r.on("data",a=>i.push(a)),r.on("end",()=>{let a=Buffer.concat(i);n(_Y(a))})})}var nae=Kt(rae(),1),CI=["image/png","image/jpeg","image/gif"];async function DI(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 AWe(r,t)}function AWe(e,t){return new Promise(r=>(0,nae.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 So(e,t,r,n){return n._parse(e,t,r,n)}function Jt(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var $u={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},aae=$u.self||$u.window||$u.global||{},oae=$u.window||$u.self||$u.global||{},sae=$u.global||$u.self||$u.window||{},uae=$u.document||{};var vn=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var iae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),SWe=iae&&parseFloat(iae[1])||0;function FI(e,t){return cae(e||{},t)}function cae(e,t){let r={...e};for(let[n,i]of Object.entries(t))i&&typeof i=="object"&&!Array.isArray(i)?r[n]=cae(r[n]||{},t[n]):r[n]=t[n];return r}var lae="beta";function TWe(){var e;return(e=globalThis._loadersgl_)!=null&&e.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.0.0-beta.6"),globalThis._loadersgl_.version}var Uh=TWe();function ha(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Ju={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},ktr=Ju.self||Ju.window||Ju.global||{},Itr=Ju.window||Ju.self||Ju.global||{},Ptr=Ju.global||Ju.self||Ju.window||{},jtr=Ju.document||{};var Xa=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ex=typeof importScripts=="function",dae=typeof window<"u"&&typeof window.orientation<"u",fae=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Ltr=fae&&parseFloat(fae[1])||0;var wx=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){ha(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){ha(this.isRunning),this.isRunning=!1,this._reject(t)}};var Dm={};ca(Dm,{NodeWorker:()=>Ax});var hae=Kt(require("worker_threads"),1);BE(Dm,require("worker_threads"));var Ax=hae.Worker;var BI=new Map;function pae(e){ha(e.source&&!e.url||!e.source&&e.url);let t=BI.get(e.source||e.url);return t||(e.url&&(t=CWe(e.url),BI.set(e.url,t)),e.source&&(t=mae(e.source),BI.set(e.source,t))),ha(t),t}function CWe(e){if(!e.startsWith("http"))return e;let t=DWe(e);return mae(t)}function mae(e){let t=new Blob([e],{type:"application/javascript"});return URL.createObjectURL(t)}function DWe(e){return`try {
174
174
  importScripts('${e}');
175
175
  } catch (error) {
176
176
  console.error(error);
177
177
  throw error;
178
178
  }`}function RI(e,t=!0,r){let n=r||new Set;if(e){if(gae(e))n.add(e);else if(gae(e.buffer))n.add(e.buffer);else if(!ArrayBuffer.isView(e)){if(t&&typeof e=="object")for(let i in e)RI(e[i],t,n)}}return r===void 0?Array.from(n):[]}function gae(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 OI(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]=OI(e[r]):typeof t[r]=="function"||t[r]instanceof RegExp?t[r]={}:t[r]=e[r]}),t}var kI=()=>{},Pf=class{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Xa||typeof Ax<"u"&&!Xa}constructor(t){let{name:r,source:n,url:i}=t;ha(n||i),this.name=r,this.source=n,this.url=i,this.onMessage=kI,this.onError=a=>console.log(a),this.worker=Xa?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=kI,this.onError=kI,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,r){r=r||RI(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=pae({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 Ax(n,{eval:!1})}else if(this.source)t=new Ax(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 Sx=class{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return Pf.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 wx(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){!Xa||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 Pf({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return dae?this.maxMobileConcurrency:this.maxConcurrency}};var FWe={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},Gh=class{props;workerPools=new Map;static isSupported(){return Pf.isSupported()}static getWorkerFarm(t={}){return Gh._workerFarm=Gh._workerFarm||new Gh({}),Gh._workerFarm.setProps(t),Gh._workerFarm}constructor(t){this.props={...FWe},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 Sx({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}}},Pa=Gh;xV(Pa,"_workerFarm");function vae(e){let t=e.version!==Uh?` (worker-utils@${Uh})`:"";return`${e.name}@${e.version}${t}`}function Tx(e,t={}){let r=t[e.id]||{},n=Xa?`${e.id}-worker.js`:`${e.id}-worker-node.js`,i=r.workerUrl;if(!i&&e.id==="compression"&&(i=t.workerUrl),t._workerType==="test"&&(i=`modules/${e.module}/dist/${n}`),!i){let a=e.version;a==="latest"&&(a=lae);let o=a?`@${a}`:"";i=`https://unpkg.com/@loaders.gl/${e.module}${o}/dist/${n}`}return ha(i),i}async function II(e,t,r={},n={}){let i=vae(e),a=Pa.getWorkerFarm(r),{source:o}=r,s={name:i,source:o};o||(s.url=Tx(e,r));let u=a.getWorkerPool(s),c=r.jobName||e.name,l=await u.startJob(c,BWe.bind(null,n)),f=OI(r);return l.postMessage("process",{input:t,options:f}),(await l.result).result}async function BWe(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 PI(e,t=Uh){ha(e,"no worker provided");let r=e.version;return!(!t||!r)}var LI={};ca(LI,{readFileAsArrayBuffer:()=>DA,readFileAsText:()=>FA,requireFromFile:()=>BA,requireFromString:()=>Fm});var jI=Kt(require("module"),1),bae=Kt(require("path"),1),CA=Kt(require("fs"),1);async function DA(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():CA.readFileSync(e).buffer}async function FA(e){return e.startsWith("http")?await(await fetch(e)).text():CA.readFileSync(e,"utf8")}async function BA(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return Fm(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await CA.readFileSync(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=jI.default._nodeModulePaths(bae.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new jI.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 MI={};async function Qu(e,t=null,r={},n=null){return t&&(e=yae(e,t,r,n)),MI[e]=MI[e]||RWe(e),await MI[e]}function yae(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]:Xa?r.CDN?(ha(r.CDN.startsWith("http")),`${r.CDN}/${t}@${Uh}/dist/libs/${n}`):Ex?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function RWe(e){if(e.endsWith("wasm"))return await kWe(e);if(!Xa)try{return LI&&BA&&await BA(e)}catch(r){return console.error(r),null}if(Ex)return importScripts(e);let t=await IWe(e);return OWe(t,e)}function OWe(e,t){if(!Xa)return Fm&&Fm(e,t);if(Ex)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 kWe(e){return!DA||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await DA(e)}async function IWe(e){return!FA||e.startsWith("http")?await(await fetch(e)).text():await FA(e)}var wae=Kt(require("child_process"),1);var xae=Kt(require("child_process"),1);function _ae(e=3e3){return new Promise(t=>{xae.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 Eae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...Eae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Eae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await _ae(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=wae.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 qI(e,t){return!Pa.isSupported()||!Xa&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function NI(e,t,r,n,i){let a=e.id,o=Tx(e,r),u=Pa.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",PWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function PWe(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 UI(e,t){return!Pa.isSupported()||!vn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Sae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Aae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Aae(e,0,t):""}function Aae(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 GI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Sae(e)}"`)}}function Zu(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 ec(...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 To(...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 zh(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 Co(e,t){return Jt(e>=0),Jt(t>0),e+(t-1)&~(t-1)}function zI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+Co(n.byteLength,4)}function HI(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 Bm(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Cx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function RA(e,t,r,n){let i=Co(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 Rm(e,t,r,n){let a=new TextEncoder().encode(r);return t=RA(e,t,a,n),t}async function Hh(e){let t=[];for await(let r of e)t.push(r);return ec(...t)}function jf(e){return jf=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},jf(e)}function WI(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VI(e){var t=WI(e,"string");return jf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=VI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jWe="",Tae={};function tc(e){for(let t in Tae)if(e.startsWith(t)){let r=Tae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${jWe}${e}`),e}var LWe="4.0.0-beta.5",KI={name:"JSON",id:"json",module:"json",version:LWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Cae,parse:async e=>Cae(new TextDecoder().decode(e)),options:{}};function Cae(e){return JSON.parse(e)}function Dae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Fae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(Fae(e))return Dae(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 eu={};ca(eu,{dirname:()=>NWe,filename:()=>qWe,join:()=>UWe,resolve:()=>GWe});function Bae(){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 qWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function NWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function UWe(...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 GWe(...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=Bae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Dx)}return r=zWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Dx=47,XI=46;function zWe(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===Dx)break;a=Dx}if(a===Dx){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==XI||r.charCodeAt(r.length-2)!==XI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Dx;--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===XI&&i!==-1?++i:i=-1}return r}var YI=new Error("Not implemented"),Wh=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 vn?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 YI}async write(t,r,n){throw YI}async stat(){throw YI}async close(){}};var $I=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Fx=class{file;size;constructor(t){this.file=new Wh(t,"r"),this.size=this.file.bigsize}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.size}};var Vh=Kt(require("fs"),1),Kh=class{handle;size;bigsize;url;constructor(t,r,n){t=tc(t),this.handle=Vh.default.openSync(t,r,n);let i=Vh.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)=>{Vh.default.close(this.handle,n=>n?r(n):t())})}async stat(){return await new Promise((t,r)=>Vh.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 WWe(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);Vh.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function WWe(e,t,r,n,i){return await new Promise((a,o)=>Vh.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var PA=Kt(require("fs/promises"),1);var QI=Kt(require("fs"),1),JI=require("stream");var OA=Kt(require("zlib"),1),VWe=e=>e&&e instanceof ArrayBuffer,KWe=e=>e&&e instanceof Buffer;function kA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(OA.default.createBrotliDecompress());case"gzip":return e.pipe(OA.default.createGunzip());case"deflate":return e.pipe(OA.default.createDeflate());default:return e}}async function Rae(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(YWe(i))}),e.on("end",()=>{let i=XWe(t);r(i)})})}function XWe(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 YWe(e){if(VWe(e))return e;if(KWe(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",Oae=e=>typeof e=="function",JWe=e=>e!==null&&typeof e=="object",QWe=e=>JWe(e)&&Oae(e.read)&&Oae(e.pipe)&&$We(e.readable);async function IA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=tc(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,d)=>{let h=QI.default.createReadStream(n,{encoding:null});h.once("readable",()=>f(h)),h.on("error",p=>d(p))}),o=a;QWe(a)?o=kA(a,i):typeof a=="string"?o=JI.Readable.from([new TextEncoder().encode(a)]):o=JI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=ZWe(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 ZWe(e){let t={};if(!t["content-length"]){let r=QI.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 jA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await PA.default.readdir(t,r)}async stat(t){let r=await PA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await PA.default.unlink(t)}async fetch(t,r){return await IA(t,r)}async openReadableFile(t,r="r"){return new Kh(t,r)}async openWritableFile(t,r="w",n){return new Kh(t,r,n)}};var Vae=require("process");var kae=Kt(require("stream"),1),ZI=class{},eVe=kae.Readable||ZI;function t5(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new e5(r,t)}var e5=class extends eVe{_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 jae=Kt(Pae(),1);delete globalThis.ReadableStream;var MA=class extends jae.ReadableStream{};var qA=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 NA=class extends MA{_chunks;constructor(t){super(new qA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Xh=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 Xh)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=tVe(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 Xh([],{type:n});if(u===0)return c;let l=0,f=[];for(let d of a){let{byteLength:h}=d;if(o>0&&h<=o)o-=h,s-=h;else{let p=d.subarray(o,Math.min(h,s));if(f.push(p),l+=p.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 NA(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 tVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function rVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Xh),globalThis.Blob}var nVe=rVe();var UA=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,${by(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var GA=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 iVe(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=UA),typeof File>"u"&&!globalThis.File&&(globalThis.File=GA),global}var aVe=iVe();var r5=Kt(require("module"),1),Lae=Kt(require("path"),1),HA=Kt(require("fs"),1);async function Mae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():HA.default.readFileSync(e).buffer}async function qae(e){return e.startsWith("http")?await(await fetch(e)).text():HA.default.readFileSync(e,"utf8")}async function Nae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return zA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await HA.default.readFileSync(e,"utf8");return zA(t)}function zA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=r5.default._nodeModulePaths(Lae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new r5.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 tu=class{map;constructor(t){this.map={},t instanceof tu?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=Bx(t),r=Uae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Bx(t)]}get(t){return t=Bx(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Bx(t))}set(t,r){this.map[Bx(t)]=Uae(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)}),n5(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),n5(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),n5(t)}*[Symbol.iterator](){yield*this.entries()}};function Bx(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 Uae(e){return typeof e!="string"&&(e=String(e)),e}function n5(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function i5(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var o5=Kt(require("stream"),1),oVe=e=>typeof e=="boolean",Gae=e=>typeof e=="function",sVe=e=>e!==null&&typeof e=="object",a5=e=>sVe(e)&&Gae(e.read)&&Gae(e.pipe)&&oVe(e.readable),dl=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 tu((r==null?void 0:r.headers)||{}),a5(t)?this._body=kA(t,n):typeof t=="string"?this._body=o5.Readable.from([new TextEncoder().encode(t)]):this._body=o5.Readable.from([t||new ArrayBuffer(0)])}get body(){return i5(!this.bodyUsed),i5(a5(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return a5(this._body)?await Rae(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 Hae=Kt(require("http"),1),Wae=Kt(require("https"),1);var uVe=e=>e&&e instanceof ArrayBuffer,cVe=e=>e&&e instanceof Buffer;function zae(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:lVe(r),mimeType:n}}function lVe(e){if(uVe(e))return e;if(cVe(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 s5=e=>e.startsWith("data:"),fVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Rx(e,t){try{if(globalThis.fetch!==Rx&&(fVe(e)||s5(e)))return await fetch(e,t);if(s5(e)){let{arrayBuffer:c,mimeType:l}=zae(e);return new dl(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 dVe(n,t),a=gVe(e,i,r),{status:o,statusText:s}=mVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=hVe(e,a.get("location"));return await Rx(c,t)}return new dl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new dl(null,{status:400,statusText:String(r),url:e})}}async function dVe(e,t){return await new Promise((r,n)=>{let i=pVe(e,t),a=e.startsWith("https:")?Wae.default.request(i,o=>r(o)):Hae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function hVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function pVe(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 mVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function gVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=vVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new tu(n)}function vVe(e){return s5(e)?e.length-5:null}var bVe=parseInt(Vae.versions.node.split(".")[0]);_V&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=t5;globalThis.loaders.NodeFile=Kh;globalThis.loaders.NodeFileSystem=jA;globalThis.loaders.fetchNode=IA;globalThis.TextEncoder||(globalThis.TextEncoder=vy);globalThis.TextDecoder||(globalThis.TextDecoder=Eh);!("atob"in globalThis)&&by&&(globalThis.atob=by);!("btoa"in globalThis)&&AB&&(globalThis.btoa=AB);globalThis.loaders.encodeImageNode=AY;globalThis.loaders.parseImageNode=DI;globalThis.loaders.imageFormatsNode=CI;globalThis._parseImageNode=DI;globalThis._imageFormatsNode=CI;globalThis.loaders.readFileAsArrayBuffer=Mae;globalThis.loaders.readFileAsText=qae;globalThis.loaders.requireFromFile=Nae;globalThis.loaders.requireFromString=zA;bVe<18&&(!("Headers"in globalThis)&&tu&&(globalThis.Headers=tu),!("Response"in globalThis)&&dl&&(globalThis.Response=dl),!("fetch"in globalThis)&&Rx&&(globalThis.fetch=Rx));var zRe=require("path"),HRe=Kt(Lye(),1);var JSt=e=>typeof e=="boolean",U1=e=>typeof e=="function",Ep=e=>e!==null&&typeof e=="object",G9=e=>Ep(e)&&e.constructor==={}.constructor;var Mye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",qye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var us=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var cs=e=>typeof Blob<"u"&&e instanceof Blob,Nye=e=>e&&typeof e=="object"&&e.isBuffer;var QSt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ep(e)&&U1(e.tee)&&U1(e.cancel)&&U1(e.getReader);var ZSt=e=>Ep(e)&&U1(e.read)&&U1(e.pipe)&&JSt(e.readable),Y8=e=>QSt(e)||ZSt(e);var eTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tTt=/^([-\w.]+\/[-\w.+]+)/;function Uye(e){let t=tTt.exec(e);return t?t[1]:e}function z9(e){let t=eTt.exec(e);return t?t[1]:""}var Gye=/\?.*/;function zye(e){let t=e.match(Gye);return t&&t[0]}function sv(e){return e.replace(Gye,"")}function wp(e){return us(e)?e.url:cs(e)?e.name||"":typeof e=="string"?e:""}function G1(e){if(us(e)){let t=e,r=t.headers.get("content-type")||"",n=sv(t.url);return Uye(r)||z9(n)}return cs(e)?e.type||"":typeof e=="string"?z9(e):""}function Hye(e){return us(e)?e.headers["content-length"]||-1:cs(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function $8(e){if(us(e))return e;let t={},r=Hye(e);r>=0&&(t["content-length"]=String(r));let n=wp(e),i=G1(e);i&&(t["content-type"]=i);let a=await nTt(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 Wye(e){if(!e.ok){let t=await rTt(e);throw new Error(t)}}async function rTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function nTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${iTt(r)}`}return null}function iTt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function aTt(e){return!oTt(e)&&!sTt(e)}function oTt(e){return e.startsWith("http:")||e.startsWith("https:")}function sTt(e){return e.startsWith("data:")}async function Fo(e,t){var r,n;if(typeof e=="string"){let i=tc(e);return aTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await $8(e)}function H9(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 lu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||H9()}var uTt=globalThis.self||globalThis.window||globalThis.global,uv=globalThis.window||globalThis.self||globalThis.global,cTt=globalThis.document||{},Ap=globalThis.process||{},lTt=globalThis.console,kpr=globalThis.navigator||{};var J8="4.0.0-beta.5",jpr=lu();function fTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Q8=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=fTt(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 Vye(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 Kye(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 Z8(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 eC;(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"})(eC||(eC={}));var dTt=10;function Xye(e){return typeof e!="string"?e:(e=e.toUpperCase(),eC[e]||eC.WHITE)}function Yye(e,t,r){if(!lu&&typeof e=="string"){if(t){let n=Xye(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Xye(r);e="\x1B[".concat(n+dTt,"m").concat(e,"\x1B[49m")}}return e}function $ye(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 Sp(){let e;if(lu()&&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 Ap){var n;let i=Ap===null||Ap===void 0||(n=Ap.hrtime)===null||n===void 0?void 0:n.call(Ap);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var lv={debug:lu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},hTt={enabled:!0,level:0};function ls(){}var Jye={},Qye={once:!0},gc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",J8),zt(this,"_startTs",Sp()),zt(this,"_deltaTs",Sp()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new Q8("__probe-".concat(this.id,"__"),hTt),this.timeStamp("".concat(this.id," started")),$ye(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((Sp()-this._startTs).toPrecision(10))}getDelta(){return Number((Sp()-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,Qye)}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,Qye)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ls,n&&[n],{tag:vTt(r)}):ls}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?lu()?gTt({image:i,message:a,scale:o}):mTt({image:i,message:a,scale:o}):ls}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||ls)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Zye({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||ls)}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()>=exe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=Zye({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,cv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Sp();let o=a.tag||a.message;if(a.once&&o)if(!Jye[o])Jye[o]=Sp();else return ls;return r=pTt(this.id,a.message,a),n.bind(console,r,...a.args)}return ls}};zt(gc,"VERSION",J8);function exe(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 Zye(e){let{logLevel:t,message:r}=e;e.logLevel=exe(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 pTt(e,t,r){if(typeof t=="string"){let n=r.time?Kye(Vye(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Yye(t,r.color,r.background)}return t}function mTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ls}function gTt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=Z8(a,r,n);console.log(...o)},a.src=t,ls}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Z8(t,r,n)),ls;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...Z8(a,r,n)),a.src=t.toDataURL(),ls}return ls}function vTt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var c0r=new gc({id:"@probe.gl/log"});var W9=new gc({id:"loaders.gl"}),tC=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},rC=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 V9={fetch:null,mimeType:void 0,nothrow:!1,log:new rC,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:vn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},txe={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 K9(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function fv(){let e=K9();return e.globalOptions=e.globalOptions||{...V9},e.globalOptions}function ixe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],bTt(e,r),xTt(t,e,n)}function bTt(e,t){rxe(e,null,V9,txe,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]||{};rxe(n,r.id,i,a,t)}}function rxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ep(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)W9.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=yTt(s,i);W9.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function yTt(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 xTt(e,t,r){let i={...e.options||{}};return _Tt(i,r),i.log===null&&(i.log=new tC),nxe(i,fv()),nxe(i,t),i}function nxe(e,t){for(let r in t)if(r in t){let n=t[r];G9(n)&&G9(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function _Tt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function z1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function X9(e){Jt(e,"null loader"),Jt(z1(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 ETt=()=>{let e=K9();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function axe(){return ETt()}var oxe=new gc({id:"loaders.gl"});var wTt=/\.([^.]+)$/;async function cxe(e,t=[],r,n){if(!lxe(e))return null;let i=sxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(cs(e)&&(e=await e.slice(0,10).arrayBuffer(),i=sxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(fxe(e));return i}function sxe(e,t=[],r,n){if(!lxe(e))return null;if(t&&!Array.isArray(t))return X9(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...axe()),STt(i);let a=ATt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(fxe(e));return a}function ATt(e,t,r,n){let i=wp(e),a=G1(e),o=sv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=Y9(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||TTt(t,o),u=u||(s?`matched url ${o}`:""),s=s||Y9(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||DTt(t,e),u=u||(s?`matched initial data ${dxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||Y9(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&oxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function lxe(e){return!(e instanceof Response&&e.status===204)}function fxe(e){let t=wp(e),r=G1(e),n="No valid loader found (";n+=t?`${eu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?dxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function STt(e){for(let t of e)X9(t)}function TTt(e,t){let r=t&&wTt.exec(t),n=r&&r[1];return n?CTt(e,n):null}function CTt(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 Y9(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function DTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(FTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(uxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&uxe(t,0,r))return r;return null}function FTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function uxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>BTt(e,t,r,i))}function BTt(e,t,r,n){if(n instanceof ArrayBuffer)return Zu(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=$9(e,t,n.length);return n===i;default:return!1}}function dxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?$9(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?$9(e,0,t):""}function $9(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*hxe(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*pxe(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*mxe(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 J9(e,t){return vn?RTt(e,t):OTt(e,t)}async function*RTt(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*OTt(e,t){for await(let r of e)yield fl(r)}function gxe(e,t){if(typeof e=="string")return hxe(e,t);if(e instanceof ArrayBuffer)return pxe(e,t);if(cs(e))return mxe(e,t);if(Y8(e))return J9(e,t);if(us(e))return J9(e.body,t);throw new Error("makeIterator")}var vxe="Cannot convert supplied data type";function kTt(e,t,r){if(t.text&&typeof e=="string")return e;if(Nye(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(vxe)}async function bxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return kTt(e,t,r);if(cs(e)&&(e=await $8(e)),us(e)){let i=e;return await Wye(i),t.binary?await i.arrayBuffer():await i.text()}if(Y8(e)&&(e=gxe(e,r)),Mye(e)||qye(e))return Hh(e);throw new Error(vxe)}function nC(e,t){let r=fv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ep(n.fetch)?i=>Fo(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:Fo}function yxe(e,t,r){if(r)return r;let n={fetch:nC(t,e),...e};if(n.url){let i=sv(n.url);n.baseUrl=i,n.queryString=zye(n.url),n.filename=eu.filename(i),n.baseUrl=eu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function xxe(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)&&!z1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=wp(e),o=xxe(t,n),s=await cxe(e,o,r);return s?(r=ixe(r,s,o,i),n=yxe({url:i,_parse:Bo,loaders:o},r,n||null),await ITt(s,e,r,n)):null}async function ITt(e,t,r,n){if(PI(e),r=FI(e.options,r),us(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,d=Object.fromEntries(a.headers.entries());n.response={headers:d,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await bxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(qI(e,r))return await NI(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 ha(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function mn(e,t,r,n){let i,a;!Array.isArray(t)&&!z1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=nC(a),s=e;return typeof e=="string"&&(s=await o(e)),cs(e)&&(s=await o(e)),Array.isArray(i)?await Bo(s,i,a):await Bo(s,i,a)}async function dv(e,t,r){if(r={...fv(),...r},UI(t,r))return await II(t,e,r);if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return new TextEncoder().encode(await t.encodeText(e,r));if(t.encodeInBatches){let i=Exe(e,t,r),a=[];for await(let o of i)a.push(o);return ec(...a)}if(!vn&&t.encodeURLtoURL){let i=_xe("input");await new Wh(i,"w").write(e);let o=_xe("output"),s=await wxe(i,o,t,r);return(await Fo(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function iC(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Exe(e,t,r){if(t.encodeInBatches){let n=PTt(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}async function wxe(e,t,r,n){if(e=tc(e),t=tc(t),vn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}function PTt(e){return[{...e,start:0,end:e.length}]}function _xe(e){return`/tmp/${e}`}var jTt=1/Math.PI*180,LTt=1/180*Math.PI,MTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...MTt}};var Sn=globalThis.mathgl.config;function Q9(e,{precision:t=Sn.precision}={}){return e=qTt(e),"".concat(parseFloat(e.toPrecision(t)))}function fs(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Z9(e){return Axe(e)}function e7(e){return Cl(e)}function Axe(e,t){return r7(e,r=>r*LTt,t)}function Cl(e,t){return r7(e,r=>r*jTt,t)}function t7(e,t,r){return r7(e,n=>Math.max(t,Math.min(r,n)))}function Ro(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(fs(e)&&fs(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Ro(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 qTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function NTt(e){return e.clone?e.clone():new Array(e.length)}function r7(e,t,r){if(fs(e)){let n=e;r=r||NTt(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 UTt(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 bd=class extends UTt(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:fs(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?", ":"")+Q9(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(!Ro(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 GTt(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 yd(e,t,r=""){if(Sn.debug&&!GTt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function na(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var xd=class extends bd{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 na(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return na(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 Ln=typeof Float32Array<"u"?Float32Array:Array,H1=Math.random;function hv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var $mr=Math.PI/180;function zTt(){let e=new Ln(2);return Ln!=Float32Array&&(e[0]=0,e[1]=0),e}function Sxe(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 Txe(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 aC(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 oC(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 Jmr=function(){let e=zTt();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 sC(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 uC(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 Cxe(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 Dxe(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 cC(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 Tp=class extends xd{constructor(t=0,r=0){super(2),fs(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 oC(this,this,t),this.check()}transformAsVector(t){return sC(this,this,t),this.check()}transformByMatrix3(t){return aC(this,this,t),this.check()}transformByMatrix2x3(t){return Txe(this,this,t),this.check()}transformByMatrix2(t){return Sxe(this,this,t),this.check()}};var mv={};ca(mv,{add:()=>KTt,angle:()=>s7,bezier:()=>o6t,ceil:()=>XTt,clone:()=>HTt,copy:()=>WTt,create:()=>lC,cross:()=>Cp,dist:()=>m6t,distance:()=>kxe,div:()=>p6t,divide:()=>Oxe,dot:()=>W1,equals:()=>f6t,exactEquals:()=>l6t,floor:()=>YTt,forEach:()=>b6t,fromValues:()=>fC,hermite:()=>a6t,inverse:()=>r6t,len:()=>u7,length:()=>Fxe,lerp:()=>n6t,max:()=>JTt,min:()=>$Tt,mul:()=>h6t,multiply:()=>Rxe,negate:()=>t6t,normalize:()=>n7,random:()=>s6t,rotateX:()=>i7,rotateY:()=>a7,rotateZ:()=>o7,round:()=>QTt,scale:()=>ZTt,scaleAndAdd:()=>e6t,set:()=>VTt,slerp:()=>i6t,sqrDist:()=>g6t,sqrLen:()=>v6t,squaredDistance:()=>Ixe,squaredLength:()=>Pxe,str:()=>c6t,sub:()=>d6t,subtract:()=>Bxe,transformMat3:()=>V1,transformMat4:()=>Dp,transformQuat:()=>K1,zero:()=>u6t});function lC(){let e=new Ln(3);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function HTt(e){let t=new Ln(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Fxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function fC(e,t,r){let n=new Ln(3);return n[0]=e,n[1]=t,n[2]=r,n}function WTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function VTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function KTt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Bxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Rxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Oxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function XTt(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function YTt(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function $Tt(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 JTt(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 QTt(e,t){return e[0]=hv(t[0]),e[1]=hv(t[1]),e[2]=hv(t[2]),e}function ZTt(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function e6t(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 kxe(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 Ixe(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 Pxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function t6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function r6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function n7(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 W1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Cp(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 n6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function i6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(W1(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 a6t(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 o6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,d=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*d,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*d,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*d,e}function s6t(e,t){t=t===void 0?1:t;let r=H1()*2*Math.PI,n=H1()*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 Dp(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 V1(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 K1(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,d=n*u-i*s,h=i*d-a*f,p=a*l-n*d,b=n*f-i*l,g=o*2;return l*=g,f*=g,d*=g,h*=2,p*=2,b*=2,e[0]=s+l+h,e[1]=u+f+p,e[2]=c+d+b,e}function i7(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 a7(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 o7(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 s7(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&&W1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function u6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function c6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function l6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function f6t(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 d6t=Bxe,h6t=Rxe,p6t=Oxe,m6t=kxe,g6t=Ixe,u7=Fxe,v6t=Pxe,b6t=function(){let e=lC();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 c7=[0,0,0],dC,ce=class extends xd{static get ZERO(){return dC||(dC=new ce(0,0,0),Object.freeze(dC)),dC}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&fs(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 s7(this,t)}cross(t){return Cp(this,this,t),this.check()}rotateX({radians:t,origin:r=c7}){return i7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=c7}){return a7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=c7}){return o7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Dp(this,this,t),this.check()}transformAsVector(t){return uC(this,this,t),this.check()}transformByMatrix3(t){return V1(this,this,t),this.check()}transformByMatrix2(t){return Cxe(this,this,t),this.check()}transformByQuaternion(t){return K1(this,this,t),this.check()}};var hC,ds=class extends xd{static get ZERO(){return hC||(hC=new ds(0,0,0,0),Object.freeze(hC)),hC}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),fs(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 Dp(this,this,t),this.check()}transformByMatrix3(t){return cC(this,this,t),this.check()}transformByMatrix2(t){return Dxe(this,this,t),this.check()}transformByQuaternion(t){return K1(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gv=class extends bd{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 jxe(){let e=new Ln(9);return Ln!=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 Lxe(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 Mxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,d=-l*a+s*u,h=c*a-o*u,p=r*f+n*d+i*h;return p?(p=1/p,e[0]=f*p,e[1]=(-l*n+i*c)*p,e[2]=(s*n-i*o)*p,e[3]=d*p,e[4]=(l*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=h*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*a)*p,e):null}function qxe(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 l7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],h=r[1],p=r[2],b=r[3],g=r[4],x=r[5],w=r[6],S=r[7],F=r[8];return e[0]=d*n+h*o+p*c,e[1]=d*i+h*s+p*l,e[2]=d*a+h*u+p*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]=w*n+S*o+F*c,e[7]=w*i+S*s+F*l,e[8]=w*a+S*u+F*f,e}function Nxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+h*o+c,e[7]=d*i+h*s+l,e[8]=d*a+h*u+f,e}function Uxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=Math.sin(r),h=Math.cos(r);return e[0]=h*n+d*o,e[1]=h*i+d*s,e[2]=h*a+d*u,e[3]=h*o-d*n,e[4]=h*s-d*i,e[5]=h*u-d*a,e[6]=c,e[7]=l,e[8]=f,e}function f7(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 Gxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,h=i*s,p=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-p,e[3]=l-x,e[6]=d+g,e[1]=l+x,e[4]=1-c-p,e[7]=h-b,e[2]=d-g,e[5]=h+b,e[8]=1-c-f,e}var d7;(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"})(d7||(d7={}));var x6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Pr=class extends gv{static get IDENTITY(){return E6t()}static get ZERO(){return _6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return d7}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(x6t)}fromObject(t){return this.check()}fromQuaternion(t){return Gxe(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 qxe(this)}transpose(){return Lxe(this,this),this.check()}invert(){return Mxe(this,this),this.check()}multiplyLeft(t){return l7(this,t,this),this.check()}multiplyRight(t){return l7(this,this,t),this.check()}rotate(t){return Uxe(this,this,t),this.check()}scale(t){return Array.isArray(t)?f7(this,this,t):f7(this,this,[t,t]),this.check()}translate(t){return Nxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=aC(r||[-0,-0],t,this);break;case 3:n=V1(r||[-0,-0,-0],t,this);break;case 4:n=cC(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yd(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)}},pC,mC=null;function _6t(){return pC||(pC=new Pr([0,0,0,0,0,0,0,0,0]),Object.freeze(pC)),pC}function E6t(){return mC||(mC=new Pr,Object.freeze(mC)),mC}var gC={};ca(gC,{add:()=>K6t,adjoint:()=>D6t,clone:()=>A6t,copy:()=>S6t,create:()=>w6t,decompose:()=>M6t,determinant:()=>m7,equals:()=>J6t,exactEquals:()=>$6t,frob:()=>V6t,fromQuat:()=>E7,fromQuat2:()=>P6t,fromRotation:()=>R6t,fromRotationTranslation:()=>Hxe,fromRotationTranslationScale:()=>q6t,fromRotationTranslationScaleOrigin:()=>N6t,fromScaling:()=>B6t,fromTranslation:()=>F6t,fromValues:()=>T6t,fromXRotation:()=>O6t,fromYRotation:()=>k6t,fromZRotation:()=>I6t,frustum:()=>w7,getRotation:()=>L6t,getScaling:()=>Wxe,getTranslation:()=>j6t,identity:()=>zxe,invert:()=>p7,lookAt:()=>T7,mul:()=>Q6t,multiply:()=>X1,multiplyScalar:()=>X6t,multiplyScalarAndAdd:()=>Y6t,ortho:()=>S7,orthoNO:()=>Kxe,orthoZO:()=>z6t,perspective:()=>A7,perspectiveFromFieldOfView:()=>G6t,perspectiveNO:()=>Vxe,perspectiveZO:()=>U6t,rotate:()=>b7,rotateX:()=>y7,rotateY:()=>x7,rotateZ:()=>_7,scale:()=>v7,set:()=>C6t,str:()=>W6t,sub:()=>Z6t,subtract:()=>Xxe,targetTo:()=>H6t,translate:()=>g7,transpose:()=>h7});function w6t(){let e=new Ln(16);return Ln!=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 A6t(e){let t=new Ln(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 S6t(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 T6t(e,t,r,n,i,a,o,s,u,c,l,f,d,h,p,b){let g=new Ln(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=d,g[13]=h,g[14]=p,g[15]=b,g}function C6t(e,t,r,n,i,a,o,s,u,c,l,f,d,h,p,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=d,e[12]=h,e[13]=p,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 h7(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 p7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],h=t[11],p=t[12],b=t[13],g=t[14],x=t[15],w=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,B=i*c-a*u,N=l*b-f*p,C=l*g-d*p,k=l*x-h*p,I=f*g-d*b,U=f*x-h*b,Y=d*x-h*g,$=w*Y-S*U+F*I+D*k-j*C+B*N;return $?($=1/$,e[0]=(s*Y-u*U+c*I)*$,e[1]=(i*U-n*Y-a*I)*$,e[2]=(b*B-g*j+x*D)*$,e[3]=(d*j-f*B-h*D)*$,e[4]=(u*k-o*Y-c*C)*$,e[5]=(r*Y-i*k+a*C)*$,e[6]=(g*F-p*B-x*S)*$,e[7]=(l*B-d*F+h*S)*$,e[8]=(o*U-s*k+c*N)*$,e[9]=(n*k-r*U-a*N)*$,e[10]=(p*j-b*F+x*w)*$,e[11]=(f*F-l*j-h*w)*$,e[12]=(s*C-o*I-u*N)*$,e[13]=(r*I-n*C+i*N)*$,e[14]=(b*S-p*D-g*w)*$,e[15]=(l*D-f*S+d*w)*$,e):null}function D6t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],h=t[11],p=t[12],b=t[13],g=t[14],x=t[15],w=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,B=i*c-a*u,N=l*b-f*p,C=l*g-d*p,k=l*x-h*p,I=f*g-d*b,U=f*x-h*b,Y=d*x-h*g;return e[0]=s*Y-u*U+c*I,e[1]=i*U-n*Y-a*I,e[2]=b*B-g*j+x*D,e[3]=d*j-f*B-h*D,e[4]=u*k-o*Y-c*C,e[5]=r*Y-i*k+a*C,e[6]=g*F-p*B-x*S,e[7]=l*B-d*F+h*S,e[8]=o*U-s*k+c*N,e[9]=n*k-r*U-a*N,e[10]=p*j-b*F+x*w,e[11]=f*F-l*j-h*w,e[12]=s*C-o*I-u*N,e[13]=r*I-n*C+i*N,e[14]=b*S-p*D-g*w,e[15]=l*D-f*S+d*w,e}function m7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],h=e[12],p=e[13],b=e[14],g=e[15],x=t*o-r*a,w=t*s-n*a,S=r*s-n*o,F=c*p-l*h,D=c*b-f*h,j=l*b-f*p,B=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*w+f*x,k=h*S-p*w+b*x;return u*B-i*N+g*C-d*k}function X1(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=t[9],h=t[10],p=t[11],b=t[12],g=t[13],x=t[14],w=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*d+j*g,e[2]=S*a+F*c+D*h+j*x,e[3]=S*o+F*l+D*p+j*w,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*d+j*g,e[6]=S*a+F*c+D*h+j*x,e[7]=S*o+F*l+D*p+j*w,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*d+j*g,e[10]=S*a+F*c+D*h+j*x,e[11]=S*o+F*l+D*p+j*w,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*d+j*g,e[14]=S*a+F*c+D*h+j*x,e[15]=S*o+F*l+D*p+j*w,e}function g7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,d,h,p,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],d=t[6],h=t[7],p=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=d,e[7]=h,e[8]=p,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+p*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+d*i+g*a+t[14],e[15]=c*n+h*i+x*a+t[15]),e}function v7(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 b7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,d,h,p,b,g,x,w,S,F,D,j,B,N,C,k,I,U,Y,$,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],d=t[1],h=t[2],p=t[3],b=t[4],g=t[5],x=t[6],w=t[7],S=t[8],F=t[9],D=t[10],j=t[11],B=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,k=i*a*l-o*c,I=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,$=a*o*l-i*c,re=o*o*l+u,e[0]=f*B+b*N+S*C,e[1]=d*B+g*N+F*C,e[2]=h*B+x*N+D*C,e[3]=p*B+w*N+j*C,e[4]=f*k+b*I+S*U,e[5]=d*k+g*I+F*U,e[6]=h*k+x*I+D*U,e[7]=p*k+w*I+j*U,e[8]=f*Y+b*$+S*re,e[9]=d*Y+g*$+F*re,e[10]=h*Y+x*$+D*re,e[11]=p*Y+w*$+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function y7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+d*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=d*i-u*n,e}function x7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-d*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+d*i,e}function _7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+d*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=d*i-u*n,e}function F6t(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 B6t(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 R6t(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 O6t(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 k6t(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 I6t(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 Hxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,d=n*c,h=i*u,p=i*c,b=a*c,g=o*s,x=o*u,w=o*c;return e[0]=1-(h+b),e[1]=f+w,e[2]=d-x,e[3]=0,e[4]=f-w,e[5]=1-(l+b),e[6]=p+g,e[7]=0,e[8]=d+x,e[9]=p-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 P6t(e,t){let r=new Ln(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),Hxe(e,t,r),e}function j6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Wxe(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 L6t(e,t){let r=new Ln(3);Wxe(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,d=t[8]*n,h=t[9]*i,p=t[10]*a,b=o+l+p,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(d-u)/g,e[2]=(s-c)/g):o>l&&o>p?(g=Math.sqrt(1+o-l-p)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(d+u)/g):l>p?(g=Math.sqrt(1+l-o-p)*2,e[3]=(d-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+p-o-l)*2,e[3]=(s-c)/g,e[0]=(d+u)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function M6t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],d=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+d*d);let h=1/r[0],p=1/r[1],b=1/r[2],g=i*h,x=a*p,w=o*b,S=s*h,F=u*p,D=c*b,j=l*h,B=f*p,N=d*b,C=g+F+N,k=0;return C>0?(k=Math.sqrt(C+1)*2,e[3]=.25*k,e[0]=(D-B)/k,e[1]=(j-w)/k,e[2]=(x-S)/k):g>F&&g>N?(k=Math.sqrt(1+g-F-N)*2,e[3]=(D-B)/k,e[0]=.25*k,e[1]=(x+S)/k,e[2]=(j+w)/k):F>N?(k=Math.sqrt(1+F-g-N)*2,e[3]=(j-w)/k,e[0]=(x+S)/k,e[1]=.25*k,e[2]=(D+B)/k):(k=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/k,e[0]=(j+w)/k,e[1]=(D+B)/k,e[2]=.25*k),e}function q6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,d=i*c,h=i*l,p=a*c,b=a*l,g=o*l,x=s*u,w=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(p+g))*F,e[1]=(d+S)*F,e[2]=(h-w)*F,e[3]=0,e[4]=(d-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(h+w)*j,e[9]=(b-x)*j,e[10]=(1-(f+p))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function N6t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,d=a*c,h=a*l,p=a*f,b=o*l,g=o*f,x=s*f,w=u*c,S=u*l,F=u*f,D=n[0],j=n[1],B=n[2],N=i[0],C=i[1],k=i[2],I=(1-(b+x))*D,U=(h+F)*D,Y=(p-S)*D,$=(h-F)*j,re=(1-(d+x))*j,ee=(g+w)*j,ge=(p+S)*B,ye=(g-w)*B,he=(1-(d+b))*B;return e[0]=I,e[1]=U,e[2]=Y,e[3]=0,e[4]=$,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-(I*N+$*C+ge*k),e[13]=r[1]+C-(U*N+re*C+ye*k),e[14]=r[2]+k-(Y*N+ee*C+he*k),e[15]=1,e}function E7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,h=i*s,p=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-p,e[1]=l+x,e[2]=d-g,e[3]=0,e[4]=l-x,e[5]=1-c-p,e[6]=h+b,e[7]=0,e[8]=d+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 w7(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 Vxe(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 A7=Vxe;function U6t(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 G6t(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 Kxe(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 S7=Kxe;function z6t(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 T7(e,t,r,n){let i,a,o,s,u,c,l,f,d,h,p=t[0],b=t[1],g=t[2],x=n[0],w=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(p-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?zxe(e):(f=p-F,d=b-D,h=g-j,i=1/Math.sqrt(f*f+d*d+h*h),f*=i,d*=i,h*=i,a=w*h-S*d,o=S*f-x*h,s=x*d-w*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=d*s-h*o,c=h*a-f*s,l=f*o-d*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=h,e[11]=0,e[12]=-(a*p+o*b+s*g),e[13]=-(u*p+c*b+l*g),e[14]=-(f*p+d*b+h*g),e[15]=1,e)}function H6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],d=o-r[2],h=l*l+f*f+d*d;h>0&&(h=1/Math.sqrt(h),l*=h,f*=h,d*=h);let p=u*d-c*f,b=c*l-s*d,g=s*f-u*l;return h=p*p+b*b+g*g,h>0&&(h=1/Math.sqrt(h),p*=h,b*=h,g*=h),e[0]=p,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-d*b,e[5]=d*p-l*g,e[6]=l*b-f*p,e[7]=0,e[8]=l,e[9]=f,e[10]=d,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function W6t(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 V6t(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 K6t(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 Xxe(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 X6t(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 Y6t(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 $6t(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 J6t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],h=e[11],p=e[12],b=e[13],g=e[14],x=e[15],w=t[0],S=t[1],F=t[2],D=t[3],j=t[4],B=t[5],N=t[6],C=t[7],k=t[8],I=t[9],U=t[10],Y=t[11],$=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-w)<=1e-6*Math.max(1,Math.abs(r),Math.abs(w))&&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-B)<=1e-6*Math.max(1,Math.abs(s),Math.abs(B))&&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-k)<=1e-6*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(f-I)<=1e-6*Math.max(1,Math.abs(f),Math.abs(I))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(h-Y)<=1e-6*Math.max(1,Math.abs(h),Math.abs(Y))&&Math.abs(p-$)<=1e-6*Math.max(1,Math.abs(p),Math.abs($))&&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 Q6t=X1,Z6t=Xxe;function e3t(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Yxe(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 $xe(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 Jxe(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 Qxe(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function Zxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function e1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function t1e(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 r1e(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 n1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,d=c*a+o*i-s*n,h=-o*n-s*i-u*a;return e[0]=l*c+h*-o+f*-u-d*-s,e[1]=f*c+h*-s+d*-o-l*-u,e[2]=d*c+h*-u+l*-s-f*-o,e[3]=t[3],e}var Fgr=function(){let e=e3t();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 F7;(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"})(F7||(F7={}));var r3t=45*Math.PI/180,n3t=1,C7=.1,D7=500,i3t=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 o3t()}static get ZERO(){return a3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return F7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,d,h,p,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=d,this[12]=h,this[13]=p,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,d,h,p,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]=p,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=d,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(i3t)}fromObject(t){return this.check()}fromQuaternion(t){return E7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=C7,far:s=D7}=t;return s===1/0?s3t(this,r,n,i,a,o):w7(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 T7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=C7,far:s=D7}=t;return S7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=r3t,aspect:n=n3t,focalDistance:i=1,near:a=C7,far:o=D7}=t;i1e(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 i1e(r),A7(this,r,n,i,a),this.check()}determinant(){return m7(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 h7(this,this),this.check()}invert(){return p7(this,this),this.check()}multiplyLeft(t){return X1(this,t,this),this.check()}multiplyRight(t){return X1(this,this,t),this.check()}rotateX(t){return y7(this,this,t),this.check()}rotateY(t){return x7(this,this,t),this.check()}rotateZ(t){return _7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return b7(this,this,t,r),this.check()}scale(t){return v7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return g7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=r1e(r||[-0,-0,-0,-0],t,this),yd(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=oC(r||[-0,-0],t,this);break;case 3:i=Dp(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yd(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=sC(r||[-0,-0],t,this);break;case 3:n=uC(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yd(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])}},vC,bC;function a3t(){return vC||(vC=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(vC)),vC}function o3t(){return bC||(bC=new Kr,Object.freeze(bC)),bC}function i1e(e){if(e>Math.PI*2)throw Error("expected radians")}function s3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,d=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}function a1e(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function o1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function B7(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 R7(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 s1e(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 u1e(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 c1e(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 l1e(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 Y1(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],d,h,p,b,g;return d=i*u+a*c+o*l+s*f,d<0&&(d=-d,u=-u,c=-c,l=-l,f=-f),1-d>1e-6?(h=Math.acos(d),g=Math.sin(h),p=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(p=1-n,b=n),e[0]=p*i+b*u,e[1]=p*a+b*c,e[2]=p*o+b*l,e[3]=p*s+b*f,e}function f1e(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 d1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function O7(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 h1e=Yxe;var p1e=$xe,m1e=e1e,g1e=t1e,v1e=Jxe;var b1e=Qxe;var y1e=Zxe;var x1e=function(){let e=lC(),t=fC(1,0,0),r=fC(0,1,0);return function(n,i,a){let o=W1(i,a);return o<-.999999?(Cp(e,t,i),u7(e)<1e-6&&Cp(e,r,i),n7(e,e),B7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Cp(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,y1e(n,n))}}(),zgr=function(){let e=a1e(),t=a1e();return function(r,n,i,a,o,s){return Y1(e,n,o,s),Y1(t,i,a,s),Y1(r,e,t,2*s*(1-s)),r}}(),Hgr=function(){let e=jxe();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],y1e(t,O7(t,e))}}();var u3t=[0,0,0,1],hs=class extends bd{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 O7(this,t),this.check()}fromAxisRotation(t,r){return B7(this,t,r),this.check()}identity(){return o1e(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 v1e(this)}lengthSquared(){return b1e(this)}dot(t){return m1e(this,t)}rotationTo(t,r){return x1e(this,t,r),this.check()}add(t){return h1e(this,this,t),this.check()}calculateW(){return l1e(this,this),this.check()}conjugate(){return d1e(this,this),this.check()}invert(){return f1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(g1e(this,t,r,n),this.check())}multiplyRight(t){return R7(this,this,t),this.check()}multiplyLeft(t){return R7(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 s1e(this,this,t),this.check()}rotateY(t){return u1e(this,this,t),this.check()}rotateZ(t){return c1e(this,this,t),this.check()}scale(t){return p1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=u3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return Y1(this,i,a,o),this.check()}transformVector4(t,r=new ds){return n1e(r,t,this),yd(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 fu={};ca(fu,{EPSILON1:()=>c3t,EPSILON10:()=>b3t,EPSILON11:()=>y3t,EPSILON12:()=>x3t,EPSILON13:()=>_3t,EPSILON14:()=>E3t,EPSILON15:()=>w3t,EPSILON16:()=>A3t,EPSILON17:()=>S3t,EPSILON18:()=>T3t,EPSILON19:()=>C3t,EPSILON2:()=>l3t,EPSILON20:()=>D3t,EPSILON3:()=>f3t,EPSILON4:()=>d3t,EPSILON5:()=>h3t,EPSILON6:()=>p3t,EPSILON7:()=>m3t,EPSILON8:()=>g3t,EPSILON9:()=>v3t,PI_OVER_FOUR:()=>B3t,PI_OVER_SIX:()=>R3t,PI_OVER_TWO:()=>F3t,TWO_PI:()=>O3t});var c3t=.1,l3t=.01,f3t=.001,d3t=1e-4,h3t=1e-5,p3t=1e-6,m3t=1e-7,g3t=1e-8,v3t=1e-9,b3t=1e-10,y3t=1e-11,x3t=1e-12,_3t=1e-13,E3t=1e-14,w3t=1e-15,A3t=1e-16,S3t=1e-17,T3t=1e-18,C3t=1e-19,D3t=1e-20,F3t=Math.PI/2,B3t=Math.PI/4,R3t=Math.PI/6,O3t=Math.PI*2;var Dl=6356752314245179e-9,k3t={radii:[6378137,6378137,Dl],radiiSquared:[6378137*6378137,6378137*6378137,Dl*Dl],oneOverRadii:[1/6378137,1/6378137,1/Dl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dl*Dl)],maximumRadius:Math.max(6378137,6378137,Dl),centerToleranceSquared:.1};function yC(e){return e}var _vr=new ce;function I3t(e,t=[],r=yC){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 _1e(e,t=[]){return I3t(e,t,Sn._cartographicRadians?yC:Z9)}function P3t(e,t,r=yC){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 E1e(e,t){return P3t(e,t,Sn._cartographicRadians?yC:e7)}var w1e=1e-14,j3t=new ce,A1e={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"}},k7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$1={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},L3t=new ce,M3t=new ce,q3t=new ce;function I7(e,t,r,n,i,a){let o=A1e[t]&&A1e[t][r];na(o&&(!n||n===o));let s,u,c,l=j3t.copy(i);if(Ro(l.x,0,w1e)&&Ro(l.y,0,w1e)){let d=Math.sign(l.z);s=L3t.fromArray(k7[t]),t!=="east"&&t!=="west"&&s.scale(d),u=M3t.fromArray(k7[r]),r!=="east"&&r!=="west"&&u.scale(d),c=q3t.fromArray(k7[n]),n!=="east"&&n!=="west"&&c.scale(d)}else{let{up:d,east:h,north:p}=$1;h.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),p.copy(d).cross(h);let{down:b,west:g,south:x}=$1;b.copy(d).scale(-1),g.copy(h).scale(-1),x.copy(p).scale(-1),s=$1[t],u=$1[r],c=$1[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,N3t=new ce,U3t=new ce;function S1e(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,d=o*o*c*c,h=s*s*l*l,p=u*u*f*f,b=d+h+p,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=N3t;if(x.copy(e).scale(g),b<a)return x.to(r);let w=i.x,S=i.y,F=i.z,D=U3t;D.set(x.x*w*2,x.y*S*2,x.z*F*2);let j=(1-g)*vv.len()/(.5*D.len()),B=0,N,C,k,I;do{j-=B,N=1/(1+j*w),C=1/(1+j*S),k=1/(1+j*F);let U=N*N,Y=C*C,$=k*k,re=U*N,ee=Y*C,ge=$*k;I=d*U+h*Y+p*$-1;let he=-2*(d*re*w+h*ee*S+p*ge*F);B=I/he}while(Math.abs(I)>fu.EPSILON12);return vv.scale([N,C,k]).to(r)}var xC=new ce,T1e=new ce,H3t=new ce,du=new ce,W3t=new ce,_C=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",fu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),na(t>=0),na(r>=0),na(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=T1e,i=H3t,[,,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]){_C.from(t);let n=this.scaleToGeodeticSurface(_C,du);if(!n)return;let i=this.geodeticSurfaceNormal(n,T1e),a=W3t;a.copy(_C).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(mv.dot(a,_C))*mv.length(a);return E1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return I7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return I7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return xC.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=_1e(t),i=n[0],a=n[1],o=Math.cos(a);return xC.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),xC.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return xC.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return S1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){du.from(t);let n=du.x,i=du.y,a=du.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return du.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return du.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return du.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){na(Ro(this.radii.x,this.radii.y,fu.EPSILON15)),na(this.radii.z>0),du.from(t);let i=du.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return du.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Dl));var ia={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var Gvr=new ce,zvr=new ce;var J1=new ce,C1e=new ce,Ya=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=J1.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 Ya(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=J1.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 C1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(C1e),this.radius=u,this}expand(t){let n=J1.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=gC.getScaling(J1,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=J1.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?ia.OUTSIDE:a<n?ia.INTERSECTING:ia.INSIDE}};var V3t=new ce,K3t=new ce,EC=new ce,wC=new ce,AC=new ce,X3t=new ce,Y3t=new ce,Fl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},aa=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 Pr(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 hs().fromMatrix3(new Pr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new hs(n),a=new Pr().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 aa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ya){let r=this.halfAxes,n=r.getColumn(0,EC),i=r.getColumn(1,wC),a=r.getColumn(2,AC),o=V3t.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[Fl.COLUMN0ROW0]+o*i[Fl.COLUMN0ROW1]+s*i[Fl.COLUMN0ROW2])+Math.abs(a*i[Fl.COLUMN1ROW0]+o*i[Fl.COLUMN1ROW1]+s*i[Fl.COLUMN1ROW2])+Math.abs(a*i[Fl.COLUMN2ROW0]+o*i[Fl.COLUMN2ROW1]+s*i[Fl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?ia.OUTSIDE:c>=u?ia.INSIDE:ia.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=K3t.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,EC),a=n.getColumn(1,wC),o=n.getColumn(2,AC),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,EC),c=s.getColumn(1,wC),l=s.getColumn(2,AC),f=X3t.copy(u).add(c).add(l).add(o),d=Y3t.copy(f).subtract(t),h=r.dot(d);return i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).add(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).add(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).add(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).add(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),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,EC);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,wC);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,AC);return i.transformAsPoint(t),this.halfAxes=new Pr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var D1e=new ce,F1e=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 na(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=D1e.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),na(Ro(this.normal.len(),1)),this.distance=i,this}clone(){return new Bl(this.normal,this.distance)}equals(t){return Ro(this.distance,t.distance)&&Ro(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=F1e.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=D1e.from(t),i=this.getPointDistance(n),a=F1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var B1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],R1e=new ce,$3t=new ce,ps=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*B1e.length;let r=t.center,n=t.radius,i=0;for(let a of B1e){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=R1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=R1e.copy(a).scale(n).add(r),l=$3t.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=ia.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ia.OUTSIDE:return ia.OUTSIDE;case ia.INTERSECTING:r=ia.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(na(Number.isFinite(r),"parentPlaneMask is required."),r===ps.MASK_OUTSIDE||r===ps.MASK_INSIDE)return r;let n=ps.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===ia.OUTSIDE)return ps.MASK_OUTSIDE;u===ia.INTERSECTING&&(n|=o)}return n}};zt(ps,"MASK_OUTSIDE",4294967295);zt(ps,"MASK_INSIDE",0);zt(ps,"MASK_INDETERMINATE",2147483647);var dbr=new ce,hbr=new ce,pbr=new ce,mbr=new ce,gbr=new ce;var Q3t=new ce,Z3t=new ce,e8t=new ce,t8t=new ce,r8t=new ce,n8t=new ce,i8t=new ce,bv=new ce,a8t=new ce,o8t=new ce,s8t=new ce,u8t=new ce;function P7(e,t=new Ya){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=i8t.copy(e[0]),n=Q3t.copy(r),i=Z3t.copy(r),a=e8t.copy(r),o=t8t.copy(r),s=r8t.copy(r),u=n8t.copy(r);for(let j of e){r.copy(j);let B=r.x,N=r.y,C=r.z;B<n.x&&n.copy(r),B>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(),d=n,h=o,p=c;l>p&&(p=l,d=i,h=s),f>p&&(p=f,d=a,h=u);let b=a8t;b.x=(d.x+h.x)*.5,b.y=(d.y+h.y)*.5,b.z=(d.z+h.z)*.5;let g=bv.copy(h).subtract(b).magnitudeSquared(),x=Math.sqrt(g),w=o8t;w.x=n.x,w.y=i.y,w.z=a.z;let S=s8t;S.x=o.x,S.y=s.y,S.z=u.z;let F=u8t.copy(w).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let B=bv.copy(r).subtract(F).magnitude();B>D&&(D=B);let N=bv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let k=C-x;b.x=(x*b.x+k*r.x)/C,b.y=(x*b.y+k*r.y)/C,b.z=(x*b.z+k*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var vc=new Pr,c8t=new Pr,l8t=new Pr,SC=new Pr,O1e=new Pr;function M7(e,t={}){let r=fu.EPSILON20,n=10,i=0,a=0,o=c8t,s=l8t;o.identity(),s.copy(e);let u=r*f8t(s);for(;a<n&&d8t(s)>u;)h8t(s,SC),O1e.copy(SC).transpose(),s.multiplyRight(SC),s.multiplyLeft(O1e),o.multiplyRight(SC),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function f8t(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var j7=[1,0,0],L7=[2,2,1];function d8t(e){let t=0;for(let r=0;r<3;++r){let n=e[vc.getElementIndex(L7[r],j7[r])];t+=2*n*n}return Math.sqrt(t)}function h8t(e,t){let r=fu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[vc.getElementIndex(L7[c],j7[c])]);l>n&&(i=c,n=l)}let a=j7[i],o=L7[i],s=1,u=0;if(Math.abs(e[vc.getElementIndex(o,a)])>r){let c=e[vc.getElementIndex(o,o)],l=e[vc.getElementIndex(a,a)],f=e[vc.getElementIndex(o,a)],d=(c-l)/2/f,h;d<0?h=-1/(-d+Math.sqrt(1+d*d)):h=1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+h*h),u=h*s}return Pr.IDENTITY.to(t),t[vc.getElementIndex(a,a)]=t[vc.getElementIndex(o,o)]=s,t[vc.getElementIndex(o,a)]=u,t[vc.getElementIndex(a,o)]=-u,t}var _d=new ce,m8t=new ce,g8t=new ce,v8t=new ce,b8t=new ce,y8t=new Pr,x8t={diagonal:new Pr,unitary:new Pr};function Q1(e,t=new aa){if(!e||e.length===0)return t.halfAxes=new Pr([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 k=_d.copy(C).subtract(n);a+=k.x*k.x,o+=k.x*k.y,s+=k.x*k.z,u+=k.y*k.y,c+=k.y*k.z,l+=k.z*k.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=y8t;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:d}=M7(f,x8t),h=t.halfAxes.copy(d),p=h.getColumn(0,g8t),b=h.getColumn(1,v8t),g=h.getColumn(2,b8t),x=-Number.MAX_VALUE,w=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)_d.copy(C),x=Math.max(_d.dot(p),x),w=Math.max(_d.dot(b),w),S=Math.max(_d.dot(g),S),F=Math.min(_d.dot(p),F),D=Math.min(_d.dot(b),D),j=Math.min(_d.dot(g),j);p=p.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+w)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(p).add(b).add(g);let B=m8t.set(x-F,w-D,S-j).multiplyByScalar(.5),N=new Pr([B[0],0,0,0,B[1],0,0,0,B[2]]);return t.halfAxes.multiplyRight(N),t}function j1e(e){return e!=null}var Ybr=new ce,_8t=new ce,E8t=new ce,w8t=new ce,Fp=new ce,k1e=new ce,I1e=new ce,P1e=new ce;function TC(e,t,r){if(Jt(e,"3D Tile: boundingVolume must be defined"),e.box)return L1e(e.box,t,r);if(e.region)return S8t(e.region);if(e.sphere)return A8t(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function L1e(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 hs;l.fromArray(e,6);let f=new ce([1,0,0]),d=new ce([0,1,0]),h=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),d.transformByQuaternion(l),d.scale(c[1]),h.transformByQuaternion(l),h.scale(c[2]),i=[...f.toArray(),...d.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 Pr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return j1e(r)?(r.center=n,r.halfAxes=u,r):new aa(n,u)}function A8t(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(_8t),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return j1e(r)?(r.center=n,r.radius=o,r):new Ya(n,o)}function S8t(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Cl(t),Cl(i),a],E8t),u=or.WGS84.cartographicToCartesian([Cl(n),Cl(r),o],w8t),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Fp),or.WGS84.cartographicToCartesian([Cl(n),Fp[1],Fp[2]],k1e),or.WGS84.cartographicToCartesian([Fp[0],Cl(i),Fp[2]],I1e),or.WGS84.cartographicToCartesian([Fp[0],Fp[1],o],P1e),L1e([...c,...k1e.subtract(c),...I1e.subtract(c),...P1e.subtract(c)],new Kr)}var yv="4.0.0-beta.5";var ms={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},eyr=Object.keys(ms),Ed={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function q7(e,t,r){Jt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function M1e(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 CC="4.0.0-beta.5";var T8t={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},q1e={name:"Draco",id:"draco",module:"draco",version:CC,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:T8t};function N1e(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 N7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],d=s[c+2];t=l<t?l:t,r=f<r?f:r,n=d<n?d:n,i=l>i?l:i,a=f>a?f:a,o=d>o?d:o}return[[t,r,n],[i,a,o]]}function U7(e,t,r){let n=N1e(t.value),i=r||U1e(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function U1e(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}function z1e(e,t,r){let n=H1e(t.metadata),i=[],a=C8t(t.attributes);for(let o in e){let s=e[o],u=G1e(o,s,a[o]);i.push(u)}if(r){let o=G1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function C8t(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function G1e(e,t,r){let n=r?H1e(r.metadata):void 0;return U7(e,t,n)}function H1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var W1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},D8t={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},F8t=4,Z1=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=N7(u.attributes),l=z1e(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*F8t,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),O8t(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=D8t[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=B8t(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 W1e)if(this.draco[o]===i)return W1e[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=R8t(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 B8t(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 R8t(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function O8t(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var k8t="1.5.6",I8t="1.4.1",G7=`https://www.gstatic.com/draco/versioned/decoders/${k8t}`,ii={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},wd={[ii.DECODER]:`${G7}/${ii.DECODER}`,[ii.DECODER_WASM]:`${G7}/${ii.DECODER_WASM}`,[ii.FALLBACK_DECODER]:`${G7}/${ii.FALLBACK_DECODER}`,[ii.ENCODER]:`https://raw.githubusercontent.com/google/draco/${I8t}/javascript/${ii.ENCODER}`},e_;async function V1e(e){let t=e.modules||{};return t.draco3d?e_=e_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):e_=e_||P8t(e),await e_}async function P8t(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Qu(wd[ii.FALLBACK_DECODER],"draco",e,ii.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Qu(wd[ii.DECODER],"draco",e,ii.DECODER),await Qu(wd[ii.DECODER_WASM],"draco",e,ii.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await j8t(t,r)}function j8t(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var z7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:CC,worker:!0,options:{draco:{},source:null}};var xv={...q1e,parse:L8t};async function L8t(e,t){let{draco:r}=await V1e(t),n=new Z1(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var M8t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},vi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Zt={...M8t,...vi};var H7={[vi.DOUBLE]:Float64Array,[vi.FLOAT]:Float32Array,[vi.UNSIGNED_SHORT]:Uint16Array,[vi.UNSIGNED_INT]:Uint32Array,[vi.UNSIGNED_BYTE]:Uint8Array,[vi.BYTE]:Int8Array,[vi.SHORT]:Int16Array,[vi.INT]:Int32Array},q8t={DOUBLE:vi.DOUBLE,FLOAT:vi.FLOAT,UNSIGNED_SHORT:vi.UNSIGNED_SHORT,UNSIGNED_INT:vi.UNSIGNED_INT,UNSIGNED_BYTE:vi.UNSIGNED_BYTE,BYTE:vi.BYTE,SHORT:vi.SHORT,INT:vi.INT},W7="Failed to convert GL type",La=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in H7)if(H7[r]===t)return r;throw new Error(W7)}static fromName(t){let r=q8t[t];if(!r)throw new Error(W7);return r}static getArrayType(t){switch(t){case vi.UNSIGNED_SHORT_5_6_5:case vi.UNSIGNED_SHORT_4_4_4_4:case vi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=H7[t];if(!r)throw new Error(W7);return r}}static getByteSize(t){return La.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(La.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/La.getByteSize(t));let a=La.getArrayType(t);return new a(r,n,i)}};function K1e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function V7(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 Lyr=1/256;var Myr=new Tp,qyr=new ce,Nyr=new Tp,Uyr=new Tp,Gyr=new Uint8Array(1);function X1e(e,t=255){return t7(e,0,t)/t*2-1}function Y1e(e){return e<0?-1:1}function $1e(e,t,r,n){if(K1e(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=X1e(e,r),n.y=X1e(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))*Y1e(i),n.y=(1-Math.abs(i))*Y1e(n.y)}return n.normalize()}function K7(e,t,r){return $1e(e,t,255,r)}function Bp(e){return(e%1+1)%1}var Rl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Zt.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=La.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=La.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=La.createTypedArray(r,n),i[t]=a),a}};var N8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},U8t={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]]},G8t={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 J1e(e,t,r,n){let{componentType:i}=e;Jt(e.componentType);let a=typeof i=="string"?La.fromName(i):i,o=N8t[e.type],s=U8t[e.type],u=G8t[e.type];return r+=e.byteOffset,{values:La.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var bc=e=>e!==void 0;function Q1e(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?z8t(n,r):null}function z8t(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;bc(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(bc(u))for(bc(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];bc(c)&&bc(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let d=o.length;for(r=0;r<d;++r){let g=o[r].length,x=o[r].instances,w=getBinaryProperties(g,x,t);o[r].instances=combine(w,x)}let h=new Array(d).fill(0),p=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],p[r]=h[n],++h[n];let b={classes:o,classIds:s,classIndexes:p,parentCounts:u,parentIndexes:f,parentIds:c};return V8t(b),b}function _v(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?H8t(e,t,r):W8t(e,t,r)}function H8t(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(bc(f))return f;let d=i[t],h=o[t];for(let p=0;p<d;++p){let b=a[h+p];b!==t&&l.push(b)}}return null}function W8t(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(bc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function V8t(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)Z1e(e,i,stack)}function Z1e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!bc(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=bc(n)?n[t]:1,c=bc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&Z1e(e,f,r)}r.pop(t)}function po(e){return e!=null}var DC=(e,t)=>e,K8t={HIERARCHY:!0,extensions:!0,extras:!0},Rp=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Jt(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)K8t[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Q1e(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),Jt(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 po(n)}return!1}isExactClass(t,r){return Jt(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),Jt(typeof r=="string",r),po(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=po(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),Jt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(po(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(po(n))return DC(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(po(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Jt(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];po(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=DC(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;Jt(this.binary,`Property ${t} requires a batch table binary.`),Jt(n.type,`Property ${t} requires a type.`);let i=J1e(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 po(s[r])});return po(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 po(u)?po(u.typedArray)?this._getBinaryProperty(u,s):DC(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 po(f)?(Jt(s===r,`Inherited property "${n}" is read-only.`),po(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=DC(i,!0),!0):!1});return po(a)}};var X7=4;function Ad(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=X7,e.version=n.getUint32(r,!0),r+=X7,e.byteLength=n.getUint32(r,!0),r+=X7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Ev=4,e_e="b3dm tile in legacy format.";function wv(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=Ev;let o=n.getUint32(r,!0);r+=Ev;let s=n.getUint32(r,!0);r+=Ev;let u=n.getUint32(r,!0);return r+=Ev,s>=570425344?(r-=Ev*2,i=a,s=o,u=0,a=0,o=0,console.warn(e_e)):u>=570425344&&(r-=Ev,i=s,s=a,u=o,a=0,o=0,console.warn(e_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=X8t(e,t,r,n),r=Y8t(e,t,r,n),r}function X8t(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=q7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function Y8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=q7(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 Y7(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:Zt.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=V7(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Zt.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Zt.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Zt.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var t_e=new ce;function r_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++)K7(t[n*2],t[n*2+1],t_e),t_e.toArray(r,n*3);return{type:Zt.FLOAT,size:2,value:r}}return{type:Zt.FLOAT,size:2,value:t}}function n_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,$8t(e,t)):{type:Zt.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function $8t(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 i_e(e,t,r,n,i){r=Ad(e,t,r),r=wv(e,t,r),r=Av(e,t,r,n),J8t(e);let{featureTable:a,batchTable:o}=Q8t(e);return await nCt(e,a,o,n,i),Z8t(e,a,n),eCt(e,a,o),tCt(e,a),r}function J8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Q8t(e){let t=new Rl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3);let n=rCt(e,t);return{featureTable:t,batchTable:n}}function Z8t(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",Zt.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=n_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function eCt(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",Zt.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Zt.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Zt.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Y7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Zt.UNSIGNED_BYTE,4))}function tCt(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",Zt.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Zt.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=r_e(e,r)}}function rCt(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Zt.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 Rp(i,a,n)}return r}async function nCt(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,d=c.byteLength;if(!o||!Number.isFinite(f)||!d)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+d),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await iCt(e,l,n,i)}async function iCt(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 So(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,p=h.range;e.quantizedVolumeScale=new ce(p,p,p),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 d={};if(t.batchTableProperties)for(let h of Object.keys(t.batchTableProperties))a.attributes[h]&&a.attributes[h].value&&(d[h.toLowerCase()]=a.attributes[h].value);e.attributes={positions:o,colors:Y7(e,s,void 0),normals:u,batchIds:c,...d}}var iq={};ca(iq,{decode:()=>zCt,name:()=>qC});var FC="4.0.0-beta.5";var a_e,aCt=(a_e=globalThis.loaders)==null?void 0:a_e.parseImageNode,$7=typeof Image<"u",J7=typeof ImageBitmap<"u",oCt=Boolean(aCt),Q7=vn?!0:oCt;function o_e(e){switch(e){case"auto":return J7||$7||Q7;case"imagebitmap":return J7;case"image":return $7;case"data":return Q7;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function s_e(){if(J7)return"imagebitmap";if($7)return"image";if(Q7)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function u_e(e){let t=sCt(e);if(!t)throw new Error("Not an image");return t}function Z7(e){return Sv(e)}function Sv(e){switch(u_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 sCt(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 uCt=/^data:image\/svg\+xml/,cCt=/\.svg((\?|#).*)?$/;function BC(e){return e&&(uCt.test(e)||cCt.test(e))}function c_e(e,t){if(BC(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 eq(e,t)}function eq(e,t){if(BC(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function RC(e,t,r){let n=c_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await lCt(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function lCt(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=>i(new Error(`Could not load image ${e}: ${a}`))}catch(a){i(a)}})}var fCt={},l_e=!0;async function f_e(e,t,r){let n;BC(r)?n=await RC(e,t,r):n=eq(e,r);let i=t&&t.imagebitmap;return await dCt(n,i)}async function dCt(e,t=null){if((hCt(t)||!l_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),l_e=!1}return await createImageBitmap(e)}function hCt(e){for(let t in e||fCt)return!1;return!0}function d_e(e){return!vCt(e,"ftyp",4)||!(e[8]&96)?null:pCt(e)}function pCt(e){switch(mCt(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function mCt(e,t,r){return String.fromCharCode(...e.slice(t,r))}function gCt(e){return[...e].map(t=>t.charCodeAt(0))}function vCt(e,t,r=0){let n=gCt(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var yc=!1,t_=!0;function Op(e){let t=r_(e);return yCt(t)||ECt(t)||xCt(t)||_Ct(t)||bCt(t)}function bCt(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=d_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function yCt(e){let t=r_(e);return t.byteLength>=24&&t.getUint32(0,yc)===2303741511?{mimeType:"image/png",width:t.getUint32(16,yc),height:t.getUint32(20,yc)}:null}function xCt(e){let t=r_(e);return t.byteLength>=10&&t.getUint32(0,yc)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,t_),height:t.getUint16(8,t_)}:null}function _Ct(e){let t=r_(e);return t.byteLength>=14&&t.getUint16(0,yc)===16973&&t.getUint32(2,t_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,t_),height:t.getUint32(22,t_)}:null}function ECt(e){let t=r_(e);if(!(t.byteLength>=3&&t.getUint16(0,yc)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=wCt(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,yc);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,yc),width:t.getUint16(a+7,yc)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,yc)}return null}function wCt(){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 r_(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 h_e(e,t){var i;let{mimeType:r}=Op(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Jt(n),await n(e,r)}async function p_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=ACt(i),s;switch(o){case"imagebitmap":s=await f_e(e,t,a);break;case"image":s=await RC(e,t,a);break;case"data":s=await h_e(e,t);break;default:Jt(!1)}return i==="data"&&(s=Sv(s)),s}function ACt(e){switch(e){case"auto":case"data":return s_e();default:return o_e(e),e}}var SCt=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],TCt=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],CCt={image:{type:"auto",decode:!0}},Tv={id:"image",module:"images",name:"Images",version:FC,mimeTypes:TCt,extensions:SCt,parse:p_e,tests:[e=>Boolean(Op(new DataView(e)))],options:CCt};var v_e,m_e=(v_e=globalThis.loaders)==null?void 0:v_e.encodeImageNode;async function b_e(e,t){return t=t||{},t.image=t.image||{},m_e?m_e(e,{type:t.image.mimeType}):DCt(e,t)}var g_e=!0;async function DCt(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=Z7(e),o=document.createElement("canvas");o.width=i,o.height=a,FCt(e,o);let s=await new Promise(u=>{if(n&&g_e)try{o.toBlob(u,r,n);return}catch{g_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function FCt(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 tq={name:"Images",id:"image",module:"images",version:FC,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:b_e};var rq={};function nq(e){if(rq[e]===void 0){let t=vn?RCt(e):BCt(e);rq[e]=t}return rq[e]}function BCt(e){var i,a;let t=["image/png","image/jpeg","image/gif"],r=(i=globalThis.loaders)==null?void 0:i.parseImageNode,n=((a=globalThis.loaders)==null?void 0:a.imageFormatsNode)||t;return Boolean(r)&&n.includes(e)}function RCt(e){switch(e){case"image/avif":case"image/webp":return OCt(e);default:return!0}}function OCt(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ni(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var OC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kC={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var kCt=1.33,y_e=["SCALAR","VEC2","VEC3","VEC4"],ICt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],PCt=new Map(ICt),jCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},LCt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},MCt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function IC(e){return y_e[e-1]||y_e[0]}function Cv(e){let t=PCt.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Dv(e,t){let r=MCt[e.componentType],n=jCt[e.type],i=LCt[e.componentType],a=e.count*n,o=e.count*n*i;Ni(o>=0&&o<=t.byteLength);let s=kC[e.componentType],u=OC[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function n_(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*kCt)}function x_e(e,t,r){let n=e.bufferViews[r];Ni(n);let i=n.buffer,a=t[i];Ni(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function __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 ${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),d=l*f,h=i.byteStride||d;if(typeof i.byteStride>"u"||i.byteStride===d)return new u(a,s,c);let p=new u(c);for(let x=0;x<n.count;x++){let w=new u(a,s+x*h,f);p.set(w,x*f)}return p}function qCt(){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)||qCt(),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];Ni(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return __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 Ni(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ni(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=Op(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;Ni(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Co(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:IC(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=zI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};var E_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},NCt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},w_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function i_(e,t){return w_e[t]*E_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=Bv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function Bv(e,t,r,n=1){let i=E_e[t],a=NCt[r],o=w_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Rv(e,t,r){var c,l,f,d,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 p=(d=(f=o.images)==null?void 0:f[u])==null?void 0:d.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 w=UCt(b,p,a,x,t.channels);g.push(w)}return g}}return[]}function PC(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(d=>d===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Cv(o),count:o.length});i.attributes[t]=c}function UCt(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=GCt(o,s,e,u),l=0;for(let f of i){let d=typeof f=="number"?Object.values(a)[f]:a[f],h=c+d.offset,p=Sv(e);if(p.data.length<=h)throw new Error(`${p.data.length} <= ${h}`);let b=p.data[h];l|=b<<d.shift}return l}function GCt(e,t,r,n=1){let i=r.width,a=Bp(e)*(i-1),o=Math.round(a),s=r.height,u=Bp(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function jC(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 LC(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 MC(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 A_e="EXT_mesh_features",qC=A_e;async function zCt(e,t){let r=new qr(e);HCt(r,t)}function HCt(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)WCt(e,i,t)}function WCt(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[A_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Rv(e,u.texture,t):c=[];u.data=c}}var sq={};ca(sq,{decode:()=>VCt,name:()=>Ol});var aq="EXT_structural_metadata",Ol=aq;async function VCt(e,t){let r=new qr(e);KCt(r,t)}function KCt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(aq);r&&((i=t.gltf)!=null&&i.loadImages&&XCt(e,r),YCt(e,r))}function XCt(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)JCt(e,r,a,t)}function YCt(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=$Ct(i,a);o&&ZCt(e,r,o)}}function $Ct(e,t){for(let r of e)if(r.class===t)return r;return null}function JCt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[aq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];QCt(e,u,r,n)}}function QCt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Rv(e,u,r);l!==null&&(PC(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function ZCt(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=eDt(e,t,u,i,c);c.data=l}}}function eDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=tDt(e,r,i,n),c=rDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=nDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=MC(n,s,u,c);break}case"ENUM":{a=iDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function tDt(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 rDt(e,t,r){return typeof t.stringOffsets<"u"?Fv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function nDt(e,t,r,n){let i=e.array,a=e.count,o=i_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=Bv(r,e.type,e.componentType,s):u=r,i?n?jC(u,t,n,r.length,o):a?LC(u,t,a):[]:u}function iDt(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=i_(t.type,s),c=n.byteLength/u,l=Bv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return aDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let d=t.count;return d?oDt(l,r,d,o):[]}return oq(l,0,r,o)}function aDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,d=l/a,h=oq(t,f,d,o);s.push(h)}return s}function oDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=oq(e,o,r,n);i.push(s)}return i}function oq(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=sDt(n,o);s?i.push(s.name):i.push("")}return i}function sDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var uq={};ca(uq,{decode:()=>uDt,name:()=>gs});var S_e="EXT_feature_metadata",gs=S_e;async function uDt(e,t){let r=new qr(e);cDt(r,t)}function cDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(S_e);r&&((i=t.gltf)!=null&&i.loadImages&&lDt(e,r),fDt(e,r))}function lDt(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=hDt(i,a);s&&mDt(e,s,o)}}function fDt(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=dDt(i,a);o&&pDt(e,r,o)}}function dDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function hDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function pDt(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=gDt(e,t,u,i,c);c.data=l}}}function mDt(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=_Dt(e,o,n);o.data=s}}}function gDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=vDt(e,r,i,n),c=bDt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=MC(n,s,u,c):yDt(r)&&(a=xDt(r,n,s,u)),a}function vDt(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 bDt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Fv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function yDt(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 xDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=i_(o,s),c=r.byteLength/u,l=Bv(r,o,s,c);return i?n?jC(l,t,n,r.length,u):a?LC(l,t,a):[]:l}function _Dt(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)EDt(e,r,t,i,o);return i}function EDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Rv(e,a,i);o&&PC(e,t,o,n,i)}var NC="4.0.0-beta.5";var Ov="4.0.0-beta.5";var xc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},cq;async function fq(e){let t=e.modules||{};return t.basis?t.basis:(cq=cq||wDt(e),await cq)}async function wDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(xc.TRANSCODER,"textures",e),await Qu(xc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await ADt(t,r)}function ADt(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 lq;async function dq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(lq=lq||SDt(e),await lq)}async function SDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(xc.ENCODER,"textures",e),await Qu(xc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await TDt(t,r)}function TDt(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 Be={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 CDt=["","WEBKIT_","MOZ_"],T_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"},UC=null;function a_(e){if(!UC){e=e||DDt()||void 0,UC=new Set;for(let t of CDt)for(let r in T_e)if(e&&e.getExtension(`${t}${r}`)){let n=T_e[r];UC.add(n)}}return UC}function DDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var M_e=Kt(j_e(),1);function kv(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=RDt(t,n,i,e,o),u=BDt(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 BDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function RDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var ODt={131:Be.COMPRESSED_RGB_S3TC_DXT1_EXT,132:Be.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:Be.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:Be.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:Be.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:Be.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:Be.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:Be.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:Be.COMPRESSED_RED_RGTC1_EXT,140:Be.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:Be.COMPRESSED_RED_GREEN_RGTC2_EXT,142:Be.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:Be.COMPRESSED_RGB8_ETC2,148:Be.COMPRESSED_SRGB8_ETC2,149:Be.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:Be.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:Be.COMPRESSED_RGBA8_ETC2_EAC,152:Be.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:Be.COMPRESSED_R11_EAC,154:Be.COMPRESSED_SIGNED_R11_EAC,155:Be.COMPRESSED_RG11_EAC,156:Be.COMPRESSED_SIGNED_RG11_EAC,157:Be.COMPRESSED_RGBA_ASTC_4x4_KHR,158:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:Be.COMPRESSED_RGBA_ASTC_5x4_KHR,160:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:Be.COMPRESSED_RGBA_ASTC_5x5_KHR,162:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:Be.COMPRESSED_RGBA_ASTC_6x5_KHR,164:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:Be.COMPRESSED_RGBA_ASTC_6x6_KHR,166:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:Be.COMPRESSED_RGBA_ASTC_8x5_KHR,168:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:Be.COMPRESSED_RGBA_ASTC_8x6_KHR,170:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:Be.COMPRESSED_RGBA_ASTC_8x8_KHR,172:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:Be.COMPRESSED_RGBA_ASTC_10x5_KHR,174:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:Be.COMPRESSED_RGBA_ASTC_10x6_KHR,176:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:Be.COMPRESSED_RGBA_ASTC_10x8_KHR,178:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:Be.COMPRESSED_RGBA_ASTC_10x10_KHR,180:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:Be.COMPRESSED_RGBA_ASTC_12x10_KHR,182:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:Be.COMPRESSED_RGBA_ASTC_12x12_KHR,184:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:Be.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:Be.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:Be.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:Be.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:Be.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:Be.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:Be.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:Be.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:Be.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:Be.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:Be.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:Be.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:Be.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:Be.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:Be.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:Be.COMPRESSED_RGBA_ASTC_12x12_KHR};function L_e(e){return ODt[e]}var Oo=[171,75,84,88,32,50,48,187,13,10,26,10];function VC(e){let t=new Uint8Array(e);return!(t.byteLength<Oo.length||t[0]!==Oo[0]||t[1]!==Oo[1]||t[2]!==Oo[2]||t[3]!==Oo[3]||t[4]!==Oo[4]||t[5]!==Oo[5]||t[6]!==Oo[6]||t[7]!==Oo[7]||t[8]!==Oo[8]||t[9]!==Oo[9]||t[10]!==Oo[10]||t[11]!==Oo[11])}function q_e(e){let t=new Uint8Array(e),r=(0,M_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=L_e(r.vkFormat);return kv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var kDt={etc1:{basisFormat:0,compressed:!0,format:Be.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Be.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Be.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:Be.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Be.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Be.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 s_(e,t){if(t.basis.containerFormat==="auto"){if(VC(e)){let n=await dq(t);return N_e(n.KTX2File,e,t)}let{BasisFile:r}=await fq(t);return vq(r,e,t)}switch(t.basis.module){case"encoder":let r=await dq(t);switch(t.basis.containerFormat){case"ktx2":return N_e(r.KTX2File,e,t);case"basis":default:return vq(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await fq(t);return vq(n,e,t)}}function vq(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(IDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function IDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=U_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 N_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(PDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function PDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=U_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 U_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Iv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),kDt[r]}function Iv(){let e=a_();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 G_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"}}},kp={...G_e,parse:s_};var ko={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},jDt={DXT1:Be.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:Be.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:Be.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":Be.COMPRESSED_RGB_ATC_WEBGL,ATCA:Be.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:Be.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},LDt=W_e,MDt=KC,qDt=KC,NDt={DXT1:W_e,DXT3:KC,DXT5:KC,"ATC ":LDt,ATCA:MDt,ATCI:qDt};function z_e(e){return new Uint32Array(e,0,ko.HEADER_LENGTH)[ko.MAGIC_NUMBER_INDEX]===ko.MAGIC_NUMBER}function H_e(e){let t=new Int32Array(e,0,ko.HEADER_LENGTH),r=t[ko.HEADER_PF_FOURCC_INDEX];Jt(Boolean(t[ko.HEADER_PF_FLAGS_INDEX]&ko.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=UDt(r),i=jDt[n],a=NDt[n];Jt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[ko.HEADER_FLAGS_INDEX]&ko.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[ko.MIPMAPCOUNT_INDEX]));let s=t[ko.HEADER_WIDTH_INDEX],u=t[ko.HEADER_HEIGHT_INDEX],c=t[ko.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return kv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function W_e(e,t){return(e+3>>2)*(t+3>>2)*8}function KC(e,t){return(e+3>>2)*(t+3>>2)*16}function UDt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var vs={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},GDt={0:[Be.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[Be.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[Be.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[Be.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[Be.COMPRESSED_RGB_ETC1_WEBGL],7:[Be.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[Be.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[Be.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[Be.COMPRESSED_RGB8_ETC2],23:[Be.COMPRESSED_RGBA8_ETC2_EAC],24:[Be.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[Be.COMPRESSED_R11_EAC],26:[Be.COMPRESSED_RG11_EAC],27:[Be.COMPRESSED_RGBA_ASTC_4X4_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[Be.COMPRESSED_RGBA_ASTC_5X4_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[Be.COMPRESSED_RGBA_ASTC_5X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[Be.COMPRESSED_RGBA_ASTC_6X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[Be.COMPRESSED_RGBA_ASTC_6X6_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[Be.COMPRESSED_RGBA_ASTC_8X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[Be.COMPRESSED_RGBA_ASTC_8X6_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[Be.COMPRESSED_RGBA_ASTC_8X8_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[Be.COMPRESSED_RGBA_ASTC_10X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[Be.COMPRESSED_RGBA_ASTC_10X6_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[Be.COMPRESSED_RGBA_ASTC_10X8_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[Be.COMPRESSED_RGBA_ASTC_10X10_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[Be.COMPRESSED_RGBA_ASTC_12X10_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[Be.COMPRESSED_RGBA_ASTC_12X12_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},zDt={0:V_e,1:V_e,2:K_e,3:K_e,6:u_,7:u_,9:c_,11:c_,22:u_,23:c_,24:u_,25:u_,26:c_,27:c_,28:HDt,29:WDt,30:VDt,31:KDt,32:XDt,33:YDt,34:$Dt,35:JDt,36:QDt,37:ZDt,38:eFt,39:tFt,40:rFt};function X_e(e){let r=new Uint32Array(e,0,vs.HEADER_LENGTH)[vs.MAGIC_NUMBER_INDEX];return r===vs.MAGIC_NUMBER||r===vs.MAGIC_NUMBER_EXTRA}function Y_e(e){let t=new Uint32Array(e,0,vs.HEADER_LENGTH),r=t[vs.PIXEL_FORMAT_INDEX],n=t[vs.COLOUR_SPACE_INDEX],i=GDt[r]||[],a=i.length>1&&n?i[1]:i[0],o=zDt[r],s=t[vs.MIPMAPCOUNT_INDEX],u=t[vs.WIDTH_INDEX],c=t[vs.HEIGHT_INDEX],l=vs.HEADER_SIZE+t[vs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return kv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function V_e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function K_e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function u_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function c_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function HDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function WDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function VDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function KDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function XDt(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function YDt(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function $Dt(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function JDt(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function QDt(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function ZDt(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function eFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function tFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function rFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function $_e(e){if(VC(e))return q_e(e);if(z_e(e))return H_e(e);if(X_e(e))return Y_e(e);throw new Error("Texture container format not recognized")}var J_e={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}}},XC={...J_e,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 s_(e,t))[0]):$_e(e)}};var bq={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 Pv=!0,Q_e=1735152710,_q=12,YC=8,nFt=1313821514,iFt=5130562,aFt=0,oFt=0,sFt=1;function uFt(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 Z_e(e,t=0,r={}){let n=new DataView(e),{magic:i=Q_e}=r,a=n.getUint32(t,!1);return a===i||a===Q_e}function e2e(e,t,r=0,n={}){let i=new DataView(t),a=uFt(i,r+0),o=i.getUint32(r+4,Pv),s=i.getUint32(r+8,Pv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=_q,e.version){case 1:return cFt(e,i,r);case 2:return lFt(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function cFt(e,t,r){Jt(e.header.byteLength>_q+YC);let n=t.getUint32(r+0,Pv),i=t.getUint32(r+4,Pv);return r+=YC,Jt(i===aFt),yq(e,t,r,n),r+=n,r+=xq(e,t,r,e.header.byteLength),r}function lFt(e,t,r,n){return Jt(e.header.byteLength>_q+YC),fFt(e,t,r,n),r+e.header.byteLength}function fFt(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,Pv),a=t.getUint32(r+4,Pv);switch(r+=YC,a){case nFt:yq(e,t,r,i);break;case iFt:xq(e,t,r,i);break;case oFt:n.strict||yq(e,t,r,i);break;case sFt:n.strict||xq(e,t,r,i);break;default:break}r+=Co(i,4)}return r}function yq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Co(n,4)}function xq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Co(n,4)}function Eq(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 Aq={};ca(Aq,{decode:()=>wFt,name:()=>EFt});var dFt="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",hFt="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",pFt=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]),mFt=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]),gFt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},vFt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function t2e(e,t,r,n,i,a="NONE"){let o=await bFt();_Ft(o,o.exports[vFt[i]],e,t,r,n,o.exports[gFt[a||"NONE"]])}var wq;async function bFt(){return wq||(wq=yFt()),wq}async function yFt(){let e=dFt;WebAssembly.validate(pFt)&&(e=hFt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(xFt(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function xFt(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?mFt[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function _Ft(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let d=t(c,n,i,l,a.length);if(d===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),d!==0)throw new Error(`Malformed buffer data: ${d}`)}var $C="EXT_meshopt_compression",EFt=$C;async function wFt(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(AFt(r,o));await Promise.all(n),r.removeExtension($C)}async function AFt(e,t){let r=e.getObjectExtension(t,$C);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),d=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await t2e(d,o,a,f,s,u),e.removeObjectExtension(t,$C)}}var Sq={};ca(Sq,{name:()=>SFt,preprocess:()=>TFt});var jv="EXT_texture_webp",SFt=jv;function TFt(e,t){let r=new qr(e);if(!nq("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 Tq={};ca(Tq,{name:()=>CFt,preprocess:()=>DFt});var JC="KHR_texture_basisu",CFt=JC;function DFt(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,JC);a&&(i.source=a.source,r.removeObjectExtension(i,JC))}r.removeExtension(JC)}var Dq={};ca(Dq,{decode:()=>kFt,encode:()=>IFt,name:()=>RFt,preprocess:()=>OFt});function r2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Cq(n);t[r]=i}}return t}function Cq(e){let{buffer:t,size:r,count:n}=FFt(e);return{value:t,size:r,byteOffset:0,count:n,type:IC(r),componentType:Cv(t)}}function FFt(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=BFt(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function BFt(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Sd="KHR_draco_mesh_compression",RFt=Sd;function OFt(e,t,r){let n=new qr(e);for(let i of n2e(n))n.getObjectExtension(i,Sd)}async function kFt(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 n2e(n))n.getObjectExtension(o,Sd)&&i.push(PFt(n,o,t,r));await Promise.all(i),n.removeExtension(Sd)}function IFt(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])jFt(n,t),r.addRequiredExtension(Sd)}async function PFt(e,t,r,n){let i=e.getObjectExtension(t,Sd);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=zh(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await So(o,xv,s,n),c=r2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let d=t.attributes[l],h=e.getAccessor(d);h!=null&&h.min&&(h!=null&&h.max)&&(f.min=h.min,f.max=h.max)}t.attributes=c,u.indices&&(t.indices=Cq(u.indices)),e.removeObjectExtension(t,Sd),LFt(t)}function jFt(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:{[Sd]:{bufferView:u,attributes:s}}}]}}function LFt(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*n2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Bq={};ca(Bq,{decode:()=>UFt,name:()=>MFt});var Fq="KHR_texture_transform",MFt=Fq,QC=new ce,qFt=new Pr,NFt=new Pr;async function UFt(e,t){var a;if(!new qr(e).hasExtension(Fq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)GFt(o,e)}function GFt(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&l_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&l_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&l_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&l_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&l_(t,e,u,r)}function l_(e,t,r,n){let i=zFt(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&&HFt(e,s,i)}}function zFt(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Fq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=KFt(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function HFt(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:d}=e.buffers[l.buffer],h=(d||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:p,length:b}=Dv(c,l),g=kC[c.componentType],x=OC[c.type],w=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new p(f,h+F*w,2);QC.set(D[0],D[1],1),QC.transformByMatrix3(a),S.set([QC[0],QC[1]],F*x)}n===i?WFt(c,l,e.buffers,S):VFt(i,c,t,e,S)}}}}function WFt(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 VFt(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 KFt(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Pr().set(1,0,0,0,1,0,t[0],t[1],1),a=qFt.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=NFt.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Rq={};ca(Rq,{decode:()=>YFt,encode:()=>$Ft,name:()=>XFt});var Ip="KHR_lights_punctual",XFt=Ip;async function YFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Ip);n&&(t.json.lights=n.lights,t.removeExtension(Ip));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Ip);a&&(i.light=a.light),t.removeObjectExtension(i,Ip)}}async function $Ft(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ip);Ni(!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,Ip,n)}delete t.json.lights}}var Oq={};ca(Oq,{decode:()=>QFt,encode:()=>ZFt,name:()=>JFt});var f_="KHR_materials_unlit",JFt=f_;async function QFt(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,f_);t.removeExtension(f_)}function ZFt(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,f_,{}),t.addExtension(f_))}var kq={};ca(kq,{decode:()=>t4t,encode:()=>r4t,name:()=>e4t});var d_="KHR_techniques_webgl",e4t=d_;async function t4t(e){let t=new qr(e),{json:r}=t,n=t.getExtension(d_);if(n){let i=n4t(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,d_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=i4t(a.technique,t)),t.removeObjectExtension(a,d_)}t.removeExtension(d_)}}async function r4t(e,t){}function n4t(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 i4t(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 i2e=[sq,iq,Aq,Sq,Tq,Dq,Rq,Oq,kq,Bq,uq];function a2e(e,t={},r){var i;let n=i2e.filter(a=>s2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function o2e(e,t={},r){var i;let n=i2e.filter(a=>s2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function s2e(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 Iq="KHR_binary_glTF";function u2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Iq);i&&Object.assign(n,i),t.removeObjectExtension(n,Iq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Iq)}var c2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},o4t={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Pq=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),u2e(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 c2e)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 c2e)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=o4t[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 l2e(e,t={}){return new Pq().normalize(e,t)}async function f2e(e,t,r=0,n,i){var a,o,s;return s4t(e,t,r,n),l2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),a2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await u4t(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await c4t(e,n,i),await o2e(e,n,i),e}function s4t(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Z_e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=GI(t);else if(t instanceof ArrayBuffer){let o={};r=e2e(o,t,r,n.glb),Ni(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ni(!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 u4t(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;Ni(u);let c=Eq(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 c4t(e,t,r){let n=l4t(e),i=e.json.images||[],a=[];for(let o of n)a.push(f4t(e,i[o],o,t,r));return await Promise.all(a)}function l4t(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 f4t(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Eq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=x_e(e.json,e.buffers,t.bufferView);a=zh(s.buffer,s.byteOffset,s.byteLength)}Ni(a,"glTF image has no data");let o=await So(a,[Tv,kp],{...n,mimeType:t.mimeType,basis:n.basis||{format:Iv()}},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 kl={name:"glTF",id:"gltf",module:"gltf",version:NC,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:d4t,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes",postProcess:"removed in v4"}}};async function d4t(e,t={},r){t={...kl.options,...t},t.gltf={...kl.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await f2e({},e,n,t,r)}var h4t=1179937895,p4t=1313821514,m4t=5130562,_c=!0;function d2e(e,t,r=0,n={}){let{magic:i=h4t,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,_c),t.setUint32(r+4,a,_c),t.setUint32(r+8,0,_c));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,_c),t.setUint32(r+4,p4t,_c)),r+=8;let f=JSON.stringify(o);if(r=Rm(t,r,f,4),t){let d=r-l-8;t.setUint32(l+0,d,_c)}if(s){let d=r;if(t&&(t.setUint32(r+0,0,_c),t.setUint32(r+4,m4t,_c)),r+=8,r=RA(t,r,s,4),t){let h=r-d-8;t.setUint32(d+0,h,_c)}}if(t){let d=r-u;t.setUint32(c,d,_c)}return r}function jq(e,t,r,n){return g4t(e),d2e(e,t,r,n)}function g4t(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Lq={name:"glTF",id:"gltf",module:"gltf",version:NC,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:v4t,options:{gltf:{}}};function v4t(e,t={}){let{byteOffset:r=0}=t,n=jq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return jq(e,a,r,t),i}var b4t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},y4t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bs={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},x4t={magFilter:bs.TEXTURE_MAG_FILTER,minFilter:bs.TEXTURE_MIN_FILTER,wrapS:bs.TEXTURE_WRAP_S,wrapT:bs.TEXTURE_WRAP_T},_4t={[bs.TEXTURE_MAG_FILTER]:bs.LINEAR,[bs.TEXTURE_MIN_FILTER]:bs.NEAREST_MIPMAP_LINEAR,[bs.TEXTURE_WRAP_S]:bs.REPEAT,[bs.TEXTURE_WRAP_T]:bs.REPEAT};function E4t(){return{id:"default-sampler",parameters:_4t}}function w4t(e){return y4t[e]}function A4t(e){return b4t[e]}var Mq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ni(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=w4t(t.componentType),i=A4t(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):E4t(),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 x4t[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 h_(e,t){return new Mq().postProcess(e,t)}var ZC={URI:0,EMBEDDED:1};function eD(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=zh(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 tD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(S4t(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 So(e.gltfArrayBuffer,kl,r,n);e.gltf=h_(a),e.gpuMemoryUsageInBytes=n_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function S4t(e,t,r){switch(t){case ZC.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 ZC.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function h2e(e,t,r,n,i){var o;r=T4t(e,t,r,n,i),await tD(e,ZC.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 T4t(e,t,r,n,i){r=Ad(e,t,r),r=wv(e,t,r),r=Av(e,t,r,n),r=eD(e,t,r,n);let a=new Rl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3),r}async function p2e(e,t,r,n,i){return r=C4t(e,t,r,n,i),await tD(e,e.gltfFormat||0,n,i),r}function C4t(e,t,r,n,i){var c;if(r=Ad(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=wv(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Av(e,t,r,n),r=eD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Rl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3);let u=new Rp(e.batchTableJson,e.batchTableBinary,s);return D4t(e,o,u,s),r}function D4t(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Pr,l=new hs,f=new ce,d={},h=new Kr,p=[],b=[],g=[],x=[];for(let w=0;w<n;w++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Zt.FLOAT,3,w,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3,w,a);let k=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3);if(!k)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let I=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3);if(!I)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*I[Y]+k[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),d.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Zt.FLOAT,3,w,p),e.normalRight=t.getProperty("NORMAL_RIGHT",Zt.FLOAT,3,w,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",Zt.UNSIGNED_SHORT,2,w,p),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Zt.UNSIGNED_SHORT,2,w,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),d.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Zt.FLOAT,1,w,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Zt.FLOAT,3,w,p);j&&f.scale(j),d.scale=f;let B=t.getProperty("BATCH_ID",Zt.UNSIGNED_SHORT,1,w,x);B===void 0&&(B=w);let N=new Kr().fromQuaternion(d.rotation);h.identity(),h.translate(d.translation),h.multiplyRight(N),h.scale(d.scale);let C=h.clone();i[w]={modelMatrix:C,batchId:B}}e.instances=i}async function m2e(e,t,r,n,i,a){r=Ad(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 g2e(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 So(t,kl,r,n);e.gltf=h_(o),e.gpuMemoryUsageInBytes=n_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function qq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=M1e(e,t),i.type){case ms.COMPOSITE:return await m2e(i,e,t,r,n,qq);case ms.BATCHED_3D_MODEL:return await h2e(i,e,t,r,n);case ms.GLTF:return await g2e(i,e,r,n);case ms.INSTANCED_3D_MODEL:return await p2e(i,e,t,r,n);case ms.POINT_CLOUD:return await i_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Nq(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=v2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=v2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await rD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let d of c.contentAvailability)await rD(c,d,f,r);else await rD(c,c.contentAvailability,f,r);return await rD(c,c.childSubtreeAvailability,f,r),c}async function rD(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 v2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var nD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:yv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Nq,options:{}};function Uq(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function hu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Uq()}var F4t=globalThis.self||globalThis.window||globalThis.global,Lv=globalThis.window||globalThis.self||globalThis.global,B4t=globalThis.document||{},Pp=globalThis.process||{},R4t=globalThis.console,jEr=globalThis.navigator||{};var iD="4.0.0-beta.5",qEr=hu();function O4t(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var aD=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=O4t(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 b2e(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 y2e(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 oD(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 sD;(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"})(sD||(sD={}));var k4t=10;function x2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),sD[e]||sD.WHITE)}function _2e(e,t,r){if(!hu&&typeof e=="string"){if(t){let n=x2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=x2e(r);e="\x1B[".concat(n+k4t,"m").concat(e,"\x1B[49m")}}return e}function E2e(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 jp(){let e;if(hu()&&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 Pp){var n;let i=Pp===null||Pp===void 0||(n=Pp.hrtime)===null||n===void 0?void 0:n.call(Pp);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var qv={debug:hu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},I4t={enabled:!0,level:0};function ys(){}var w2e={},A2e={once:!0},p_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=iD,this._startTs=jp(),this._deltaTs=jp(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new aD("__probe-".concat(this.id,"__"),I4t),this.timeStamp("".concat(this.id," started")),E2e(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((jp()-this._startTs).toPrecision(10))}getDelta(){return Number((jp()-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,A2e)}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,A2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ys,n&&[n],{tag:M4t(r)}):ys}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?hu()?L4t({image:i,message:a,scale:o}):j4t({image:i,message:a,scale:o}):ys}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||ys)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=S2e({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||ys)}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()>=T2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=S2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Mv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=jp();let o=a.tag||a.message;if(a.once&&o)if(!w2e[o])w2e[o]=jp();else return ys;return r=P4t(this.id,a.message,a),n.bind(console,r,...a.args)}return ys}};p_.VERSION=iD;function T2e(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 S2e(e){let{logLevel:t,message:r}=e;e.logLevel=T2e(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 P4t(e,t,r){if(typeof t=="string"){let n=r.time?y2e(b2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=_2e(t,r.color,r.background)}return t}function j4t(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ys}function L4t(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=oD(a,r,n);console.log(...o)},a.src=t,ys}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...oD(t,r,n)),ys;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...oD(a,r,n)),a.src=t.toDataURL(),ys}return ys}function M4t(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Gq=new p_({id:"@probe.gl/log"});var xs=null;try{xs=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 Bn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Bn.prototype.__isLong__;Object.defineProperty(Bn.prototype,"__isLong__",{value:!0});function Ma(e){return(e&&e.__isLong__)===!0}function C2e(e){var t=Math.clz32(e&-e);return e?31-t:t}Bn.isLong=Ma;var D2e={},F2e={};function Lp(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=F2e[e],n)?n:(r=Xr(e,0,!0),i&&(F2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=D2e[e],n)?n:(r=Xr(e,e<0?-1:0,!1),i&&(D2e[e]=r),r))}Bn.fromInt=Lp;function _s(e,t){if(isNaN(e))return t?Il:pu;if(t){if(e<0)return Il;if(e>=k2e)return j2e}else{if(e<=-R2e)return mo;if(e+1>=R2e)return P2e}return e<0?_s(-e,t).neg():Xr(e%Uv|0,e/Uv|0,t)}Bn.fromNumber=_s;function Xr(e,t,r){return new Bn(e,t,r)}Bn.fromBits=Xr;var uD=Math.pow;function Hq(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?Il:pu;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 Hq(e.substring(1),t,r).neg();for(var i=_s(uD(r,8)),a=pu,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=_s(uD(r,s));a=a.mul(c).add(_s(u))}else a=a.mul(i),a=a.add(_s(u))}return a.unsigned=t,a}Bn.fromString=Hq;function mu(e,t){return typeof e=="number"?_s(e,t):typeof e=="string"?Hq(e,t):Xr(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Bn.fromValue=mu;var B2e=1<<16,q4t=1<<24,Uv=B2e*B2e,k2e=Uv*Uv,R2e=k2e/2,O2e=Lp(q4t),pu=Lp(0);Bn.ZERO=pu;var Il=Lp(0,!0);Bn.UZERO=Il;var Nv=Lp(1);Bn.ONE=Nv;var I2e=Lp(1,!0);Bn.UONE=I2e;var zq=Lp(-1);Bn.NEG_ONE=zq;var P2e=Xr(-1,2147483647,!1);Bn.MAX_VALUE=P2e;var j2e=Xr(-1,-1,!0);Bn.MAX_UNSIGNED_VALUE=j2e;var mo=Xr(0,-2147483648,!1);Bn.MIN_VALUE=mo;var Ke=Bn.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(mo)){var r=_s(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=_s(uD(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(mo)?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 Ma(t)||(t=mu(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(Ma(t)||(t=mu(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(mo)?mo:this.not().add(Nv)};Ke.neg=Ke.negate;Ke.add=function(t){Ma(t)||(t=mu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,d=0,h=0;return h+=a+c,d+=h>>>16,h&=65535,d+=i+u,f+=d>>>16,d&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,Xr(d<<16|h,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Ma(t)||(t=mu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Ma(t)||(t=mu(t)),xs){var r=xs.mul(this.low,this.high,t.low,t.high);return Xr(r,xs.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Il:pu;if(this.eq(mo))return t.isOdd()?mo:pu;if(t.eq(mo))return this.isOdd()?mo:pu;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(O2e)&&t.lt(O2e))return _s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,d=0,h=0,p=0;return p+=o*l,h+=p>>>16,p&=65535,h+=a*l,d+=h>>>16,h&=65535,h+=o*c,d+=h>>>16,h&=65535,d+=i*l,f+=d>>>16,d&=65535,d+=a*c,f+=d>>>16,d&=65535,d+=o*u,f+=d>>>16,d&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,Xr(h<<16|p,f<<16|d,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Ma(t)||(t=mu(t)),t.isZero())throw Error("division by zero");if(xs){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?xs.div_u:xs.div_s)(this.low,this.high,t.low,t.high);return Xr(r,xs.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Il:pu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Il;if(t.gt(this.shru(1)))return I2e;a=Il}else{if(this.eq(mo)){if(t.eq(Nv)||t.eq(zq))return mo;if(t.eq(mo))return Nv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(pu)?t.isNegative()?Nv:zq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(mo))return this.unsigned?Il:pu;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=pu}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:uD(2,s-48),c=_s(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=_s(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(Ma(t)||(t=mu(t)),xs){var r=(this.unsigned?xs.rem_u:xs.rem_s)(this.low,this.high,t.low,t.high);return Xr(r,xs.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return Xr(~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?C2e(this.low):C2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Ma(t)||(t=mu(t)),Xr(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Ma(t)||(t=mu(t)),Xr(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Ma(t)||(t=mu(t)),Xr(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Xr(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Xr(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Xr(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Xr(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Xr(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Xr(this.high,0,this.unsigned):Xr(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Xr(this.high,this.low,this.unsigned):t<32?(r=32-t,Xr(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Xr(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 Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Xr(this.high,this.low,this.unsigned):t<32?(r=32-t,Xr(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Xr(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?Xr(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:Xr(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]};Bn.fromBytes=function(t,r,n){return n?Bn.fromBytesLE(t,r):Bn.fromBytesBE(t,r)};Bn.fromBytesLE=function(t,r){return new Bn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Bn.fromBytesBE=function(t,r){return new Bn(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=Bn;var N4t=16;function m_(e){e==="X"&&(e="");let t=e.padEnd(N4t,"0");return Gv.fromString(t,!0,16)}function Wq(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 Vq(e,t){let r=U4t(e).shiftRightUnsigned(2);return e.add(Gv.fromNumber(2*t+1-4).multiply(r))}function U4t(e){return e.and(e.not().add(1))}var G4t=3,z4t=30,H4t=2*z4t+1,L2e=180/Math.PI;function q2e(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);W4t(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 N2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<G4t+H4t;)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 Kq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function M2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Xq(e){return[M2e(e[0]),M2e(e[1])]}function Yq(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 $q([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*L2e,n*L2e]}function W4t(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 U2e(e){let t=Kq(e.ij,e.level,[.5,.5]),r=Xq(t),n=Yq(e.face,r);return $q(n)}var V4t=100;function Jq(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(V4t*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],d=(f[0]-l[0])/a,h=(f[1]-l[1])/a;for(let p=0;p<a;p++){l[0]+=d,l[1]+=h;let b=Kq(r,n,l),g=Xq(b),x=Yq(t,g),w=$q(x);Math.abs(w[1])>89.999&&(w[0]=u);let S=w[0]-u;w[0]+=S>180?-360:S<-180?360:0,o[s++]=w[0],o[s++]=w[1],u=w[0]}}return o[s++]=o[0],o[s++]=o[1],o}function zv(e){let t=K4t(e);return q2e(t)}function K4t(e){if(e.indexOf("/")>0)return e;let t=m_(e);return N2e(t)}function Qq(e){let t=zv(e);return U2e(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=Jq(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=G2e(r)}else{let r=Jq(e);t=G2e(r)}return t}function G2e(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 Zq(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 cD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Zq(t,r),i=Qq(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=Q1(n);return[...c.center,...c.halfAxes]}var X4t=4,Y4t=8,$4t={QUADTREE:X4t,OCTREE:Y4t};function J4t(e,t,r){if(e!=null&&e.box){let n=m_(e.s2VolumeInfo.token),i=Vq(n,t),a=Wq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,d=c.minimumHeight+l/2;c.minimumHeight=d-f,c.maximumHeight=d+f;break;default:break}return{box:cD(o),s2VolumeInfo:o}}}async function tN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:i={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a,loaderOptions:o}=e,{subtree:s,level:u=0}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:d,subtreesUriTemplate:h,basePath:p}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Gq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${d} won't be loaded...`),b;let g=u+i.level;if(g>f)return b;let x=$4t[c],w=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**u-1)/(x-1),B=Mp(r.mortonIndex,n,w),N=j+B,C=Mp(r.x,S,1),k=Mp(r.y,F,1),I=Mp(r.z,D,1),U=!1;u>=l&&(U=eN(s.childSubtreeAvailability,B));let Y=Mp(i.x,C,u*w),$=Mp(i.y,k,u*w),re=Mp(i.z,I,u*w);if(U){let Te=`${p}/${h}`,Xe=lD(Te,g,Y,$,re);s=await mn(Xe,nD,o),i.mortonIndex=B,i.x=C,i.y=k,i.z=I,i.level=u,B=0,N=0,C=0,k=0,I=0,u=0}if(!eN(s.tileAvailability,N))return b;eN(s.contentAvailability,N)&&(b.contentUrl=lD(d,g,Y,$,re));let ye=u+1,he={mortonIndex:B,x:C,y:k,z:I};for(let Te=0;Te<x;Te++){let Xe=J4t(a,Te,c),We=await tN({subtree:s,implicitOptions:t,loaderOptions:o,parentData:he,childIndex:Te,level:ye,globalData:{...i},s2VolumeBox:Xe});if(We.contentUrl||We.children.length){let oe=g+1,ne=Q4t(We,oe,{childTileX:C,childTileY:k,childTileZ:I},t,a);b.children.push(ne)}}return b}function eN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Gq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?tBt(t,r.explicitBitstream):!1}function Q4t(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,d=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),h=l/2**t,p=i!=null&&i.box?{box:i.box}:f,b=Z4t(t,p,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:h,geometricError:h,transform:e.transform,boundingVolume:b}}function Z4t(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,d=2**e,h=(u-o)/d,p=(c-s)/d,b=(f-l)/d,[g,x]=[o+h*n,o+h*(n+1)],[w,S]=[s+p*i,s+p*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,w,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Mp(e,t,r){return(e<<r)+t}function lD(e,t,r,n,i){let a=eBt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function eBt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function tBt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function nN(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 iN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function rN(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 eu.resolve(t,e)}function H2e(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);r=rN(a,t)}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:nN(e,r),refine:iN(e.refine)}}async function K2e(e,t,r){let n=null,i=V2e(e.root);i&&e.root?n=await W2e(e.root,e,t,i,r):n=H2e(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=V2e(c),f;l?f=await W2e(c,e,t,l,r):f=H2e(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function W2e(e,t,r,n,i){var S,F,D;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=lD(c,0,0,0,0),f=rN(l,r),d=await mn(f,nD,i),h=rN((S=e.content)==null?void 0:S.uri,r),p=(F=t==null?void 0:t.root)==null?void 0:F.refine,b=e.geometricError,g=(D=e.boundingVolume.extensions)==null?void 0:D["3DTILES_bounding_volume_S2"];if(g){let B={box:cD(g),s2VolumeInfo:g};e.boundingVolume=B}let x=e.boundingVolume,w={contentUrlTemplate:h,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:p,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:b,rootBoundingVolume:x,getTileType:nN,getRefine:iN};return await rBt(e,r,d,w,i)}async function rBt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await tN({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:nN(e,s),refine:iN(e.refine),content:u||e.content,children:a}}function V2e(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 Ec={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:nBt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function nBt(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?iBt(e,t,r):aBt(e,t,r)}async function iBt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=oBt(i),o=await K2e(n,a,t||{});return{...n,shape:"tileset3d",loader:Ec,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 aBt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await qq(e,0,t,r,n.content),n.content}function oBt(e){return eu.dirname(e)}var X2e="https://api.cesium.com/v1/assets";async function Y2e(e,t){if(!t){let a=await sBt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await uBt(e,t),{type:n,url:i}=r;return Jt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function sBt(e){Jt(e);let t=X2e,r={Authorization:`Bearer ${e}`},n=await Fo(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function uBt(e,t){Jt(e,t);let r={Authorization:`Bearer ${e}`},n=`${X2e}/${t}`,i=await Fo(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await Fo(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function cBt(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 Y2e(r,n)}var fD={...Ec,id:"cesium-ion",name:"Cesium Ion",preload:cBt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=fD,Ec.parse(e,t,r)),options:{"cesium-ion":{...Ec.options["3d-tiles"],accessToken:null}}};var nTe=Kt(WU(),1),FIt="4.0.0-beta.5",VU={id:"zip",module:"zip",name:"Zip Archive",version:FIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:BIt};async function BIt(e,t={}){let r=[],n={};try{let i=new nTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=RIt(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 RIt(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 Q_=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 OIt=new Uint8Array([80,75,5,6]),kIt=new Uint8Array([80,75,6,7]),IIt=new Uint8Array([80,75,6,6]),PIt=8n,jIt=16n,LIt=8n,MIt=24n,qIt=48n,iTe=async e=>{let t=await Q_(e,OIt),r=BigInt(await e.getUint16(t+PIt)),n=BigInt(await e.getUint32(t+jIt));if(n===BigInt(4294967295)||r===BigInt(4294967295)){let i=t-20n,a=await e.slice(i,i+4n);if(!Zu(a,kIt))throw new Error("zip64 EoCD locator not found");let o=await e.getBigUint64(i+LIt),s=await e.slice(o,o+4n);if(!Zu(s,IIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+MIt),n=await e.getBigUint64(o+qIt)}return{cdRecordsNumber:r,cdStartOffset:n}};var NIt=20n,UIt=24n,GIt=28n,zIt=30n,HIt=42n,KU=46n,rF=new Uint8Array([80,75,1,2]),Z_=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,rF.buffer))return null;let n=BigInt(await t.getUint32(e+NIt)),i=BigInt(await t.getUint32(e+UIt)),a=await t.getUint16(e+zIt),o=await t.getUint16(e+GIt),s=await t.slice(e+KU,e+KU+BigInt(o)),u=new TextDecoder().decode(s),c=e+KU+BigInt(o),l=await t.getUint32(e+HIt),f=BigInt(l),d=4n;return i===BigInt(4294967295)&&(i=await t.getBigUint64(c+d),d+=8n),n===BigInt(4294967295)&&(n=await t.getBigUint64(c+d),d+=8n),f===BigInt(4294967295)&&(f=await t.getBigUint64(c+d)),{compressedSize:n,uncompressedSize:i,extraFieldLength:a,fileNameLength:o,fileName:u,extraOffset:c,localHeaderOffset:f}};async function*nF(e){let{cdStartOffset:t}=await iTe(e),r=await Z_(t,e);for(;r;)yield r,r=await Z_(r.extraOffset+BigInt(r.extraFieldLength),e)}var WIt=8n,VIt=18n,KIt=22n,XIt=26n,YIt=28n,iF=30n,aTe=new Uint8Array([80,75,3,4]),Zp=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,aTe))return null;let n=await t.getUint16(e+XIt),i=new TextDecoder().decode(await t.slice(e+iF,e+iF+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+YIt),o=e+iF+BigInt(n+a),s=await t.getUint16(e+WIt),u=BigInt(await t.getUint32(e+VIt)),c=BigInt(await t.getUint32(e+KIt)),l=e+iF+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 aF=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 Hh(t)}};function oTe(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+=$It(n[i])}return t}function $It(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 sTe(e,t){switch(t){case"hex":return e;case"base64":return JIt(e);default:throw new Error(t)}}function JIt(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return oTe(r)||""}var cTe=typeof atob=="function"?atob:typeof Buffer=="function"?i5t:fTe,QIt=cTe("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="),XU=WebAssembly&&cTe!==fTe?n5t(QIt).buffer:!1,Bc=a5t(),YU=240*16*16,lTe=Math.floor(YU*16*1.066666667),ZIt=268435456-65536,uTe="Parameter must be Buffer, ArrayBuffer or Uint8Array",e5t="Parameter exceeds max size of 255.9 Mbytes";XU||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function $U(e){var t,r,n,i,a,o,s,u,c,l;let f=r5t(),d=t5t(),h={},p=new Date().getTime();return h.then=function(w){return s=w,g(),h},h.catch=function(w){return u=w,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(uTe)):x(new TypeError(uTe)),o&&(a=o.length,XU&&a>lTe?a>ZIt?x(new Error(e5t)):(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(XU,n).then(b)):g(f(o))),h;function b(w){g(d(o,w.instance.exports,r))}function g(w){var S=Boolean(w)?w:c;Boolean(w)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-p),s=u=null):Boolean(w)&&(c=w)}function x(w){typeof u=="function"&&u(w)}}function t5t(){var e,t,r,n,i,a,o,s,u,c,l,f,d,h=function(p){var b,g,x,w,S,F,D,j,B,N,C,k,I,U,Y,$,re,ee,ge,ye,he,Te,Xe=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=p.length*8,ft;for(ft=ke(p,d),d[at>>>5]|=128<<at%32,d[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,he=d;Ge<ft;)ft>Ge+lTe?(n(oe),a(V),s(ne),c(se),t(YU),Ge=Ge+YU*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,w=he[Ge+3]>>>0,S=he[Ge+4]>>>0,F=he[Ge+5]>>>0,D=he[Ge+6]>>>0,j=he[Ge+7]>>>0,B=he[Ge+8]>>>0,N=he[Ge+9]>>>0,C=he[Ge+10]>>>0,k=he[Ge+11]>>>0,I=he[Ge+12]>>>0,U=he[Ge+13]>>>0,Y=he[Ge+14]>>>0,$=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)+w-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)+B+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)+k-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+I+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)+$+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)+k+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)+$-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)+w-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+B+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)+I-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+B-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+k+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)+w-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)+I-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+$+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))+I+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+w-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))+B+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+$-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))+k-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 Bc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function ke(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,de,Je,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],de=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Je=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|de<<8|Je<<16|ct<<24;return _t+1}};return function(p,b,g,x){var w;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,d=g,w=Bc.wordsToBytes(h(p)),x&&x.asBytes?w:Bc.bytesconvertNumberToHex(w)}}function r5t(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,d,h,p,b,g,x,w,S,F,D,j,B,N=new Date().getTime(),C=1732584193,k=-271733879,I=-1732584194,U=271733878,Y=t.length*8;B=Bc.bytesToWords(t);for(var $=0;$<B.length;$++)B[$]=(B[$]<<8|B[$]>>>24)&16711935|(B[$]<<24|B[$]>>>8)&4278255360;B[Y>>>5]|=128<<Y%32,B[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<B.length;re+=16)S=C,F=k,D=I,j=U,n=B[re+0]>>>0,i=B[re+1]>>>0,a=B[re+2]>>>0,o=B[re+3]>>>0,s=B[re+4]>>>0,u=B[re+5]>>>0,c=B[re+6]>>>0,l=B[re+7]>>>0,f=B[re+8]>>>0,d=B[re+9]>>>0,h=B[re+10]>>>0,p=B[re+11]>>>0,b=B[re+12]>>>0,g=B[re+13]>>>0,x=B[re+14]>>>0,w=B[re+15]>>>0,C=ee(7,25,C+(k&I|~k&U)+n-680876936)+k,U=ee(12,20,U+(C&k|~C&I)+i-389564586)+C,I=ee(17,15,I+(U&C|~U&k)+a+606105819)+U,k=ee(22,10,k+(I&U|~I&C)+o-1044525330)+I,C=ee(7,25,C+(k&I|~k&U)+s-176418897)+k,U=ee(12,20,U+(C&k|~C&I)+u+1200080426)+C,I=ee(17,15,I+(U&C|~U&k)+c-1473231341)+U,k=ee(22,10,k+(I&U|~I&C)+l-45705983)+I,C=ee(7,25,C+(k&I|~k&U)+f+1770035416)+k,U=ee(12,20,U+(C&k|~C&I)+d-1958414417)+C,I=ee(17,15,I+(U&C|~U&k)+h-42063)+U,k=ee(22,10,k+(I&U|~I&C)+p-1990404162)+I,C=ee(7,25,C+(k&I|~k&U)+b+1804603682)+k,U=ee(12,20,U+(C&k|~C&I)+g-40341101)+C,I=ee(17,15,I+(U&C|~U&k)+x-1502002290)+U,k=ee(22,10,k+(I&U|~I&C)+w+1236535329)+I,C=ee(5,27,C+(k&U|I&~U)+i-165796510)+k,U=ee(9,23,U+(C&I|k&~I)+c-1069501632)+C,I=ee(14,18,I+(U&k|C&~k)+p+643717713)+U,k=ee(20,12,k+(I&C|U&~C)+n-373897302)+I,C=ee(5,27,C+(k&U|I&~U)+u-701558691)+k,U=ee(9,23,U+(C&I|k&~I)+h+38016083)+C,I=ee(14,18,I+(U&k|C&~k)+w-660478335)+U,k=ee(20,12,k+(I&C|U&~C)+s-405537848)+I,C=ee(5,27,C+(k&U|I&~U)+d+568446438)+k,U=ee(9,23,U+(C&I|k&~I)+x-1019803690)+C,I=ee(14,18,I+(U&k|C&~k)+o-187363961)+U,k=ee(20,12,k+(I&C|U&~C)+f+1163531501)+I,C=ee(5,27,C+(k&U|I&~U)+g-1444681467)+k,U=ee(9,23,U+(C&I|k&~I)+a-51403784)+C,I=ee(14,18,I+(U&k|C&~k)+l+1735328473)+U,k=ee(20,12,k+(I&C|U&~C)+b-1926607734)+I,C=ee(4,28,C+(k^I^U)+u-378558)+k,U=ee(11,21,U+(C^k^I)+f-2022574463)+C,I=ee(16,16,I+(U^C^k)+p+1839030562)+U,k=ee(23,9,k+(I^U^C)+x-35309556)+I,C=ee(4,28,C+(k^I^U)+i-1530992060)+k,U=ee(11,21,U+(C^k^I)+s+1272893353)+C,I=ee(16,16,I+(U^C^k)+l-155497632)+U,k=ee(23,9,k+(I^U^C)+h-1094730640)+I,C=ee(4,28,C+(k^I^U)+g+681279174)+k,U=ee(11,21,U+(C^k^I)+n-358537222)+C,I=ee(16,16,I+(U^C^k)+o-722521979)+U,k=ee(23,9,k+(I^U^C)+c+76029189)+I,C=ee(4,28,C+(k^I^U)+d-640364487)+k,U=ee(11,21,U+(C^k^I)+b-421815835)+C,I=ee(16,16,I+(U^C^k)+w+530742520)+U,k=ee(23,9,k+(I^U^C)+a-995338651)+I,C=ee(6,26,C+(I^(k|~U))+n-198630844)+k,U=ee(10,22,U+(k^(C|~I))+l+1126891415)+C,I=ee(15,17,I+(C^(U|~k))+x-1416354905)+U,k=ee(21,11,k+(U^(I|~C))+u-57434055)+I,C=ee(6,26,C+(I^(k|~U))+b+1700485571)+k,U=ee(10,22,U+(k^(C|~I))+o-1894986606)+C,I=ee(15,17,I+(C^(U|~k))+h-1051523)+U,k=ee(21,11,k+(U^(I|~C))+i-2054922799)+I,C=ee(6,26,C+(I^(k|~U))+f+1873313359)+k,U=ee(10,22,U+(k^(C|~I))+w-30611744)+C,I=ee(15,17,I+(C^(U|~k))+c-1560198380)+U,k=ee(21,11,k+(U^(I|~C))+g+1309151649)+I,C=ee(6,26,C+(I^(k|~U))+s-145523070)+k,U=ee(10,22,U+(k^(C|~I))+p-1120210379)+C,I=ee(15,17,I+(C^(U|~k))+a+718787259)+U,k=ee(21,11,k+(U^(I|~C))+d-343485551)+I,C=C+S>>>0,k=k+F>>>0,I=I+D>>>0,U=U+j>>>0;return Bc.endian([C,k,I,U]);function ee(ge,ye,he){return he<<ge|he>>>ye}};return function(t,r){var n=Bc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:Bc.bytesconvertNumberToHex(n);return i}}function n5t(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 i5t(e){return Buffer.from(e,"base64").toString("binary")}function fTe(e){return e}function a5t(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return Bc.rotl(t,8)&16711935|Bc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=Bc.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 e2=class extends aF{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>$U(t).then(a).catch(o));return sTe(i,r)}};function JU(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=o5t(e,n,16);r[a]=i}return r}function o5t(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 Hh(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var t2=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 e0=Kt(OU(),1),Wl=Kt(require("zlib"),1);var t0=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(!vn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gzip)(t):await Om(Wl.default.deflate)(t);return fl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!vn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gunzip)(t):await Om(Wl.default.inflate)(t);return fl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!vn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gzipSync(t):Wl.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?e0.default.deflateRaw:e0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!vn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gunzipSync(t):Wl.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?e0.default.inflateRaw:e0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new e0.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 e0.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 s5t={0:async e=>e,8:async e=>await new t0({raw:!0}).decompress(e)},r2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!vn)this.fileProvider=new Fx(t);else throw new Error("Cannot open file for random access in a WEB browser");else $I(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=nF(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 Zp(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=s5t[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=nF(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 u5t={0:e=>new t2().decompress(e),8:e=>new t0({raw:!0}).decompress(e)},oF=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 e2().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await Zp(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=u5t[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var n2=class extends r2{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 oF(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 Q_(t,rF),n=await Z_(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await Zp(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=JU(o)}else this.hashTable=null}};function Ld(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Jt(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 Md(e,t,r){e&&e.setUint32(t+8,r,!0)}function dTe(e,t,r,n,i){e={magic:Ed.COMPOSITE,tiles:[],...e};let a=r;r+=Ld(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 Md(t,a,r-a),r}function hTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Co(s.length,8),l=u?Co(u.length,8):0;e={magic:Ed.BATCHED_MODEL,...e};let f=r;r=Ld(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=Rm(t,r,s,8),a&&(r=Rm(t,r,u,8));let d=e.gltfEncoded;return d&&(r=Cx(t,r,d,d.byteLength)),Md(t,f,r-f),r}function pTe(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:Ed.INSTANCED_MODEL,...e};let f=r;return r=Ld(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+=Bm(t,r,c,l),r+=Bm(t,r,o,s),Md(t,f,r-f),r}var c5t={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function mTe(e,t,r,n){let{featureTableJson:i=c5t}=e,a=JSON.stringify(i);a=HI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:Ed.POINT_CLOUD,...e};let c=r;return r+=Ld(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+=Bm(t,r,a,o),r+=Cx(t,r,s,u),Md(t,c,r-c),r}function ZU(e,t){let r=QU(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return QU(e,i,0,t),n}function QU(e,t,r,n){switch(Jt(typeof e.type=="string"),e.type){case ms.COMPOSITE:return dTe(e,t,r,n,QU);case ms.POINT_CLOUD:return mTe(e,t,r,n);case ms.BATCHED_3D_MODEL:return hTe(e,t,r,n);case ms.INSTANCED_3D_MODEL:return pTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var eG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:l5t,binary:!0,options:{["3d-tiles"]:{}}};function l5t(e,t){return ZU(e,t)}var Na=require("path");var gTe=Kt(require("crypto")),uF=new Uint8Array(256),sF=uF.length;function tG(){return sF>uF.length-16&&(gTe.default.randomFillSync(uF),sF=0),uF.slice(sF,sF+=16)}var Ea=[];for(let e=0;e<256;++e)Ea.push((e+256).toString(16).slice(1));function vTe(e,t=0){return(Ea[e[t+0]]+Ea[e[t+1]]+Ea[e[t+2]]+Ea[e[t+3]]+"-"+Ea[e[t+4]]+Ea[e[t+5]]+"-"+Ea[e[t+6]]+Ea[e[t+7]]+"-"+Ea[e[t+8]]+Ea[e[t+9]]+"-"+Ea[e[t+10]]+Ea[e[t+11]]+Ea[e[t+12]]+Ea[e[t+13]]+Ea[e[t+14]]+Ea[e[t+15]]).toLowerCase()}var bTe=Kt(require("crypto")),rG={randomUUID:bTe.default.randomUUID};function f5t(e,t,r){if(rG.randomUUID&&!t&&!e)return rG.randomUUID();e=e||{};let n=e.random||(e.rng||tG)();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 vTe(n)}var Rc=f5t;var C0=Kt(require("process"),1),nB=Kt(_u(),1),KW=Kt(oG(),1);var $b=require("path"),bBe=Kt(_u(),1);var FTe=()=>({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 Xb=require("fs"),Yb=require("path");var pBe=require("zlib"),mBe=require("path"),rE=require("fs"),LVt=Kt(hBe(),1);var MVt=Kt(WU(),1);var qVt=Kt(nG(),1);function V4(e){let t=`${e}.gz`,r=(0,pBe.createGzip)(),n=(0,rE.createReadStream)(e),i=(0,rE.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 gBe(e,t,r,n,i){process.platform==="win32"?await UVt(e,t,r,n,i):await NVt(e,t,r,n)}async function NVt(e,t,r=0,n="."){let i=nE(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function UVt(e,t,r=0,n=(0,mBe.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=nE(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Fi(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 Xb.promises.mkdir(e,{recursive:!0});let i=(0,Yb.join)(e,r);try{await Xb.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function Mc(e,t,r="index.json",n=!0,i){let a=await Fi(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await V4(a);return await kW(a),o}}return a}async function K4(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);mn(o,KI).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function vBe(e){try{return await Xb.promises.stat(e),!0}catch{return!1}}function iE(e){return Xb.promises.rm(e,{recursive:!0})}function kW(e){return Xb.promises.unlink(e)}function nE(e){return(0,Yb.isAbsolute)(e)?e:(0,Yb.join)(process.cwd(),e)}var Za=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,$b.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,$b.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,$b.join)(r,n);return await vBe(i)?(console.log(`load ${i}.`),await K4(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),Za.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?Za.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,bBe.default)({nodeCount:this.nodesCounter},FTe()),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,$b.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,$b.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}),Za.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 aE=require("path"),X4=require("fs");function Y4(e){let r=e[0],n=Math.floor(r/3600);r=r-n*3600;let i=Math.floor(r/60);r=r-i*60;let a=Math.floor(r),o=e[1]/1e6,s="";return n&&(s+=`${n}h `),i&&(s+=`${i}m `),a&&(s+=`${a}s`),s||(s+=`${o}ms`),s}async function $4(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=nE(r);try{if(t){let s=(0,aE.join)(i,`${n}.slpk`);return(await X4.promises.stat(s)).size}let a=(0,aE.join)(i,n);return await yBe(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function yBe(e){let t=0,r=await X4.promises.readdir(e);for(let n of r){let i=await X4.promises.stat((0,aE.join)(e,n));i.isDirectory()?t+=await yBe((0,aE.join)(e,n)):t+=i.size}return t}var zBe=Kt(oG(),1);var T0=3,Jb=9;function _Be(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Jb;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=GVt(o),c=zVt({...u,...e}),l=HVt(c);return WVt(l,u.featureCount)}function GVt(e){let t=1,r=1,n=xBe(e.slice(0,T0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=T0;c<e.length;c+=T0){let l=xBe(e.slice(c,c+T0));n!==l&&(i[t]=c/T0-1,i[t+1]=c/T0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/T0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function xBe(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 zVt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),d=new Float32Array(o),h=new Uint16Array(a),p=0,b=0,g=0,x=0,w=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=oE("positions",F,D),B=oE("normals",F,D),N=oE("colors",F,D),C=oE("uvRegions",F,D),k=oE("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(p,p+j),normals:l.subarray(b,b+B),colors:f.subarray(g,g+N),uvRegions:h.subarray(x,x+C),texCoords:d.subarray(w,w+k)}),p+=j,b+=B,g+=N,x+=C,w+=k}return u}function oE(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Jb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function HVt(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=EBe(n.attributes);r.push({featureId:n.featureId,...i})}return r}function WVt(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/Jb-1+o),i.push(f.positions.length/Jb+o),o+=f.positions.length/Jb,a+=1}let s=EBe(e);return i.push(s.positions.length/Jb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function EBe(e){let t=e.map(({positions:f})=>f),r=t.length>1?To(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?To(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?To(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?To(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?To(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function IW(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 aa?(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 hs().fromMatrix3(new Pr([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 wBe(e,t){let r=VVt(e),n=Q1(r),i=P7(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 VVt(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 ABe(e){let t;e instanceof Ya?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 PW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Pr([t,0,0,0,t,0,0,0,t]);return new aa(r,n)}function SBe(e,t,r){var s,u,c,l,f,d,h,p;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((d=e.gltf)==null?void 0:d.nodes)||[],i=((p=(h=e.gltf)==null?void 0:h.images)==null?void 0:p.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let w=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(w.length);return S.set(w),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];TBe(n);let{cartographicOrigin:a,modelMatrix:o}=XVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function KVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function XVt(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 TBe(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:KVt(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&&TBe(n.children)}}function CBe(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[gs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function DBe(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 gs:return $Vt(e,o,r,n);case qC:return YVt(e,o);default:return[]}return[]}function YVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function $Vt(e,t,r,n){var o,s,u,c,l,f,d;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let h=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return JVt(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 p=`TEXCOORD_${((d=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:d.texCoord)||0}`,b=e[p].value;return QVt(a,b,r)}return n?e[n].value:[]}function JVt(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 QVt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let d=0;d<t.length;d+=2){let h=t[d],p=t[d+1],b=Math.min(Bp(h)*o.width|0,o.width-1),x=(Math.min(Bp(p)*o.height|0,o.height-1)*o.width+b)*o.components+u,w=new Uint8Array(o.data)[x];s.push(w)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function BBe(e,t){let r={};for(let n in t){let i=t[n];r[n]=ZVt(i,e)}return r}function ZVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function RBe(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}var qc="string",sE="Int32",uE="double",OBe="OBJECTID";function eKt(e){return typeof e===qc||typeof e=="bigint"?qc:typeof e=="number"?Number.isInteger(e)?sE:uE:qc}function kBe(e,t,r){let n={key:`f_${e}`,name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case OBe:tKt(n);break;case qc:FBe(n);break;case uE:rKt(n);break;case sE:break;default:FBe(n)}return n}function IBe(e){switch(e){case OBe:return"esriFieldTypeOID";case qc:return"esriFieldTypeString";case sE:return"esriFieldTypeInteger";case uE:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function PBe(e,t){return{name:e,type:t,alias:e}}function jBe(e){let t="{OBJECTID}",r=[],n=[],i=[],a=[];for(let o of e)n.push({fieldName:o,visible:!0,isEditable:!1,label:o});return i.push({fieldInfos:n,type:"fields"}),{title:t,mediaInfos:r,popupElements:i,fieldInfos:n,expressionInfos:a}}function FBe(e){e.ordering.unshift("attributeByteCounts"),e.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),e.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},e.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}function tKt(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function rKt(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}function LBe(e){let t={};for(let r in e){let n=e[r][0],i=eKt(n);t[r]=i}return t}var MBe=(e,t)=>{var a,o,s,u,c,l,f,d;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[gs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let h in n.properties){let p=n.properties[h],b=nKt(p);r[h]=b}return r}let i=(d=(f=(l=(c=e.extensions)==null?void 0:c[Ol])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:d[t];if(i){for(let h in i.properties){let p=i.properties[h],b=iKt(p);r[h]=b}return r}return null},nKt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=sE;break;case"FLOAT32":case"FLOAT64":t=uE;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=qc;break;default:t=qc;break}return t},iKt=e=>{let t;if(e.array)t=qc;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=sE;break;case"FLOAT32":case"FLOAT64":t=uE;break;case"INT64":case"UINT64":t=qc;break;default:t=qc;break}return t};var J4=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var aKt=1,oKt=1,wu=3,cE=2,sKt=4,uKt="string",cKt="Int32",lKt="Float64",fKt="Oid32",qBe=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],bh=new ce;async function jW(e,t,r,n,i,a,o,s,u,c,l,f,d){var S;let h=u,p=await TKt((S=e.gltf)==null?void 0:S.materials,c),b=SBe(e,t,r),g=CBe(e,d),x=await pKt(b,p,h,g);u&&dKt(x,l);let w=[];for(let F of p){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:B,texture:N}=F,C=await n();w.push(await hKt({convertedAttributes:j,material:B,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return w.length?w:null}function dKt(e,t){for(let r of e.values()){let n=wBe(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=wu){let o=r.positions.subarray(a,a+wu);or.WGS84.cartesianToCartographic(Array.from(o),bh),bh[2]=bh[2]-t.getHeight(bh[1],bh[0]),bh=bh.subtract(i),r.positions.set(bh,a)}}}async function hKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var k;let l=e.boundingVolumes,f=e.positions.length/wu,{faceRange:d,featureIds:h,positions:p,normals:b,colors:g,uvRegions:x,texCoords:w,featureCount:S}=_Be(e),F={};o&&(F=LKt(h,e.featureIndices,a,o));let D=new Uint32Array(2),j=VKt(h);D.set([f,S],0);let B=new Uint8Array(ec(D.buffer,p.buffer,b.buffer,r?w.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,d.buffer)),N=u?KKt(f,e,{positions:p,normals:b,texCoords:r?w:new Float32Array(0),colors:g,uvRegions:x,featureIds:h,faceRange:d},c):null,C=[];return s&&o&&(C=UKt(h,F,o,s)),{nodeId:i,geometry:B,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:OKt(((k=n.gltf)==null?void 0:k.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function pKt(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)}HBe(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,d)=>f.concat(d)),delete l.featureIndicesGroups)}}return u}function HBe(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)gKt(u,t,r,n,i,a,o,s)}function mKt(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 gKt(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=mKt(e,o),c=e.mesh;c&&vKt(c,t,r,n,i,a,u,s),HBe(e.children||[],t,r,n,i,a,u,s)}function vKt(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:p})=>{var b;return p===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Jt(l!==null,"Primitive - material mapping failed"),Jt(c.mode===void 0||c.mode===Zt.TRIANGLES||c.mode===Zt.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let d=c.attributes;if(!l)continue;let h=bKt(c);l.positions=To(l.positions,NBe({vertices:d.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:yKt,useCartesianPositions:a})),l.normals=To(l.normals,NBe({vertices:d.NORMAL&&d.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:xKt,useCartesianPositions:!1})),l.texCoords=To(l.texCoords,_Kt(d.TEXCOORD_0&&d.TEXCOORD_0.value,h)),l.colors=To(l.colors,EKt(d.COLOR_0,h)),f&&(l.uvRegions=To(l.uvRegions,wKt(f,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(AKt(SKt(d,c,t,s),h))}}function bKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return J4(n.length/wu)}if(t&&e.mode===Zt.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 NBe(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*wu);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*wu,s=t.subarray(o,o+wu),u=new ce(Array.from(s));u=n(u,e),i[a*wu]=u.x,i[a*wu+1]=u.y,i[a*wu+2]=u.z}return i}function yKt(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 xKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function _Kt(e,t){let r=new Float32Array(t.length*cE);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*cE,a=e.subarray(i,i+cE);r[n*cE]=a[0],r[n*cE+1]=a[1]}return r}function EKt(e,t){let r=(e==null?void 0:e.components)||sKt,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 wKt(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 AKt(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 SKt(e,t,r,n){let i=DBe(e,t,r,n);if(i.length)return i;for(let a=0;a<qBe.length;a++){let o=qBe[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function TKt(e=[],t){let r=[];for(let n of e)r.push(FKt(n));return t&&(r=await CKt(r)),r}async function CKt(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 DKt(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:RKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function DKt(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 FKt(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:BKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||aKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||oKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Rc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function BKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function RKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function OKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=kKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function kKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=PKt(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:IKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function IKt(e,t=1){let r=.00015686274509803922,n=new ds(0,0,0,1),i=new ds(1,1,1,1),a=new ds(r,r,r,0),o=new ds(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 PKt(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:jKt(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 jKt(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,d=n-1<<0,h=c+l+f+d;return BigInt(`0b${h.toString(2)}${u}`).toString()}function LKt(e,t,r,n){let i=MKt(e,n,r);return UBe(t,i),UBe(e,i),i}function MKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=NKt(i,t,r);n[a.toString()]=o}return n}function qKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function NKt(e,t,r){let n=qKt(t,e),i=(0,zBe.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function UBe(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function UKt(e,t,r,n){let i=[],o=RBe(e,r)?BBe(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=zKt(u,n);if(c){let l=s[u],f=GKt(c,l);i.push(f)}}return i}function GKt(e,t){let r;switch(e){case fKt:case cKt:r=HKt(t);break;case lKt:r=WKt(t);break;case uKt:r=GBe(t);break;default:r=GBe(t)}return r}function zKt(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 HKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return ec(t.buffer,r.buffer)}function WKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return ec(t.buffer,r.buffer,n.buffer)}function GBe(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 ec(t.buffer,a.buffer,n.buffer,...i)}function VKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function KKt(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let d=new Uint32Array(t.featureIndices.length?t.featureIndices:e),h=XKt(d,l),p={positions:i,normals:a,colors:s,"feature-index":h};o.length&&(p.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(p["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),dv({attributes:p,indices:f},z7,{...z7.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 XKt(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)*wu;r.fill(n,i,o),n++,i=o+1}return r}function WBe(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=JKt(e);switch(i){case Ol:return r=YKt(a,t),r;case gs:return r=$Kt(a,t),r;default:return null}}function YKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return Q4(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return Q4(r)}return null}function $Kt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return Q4(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return Q4(n)}return null}function Q4(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function JKt(e){var a,o,s,u;let t=[gs,Ol];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 KBe=Kt(_u(),1),XBe=require("path");var VBe=()=>({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 YBe(e,t,r){let n={serviceItemId:Rc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,KBe.default)(n,VBe()),a=(0,XBe.join)(r,"SceneServer");await Fi(a,JSON.stringify(i))}var LW=16;function $Be(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*LW/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 MW(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=LW),e.mbs[3]*2*LW/r}var QKt=240,ZKt=[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],eXt=372,tXt=[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],rXt=372,nXt=[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],iXt=12,qW=(3+1)*(3+2)/2,aXt=2,Qb=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=oXt(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,d=new Array(qW);if(o===this._ix&&s===this._iy)this.options.cubic?d=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let p=[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=tXt;s!==0&&(b=s===this.options._height-2?nXt:ZKt);let g=eXt;s!==0&&(g=s===this.options._height-2?rXt:QKt);for(let x=0;x<qW;++x){d[x]=0;for(let w=0;w<iXt;++w)d[x]+=p[w]*b[qW*w+x];d[x]/=g}}if(!this.options.cubic){let p=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*p+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=d[0]+i*(d[1]+i*(d[3]+i*d[6]))+a*(d[2]+i*(d[4]+i*d[7])+a*(d[5]+i*d[8]+a*d[9]));return h=this.options._offset+this.options._scale*h,this._ix=o,this._iy=s,this._t=d,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+aXt*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function oXt(e,t){t=Math.abs(t);let r=JBe(e,t);return 2*Math.abs(r)===t?r-=JBe(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function JBe(e,t){return e-Math.floor(e/t)*t}var sXt=10,uXt=65535;function NW(e,t){let r=cXt(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,d=null,h=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let w=x.split(" "),S=w[0],F=w[1];if(S!=="#"||!F)continue;let D=w.length>2?w.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!w[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(w[2],10)}else if(F==="Scale"){if(!w[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(w[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(w[2]))&&(o=parseFloat(w[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(w[2]))&&(s=parseFloat(w[2]))}else{let w=x.split(" ");if(w=w.filter(S=>S!==""),l=parseInt(w[0],10),f=parseInt(w[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let p=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(p!==uXt)throw new Error("Geoid model file: Incorrect value of maxval");if(d=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 Qb({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:h,_datastart:d,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*cXt(e){let t=0;do{let r=e.indexOf(sXt,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:QBe(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:QBe(n)}}}while(t<e.length);return{offset:t,line:""}}function QBe(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var lXt="4.0.0-beta.5";var Z4={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:lXt,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>NW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var Zb=Kt(_u(),1);var ZBe={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 fXt=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),dXt=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),hXt=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),pXt=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),eRe=()=>({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,Zb.default)(e,fXt())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,Zb.default)(e,ZBe)},fullExtent:{path:"fullExtent",transform:e=>(0,Zb.default)(e,pXt())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,Zb.default)(e,dXt())},nodePages:{path:"nodePages",transform:e=>(0,Zb.default)(e,hXt())},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 UW=Kt(_u(),1),mXt=()=>({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}}}),gXt=()=>({"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}}}),tRe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,UW.default)(e,mXt())];return e.draco&&t.push((0,UW.default)({geometryConfig:e},gXt())),t}}});var lE=Kt(_u(),1),vXt=()=>({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}}),bXt=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,lE.default)(r,vXt())}}),yXt=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),xXt=()=>({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,lE.default)(n,yXt()))}}),rRe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:_Xt},textureDefinitions:{path:"textureDefinitionInfos",transform:EXt}});function _Xt(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,lE.default)(a,bXt());return n}function EXt(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,lE.default)(a,xXt())}return n}var wXt=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 iRe(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 AXt(t,e),SXt(t,e),t}function AXt(e,t){var o;let r=TXt(t.parentNode.obb),n=CXt(t);if(DXt(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 SXt(e,t){var a;let r=nRe(t.mbs),n=nRe(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 nRe(e){return new Ya([e[0],e[1],e[2]],e[3])}function TXt(e){let{center:t,halfSize:r,quaternion:n}=e;return new aa().fromCenterHalfSizeQuaternion(t,r,n)}function CXt(e){let t=e.obb.halfSize,r=wXt,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 DXt(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 eB=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var aRe=Kt(require("process"),1),FXt=4*1024*1024*1024,ey=class extends eB{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),aRe.default.memoryUsage().rss>FXt&&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 ty="Tile converter does not work in browser, only in node js environment";var zW=require("path"),HW=Kt(_u(),1);var oRe=Kt(_u(),1),sRe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),BXt=()=>({href:{path:"href"}}),RXt=()=>({id:{path:"id"},...BXt(),...sRe()}),GW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...sRe(),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,oRe.default)(e,RXt()),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 Au=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,zW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Mc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Fi(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,zW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await K4(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Au.createRootNodeIndexDocument(t);return await new Au(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Au.createNodeIndexDocument(t,r,n,i,a);return await new Au(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Rc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,HW.default)(r,GW())}static async createNodeIndexDocument(t,r,n,i,a){var d,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,HW.default)(l,GW());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=(d=t.converter.layers0)==null?void 0:d.attributeStorageInfo)!=null&&h.length))){f.attributeData=[];let p=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<p;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var WW=async(e,t,r)=>{let n=fE(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await tB(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},VW=async(e,t,r)=>{let n=fE(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 tB(t.contentUrl,e.loader,i)};async function tB(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 n2(a),s=await mn(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await mn(e,t,r)}function fE(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var rB=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 rB(u,s,r,n,i,a+1);n&&await n(o,t)};var OXt=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],uRe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Bo(e.gltfArrayBuffer,kl,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=kXt(n),a=IXt(n);return{meshTopologyTypes:i,metadataClasses:a}},kXt=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(OXt[i])}return t},IXt=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[gs])==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[Ol])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},cRe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var fRe,PXt=(fRe=C0.default.env)==null?void 0:fRe.IonToken,lRe=64,jXt="3DTILES",LXt="3DObject",MXt=1800,qXt="https://",ry=class{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=Ec;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ey;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};constructor(){this.nodePages=new Za(Fi,lRe,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(vn)return console.log(ty),ty;this.conversionStartTime=C0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:d,generateBoundingVolumes:h,instantNodeWriting:p=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:w=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:p,mergeMaterials:b,inquirer:g,metadataClass:x},this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(qXt)!==-1?fD:Ec,this.generateTextures=Boolean(d),this.generateBoundingVolumes=Boolean(h),this.writeQueue=new ey,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await mn(i,Z4),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(Mc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await tB(F,this.Loader,this.loadOptions),(this.Loader===Ec||w?await this.preprocessConversion():!0)&&!w&&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(),Pa.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await rB(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(`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(fE(t))return await WW(this.sourceTileset,t,this.loadOptions),null;t.id&&console.log(`[analyze]: ${t.id}`);let i=null;try{i=await VW(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 uRe(i);return cRe(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,Na.join)(`${t}`,`${r}`);try{await iE(n)}catch{}this.layers0Path=(0,Na.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=TC(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=IW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await Au.createRootNode(o,this);await rB(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,nB.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),tRe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),YBe(r,this.layers0,n);for(let f of this.compressList||[])await V4(f),await kW(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=ABe(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Rc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Rc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:lRe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,nB.default)(o,eRe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Mc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Fi(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Na.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await gBe(r,n,0,".",this.options.sevenZipExe);try{await iE(t)}catch{}}}async convertTile(t,r){let n=fE(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await WW(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);return await s.addChildren(u),{transform:o,parentNodes:u}}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 VW(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=TC(r.boundingVolume,n,null),o=IW(a,this.geoidHeightModel),s=WBe(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],d={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let h of u||[d]){this.layersHasTexture=this.layersHasTexture||Boolean(h.texture),this.generateBoundingVolumes&&h.boundingVolumes&&(o=h.boundingVolumes);let p=$Be(r,o),b=p.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,h),x=await Au.createNodeIndexDocument(t,o,p,g,h),w=await new Au(g.index,this).addData(x);c.push(w),g.mesh&&await this._writeResources(h,w.id),this.validate&&(this.boundingVolumeWarnings=iRe(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){var c;if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await jW(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,(c=this.layers0)==null?void 0:c.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,d={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(d.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let h=a.nodeId,p;if(h?p=await this.nodePages.getNodeById(h):p=await this.nodePages.push(d,i),d.mesh||console.log(`[warning]: node ${p.index} is created with empty content`),Za.updateAll(p,d),o&&Za.updateMaterialByNodeId(p,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;Za.updateTexelCountHintByNodeId(p,b)}return u&&(this.vertexCounter+=u,Za.updateVertexCountByNodeId(p,u)),Za.updateNodeAttributeByNodeId(p),c&&Za.updateFeatureCountByNodeId(p,c),this.nodePages.saveNode(p),p}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Na.join)(this.layers0Path,"nodes",r),c=(0,Na.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,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>Mc(a,t,"0.bin")})}else{let a=(0,Na.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>Mc(a,r,"1.bin")})}else{let a=(0,Na.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,nB.default)(t,rRe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Na.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>Mc(s,o,"sharedResource.json")})}else{let s=(0,Na.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Fi(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=dv({...t.image,data:u},bq,{...bq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=dv(t.image.data[0],tq);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,Na.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>Mc(o,t,`${r}.${n}`,s)})}else{let o=(0,Na.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Fi(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){var i,a;if(t!=null&&t.length&&((a=(i=this.layers0)==null?void 0:i.attributeStorageInfo)!=null&&a.length)){let o=t.length<this.layers0.attributeStorageInfo.length?t.length:this.layers0.attributeStorageInfo.length;for(let s=0;s<o;s++){let u=this.layers0.attributeStorageInfo[s].key,c=new Uint8Array(t[s]);if(this.options.slpk){let l=(0,Na.join)(r,"attributes",u);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${u}.bin.gz`,writePromise:()=>Mc(l,c,"0.bin")})}else{let l=(0,Na.join)(r,`attributes/${u}/0`);await this.writeQueue.enqueue({writePromise:()=>Fi(l,c,"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,KW.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,KW.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.layers0.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=MBe(t.gltf,this.options.metadataClass)):r&&(n=LBe(r)),n&&this.createStorageAttributes(n)}createStorageAttributes(t){if(!Object.keys(t).length)return;let r={OBJECTID:"OBJECTID",...t},n=!1,i=this.layers0.attributeStorageInfo.length;for(let a in r)if(!this.layers0.attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=kBe(i,a,s),c=IBe(s),l=PBe(a,c);this.layers0.attributeStorageInfo.push(u),this.layers0.fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this.layers0.attributeStorageInfo)a.push(o.name);this.layers0.popupInfo=jBe(a),this.layers0.layerType=LXt}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await $4(t),o=C0.default.hrtime(this.conversionStartTime),s=Y4(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${jXt}`),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||PXt}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=C0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(C0.default.hrtime(this.refreshTokenTime)[0]<MXt)return;this.refreshTokenTime=C0.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 MRe=require("path"),JW=Kt(require("process"),1),qRe=Kt(_u(),1);var ny=Kt(dRe(),1);function XW(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 hRe={UInt8:ny.default.UNSIGNED_BYTE,UInt16:ny.default.UNSIGNED_SHORT,Float32:ny.default.FLOAT,UInt32:ny.default.UNSIGNED_INT,UInt64:ny.default.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 pRe="String",mRe="Oid32",gRe="Float64",vRe="Int16";function aB(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function yh(e,t=null){return t?`${e}?token=${t}`:e}function bRe(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 yRe(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}function _Re(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?UXt(n,e):null}:{}}function UXt(e,t){switch(e){case pRe:return HXt(t);case mRe:return xRe(t);case gRe:return zXt(t);case vRe:return GXt(t);default:return xRe(t)}}function xRe(e){return new Uint32Array(e,4)}function GXt(e){return new Int16Array(e,4)}function zXt(e){return new Float64Array(e,8)}function HXt(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 WXt="4.0.0-beta.5";var dE={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:WXt,mimeTypes:["application/binary"],parse:async(e,t)=>_Re(e,t),extensions:["bin"],options:{},binary:!0};function ERe(e){return e.hasOwnProperty("objectIds")?"Oid32":e.hasOwnProperty("attributeValues")?e.attributeValues.valueType:""}async function ARe(e,t,r,n,i){var l;if(!((l=i==null?void 0:i.i3s)!=null&&l.colorsByAttribute))return e;let a=n.fields.find(({name:f})=>{var d,h;return f===((h=(d=i==null?void 0:i.i3s)==null?void 0:d.colorsByAttribute)==null?void 0:h.attributeName)});if(!a||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(a.type))return e;let o=await wRe(a.name,r,n,i);if(!o)return e;let s=n.fields.find(({type:f})=>f==="esriFieldTypeOID");if(!s)return e;let u=await wRe(s.name,r,n,i);if(!u)return e;let c={};for(let f=0;f<u[s.name].length;f++)c[u[s.name][f]]=VXt(o[a.name][f],i);for(let f=0;f<t.value.length;f++){let d=c[t.value[f]];d&&(i.i3s.colorsByAttribute.mode==="multiply"?d.forEach((h,p)=>{e.value[f*4+p]=e.value[f*4+p]*h/255}):e.value.set(d,f*4))}return e}function VXt(e,t){var u;if(!((u=t==null?void 0:t.i3s)!=null&&u.colorsByAttribute))return[255,255,255,255];let{minValue:r,maxValue:n,minColor:i,maxColor:a}=t.i3s.colorsByAttribute,o=(e-r)/(n-r),s=[255,255,255,255];for(let c=0;c<i.length;c++)s[c]=Math.round((a[c]-i[c])*o+i[c]);return s}async function wRe(e,{attributeUrls:t},{attributeStorageInfo:r},n){var u;let i=r.findIndex(({name:c})=>e===c);if(i===-1)return null;let a=yh(t[i],(u=n==null?void 0:n.i3s)==null?void 0:u.token),o=ERe(r[i]);return await mn(a,dE,{attributeName:e,attributeType:o})}var oB=new ce([0,0,0]);function XXt(e){switch(e){case"ktx-etc2":case"dds":return XC;case"ktx2":return kp;case"jpg":case"png":default:return Tv}}var YXt="i3s-attribute-type";async function DRe(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=yh(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=XXt(t.textureFormat),f=await(await(i==null?void 0:i.fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Tv){let d={...t.textureLoaderOptions,image:{type:"data"}};try{let h=await So(f,[],d,i);a.texture=h}catch{let p=await Bo(f,u,d,i);a.texture=p}}else if(u===XC||u===kp){let d=await mn(f,u,t.textureLoaderOptions);u===kp&&(d=d[0]),a.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else a.texture=f}return a.material=iYt(t.materialDefinition,a.texture),a.material&&(a.texture=null),await $Xt(e,a,t,r,n)}async function $Xt(e,t,r,n,i){var f,d;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let h=await Bo(e,xv,{draco:{attributeNameEntry:YXt}});s=h.header.vertexCount,l=(f=h.indices)==null?void 0:f.value;let{POSITION:p,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:w,["uv-region"]:S}=h.attributes;o={position:p,normal:b,color:g,uv0:x,uvRegion:S,id:w},JXt(o,h);let F=uYt(w);F&&sYt(o,F)}else{let{vertexAttributes:h,ordering:p,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=ZXt(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:w,byteOffset:S}=TRe(e,u,h,s,p),{attributes:F}=TRe(e,S,b,c,g);oYt(F),o=QXt(w,F)}if(!((d=i==null?void 0:i.i3s)!=null&&d.coordinateSystem)||i.i3s.coordinateSystem===2){let h=tYt(o.position,r);t.modelMatrix=h.invert(),t.coordinateSystem=2}else t.modelMatrix=nYt(o.position),t.coordinateSystem=3;o.color=await ARe(o.color,o.id,r,n,i),t.attributes={positions:o.position,normals:o.normal,colors:SRe(o.color),texCoords:o.uv0,uvRegions:SRe(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 JXt(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 QXt(e,t){return{...e,...t}}function SRe(e){return e&&(e.normalized=!0,e)}function ZXt(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=XW(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 TRe(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=eYt(c,n*u,iy(s));else{let f=XW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:hRe[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 eYt(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 tYt(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=rYt(n,i,o),a}function rYt(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),oB),n[o]=oB.x,n[o+1]=oB.y,n[o+2]=oB.z;return n}function nYt(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 iYt(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=CRe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=CRe(r.pbrMetallicRoughness.baseColorFactor)),t&&aYt(r,t),r}function CRe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function aYt(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function oYt(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],d=i[c-1],h=f-d+1,p=u+h*3;o.fill(l,u,p),s++,u=p}e.id.value=o}function sYt(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 uYt(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 cYt="4.0.0-beta.5",FRe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:cYt,mimeTypes:["application/octet-stream"],parse:lYt,extensions:["bin"],options:{"i3s-content":{}}};async function lYt(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 DRe(e,s,u,t,r)}var fYt="4.0.0-beta.5",BRe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:fYt,mimeTypes:["application/json"],parse:dYt,extensions:["json"],options:{i3s:{}}};async function dYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var hE=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=yh(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:mn(a,BRe,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:p}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=h,f=p;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=yRe(this.tileset,this.url,r.mesh.attribute.resource))}let d=this.getLodSelection(r);return YW({id:t.toString(),lodSelection:d,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Iv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=a_();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 RRe(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=bRe(r,e));let o=e.children||[];return YW({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function YW(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 aa().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 ORe(e,t,r){let n=aB(r.url||""),i,a;if(e.nodePages)i=new hE(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=yh(`${n}/nodes/root`,o.token);a=await mn(s,Zl,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:Zl,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var hYt="4.0.0-beta.5",pYt=/layers\/[0-9]+$/,mYt=/nodes\/([0-9-]+|root)$/,gYt="504b0304",vYt="PointCloud",Zl={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:hYt,mimeTypes:["application/octet-stream"],parse:bYt,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,colorsByAttribute:null}}};async function bYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},EYt(e)===gYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=aB(n),o;t.i3s.isTileset==="auto"?o=pYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=mYt.test(a):s=t.i3s.isTileHeader,o?e=await xYt(e,t,r):s?e=await _Yt(e,r):e=await yYt(e,t),e}async function yYt(e,t){return await Bo(e,FRe,t)}async function xYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===vYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await ORe(n,t,r)}async function _Yt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),RRe(e,t)}function EYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function $W(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 aa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var sB=Kt(_u(),1),wYt=()=>({version:{path:"version",default:"1.0"}}),kRe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,sB.default)(t,kRe()))}}),IRe=()=>({asset:{path:"asset",transform:e=>(0,sB.default)(e,wYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,sB.default)(e,kRe())}});function PRe(e,t){let r=new Float32Array(e.length),n=SYt(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=AYt([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 AYt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function SYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var TYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),jRe=new ce,pE=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return iC({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},eG)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),d=this._convertI3sMaterialToGLTFMaterial(o,f),h=l.addMaterial(d),p=s.positions,b=p.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=PRe(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 w=u||J4(b.length/p.size),S=l.addMesh({attributes:s,indices:w,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(),iC(l.gltf,Lq)}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,jRe),c=jRe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(TYt)}_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 LRe=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 mn(t.contentUrl,Zl,n)};var CYt="I3S",ay=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(vn)return console.log(ty),ty;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=JW.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await mn(o,Z4),console.log("Loading egm file completed!"),this.sourceTileset=await mn(r,Zl,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=PW(s.mbs)),this.tilesetPath=(0,MRe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await iE(this.tilesetPath)}catch{}let u={boundingVolume:{box:$W(s.obb,this.geoidHeightModel)},geometricError:MW(s),children:[]};await this._addChildren(s,u,1);let c=(0,qRe.default)({root:u},IRe());await Fi(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),Pa.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await LRe(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=PW(a.mbs));let u={box:$W(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:MW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},d=await new pE().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Fi(this.tilesetPath,new Uint8Array(d),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(this.options.maxDepth&&n>this.options.maxDepth)return;let i=[];for(let a of t.children||[])i.push(this.convertChildNode(t,r,n,a));await Promise.all(i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await mn(a,Zl,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(mn(s,dE,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 $4(t),n=JW.default.hrtime(this.conversionStartTime),i=Y4(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${CYt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var uB=require("path");var DYt="4.0.0-beta.5",FYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",cB=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await mn(FYt,VU,{}),n=process.cwd();t&&(n=(0,uB.join)(n,t)),await Fi(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(wd[ii.DECODER],"draco",ii.DECODER),await this.installFromUrl(wd[ii.DECODER_WASM],"draco",ii.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(wd[ii.ENCODER],"draco",ii.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",xc.TRANSCODER,"libs"),await this.installFromNpm("textures",xc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",xc.ENCODER,"libs"),await this.installFromNpm("textures",xc.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 Fo(`https://unpkg.com/@loaders.gl/${t}@${DYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,uB.join)(process.cwd(),"modules",t,"dist",n);await Fi(o,a,r)}async installFromUrl(t,r,n){let a=await(await Fo(t)).arrayBuffer();if(!a)return;let o=(0,uB.join)(process.cwd(),"modules",r,"dist","libs");await Fi(o,a,n)}};function Su(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function NRe(e,t){let r=Su(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function URe(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 GRe(e,t){let r=Su(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Su(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var QW={I3S:"I3S",_3DTILES:"3DTILES"};async function BYt(){let[,,...e]=process.argv;e.length===0&&ZW();let t=URe(e),r=kYt(t);if(r.installDependencies){new cB().install("deps");return}let n=OYt(r);await RYt(n)}BYt().catch(e=>{console.log(e),process.exit(1)});function ZW(){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 RYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case QW.I3S:new ay().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case QW._3DTILES:await new ry().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:HRe.default});break;default:ZW()}}function OYt(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(QW).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 kYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,zRe.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=Su(n,e);break;case"--tileset":t.tileset=NRe(n,e);break;case"--name":t.name=Su(n,e);break;case"--output":t.output=Su(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=GRe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Su(n,e);break;case"--egm":t.egm=Su(n,e);break;case"--token":t.token=Su(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=Su(n,e);break;case"--help":ZW();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 Eae={command:"",arguments:[],port:5e3,autoPort:!0,wait:2e3,onSuccess:e=>{console.log(`Started ${e.props.command}`)}},ll=class{id;props={...Eae};childProcess=null;port=0;successTimer;constructor({id:t="browser-driver"}={}){this.id=t}async start(t){t={...Eae,...t},this.props=t;let r=[...t.arguments];return this.port=Number(t.port),t.portArg&&(t.autoPort&&(this.port=await _ae(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=wae.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 qI(e,t){return!Pa.isSupported()||!Xa&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}async function NI(e,t,r,n,i){let a=e.id,o=Tx(e,r),u=Pa.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",PWe.bind(null,i));return c.postMessage("process",{input:t,options:r,context:n}),await(await c.result).result}async function PWe(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 UI(e,t){return!Pa.isSupported()||!vn&&!(t!=null&&t._nodeWorkers)?!1:e.worker&&(t==null?void 0:t.worker)}function Sae(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?Aae(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?Aae(e,0,t):""}function Aae(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 GI(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${Sae(e)}"`)}}function Zu(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 ec(...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 To(...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 zh(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 Co(e,t){return Jt(e>=0),Jt(t>0),e+(t-1)&~(t-1)}function zI(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let i=e.byteOffset,a=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,i,a)}return t.set(n,r),r+Co(n.byteLength,4)}function HI(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 Bm(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r.charCodeAt(i));return t+n}function Cx(e,t,r,n){if(e)for(let i=0;i<n;i++)e.setUint8(t+i,r[i]);return t+n}function RA(e,t,r,n){let i=Co(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 Rm(e,t,r,n){let a=new TextEncoder().encode(r);return t=RA(e,t,a,n),t}async function Hh(e){let t=[];for await(let r of e)t.push(r);return ec(...t)}function jf(e){return jf=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},jf(e)}function WI(e,t){if(jf(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t||"default");if(jf(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function VI(e){var t=WI(e,"string");return jf(t)==="symbol"?t:String(t)}function zt(e,t,r){return t=VI(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var jWe="",Tae={};function tc(e){for(let t in Tae)if(e.startsWith(t)){let r=Tae[t];e=e.replace(t,r)}return!e.startsWith("http://")&&!e.startsWith("https://")&&(e=`${jWe}${e}`),e}var LWe="4.0.0-beta.6",KI={name:"JSON",id:"json",module:"json",version:LWe,extensions:["json","geojson"],mimeTypes:["application/json"],category:"json",text:!0,parseTextSync:Cae,parse:async e=>Cae(new TextDecoder().decode(e)),options:{}};function Cae(e){return JSON.parse(e)}function Dae(e){return Buffer.isBuffer(e)?new Uint8Array(e.buffer,e.byteOffset,e.length).slice().buffer:e}function Fae(e){return e&&typeof e=="object"&&e.isBuffer}function fl(e){if(Fae(e))return Dae(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 eu={};ca(eu,{dirname:()=>NWe,filename:()=>qWe,join:()=>UWe,resolve:()=>GWe});function Bae(){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 qWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function NWe(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function UWe(...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 GWe(...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=Bae()),o=i),o.length!==0&&(r=`${o}/${r}`,n=o.charCodeAt(0)===Dx)}return r=zWe(r,!n),n?`/${r}`:r.length>0?r:"."}var Dx=47,XI=46;function zWe(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===Dx)break;a=Dx}if(a===Dx){if(!(n===s-1||i===1))if(n!==s-1&&i===2){if(r.length<2||!o||r.charCodeAt(r.length-1)!==XI||r.charCodeAt(r.length-2)!==XI){if(r.length>2){let u=r.length-1,c=u;for(;c>=0&&r.charCodeAt(c)!==Dx;--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===XI&&i!==-1?++i:i=-1}return r}var YI=new Error("Not implemented"),Wh=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 vn?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 YI}async write(t,r,n){throw YI}async stat(){throw YI}async close(){}};var $I=e=>(e==null?void 0:e.getUint8)&&(e==null?void 0:e.slice)&&(e==null?void 0:e.length);var Fx=class{file;size;constructor(t){this.file=new Wh(t,"r"),this.size=this.file.bigsize}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.size}};var Vh=Kt(require("fs"),1),Kh=class{handle;size;bigsize;url;constructor(t,r,n){t=tc(t),this.handle=Vh.default.openSync(t,r,n);let i=Vh.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)=>{Vh.default.close(this.handle,n=>n?r(n):t())})}async stat(){return await new Promise((t,r)=>Vh.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 WWe(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);Vh.default.write(this.handle,s,0,n,o,(u,c)=>u?a(u):i(c))})}};async function WWe(e,t,r,n,i){return await new Promise((a,o)=>Vh.default.read(e,t,r,n,i,(s,u)=>s?o(s):a(u)))}var PA=Kt(require("fs/promises"),1);var QI=Kt(require("fs"),1),JI=require("stream");var OA=Kt(require("zlib"),1),VWe=e=>e&&e instanceof ArrayBuffer,KWe=e=>e&&e instanceof Buffer;function kA(e,t){switch(t==null?void 0:t.get("content-encoding")){case"br":return e.pipe(OA.default.createBrotliDecompress());case"gzip":return e.pipe(OA.default.createGunzip());case"deflate":return e.pipe(OA.default.createDeflate());default:return e}}async function Rae(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(YWe(i))}),e.on("end",()=>{let i=XWe(t);r(i)})})}function XWe(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 YWe(e){if(VWe(e))return e;if(KWe(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",Oae=e=>typeof e=="function",JWe=e=>e!==null&&typeof e=="object",QWe=e=>JWe(e)&&Oae(e.read)&&Oae(e.pipe)&&$We(e.readable);async function IA(e,t){let r=/^file:\/\//;e.replace(r,"/");let n=e.split("?")[0];n=tc(n);let i=new Headers;e.endsWith(".gz")&&(i["content-encoding"]="gzip"),e.endsWith(".br")&&(i["content-encoding"]="br");try{let a=await new Promise((f,d)=>{let h=QI.default.createReadStream(n,{encoding:null});h.once("readable",()=>f(h)),h.on("error",p=>d(p))}),o=a;QWe(a)?o=kA(a,i):typeof a=="string"?o=JI.Readable.from([new TextEncoder().encode(a)]):o=JI.Readable.from([a||new ArrayBuffer(0)]);let s=200,u="OK",c=ZWe(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 ZWe(e){let t={};if(!t["content-length"]){let r=QI.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 jA=class{readable=!0;writable=!0;constructor(){}async readdir(t=".",r){return await PA.default.readdir(t,r)}async stat(t){let r=await PA.default.stat(t,{bigint:!0});return{size:Number(r.size),bigsize:r.size,isDirectory:r.isDirectory()}}async unlink(t){return await PA.default.unlink(t)}async fetch(t,r){return await IA(t,r)}async openReadableFile(t,r="r"){return new Kh(t,r)}async openWritableFile(t,r="w",n){return new Kh(t,r,n)}};var Vae=require("process");var kae=Kt(require("stream"),1),ZI=class{},eVe=kae.Readable||ZI;function t5(e,t){let r=e[Symbol.asyncIterator]?e[Symbol.asyncIterator]():e[Symbol.iterator]();return new e5(r,t)}var e5=class extends eVe{_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 jae=Kt(Pae(),1);delete globalThis.ReadableStream;var MA=class extends jae.ReadableStream{};var qA=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 NA=class extends MA{_chunks;constructor(t){super(new qA(t.values()),{type:"bytes"}),this._chunks=t}async*[Symbol.asyncIterator](t){let r=this.getReader();yield*this._chunks,r.releaseLock()}};var Xh=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 Xh)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=tVe(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 Xh([],{type:n});if(u===0)return c;let l=0,f=[];for(let d of a){let{byteLength:h}=d;if(o>0&&h<=o)o-=h,s-=h;else{let p=d.subarray(o,Math.min(h,s));if(f.push(p),l+=p.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 NA(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 tVe(e=""){let t=String(e).toLowerCase();return/[^\u0020-\u007E]/.test(t)?"":t}function rVe(){return typeof Blob>"u"&&!globalThis.Blob&&(globalThis.Blob=Xh),globalThis.Blob}var nVe=rVe();var UA=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,${by(r)}`;this.onload&&this.onload({target:{result:n}})}async readAsText(t){let r=await t.text();this.onload&&this.onload({target:{result:r}})}};var GA=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 iVe(){return typeof FileReader>"u"&&!globalThis.FileReader&&(globalThis.FileReader=UA),typeof File>"u"&&!globalThis.File&&(globalThis.File=GA),global}var aVe=iVe();var r5=Kt(require("module"),1),Lae=Kt(require("path"),1),HA=Kt(require("fs"),1);async function Mae(e){return e.startsWith("http")?await(await fetch(e)).arrayBuffer():HA.default.readFileSync(e).buffer}async function qae(e){return e.startsWith("http")?await(await fetch(e)).text():HA.default.readFileSync(e,"utf8")}async function Nae(e){if(e.startsWith("http")){let n=await(await fetch(e)).text();return zA(n)}e.startsWith("/")||(e=`${process.cwd()}/${e}`);let t=await HA.default.readFileSync(e,"utf8");return zA(t)}function zA(e,t="",r){if(typeof t=="object"&&(r=t,t=""),t=t.replace("file://",""),typeof e!="string")throw new Error(`code must be a string, not ${typeof e}`);let n=r5.default._nodeModulePaths(Lae.default.dirname(t)),i=typeof module<"u"&&(module==null?void 0:module.parent),a=new r5.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 tu=class{map;constructor(t){this.map={},t instanceof tu?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=Bx(t),r=Uae(r);let n=this.map[t];this.map[t]=n?`${n}, ${r}`:r}delete(t){delete this.map[Bx(t)]}get(t){return t=Bx(t),this.has(t)?this.map[t]:null}has(t){return this.map.hasOwnProperty(Bx(t))}set(t,r){this.map[Bx(t)]=Uae(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)}),n5(t)}values(){let t=[];return this.forEach(function(r){t.push(r)}),n5(t)}entries(){let t=[];return this.forEach(function(r,n){t.push([n,r])}),n5(t)}*[Symbol.iterator](){yield*this.entries()}};function Bx(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 Uae(e){return typeof e!="string"&&(e=String(e)),e}function n5(e){let t={next(){let r=e.shift();return{done:r===void 0,value:r}}};return t[Symbol.iterator]=function(){return t},t}function i5(e,t){if(!e)throw new Error(`@loaders.gl/polyfills assertion ${t}`)}var o5=Kt(require("stream"),1),oVe=e=>typeof e=="boolean",Gae=e=>typeof e=="function",sVe=e=>e!==null&&typeof e=="object",a5=e=>sVe(e)&&Gae(e.read)&&Gae(e.pipe)&&oVe(e.readable),dl=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 tu((r==null?void 0:r.headers)||{}),a5(t)?this._body=kA(t,n):typeof t=="string"?this._body=o5.Readable.from([new TextEncoder().encode(t)]):this._body=o5.Readable.from([t||new ArrayBuffer(0)])}get body(){return i5(!this.bodyUsed),i5(a5(this._body)),this.bodyUsed=!0,this._body}async arrayBuffer(){return a5(this._body)?await Rae(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 Hae=Kt(require("http"),1),Wae=Kt(require("https"),1);var uVe=e=>e&&e instanceof ArrayBuffer,cVe=e=>e&&e instanceof Buffer;function zae(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:lVe(r),mimeType:n}}function lVe(e){if(uVe(e))return e;if(cVe(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 s5=e=>e.startsWith("data:"),fVe=e=>e.startsWith("http:")||e.startsWith("https:");async function Rx(e,t){try{if(globalThis.fetch!==Rx&&(fVe(e)||s5(e)))return await fetch(e,t);if(s5(e)){let{arrayBuffer:c,mimeType:l}=zae(e);return new dl(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 dVe(n,t),a=gVe(e,i,r),{status:o,statusText:s}=mVe(i),u=!t||t.followRedirect||t.followRedirect===void 0;if(o>=300&&o<400&&a.has("location")&&u){let c=hVe(e,a.get("location"));return await Rx(c,t)}return new dl(i,{headers:a,status:o,statusText:s,url:e})}catch(r){return new dl(null,{status:400,statusText:String(r),url:e})}}async function dVe(e,t){return await new Promise((r,n)=>{let i=pVe(e,t),a=e.startsWith("https:")?Wae.default.request(i,o=>r(o)):Hae.default.request(i,o=>r(o));a.on("error",o=>n(o)),a.end()})}function hVe(e,t){if(t.startsWith("http"))return t;let r=new URL(e);return r.pathname=t,r.href}function pVe(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 mVe(e){return e.statusCode?{status:e.statusCode,statusText:e.statusMessage||"NA"}:{status:200,statusText:"OK"}}function gVe(e,t,r={}){let n={};if(t&&t.headers){let i=t.headers;for(let a in i){let o=i[a];n[a.toLowerCase()]=String(o)}}if(!n["content-length"]){let i=vVe(e);Number.isFinite(i)&&(n["content-length"]=i)}return Object.assign(n,r),new tu(n)}function vVe(e){return s5(e)?e.length-5:null}var bVe=parseInt(Vae.versions.node.split(".")[0]);_V&&console.error("loaders.gl: The @loaders.gl/polyfills should only be used in Node.js environments");globalThis.loaders=globalThis.loaders||{};globalThis.loaders.makeNodeStream=t5;globalThis.loaders.NodeFile=Kh;globalThis.loaders.NodeFileSystem=jA;globalThis.loaders.fetchNode=IA;globalThis.TextEncoder||(globalThis.TextEncoder=vy);globalThis.TextDecoder||(globalThis.TextDecoder=Eh);!("atob"in globalThis)&&by&&(globalThis.atob=by);!("btoa"in globalThis)&&AB&&(globalThis.btoa=AB);globalThis.loaders.encodeImageNode=AY;globalThis.loaders.parseImageNode=DI;globalThis.loaders.imageFormatsNode=CI;globalThis._parseImageNode=DI;globalThis._imageFormatsNode=CI;globalThis.loaders.readFileAsArrayBuffer=Mae;globalThis.loaders.readFileAsText=qae;globalThis.loaders.requireFromFile=Nae;globalThis.loaders.requireFromString=zA;bVe<18&&(!("Headers"in globalThis)&&tu&&(globalThis.Headers=tu),!("Response"in globalThis)&&dl&&(globalThis.Response=dl),!("fetch"in globalThis)&&Rx&&(globalThis.fetch=Rx));var zRe=require("path"),HRe=Kt(Lye(),1);var JSt=e=>typeof e=="boolean",U1=e=>typeof e=="function",Ep=e=>e!==null&&typeof e=="object",G9=e=>Ep(e)&&e.constructor==={}.constructor;var Mye=e=>Boolean(e)&&typeof e[Symbol.iterator]=="function",qye=e=>e&&typeof e[Symbol.asyncIterator]=="function";var us=e=>typeof Response<"u"&&e instanceof Response||e&&e.arrayBuffer&&e.text&&e.json;var cs=e=>typeof Blob<"u"&&e instanceof Blob,Nye=e=>e&&typeof e=="object"&&e.isBuffer;var QSt=e=>typeof ReadableStream<"u"&&e instanceof ReadableStream||Ep(e)&&U1(e.tee)&&U1(e.cancel)&&U1(e.getReader);var ZSt=e=>Ep(e)&&U1(e.read)&&U1(e.pipe)&&JSt(e.readable),Y8=e=>QSt(e)||ZSt(e);var eTt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,tTt=/^([-\w.]+\/[-\w.+]+)/;function Uye(e){let t=tTt.exec(e);return t?t[1]:e}function z9(e){let t=eTt.exec(e);return t?t[1]:""}var Gye=/\?.*/;function zye(e){let t=e.match(Gye);return t&&t[0]}function sv(e){return e.replace(Gye,"")}function wp(e){return us(e)?e.url:cs(e)?e.name||"":typeof e=="string"?e:""}function G1(e){if(us(e)){let t=e,r=t.headers.get("content-type")||"",n=sv(t.url);return Uye(r)||z9(n)}return cs(e)?e.type||"":typeof e=="string"?z9(e):""}function Hye(e){return us(e)?e.headers["content-length"]||-1:cs(e)?e.size:typeof e=="string"?e.length:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:-1}async function $8(e){if(us(e))return e;let t={},r=Hye(e);r>=0&&(t["content-length"]=String(r));let n=wp(e),i=G1(e);i&&(t["content-type"]=i);let a=await nTt(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 Wye(e){if(!e.ok){let t=await rTt(e);throw new Error(t)}}async function rTt(e){let t=`Failed to fetch resource ${e.url} (${e.status}): `;try{let r=e.headers.get("Content-Type"),n=e.statusText;r.includes("application/json")&&(n+=` ${await e.text()}`),t+=n,t=t.length>60?`${t.slice(0,60)}...`:t}catch{}return t}async function nTt(e){if(typeof e=="string")return`data:,${e.slice(0,5)}`;if(e instanceof Blob){let r=e.slice(0,5);return await new Promise(n=>{let i=new FileReader;i.onload=a=>{var o;return n((o=a==null?void 0:a.target)==null?void 0:o.result)},i.readAsDataURL(r)})}if(e instanceof ArrayBuffer){let r=e.slice(0,5);return`data:base64,${iTt(r)}`}return null}function iTt(e){let t="",r=new Uint8Array(e);for(let n=0;n<r.byteLength;n++)t+=String.fromCharCode(r[n]);return btoa(t)}function aTt(e){return!oTt(e)&&!sTt(e)}function oTt(e){return e.startsWith("http:")||e.startsWith("https:")}function sTt(e){return e.startsWith("data:")}async function Fo(e,t){var r,n;if(typeof e=="string"){let i=tc(e);return aTt(i)&&(r=globalThis.loaders)!=null&&r.fetchNode?(n=globalThis.loaders)==null?void 0:n.fetchNode(i,t):await fetch(i,t)}return await $8(e)}function H9(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 lu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||H9()}var uTt=globalThis.self||globalThis.window||globalThis.global,uv=globalThis.window||globalThis.self||globalThis.global,cTt=globalThis.document||{},Ap=globalThis.process||{},lTt=globalThis.console,kpr=globalThis.navigator||{};var J8="4.0.0-beta.6",jpr=lu();function fTt(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var Q8=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=fTt(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 Vye(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 Kye(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 Z8(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 eC;(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"})(eC||(eC={}));var dTt=10;function Xye(e){return typeof e!="string"?e:(e=e.toUpperCase(),eC[e]||eC.WHITE)}function Yye(e,t,r){if(!lu&&typeof e=="string"){if(t){let n=Xye(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Xye(r);e="\x1B[".concat(n+dTt,"m").concat(e,"\x1B[49m")}}return e}function $ye(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 Sp(){let e;if(lu()&&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 Ap){var n;let i=Ap===null||Ap===void 0||(n=Ap.hrtime)===null||n===void 0?void 0:n.call(Ap);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var lv={debug:lu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},hTt={enabled:!0,level:0};function ls(){}var Jye={},Qye={once:!0},gc=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};zt(this,"id",void 0),zt(this,"VERSION",J8),zt(this,"_startTs",Sp()),zt(this,"_deltaTs",Sp()),zt(this,"_storage",void 0),zt(this,"userData",{}),zt(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new Q8("__probe-".concat(this.id,"__"),hTt),this.timeStamp("".concat(this.id," started")),$ye(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((Sp()-this._startTs).toPrecision(10))}getDelta(){return Number((Sp()-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,Qye)}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,Qye)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ls,n&&[n],{tag:vTt(r)}):ls}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?lu()?gTt({image:i,message:a,scale:o}):mTt({image:i,message:a,scale:o}):ls}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||ls)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=Zye({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||ls)}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()>=exe(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=Zye({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,cv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=Sp();let o=a.tag||a.message;if(a.once&&o)if(!Jye[o])Jye[o]=Sp();else return ls;return r=pTt(this.id,a.message,a),n.bind(console,r,...a.args)}return ls}};zt(gc,"VERSION",J8);function exe(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 Zye(e){let{logLevel:t,message:r}=e;e.logLevel=exe(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 pTt(e,t,r){if(typeof t=="string"){let n=r.time?Kye(Vye(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=Yye(t,r.color,r.background)}return t}function mTt(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ls}function gTt(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=Z8(a,r,n);console.log(...o)},a.src=t,ls}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...Z8(t,r,n)),ls;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...Z8(a,r,n)),a.src=t.toDataURL(),ls}return ls}function vTt(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var c0r=new gc({id:"@probe.gl/log"});var W9=new gc({id:"loaders.gl"}),tC=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},rC=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 V9={fetch:null,mimeType:void 0,nothrow:!1,log:new rC,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:vn,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},txe={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 K9(){globalThis.loaders=globalThis.loaders||{};let{loaders:e}=globalThis;return e._state=e._state||{},e._state}function fv(){let e=K9();return e.globalOptions=e.globalOptions||{...V9},e.globalOptions}function ixe(e,t,r,n){return r=r||[],r=Array.isArray(r)?r:[r],bTt(e,r),xTt(t,e,n)}function bTt(e,t){rxe(e,null,V9,txe,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]||{};rxe(n,r.id,i,a,t)}}function rxe(e,t,r,n,i){let a=t||"Top level",o=t?`${t}.`:"";for(let s in e){let u=!t&&Ep(e[s]),c=s==="baseUri"&&!t,l=s==="workerUrl"&&t;if(!(s in r)&&!c&&!l){if(s in n)W9.warn(`${a} loader option '${o}${s}' no longer supported, use '${n[s]}'`)();else if(!u){let f=yTt(s,i);W9.warn(`${a} loader option '${o}${s}' not recognized. ${f}`)()}}}}function yTt(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 xTt(e,t,r){let i={...e.options||{}};return _Tt(i,r),i.log===null&&(i.log=new tC),nxe(i,fv()),nxe(i,t),i}function nxe(e,t){for(let r in t)if(r in t){let n=t[r];G9(n)&&G9(e[r])?e[r]={...e[r],...t[r]}:e[r]=t[r]}}function _Tt(e,t){t&&!("baseUri"in e)&&(e.baseUri=t)}function z1(e){return e?(Array.isArray(e)&&(e=e[0]),Array.isArray(e==null?void 0:e.extensions)):!1}function X9(e){Jt(e,"null loader"),Jt(z1(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 ETt=()=>{let e=K9();return e.loaderRegistry=e.loaderRegistry||[],e.loaderRegistry};function axe(){return ETt()}var oxe=new gc({id:"loaders.gl"});var wTt=/\.([^.]+)$/;async function cxe(e,t=[],r,n){if(!lxe(e))return null;let i=sxe(e,t,{...r,nothrow:!0},n);if(i)return i;if(cs(e)&&(e=await e.slice(0,10).arrayBuffer(),i=sxe(e,t,r,n)),!i&&!(r!=null&&r.nothrow))throw new Error(fxe(e));return i}function sxe(e,t=[],r,n){if(!lxe(e))return null;if(t&&!Array.isArray(t))return X9(t);let i=[];t&&(i=i.concat(t)),r!=null&&r.ignoreRegisteredLoaders||i.push(...axe()),STt(i);let a=ATt(e,i,r,n);if(!a&&!(r!=null&&r.nothrow))throw new Error(fxe(e));return a}function ATt(e,t,r,n){let i=wp(e),a=G1(e),o=sv(i)||(n==null?void 0:n.url),s=null,u="";return r!=null&&r.mimeType&&(s=Y9(t,r==null?void 0:r.mimeType),u=`match forced by supplied MIME type ${r==null?void 0:r.mimeType}`),s=s||TTt(t,o),u=u||(s?`matched url ${o}`:""),s=s||Y9(t,a),u=u||(s?`matched MIME type ${a}`:""),s=s||DTt(t,e),u=u||(s?`matched initial data ${dxe(e)}`:""),r!=null&&r.fallbackMimeType&&(s=s||Y9(t,r==null?void 0:r.fallbackMimeType),u=u||(s?`matched fallback MIME type ${a}`:"")),u&&oxe.log(1,`selectLoader selected ${s==null?void 0:s.name}: ${u}.`),s}function lxe(e){return!(e instanceof Response&&e.status===204)}function fxe(e){let t=wp(e),r=G1(e),n="No valid loader found (";n+=t?`${eu.filename(t)}, `:"no url provided, ",n+=`MIME type: ${r?`"${r}"`:"not provided"}, `;let i=e?dxe(e):"";return n+=i?` first bytes: "${i}"`:"first bytes: not available",n+=")",n}function STt(e){for(let t of e)X9(t)}function TTt(e,t){let r=t&&wTt.exec(t),n=r&&r[1];return n?CTt(e,n):null}function CTt(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 Y9(e,t){for(let r of e)if(r.mimeTypes&&r.mimeTypes.includes(t)||t===`application/x.${r.id}`)return r;return null}function DTt(e,t){if(!t)return null;for(let r of e)if(typeof t=="string"){if(FTt(t,r))return r}else if(ArrayBuffer.isView(t)){if(uxe(t.buffer,t.byteOffset,r))return r}else if(t instanceof ArrayBuffer&&uxe(t,0,r))return r;return null}function FTt(e,t){return t.testText?t.testText(e):(Array.isArray(t.tests)?t.tests:[t.tests]).some(n=>e.startsWith(n))}function uxe(e,t,r){return(Array.isArray(r.tests)?r.tests:[r.tests]).some(i=>BTt(e,t,r,i))}function BTt(e,t,r,n){if(n instanceof ArrayBuffer)return Zu(n,e,n.byteLength);switch(typeof n){case"function":return n(e);case"string":let i=$9(e,t,n.length);return n===i;default:return!1}}function dxe(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?$9(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?$9(e,0,t):""}function $9(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*hxe(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*pxe(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*mxe(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 J9(e,t){return vn?RTt(e,t):OTt(e,t)}async function*RTt(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*OTt(e,t){for await(let r of e)yield fl(r)}function gxe(e,t){if(typeof e=="string")return hxe(e,t);if(e instanceof ArrayBuffer)return pxe(e,t);if(cs(e))return mxe(e,t);if(Y8(e))return J9(e,t);if(us(e))return J9(e.body,t);throw new Error("makeIterator")}var vxe="Cannot convert supplied data type";function kTt(e,t,r){if(t.text&&typeof e=="string")return e;if(Nye(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(vxe)}async function bxe(e,t,r){let n=e instanceof ArrayBuffer||ArrayBuffer.isView(e);if(typeof e=="string"||n)return kTt(e,t,r);if(cs(e)&&(e=await $8(e)),us(e)){let i=e;return await Wye(i),t.binary?await i.arrayBuffer():await i.text()}if(Y8(e)&&(e=gxe(e,r)),Mye(e)||qye(e))return Hh(e);throw new Error(vxe)}function nC(e,t){let r=fv(),n=e||r;return typeof n.fetch=="function"?n.fetch:Ep(n.fetch)?i=>Fo(i,n.fetch):t!=null&&t.fetch?t==null?void 0:t.fetch:Fo}function yxe(e,t,r){if(r)return r;let n={fetch:nC(t,e),...e};if(n.url){let i=sv(n.url);n.baseUrl=i,n.queryString=zye(n.url),n.filename=eu.filename(i),n.baseUrl=eu.dirname(i)}return Array.isArray(n.loaders)||(n.loaders=null),n}function xxe(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)&&!z1(t)&&(n=void 0,r=t,t=void 0),e=await e,r=r||{};let i=wp(e),o=xxe(t,n),s=await cxe(e,o,r);return s?(r=ixe(r,s,o,i),n=yxe({url:i,_parse:Bo,loaders:o},r,n||null),await ITt(s,e,r,n)):null}async function ITt(e,t,r,n){if(PI(e),r=FI(e.options,r),us(t)){let a=t,{ok:o,redirected:s,status:u,statusText:c,type:l,url:f}=a,d=Object.fromEntries(a.headers.entries());n.response={headers:d,ok:o,redirected:s,status:u,statusText:c,type:l,url:f}}t=await bxe(t,e,r);let i=e;if(i.parseTextSync&&typeof t=="string")return i.parseTextSync(t,r,n);if(qI(e,r))return await NI(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 ha(!i.parseSync),new Error(`${e.id} loader - no parser found and worker is disabled`)}async function mn(e,t,r,n){let i,a;!Array.isArray(t)&&!z1(t)?(i=[],a=t,n=void 0):(i=t,a=r);let o=nC(a),s=e;return typeof e=="string"&&(s=await o(e)),cs(e)&&(s=await o(e)),Array.isArray(i)?await Bo(s,i,a):await Bo(s,i,a)}async function dv(e,t,r){if(r={...fv(),...r},UI(t,r))return await II(t,e,r);if(t.encode)return await t.encode(e,r);if(t.encodeSync)return t.encodeSync(e,r);if(t.encodeText)return new TextEncoder().encode(await t.encodeText(e,r));if(t.encodeInBatches){let i=Exe(e,t,r),a=[];for await(let o of i)a.push(o);return ec(...a)}if(!vn&&t.encodeURLtoURL){let i=_xe("input");await new Wh(i,"w").write(e);let o=_xe("output"),s=await wxe(i,o,t,r);return(await Fo(s)).arrayBuffer()}throw new Error("Writer could not encode data")}function iC(e,t,r){if(t.encodeSync)return t.encodeSync(e,r);throw new Error("Writer could not synchronously encode data")}function Exe(e,t,r){if(t.encodeInBatches){let n=PTt(e);return t.encodeInBatches(n,r)}throw new Error("Writer could not encode data in batches")}async function wxe(e,t,r,n){if(e=tc(e),t=tc(t),vn||!r.encodeURLtoURL)throw new Error;return await r.encodeURLtoURL(e,t,n)}function PTt(e){return[{...e,start:0,end:e.length}]}function _xe(e){return`/tmp/${e}`}var jTt=1/Math.PI*180,LTt=1/180*Math.PI,MTt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...MTt}};var Sn=globalThis.mathgl.config;function Q9(e,{precision:t=Sn.precision}={}){return e=qTt(e),"".concat(parseFloat(e.toPrecision(t)))}function fs(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Z9(e){return Axe(e)}function e7(e){return Cl(e)}function Axe(e,t){return r7(e,r=>r*LTt,t)}function Cl(e,t){return r7(e,r=>r*jTt,t)}function t7(e,t,r){return r7(e,n=>Math.max(t,Math.min(r,n)))}function Ro(e,t,r){let n=Sn.EPSILON;r&&(Sn.EPSILON=r);try{if(e===t)return!0;if(fs(e)&&fs(t)){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(!Ro(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 qTt(e){return Math.round(e/Sn.EPSILON)*Sn.EPSILON}function NTt(e){return e.clone?e.clone():new Array(e.length)}function r7(e,t,r){if(fs(e)){let n=e;r=r||NTt(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 UTt(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 bd=class extends UTt(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:fs(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?", ":"")+Q9(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(!Ro(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 GTt(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 yd(e,t,r=""){if(Sn.debug&&!GTt(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function na(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var xd=class extends bd{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 na(t>=0&&t<this.ELEMENTS,"index is out of range"),Ar(this[t])}setComponent(t,r){return na(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 Ln=typeof Float32Array<"u"?Float32Array:Array,H1=Math.random;function hv(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var $mr=Math.PI/180;function zTt(){let e=new Ln(2);return Ln!=Float32Array&&(e[0]=0,e[1]=0),e}function Sxe(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 Txe(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 aC(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 oC(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 Jmr=function(){let e=zTt();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 sC(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 uC(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 Cxe(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 Dxe(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 cC(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 Tp=class extends xd{constructor(t=0,r=0){super(2),fs(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 oC(this,this,t),this.check()}transformAsVector(t){return sC(this,this,t),this.check()}transformByMatrix3(t){return aC(this,this,t),this.check()}transformByMatrix2x3(t){return Txe(this,this,t),this.check()}transformByMatrix2(t){return Sxe(this,this,t),this.check()}};var mv={};ca(mv,{add:()=>KTt,angle:()=>s7,bezier:()=>o6t,ceil:()=>XTt,clone:()=>HTt,copy:()=>WTt,create:()=>lC,cross:()=>Cp,dist:()=>m6t,distance:()=>kxe,div:()=>p6t,divide:()=>Oxe,dot:()=>W1,equals:()=>f6t,exactEquals:()=>l6t,floor:()=>YTt,forEach:()=>b6t,fromValues:()=>fC,hermite:()=>a6t,inverse:()=>r6t,len:()=>u7,length:()=>Fxe,lerp:()=>n6t,max:()=>JTt,min:()=>$Tt,mul:()=>h6t,multiply:()=>Rxe,negate:()=>t6t,normalize:()=>n7,random:()=>s6t,rotateX:()=>i7,rotateY:()=>a7,rotateZ:()=>o7,round:()=>QTt,scale:()=>ZTt,scaleAndAdd:()=>e6t,set:()=>VTt,slerp:()=>i6t,sqrDist:()=>g6t,sqrLen:()=>v6t,squaredDistance:()=>Ixe,squaredLength:()=>Pxe,str:()=>c6t,sub:()=>d6t,subtract:()=>Bxe,transformMat3:()=>V1,transformMat4:()=>Dp,transformQuat:()=>K1,zero:()=>u6t});function lC(){let e=new Ln(3);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function HTt(e){let t=new Ln(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Fxe(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function fC(e,t,r){let n=new Ln(3);return n[0]=e,n[1]=t,n[2]=r,n}function WTt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function VTt(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function KTt(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function Bxe(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function Rxe(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function Oxe(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function XTt(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function YTt(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function $Tt(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 JTt(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 QTt(e,t){return e[0]=hv(t[0]),e[1]=hv(t[1]),e[2]=hv(t[2]),e}function ZTt(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function e6t(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 kxe(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 Ixe(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 Pxe(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function t6t(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function r6t(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function n7(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 W1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Cp(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 n6t(e,t,r,n){let i=t[0],a=t[1],o=t[2];return e[0]=i+n*(r[0]-i),e[1]=a+n*(r[1]-a),e[2]=o+n*(r[2]-o),e}function i6t(e,t,r,n){let i=Math.acos(Math.min(Math.max(W1(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 a6t(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 o6t(e,t,r,n,i,a){let o=1-a,s=o*o,u=a*a,c=s*o,l=3*a*s,f=3*u*o,d=u*a;return e[0]=t[0]*c+r[0]*l+n[0]*f+i[0]*d,e[1]=t[1]*c+r[1]*l+n[1]*f+i[1]*d,e[2]=t[2]*c+r[2]*l+n[2]*f+i[2]*d,e}function s6t(e,t){t=t===void 0?1:t;let r=H1()*2*Math.PI,n=H1()*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 Dp(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 V1(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 K1(e,t,r){let n=r[0],i=r[1],a=r[2],o=r[3],s=t[0],u=t[1],c=t[2],l=i*c-a*u,f=a*s-n*c,d=n*u-i*s,h=i*d-a*f,p=a*l-n*d,b=n*f-i*l,g=o*2;return l*=g,f*=g,d*=g,h*=2,p*=2,b*=2,e[0]=s+l+h,e[1]=u+f+p,e[2]=c+d+b,e}function i7(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 a7(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 o7(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 s7(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&&W1(e,t)/u;return Math.acos(Math.min(Math.max(c,-1),1))}function u6t(e){return e[0]=0,e[1]=0,e[2]=0,e}function c6t(e){return"vec3(".concat(e[0],", ").concat(e[1],", ").concat(e[2],")")}function l6t(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function f6t(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 d6t=Bxe,h6t=Rxe,p6t=Oxe,m6t=kxe,g6t=Ixe,u7=Fxe,v6t=Pxe,b6t=function(){let e=lC();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 c7=[0,0,0],dC,ce=class extends xd{static get ZERO(){return dC||(dC=new ce(0,0,0),Object.freeze(dC)),dC}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&fs(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 s7(this,t)}cross(t){return Cp(this,this,t),this.check()}rotateX({radians:t,origin:r=c7}){return i7(this,this,r,t),this.check()}rotateY({radians:t,origin:r=c7}){return a7(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=c7}){return o7(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Dp(this,this,t),this.check()}transformAsVector(t){return uC(this,this,t),this.check()}transformByMatrix3(t){return V1(this,this,t),this.check()}transformByMatrix2(t){return Cxe(this,this,t),this.check()}transformByQuaternion(t){return K1(this,this,t),this.check()}};var hC,ds=class extends xd{static get ZERO(){return hC||(hC=new ds(0,0,0,0),Object.freeze(hC)),hC}constructor(t=0,r=0,n=0,i=0){super(-0,-0,-0,-0),fs(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 Dp(this,this,t),this.check()}transformByMatrix3(t){return cC(this,this,t),this.check()}transformByMatrix2(t){return Dxe(this,this,t),this.check()}transformByQuaternion(t){return K1(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var gv=class extends bd{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 jxe(){let e=new Ln(9);return Ln!=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 Lxe(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 Mxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=l*o-s*c,d=-l*a+s*u,h=c*a-o*u,p=r*f+n*d+i*h;return p?(p=1/p,e[0]=f*p,e[1]=(-l*n+i*c)*p,e[2]=(s*n-i*o)*p,e[3]=d*p,e[4]=(l*r-i*u)*p,e[5]=(-s*r+i*a)*p,e[6]=h*p,e[7]=(-c*r+n*u)*p,e[8]=(o*r-n*a)*p,e):null}function qxe(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 l7(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],h=r[1],p=r[2],b=r[3],g=r[4],x=r[5],w=r[6],S=r[7],F=r[8];return e[0]=d*n+h*o+p*c,e[1]=d*i+h*s+p*l,e[2]=d*a+h*u+p*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]=w*n+S*o+F*c,e[7]=w*i+S*s+F*l,e[8]=w*a+S*u+F*f,e}function Nxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=r[0],h=r[1];return e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=u,e[6]=d*n+h*o+c,e[7]=d*i+h*s+l,e[8]=d*a+h*u+f,e}function Uxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=Math.sin(r),h=Math.cos(r);return e[0]=h*n+d*o,e[1]=h*i+d*s,e[2]=h*a+d*u,e[3]=h*o-d*n,e[4]=h*s-d*i,e[5]=h*u-d*a,e[6]=c,e[7]=l,e[8]=f,e}function f7(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 Gxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,h=i*s,p=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-p,e[3]=l-x,e[6]=d+g,e[1]=l+x,e[4]=1-c-p,e[7]=h-b,e[2]=d-g,e[5]=h+b,e[8]=1-c-f,e}var d7;(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"})(d7||(d7={}));var x6t=Object.freeze([1,0,0,0,1,0,0,0,1]),Pr=class extends gv{static get IDENTITY(){return E6t()}static get ZERO(){return _6t()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return d7}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(x6t)}fromObject(t){return this.check()}fromQuaternion(t){return Gxe(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 qxe(this)}transpose(){return Lxe(this,this),this.check()}invert(){return Mxe(this,this),this.check()}multiplyLeft(t){return l7(this,t,this),this.check()}multiplyRight(t){return l7(this,this,t),this.check()}rotate(t){return Uxe(this,this,t),this.check()}scale(t){return Array.isArray(t)?f7(this,this,t):f7(this,this,[t,t]),this.check()}translate(t){return Nxe(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=aC(r||[-0,-0],t,this);break;case 3:n=V1(r||[-0,-0,-0],t,this);break;case 4:n=cC(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yd(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)}},pC,mC=null;function _6t(){return pC||(pC=new Pr([0,0,0,0,0,0,0,0,0]),Object.freeze(pC)),pC}function E6t(){return mC||(mC=new Pr,Object.freeze(mC)),mC}var gC={};ca(gC,{add:()=>K6t,adjoint:()=>D6t,clone:()=>A6t,copy:()=>S6t,create:()=>w6t,decompose:()=>M6t,determinant:()=>m7,equals:()=>J6t,exactEquals:()=>$6t,frob:()=>V6t,fromQuat:()=>E7,fromQuat2:()=>P6t,fromRotation:()=>R6t,fromRotationTranslation:()=>Hxe,fromRotationTranslationScale:()=>q6t,fromRotationTranslationScaleOrigin:()=>N6t,fromScaling:()=>B6t,fromTranslation:()=>F6t,fromValues:()=>T6t,fromXRotation:()=>O6t,fromYRotation:()=>k6t,fromZRotation:()=>I6t,frustum:()=>w7,getRotation:()=>L6t,getScaling:()=>Wxe,getTranslation:()=>j6t,identity:()=>zxe,invert:()=>p7,lookAt:()=>T7,mul:()=>Q6t,multiply:()=>X1,multiplyScalar:()=>X6t,multiplyScalarAndAdd:()=>Y6t,ortho:()=>S7,orthoNO:()=>Kxe,orthoZO:()=>z6t,perspective:()=>A7,perspectiveFromFieldOfView:()=>G6t,perspectiveNO:()=>Vxe,perspectiveZO:()=>U6t,rotate:()=>b7,rotateX:()=>y7,rotateY:()=>x7,rotateZ:()=>_7,scale:()=>v7,set:()=>C6t,str:()=>W6t,sub:()=>Z6t,subtract:()=>Xxe,targetTo:()=>H6t,translate:()=>g7,transpose:()=>h7});function w6t(){let e=new Ln(16);return Ln!=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 A6t(e){let t=new Ln(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 S6t(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 T6t(e,t,r,n,i,a,o,s,u,c,l,f,d,h,p,b){let g=new Ln(16);return g[0]=e,g[1]=t,g[2]=r,g[3]=n,g[4]=i,g[5]=a,g[6]=o,g[7]=s,g[8]=u,g[9]=c,g[10]=l,g[11]=f,g[12]=d,g[13]=h,g[14]=p,g[15]=b,g}function C6t(e,t,r,n,i,a,o,s,u,c,l,f,d,h,p,b,g){return e[0]=t,e[1]=r,e[2]=n,e[3]=i,e[4]=a,e[5]=o,e[6]=s,e[7]=u,e[8]=c,e[9]=l,e[10]=f,e[11]=d,e[12]=h,e[13]=p,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 h7(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 p7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],h=t[11],p=t[12],b=t[13],g=t[14],x=t[15],w=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,B=i*c-a*u,N=l*b-f*p,C=l*g-d*p,k=l*x-h*p,I=f*g-d*b,U=f*x-h*b,Y=d*x-h*g,$=w*Y-S*U+F*I+D*k-j*C+B*N;return $?($=1/$,e[0]=(s*Y-u*U+c*I)*$,e[1]=(i*U-n*Y-a*I)*$,e[2]=(b*B-g*j+x*D)*$,e[3]=(d*j-f*B-h*D)*$,e[4]=(u*k-o*Y-c*C)*$,e[5]=(r*Y-i*k+a*C)*$,e[6]=(g*F-p*B-x*S)*$,e[7]=(l*B-d*F+h*S)*$,e[8]=(o*U-s*k+c*N)*$,e[9]=(n*k-r*U-a*N)*$,e[10]=(p*j-b*F+x*w)*$,e[11]=(f*F-l*j-h*w)*$,e[12]=(s*C-o*I-u*N)*$,e[13]=(r*I-n*C+i*N)*$,e[14]=(b*S-p*D-g*w)*$,e[15]=(l*D-f*S+d*w)*$,e):null}function D6t(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=t[4],s=t[5],u=t[6],c=t[7],l=t[8],f=t[9],d=t[10],h=t[11],p=t[12],b=t[13],g=t[14],x=t[15],w=r*s-n*o,S=r*u-i*o,F=r*c-a*o,D=n*u-i*s,j=n*c-a*s,B=i*c-a*u,N=l*b-f*p,C=l*g-d*p,k=l*x-h*p,I=f*g-d*b,U=f*x-h*b,Y=d*x-h*g;return e[0]=s*Y-u*U+c*I,e[1]=i*U-n*Y-a*I,e[2]=b*B-g*j+x*D,e[3]=d*j-f*B-h*D,e[4]=u*k-o*Y-c*C,e[5]=r*Y-i*k+a*C,e[6]=g*F-p*B-x*S,e[7]=l*B-d*F+h*S,e[8]=o*U-s*k+c*N,e[9]=n*k-r*U-a*N,e[10]=p*j-b*F+x*w,e[11]=f*F-l*j-h*w,e[12]=s*C-o*I-u*N,e[13]=r*I-n*C+i*N,e[14]=b*S-p*D-g*w,e[15]=l*D-f*S+d*w,e}function m7(e){let t=e[0],r=e[1],n=e[2],i=e[3],a=e[4],o=e[5],s=e[6],u=e[7],c=e[8],l=e[9],f=e[10],d=e[11],h=e[12],p=e[13],b=e[14],g=e[15],x=t*o-r*a,w=t*s-n*a,S=r*s-n*o,F=c*p-l*h,D=c*b-f*h,j=l*b-f*p,B=t*j-r*D+n*F,N=a*j-o*D+s*F,C=c*S-l*w+f*x,k=h*S-p*w+b*x;return u*B-i*N+g*C-d*k}function X1(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],c=t[6],l=t[7],f=t[8],d=t[9],h=t[10],p=t[11],b=t[12],g=t[13],x=t[14],w=t[15],S=r[0],F=r[1],D=r[2],j=r[3];return e[0]=S*n+F*s+D*f+j*b,e[1]=S*i+F*u+D*d+j*g,e[2]=S*a+F*c+D*h+j*x,e[3]=S*o+F*l+D*p+j*w,S=r[4],F=r[5],D=r[6],j=r[7],e[4]=S*n+F*s+D*f+j*b,e[5]=S*i+F*u+D*d+j*g,e[6]=S*a+F*c+D*h+j*x,e[7]=S*o+F*l+D*p+j*w,S=r[8],F=r[9],D=r[10],j=r[11],e[8]=S*n+F*s+D*f+j*b,e[9]=S*i+F*u+D*d+j*g,e[10]=S*a+F*c+D*h+j*x,e[11]=S*o+F*l+D*p+j*w,S=r[12],F=r[13],D=r[14],j=r[15],e[12]=S*n+F*s+D*f+j*b,e[13]=S*i+F*u+D*d+j*g,e[14]=S*a+F*c+D*h+j*x,e[15]=S*o+F*l+D*p+j*w,e}function g7(e,t,r){let n=r[0],i=r[1],a=r[2],o,s,u,c,l,f,d,h,p,b,g,x;return t===e?(e[12]=t[0]*n+t[4]*i+t[8]*a+t[12],e[13]=t[1]*n+t[5]*i+t[9]*a+t[13],e[14]=t[2]*n+t[6]*i+t[10]*a+t[14],e[15]=t[3]*n+t[7]*i+t[11]*a+t[15]):(o=t[0],s=t[1],u=t[2],c=t[3],l=t[4],f=t[5],d=t[6],h=t[7],p=t[8],b=t[9],g=t[10],x=t[11],e[0]=o,e[1]=s,e[2]=u,e[3]=c,e[4]=l,e[5]=f,e[6]=d,e[7]=h,e[8]=p,e[9]=b,e[10]=g,e[11]=x,e[12]=o*n+l*i+p*a+t[12],e[13]=s*n+f*i+b*a+t[13],e[14]=u*n+d*i+g*a+t[14],e[15]=c*n+h*i+x*a+t[15]),e}function v7(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 b7(e,t,r,n){let i=n[0],a=n[1],o=n[2],s=Math.sqrt(i*i+a*a+o*o),u,c,l,f,d,h,p,b,g,x,w,S,F,D,j,B,N,C,k,I,U,Y,$,re;return s<1e-6?null:(s=1/s,i*=s,a*=s,o*=s,c=Math.sin(r),u=Math.cos(r),l=1-u,f=t[0],d=t[1],h=t[2],p=t[3],b=t[4],g=t[5],x=t[6],w=t[7],S=t[8],F=t[9],D=t[10],j=t[11],B=i*i*l+u,N=a*i*l+o*c,C=o*i*l-a*c,k=i*a*l-o*c,I=a*a*l+u,U=o*a*l+i*c,Y=i*o*l+a*c,$=a*o*l-i*c,re=o*o*l+u,e[0]=f*B+b*N+S*C,e[1]=d*B+g*N+F*C,e[2]=h*B+x*N+D*C,e[3]=p*B+w*N+j*C,e[4]=f*k+b*I+S*U,e[5]=d*k+g*I+F*U,e[6]=h*k+x*I+D*U,e[7]=p*k+w*I+j*U,e[8]=f*Y+b*$+S*re,e[9]=d*Y+g*$+F*re,e[10]=h*Y+x*$+D*re,e[11]=p*Y+w*$+j*re,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function y7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[4],o=t[5],s=t[6],u=t[7],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*i+c*n,e[5]=o*i+l*n,e[6]=s*i+f*n,e[7]=u*i+d*n,e[8]=c*i-a*n,e[9]=l*i-o*n,e[10]=f*i-s*n,e[11]=d*i-u*n,e}function x7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[8],l=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i-c*n,e[1]=o*i-l*n,e[2]=s*i-f*n,e[3]=u*i-d*n,e[8]=a*n+c*i,e[9]=o*n+l*i,e[10]=s*n+f*i,e[11]=u*n+d*i,e}function _7(e,t,r){let n=Math.sin(r),i=Math.cos(r),a=t[0],o=t[1],s=t[2],u=t[3],c=t[4],l=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*i+c*n,e[1]=o*i+l*n,e[2]=s*i+f*n,e[3]=u*i+d*n,e[4]=c*i-a*n,e[5]=l*i-o*n,e[6]=f*i-s*n,e[7]=d*i-u*n,e}function F6t(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 B6t(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 R6t(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 O6t(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 k6t(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 I6t(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 Hxe(e,t,r){let n=t[0],i=t[1],a=t[2],o=t[3],s=n+n,u=i+i,c=a+a,l=n*s,f=n*u,d=n*c,h=i*u,p=i*c,b=a*c,g=o*s,x=o*u,w=o*c;return e[0]=1-(h+b),e[1]=f+w,e[2]=d-x,e[3]=0,e[4]=f-w,e[5]=1-(l+b),e[6]=p+g,e[7]=0,e[8]=d+x,e[9]=p-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 P6t(e,t){let r=new Ln(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),Hxe(e,t,r),e}function j6t(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Wxe(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 L6t(e,t){let r=new Ln(3);Wxe(r,t);let n=1/r[0],i=1/r[1],a=1/r[2],o=t[0]*n,s=t[1]*i,u=t[2]*a,c=t[4]*n,l=t[5]*i,f=t[6]*a,d=t[8]*n,h=t[9]*i,p=t[10]*a,b=o+l+p,g=0;return b>0?(g=Math.sqrt(b+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(d-u)/g,e[2]=(s-c)/g):o>l&&o>p?(g=Math.sqrt(1+o-l-p)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(d+u)/g):l>p?(g=Math.sqrt(1+l-o-p)*2,e[3]=(d-u)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+p-o-l)*2,e[3]=(s-c)/g,e[0]=(d+u)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function M6t(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let i=n[0],a=n[1],o=n[2],s=n[4],u=n[5],c=n[6],l=n[8],f=n[9],d=n[10];r[0]=Math.sqrt(i*i+a*a+o*o),r[1]=Math.sqrt(s*s+u*u+c*c),r[2]=Math.sqrt(l*l+f*f+d*d);let h=1/r[0],p=1/r[1],b=1/r[2],g=i*h,x=a*p,w=o*b,S=s*h,F=u*p,D=c*b,j=l*h,B=f*p,N=d*b,C=g+F+N,k=0;return C>0?(k=Math.sqrt(C+1)*2,e[3]=.25*k,e[0]=(D-B)/k,e[1]=(j-w)/k,e[2]=(x-S)/k):g>F&&g>N?(k=Math.sqrt(1+g-F-N)*2,e[3]=(D-B)/k,e[0]=.25*k,e[1]=(x+S)/k,e[2]=(j+w)/k):F>N?(k=Math.sqrt(1+F-g-N)*2,e[3]=(j-w)/k,e[0]=(x+S)/k,e[1]=.25*k,e[2]=(D+B)/k):(k=Math.sqrt(1+N-g-F)*2,e[3]=(x-S)/k,e[0]=(j+w)/k,e[1]=(D+B)/k,e[2]=.25*k),e}function q6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=i+i,c=a+a,l=o+o,f=i*u,d=i*c,h=i*l,p=a*c,b=a*l,g=o*l,x=s*u,w=s*c,S=s*l,F=n[0],D=n[1],j=n[2];return e[0]=(1-(p+g))*F,e[1]=(d+S)*F,e[2]=(h-w)*F,e[3]=0,e[4]=(d-S)*D,e[5]=(1-(f+g))*D,e[6]=(b+x)*D,e[7]=0,e[8]=(h+w)*j,e[9]=(b-x)*j,e[10]=(1-(f+p))*j,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function N6t(e,t,r,n,i){let a=t[0],o=t[1],s=t[2],u=t[3],c=a+a,l=o+o,f=s+s,d=a*c,h=a*l,p=a*f,b=o*l,g=o*f,x=s*f,w=u*c,S=u*l,F=u*f,D=n[0],j=n[1],B=n[2],N=i[0],C=i[1],k=i[2],I=(1-(b+x))*D,U=(h+F)*D,Y=(p-S)*D,$=(h-F)*j,re=(1-(d+x))*j,ee=(g+w)*j,ge=(p+S)*B,ye=(g-w)*B,he=(1-(d+b))*B;return e[0]=I,e[1]=U,e[2]=Y,e[3]=0,e[4]=$,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-(I*N+$*C+ge*k),e[13]=r[1]+C-(U*N+re*C+ye*k),e[14]=r[2]+k-(Y*N+ee*C+he*k),e[15]=1,e}function E7(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r+r,s=n+n,u=i+i,c=r*o,l=n*o,f=n*s,d=i*o,h=i*s,p=i*u,b=a*o,g=a*s,x=a*u;return e[0]=1-f-p,e[1]=l+x,e[2]=d-g,e[3]=0,e[4]=l-x,e[5]=1-c-p,e[6]=h+b,e[7]=0,e[8]=d+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 w7(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 Vxe(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 A7=Vxe;function U6t(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 G6t(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 Kxe(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 S7=Kxe;function z6t(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 T7(e,t,r,n){let i,a,o,s,u,c,l,f,d,h,p=t[0],b=t[1],g=t[2],x=n[0],w=n[1],S=n[2],F=r[0],D=r[1],j=r[2];return Math.abs(p-F)<1e-6&&Math.abs(b-D)<1e-6&&Math.abs(g-j)<1e-6?zxe(e):(f=p-F,d=b-D,h=g-j,i=1/Math.sqrt(f*f+d*d+h*h),f*=i,d*=i,h*=i,a=w*h-S*d,o=S*f-x*h,s=x*d-w*f,i=Math.sqrt(a*a+o*o+s*s),i?(i=1/i,a*=i,o*=i,s*=i):(a=0,o=0,s=0),u=d*s-h*o,c=h*a-f*s,l=f*o-d*a,i=Math.sqrt(u*u+c*c+l*l),i?(i=1/i,u*=i,c*=i,l*=i):(u=0,c=0,l=0),e[0]=a,e[1]=u,e[2]=f,e[3]=0,e[4]=o,e[5]=c,e[6]=d,e[7]=0,e[8]=s,e[9]=l,e[10]=h,e[11]=0,e[12]=-(a*p+o*b+s*g),e[13]=-(u*p+c*b+l*g),e[14]=-(f*p+d*b+h*g),e[15]=1,e)}function H6t(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=n[0],u=n[1],c=n[2],l=i-r[0],f=a-r[1],d=o-r[2],h=l*l+f*f+d*d;h>0&&(h=1/Math.sqrt(h),l*=h,f*=h,d*=h);let p=u*d-c*f,b=c*l-s*d,g=s*f-u*l;return h=p*p+b*b+g*g,h>0&&(h=1/Math.sqrt(h),p*=h,b*=h,g*=h),e[0]=p,e[1]=b,e[2]=g,e[3]=0,e[4]=f*g-d*b,e[5]=d*p-l*g,e[6]=l*b-f*p,e[7]=0,e[8]=l,e[9]=f,e[10]=d,e[11]=0,e[12]=i,e[13]=a,e[14]=o,e[15]=1,e}function W6t(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 V6t(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 K6t(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 Xxe(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 X6t(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 Y6t(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 $6t(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 J6t(e,t){let r=e[0],n=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],c=e[7],l=e[8],f=e[9],d=e[10],h=e[11],p=e[12],b=e[13],g=e[14],x=e[15],w=t[0],S=t[1],F=t[2],D=t[3],j=t[4],B=t[5],N=t[6],C=t[7],k=t[8],I=t[9],U=t[10],Y=t[11],$=t[12],re=t[13],ee=t[14],ge=t[15];return Math.abs(r-w)<=1e-6*Math.max(1,Math.abs(r),Math.abs(w))&&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-B)<=1e-6*Math.max(1,Math.abs(s),Math.abs(B))&&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-k)<=1e-6*Math.max(1,Math.abs(l),Math.abs(k))&&Math.abs(f-I)<=1e-6*Math.max(1,Math.abs(f),Math.abs(I))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(h-Y)<=1e-6*Math.max(1,Math.abs(h),Math.abs(Y))&&Math.abs(p-$)<=1e-6*Math.max(1,Math.abs(p),Math.abs($))&&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 Q6t=X1,Z6t=Xxe;function e3t(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function Yxe(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 $xe(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 Jxe(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 Qxe(e){let t=e[0],r=e[1],n=e[2],i=e[3];return t*t+r*r+n*n+i*i}function Zxe(e,t){let r=t[0],n=t[1],i=t[2],a=t[3],o=r*r+n*n+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),e[0]=r*o,e[1]=n*o,e[2]=i*o,e[3]=a*o,e}function e1e(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function t1e(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 r1e(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 n1e(e,t,r){let n=t[0],i=t[1],a=t[2],o=r[0],s=r[1],u=r[2],c=r[3],l=c*n+s*a-u*i,f=c*i+u*n-o*a,d=c*a+o*i-s*n,h=-o*n-s*i-u*a;return e[0]=l*c+h*-o+f*-u-d*-s,e[1]=f*c+h*-s+d*-o-l*-u,e[2]=d*c+h*-u+l*-s-f*-o,e[3]=t[3],e}var Fgr=function(){let e=e3t();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 F7;(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"})(F7||(F7={}));var r3t=45*Math.PI/180,n3t=1,C7=.1,D7=500,i3t=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 o3t()}static get ZERO(){return a3t()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return F7}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,i,a,o,s,u,c,l,f,d,h,p,b,g){return this[0]=t,this[1]=r,this[2]=n,this[3]=i,this[4]=a,this[5]=o,this[6]=s,this[7]=u,this[8]=c,this[9]=l,this[10]=f,this[11]=d,this[12]=h,this[13]=p,this[14]=b,this[15]=g,this.check()}setRowMajor(t,r,n,i,a,o,s,u,c,l,f,d,h,p,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]=p,this[8]=n,this[9]=s,this[10]=f,this[11]=b,this[12]=i,this[13]=u,this[14]=d,this[15]=g,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(i3t)}fromObject(t){return this.check()}fromQuaternion(t){return E7(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:i,top:a,near:o=C7,far:s=D7}=t;return s===1/0?s3t(this,r,n,i,a,o):w7(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 T7(this,r,n,i),this.check()}ortho(t){let{left:r,right:n,bottom:i,top:a,near:o=C7,far:s=D7}=t;return S7(this,r,n,i,a,o,s),this.check()}orthographic(t){let{fovy:r=r3t,aspect:n=n3t,focalDistance:i=1,near:a=C7,far:o=D7}=t;i1e(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 i1e(r),A7(this,r,n,i,a),this.check()}determinant(){return m7(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 h7(this,this),this.check()}invert(){return p7(this,this),this.check()}multiplyLeft(t){return X1(this,t,this),this.check()}multiplyRight(t){return X1(this,this,t),this.check()}rotateX(t){return y7(this,this,t),this.check()}rotateY(t){return x7(this,this,t),this.check()}rotateZ(t){return _7(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return b7(this,this,t,r),this.check()}scale(t){return v7(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return g7(this,this,t),this.check()}transform(t,r){return t.length===4?(r=r1e(r||[-0,-0,-0,-0],t,this),yd(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,i;switch(n){case 2:i=oC(r||[-0,-0],t,this);break;case 3:i=Dp(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yd(i,t.length),i}transformAsVector(t,r){let n;switch(t.length){case 2:n=sC(r||[-0,-0],t,this);break;case 3:n=uC(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return yd(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])}},vC,bC;function a3t(){return vC||(vC=new Kr([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(vC)),vC}function o3t(){return bC||(bC=new Kr,Object.freeze(bC)),bC}function i1e(e){if(e>Math.PI*2)throw Error("expected radians")}function s3t(e,t,r,n,i,a){let o=2*a/(r-t),s=2*a/(i-n),u=(r+t)/(r-t),c=(i+n)/(i-n),l=-1,f=-1,d=-2*a;return e[0]=o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=u,e[9]=c,e[10]=l,e[11]=f,e[12]=0,e[13]=0,e[14]=d,e[15]=0,e}function a1e(){let e=new Ln(4);return Ln!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function o1e(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function B7(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 R7(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 s1e(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 u1e(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 c1e(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 l1e(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 Y1(e,t,r,n){let i=t[0],a=t[1],o=t[2],s=t[3],u=r[0],c=r[1],l=r[2],f=r[3],d,h,p,b,g;return d=i*u+a*c+o*l+s*f,d<0&&(d=-d,u=-u,c=-c,l=-l,f=-f),1-d>1e-6?(h=Math.acos(d),g=Math.sin(h),p=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(p=1-n,b=n),e[0]=p*i+b*u,e[1]=p*a+b*c,e[2]=p*o+b*l,e[3]=p*s+b*f,e}function f1e(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 d1e(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function O7(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 h1e=Yxe;var p1e=$xe,m1e=e1e,g1e=t1e,v1e=Jxe;var b1e=Qxe;var y1e=Zxe;var x1e=function(){let e=lC(),t=fC(1,0,0),r=fC(0,1,0);return function(n,i,a){let o=W1(i,a);return o<-.999999?(Cp(e,t,i),u7(e)<1e-6&&Cp(e,r,i),n7(e,e),B7(n,e,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Cp(e,i,a),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+o,y1e(n,n))}}(),zgr=function(){let e=a1e(),t=a1e();return function(r,n,i,a,o,s){return Y1(e,n,o,s),Y1(t,i,a,s),Y1(r,e,t,2*s*(1-s)),r}}(),Hgr=function(){let e=jxe();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],y1e(t,O7(t,e))}}();var u3t=[0,0,0,1],hs=class extends bd{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 O7(this,t),this.check()}fromAxisRotation(t,r){return B7(this,t,r),this.check()}identity(){return o1e(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 v1e(this)}lengthSquared(){return b1e(this)}dot(t){return m1e(this,t)}rotationTo(t,r){return x1e(this,t,r),this.check()}add(t){return h1e(this,this,t),this.check()}calculateW(){return l1e(this,this),this.check()}conjugate(){return d1e(this,this),this.check()}invert(){return f1e(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(g1e(this,t,r,n),this.check())}multiplyRight(t){return R7(this,this,t),this.check()}multiplyLeft(t){return R7(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 s1e(this,this,t),this.check()}rotateY(t){return u1e(this,this,t),this.check()}rotateZ(t){return c1e(this,this,t),this.check()}scale(t){return p1e(this,this,t),this.check()}slerp(t,r,n){let i,a,o;switch(arguments.length){case 1:({start:i=u3t,target:a,ratio:o}=t);break;case 2:i=this,a=t,o=r;break;default:i=t,a=r,o=n}return Y1(this,i,a,o),this.check()}transformVector4(t,r=new ds){return n1e(r,t,this),yd(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 fu={};ca(fu,{EPSILON1:()=>c3t,EPSILON10:()=>b3t,EPSILON11:()=>y3t,EPSILON12:()=>x3t,EPSILON13:()=>_3t,EPSILON14:()=>E3t,EPSILON15:()=>w3t,EPSILON16:()=>A3t,EPSILON17:()=>S3t,EPSILON18:()=>T3t,EPSILON19:()=>C3t,EPSILON2:()=>l3t,EPSILON20:()=>D3t,EPSILON3:()=>f3t,EPSILON4:()=>d3t,EPSILON5:()=>h3t,EPSILON6:()=>p3t,EPSILON7:()=>m3t,EPSILON8:()=>g3t,EPSILON9:()=>v3t,PI_OVER_FOUR:()=>B3t,PI_OVER_SIX:()=>R3t,PI_OVER_TWO:()=>F3t,TWO_PI:()=>O3t});var c3t=.1,l3t=.01,f3t=.001,d3t=1e-4,h3t=1e-5,p3t=1e-6,m3t=1e-7,g3t=1e-8,v3t=1e-9,b3t=1e-10,y3t=1e-11,x3t=1e-12,_3t=1e-13,E3t=1e-14,w3t=1e-15,A3t=1e-16,S3t=1e-17,T3t=1e-18,C3t=1e-19,D3t=1e-20,F3t=Math.PI/2,B3t=Math.PI/4,R3t=Math.PI/6,O3t=Math.PI*2;var Dl=6356752314245179e-9,k3t={radii:[6378137,6378137,Dl],radiiSquared:[6378137*6378137,6378137*6378137,Dl*Dl],oneOverRadii:[1/6378137,1/6378137,1/Dl],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(Dl*Dl)],maximumRadius:Math.max(6378137,6378137,Dl),centerToleranceSquared:.1};function yC(e){return e}var _vr=new ce;function I3t(e,t=[],r=yC){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 _1e(e,t=[]){return I3t(e,t,Sn._cartographicRadians?yC:Z9)}function P3t(e,t,r=yC){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 E1e(e,t){return P3t(e,t,Sn._cartographicRadians?yC:e7)}var w1e=1e-14,j3t=new ce,A1e={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"}},k7={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},$1={east:new ce,north:new ce,up:new ce,west:new ce,south:new ce,down:new ce},L3t=new ce,M3t=new ce,q3t=new ce;function I7(e,t,r,n,i,a){let o=A1e[t]&&A1e[t][r];na(o&&(!n||n===o));let s,u,c,l=j3t.copy(i);if(Ro(l.x,0,w1e)&&Ro(l.y,0,w1e)){let d=Math.sign(l.z);s=L3t.fromArray(k7[t]),t!=="east"&&t!=="west"&&s.scale(d),u=M3t.fromArray(k7[r]),r!=="east"&&r!=="west"&&u.scale(d),c=q3t.fromArray(k7[n]),n!=="east"&&n!=="west"&&c.scale(d)}else{let{up:d,east:h,north:p}=$1;h.set(-l.y,l.x,0).normalize(),e.geodeticSurfaceNormal(l,d),p.copy(d).cross(h);let{down:b,west:g,south:x}=$1;b.copy(d).scale(-1),g.copy(h).scale(-1),x.copy(p).scale(-1),s=$1[t],u=$1[r],c=$1[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,N3t=new ce,U3t=new ce;function S1e(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,d=o*o*c*c,h=s*s*l*l,p=u*u*f*f,b=d+h+p,g=Math.sqrt(1/b);if(!Number.isFinite(g))return;let x=N3t;if(x.copy(e).scale(g),b<a)return x.to(r);let w=i.x,S=i.y,F=i.z,D=U3t;D.set(x.x*w*2,x.y*S*2,x.z*F*2);let j=(1-g)*vv.len()/(.5*D.len()),B=0,N,C,k,I;do{j-=B,N=1/(1+j*w),C=1/(1+j*S),k=1/(1+j*F);let U=N*N,Y=C*C,$=k*k,re=U*N,ee=Y*C,ge=$*k;I=d*U+h*Y+p*$-1;let he=-2*(d*re*w+h*ee*S+p*ge*F);B=I/he}while(Math.abs(I)>fu.EPSILON12);return vv.scale([N,C,k]).to(r)}var xC=new ce,T1e=new ce,H3t=new ce,du=new ce,W3t=new ce,_C=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",fu.EPSILON1),zt(this,"squaredXOverSquaredZ",void 0),na(t>=0),na(r>=0),na(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=T1e,i=H3t,[,,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]){_C.from(t);let n=this.scaleToGeodeticSurface(_C,du);if(!n)return;let i=this.geodeticSurfaceNormal(n,T1e),a=W3t;a.copy(_C).subtract(n);let o=Math.atan2(i.y,i.x),s=Math.asin(i.z),u=Math.sign(mv.dot(a,_C))*mv.length(a);return E1e([o,s,u],r)}eastNorthUpToFixedFrame(t,r=new Kr){return I7(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,i,a=new Kr){return I7(this,t,r,n,i,a)}geocentricSurfaceNormal(t,r=[0,0,0]){return xC.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=_1e(t),i=n[0],a=n[1],o=Math.cos(a);return xC.set(o*Math.cos(i),o*Math.sin(i),Math.sin(a)).normalize(),xC.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return xC.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return S1e(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){du.from(t);let n=du.x,i=du.y,a=du.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(n*n*o.x+i*i*o.y+a*a*o.z);return du.multiplyScalar(s).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return du.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return du.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){na(Ro(this.radii.x,this.radii.y,fu.EPSILON15)),na(this.radii.z>0),du.from(t);let i=du.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(i)>=this.radii.z-r))return du.set(0,0,i).to(n)}};zt(or,"WGS84",new or(6378137,6378137,Dl));var ia={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var Gvr=new ce,zvr=new ce;var J1=new ce,C1e=new ce,Ya=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=J1.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 Ya(this.center,this.radius)}union(t){let r=this.center,n=this.radius,i=t.center,a=t.radius,o=J1.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 C1e.copy(o).scale((-n+u)/s).add(r),this.center.copy(C1e),this.radius=u,this}expand(t){let n=J1.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=gC.getScaling(J1,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=J1.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?ia.OUTSIDE:a<n?ia.INTERSECTING:ia.INSIDE}};var V3t=new ce,K3t=new ce,EC=new ce,wC=new ce,AC=new ce,X3t=new ce,Y3t=new ce,Fl={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},aa=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 Pr(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 hs().fromMatrix3(new Pr([...i,...a,...o]))}fromCenterHalfSizeQuaternion(t,r,n){let i=new hs(n),a=new Pr().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 aa(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Ya){let r=this.halfAxes,n=r.getColumn(0,EC),i=r.getColumn(1,wC),a=r.getColumn(2,AC),o=V3t.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[Fl.COLUMN0ROW0]+o*i[Fl.COLUMN0ROW1]+s*i[Fl.COLUMN0ROW2])+Math.abs(a*i[Fl.COLUMN1ROW0]+o*i[Fl.COLUMN1ROW1]+s*i[Fl.COLUMN1ROW2])+Math.abs(a*i[Fl.COLUMN2ROW0]+o*i[Fl.COLUMN2ROW1]+s*i[Fl.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-u?ia.OUTSIDE:c>=u?ia.INSIDE:ia.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=K3t.from(t).subtract(this.center),n=this.halfAxes,i=n.getColumn(0,EC),a=n.getColumn(1,wC),o=n.getColumn(2,AC),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,EC),c=s.getColumn(1,wC),l=s.getColumn(2,AC),f=X3t.copy(u).add(c).add(l).add(o),d=Y3t.copy(f).subtract(t),h=r.dot(d);return i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).add(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).add(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),f.copy(o).add(u).subtract(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).add(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).add(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).add(l),d.copy(f).subtract(t),h=r.dot(d),i=Math.min(h,i),a=Math.max(h,a),o.copy(f).subtract(u).subtract(c).subtract(l),d.copy(f).subtract(t),h=r.dot(d),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,EC);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,wC);n.transformAsPoint(t);let i=this.halfAxes.getColumn(2,AC);return i.transformAsPoint(t),this.halfAxes=new Pr([...r,...n,...i]),this}getTransform(){throw new Error("not implemented")}};var D1e=new ce,F1e=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 na(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=D1e.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),na(Ro(this.normal.len(),1)),this.distance=i,this}clone(){return new Bl(this.normal,this.distance)}equals(t){return Ro(this.distance,t.distance)&&Ro(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=F1e.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=D1e.from(t),i=this.getPointDistance(n),a=F1e.copy(this.normal).scale(i);return n.subtract(a).to(r)}};var B1e=[new ce([1,0,0]),new ce([0,1,0]),new ce([0,0,1])],R1e=new ce,$3t=new ce,ps=class{constructor(t=[]){zt(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*B1e.length;let r=t.center,n=t.radius,i=0;for(let a of B1e){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=R1e.copy(a).scale(-n).add(r);o.fromPointNormal(u,a);let c=R1e.copy(a).scale(n).add(r),l=$3t.copy(a).negate();s.fromPointNormal(c,l),i+=2}return this}computeVisibility(t){let r=ia.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ia.OUTSIDE:return ia.OUTSIDE;case ia.INTERSECTING:r=ia.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(na(Number.isFinite(r),"parentPlaneMask is required."),r===ps.MASK_OUTSIDE||r===ps.MASK_INSIDE)return r;let n=ps.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===ia.OUTSIDE)return ps.MASK_OUTSIDE;u===ia.INTERSECTING&&(n|=o)}return n}};zt(ps,"MASK_OUTSIDE",4294967295);zt(ps,"MASK_INSIDE",0);zt(ps,"MASK_INDETERMINATE",2147483647);var dbr=new ce,hbr=new ce,pbr=new ce,mbr=new ce,gbr=new ce;var Q3t=new ce,Z3t=new ce,e8t=new ce,t8t=new ce,r8t=new ce,n8t=new ce,i8t=new ce,bv=new ce,a8t=new ce,o8t=new ce,s8t=new ce,u8t=new ce;function P7(e,t=new Ya){if(!e||e.length===0)return t.fromCenterRadius([0,0,0],0);let r=i8t.copy(e[0]),n=Q3t.copy(r),i=Z3t.copy(r),a=e8t.copy(r),o=t8t.copy(r),s=r8t.copy(r),u=n8t.copy(r);for(let j of e){r.copy(j);let B=r.x,N=r.y,C=r.z;B<n.x&&n.copy(r),B>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(),d=n,h=o,p=c;l>p&&(p=l,d=i,h=s),f>p&&(p=f,d=a,h=u);let b=a8t;b.x=(d.x+h.x)*.5,b.y=(d.y+h.y)*.5,b.z=(d.z+h.z)*.5;let g=bv.copy(h).subtract(b).magnitudeSquared(),x=Math.sqrt(g),w=o8t;w.x=n.x,w.y=i.y,w.z=a.z;let S=s8t;S.x=o.x,S.y=s.y,S.z=u.z;let F=u8t.copy(w).add(S).multiplyByScalar(.5),D=0;for(let j of e){r.copy(j);let B=bv.copy(r).subtract(F).magnitude();B>D&&(D=B);let N=bv.copy(r).subtract(b).magnitudeSquared();if(N>g){let C=Math.sqrt(N);x=(x+C)*.5,g=x*x;let k=C-x;b.x=(x*b.x+k*r.x)/C,b.y=(x*b.y+k*r.y)/C,b.z=(x*b.z+k*r.z)/C}}return x<D?(b.to(t.center),t.radius=x):(F.to(t.center),t.radius=D),t}var vc=new Pr,c8t=new Pr,l8t=new Pr,SC=new Pr,O1e=new Pr;function M7(e,t={}){let r=fu.EPSILON20,n=10,i=0,a=0,o=c8t,s=l8t;o.identity(),s.copy(e);let u=r*f8t(s);for(;a<n&&d8t(s)>u;)h8t(s,SC),O1e.copy(SC).transpose(),s.multiplyRight(SC),s.multiplyLeft(O1e),o.multiplyRight(SC),++i>2&&(++a,i=0);return t.unitary=o.toTarget(t.unitary),t.diagonal=s.toTarget(t.diagonal),t}function f8t(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var j7=[1,0,0],L7=[2,2,1];function d8t(e){let t=0;for(let r=0;r<3;++r){let n=e[vc.getElementIndex(L7[r],j7[r])];t+=2*n*n}return Math.sqrt(t)}function h8t(e,t){let r=fu.EPSILON15,n=0,i=1;for(let c=0;c<3;++c){let l=Math.abs(e[vc.getElementIndex(L7[c],j7[c])]);l>n&&(i=c,n=l)}let a=j7[i],o=L7[i],s=1,u=0;if(Math.abs(e[vc.getElementIndex(o,a)])>r){let c=e[vc.getElementIndex(o,o)],l=e[vc.getElementIndex(a,a)],f=e[vc.getElementIndex(o,a)],d=(c-l)/2/f,h;d<0?h=-1/(-d+Math.sqrt(1+d*d)):h=1/(d+Math.sqrt(1+d*d)),s=1/Math.sqrt(1+h*h),u=h*s}return Pr.IDENTITY.to(t),t[vc.getElementIndex(a,a)]=t[vc.getElementIndex(o,o)]=s,t[vc.getElementIndex(o,a)]=u,t[vc.getElementIndex(a,o)]=-u,t}var _d=new ce,m8t=new ce,g8t=new ce,v8t=new ce,b8t=new ce,y8t=new Pr,x8t={diagonal:new Pr,unitary:new Pr};function Q1(e,t=new aa){if(!e||e.length===0)return t.halfAxes=new Pr([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 k=_d.copy(C).subtract(n);a+=k.x*k.x,o+=k.x*k.y,s+=k.x*k.z,u+=k.y*k.y,c+=k.y*k.z,l+=k.z*k.z}a*=i,o*=i,s*=i,u*=i,c*=i,l*=i;let f=y8t;f[0]=a,f[1]=o,f[2]=s,f[3]=o,f[4]=u,f[5]=c,f[6]=s,f[7]=c,f[8]=l;let{unitary:d}=M7(f,x8t),h=t.halfAxes.copy(d),p=h.getColumn(0,g8t),b=h.getColumn(1,v8t),g=h.getColumn(2,b8t),x=-Number.MAX_VALUE,w=-Number.MAX_VALUE,S=-Number.MAX_VALUE,F=Number.MAX_VALUE,D=Number.MAX_VALUE,j=Number.MAX_VALUE;for(let C of e)_d.copy(C),x=Math.max(_d.dot(p),x),w=Math.max(_d.dot(b),w),S=Math.max(_d.dot(g),S),F=Math.min(_d.dot(p),F),D=Math.min(_d.dot(b),D),j=Math.min(_d.dot(g),j);p=p.multiplyByScalar(.5*(F+x)),b=b.multiplyByScalar(.5*(D+w)),g=g.multiplyByScalar(.5*(j+S)),t.center.copy(p).add(b).add(g);let B=m8t.set(x-F,w-D,S-j).multiplyByScalar(.5),N=new Pr([B[0],0,0,0,B[1],0,0,0,B[2]]);return t.halfAxes.multiplyRight(N),t}function j1e(e){return e!=null}var Ybr=new ce,_8t=new ce,E8t=new ce,w8t=new ce,Fp=new ce,k1e=new ce,I1e=new ce,P1e=new ce;function TC(e,t,r){if(Jt(e,"3D Tile: boundingVolume must be defined"),e.box)return L1e(e.box,t,r);if(e.region)return S8t(e.region);if(e.sphere)return A8t(e.sphere,t,r);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function L1e(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 hs;l.fromArray(e,6);let f=new ce([1,0,0]),d=new ce([0,1,0]),h=new ce([0,0,1]);f.transformByQuaternion(l),f.scale(c[0]),d.transformByQuaternion(l),d.scale(c[1]),h.transformByQuaternion(l),h.scale(c[2]),i=[...f.toArray(),...d.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 Pr([a[0],a[1],a[2],o[0],o[1],o[2],s[0],s[1],s[2]]);return j1e(r)?(r.center=n,r.halfAxes=u,r):new aa(n,u)}function A8t(e,t,r){let n=new ce(e[0],e[1],e[2]);t.transform(n,n);let i=t.getScale(_8t),a=Math.max(Math.max(i[0],i[1]),i[2]),o=e[3]*a;return j1e(r)?(r.center=n,r.radius=o,r):new Ya(n,o)}function S8t(e){let[t,r,n,i,a,o]=e,s=or.WGS84.cartographicToCartesian([Cl(t),Cl(i),a],E8t),u=or.WGS84.cartographicToCartesian([Cl(n),Cl(r),o],w8t),c=new ce().addVectors(s,u).multiplyByScalar(.5);return or.WGS84.cartesianToCartographic(c,Fp),or.WGS84.cartographicToCartesian([Cl(n),Fp[1],Fp[2]],k1e),or.WGS84.cartographicToCartesian([Fp[0],Cl(i),Fp[2]],I1e),or.WGS84.cartographicToCartesian([Fp[0],Fp[1],o],P1e),L1e([...c,...k1e.subtract(c),...I1e.subtract(c),...P1e.subtract(c)],new Kr)}var yv="4.0.0-beta.6";var ms={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},eyr=Object.keys(ms),Ed={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function q7(e,t,r){Jt(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),i=new Uint8Array(e,t,r);return n.decode(i)}function M1e(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 CC="4.0.0-beta.6";var T8t={draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}},q1e={name:"Draco",id:"draco",module:"draco",version:CC,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:T8t};function N1e(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 N7(e){let t=1/0,r=1/0,n=1/0,i=-1/0,a=-1/0,o=-1/0,s=e.POSITION?e.POSITION.value:[],u=s&&s.length;for(let c=0;c<u;c+=3){let l=s[c],f=s[c+1],d=s[c+2];t=l<t?l:t,r=f<r?f:r,n=d<n?d:n,i=l>i?l:i,a=f>a?f:a,o=d>o?d:o}return[[t,r,n],[i,a,o]]}function U7(e,t,r){let n=N1e(t.value),i=r||U1e(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:i}}function U1e(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}function z1e(e,t,r){let n=H1e(t.metadata),i=[],a=C8t(t.attributes);for(let o in e){let s=e[o],u=G1e(o,s,a[o]);i.push(u)}if(r){let o=G1e("indices",r);i.push(o)}return{fields:i,metadata:n}}function C8t(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function G1e(e,t,r){let n=r?H1e(r.metadata):void 0;return U7(e,t,n)}function H1e(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var W1e={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},D8t={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},F8t=4,Z1=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let i=this.decoder.GetEncodedGeometryType(n),a=i===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let o;switch(i){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeBufferToMesh(n,a);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeBufferToPointCloud(n,a);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!a.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let s=this._getDracoLoaderData(a,i,r),u=this._getMeshData(a,s,r),c=N7(u.attributes),l=z1e(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*F8t,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),O8t(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=D8t[r.data_type],i=r.num_components,o=t.num_points()*i,s=o*n.BYTES_PER_ELEMENT,u=B8t(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 W1e)if(this.draco[o]===i)return W1e[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=R8t(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 B8t(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 R8t(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function O8t(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var k8t="1.5.6",I8t="1.4.1",G7=`https://www.gstatic.com/draco/versioned/decoders/${k8t}`,ii={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},wd={[ii.DECODER]:`${G7}/${ii.DECODER}`,[ii.DECODER_WASM]:`${G7}/${ii.DECODER_WASM}`,[ii.FALLBACK_DECODER]:`${G7}/${ii.FALLBACK_DECODER}`,[ii.ENCODER]:`https://raw.githubusercontent.com/google/draco/${I8t}/javascript/${ii.ENCODER}`},e_;async function V1e(e){let t=e.modules||{};return t.draco3d?e_=e_||t.draco3d.createDecoderModule({}).then(r=>({draco:r})):e_=e_||P8t(e),await e_}async function P8t(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await Qu(wd[ii.FALLBACK_DECODER],"draco",e,ii.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await Qu(wd[ii.DECODER],"draco",e,ii.DECODER),await Qu(wd[ii.DECODER_WASM],"draco",e,ii.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await j8t(t,r)}function j8t(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:i=>n({draco:i})})})}var z7={id:"draco-writer",name:"Draco compressed geometry writer",module:"draco",version:CC,worker:!0,options:{draco:{},source:null}};var xv={...q1e,parse:L8t};async function L8t(e,t){let{draco:r}=await V1e(t),n=new Z1(r);try{return n.parseSync(e,t==null?void 0:t.draco)}finally{n.destroy()}}var M8t={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},vi={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Zt={...M8t,...vi};var H7={[vi.DOUBLE]:Float64Array,[vi.FLOAT]:Float32Array,[vi.UNSIGNED_SHORT]:Uint16Array,[vi.UNSIGNED_INT]:Uint32Array,[vi.UNSIGNED_BYTE]:Uint8Array,[vi.BYTE]:Int8Array,[vi.SHORT]:Int16Array,[vi.INT]:Int32Array},q8t={DOUBLE:vi.DOUBLE,FLOAT:vi.FLOAT,UNSIGNED_SHORT:vi.UNSIGNED_SHORT,UNSIGNED_INT:vi.UNSIGNED_INT,UNSIGNED_BYTE:vi.UNSIGNED_BYTE,BYTE:vi.BYTE,SHORT:vi.SHORT,INT:vi.INT},W7="Failed to convert GL type",La=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in H7)if(H7[r]===t)return r;throw new Error(W7)}static fromName(t){let r=q8t[t];if(!r)throw new Error(W7);return r}static getArrayType(t){switch(t){case vi.UNSIGNED_SHORT_5_6_5:case vi.UNSIGNED_SHORT_4_4_4_4:case vi.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=H7[t];if(!r)throw new Error(W7);return r}}static getByteSize(t){return La.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(La.getArrayType(t))}static createTypedArray(t,r,n=0,i){i===void 0&&(i=(r.byteLength-n)/La.getByteSize(t));let a=La.getArrayType(t);return new a(r,n,i)}};function K1e(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function V7(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 Lyr=1/256;var Myr=new Tp,qyr=new ce,Nyr=new Tp,Uyr=new Tp,Gyr=new Uint8Array(1);function X1e(e,t=255){return t7(e,0,t)/t*2-1}function Y1e(e){return e<0?-1:1}function $1e(e,t,r,n){if(K1e(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=X1e(e,r),n.y=X1e(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))*Y1e(i),n.y=(1-Math.abs(i))*Y1e(n.y)}return n.normalize()}function K7(e,t,r){return $1e(e,t,255,r)}function Bp(e){return(e%1+1)%1}var Rl=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=Zt.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=La.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=La.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=La.createTypedArray(r,n),i[t]=a),a}};var N8t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},U8t={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]]},G8t={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 J1e(e,t,r,n){let{componentType:i}=e;Jt(e.componentType);let a=typeof i=="string"?La.fromName(i):i,o=N8t[e.type],s=U8t[e.type],u=G8t[e.type];return r+=e.byteOffset,{values:La.createTypedArray(a,t,r,o*n),type:a,size:o,unpacker:s,packer:u}}var bc=e=>e!==void 0;function Q1e(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?z8t(n,r):null}function z8t(e,t){let r,n,i,a=e.instancesLength,o=e.classes,s=e.classIds,u=e.parentCounts,c=e.parentIds,l=a;bc(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(bc(u))for(bc(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];bc(c)&&bc(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,i=getBinaryAccessor(c),c=i.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,l));let d=o.length;for(r=0;r<d;++r){let g=o[r].length,x=o[r].instances,w=getBinaryProperties(g,x,t);o[r].instances=combine(w,x)}let h=new Array(d).fill(0),p=new Uint16Array(a);for(r=0;r<a;++r)n=s[r],p[r]=h[n],++h[n];let b={classes:o,classIds:s,classIndexes:p,parentCounts:u,parentIndexes:f,parentIds:c};return V8t(b),b}function _v(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?H8t(e,t,r):W8t(e,t,r)}function H8t(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(bc(f))return f;let d=i[t],h=o[t];for(let p=0;p<d;++p){let b=a[h+p];b!==t&&l.push(b)}}return null}function W8t(e,t,r){let n=!0;for(;n;){let i=r(e,t);if(bc(i))return i;let a=e.parentIds[t];n=a!==t,t=a}throw new Error("traverseHierarchySingleParent")}function V8t(e){let t=[],n=e.classIds.length;for(let i=0;i<n;++i)Z1e(e,i,stack)}function Z1e(e,t,r){let n=e.parentCounts,i=e.parentIds,a=e.parentIndexes,s=e.classIds.length;if(!bc(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=bc(n)?n[t]:1,c=bc(n)?a[t]:t;for(let l=0;l<u;++l){let f=i[c+l];f!==t&&Z1e(e,f,r)}r.pop(t)}function po(e){return e!=null}var DC=(e,t)=>e,K8t={HIERARCHY:!0,extensions:!0,extras:!0},Rp=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,i={}){var a;Jt(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)K8t[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),i["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Q1e(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),Jt(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 po(n)}return!1}isExactClass(t,r){return Jt(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),Jt(typeof r=="string",r),po(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=po(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),Jt(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(po(i))return this._getBinaryProperty(i,t)}let n=this._properties[r];if(po(n))return DC(n[t],!0);if(this._hierarchy){let i=this._getHierarchyProperty(t,r);if(po(i))return i}}setProperty(t,r,n){let i=this.featureCount;if(this._checkBatchId(t),Jt(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];po(a)||(this._properties[r]=new Array(i),a=this._properties[r]),a[t]=DC(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;Jt(this.binary,`Property ${t} requires a batch table binary.`),Jt(n.type,`Property ${t} requires a type.`);let i=J1e(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 po(s[r])});return po(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 po(u)?po(u.typedArray)?this._getBinaryProperty(u,s):DC(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 po(f)?(Jt(s===r,`Inherited property "${n}" is read-only.`),po(f.typedArray)?this._setBinaryProperty(f,l,i):f[l]=DC(i,!0),!0):!1});return po(a)}};var X7=4;function Ad(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=X7,e.version=n.getUint32(r,!0),r+=X7,e.byteLength=n.getUint32(r,!0),r+=X7,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Ev=4,e_e="b3dm tile in legacy format.";function wv(e,t,r){let n=new DataView(t),i;e.header=e.header||{};let a=n.getUint32(r,!0);r+=Ev;let o=n.getUint32(r,!0);r+=Ev;let s=n.getUint32(r,!0);r+=Ev;let u=n.getUint32(r,!0);return r+=Ev,s>=570425344?(r-=Ev*2,i=a,s=o,u=0,a=0,o=0,console.warn(e_e)):u>=570425344&&(r-=Ev,i=s,s=a,u=o,a=0,o=0,console.warn(e_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=X8t(e,t,r,n),r=Y8t(e,t,r,n),r}function X8t(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=q7(t,r,i);e.featureTableJson=JSON.parse(s)}return r+=i||0,e.featureTableBinary=new Uint8Array(t,r,a),r+=a||0,r}function Y8t(e,t,r,n){let{batchTableJsonByteLength:i,batchTableBinaryByteLength:a}=e.header||{};if(i&&i>0){let o=q7(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 Y7(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:Zt.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=V7(t[s]);o[s*3]=u[0],o[s*3+1]=u[1],o[s*3+2]=u[2]}return{type:Zt.UNSIGNED_BYTE,value:o,size:3,normalized:!0}}return t&&t.length===a*3?{type:Zt.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:Zt.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var t_e=new ce;function r_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++)K7(t[n*2],t[n*2+1],t_e),t_e.toArray(r,n*3);return{type:Zt.FLOAT,size:2,value:r}}return{type:Zt.FLOAT,size:2,value:t}}function n_e(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,$8t(e,t)):{type:Zt.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function $8t(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 i_e(e,t,r,n,i){r=Ad(e,t,r),r=wv(e,t,r),r=Av(e,t,r,n),J8t(e);let{featureTable:a,batchTable:o}=Q8t(e);return await nCt(e,a,o,n,i),Z8t(e,a,n),eCt(e,a,o),tCt(e,a),r}function J8t(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function Q8t(e){let t=new Rl(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3);let n=rCt(e,t);return{featureTable:t,batchTable:n}}function Z8t(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",Zt.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=n_e(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function eCt(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",Zt.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",Zt.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",Zt.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Y7(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",Zt.UNSIGNED_BYTE,4))}function tCt(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",Zt.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",Zt.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=r_e(e,r)}}function rCt(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",Zt.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 Rp(i,a,n)}return r}async function nCt(e,t,r,n,i){let a,o,s,u=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];u&&(s=u.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){o=c.properties;let f=c.byteOffset,d=c.byteLength;if(!o||!Number.isFinite(f)||!d)throw new Error("Draco properties, byteOffset, and byteLength must be defined");a=(e.featureTableBinary||[]).slice(f,f+d),e.hasPositions=Number.isFinite(o.POSITION),e.hasColors=Number.isFinite(o.RGB)||Number.isFinite(o.RGBA),e.hasNormals=Number.isFinite(o.NORMAL),e.hasBatchIds=Number.isFinite(o.BATCH_ID),e.isTranslucent=Number.isFinite(o.RGBA)}if(!a)return!0;let l={buffer:a,properties:{...o,...s},featureTableProperties:o,batchTableProperties:s,dequantizeInShader:!1};return await iCt(e,l,n,i)}async function iCt(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 So(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,p=h.range;e.quantizedVolumeScale=new ce(p,p,p),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 d={};if(t.batchTableProperties)for(let h of Object.keys(t.batchTableProperties))a.attributes[h]&&a.attributes[h].value&&(d[h.toLowerCase()]=a.attributes[h].value);e.attributes={positions:o,colors:Y7(e,s,void 0),normals:u,batchIds:c,...d}}var iq={};ca(iq,{decode:()=>zCt,name:()=>qC});var FC="4.0.0-beta.6";var a_e,aCt=(a_e=globalThis.loaders)==null?void 0:a_e.parseImageNode,$7=typeof Image<"u",J7=typeof ImageBitmap<"u",oCt=Boolean(aCt),Q7=vn?!0:oCt;function o_e(e){switch(e){case"auto":return J7||$7||Q7;case"imagebitmap":return J7;case"image":return $7;case"data":return Q7;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function s_e(){if(J7)return"imagebitmap";if($7)return"image";if(Q7)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function u_e(e){let t=sCt(e);if(!t)throw new Error("Not an image");return t}function Z7(e){return Sv(e)}function Sv(e){switch(u_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 sCt(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 uCt=/^data:image\/svg\+xml/,cCt=/\.svg((\?|#).*)?$/;function BC(e){return e&&(uCt.test(e)||cCt.test(e))}function c_e(e,t){if(BC(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 eq(e,t)}function eq(e,t){if(BC(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function RC(e,t,r){let n=c_e(e,r),i=self.URL||self.webkitURL,a=typeof n!="string"&&i.createObjectURL(n);try{return await lCt(a||n,t)}finally{a&&i.revokeObjectURL(a)}}async function lCt(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=>i(new Error(`Could not load image ${e}: ${a}`))}catch(a){i(a)}})}var fCt={},l_e=!0;async function f_e(e,t,r){let n;BC(r)?n=await RC(e,t,r):n=eq(e,r);let i=t&&t.imagebitmap;return await dCt(n,i)}async function dCt(e,t=null){if((hCt(t)||!l_e)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),l_e=!1}return await createImageBitmap(e)}function hCt(e){for(let t in e||fCt)return!1;return!0}function d_e(e){return!vCt(e,"ftyp",4)||!(e[8]&96)?null:pCt(e)}function pCt(e){switch(mCt(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function mCt(e,t,r){return String.fromCharCode(...e.slice(t,r))}function gCt(e){return[...e].map(t=>t.charCodeAt(0))}function vCt(e,t,r=0){let n=gCt(t);for(let i=0;i<n.length;++i)if(n[i]!==e[i+r])return!1;return!0}var yc=!1,t_=!0;function Op(e){let t=r_(e);return yCt(t)||ECt(t)||xCt(t)||_Ct(t)||bCt(t)}function bCt(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=d_e(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function yCt(e){let t=r_(e);return t.byteLength>=24&&t.getUint32(0,yc)===2303741511?{mimeType:"image/png",width:t.getUint32(16,yc),height:t.getUint32(20,yc)}:null}function xCt(e){let t=r_(e);return t.byteLength>=10&&t.getUint32(0,yc)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,t_),height:t.getUint16(8,t_)}:null}function _Ct(e){let t=r_(e);return t.byteLength>=14&&t.getUint16(0,yc)===16973&&t.getUint32(2,t_)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,t_),height:t.getUint32(22,t_)}:null}function ECt(e){let t=r_(e);if(!(t.byteLength>=3&&t.getUint16(0,yc)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:i}=wCt(),a=2;for(;a+9<t.byteLength;){let o=t.getUint16(a,yc);if(i.has(o))return{mimeType:"image/jpeg",height:t.getUint16(a+5,yc),width:t.getUint16(a+7,yc)};if(!n.has(o))return null;a+=2,a+=t.getUint16(a,yc)}return null}function wCt(){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 r_(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 h_e(e,t){var i;let{mimeType:r}=Op(e)||{},n=(i=globalThis.loaders)==null?void 0:i.parseImageNode;return Jt(n),await n(e,r)}async function p_e(e,t,r){t=t||{};let i=(t.image||{}).type||"auto",{url:a}=r||{},o=ACt(i),s;switch(o){case"imagebitmap":s=await f_e(e,t,a);break;case"image":s=await RC(e,t,a);break;case"data":s=await h_e(e,t);break;default:Jt(!1)}return i==="data"&&(s=Sv(s)),s}function ACt(e){switch(e){case"auto":case"data":return s_e();default:return o_e(e),e}}var SCt=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],TCt=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],CCt={image:{type:"auto",decode:!0}},Tv={id:"image",module:"images",name:"Images",version:FC,mimeTypes:TCt,extensions:SCt,parse:p_e,tests:[e=>Boolean(Op(new DataView(e)))],options:CCt};var v_e,m_e=(v_e=globalThis.loaders)==null?void 0:v_e.encodeImageNode;async function b_e(e,t){return t=t||{},t.image=t.image||{},m_e?m_e(e,{type:t.image.mimeType}):DCt(e,t)}var g_e=!0;async function DCt(e,t){let{mimeType:r,jpegQuality:n}=t.image,{width:i,height:a}=Z7(e),o=document.createElement("canvas");o.width=i,o.height=a,FCt(e,o);let s=await new Promise(u=>{if(n&&g_e)try{o.toBlob(u,r,n);return}catch{g_e=!1}o.toBlob(u,r)});if(!s)throw new Error("image encoding failed");return await s.arrayBuffer()}function FCt(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 tq={name:"Images",id:"image",module:"images",version:FC,extensions:["jpeg"],options:{image:{mimeType:"image/png",jpegQuality:null}},encode:b_e};var rq={};function nq(e){if(rq[e]===void 0){let t=vn?RCt(e):BCt(e);rq[e]=t}return rq[e]}function BCt(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 RCt(e){switch(e){case"image/avif":case"image/webp":return OCt(e);default:return!0}}function OCt(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function Ni(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var OC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kC={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var kCt=1.33,y_e=["SCALAR","VEC2","VEC3","VEC4"],ICt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],PCt=new Map(ICt),jCt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},LCt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},MCt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function IC(e){return y_e[e-1]||y_e[0]}function Cv(e){let t=PCt.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Dv(e,t){let r=MCt[e.componentType],n=jCt[e.type],i=LCt[e.componentType],a=e.count*n,o=e.count*n*i;Ni(o>=0&&o<=t.byteLength);let s=kC[e.componentType],u=OC[e.type];return{ArrayType:r,length:a,byteLength:o,componentByteSize:s,numberOfComponentsInElement:u}}function n_(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*kCt)}function x_e(e,t,r){let n=e.bufferViews[r];Ni(n);let i=n.buffer,a=t[i];Ni(a);let o=(n.byteOffset||0)+a.byteOffset;return new Uint8Array(a.arrayBuffer,o,n.byteLength)}function __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 ${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),d=l*f,h=i.byteStride||d;if(typeof i.byteStride>"u"||i.byteStride===d)return new u(a,s,c);let p=new u(c);for(let x=0;x<n.count;x++){let w=new u(a,s+x*h,f);p.set(w,x*f)}return p}function qCt(){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)||qCt(),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];Ni(n);let i=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,i,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return __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 Ni(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return Ni(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=Op(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;Ni(Number.isFinite(i)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let a={buffer:r,byteOffset:n,byteLength:i};return this.byteLength+=Co(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:IC(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=zI(s,n,i);(o=(a=this.json)==null?void 0:a.buffers)!=null&&o[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let i=t.indexOf(r);i>-1?t.splice(i,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let i=t[n],a=this._getGltfAttributeName(n),o=this.addBinaryBuffer(i.value,i);r[a]=o}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let i=t.subarray(0,r);for(let a of i)n.min.push(a),n.max.push(a);for(let a=r;a<t.length;a+=r)for(let o=0;o<r;o++)n.min[0+o]=Math.min(n.min[0+o],t[a+o]),n.max[0+o]=Math.max(n.max[0+o],t[a+o]);return n}};var E_e={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},NCt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},w_e={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function i_(e,t){return w_e[t]*E_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=Bv(i,"SCALAR",r,n+1);return a instanceof BigInt64Array||a instanceof BigUint64Array?null:a}function Bv(e,t,r,n=1){let i=E_e[t],a=NCt[r],o=w_e[r],s=n*i,u=s*o,c=e.buffer,l=e.byteOffset;return l%o!==0&&(c=new Uint8Array(c).slice(l,l+u).buffer,l=0),new a(c,l,s)}function Rv(e,t,r){var c,l,f,d,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 p=(d=(f=o.images)==null?void 0:f[u])==null?void 0:d.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 w=UCt(b,p,a,x,t.channels);g.push(w)}return g}}return[]}function PC(e,t,r,n,i){if(!(r!=null&&r.length))return;let a=[];for(let l of r){let f=n.findIndex(d=>d===l);f===-1&&(f=n.push(l)-1),a.push(f)}let o=new Uint32Array(a),s=e.gltf.buffers.push({arrayBuffer:o.buffer,byteOffset:o.byteOffset,byteLength:o.byteLength})-1,u=e.addBufferView(o,s,0),c=e.addAccessor(u,{size:1,componentType:Cv(o),count:o.length});i.attributes[t]=c}function UCt(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=GCt(o,s,e,u),l=0;for(let f of i){let d=typeof f=="number"?Object.values(a)[f]:a[f],h=c+d.offset,p=Sv(e);if(p.data.length<=h)throw new Error(`${p.data.length} <= ${h}`);let b=p.data[h];l|=b<<d.shift}return l}function GCt(e,t,r,n=1){let i=r.width,a=Bp(e)*(i-1),o=Math.round(a),s=r.height,u=Bp(t)*(s-1),c=Math.round(u),l=r.components?r.components:n;return(c*i+o)*l}function jC(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 LC(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 MC(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 A_e="EXT_mesh_features",qC=A_e;async function zCt(e,t){let r=new qr(e);HCt(r,t)}function HCt(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let i of n.primitives)WCt(e,i,t)}function WCt(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[A_e],i=n==null?void 0:n.featureIds;if(i)for(let u of i){let c;if(typeof u.attribute<"u"){let l=`_FEATURE_ID_${u.attribute}`,f=t.attributes[l];c=e.getTypedArrayForAccessor(f)}else typeof u.texture<"u"&&((s=r==null?void 0:r.gltf)!=null&&s.loadImages)?c=Rv(e,u.texture,t):c=[];u.data=c}}var sq={};ca(sq,{decode:()=>VCt,name:()=>Ol});var aq="EXT_structural_metadata",Ol=aq;async function VCt(e,t){let r=new qr(e);KCt(r,t)}function KCt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(aq);r&&((i=t.gltf)!=null&&i.loadImages&&XCt(e,r),YCt(e,r))}function XCt(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)JCt(e,r,a,t)}function YCt(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=$Ct(i,a);o&&ZCt(e,r,o)}}function $Ct(e,t){for(let r of e)if(r.class===t)return r;return null}function JCt(e,t,r,n){var o;if(!t)return;let i=(o=r.extensions)==null?void 0:o[aq],a=i==null?void 0:i.propertyTextures;if(a)for(let s of a){let u=t[s];QCt(e,u,r,n)}}function QCt(e,t,r,n){var a;if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let i=t.class;for(let o in t.properties){let s=`${i}_${o}`,u=(a=t.properties)==null?void 0:a[o];if(!u)continue;u.data||(u.data=[]);let c=u.data,l=Rv(e,u,r);l!==null&&(PC(e,s,l,c,r),u.data=c,n.dataAttributeNames.push(s))}}function ZCt(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=eDt(e,t,u,i,c);c.data=l}}}function eDt(e,t,r,n,i){let a=[],o=i.values,s=e.getTypedArrayForBufferView(o),u=tDt(e,r,i,n),c=rDt(e,i,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{a=nDt(r,n,s,u);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{a=MC(n,s,u,c);break}case"ENUM":{a=iDt(t,r,n,s,u);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return a}function tDt(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 rDt(e,t,r){return typeof t.stringOffsets<"u"?Fv(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function nDt(e,t,r,n){let i=e.array,a=e.count,o=i_(e.type,e.componentType),s=r.byteLength/o,u;return e.componentType?u=Bv(r,e.type,e.componentType,s):u=r,i?n?jC(u,t,n,r.length,o):a?LC(u,t,a):[]:u}function iDt(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=i_(t.type,s),c=n.byteLength/u,l=Bv(n,t.type,s,c);if(l||(l=n),t.array){if(i)return aDt({valuesData:l,numberOfElements:r,arrayOffsets:i,valuesDataBytesLength:n.length,elementSize:u,enumEntry:o});let d=t.count;return d?oDt(l,r,d,o):[]}return oq(l,0,r,o)}function aDt(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:i,elementSize:a,enumEntry:o}=e,s=[];for(let u=0;u<r;u++){let c=n[u],l=n[u+1]-n[u];if(l+c>i)break;let f=c/a,d=l/a,h=oq(t,f,d,o);s.push(h)}return s}function oDt(e,t,r,n){let i=[];for(let a=0;a<t;a++){let o=r*a,s=oq(e,o,r,n);i.push(s)}return i}function oq(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=sDt(n,o);s?i.push(s.name):i.push("")}return i}function sDt(e,t){for(let r of e.values)if(r.value===t)return r;return null}var uq={};ca(uq,{decode:()=>uDt,name:()=>gs});var S_e="EXT_feature_metadata",gs=S_e;async function uDt(e,t){let r=new qr(e);cDt(r,t)}function cDt(e,t){var n,i;if(!((n=t.gltf)!=null&&n.loadBuffers))return;let r=e.getExtension(S_e);r&&((i=t.gltf)!=null&&i.loadImages&&lDt(e,r),fDt(e,r))}function lDt(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=hDt(i,a);s&&mDt(e,s,o)}}function fDt(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=dDt(i,a);o&&pDt(e,r,o)}}function dDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function hDt(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function pDt(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=gDt(e,t,u,i,c);c.data=l}}}function mDt(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=_Dt(e,o,n);o.data=s}}}function gDt(e,t,r,n,i){let a=[],o=i.bufferView,s=e.getTypedArrayForBufferView(o),u=vDt(e,r,i,n),c=bDt(e,r,i,n);return r.type==="STRING"||r.componentType==="STRING"?a=MC(n,s,u,c):yDt(r)&&(a=xDt(r,n,s,u)),a}function vDt(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 bDt(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Fv(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function yDt(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 xDt(e,t,r,n){let i=e.type==="ARRAY",a=e.componentCount,o="SCALAR",s=e.componentType||e.type,u=i_(o,s),c=r.byteLength/u,l=Bv(r,o,s,c);return i?n?jC(l,t,n,r.length,u):a?LC(l,t,a):[]:l}function _Dt(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)EDt(e,r,t,i,o);return i}function EDt(e,t,r,n,i){let a={channels:r.channels,...r.texture},o=Rv(e,a,i);o&&PC(e,t,o,n,i)}var NC="4.0.0-beta.6";var Ov="4.0.0-beta.6";var xc={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},cq;async function fq(e){let t=e.modules||{};return t.basis?t.basis:(cq=cq||wDt(e),await cq)}async function wDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(xc.TRANSCODER,"textures",e),await Qu(xc.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await ADt(t,r)}function ADt(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 lq;async function dq(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(lq=lq||SDt(e),await lq)}async function SDt(e){let t=null,r=null;return[t,r]=await Promise.all([await Qu(xc.ENCODER,"textures",e),await Qu(xc.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await TDt(t,r)}function TDt(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 Be={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 CDt=["","WEBKIT_","MOZ_"],T_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"},UC=null;function a_(e){if(!UC){e=e||DDt()||void 0,UC=new Set;for(let t of CDt)for(let r in T_e)if(e&&e.getExtension(`${t}${r}`)){let n=T_e[r];UC.add(n)}}return UC}function DDt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var M_e=Kt(j_e(),1);function kv(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=RDt(t,n,i,e,o),u=BDt(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 BDt(e,t,r,n){return Array.isArray(e)?e[t].levelData:new Uint8Array(e.buffer,e.byteOffset+r,n)}function RDt(e,t,r,n,i){return Array.isArray(n)?e.sizeFunction(n[i]):e.sizeFunction(t,r)}var ODt={131:Be.COMPRESSED_RGB_S3TC_DXT1_EXT,132:Be.COMPRESSED_SRGB_S3TC_DXT1_EXT,133:Be.COMPRESSED_RGBA_S3TC_DXT1_EXT,134:Be.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,135:Be.COMPRESSED_RGBA_S3TC_DXT3_EXT,136:Be.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,137:Be.COMPRESSED_RGBA_S3TC_DXT5_EXT,138:Be.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,139:Be.COMPRESSED_RED_RGTC1_EXT,140:Be.COMPRESSED_SIGNED_RED_RGTC1_EXT,141:Be.COMPRESSED_RED_GREEN_RGTC2_EXT,142:Be.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT,147:Be.COMPRESSED_RGB8_ETC2,148:Be.COMPRESSED_SRGB8_ETC2,149:Be.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,150:Be.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,151:Be.COMPRESSED_RGBA8_ETC2_EAC,152:Be.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,153:Be.COMPRESSED_R11_EAC,154:Be.COMPRESSED_SIGNED_R11_EAC,155:Be.COMPRESSED_RG11_EAC,156:Be.COMPRESSED_SIGNED_RG11_EAC,157:Be.COMPRESSED_RGBA_ASTC_4x4_KHR,158:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,159:Be.COMPRESSED_RGBA_ASTC_5x4_KHR,160:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR,161:Be.COMPRESSED_RGBA_ASTC_5x5_KHR,162:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,163:Be.COMPRESSED_RGBA_ASTC_6x5_KHR,164:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,165:Be.COMPRESSED_RGBA_ASTC_6x6_KHR,166:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,167:Be.COMPRESSED_RGBA_ASTC_8x5_KHR,168:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,169:Be.COMPRESSED_RGBA_ASTC_8x6_KHR,170:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,171:Be.COMPRESSED_RGBA_ASTC_8x8_KHR,172:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,173:Be.COMPRESSED_RGBA_ASTC_10x5_KHR,174:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,175:Be.COMPRESSED_RGBA_ASTC_10x6_KHR,176:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,177:Be.COMPRESSED_RGBA_ASTC_10x8_KHR,178:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,179:Be.COMPRESSED_RGBA_ASTC_10x10_KHR,180:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,181:Be.COMPRESSED_RGBA_ASTC_12x10_KHR,182:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,183:Be.COMPRESSED_RGBA_ASTC_12x12_KHR,184:Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR,1000054e3:Be.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,1000054001:Be.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,1000066e3:Be.COMPRESSED_RGBA_ASTC_4x4_KHR,1000066001:Be.COMPRESSED_RGBA_ASTC_5x4_KHR,1000066002:Be.COMPRESSED_RGBA_ASTC_5x5_KHR,1000066003:Be.COMPRESSED_RGBA_ASTC_6x5_KHR,1000066004:Be.COMPRESSED_RGBA_ASTC_6x6_KHR,1000066005:Be.COMPRESSED_RGBA_ASTC_8x5_KHR,1000066006:Be.COMPRESSED_RGBA_ASTC_8x6_KHR,1000066007:Be.COMPRESSED_RGBA_ASTC_8x8_KHR,1000066008:Be.COMPRESSED_RGBA_ASTC_10x5_KHR,1000066009:Be.COMPRESSED_RGBA_ASTC_10x6_KHR,1000066010:Be.COMPRESSED_RGBA_ASTC_10x8_KHR,1000066011:Be.COMPRESSED_RGBA_ASTC_10x10_KHR,1000066012:Be.COMPRESSED_RGBA_ASTC_12x10_KHR,1000066013:Be.COMPRESSED_RGBA_ASTC_12x12_KHR};function L_e(e){return ODt[e]}var Oo=[171,75,84,88,32,50,48,187,13,10,26,10];function VC(e){let t=new Uint8Array(e);return!(t.byteLength<Oo.length||t[0]!==Oo[0]||t[1]!==Oo[1]||t[2]!==Oo[2]||t[3]!==Oo[3]||t[4]!==Oo[4]||t[5]!==Oo[5]||t[6]!==Oo[6]||t[7]!==Oo[7]||t[8]!==Oo[8]||t[9]!==Oo[9]||t[10]!==Oo[10]||t[11]!==Oo[11])}function q_e(e){let t=new Uint8Array(e),r=(0,M_e.read)(t),n=Math.max(1,r.levels.length),i=r.pixelWidth,a=r.pixelHeight,o=L_e(r.vkFormat);return kv(r.levels,{mipMapLevels:n,width:i,height:a,sizeFunction:s=>s.uncompressedByteLength,internalFormat:o})}var kDt={etc1:{basisFormat:0,compressed:!0,format:Be.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Be.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Be.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:Be.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Be.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Be.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 s_(e,t){if(t.basis.containerFormat==="auto"){if(VC(e)){let n=await dq(t);return N_e(n.KTX2File,e,t)}let{BasisFile:r}=await fq(t);return vq(r,e,t)}switch(t.basis.module){case"encoder":let r=await dq(t);switch(t.basis.containerFormat){case"ktx2":return N_e(r.KTX2File,e,t);case"basis":default:return vq(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await fq(t);return vq(n,e,t)}}function vq(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(IDt(n,o,c,r));a.push(u)}return a}finally{n.close(),n.delete()}}function IDt(e,t,r,n){let i=e.getImageWidth(t,r),a=e.getImageHeight(t,r),o=e.getHasAlpha(),{compressed:s,format:u,basisFormat:c}=U_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 N_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(PDt(n,o,r));break}return[a]}finally{n.close(),n.delete()}}function PDt(e,t,r){let{alphaFlag:n,height:i,width:a}=e.getImageLevelInfo(t,0,0),{compressed:o,format:s,basisFormat:u}=U_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 U_e(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Iv()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),kDt[r]}function Iv(){let e=a_();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 G_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"}}},kp={...G_e,parse:s_};var ko={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},jDt={DXT1:Be.COMPRESSED_RGB_S3TC_DXT1_EXT,DXT3:Be.COMPRESSED_RGBA_S3TC_DXT3_EXT,DXT5:Be.COMPRESSED_RGBA_S3TC_DXT5_EXT,"ATC ":Be.COMPRESSED_RGB_ATC_WEBGL,ATCA:Be.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL,ATCI:Be.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL},LDt=W_e,MDt=KC,qDt=KC,NDt={DXT1:W_e,DXT3:KC,DXT5:KC,"ATC ":LDt,ATCA:MDt,ATCI:qDt};function z_e(e){return new Uint32Array(e,0,ko.HEADER_LENGTH)[ko.MAGIC_NUMBER_INDEX]===ko.MAGIC_NUMBER}function H_e(e){let t=new Int32Array(e,0,ko.HEADER_LENGTH),r=t[ko.HEADER_PF_FOURCC_INDEX];Jt(Boolean(t[ko.HEADER_PF_FLAGS_INDEX]&ko.DDPF_FOURCC),"DDS: Unsupported format, must contain a FourCC code");let n=UDt(r),i=jDt[n],a=NDt[n];Jt(i&&a,`DDS: Unknown pixel format ${r}`);let o=1;t[ko.HEADER_FLAGS_INDEX]&ko.DDSD_MIPMAPCOUNT&&(o=Math.max(1,t[ko.MIPMAPCOUNT_INDEX]));let s=t[ko.HEADER_WIDTH_INDEX],u=t[ko.HEADER_HEIGHT_INDEX],c=t[ko.HEADER_SIZE_INDEX]+4,l=new Uint8Array(e,c);return kv(l,{mipMapLevels:o,width:s,height:u,sizeFunction:a,internalFormat:i})}function W_e(e,t){return(e+3>>2)*(t+3>>2)*8}function KC(e,t){return(e+3>>2)*(t+3>>2)*16}function UDt(e){return String.fromCharCode(e&255,e>>8&255,e>>16&255,e>>24&255)}var vs={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},GDt={0:[Be.COMPRESSED_RGB_PVRTC_2BPPV1_IMG],1:[Be.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG],2:[Be.COMPRESSED_RGB_PVRTC_4BPPV1_IMG],3:[Be.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG],6:[Be.COMPRESSED_RGB_ETC1_WEBGL],7:[Be.COMPRESSED_RGB_S3TC_DXT1_EXT],9:[Be.COMPRESSED_RGBA_S3TC_DXT3_EXT],11:[Be.COMPRESSED_RGBA_S3TC_DXT5_EXT],22:[Be.COMPRESSED_RGB8_ETC2],23:[Be.COMPRESSED_RGBA8_ETC2_EAC],24:[Be.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2],25:[Be.COMPRESSED_R11_EAC],26:[Be.COMPRESSED_RG11_EAC],27:[Be.COMPRESSED_RGBA_ASTC_4X4_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR],28:[Be.COMPRESSED_RGBA_ASTC_5X4_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR],29:[Be.COMPRESSED_RGBA_ASTC_5X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR],30:[Be.COMPRESSED_RGBA_ASTC_6X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR],31:[Be.COMPRESSED_RGBA_ASTC_6X6_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR],32:[Be.COMPRESSED_RGBA_ASTC_8X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR],33:[Be.COMPRESSED_RGBA_ASTC_8X6_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR],34:[Be.COMPRESSED_RGBA_ASTC_8X8_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR],35:[Be.COMPRESSED_RGBA_ASTC_10X5_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR],36:[Be.COMPRESSED_RGBA_ASTC_10X6_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR],37:[Be.COMPRESSED_RGBA_ASTC_10X8_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR],38:[Be.COMPRESSED_RGBA_ASTC_10X10_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR],39:[Be.COMPRESSED_RGBA_ASTC_12X10_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR],40:[Be.COMPRESSED_RGBA_ASTC_12X12_KHR,Be.COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR]},zDt={0:V_e,1:V_e,2:K_e,3:K_e,6:u_,7:u_,9:c_,11:c_,22:u_,23:c_,24:u_,25:u_,26:c_,27:c_,28:HDt,29:WDt,30:VDt,31:KDt,32:XDt,33:YDt,34:$Dt,35:JDt,36:QDt,37:ZDt,38:eFt,39:tFt,40:rFt};function X_e(e){let r=new Uint32Array(e,0,vs.HEADER_LENGTH)[vs.MAGIC_NUMBER_INDEX];return r===vs.MAGIC_NUMBER||r===vs.MAGIC_NUMBER_EXTRA}function Y_e(e){let t=new Uint32Array(e,0,vs.HEADER_LENGTH),r=t[vs.PIXEL_FORMAT_INDEX],n=t[vs.COLOUR_SPACE_INDEX],i=GDt[r]||[],a=i.length>1&&n?i[1]:i[0],o=zDt[r],s=t[vs.MIPMAPCOUNT_INDEX],u=t[vs.WIDTH_INDEX],c=t[vs.HEIGHT_INDEX],l=vs.HEADER_SIZE+t[vs.METADATA_SIZE_INDEX],f=new Uint8Array(e,l);return kv(f,{mipMapLevels:s,width:u,height:c,sizeFunction:o,internalFormat:a})}function V_e(e,t){return e=Math.max(e,16),t=Math.max(t,8),e*t/4}function K_e(e,t){return e=Math.max(e,8),t=Math.max(t,8),e*t/2}function u_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*8}function c_(e,t){return Math.floor((e+3)/4)*Math.floor((t+3)/4)*16}function HDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+3)/4)*16}function WDt(e,t){return Math.floor((e+4)/5)*Math.floor((t+4)/5)*16}function VDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+4)/5)*16}function KDt(e,t){return Math.floor((e+5)/6)*Math.floor((t+5)/6)*16}function XDt(e,t){return Math.floor((e+7)/8)*Math.floor((t+4)/5)*16}function YDt(e,t){return Math.floor((e+7)/8)*Math.floor((t+5)/6)*16}function $Dt(e,t){return Math.floor((e+7)/8)*Math.floor((t+7)/8)*16}function JDt(e,t){return Math.floor((e+9)/10)*Math.floor((t+4)/5)*16}function QDt(e,t){return Math.floor((e+9)/10)*Math.floor((t+5)/6)*16}function ZDt(e,t){return Math.floor((e+9)/10)*Math.floor((t+7)/8)*16}function eFt(e,t){return Math.floor((e+9)/10)*Math.floor((t+9)/10)*16}function tFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+9)/10)*16}function rFt(e,t){return Math.floor((e+11)/12)*Math.floor((t+11)/12)*16}function $_e(e){if(VC(e))return q_e(e);if(z_e(e))return H_e(e);if(X_e(e))return Y_e(e);throw new Error("Texture container format not recognized")}var J_e={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}}},XC={...J_e,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 s_(e,t))[0]):$_e(e)}};var bq={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 Pv=!0,Q_e=1735152710,_q=12,YC=8,nFt=1313821514,iFt=5130562,aFt=0,oFt=0,sFt=1;function uFt(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 Z_e(e,t=0,r={}){let n=new DataView(e),{magic:i=Q_e}=r,a=n.getUint32(t,!1);return a===i||a===Q_e}function e2e(e,t,r=0,n={}){let i=new DataView(t),a=uFt(i,r+0),o=i.getUint32(r+4,Pv),s=i.getUint32(r+8,Pv);switch(Object.assign(e,{header:{byteOffset:r,byteLength:s,hasBinChunk:!1},type:a,version:o,json:{},binChunks:[]}),r+=_q,e.version){case 1:return cFt(e,i,r);case 2:return lFt(e,i,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function cFt(e,t,r){Jt(e.header.byteLength>_q+YC);let n=t.getUint32(r+0,Pv),i=t.getUint32(r+4,Pv);return r+=YC,Jt(i===aFt),yq(e,t,r,n),r+=n,r+=xq(e,t,r,e.header.byteLength),r}function lFt(e,t,r,n){return Jt(e.header.byteLength>_q+YC),fFt(e,t,r,n),r+e.header.byteLength}function fFt(e,t,r,n){for(;r+8<=e.header.byteLength;){let i=t.getUint32(r+0,Pv),a=t.getUint32(r+4,Pv);switch(r+=YC,a){case nFt:yq(e,t,r,i);break;case iFt:xq(e,t,r,i);break;case oFt:n.strict||yq(e,t,r,i);break;case sFt:n.strict||xq(e,t,r,i);break;default:break}r+=Co(i,4)}return r}function yq(e,t,r,n){let i=new Uint8Array(t.buffer,r,n),o=new TextDecoder("utf8").decode(i);return e.json=JSON.parse(o),Co(n,4)}function xq(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),Co(n,4)}function Eq(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 Aq={};ca(Aq,{decode:()=>wFt,name:()=>EFt});var dFt="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",hFt="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",pFt=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]),mFt=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]),gFt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},vFt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function t2e(e,t,r,n,i,a="NONE"){let o=await bFt();_Ft(o,o.exports[vFt[i]],e,t,r,n,o.exports[gFt[a||"NONE"]])}var wq;async function bFt(){return wq||(wq=yFt()),wq}async function yFt(){let e=dFt;WebAssembly.validate(pFt)&&(e=hFt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(xFt(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function xFt(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?mFt[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function _Ft(e,t,r,n,i,a,o){let s=e.exports.sbrk,u=n+3&-4,c=s(u*i),l=s(a.length),f=new Uint8Array(e.exports.memory.buffer);f.set(a,l);let d=t(c,n,i,l,a.length);if(d===0&&o&&o(c,u,i),r.set(f.subarray(c,c+n*i)),s(c-s(0)),d!==0)throw new Error(`Malformed buffer data: ${d}`)}var $C="EXT_meshopt_compression",EFt=$C;async function wFt(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(AFt(r,o));await Promise.all(n),r.removeExtension($C)}async function AFt(e,t){let r=e.getObjectExtension(t,$C);if(r){let{byteOffset:n=0,byteLength:i=0,byteStride:a,count:o,mode:s,filter:u="NONE",buffer:c}=r,l=e.gltf.buffers[c],f=new Uint8Array(l.arrayBuffer,l.byteOffset+n,i),d=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await t2e(d,o,a,f,s,u),e.removeObjectExtension(t,$C)}}var Sq={};ca(Sq,{name:()=>SFt,preprocess:()=>TFt});var jv="EXT_texture_webp",SFt=jv;function TFt(e,t){let r=new qr(e);if(!nq("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 Tq={};ca(Tq,{name:()=>CFt,preprocess:()=>DFt});var JC="KHR_texture_basisu",CFt=JC;function DFt(e,t){let r=new qr(e),{json:n}=r;for(let i of n.textures||[]){let a=r.getObjectExtension(i,JC);a&&(i.source=a.source,r.removeObjectExtension(i,JC))}r.removeExtension(JC)}var Dq={};ca(Dq,{decode:()=>kFt,encode:()=>IFt,name:()=>RFt,preprocess:()=>OFt});function r2e(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let i=Cq(n);t[r]=i}}return t}function Cq(e){let{buffer:t,size:r,count:n}=FFt(e);return{value:t,size:r,byteOffset:0,count:n,type:IC(r),componentType:Cv(t)}}function FFt(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=BFt(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function BFt(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Sd="KHR_draco_mesh_compression",RFt=Sd;function OFt(e,t,r){let n=new qr(e);for(let i of n2e(n))n.getObjectExtension(i,Sd)}async function kFt(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 n2e(n))n.getObjectExtension(o,Sd)&&i.push(PFt(n,o,t,r));await Promise.all(i),n.removeExtension(Sd)}function IFt(e,t={}){let r=new qr(e);for(let n of r.json.meshes||[])jFt(n,t),r.addRequiredExtension(Sd)}async function PFt(e,t,r,n){let i=e.getObjectExtension(t,Sd);if(!i)return;let a=e.getTypedArrayForBufferView(i.bufferView),o=zh(a.buffer,a.byteOffset),s={...r};delete s["3d-tiles"];let u=await So(o,xv,s,n),c=r2e(u.attributes);for(let[l,f]of Object.entries(c))if(l in t.attributes){let d=t.attributes[l],h=e.getAccessor(d);h!=null&&h.min&&(h!=null&&h.max)&&(f.min=h.min,f.max=h.max)}t.attributes=c,u.indices&&(t.indices=Cq(u.indices)),e.removeObjectExtension(t,Sd),LFt(t)}function jFt(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:{[Sd]:{bufferView:u,attributes:s}}}]}}function LFt(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*n2e(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Bq={};ca(Bq,{decode:()=>UFt,name:()=>MFt});var Fq="KHR_texture_transform",MFt=Fq,QC=new ce,qFt=new Pr,NFt=new Pr;async function UFt(e,t){var a;if(!new qr(e).hasExtension(Fq)||!((a=t.gltf)!=null&&a.loadBuffers))return;let i=e.json.materials||[];for(let o=0;o<i.length;o++)GFt(o,e)}function GFt(e,t){var c,l,f;let r=[],n=(c=t.json.materials)==null?void 0:c[e],i=(l=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:l.baseColorTexture;i&&l_(t,e,i,r);let a=n==null?void 0:n.emissiveTexture;a&&l_(t,e,a,r);let o=n==null?void 0:n.normalTexture;o&&l_(t,e,o,r);let s=n==null?void 0:n.occlusionTexture;s&&l_(t,e,s,r);let u=(f=n==null?void 0:n.pbrMetallicRoughness)==null?void 0:f.metallicRoughnessTexture;u&&l_(t,e,u,r)}function l_(e,t,r,n){let i=zFt(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&&HFt(e,s,i)}}function zFt(e,t){var o;let r=(o=e.extensions)==null?void 0:o[Fq],{texCoord:n=0}=e,{texCoord:i=n}=r;if(!(t.findIndex(([s,u])=>s===n&&u===i)!==-1)){let s=KFt(r);return n!==i&&(e.texCoord=i),t.push([n,i]),{originalTexCoord:n,texCoord:i,matrix:s}}return null}function HFt(e,t,r){var s,u;let{originalTexCoord:n,texCoord:i,matrix:a}=r,o=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(o)){let c=(s=e.json.accessors)==null?void 0:s[o];if(c&&c.bufferView){let l=(u=e.json.bufferViews)==null?void 0:u[c.bufferView];if(l){let{arrayBuffer:f,byteOffset:d}=e.buffers[l.buffer],h=(d||0)+(c.byteOffset||0)+(l.byteOffset||0),{ArrayType:p,length:b}=Dv(c,l),g=kC[c.componentType],x=OC[c.type],w=l.byteStride||g*x,S=new Float32Array(b);for(let F=0;F<c.count;F++){let D=new p(f,h+F*w,2);QC.set(D[0],D[1],1),QC.transformByMatrix3(a),S.set([QC[0],QC[1]],F*x)}n===i?WFt(c,l,e.buffers,S):VFt(i,c,t,e,S)}}}}function WFt(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 VFt(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 KFt(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,i=new Pr().set(1,0,0,0,1,0,t[0],t[1],1),a=qFt.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),o=NFt.set(n[0],0,0,0,n[1],0,0,0,1);return i.multiplyRight(a).multiplyRight(o)}var Rq={};ca(Rq,{decode:()=>YFt,encode:()=>$Ft,name:()=>XFt});var Ip="KHR_lights_punctual",XFt=Ip;async function YFt(e){let t=new qr(e),{json:r}=t,n=t.getExtension(Ip);n&&(t.json.lights=n.lights,t.removeExtension(Ip));for(let i of r.nodes||[]){let a=t.getObjectExtension(i,Ip);a&&(i.light=a.light),t.removeObjectExtension(i,Ip)}}async function $Ft(e){let t=new qr(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ip);Ni(!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,Ip,n)}delete t.json.lights}}var Oq={};ca(Oq,{decode:()=>QFt,encode:()=>ZFt,name:()=>JFt});var f_="KHR_materials_unlit",JFt=f_;async function QFt(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,f_);t.removeExtension(f_)}function ZFt(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,f_,{}),t.addExtension(f_))}var kq={};ca(kq,{decode:()=>t4t,encode:()=>r4t,name:()=>e4t});var d_="KHR_techniques_webgl",e4t=d_;async function t4t(e){let t=new qr(e),{json:r}=t,n=t.getExtension(d_);if(n){let i=n4t(n,t);for(let a of r.materials||[]){let o=t.getObjectExtension(a,d_);o&&(a.technique=Object.assign({},o,i[o.technique]),a.technique.values=i4t(a.technique,t)),t.removeObjectExtension(a,d_)}t.removeExtension(d_)}}async function r4t(e,t){}function n4t(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 i4t(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 i2e=[sq,iq,Aq,Sq,Tq,Dq,Rq,Oq,kq,Bq,uq];function a2e(e,t={},r){var i;let n=i2e.filter(a=>s2e(a.name,t));for(let a of n)(i=a.preprocess)==null||i.call(a,e,t,r)}async function o2e(e,t={},r){var i;let n=i2e.filter(a=>s2e(a.name,t));for(let a of n)await((i=a.decode)==null?void 0:i.call(a,e,t,r))}function s2e(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 Iq="KHR_binary_glTF";function u2e(e){let t=new qr(e),{json:r}=t;for(let n of r.images||[]){let i=t.getObjectExtension(n,Iq);i&&Object.assign(n,i),t.removeObjectExtension(n,Iq)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(Iq)}var c2e={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},o4t={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Pq=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),u2e(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 c2e)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 c2e)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=o4t[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 l2e(e,t={}){return new Pq().normalize(e,t)}async function f2e(e,t,r=0,n,i){var a,o,s;return s4t(e,t,r,n),l2e(e,{normalize:(a=n==null?void 0:n.gltf)==null?void 0:a.normalize}),a2e(e,n,i),(o=n==null?void 0:n.gltf)!=null&&o.loadBuffers&&e.json.buffers&&await u4t(e,n,i),(s=n==null?void 0:n.gltf)!=null&&s.loadImages&&await c4t(e,n,i),await o2e(e,n,i),e}function s4t(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Z_e(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=GI(t);else if(t instanceof ArrayBuffer){let o={};r=e2e(o,t,r,n.glb),Ni(o.type==="glTF",`Invalid GLB magic string ${o.type}`),e._glb=o,e.json=o.json}else Ni(!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 u4t(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;Ni(u);let c=Eq(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 c4t(e,t,r){let n=l4t(e),i=e.json.images||[],a=[];for(let o of n)a.push(f4t(e,i[o],o,t,r));return await Promise.all(a)}function l4t(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 f4t(e,t,r,n,i){let a;if(t.uri&&!t.hasOwnProperty("bufferView")){let s=Eq(t.uri,n),{fetch:u}=i;a=await(await u(s)).arrayBuffer(),t.bufferView={data:a}}if(Number.isFinite(t.bufferView)){let s=x_e(e.json,e.buffers,t.bufferView);a=zh(s.buffer,s.byteOffset,s.byteLength)}Ni(a,"glTF image has no data");let o=await So(a,[Tv,kp],{...n,mimeType:t.mimeType,basis:n.basis||{format:Iv()}},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 kl={name:"glTF",id:"gltf",module:"gltf",version:NC,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:d4t,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function d4t(e,t={},r){t={...kl.options,...t},t.gltf={...kl.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await f2e({},e,n,t,r)}var h4t=1179937895,p4t=1313821514,m4t=5130562,_c=!0;function d2e(e,t,r=0,n={}){let{magic:i=h4t,version:a=2,json:o={},binary:s}=e,u=r;t&&(t.setUint32(r+0,i,_c),t.setUint32(r+4,a,_c),t.setUint32(r+8,0,_c));let c=r+8;r+=12;let l=r;t&&(t.setUint32(r+0,0,_c),t.setUint32(r+4,p4t,_c)),r+=8;let f=JSON.stringify(o);if(r=Rm(t,r,f,4),t){let d=r-l-8;t.setUint32(l+0,d,_c)}if(s){let d=r;if(t&&(t.setUint32(r+0,0,_c),t.setUint32(r+4,m4t,_c)),r+=8,r=RA(t,r,s,4),t){let h=r-d-8;t.setUint32(d+0,h,_c)}}if(t){let d=r-u;t.setUint32(c,d,_c)}return r}function jq(e,t,r,n){return g4t(e),d2e(e,t,r,n)}function g4t(e,{firstBuffer:t=0}={}){if(e.buffers&&e.buffers.length>t)throw new Error("encodeGLTF: multiple buffers not yet implemented")}var Lq={name:"glTF",id:"gltf",module:"gltf",version:NC,extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,encodeSync:v4t,options:{gltf:{}}};function v4t(e,t={}){let{byteOffset:r=0}=t,n=jq(e,null,r,t),i=new ArrayBuffer(n),a=new DataView(i);return jq(e,a,r,t),i}var b4t={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},y4t={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},bs={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},x4t={magFilter:bs.TEXTURE_MAG_FILTER,minFilter:bs.TEXTURE_MIN_FILTER,wrapS:bs.TEXTURE_WRAP_S,wrapT:bs.TEXTURE_WRAP_T},_4t={[bs.TEXTURE_MAG_FILTER]:bs.LINEAR,[bs.TEXTURE_MIN_FILTER]:bs.NEAREST_MIPMAP_LINEAR,[bs.TEXTURE_WRAP_S]:bs.REPEAT,[bs.TEXTURE_WRAP_T]:bs.REPEAT};function E4t(){return{id:"default-sampler",parameters:_4t}}function w4t(e){return y4t[e]}function A4t(e){return b4t[e]}var Mq=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:i=[],images:a=[]}=t,{baseUri:o=""}=t;return Ni(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=w4t(t.componentType),i=A4t(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):E4t(),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 x4t[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 h_(e,t){return new Mq().postProcess(e,t)}var ZC={URI:0,EMBEDDED:1};function eD(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=zh(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 tD(e,t,r,n){let i=(r==null?void 0:r["3d-tiles"])||{};if(S4t(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 So(e.gltfArrayBuffer,kl,r,n);e.gltf=h_(a),e.gpuMemoryUsageInBytes=n_(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function S4t(e,t,r){switch(t){case ZC.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 ZC.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function h2e(e,t,r,n,i){var o;r=T4t(e,t,r,n,i),await tD(e,ZC.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 T4t(e,t,r,n,i){r=Ad(e,t,r),r=wv(e,t,r),r=Av(e,t,r,n),r=eD(e,t,r,n);let a=new Rl(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=a.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3),r}async function p2e(e,t,r,n,i){return r=C4t(e,t,r,n,i),await tD(e,e.gltfFormat||0,n,i),r}function C4t(e,t,r,n,i){var c;if(r=Ad(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=wv(e,t,r);let a=new DataView(t);if(e.gltfFormat=a.getUint32(r,!0),r+=4,r=Av(e,t,r,n),r=eD(e,t,r,n),!((c=e==null?void 0:e.header)!=null&&c.featureTableJsonByteLength)||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let o=new Rl(e.featureTableJson,e.featureTableBinary),s=o.getGlobalProperty("INSTANCES_LENGTH");if(o.featuresLength=s,!Number.isFinite(s))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=o.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=o.getGlobalProperty("RTC_CENTER",Zt.FLOAT,3);let u=new Rp(e.batchTableJson,e.batchTableBinary,s);return D4t(e,o,u,s),r}function D4t(e,t,r,n){let i=new Array(n),a=new ce,o=new ce,s=new ce,u=new ce,c=new Pr,l=new hs,f=new ce,d={},h=new Kr,p=[],b=[],g=[],x=[];for(let w=0;w<n;w++){let S;if(t.hasProperty("POSITION"))S=t.getProperty("POSITION",Zt.FLOAT,3,w,a);else if(t.hasProperty("POSITION_QUANTIZED")){S=t.getProperty("POSITION_QUANTIZED",Zt.UNSIGNED_SHORT,3,w,a);let k=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Zt.FLOAT,3);if(!k)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let I=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Zt.FLOAT,3);if(!I)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*I[Y]+k[Y]}if(!S)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");a.copy(S),d.translation=a,e.normalUp=t.getProperty("NORMAL_UP",Zt.FLOAT,3,w,p),e.normalRight=t.getProperty("NORMAL_RIGHT",Zt.FLOAT,3,w,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",Zt.UNSIGNED_SHORT,2,w,p),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",Zt.UNSIGNED_SHORT,2,w,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),d.rotation=l,f.set(1,1,1);let D=t.getProperty("SCALE",Zt.FLOAT,1,w,g);Number.isFinite(D)&&f.multiplyByScalar(D);let j=t.getProperty("SCALE_NON_UNIFORM",Zt.FLOAT,3,w,p);j&&f.scale(j),d.scale=f;let B=t.getProperty("BATCH_ID",Zt.UNSIGNED_SHORT,1,w,x);B===void 0&&(B=w);let N=new Kr().fromQuaternion(d.rotation);h.identity(),h.translate(d.translation),h.multiplyRight(N),h.scale(d.scale);let C=h.clone();i[w]={modelMatrix:C,batchId:B}}e.instances=i}async function m2e(e,t,r,n,i,a){r=Ad(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 g2e(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 So(t,kl,r,n);e.gltf=h_(o),e.gpuMemoryUsageInBytes=n_(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function qq(e,t=0,r,n,i={shape:"tile3d"}){switch(i.byteOffset=t,i.type=M1e(e,t),i.type){case ms.COMPOSITE:return await m2e(i,e,t,r,n,qq);case ms.BATCHED_3D_MODEL:return await h2e(i,e,t,r,n);case ms.GLTF:return await g2e(i,e,r,n);case ms.INSTANCED_3D_MODEL:return await p2e(i,e,t,r,n);case ms.POINT_CLOUD:return await i_e(i,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${i.type}`)}}async function Nq(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=v2e(e.slice(8,16)),o=new Uint8Array(e,24,a),u=new TextDecoder("utf8").decode(o),c=JSON.parse(u),l=v2e(e.slice(16,24)),f=new ArrayBuffer(0);if(l&&(f=e.slice(24+a)),await rD(c,c.tileAvailability,f,r),Array.isArray(c.contentAvailability))for(let d of c.contentAvailability)await rD(c,d,f,r);else await rD(c,c.contentAvailability,f,r);return await rD(c,c.childSubtreeAvailability,f,r),c}async function rD(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 v2e(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var nD={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:yv,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Nq,options:{}};function Uq(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function hu(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Uq()}var F4t=globalThis.self||globalThis.window||globalThis.global,Lv=globalThis.window||globalThis.self||globalThis.global,B4t=globalThis.document||{},Pp=globalThis.process||{},R4t=globalThis.console,jEr=globalThis.navigator||{};var iD="4.0.0-beta.6",qEr=hu();function O4t(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var aD=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=O4t(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 b2e(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 y2e(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 oD(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 sD;(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"})(sD||(sD={}));var k4t=10;function x2e(e){return typeof e!="string"?e:(e=e.toUpperCase(),sD[e]||sD.WHITE)}function _2e(e,t,r){if(!hu&&typeof e=="string"){if(t){let n=x2e(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=x2e(r);e="\x1B[".concat(n+k4t,"m").concat(e,"\x1B[49m")}}return e}function E2e(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 jp(){let e;if(hu()&&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 Pp){var n;let i=Pp===null||Pp===void 0||(n=Pp.hrtime)===null||n===void 0?void 0:n.call(Pp);e=i[0]*1e3+i[1]/1e6}else e=Date.now();return e}var qv={debug:hu()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},I4t={enabled:!0,level:0};function ys(){}var w2e={},A2e={once:!0},p_=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=iD,this._startTs=jp(),this._deltaTs=jp(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new aD("__probe-".concat(this.id,"__"),I4t),this.timeStamp("".concat(this.id," started")),E2e(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((jp()-this._startTs).toPrecision(10))}getDelta(){return Number((jp()-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,A2e)}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,A2e)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||ys,n&&[n],{tag:M4t(r)}):ys}image(t){let{logLevel:r,priority:n,image:i,message:a="",scale:o=1}=t;return this._shouldLog(r||n)?hu()?L4t({image:i,message:a,scale:o}):j4t({image:i,message:a,scale:o}):ys}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||ys)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},i=S2e({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||ys)}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()>=T2e(t)}_getLogFunction(t,r,n,i,a){if(this._shouldLog(t)){a=S2e({logLevel:t,message:r,args:i,opts:a}),n=n||a.method,Mv(n),a.total=this.getTotal(),a.delta=this.getDelta(),this._deltaTs=jp();let o=a.tag||a.message;if(a.once&&o)if(!w2e[o])w2e[o]=jp();else return ys;return r=P4t(this.id,a.message,a),n.bind(console,r,...a.args)}return ys}};p_.VERSION=iD;function T2e(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 S2e(e){let{logLevel:t,message:r}=e;e.logLevel=T2e(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 P4t(e,t,r){if(typeof t=="string"){let n=r.time?y2e(b2e(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=_2e(t,r.color,r.background)}return t}function j4t(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),ys}function L4t(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let a=new Image;return a.onload=()=>{let o=oD(a,r,n);console.log(...o)},a.src=t,ys}let i=t.nodeName||"";if(i.toLowerCase()==="img")return console.log(...oD(t,r,n)),ys;if(i.toLowerCase()==="canvas"){let a=new Image;return a.onload=()=>console.log(...oD(a,r,n)),a.src=t.toDataURL(),ys}return ys}function M4t(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Gq=new p_({id:"@probe.gl/log"});var xs=null;try{xs=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 Bn(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Bn.prototype.__isLong__;Object.defineProperty(Bn.prototype,"__isLong__",{value:!0});function Ma(e){return(e&&e.__isLong__)===!0}function C2e(e){var t=Math.clz32(e&-e);return e?31-t:t}Bn.isLong=Ma;var D2e={},F2e={};function Lp(e,t){var r,n,i;return t?(e>>>=0,(i=0<=e&&e<256)&&(n=F2e[e],n)?n:(r=Xr(e,0,!0),i&&(F2e[e]=r),r)):(e|=0,(i=-128<=e&&e<128)&&(n=D2e[e],n)?n:(r=Xr(e,e<0?-1:0,!1),i&&(D2e[e]=r),r))}Bn.fromInt=Lp;function _s(e,t){if(isNaN(e))return t?Il:pu;if(t){if(e<0)return Il;if(e>=k2e)return j2e}else{if(e<=-R2e)return mo;if(e+1>=R2e)return P2e}return e<0?_s(-e,t).neg():Xr(e%Uv|0,e/Uv|0,t)}Bn.fromNumber=_s;function Xr(e,t,r){return new Bn(e,t,r)}Bn.fromBits=Xr;var uD=Math.pow;function Hq(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?Il:pu;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 Hq(e.substring(1),t,r).neg();for(var i=_s(uD(r,8)),a=pu,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=_s(uD(r,s));a=a.mul(c).add(_s(u))}else a=a.mul(i),a=a.add(_s(u))}return a.unsigned=t,a}Bn.fromString=Hq;function mu(e,t){return typeof e=="number"?_s(e,t):typeof e=="string"?Hq(e,t):Xr(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Bn.fromValue=mu;var B2e=1<<16,q4t=1<<24,Uv=B2e*B2e,k2e=Uv*Uv,R2e=k2e/2,O2e=Lp(q4t),pu=Lp(0);Bn.ZERO=pu;var Il=Lp(0,!0);Bn.UZERO=Il;var Nv=Lp(1);Bn.ONE=Nv;var I2e=Lp(1,!0);Bn.UONE=I2e;var zq=Lp(-1);Bn.NEG_ONE=zq;var P2e=Xr(-1,2147483647,!1);Bn.MAX_VALUE=P2e;var j2e=Xr(-1,-1,!0);Bn.MAX_UNSIGNED_VALUE=j2e;var mo=Xr(0,-2147483648,!1);Bn.MIN_VALUE=mo;var Ke=Bn.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(mo)){var r=_s(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=_s(uD(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(mo)?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 Ma(t)||(t=mu(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(Ma(t)||(t=mu(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(mo)?mo:this.not().add(Nv)};Ke.neg=Ke.negate;Ke.add=function(t){Ma(t)||(t=mu(t));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,a=this.low&65535,o=t.high>>>16,s=t.high&65535,u=t.low>>>16,c=t.low&65535,l=0,f=0,d=0,h=0;return h+=a+c,d+=h>>>16,h&=65535,d+=i+u,f+=d>>>16,d&=65535,f+=n+s,l+=f>>>16,f&=65535,l+=r+o,l&=65535,Xr(d<<16|h,l<<16|f,this.unsigned)};Ke.subtract=function(t){return Ma(t)||(t=mu(t)),this.add(t.neg())};Ke.sub=Ke.subtract;Ke.multiply=function(t){if(this.isZero())return this;if(Ma(t)||(t=mu(t)),xs){var r=xs.mul(this.low,this.high,t.low,t.high);return Xr(r,xs.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?Il:pu;if(this.eq(mo))return t.isOdd()?mo:pu;if(t.eq(mo))return this.isOdd()?mo:pu;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(O2e)&&t.lt(O2e))return _s(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,a=this.low>>>16,o=this.low&65535,s=t.high>>>16,u=t.high&65535,c=t.low>>>16,l=t.low&65535,f=0,d=0,h=0,p=0;return p+=o*l,h+=p>>>16,p&=65535,h+=a*l,d+=h>>>16,h&=65535,h+=o*c,d+=h>>>16,h&=65535,d+=i*l,f+=d>>>16,d&=65535,d+=a*c,f+=d>>>16,d&=65535,d+=o*u,f+=d>>>16,d&=65535,f+=n*l+i*c+a*u+o*s,f&=65535,Xr(h<<16|p,f<<16|d,this.unsigned)};Ke.mul=Ke.multiply;Ke.divide=function(t){if(Ma(t)||(t=mu(t)),t.isZero())throw Error("division by zero");if(xs){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?xs.div_u:xs.div_s)(this.low,this.high,t.low,t.high);return Xr(r,xs.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Il:pu;var n,i,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Il;if(t.gt(this.shru(1)))return I2e;a=Il}else{if(this.eq(mo)){if(t.eq(Nv)||t.eq(zq))return mo;if(t.eq(mo))return Nv;var o=this.shr(1);return n=o.div(t).shl(1),n.eq(pu)?t.isNegative()?Nv:zq:(i=this.sub(t.mul(n)),a=n.add(i.div(t)),a)}else if(t.eq(mo))return this.unsigned?Il:pu;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=pu}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:uD(2,s-48),c=_s(n),l=c.mul(t);l.isNegative()||l.gt(i);)n-=u,c=_s(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(Ma(t)||(t=mu(t)),xs){var r=(this.unsigned?xs.rem_u:xs.rem_s)(this.low,this.high,t.low,t.high);return Xr(r,xs.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};Ke.mod=Ke.modulo;Ke.rem=Ke.modulo;Ke.not=function(){return Xr(~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?C2e(this.low):C2e(this.high)+32};Ke.ctz=Ke.countTrailingZeros;Ke.and=function(t){return Ma(t)||(t=mu(t)),Xr(this.low&t.low,this.high&t.high,this.unsigned)};Ke.or=function(t){return Ma(t)||(t=mu(t)),Xr(this.low|t.low,this.high|t.high,this.unsigned)};Ke.xor=function(t){return Ma(t)||(t=mu(t)),Xr(this.low^t.low,this.high^t.high,this.unsigned)};Ke.shiftLeft=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Xr(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Xr(0,this.low<<t-32,this.unsigned)};Ke.shl=Ke.shiftLeft;Ke.shiftRight=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Xr(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Xr(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};Ke.shr=Ke.shiftRight;Ke.shiftRightUnsigned=function(t){return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Xr(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Xr(this.high,0,this.unsigned):Xr(this.high>>>t-32,0,this.unsigned)};Ke.shru=Ke.shiftRightUnsigned;Ke.shr_u=Ke.shiftRightUnsigned;Ke.rotateLeft=function(t){var r;return Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Xr(this.high,this.low,this.unsigned):t<32?(r=32-t,Xr(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Xr(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 Ma(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Xr(this.high,this.low,this.unsigned):t<32?(r=32-t,Xr(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Xr(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};Ke.rotr=Ke.rotateRight;Ke.toSigned=function(){return this.unsigned?Xr(this.low,this.high,!1):this};Ke.toUnsigned=function(){return this.unsigned?this:Xr(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]};Bn.fromBytes=function(t,r,n){return n?Bn.fromBytesLE(t,r):Bn.fromBytesBE(t,r)};Bn.fromBytesLE=function(t,r){return new Bn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Bn.fromBytesBE=function(t,r){return new Bn(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=Bn;var N4t=16;function m_(e){e==="X"&&(e="");let t=e.padEnd(N4t,"0");return Gv.fromString(t,!0,16)}function Wq(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 Vq(e,t){let r=U4t(e).shiftRightUnsigned(2);return e.add(Gv.fromNumber(2*t+1-4).multiply(r))}function U4t(e){return e.and(e.not().add(1))}var G4t=3,z4t=30,H4t=2*z4t+1,L2e=180/Math.PI;function q2e(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);W4t(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 N2e(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<G4t+H4t;)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 Kq(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function M2e(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Xq(e){return[M2e(e[0]),M2e(e[1])]}function Yq(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 $q([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*L2e,n*L2e]}function W4t(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 U2e(e){let t=Kq(e.ij,e.level,[.5,.5]),r=Xq(t),n=Yq(e.face,r);return $q(n)}var V4t=100;function Jq(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(V4t*Math.pow(2,-n))),o=new Float64Array(4*a*2+2),s=0,u=0;for(let c=0;c<4;c++){let l=i[c].slice(0),f=i[c+1],d=(f[0]-l[0])/a,h=(f[1]-l[1])/a;for(let p=0;p<a;p++){l[0]+=d,l[1]+=h;let b=Kq(r,n,l),g=Xq(b),x=Yq(t,g),w=$q(x);Math.abs(w[1])>89.999&&(w[0]=u);let S=w[0]-u;w[0]+=S>180?-360:S<-180?360:0,o[s++]=w[0],o[s++]=w[1],u=w[0]}}return o[s++]=o[0],o[s++]=o[1],o}function zv(e){let t=K4t(e);return q2e(t)}function K4t(e){if(e.indexOf("/")>0)return e;let t=m_(e);return N2e(t)}function Qq(e){let t=zv(e);return U2e(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=Jq(o);(typeof r>"u"||r===null)&&(r=new Float64Array(4*s.length)),r.set(s,n),n+=s.length}t=G2e(r)}else{let r=Jq(e);t=G2e(r)}return t}function G2e(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 Zq(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 cD(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Zq(t,r),i=Qq(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=Q1(n);return[...c.center,...c.halfAxes]}var X4t=4,Y4t=8,$4t={QUADTREE:X4t,OCTREE:Y4t};function J4t(e,t,r){if(e!=null&&e.box){let n=m_(e.s2VolumeInfo.token),i=Vq(n,t),a=Wq(i),o={...e.s2VolumeInfo};switch(o.token=a,r){case"OCTREE":let c=e.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,f=l/2,d=c.minimumHeight+l/2;c.minimumHeight=d-f,c.maximumHeight=d+f;break;default:break}return{box:cD(o),s2VolumeInfo:o}}}async function tN(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:i={level:0,mortonIndex:0,x:0,y:0,z:0},s2VolumeBox:a,loaderOptions:o}=e,{subtree:s,level:u=0}=e,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:f,contentUrlTemplate:d,subtreesUriTemplate:h,basePath:p}=t,b={children:[],lodMetricValue:0,contentUrl:""};if(!f)return Gq.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${d} won't be loaded...`),b;let g=u+i.level;if(g>f)return b;let x=$4t[c],w=Math.log2(x),S=n&1,F=n>>1&1,D=n>>2&1,j=(x**u-1)/(x-1),B=Mp(r.mortonIndex,n,w),N=j+B,C=Mp(r.x,S,1),k=Mp(r.y,F,1),I=Mp(r.z,D,1),U=!1;u>=l&&(U=eN(s.childSubtreeAvailability,B));let Y=Mp(i.x,C,u*w),$=Mp(i.y,k,u*w),re=Mp(i.z,I,u*w);if(U){let Te=`${p}/${h}`,Xe=lD(Te,g,Y,$,re);s=await mn(Xe,nD,o),i.mortonIndex=B,i.x=C,i.y=k,i.z=I,i.level=u,B=0,N=0,C=0,k=0,I=0,u=0}if(!eN(s.tileAvailability,N))return b;eN(s.contentAvailability,N)&&(b.contentUrl=lD(d,g,Y,$,re));let ye=u+1,he={mortonIndex:B,x:C,y:k,z:I};for(let Te=0;Te<x;Te++){let Xe=J4t(a,Te,c),We=await tN({subtree:s,implicitOptions:t,loaderOptions:o,parentData:he,childIndex:Te,level:ye,globalData:{...i},s2VolumeBox:Xe});if(We.contentUrl||We.children.length){let oe=g+1,ne=Q4t(We,oe,{childTileX:C,childTileY:k,childTileZ:I},t,a);b.children.push(ne)}}return b}function eN(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Gq.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?tBt(t,r.explicitBitstream):!1}function Q4t(e,t,r,n,i){let{basePath:a,refine:o,getRefine:s,lodMetricType:u,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:f}=n,d=e.contentUrl&&e.contentUrl.replace(`${a}/`,""),h=l/2**t,p=i!=null&&i.box?{box:i.box}:f,b=Z4t(t,p,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:d},id:e.contentUrl,refine:s(o),type:c(e),lodMetricType:u,lodMetricValue:h,geometricError:h,transform:e.transform,boundingVolume:b}}function Z4t(e,t,r){if(t.region){let{childTileX:n,childTileY:i,childTileZ:a}=r,[o,s,u,c,l,f]=t.region,d=2**e,h=(u-o)/d,p=(c-s)/d,b=(f-l)/d,[g,x]=[o+h*n,o+h*(n+1)],[w,S]=[s+p*i,s+p*(i+1)],[F,D]=[l+b*a,l+b*(a+1)];return{region:[g,w,x,S,F,D]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${t}`)}function Mp(e,t,r){return(e<<r)+t}function lD(e,t,r,n,i){let a=eBt({level:t,x:r,y:n,z:i});return e.replace(/{level}|{x}|{y}|{z}/gi,o=>a[o])}function eBt(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function tBt(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function nN(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 iN(e){switch(e){case"REPLACE":case"replace":return 2;case"ADD":case"add":return 1;default:return e}}function rN(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 eu.resolve(t,e)}function H2e(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);r=rN(a,t)}return{...e,id:r,contentUrl:r,lodMetricType:"geometricError",lodMetricValue:e.geometricError,transformMatrix:e.transform,type:nN(e,r),refine:iN(e.refine)}}async function K2e(e,t,r){let n=null,i=V2e(e.root);i&&e.root?n=await W2e(e.root,e,t,i,r):n=H2e(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=V2e(c),f;l?f=await W2e(c,e,t,l,r):f=H2e(c,t),f&&(u.push(f),a.push(f))}o.children=u}return n}async function W2e(e,t,r,n,i){var S,F,D;let{subdivisionScheme:a,maximumLevel:o,availableLevels:s,subtreeLevels:u,subtrees:{uri:c}}=n,l=lD(c,0,0,0,0),f=rN(l,r),d=await mn(f,nD,i),h=rN((S=e.content)==null?void 0:S.uri,r),p=(F=t==null?void 0:t.root)==null?void 0:F.refine,b=e.geometricError,g=(D=e.boundingVolume.extensions)==null?void 0:D["3DTILES_bounding_volume_S2"];if(g){let B={box:cD(g),s2VolumeInfo:g};e.boundingVolume=B}let x=e.boundingVolume,w={contentUrlTemplate:h,subtreesUriTemplate:c,subdivisionScheme:a,subtreeLevels:u,maximumLevel:Number.isFinite(s)?s-1:o,refine:p,basePath:r,lodMetricType:"geometricError",rootLodMetricValue:b,rootBoundingVolume:x,getTileType:nN,getRefine:iN};return await rBt(e,r,d,w,i)}async function rBt(e,t,r,n,i){if(!e)return null;let{children:a,contentUrl:o}=await tN({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:nN(e,s),refine:iN(e.refine),content:u||e.content,children:a}}function V2e(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 Ec={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:nBt,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function nBt(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?iBt(e,t,r):aBt(e,t,r)}async function iBt(e,t,r){var u;let n=JSON.parse(new TextDecoder().decode(e)),i=(r==null?void 0:r.url)||"",a=oBt(i),o=await K2e(n,a,t||{});return{...n,shape:"tileset3d",loader:Ec,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 aBt(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await qq(e,0,t,r,n.content),n.content}function oBt(e){return eu.dirname(e)}var X2e="https://api.cesium.com/v1/assets";async function Y2e(e,t){if(!t){let a=await sBt(e);for(let o of a.items)o.type==="3DTILES"&&(t=o.id)}let r=await uBt(e,t),{type:n,url:i}=r;return Jt(n==="3DTILES"&&i),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function sBt(e){Jt(e);let t=X2e,r={Authorization:`Bearer ${e}`},n=await Fo(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function uBt(e,t){Jt(e,t);let r={Authorization:`Bearer ${e}`},n=`${X2e}/${t}`,i=await Fo(`${n}`,{headers:r});if(!i.ok)throw new Error(i.statusText);let a=await i.json();if(i=await Fo(`${n}/endpoint`,{headers:r}),!i.ok)throw new Error(i.statusText);let o=await i.json();return a={...a,...o},a}async function cBt(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 Y2e(r,n)}var fD={...Ec,id:"cesium-ion",name:"Cesium Ion",preload:cBt,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=fD,Ec.parse(e,t,r)),options:{"cesium-ion":{...Ec.options["3d-tiles"],accessToken:null}}};var nTe=Kt(WU(),1),FIt="4.0.0-beta.6",VU={id:"zip",module:"zip",name:"Zip Archive",version:FIt,extensions:["zip"],mimeTypes:["application/zip"],category:"archive",tests:["PK"],options:{},parse:BIt};async function BIt(e,t={}){let r=[],n={};try{let i=new nTe.default;return(await i.loadAsync(e,t)).forEach((o,s)=>{let u=s.name,c=RIt(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 RIt(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 Q_=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 OIt=new Uint8Array([80,75,5,6]),kIt=new Uint8Array([80,75,6,7]),IIt=new Uint8Array([80,75,6,6]),PIt=8n,jIt=16n,LIt=8n,MIt=24n,qIt=48n,iTe=async e=>{let t=await Q_(e,OIt),r=BigInt(await e.getUint16(t+PIt)),n=BigInt(await e.getUint32(t+jIt));if(n===BigInt(4294967295)||r===BigInt(4294967295)){let i=t-20n,a=await e.slice(i,i+4n);if(!Zu(a,kIt))throw new Error("zip64 EoCD locator not found");let o=await e.getBigUint64(i+LIt),s=await e.slice(o,o+4n);if(!Zu(s,IIt.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+MIt),n=await e.getBigUint64(o+qIt)}return{cdRecordsNumber:r,cdStartOffset:n}};var NIt=20n,UIt=24n,GIt=28n,zIt=30n,HIt=42n,KU=46n,rF=new Uint8Array([80,75,1,2]),Z_=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,rF.buffer))return null;let n=BigInt(await t.getUint32(e+NIt)),i=BigInt(await t.getUint32(e+UIt)),a=await t.getUint16(e+zIt),o=await t.getUint16(e+GIt),s=await t.slice(e+KU,e+KU+BigInt(o)),u=new TextDecoder().decode(s),c=e+KU+BigInt(o),l=await t.getUint32(e+HIt),f=BigInt(l),d=4n;return i===BigInt(4294967295)&&(i=await t.getBigUint64(c+d),d+=8n),n===BigInt(4294967295)&&(n=await t.getBigUint64(c+d),d+=8n),f===BigInt(4294967295)&&(f=await t.getBigUint64(c+d)),{compressedSize:n,uncompressedSize:i,extraFieldLength:a,fileNameLength:o,fileName:u,extraOffset:c,localHeaderOffset:f}};async function*nF(e){let{cdStartOffset:t}=await iTe(e),r=await Z_(t,e);for(;r;)yield r,r=await Z_(r.extraOffset+BigInt(r.extraFieldLength),e)}var WIt=8n,VIt=18n,KIt=22n,XIt=26n,YIt=28n,iF=30n,aTe=new Uint8Array([80,75,3,4]),Zp=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Zu(r,aTe))return null;let n=await t.getUint16(e+XIt),i=new TextDecoder().decode(await t.slice(e+iF,e+iF+BigInt(n))).split("\\").join("/"),a=await t.getUint16(e+YIt),o=e+iF+BigInt(n+a),s=await t.getUint16(e+WIt),u=BigInt(await t.getUint32(e+VIt)),c=BigInt(await t.getUint32(e+KIt)),l=e+iF+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 aF=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 Hh(t)}};function oTe(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+=$It(n[i])}return t}function $It(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 sTe(e,t){switch(t){case"hex":return e;case"base64":return JIt(e);default:throw new Error(t)}}function JIt(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return oTe(r)||""}var cTe=typeof atob=="function"?atob:typeof Buffer=="function"?i5t:fTe,QIt=cTe("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="),XU=WebAssembly&&cTe!==fTe?n5t(QIt).buffer:!1,Bc=a5t(),YU=240*16*16,lTe=Math.floor(YU*16*1.066666667),ZIt=268435456-65536,uTe="Parameter must be Buffer, ArrayBuffer or Uint8Array",e5t="Parameter exceeds max size of 255.9 Mbytes";XU||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function $U(e){var t,r,n,i,a,o,s,u,c,l;let f=r5t(),d=t5t(),h={},p=new Date().getTime();return h.then=function(w){return s=w,g(),h},h.catch=function(w){return u=w,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(uTe)):x(new TypeError(uTe)),o&&(a=o.length,XU&&a>lTe?a>ZIt?x(new Error(e5t)):(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(XU,n).then(b)):g(f(o))),h;function b(w){g(d(o,w.instance.exports,r))}function g(w){var S=Boolean(w)?w:c;Boolean(w)&&(l=new Date().getTime()),typeof s=="function"?Boolean(S)&&(s(S,l-p),s=u=null):Boolean(w)&&(c=w)}function x(w){typeof u=="function"&&u(w)}}function t5t(){var e,t,r,n,i,a,o,s,u,c,l,f,d,h=function(p){var b,g,x,w,S,F,D,j,B,N,C,k,I,U,Y,$,re,ee,ge,ye,he,Te,Xe=new Date().getTime(),We=0,oe=1732584193,V=-271733879,ne=-1732584194,se=271733878,Ge=0,at=p.length*8,ft;for(ft=ke(p,d),d[at>>>5]|=128<<at%32,d[(at+64>>>9<<4)+14]=at,ft=(at+64>>>9<<4)+15,he=d;Ge<ft;)ft>Ge+lTe?(n(oe),a(V),s(ne),c(se),t(YU),Ge=Ge+YU*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,w=he[Ge+3]>>>0,S=he[Ge+4]>>>0,F=he[Ge+5]>>>0,D=he[Ge+6]>>>0,j=he[Ge+7]>>>0,B=he[Ge+8]>>>0,N=he[Ge+9]>>>0,C=he[Ge+10]>>>0,k=he[Ge+11]>>>0,I=he[Ge+12]>>>0,U=he[Ge+13]>>>0,Y=he[Ge+14]>>>0,$=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)+w-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)+B+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)+k-1990404162)+ne,oe=me(7,25,oe+(V&ne|~V&se)+I+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)+$+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)+k+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)+$-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)+w-187363961)+se,V=me(20,12,V+(ne&oe|se&~oe)+B+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)+I-1926607734)+ne,oe=me(4,28,oe+(V^ne^se)+F-378558)+V,se=me(11,21,se+(oe^V^ne)+B-2022574463)+oe,ne=me(16,16,ne+(se^oe^V)+k+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)+w-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)+I-421815835)+oe,ne=me(16,16,ne+(se^oe^V)+$+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))+I+1700485571)+V,se=me(10,22,se+(V^(oe|~ne))+w-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))+B+1873313359)+V,se=me(10,22,se+(V^(oe|~ne))+$-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))+k-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 Bc.endian([oe,V,ne,se]);function me(Oe,gt,Ue){return Ue<<Oe|Ue>>>gt}function ke(Oe,gt){for(var Ue=-1,_t=Math.floor((Oe.length-1)/4),Mt=0,Sr,de,Je,ct;_t-8>Ue++;)Mt=Ue<<2,gt[Ue]=Oe[Mt+0]|Oe[Mt+1]<<8|Oe[Mt+2]<<16|Oe[Mt+3]<<24;for(Ue--;_t>Ue++;)Mt=Ue<<2,Sr=typeof Oe[Mt+0]>"u"?0:Oe[Mt+0],de=typeof Oe[Mt+1]>"u"?0:Oe[Mt+1],Je=typeof Oe[Mt+2]>"u"?0:Oe[Mt+2],ct=typeof Oe[Mt+3]>"u"?0:Oe[Mt+3],gt[Ue]=Sr|de<<8|Je<<16|ct<<24;return _t+1}};return function(p,b,g,x){var w;return t=b.loops,e=b.loop,r=b.getA,i=b.getB,o=b.getC,u=b.getD,l=b.getX,n=b.setA,a=b.setB,s=b.setC,c=b.setD,f=b.setX,d=g,w=Bc.wordsToBytes(h(p)),x&&x.asBytes?w:Bc.bytesconvertNumberToHex(w)}}function r5t(){var e=function(t,r){var n,i,a,o,s,u,c,l,f,d,h,p,b,g,x,w,S,F,D,j,B,N=new Date().getTime(),C=1732584193,k=-271733879,I=-1732584194,U=271733878,Y=t.length*8;B=Bc.bytesToWords(t);for(var $=0;$<B.length;$++)B[$]=(B[$]<<8|B[$]>>>24)&16711935|(B[$]<<24|B[$]>>>8)&4278255360;B[Y>>>5]|=128<<Y%32,B[(Y+64>>>9<<4)+14]=Y;for(var re=0;re<B.length;re+=16)S=C,F=k,D=I,j=U,n=B[re+0]>>>0,i=B[re+1]>>>0,a=B[re+2]>>>0,o=B[re+3]>>>0,s=B[re+4]>>>0,u=B[re+5]>>>0,c=B[re+6]>>>0,l=B[re+7]>>>0,f=B[re+8]>>>0,d=B[re+9]>>>0,h=B[re+10]>>>0,p=B[re+11]>>>0,b=B[re+12]>>>0,g=B[re+13]>>>0,x=B[re+14]>>>0,w=B[re+15]>>>0,C=ee(7,25,C+(k&I|~k&U)+n-680876936)+k,U=ee(12,20,U+(C&k|~C&I)+i-389564586)+C,I=ee(17,15,I+(U&C|~U&k)+a+606105819)+U,k=ee(22,10,k+(I&U|~I&C)+o-1044525330)+I,C=ee(7,25,C+(k&I|~k&U)+s-176418897)+k,U=ee(12,20,U+(C&k|~C&I)+u+1200080426)+C,I=ee(17,15,I+(U&C|~U&k)+c-1473231341)+U,k=ee(22,10,k+(I&U|~I&C)+l-45705983)+I,C=ee(7,25,C+(k&I|~k&U)+f+1770035416)+k,U=ee(12,20,U+(C&k|~C&I)+d-1958414417)+C,I=ee(17,15,I+(U&C|~U&k)+h-42063)+U,k=ee(22,10,k+(I&U|~I&C)+p-1990404162)+I,C=ee(7,25,C+(k&I|~k&U)+b+1804603682)+k,U=ee(12,20,U+(C&k|~C&I)+g-40341101)+C,I=ee(17,15,I+(U&C|~U&k)+x-1502002290)+U,k=ee(22,10,k+(I&U|~I&C)+w+1236535329)+I,C=ee(5,27,C+(k&U|I&~U)+i-165796510)+k,U=ee(9,23,U+(C&I|k&~I)+c-1069501632)+C,I=ee(14,18,I+(U&k|C&~k)+p+643717713)+U,k=ee(20,12,k+(I&C|U&~C)+n-373897302)+I,C=ee(5,27,C+(k&U|I&~U)+u-701558691)+k,U=ee(9,23,U+(C&I|k&~I)+h+38016083)+C,I=ee(14,18,I+(U&k|C&~k)+w-660478335)+U,k=ee(20,12,k+(I&C|U&~C)+s-405537848)+I,C=ee(5,27,C+(k&U|I&~U)+d+568446438)+k,U=ee(9,23,U+(C&I|k&~I)+x-1019803690)+C,I=ee(14,18,I+(U&k|C&~k)+o-187363961)+U,k=ee(20,12,k+(I&C|U&~C)+f+1163531501)+I,C=ee(5,27,C+(k&U|I&~U)+g-1444681467)+k,U=ee(9,23,U+(C&I|k&~I)+a-51403784)+C,I=ee(14,18,I+(U&k|C&~k)+l+1735328473)+U,k=ee(20,12,k+(I&C|U&~C)+b-1926607734)+I,C=ee(4,28,C+(k^I^U)+u-378558)+k,U=ee(11,21,U+(C^k^I)+f-2022574463)+C,I=ee(16,16,I+(U^C^k)+p+1839030562)+U,k=ee(23,9,k+(I^U^C)+x-35309556)+I,C=ee(4,28,C+(k^I^U)+i-1530992060)+k,U=ee(11,21,U+(C^k^I)+s+1272893353)+C,I=ee(16,16,I+(U^C^k)+l-155497632)+U,k=ee(23,9,k+(I^U^C)+h-1094730640)+I,C=ee(4,28,C+(k^I^U)+g+681279174)+k,U=ee(11,21,U+(C^k^I)+n-358537222)+C,I=ee(16,16,I+(U^C^k)+o-722521979)+U,k=ee(23,9,k+(I^U^C)+c+76029189)+I,C=ee(4,28,C+(k^I^U)+d-640364487)+k,U=ee(11,21,U+(C^k^I)+b-421815835)+C,I=ee(16,16,I+(U^C^k)+w+530742520)+U,k=ee(23,9,k+(I^U^C)+a-995338651)+I,C=ee(6,26,C+(I^(k|~U))+n-198630844)+k,U=ee(10,22,U+(k^(C|~I))+l+1126891415)+C,I=ee(15,17,I+(C^(U|~k))+x-1416354905)+U,k=ee(21,11,k+(U^(I|~C))+u-57434055)+I,C=ee(6,26,C+(I^(k|~U))+b+1700485571)+k,U=ee(10,22,U+(k^(C|~I))+o-1894986606)+C,I=ee(15,17,I+(C^(U|~k))+h-1051523)+U,k=ee(21,11,k+(U^(I|~C))+i-2054922799)+I,C=ee(6,26,C+(I^(k|~U))+f+1873313359)+k,U=ee(10,22,U+(k^(C|~I))+w-30611744)+C,I=ee(15,17,I+(C^(U|~k))+c-1560198380)+U,k=ee(21,11,k+(U^(I|~C))+g+1309151649)+I,C=ee(6,26,C+(I^(k|~U))+s-145523070)+k,U=ee(10,22,U+(k^(C|~I))+p-1120210379)+C,I=ee(15,17,I+(C^(U|~k))+a+718787259)+U,k=ee(21,11,k+(U^(I|~C))+d-343485551)+I,C=C+S>>>0,k=k+F>>>0,I=I+D>>>0,U=U+j>>>0;return Bc.endian([C,k,I,U]);function ee(ge,ye,he){return he<<ge|he>>>ye}};return function(t,r){var n=Bc.wordsToBytes(e(t,r)),i=r&&r.asBytes?n:Bc.bytesconvertNumberToHex(n);return i}}function n5t(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 i5t(e){return Buffer.from(e,"base64").toString("binary")}function fTe(e){return e}function a5t(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return Bc.rotl(t,8)&16711935|Bc.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=Bc.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 e2=class extends aF{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let i=await new Promise((a,o)=>$U(t).then(a).catch(o));return sTe(i,r)}};function JU(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=o5t(e,n,16);r[a]=i}return r}function o5t(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 Hh(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var t2=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 e0=Kt(OU(),1),Wl=Kt(require("zlib"),1);var t0=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(!vn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gzip)(t):await Om(Wl.default.deflate)(t);return fl(i)}return this.compressSync(t)}async decompress(t){var r,n;if(!vn&&((r=this.options.deflate)!=null&&r.useZlib)){let i=(n=this.options.deflate)!=null&&n.gzip?await Om(Wl.default.gunzip)(t):await Om(Wl.default.inflate)(t);return fl(i)}return this.decompressSync(t)}compressSync(t){var a,o,s,u;if(!vn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gzipSync(t):Wl.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?e0.default.deflateRaw:e0.default.deflate)(n,r).buffer}decompressSync(t){var a,o,s,u;if(!vn&&((a=this.options.deflate)!=null&&a.useZlib)){let c=(o=this.options.deflate)!=null&&o.gzip?Wl.default.gunzipSync(t):Wl.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?e0.default.inflateRaw:e0.default.inflate)(n,r).buffer}async*compressBatches(t){var i;let r=((i=this.options)==null?void 0:i.deflate)||{},n=new e0.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 e0.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 s5t={0:async e=>e,8:async e=>await new t0({raw:!0}).decompress(e)},r2=class{fileProvider=null;fileName;constructor(t){if(typeof t=="string")if(this.fileName=t,!vn)this.fileProvider=new Fx(t);else throw new Error("Cannot open file for random access in a WEB browser");else $I(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=nF(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 Zp(r.localHeaderOffset,this.fileProvider);if(!n)throw new Error("Local file header has not been found in the zip archive`");let i=s5t[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=nF(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 u5t={0:e=>new t2().decompress(e),8:e=>new t0({raw:!0}).decompress(e)},oF=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 e2().hash(r,"hex"),i=this.hashTable[n];if(i===void 0)return null;let a=await Zp(i,this.fileProvider);if(!a)return null;let o=await this.fileProvider.slice(a.fileDataOffset,a.fileDataOffset+a.compressedSize),s=u5t[a.compressionMethod];if(!s)throw Error("Only Deflation compression is supported");return s(o)}};var n2=class extends r2{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 oF(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 Q_(t,rF),n=await Z_(r,t);if((n==null?void 0:n.fileName)==="@3dtilesIndex1@"){let i=await Zp(n.localHeaderOffset,t);if(!i)throw new Error("corrupted 3tz");let a=i.fileDataOffset,o=await t.slice(a,a+i.compressedSize);this.hashTable=JU(o)}else this.hashTable=null}};function Ld(e,t,r){if(!t)return r+12;let{magic:i,version:a=1,byteLength:o=12}=e;return Jt(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 Md(e,t,r){e&&e.setUint32(t+8,r,!0)}function dTe(e,t,r,n,i){e={magic:Ed.COMPOSITE,tiles:[],...e};let a=r;r+=Ld(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 Md(t,a,r-a),r}function hTe(e,t,r,n){let{featuresLength:i=0,batchTable:a}=e,s=JSON.stringify({BATCH_LENGTH:i}),u=a?JSON.stringify(a):"",c=Co(s.length,8),l=u?Co(u.length,8):0;e={magic:Ed.BATCHED_MODEL,...e};let f=r;r=Ld(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=Rm(t,r,s,8),a&&(r=Rm(t,r,u,8));let d=e.gltfEncoded;return d&&(r=Cx(t,r,d,d.byteLength)),Md(t,f,r-f),r}function pTe(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:Ed.INSTANCED_MODEL,...e};let f=r;return r=Ld(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+=Bm(t,r,c,l),r+=Bm(t,r,o,s),Md(t,f,r-f),r}var c5t={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function mTe(e,t,r,n){let{featureTableJson:i=c5t}=e,a=JSON.stringify(i);a=HI(a,4);let{featureTableJsonByteLength:o=a.length}=e,s=new ArrayBuffer(12),u=s.byteLength;e={magic:Ed.POINT_CLOUD,...e};let c=r;return r+=Ld(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+=Bm(t,r,a,o),r+=Cx(t,r,s,u),Md(t,c,r-c),r}function ZU(e,t){let r=QU(e,null,0,t),n=new ArrayBuffer(r),i=new DataView(n);return QU(e,i,0,t),n}function QU(e,t,r,n){switch(Jt(typeof e.type=="string"),e.type){case ms.COMPOSITE:return dTe(e,t,r,n,QU);case ms.POINT_CLOUD:return mTe(e,t,r,n);case ms.BATCHED_3D_MODEL:return hTe(e,t,r,n);case ms.INSTANCED_3D_MODEL:return pTe(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var eG={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:yv,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],encodeSync:l5t,binary:!0,options:{["3d-tiles"]:{}}};function l5t(e,t){return ZU(e,t)}var Na=require("path");var gTe=Kt(require("crypto")),uF=new Uint8Array(256),sF=uF.length;function tG(){return sF>uF.length-16&&(gTe.default.randomFillSync(uF),sF=0),uF.slice(sF,sF+=16)}var Ea=[];for(let e=0;e<256;++e)Ea.push((e+256).toString(16).slice(1));function vTe(e,t=0){return(Ea[e[t+0]]+Ea[e[t+1]]+Ea[e[t+2]]+Ea[e[t+3]]+"-"+Ea[e[t+4]]+Ea[e[t+5]]+"-"+Ea[e[t+6]]+Ea[e[t+7]]+"-"+Ea[e[t+8]]+Ea[e[t+9]]+"-"+Ea[e[t+10]]+Ea[e[t+11]]+Ea[e[t+12]]+Ea[e[t+13]]+Ea[e[t+14]]+Ea[e[t+15]]).toLowerCase()}var bTe=Kt(require("crypto")),rG={randomUUID:bTe.default.randomUUID};function f5t(e,t,r){if(rG.randomUUID&&!t&&!e)return rG.randomUUID();e=e||{};let n=e.random||(e.rng||tG)();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 vTe(n)}var Rc=f5t;var C0=Kt(require("process"),1),nB=Kt(_u(),1),KW=Kt(oG(),1);var $b=require("path"),bBe=Kt(_u(),1);var FTe=()=>({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 Xb=require("fs"),Yb=require("path");var pBe=require("zlib"),mBe=require("path"),rE=require("fs"),LVt=Kt(hBe(),1);var MVt=Kt(WU(),1);var qVt=Kt(nG(),1);function V4(e){let t=`${e}.gz`,r=(0,pBe.createGzip)(),n=(0,rE.createReadStream)(e),i=(0,rE.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 gBe(e,t,r,n,i){process.platform==="win32"?await UVt(e,t,r,n,i):await NVt(e,t,r,n)}async function NVt(e,t,r=0,n="."){let i=nE(t),a=[`-${r}`,"-r",i,n];await new ll().start({command:"zip",arguments:a,spawn:{cwd:e},wait:0})}async function UVt(e,t,r=0,n=(0,mBe.join)(".","*"),i){n[0]==="@"&&(n=`*${n.substr(1)}`);let a=nE(t),o=["a","-tzip",`-mx=${r}`,a,n];await new ll().start({command:i,arguments:o,spawn:{cwd:`${e}`},wait:0})}async function Fi(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 Xb.promises.mkdir(e,{recursive:!0});let i=(0,Yb.join)(e,r);try{await Xb.promises.writeFile(i,n)}catch(a){throw a}return console.log(`${i} saved.`),i}async function Mc(e,t,r="index.json",n=!0,i){let a=await Fi(e,t,r);if(n){if(i)return i.includes(a)?null:(i.push(a),`${a}.gz`);{let o=await V4(a);return await kW(a),o}}return a}async function K4(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);mn(o,KI).then(s=>{clearInterval(a),r(s)}).catch(()=>{i++,i>100&&(clearInterval(a),n(new Error(`Cannon load ${e}/${t}.`)))})},200)})}async function vBe(e){try{return await Xb.promises.stat(e),!0}catch{return!1}}function iE(e){return Xb.promises.rm(e,{recursive:!0})}function kW(e){return Xb.promises.unlink(e)}function nE(e){return(0,Yb.isAbsolute)(e)?e:(0,Yb.join)(process.cwd(),e)}var Za=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,$b.join)(this.converter.layers0Path,"nodepages"),n=`${t.toString()}.json`):(r=(0,$b.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,$b.join)(r,n);return await vBe(i)?(console.log(`load ${i}.`),await K4(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),Za.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?Za.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,bBe.default)({nodeCount:this.nodesCounter},FTe()),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,$b.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,$b.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}),Za.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 aE=require("path"),X4=require("fs");function Y4(e){let r=e[0],n=Math.floor(r/3600);r=r-n*3600;let i=Math.floor(r/60);r=r-i*60;let a=Math.floor(r),o=e[1]/1e6,s="";return n&&(s+=`${n}h `),i&&(s+=`${i}m `),a&&(s+=`${a}s`),s||(s+=`${o}ms`),s}async function $4(e){let{slpk:t,outputPath:r,tilesetName:n}=e,i=nE(r);try{if(t){let s=(0,aE.join)(i,`${n}.slpk`);return(await X4.promises.stat(s)).size}let a=(0,aE.join)(i,n);return await yBe(a)}catch(a){return console.log("Calculate file sizes error: ",a),null}}async function yBe(e){let t=0,r=await X4.promises.readdir(e);for(let n of r){let i=await X4.promises.stat((0,aE.join)(e,n));i.isDirectory()?t+=await yBe((0,aE.join)(e,n)):t+=i.size}return t}var zBe=Kt(oG(),1);var T0=3,Jb=9;function _Be(e){let{positions:t,normals:r,texCoords:n,colors:i,uvRegions:a,featureIndices:o}=e,s=t.length/Jb;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=GVt(o),c=zVt({...u,...e}),l=HVt(c);return WVt(l,u.featureCount)}function GVt(e){let t=1,r=1,n=xBe(e.slice(0,T0)),i=[],a=[],o=[n];i[0]=0,a[0]=n;for(let c=T0;c<e.length;c+=T0){let l=xBe(e.slice(c,c+T0));n!==l&&(i[t]=c/T0-1,i[t+1]=c/T0,a[r]=l,o.includes(l)||o.push(l),t+=2,r+=1),n=l}i[t]=e.length/T0-1;let s=new Uint32Array(i),u=o.length;return{faceRange:s,featureCount:u,featureIds:a}}function xBe(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 zVt(e){let{featureIds:t,positions:r,normals:n,colors:i,uvRegions:a,texCoords:o,faceRange:s=new Uint32Array(0)}=e,u=[],c=new Float32Array(r),l=new Float32Array(n),f=new Uint8Array(i),d=new Float32Array(o),h=new Uint16Array(a),p=0,b=0,g=0,x=0,w=0;for(let S=0;S<t.length;S++){let F=s[S*2],D=s[S*2+1],j=oE("positions",F,D),B=oE("normals",F,D),N=oE("colors",F,D),C=oE("uvRegions",F,D),k=oE("texCoords",F,D);u.push({featureId:t[S],positions:c.subarray(p,p+j),normals:l.subarray(b,b+B),colors:f.subarray(g,g+N),uvRegions:h.subarray(x,x+C),texCoords:d.subarray(w,w+k)}),p+=j,b+=B,g+=N,x+=C,w+=k}return u}function oE(e,t,r){let a=r-t+1,o=a*3;switch(e){case"positions":case"normals":return a*Jb;case"colors":case"uvRegions":return o*4;case"texCoords":return o*2;default:return 0}}function HVt(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=EBe(n.attributes);r.push({featureId:n.featureId,...i})}return r}function WVt(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/Jb-1+o),i.push(f.positions.length/Jb+o),o+=f.positions.length/Jb,a+=1}let s=EBe(e);return i.push(s.positions.length/Jb-1),{faceRange:new Uint32Array(i),featureIds:n,featureCount:t,...s}}function EBe(e){let t=e.map(({positions:f})=>f),r=t.length>1?To(...t):t[0],n=e.map(({normals:f})=>f),i=n.length>1?To(...n):n[0],a=e.map(({colors:f})=>f),o=a.length>1?To(...a):a[0],s=e.map(({texCoords:f})=>f),u=s.length>1?To(...s):s[0],c=e.map(({uvRegions:f})=>f),l=c.length>1?To(...c):c[0];return{positions:r,normals:i,colors:o,texCoords:u,uvRegions:l}}function IW(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 aa?(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 hs().fromMatrix3(new Pr([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 wBe(e,t){let r=VVt(e),n=Q1(r),i=P7(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 VVt(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 ABe(e){let t;e instanceof Ya?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 PW(e){let t=e[3],r=new ce(e[0],e[1],e[2]),n=new Pr([t,0,0,0,t,0,0,0,t]);return new aa(r,n)}function SBe(e,t,r){var s,u,c,l,f,d,h,p;let n=((u=(s=e.gltf)==null?void 0:s.scene)==null?void 0:u.nodes)||((f=(l=(c=e.gltf)==null?void 0:c.scenes)==null?void 0:l[0])==null?void 0:f.nodes)||((d=e.gltf)==null?void 0:d.nodes)||[],i=((p=(h=e.gltf)==null?void 0:h.images)==null?void 0:p.map(b=>{var g,x;if((g=b==null?void 0:b.image)!=null&&g.compressed)return null;{let w=(x=b==null?void 0:b.image)==null?void 0:x.data,S=new Uint8Array(w.length);return S.set(w),{data:S,compressed:!1,height:b.image.height,width:b.image.width,components:b.image.components,mimeType:b.mimeType}}}))||[];TBe(n);let{cartographicOrigin:a,modelMatrix:o}=XVt(e,t,r);return{nodes:n,images:i,cartographicOrigin:a,cartesianModelMatrix:o}}function KVt(e){let t={};for(let r in e)t[r]={value:e[r].value};return t}function XVt(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 TBe(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:KVt(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&&TBe(n.children)}}function CBe(e,t){var n,i;let r=(i=(n=e.gltf)==null?void 0:n.extensions)==null?void 0:i[gs];if(!(r!=null&&r.featureTextures))return null;for(let a in r.featureTextures)if(r.featureTextures[a].class===t)return a;return null}function DBe(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 gs:return $Vt(e,o,r,n);case qC:return YVt(e,o);default:return[]}return[]}function YVt(e,t){for(let r of t.featureIds)if(typeof r.propertyTable<"u")return r.data;return[]}function $Vt(e,t,r,n){var o,s,u,c,l,f,d;let i=(o=t==null?void 0:t.featureIdAttributes)==null?void 0:o[0];if((s=i==null?void 0:i.featureIds)!=null&&s.attribute)return e[i.featureIds.attribute].value;if((u=i==null?void 0:i.featureIds)!=null&&u.hasOwnProperty("constant")&&((c=i==null?void 0:i.featureIds)!=null&&c.hasOwnProperty("divisor"))){let h=((l=e==null?void 0:e.POSITIONS)==null?void 0:l.value.length)/3||0;return JVt(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 p=`TEXCOORD_${((d=(f=a==null?void 0:a.featureIds)==null?void 0:f.texture)==null?void 0:d.texCoord)||0}`,b=e[p].value;return QVt(a,b,r)}return n?e[n].value:[]}function JVt(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 QVt(e,t,r){var c,l,f;if(!(r!=null&&r.length))return[];let n={r:0,g:1,b:2,a:3},i=(l=(c=e==null?void 0:e.featureIds)==null?void 0:c.texture)==null?void 0:l.index,a=(f=e==null?void 0:e.featureIds)==null?void 0:f.channels;if(!a||i===void 0)return[];let o=r[i],s=[],u=n[a];if(o&&(o!=null&&o.width)&&(o!=null&&o.height)&&(o!=null&&o.components))for(let d=0;d<t.length;d+=2){let h=t[d],p=t[d+1],b=Math.min(Bp(h)*o.width|0,o.width-1),x=(Math.min(Bp(p)*o.height|0,o.height-1)*o.width+b)*o.components+u,w=new Uint8Array(o.data)[x];s.push(w)}else console.warn(`Can't get batch Ids from ${(o==null?void 0:o.mimeType)||""} compressed texture`);return s}function BBe(e,t){let r={};for(let n in t){let i=t[n];r[n]=ZVt(i,e)}return r}function ZVt(e,t){let r=[];if(e)for(let n in t){let i=e[n]||null;r.push(i)}return r}function RBe(e,t){let r=!1;for(let n of Object.values(t))(!e||!n||e.length!==n.length)&&(r=!0);return r}var qc="string",sE="Int32",uE="double",OBe="OBJECTID";function eKt(e){return typeof e===qc||typeof e=="bigint"?qc:typeof e=="number"?Number.isInteger(e)?sE:uE:qc}function kBe(e,t,r){let n={key:`f_${e}`,name:t,ordering:["attributeValues"],header:[{property:"count",valueType:"UInt32"}],attributeValues:{valueType:"Int32",valuesPerElement:1}};switch(r){case OBe:tKt(n);break;case qc:FBe(n);break;case uE:rKt(n);break;case sE:break;default:FBe(n)}return n}function IBe(e){switch(e){case OBe:return"esriFieldTypeOID";case qc:return"esriFieldTypeString";case sE:return"esriFieldTypeInteger";case uE:return"esriFieldTypeDouble";default:return"esriFieldTypeString"}}function PBe(e,t){return{name:e,type:t,alias:e}}function jBe(e){let t="{OBJECTID}",r=[],n=[],i=[],a=[];for(let o of e)n.push({fieldName:o,visible:!0,isEditable:!1,label:o});return i.push({fieldInfos:n,type:"fields"}),{title:t,mediaInfos:r,popupElements:i,fieldInfos:n,expressionInfos:a}}function FBe(e){e.ordering.unshift("attributeByteCounts"),e.header.push({property:"attributeValuesByteCount",valueType:"UInt32"}),e.attributeValues={valueType:"String",encoding:"UTF-8",valuesPerElement:1},e.attributeByteCounts={valueType:"UInt32",valuesPerElement:1}}function tKt(e){e.attributeValues={valueType:"Oid32",valuesPerElement:1}}function rKt(e){e.attributeValues={valueType:"Float64",valuesPerElement:1}}function LBe(e){let t={};for(let r in e){let n=e[r][0],i=eKt(n);t[r]=i}return t}var MBe=(e,t)=>{var a,o,s,u,c,l,f,d;let r={},n=(u=(s=(o=(a=e.extensions)==null?void 0:a[gs])==null?void 0:o.schema)==null?void 0:s.classes)==null?void 0:u[t];if(n){for(let h in n.properties){let p=n.properties[h],b=nKt(p);r[h]=b}return r}let i=(d=(f=(l=(c=e.extensions)==null?void 0:c[Ol])==null?void 0:l.schema)==null?void 0:f.classes)==null?void 0:d[t];if(i){for(let h in i.properties){let p=i.properties[h],b=iKt(p);r[h]=b}return r}return null},nKt=e=>{let t;switch(e.type){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=sE;break;case"FLOAT32":case"FLOAT64":t=uE;break;case"INT64":case"UINT64":case"BOOLEAN":case"ENUM":case"STRING":case"ARRAY":t=qc;break;default:t=qc;break}return t},iKt=e=>{let t;if(e.array)t=qc;else switch(e.componentType){case"INT8":case"UINT8":case"INT16":case"UINT16":case"INT32":case"UINT32":t=sE;break;case"FLOAT32":case"FLOAT64":t=uE;break;case"INT64":case"UINT64":t=qc;break;default:t=qc;break}return t};var J4=e=>{let t=new Uint32Array(e);for(let r=0;r<e;r++)t[r]=r;return t};var aKt=1,oKt=1,wu=3,cE=2,sKt=4,uKt="string",cKt="Int32",lKt="Float64",fKt="Oid32",qBe=["CUSTOM_ATTRIBUTE_2","_BATCHID","BATCHID"],bh=new ce;async function jW(e,t,r,n,i,a,o,s,u,c,l,f,d){var S;let h=u,p=await TKt((S=e.gltf)==null?void 0:S.materials,c),b=SBe(e,t,r),g=CBe(e,d),x=await pKt(b,p,h,g);u&&dKt(x,l);let w=[];for(let F of p){let D=F.mergedMaterials[0].originalMaterialId;if(!x.has(D))continue;let j=x.get(D);if(!j)continue;let{material:B,texture:N}=F,C=await n();w.push(await hKt({convertedAttributes:j,material:B,texture:N,tileContent:e,nodeId:C,featuresHashArray:a,propertyTable:i,attributeStorageInfo:o,draco:s,libraries:f}))}return w.length?w:null}function dKt(e,t){for(let r of e.values()){let n=wBe(r.positions,t);r.boundingVolumes=n;let i=n.obb.center;for(let a=0;a<r.positions.length;a+=wu){let o=r.positions.subarray(a,a+wu);or.WGS84.cartesianToCartographic(Array.from(o),bh),bh[2]=bh[2]-t.getHeight(bh[1],bh[0]),bh=bh.subtract(i),r.positions.set(bh,a)}}}async function hKt({convertedAttributes:e,material:t,texture:r,tileContent:n,nodeId:i,featuresHashArray:a,propertyTable:o,attributeStorageInfo:s,draco:u,libraries:c}){var k;let l=e.boundingVolumes,f=e.positions.length/wu,{faceRange:d,featureIds:h,positions:p,normals:b,colors:g,uvRegions:x,texCoords:w,featureCount:S}=_Be(e),F={};o&&(F=LKt(h,e.featureIndices,a,o));let D=new Uint32Array(2),j=VKt(h);D.set([f,S],0);let B=new Uint8Array(ec(D.buffer,p.buffer,b.buffer,r?w.buffer:new ArrayBuffer(0),g.buffer,x,j.buffer,d.buffer)),N=u?KKt(f,e,{positions:p,normals:b,texCoords:r?w:new Float32Array(0),colors:g,uvRegions:x,featureIds:h,faceRange:d},c):null,C=[];return s&&o&&(C=UKt(h,F,o,s)),{nodeId:i,geometry:B,compressedGeometry:N,texture:r,hasUvRegions:Boolean(x.length),sharedResources:OKt(((k=n.gltf)==null?void 0:k.materials)||[],i),meshMaterial:t,vertexCount:f,attributes:C,featureCount:S,boundingVolumes:l}}async function pKt(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)}HBe(i,a,o,s,u,r,void 0,n);for(let c of u.keys()){let l=u.get(c);if(l){if(l.positions.length===0){u.delete(c);continue}l.featureIndicesGroups&&(l.featureIndices=l.featureIndicesGroups.reduce((f,d)=>f.concat(d)),delete l.featureIndicesGroups)}}return u}function HBe(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)gKt(u,t,r,n,i,a,o,s)}function mKt(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 gKt(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=mKt(e,o),c=e.mesh;c&&vKt(c,t,r,n,i,a,u,s),HBe(e.children||[],t,r,n,i,a,u,s)}function vKt(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:p})=>{var b;return p===((b=c.material)==null?void 0:b.id)}))==null?void 0:u.uvRegion):i.has("default")&&(l=i.get("default")),Jt(l!==null,"Primitive - material mapping failed"),Jt(c.mode===void 0||c.mode===Zt.TRIANGLES||c.mode===Zt.TRIANGLE_STRIP,`Primitive - unsupported mode ${c.mode}`);let d=c.attributes;if(!l)continue;let h=bKt(c);l.positions=To(l.positions,NBe({vertices:d.POSITION.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:yKt,useCartesianPositions:a})),l.normals=To(l.normals,NBe({vertices:d.NORMAL&&d.NORMAL.value,cartographicOrigin:r,cartesianModelMatrix:n,nodeMatrix:o,indices:h,attributeSpecificTransformation:xKt,useCartesianPositions:!1})),l.texCoords=To(l.texCoords,_Kt(d.TEXCOORD_0&&d.TEXCOORD_0.value,h)),l.colors=To(l.colors,EKt(d.COLOR_0,h)),f&&(l.uvRegions=To(l.uvRegions,wKt(f,h))),l.featureIndicesGroups=l.featureIndicesGroups||[],l.featureIndicesGroups.push(AKt(SKt(d,c,t,s),h))}}function bKt(e){var r;let t=(r=e.indices)==null?void 0:r.value;if(!t){let n=e.attributes.POSITION.value;return J4(n.length/wu)}if(t&&e.mode===Zt.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 NBe(e){let{vertices:t,indices:r,attributeSpecificTransformation:n}=e,i=new Float32Array(r.length*wu);if(!t)return i;for(let a=0;a<r.length;a++){let o=r[a]*wu,s=t.subarray(o,o+wu),u=new ce(Array.from(s));u=n(u,e),i[a*wu]=u.x,i[a*wu+1]=u.y,i[a*wu+2]=u.z}return i}function yKt(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 xKt(e,t){let{cartesianModelMatrix:r,nodeMatrix:n}=t;return n&&(e=e.transformAsVector(n)),e=e.transformAsVector(r),e}function _Kt(e,t){let r=new Float32Array(t.length*cE);if(!e)return r.fill(1),r;for(let n=0;n<t.length;n++){let i=t[n]*cE,a=e.subarray(i,i+cE);r[n*cE]=a[0],r[n*cE+1]=a[1]}return r}function EKt(e,t){let r=(e==null?void 0:e.components)||sKt,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 wKt(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 AKt(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 SKt(e,t,r,n){let i=DBe(e,t,r,n);if(i.length)return i;for(let a=0;a<qBe.length;a++){let o=qBe[a];if(e[o]&&e[o].value)return e[o].value}return[]}async function TKt(e=[],t){let r=[];for(let n of e)r.push(FKt(n));return t&&(r=await CKt(r)),r}async function CKt(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 DKt(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:RKt(),mergedMaterials:[{originalMaterialId:"default"}]}),t}async function DKt(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 FKt(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:BKt(e.alphaMode),pbrMetallicRoughness:{roughnessFactor:((a=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:a.roughnessFactor)||aKt,metallicFactor:((o=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:o.metallicFactor)||oKt}},r;(s=e==null?void 0:e.pbrMetallicRoughness)!=null&&s.baseColorTexture?(r=e.pbrMetallicRoughness.baseColorTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}):e.emissiveTexture&&(r=e.emissiveTexture.texture.source,t.pbrMetallicRoughness.baseColorTexture={textureSetDefinitionId:0}),e.id=Number.isFinite(e.id)?e.id:Rc();let n=[{originalMaterialId:e.id}];if(r)n[0].textureSize={width:r.image.width,height:r.image.height};else{let c=(u=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:u.baseColorFactor;t.pbrMetallicRoughness.baseColorFactor=c&&c.map(l=>Math.round(l*255))||void 0}return{material:t,texture:r,mergedMaterials:n}}function BKt(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend";default:return"opaque"}}function RKt(){return{alphaMode:"opaque",pbrMetallicRoughness:{metallicFactor:1,roughnessFactor:1}}}function OKt(e,t){let r={};if(!e||!e.length)return r;r.materialDefinitionInfos=[];for(let n of e){let{materialDefinitionInfo:i,textureDefinitionInfo:a}=kKt(n,t);r.materialDefinitionInfos.push(i),a&&(r.textureDefinitionInfos=r.textureDefinitionInfos||[],r.textureDefinitionInfos.push(a))}return r}function kKt(e,t){var s;let r=((s=e==null?void 0:e.pbrMetallicRoughness)==null?void 0:s.baseColorTexture)||e.emissiveTexture,n=null;r&&(n=PKt(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:IKt(o||[1,1,1,1],a),textureDefinitionInfo:n}}function IKt(e,t=1){let r=.00015686274509803922,n=new ds(0,0,0,1),i=new ds(1,1,1,1),a=new ds(r,r,r,0),o=new ds(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 PKt(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:jKt(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 jKt(e,t){var b;let{width:r,height:n}=((b=e.source)==null?void 0:b.image)||{};if(!r||!n)return"";let i=1,a=0,o=t+1,s=32-o.toString(2).length,u="0".repeat(s).concat(o.toString(2)),c=i<<28,l=a<<24,f=r-1<<12,d=n-1<<0,h=c+l+f+d;return BigInt(`0b${h.toString(2)}${u}`).toString()}function LKt(e,t,r,n){let i=MKt(e,n,r);return UBe(t,i),UBe(e,i),i}function MKt(e,t,r){let n={};for(let i=0;i<e.length;i++){let a=e[i],o=NKt(i,t,r);n[a.toString()]=o}return n}function qKt(e,t){let r="";for(let n in e)r+=e[n][t];return r}function NKt(e,t,r){let n=qKt(t,e),i=(0,zBe.default)(n);return r.includes(i)?r.indexOf(i):r.push(i)-1}function UBe(e,t){for(let r=0;r<e.length;r++)e[r]=t[e[r]]}function UKt(e,t,r,n){let i=[],o=RBe(e,r)?BBe(t,r):r,s={OBJECTID:e,...o};for(let u in s){let c=zKt(u,n);if(c){let l=s[u],f=GKt(c,l);i.push(f)}}return i}function GKt(e,t){let r;switch(e){case fKt:case cKt:r=HKt(t);break;case lKt:r=WKt(t);break;case uKt:r=GBe(t);break;default:r=GBe(t)}return r}function zKt(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 HKt(e){let t=new Uint32Array([e.length]),r=new Uint32Array(e);return ec(t.buffer,r.buffer)}function WKt(e){let t=new Uint32Array([e.length]),r=new Uint8Array(4),n=new Float64Array(e);return ec(t.buffer,r.buffer,n.buffer)}function GBe(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 ec(t.buffer,a.buffer,n.buffer,...i)}function VKt(e){let t=new BigUint64Array(e.length);for(let r=0;r<e.length;r++)t[r]=BigInt(e[r]);return t}async function KKt(e,t,r,n){let{positions:i,normals:a,texCoords:o,colors:s,uvRegions:u,featureIds:c,faceRange:l}=r,f=new Uint32Array(e);for(let g=0;g<f.length;g++)f.set([g],g);let d=new Uint32Array(t.featureIndices.length?t.featureIndices:e),h=XKt(d,l),p={positions:i,normals:a,colors:s,"feature-index":h};o.length&&(p.texCoords=o);let b={"feature-index":{"i3s-attribute-type":"feature-index","i3s-feature-ids":new Int32Array(c)}};return u.length&&(p["uv-region"]=u,b["uv-region"]={"i3s-attribute-type":"uv-region"}),dv({attributes:p,indices:f},z7,{...z7.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 XKt(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)*wu;r.fill(n,i,o),n++,i=o+1}return r}function WBe(e,t){if(!e)return null;let r,n=e.batchTableJson;if(n)return n;let{extensionName:i,extension:a}=JKt(e);switch(i){case Ol:return r=YKt(a,t),r;case gs:return r=$Kt(a,t),r;default:return null}}function YKt(e,t){if(e.propertyTables){for(let r of e.propertyTables)if(r.class===t||!t)return Q4(r)}if(e.propertyTextures){for(let r of e.propertyTextures)if(r.class===t||!t)return Q4(r)}return null}function $Kt(e,t){if(e.featureTables)for(let r in e.featureTables){let n=e.featureTables[r];if(n.class===t||!t)return Q4(n)}if(e.featureTextures)for(let r in e.featureTextures){let n=e.featureTextures[r];if(n.class===t||!t)return Q4(n)}return null}function Q4(e){let t={};for(let r in e.properties)t[r]=e.properties[r].data;return t}function JKt(e){var a,o,s,u;let t=[gs,Ol];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 KBe=Kt(_u(),1),XBe=require("path");var VBe=()=>({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 YBe(e,t,r){let n={serviceItemId:Rc().replace(/-/gi,""),layerName:e,layers0:t},i=(0,KBe.default)(n,VBe()),a=(0,XBe.join)(r,"SceneServer");await Fi(a,JSON.stringify(i))}var LW=16;function $Be(e,t){let r=[],n=e.boundingVolume,i=e.lodMetricValue||.1,a={metricType:"maxScreenThreshold",maxError:t.mbs[3]*2*LW/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 MW(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=LW),e.mbs[3]*2*LW/r}var QKt=240,ZKt=[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],eXt=372,tXt=[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],rXt=372,nXt=[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],iXt=12,qW=(3+1)*(3+2)/2,aXt=2,Qb=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=oXt(r,360);r=n!==-180?n:180;let i=r*this.options._rlonres,a=-t*this.options._rlatres,o=Math.floor(i),s=Math.min(Math.round((this.options._height-1)/2-1),Math.floor(a));i-=o,a-=s,s+=(this.options._height-1)/2,o+=o<0?this.options._width:o>=this.options._width?-this.options._width:0;let u=0,c=0,l=0,f=0,d=new Array(qW);if(o===this._ix&&s===this._iy)this.options.cubic?d=this._t:(u=this._v00,c=this._v01,l=this._v10,f=this._v11);else if(!this.options.cubic)u=this._rawval(o,s),c=this._rawval(o+1,s),l=this._rawval(o,s+1),f=this._rawval(o+1,s+1);else{let p=[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=tXt;s!==0&&(b=s===this.options._height-2?nXt:ZKt);let g=eXt;s!==0&&(g=s===this.options._height-2?rXt:QKt);for(let x=0;x<qW;++x){d[x]=0;for(let w=0;w<iXt;++w)d[x]+=p[w]*b[qW*w+x];d[x]/=g}}if(!this.options.cubic){let p=(1-i)*u+i*c,b=(1-i)*l+i*f,g=(1-a)*p+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=d[0]+i*(d[1]+i*(d[3]+i*d[6]))+a*(d[2]+i*(d[4]+i*d[7])+a*(d[5]+i*d[8]+a*d[9]));return h=this.options._offset+this.options._scale*h,this._ix=o,this._iy=s,this._t=d,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+aXt*(r*this.options._swidth+t),i=this.options.data[n],a=this.options.data[n+1];return i<<8|a}};function oXt(e,t){t=Math.abs(t);let r=JBe(e,t);return 2*Math.abs(r)===t?r-=JBe(e,2*t)-r:2*Math.abs(r)>t&&(r+=r<0?t:-t),r}function JBe(e,t){return e-Math.floor(e/t)*t}var sXt=10,uXt=65535;function NW(e,t){let r=cXt(e),n=r.next();if(n.done||n.value.line!=="P5")throw new Error("Geoid model file: File not in PGM format");let i=Number.MAX_VALUE,a=0,o=-1,s=-1,u="NONE",c="UNKNOWN",l=0,f=0,d=null,h=null;do{n=r.next();let x=n.value.line;if(x.length)if(x[0]==="#"){let w=x.split(" "),S=w[0],F=w[1];if(S!=="#"||!F)continue;let D=w.length>2?w.slice(2):[];if(F==="Description")u=D.join(" ");else if(F==="DateTime")c=D.join(" ");else if(F==="Offset"){if(!w[2])throw new Error("Geoid model file: Error reading offset");i=parseInt(w[2],10)}else if(F==="Scale"){if(!w[2])throw new Error("Geoid model file: Error reading scale");a=parseFloat(w[2])}else F===(t.cubic?"MaxCubicError":"MaxBilinearError")?isFinite(parseFloat(w[2]))&&(o=parseFloat(w[2])):F===(t.cubic?"RMSCubicError":"RMSBilinearError")&&isFinite(parseFloat(w[2]))&&(s=parseFloat(w[2]))}else{let w=x.split(" ");if(w=w.filter(S=>S!==""),l=parseInt(w[0],10),f=parseInt(w[1],10),!(l&&f))throw new Error("Geoid model file: Error reading raster size");break}}while(!n.done);n=r.next();let p=parseInt(n.value.line,10);if(n.done)throw new Error("Geoid model file: Error reading maxval");if(p!==uXt)throw new Error("Geoid model file: Incorrect value of maxval");if(d=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 Qb({cubic:t.cubic,_width:l,_height:f,_rlonres:b,_rlatres:g,_offset:i,_scale:a,_swidth:h,_datastart:d,_maxerror:o,_rmserror:s,_description:u,_datetime:c,data:e})}function*cXt(e){let t=0;do{let r=e.indexOf(sXt,t);if(r!==-1){let n=e.subarray(t,r);t=r+1,yield{offset:t,line:QBe(n)}}else{let n=e.subarray(t,e.length);t=e.length,yield{offset:t,line:QBe(n)}}}while(t<e.length);return{offset:t,line:""}}function QBe(e){let t="";for(let r of e)t+=String.fromCharCode(r);return t}var lXt="4.0.0-beta.6";var Z4={name:"PGM - Netpbm grayscale image format",id:"pgm",module:"tile-converter",version:lXt,mimeTypes:["image/x-portable-graymap"],parse:async(e,t)=>NW(new Uint8Array(e),(t==null?void 0:t.pgm)||{}),extensions:["pgm"],options:{pgm:{cubic:!1}}};var Zb=Kt(_u(),1);var ZBe={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 fXt=()=>({wkid:{path:"wkid",default:4326},latestWkid:{path:"latestWkid",default:4326},vcsWkid:{path:"vcsWkid",default:5773},latestVcsWkid:{path:"latestVcsWkid",default:5773}}),dXt=()=>({heightModel:{path:"heightModel",default:"gravity_related_height"},vertCRS:{path:"vertCRS",default:"EGM96_Geoid"},heightUnit:{path:"heightUnit",default:"meter"}}),hXt=()=>({nodesPerPage:{path:"nodesPerPage"},lodSelectionMetricType:{path:"lodSelectionMetricType",default:"maxScreenThresholdSQ"}}),pXt=()=>({xmin:{path:"xmin"},ymin:{path:"ymin"},xmax:{path:"xmax"},ymax:{path:"ymax"},zmin:{path:"zmin"},zmax:{path:"zmax"}}),eRe=()=>({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,Zb.default)(e,fXt())},capabilities:{path:"capabilities",default:["View","Query"]},store:{path:"store",transform:e=>(0,Zb.default)(e,ZBe)},fullExtent:{path:"fullExtent",transform:e=>(0,Zb.default)(e,pXt())},heightModelInfo:{path:"heightModelInfo",transform:e=>(0,Zb.default)(e,dXt())},nodePages:{path:"nodePages",transform:e=>(0,Zb.default)(e,hXt())},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 UW=Kt(_u(),1),mXt=()=>({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}}}),gXt=()=>({"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}}}),tRe=()=>({geometryBuffers:{path:"geometryConfig",transform:e=>{let t=[(0,UW.default)(e,mXt())];return e.draco&&t.push((0,UW.default)({geometryConfig:e},gXt())),t}}});var lE=Kt(_u(),1),vXt=()=>({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}}),bXt=()=>({name:{path:"name",default:"standard"},type:{path:"type",default:"standard"},params:{path:"params",transform:(e,t,r)=>(0,lE.default)(r,vXt())}}),yXt=()=>({id:{path:"id"},size:{path:"size"},href:{path:"href",default:["../textures/0"]},length:{path:"length"}}),xXt=()=>({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,lE.default)(n,yXt()))}}),rRe=()=>({materialDefinitions:{path:"materialDefinitionInfos",transform:_Xt},textureDefinitions:{path:"textureDefinitionInfos",transform:EXt}});function _Xt(e,t,r){let n={};for(let[i,a]of e.entries())n[`Mat${r.nodePath}${i}`]=(0,lE.default)(a,bXt());return n}function EXt(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,lE.default)(a,xXt())}return n}var wXt=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 iRe(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 AXt(t,e),SXt(t,e),t}function AXt(e,t){var o;let r=TXt(t.parentNode.obb),n=CXt(t);if(DXt(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 SXt(e,t){var a;let r=nRe(t.mbs),n=nRe(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 nRe(e){return new Ya([e[0],e[1],e[2]],e[3])}function TXt(e){let{center:t,halfSize:r,quaternion:n}=e;return new aa().fromCenterHalfSizeQuaternion(t,r,n)}function CXt(e){let t=e.obb.halfSize,r=wXt,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 DXt(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 eB=class extends Array{enqueue(t){this.push(t)}dequeue(){return this.shift()}peek(){return this[0]}isEmpty(){return this.length===0}};var aRe=Kt(require("process"),1),FXt=4*1024*1024*1024,ey=class extends eB{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),aRe.default.memoryUsage().rss>FXt&&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 ty="Tile converter does not work in browser, only in node js environment";var zW=require("path"),HW=Kt(_u(),1);var oRe=Kt(_u(),1),sRe=()=>({mbs:{path:"mbs"},obb:{path:"obb"}}),BXt=()=>({href:{path:"href"}}),RXt=()=>({id:{path:"id"},...BXt(),...sRe()}),GW=()=>({version:{path:"version"},id:{path:"id"},path:{path:"path"},level:{path:"level"},...sRe(),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,oRe.default)(e,RXt()),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 Au=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,zW.join)(this.converter.layers0Path,"nodes",this.id);this.converter.options.slpk?await this.converter.writeQueue.enqueue({archiveKey:`nodes/${this.id}/3dNodeIndexDocument.json.gz`,writePromise:()=>Mc(r,JSON.stringify(t),"3dNodeIndexDocument.json",!0,this.converter.compressList)},!0):await this.converter.writeQueue.enqueue({writePromise:()=>Fi(r,JSON.stringify(t))},!0)}async load(){if(this.data)return this.data;let t=this.id,r=(0,zW.join)(this.converter.layers0Path,"nodes",t),n="index.json";return this.converter.options.slpk&&(n="3dNodeIndexDocument.json"),await K4(r,n)}flush(){this.data=null}static async createRootNode(t,r){let n=Au.createRootNodeIndexDocument(t);return await new Au(0,r).addData(n)}static async createNode(t,r,n,i,a,o){let s=await Au.createNodeIndexDocument(t,r,n,i,a);return await new Au(i.index,o).addData(s)}static createRootNodeIndexDocument(t){let r={version:`{${Rc().toUpperCase()}}`,id:"root",level:0,lodSelection:[{metricType:"maxScreenThresholdSQ",maxError:0},{metricType:"maxScreenThreshold",maxError:0}],...t,children:[]};return(0,HW.default)(r,GW())}static async createNodeIndexDocument(t,r,n,i,a){var d,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,HW.default)(l,GW());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=(d=t.converter.layers0)==null?void 0:d.attributeStorageInfo)!=null&&h.length))){f.attributeData=[];let p=s.length<t.converter.layers0.attributeStorageInfo.length?s.length:t.converter.layers0.attributeStorageInfo.length;for(let b=0;b<p;b++){let g=t.converter.layers0.attributeStorageInfo[b].key;f.attributeData.push({href:`./attributes/${g}/0`})}}return f}};var WW=async(e,t,r)=>{let n=fE(t);if(!e||!t.contentUrl||!n)return;let i={...r,[e.loader.id]:{isTileset:n,assetGltfUpAxis:e.asset&&e.asset.gltfUpAxis||"Y"}},a=await tB(t.contentUrl,e.loader,i);a.root&&(t.children=[a.root])},VW=async(e,t,r)=>{let n=fE(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 tB(t.contentUrl,e.loader,i)};async function tB(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 n2(a),s=await mn(i,t,{...r,fetch:o.fetch.bind(o)});return await o.destroy(),s}return await mn(e,t,r)}function fE(e){return(e==null?void 0:e.type)==="json"||(e==null?void 0:e.type)==="3tz"}var rB=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 rB(u,s,r,n,i,a+1);n&&await n(o,t)};var OXt=["POINTS","LINES","LINE_LOOP","LINE_STRIP","TRIANGLES","TRIANGLE_STRIP","TRIANGLE_FAN"],uRe=async e=>{let t={meshTopologyTypes:new Set,metadataClasses:new Set};if(!(e!=null&&e.gltfArrayBuffer))return t;let n=(await Bo(e.gltfArrayBuffer,kl,{gltf:{normalize:!1,loadBuffers:!1,loadImages:!1,decompressMeshes:!1}})).json;if(!n)return t;let i=kXt(n),a=IXt(n);return{meshTopologyTypes:i,metadataClasses:a}},kXt=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(OXt[i])}return t},IXt=e=>{var i,a,o,s,u,c;let t=new Set,r=(o=(a=(i=e.extensions)==null?void 0:i[gs])==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[Ol])==null?void 0:u.schema)==null?void 0:c.classes;if(n)for(let l of Object.keys(n))t.add(l);return t},cRe=(e,t)=>{for(let r of t.meshTopologyTypes)e.meshTopologyTypes.add(r);for(let r of t.metadataClasses)e.metadataClasses.add(r)};var fRe,PXt=(fRe=C0.default.env)==null?void 0:fRe.IonToken,lRe=64,jXt="3DTILES",LXt="3DObject",MXt=1800,qXt="https://",ry=class{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=Ec;generateTextures;generateBoundingVolumes;layersHasTexture;workerSource={};writeQueue=new ey;compressList=null;preprocessData={meshTopologyTypes:new Set,metadataClasses:new Set};constructor(){this.nodePages=new Za(Fi,lRe,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(vn)return console.log(ty),ty;this.conversionStartTime=C0.default.hrtime();let{tilesetName:r,slpk:n,egmFilePath:i,inputUrl:a,validate:o,outputPath:s,draco:u=!0,sevenZipExe:c,maxDepth:l,token:f,generateTextures:d,generateBoundingVolumes:h,instantNodeWriting:p=!1,mergeMaterials:b=!0,inquirer:g,metadataClass:x,analyze:w=!1}=t;this.options={maxDepth:l,slpk:n,sevenZipExe:c,egmFilePath:i,draco:u,token:f,inputUrl:a,instantNodeWriting:p,mergeMaterials:b,inquirer:g,metadataClass:x},this.compressList=this.options.instantNodeWriting&&[]||null,this.validate=Boolean(o),this.Loader=a.indexOf(qXt)!==-1?fD:Ec,this.generateTextures=Boolean(d),this.generateBoundingVolumes=Boolean(h),this.writeQueue=new ey,this.writeQueue.startListening(),console.log("Loading egm file..."),this.geoidHeightModel=await mn(i,Z4),console.log("Loading egm file completed!"),n&&this.nodePages.useWriteFunction(Mc);try{let S=await this._fetchPreloadOptions(),F=a;S.url&&(F=S.url),S.headers&&(this.loadOptions.fetch={headers:S.headers}),this.sourceTileset=await tB(F,this.Loader,this.loadOptions),(this.Loader===Ec||w?await this.preprocessConversion():!0)&&!w&&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(),Pa.getWorkerFarm({}).destroy()}return"success"}async preprocessConversion(){console.log("Analyze source tileset");let t=this.sourceTileset.root;await rB(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(`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(fE(t))return await WW(this.sourceTileset,t,this.loadOptions),null;t.id&&console.log(`[analyze]: ${t.id}`);let i=null;try{i=await VW(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 uRe(i);return cRe(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,Na.join)(`${t}`,`${r}`);try{await iE(n)}catch{}this.layers0Path=(0,Na.join)(n,"SceneServer","layers","0"),this.materialDefinitions=[],this.materialMap=new Map;let i=this.sourceTileset.root,a=TC(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=IW(a,this.geoidHeightModel);await this.nodePages.push({index:0,lodThreshold:0,obb:o.obb,children:[]});let s=await Au.createRootNode(o,this);await rB(i,{transform:new Kr(i.transform),parentNodes:[s]},this.convertTile.bind(this),this.finalizeTile.bind(this),this.options.maxDepth),this.layers0.materialDefinitions=this.materialDefinitions,this.layers0.geometryDefinitions=(0,nB.default)(this.geometryConfigs.map(f=>({geometryConfig:{...f,draco:this.options.draco}})),tRe()),this.layersHasTexture===!1&&(this.layers0.store.defaultGeometrySchema.ordering=this.layers0.store.defaultGeometrySchema.ordering.filter(f=>f!=="uv0")),await this._writeLayers0(),YBe(r,this.layers0,n);for(let f of this.compressList||[])await V4(f),await kW(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=ABe(r);n&&(i.zmin=n[4],i.zmax=n[5]);let a=[i.xmin,i.ymin,i.xmax,i.ymax],o={version:`{${Rc().toUpperCase()}}`,id:0,name:t,href:"./layers/0",store:{id:`{${Rc().toUpperCase()}}`,extent:a},nodePages:{nodesPerPage:lRe},compressGeometry:this.options.draco,fullExtent:i};this.layers0=(0,nB.default)(o,eRe())}async _writeLayers0(){this.options.slpk?await this.writeQueue.enqueue({archiveKey:"3dSceneLayer.json.gz",writePromise:()=>Mc(this.layers0Path,JSON.stringify(this.layers0),"3dSceneLayer.json")}):await this.writeQueue.enqueue({writePromise:()=>Fi(this.layers0Path,JSON.stringify(this.layers0))})}async _createSlpk(t){if(this.options.slpk){let r=(0,Na.join)(t,"SceneServer","layers","0"),n=`${t}.slpk`;await gBe(r,n,0,".",this.options.sevenZipExe);try{await iE(t)}catch{}}}async convertTile(t,r){let n=fE(t);if(n||t.type==="empty")return n&&(t.id&&console.log(`[load]: ${t.id}`),await WW(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);return await s.addChildren(u),{transform:o,parentNodes:u}}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 VW(this.sourceTileset,r,this.loadOptions)}catch{console.log(`[warning]: Failed to load ${r.contentUrl}`)}let a=TC(r.boundingVolume,n,null),o=IW(a,this.geoidHeightModel),s=WBe(i,this.options.metadataClass);this.createAttributeStorageInfo(i,s);let u=await this._convertResources(r,n,a,i,t.inPageId,s),c=[],l=[],f=[],d={geometry:null,compressedGeometry:null,texture:null,hasUvRegions:!1,sharedResources:null,meshMaterial:null,vertexCount:null,attributes:null,featureCount:null,boundingVolumes:null};for(let h of u||[d]){this.layersHasTexture=this.layersHasTexture||Boolean(h.texture),this.generateBoundingVolumes&&h.boundingVolumes&&(o=h.boundingVolumes);let p=$Be(r,o),b=p.find(S=>S.metricType==="maxScreenThresholdSQ")||{maxError:0},g=await this._updateNodeInNodePages(b,o,r,t.inPageId,h),x=await Au.createNodeIndexDocument(t,o,p,g,h),w=await new Au(g.index,this).addData(x);c.push(w),g.mesh&&await this._writeResources(h,w.id),this.validate&&(this.boundingVolumeWarnings=iRe(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){var c;if(!this.isContentSupported(t)||!i)return null;let s={center:[],halfSize:[],quaternion:[]};return await jW(i,r,n,async()=>(await this.nodePages.push({index:0,obb:s},a)).index,o,this.featuresHashArray,(c=this.layers0)==null?void 0:c.attributeStorageInfo,this.options.draco,this.generateBoundingVolumes,this.options.mergeMaterials,this.geoidHeightModel,this.loadOptions.modules,this.options.metadataClass)}async _updateNodeInNodePages(t,r,n,i,a){let{meshMaterial:o,texture:s,vertexCount:u,featureCount:c,geometry:l,hasUvRegions:f}=a,d={index:0,lodThreshold:t.maxError,obb:r.obb,children:[]};l&&this.isContentSupported(n)&&(d.mesh={geometry:{definition:this.findOrCreateGeometryDefinition(Boolean(s),f),resource:0},attribute:{resource:0},material:{definition:0}});let h=a.nodeId,p;if(h?p=await this.nodePages.getNodeById(h):p=await this.nodePages.push(d,i),d.mesh||console.log(`[warning]: node ${p.index} is created with empty content`),Za.updateAll(p,d),o&&Za.updateMaterialByNodeId(p,this._findOrCreateMaterial(o)),s){let b=s.image.height*s.image.width;Za.updateTexelCountHintByNodeId(p,b)}return u&&(this.vertexCounter+=u,Za.updateVertexCountByNodeId(p,u)),Za.updateNodeAttributeByNodeId(p),c&&Za.updateFeatureCountByNodeId(p,c),this.nodePages.saveNode(p),p}async _writeResources(t,r){let{geometry:n,compressedGeometry:i,texture:a,sharedResources:o,attributes:s}=t,u=(0,Na.join)(this.layers0Path,"nodes",r),c=(0,Na.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,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/0.bin.gz`,writePromise:()=>Mc(a,t,"0.bin")})}else{let a=(0,Na.join)(n,"geometries/0/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,t,"index.bin")})}if(this.options.draco)if(this.options.slpk){let a=(0,Na.join)(n,"geometries");await this.writeQueue.enqueue({archiveKey:`${i}/geometries/1.bin.gz`,writePromise:()=>Mc(a,r,"1.bin")})}else{let a=(0,Na.join)(n,"geometries/1/");await this.writeQueue.enqueue({writePromise:()=>Fi(a,r,"index.bin")})}}async _writeShared(t,r,n,i){if(!t)return;t.nodePath=i;let a=(0,nB.default)(t,rRe()),o=JSON.stringify(a);if(this.options.slpk){let s=(0,Na.join)(r,"shared");await this.writeQueue.enqueue({archiveKey:`${n}/shared/sharedResource.json.gz`,writePromise:()=>Mc(s,o,"sharedResource.json")})}else{let s=(0,Na.join)(r,"shared/");await this.writeQueue.enqueue({writePromise:()=>Fi(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=dv({...t.image,data:u},bq,{...bq.options,["ktx2-basis-writer"]:{workerUrl:"./modules/textures/dist/ktx2-basis-writer-worker-node.js"},reuseWorkers:!0,_nodeWorkers:!0,useLocalLibraries:!0});await this.writeTextureFile(c,"1","ktx2",r,n)}break}case"ktx2":if(a.push({name:"1",format:i}),await this.writeTextureFile(o,"1",i,r,n),this.generateTextures){a.push({name:"0",format:"jpg"});let s=dv(t.image.data[0],tq);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,Na.join)(i,"textures"),s=!1;await this.writeQueue.enqueue({archiveKey:`${a}/textures/${r}.${n}`,writePromise:()=>Mc(o,t,`${r}.${n}`,s)})}else{let o=(0,Na.join)(i,`textures/${r}/`);await this.writeQueue.enqueue({writePromise:()=>Fi(o,t,`index.${n}`)})}}async _writeAttributes(t=[],r,n){var i,a;if(t!=null&&t.length&&((a=(i=this.layers0)==null?void 0:i.attributeStorageInfo)!=null&&a.length)){let o=t.length<this.layers0.attributeStorageInfo.length?t.length:this.layers0.attributeStorageInfo.length;for(let s=0;s<o;s++){let u=this.layers0.attributeStorageInfo[s].key,c=new Uint8Array(t[s]);if(this.options.slpk){let l=(0,Na.join)(r,"attributes",u);await this.writeQueue.enqueue({archiveKey:`${n}/attributes/${u}.bin.gz`,writePromise:()=>Mc(l,c,"0.bin")})}else{let l=(0,Na.join)(r,`attributes/${u}/0`);await this.writeQueue.enqueue({writePromise:()=>Fi(l,c,"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,KW.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,KW.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.layers0.attributeStorageInfo.length&&(t!=null&&t.gltf)&&(n=MBe(t.gltf,this.options.metadataClass)):r&&(n=LBe(r)),n&&this.createStorageAttributes(n)}createStorageAttributes(t){if(!Object.keys(t).length)return;let r={OBJECTID:"OBJECTID",...t},n=!1,i=this.layers0.attributeStorageInfo.length;for(let a in r)if(!this.layers0.attributeStorageInfo.find(s=>s.name===a)){let s=r[a],u=kBe(i,a,s),c=IBe(s),l=PBe(a,c);this.layers0.attributeStorageInfo.push(u),this.layers0.fields.push(l),i+=1,n=!0}if(n){let a=[];for(let o of this.layers0.attributeStorageInfo)a.push(o.name);this.layers0.popupInfo=jBe(a),this.layers0.layerType=LXt}}async _finishConversion(t){let{tilesCount:r,tilesWithAddRefineCount:n}=this.refinementCounter,i=n?n/r*100:0,a=await $4(t),o=C0.default.hrtime(this.conversionStartTime),s=Y4(o);console.log("------------------------------------------------"),console.log(`Finishing conversion of ${jXt}`),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||PXt}},r=await this.Loader.preload(this.options.inputUrl,t);return this.refreshTokenTime=C0.default.hrtime(),{...t,...r}}async _updateTilesetOptions(){if(C0.default.hrtime(this.refreshTokenTime)[0]<MXt)return;this.refreshTokenTime=C0.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 MRe=require("path"),JW=Kt(require("process"),1),qRe=Kt(_u(),1);var ny=Kt(dRe(),1);function XW(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 hRe={UInt8:ny.default.UNSIGNED_BYTE,UInt16:ny.default.UNSIGNED_SHORT,Float32:ny.default.FLOAT,UInt32:ny.default.UNSIGNED_INT,UInt64:ny.default.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 pRe="String",mRe="Oid32",gRe="Float64",vRe="Int16";function aB(e){let t;try{let r=new URL(e);t=`${r.origin}${r.pathname}`}catch{}return t||e}function yh(e,t=null){return t?`${e}?token=${t}`:e}function bRe(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 yRe(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}function _Re(e,t){let{attributeName:r,attributeType:n}=t;return r?{[r]:n?UXt(n,e):null}:{}}function UXt(e,t){switch(e){case pRe:return HXt(t);case mRe:return xRe(t);case gRe:return zXt(t);case vRe:return GXt(t);default:return xRe(t)}}function xRe(e){return new Uint32Array(e,4)}function GXt(e){return new Int16Array(e,4)}function zXt(e){return new Float64Array(e,8)}function HXt(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 WXt="4.0.0-beta.6";var dE={name:"I3S Attribute",id:"i3s-attribute",module:"i3s",version:WXt,mimeTypes:["application/binary"],parse:async(e,t)=>_Re(e,t),extensions:["bin"],options:{},binary:!0};function ERe(e){return e.hasOwnProperty("objectIds")?"Oid32":e.hasOwnProperty("attributeValues")?e.attributeValues.valueType:""}async function ARe(e,t,r,n,i){var l;if(!((l=i==null?void 0:i.i3s)!=null&&l.colorsByAttribute))return e;let a=n.fields.find(({name:f})=>{var d,h;return f===((h=(d=i==null?void 0:i.i3s)==null?void 0:d.colorsByAttribute)==null?void 0:h.attributeName)});if(!a||!["esriFieldTypeDouble","esriFieldTypeInteger","esriFieldTypeSmallInteger"].includes(a.type))return e;let o=await wRe(a.name,r,n,i);if(!o)return e;let s=n.fields.find(({type:f})=>f==="esriFieldTypeOID");if(!s)return e;let u=await wRe(s.name,r,n,i);if(!u)return e;let c={};for(let f=0;f<u[s.name].length;f++)c[u[s.name][f]]=VXt(o[a.name][f],i);for(let f=0;f<t.value.length;f++){let d=c[t.value[f]];d&&(i.i3s.colorsByAttribute.mode==="multiply"?d.forEach((h,p)=>{e.value[f*4+p]=e.value[f*4+p]*h/255}):e.value.set(d,f*4))}return e}function VXt(e,t){var u;if(!((u=t==null?void 0:t.i3s)!=null&&u.colorsByAttribute))return[255,255,255,255];let{minValue:r,maxValue:n,minColor:i,maxColor:a}=t.i3s.colorsByAttribute,o=(e-r)/(n-r),s=[255,255,255,255];for(let c=0;c<i.length;c++)s[c]=Math.round((a[c]-i[c])*o+i[c]);return s}async function wRe(e,{attributeUrls:t},{attributeStorageInfo:r},n){var u;let i=r.findIndex(({name:c})=>e===c);if(i===-1)return null;let a=yh(t[i],(u=n==null?void 0:n.i3s)==null?void 0:u.token),o=ERe(r[i]);return await mn(a,dE,{attributeName:e,attributeType:o})}var oB=new ce([0,0,0]);function XXt(e){switch(e){case"ktx-etc2":case"dds":return XC;case"ktx2":return kp;case"jpg":case"png":default:return Tv}}var YXt="i3s-attribute-type";async function DRe(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=yh(t.textureUrl,(o=n==null?void 0:n.i3s)==null?void 0:o.token),u=XXt(t.textureFormat),f=await(await(i==null?void 0:i.fetch)(s)).arrayBuffer();if(n!=null&&n.i3s.decodeTextures){if(u===Tv){let d={...t.textureLoaderOptions,image:{type:"data"}};try{let h=await So(f,[],d,i);a.texture=h}catch{let p=await Bo(f,u,d,i);a.texture=p}}else if(u===XC||u===kp){let d=await mn(f,u,t.textureLoaderOptions);u===kp&&(d=d[0]),a.texture={compressed:!0,mipmaps:!1,width:d[0].width,height:d[0].height,data:d}}}else a.texture=f}return a.material=iYt(t.materialDefinition,a.texture),a.material&&(a.texture=null),await $Xt(e,a,t,r,n)}async function $Xt(e,t,r,n,i){var f,d;let a=e.byteLength,o,s,u=0,c=0,l;if(r.isDracoGeometry){let h=await Bo(e,xv,{draco:{attributeNameEntry:YXt}});s=h.header.vertexCount,l=(f=h.indices)==null?void 0:f.value;let{POSITION:p,NORMAL:b,COLOR_0:g,TEXCOORD_0:x,["feature-index"]:w,["uv-region"]:S}=h.attributes;o={position:p,normal:b,color:g,uv0:x,uvRegion:S,id:w},JXt(o,h);let F=uYt(w);F&&sYt(o,F)}else{let{vertexAttributes:h,ordering:p,featureAttributes:b,featureAttributeOrder:g}=n.store.defaultGeometrySchema,x=ZXt(e,n);u=x.byteOffset,s=x.vertexCount,c=x.featureCount;let{attributes:w,byteOffset:S}=TRe(e,u,h,s,p),{attributes:F}=TRe(e,S,b,c,g);oYt(F),o=QXt(w,F)}if(!((d=i==null?void 0:i.i3s)!=null&&d.coordinateSystem)||i.i3s.coordinateSystem===2){let h=tYt(o.position,r);t.modelMatrix=h.invert(),t.coordinateSystem=2}else t.modelMatrix=nYt(o.position),t.coordinateSystem=3;o.color=await ARe(o.color,o.id,r,n,i),t.attributes={positions:o.position,normals:o.normal,colors:SRe(o.color),texCoords:o.uv0,uvRegions:SRe(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 JXt(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 QXt(e,t){return{...e,...t}}function SRe(e){return e&&(e.normalized=!0,e)}function ZXt(e,t){let r=0,n=0,i=0;for(let{property:a,type:o}of t.store.defaultGeometrySchema.header){let s=XW(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 TRe(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=eYt(c,n*u,iy(s));else{let f=XW(s);l=new f(c,0,n*u)}switch(a[o]={value:l,type:hRe[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 eYt(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 tYt(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=rYt(n,i,o),a}function rYt(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),oB),n[o]=oB.x,n[o+1]=oB.y,n[o+2]=oB.z;return n}function nYt(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 iYt(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=CRe(r.emissiveFactor)),r.pbrMetallicRoughness&&r.pbrMetallicRoughness.baseColorFactor&&(r.pbrMetallicRoughness.baseColorFactor=CRe(r.pbrMetallicRoughness.baseColorFactor)),t&&aYt(r,t),r}function CRe(e){let t=[...e];for(let r=0;r<e.length;r++)t[r]=e[r]/255;return t}function aYt(e,t){let r={source:{image:t}};e.pbrMetallicRoughness&&e.pbrMetallicRoughness.baseColorTexture?e.pbrMetallicRoughness.baseColorTexture={...e.pbrMetallicRoughness.baseColorTexture,texture:r}:e.emissiveTexture?e.emissiveTexture={...e.emissiveTexture,texture:r}:e.pbrMetallicRoughness&&e.pbrMetallicRoughness.metallicRoughnessTexture?e.pbrMetallicRoughness.metallicRoughnessTexture={...e.pbrMetallicRoughness.metallicRoughnessTexture,texture:r}:e.normalTexture?e.normalTexture={...e.normalTexture,texture:r}:e.occlusionTexture&&(e.occlusionTexture={...e.occlusionTexture,texture:r})}function oYt(e){let{id:t,faceRange:r}=e;if(!t||!r)return;let n=t.value,i=r.value,a=i[i.length-1]+1,o=new Uint32Array(a*3),s=0,u=0;for(let c=1;c<i.length;c+=2){let l=Number(n[s]),f=i[c],d=i[c-1],h=f-d+1,p=u+h*3;o.fill(l,u,p),s++,u=p}e.id.value=o}function sYt(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 uYt(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 cYt="4.0.0-beta.6",FRe={name:"I3S Content (Indexed Scene Layers)",id:"i3s-content",module:"i3s",worker:!0,version:cYt,mimeTypes:["application/octet-stream"],parse:lYt,extensions:["bin"],options:{"i3s-content":{}}};async function lYt(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 DRe(e,s,u,t,r)}var fYt="4.0.0-beta.6",BRe={name:"I3S Node Page",id:"i3s-node-page",module:"i3s",version:fYt,mimeTypes:["application/json"],parse:dYt,extensions:["json"],options:{i3s:{}}};async function dYt(e,t){return JSON.parse(new TextDecoder().decode(e))}var hE=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=yh(`${this.url}/nodepages/${r}`,(i=this.options.i3s)==null?void 0:i.token);this.pendingNodePages[r]={status:"Pending",promise:mn(a,BRe,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:p}=r.mesh.geometry&&this.getContentUrl(r.mesh.geometry)||{isDracoGeometry:!1};o=h,f=p;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=yRe(this.tileset,this.url,r.mesh.attribute.resource))}let d=this.getLodSelection(r);return YW({id:t.toString(),lodSelection:d,obb:r.obb,contentUrl:o,textureUrl:s,attributeUrls:l,materialDefinition:u,textureFormat:c,textureLoaderOptions:this.textureLoaderOptions,children:n,isDracoGeometry:f})}getContentUrl(t){let r=null,n=this.tileset.geometryDefinitions[t.definition],i=-1;if(this.options.i3s&&this.options.i3s.useDracoGeometry&&(i=n.geometryBuffers.findIndex(a=>a.compressedAttributes&&a.compressedAttributes.encoding==="draco")),i===-1&&(i=n.geometryBuffers.findIndex(a=>!a.compressedAttributes)),i!==-1){let a=Boolean(n.geometryBuffers[i].compressedAttributes);r={url:`${this.url}/nodes/${t.resource}/geometries/${i}`,isDracoGeometry:a}}return r}getLodSelection(t){let r=[];return this.lodSelectionMetricType==="maxScreenThresholdSQ"&&r.push({metricType:"maxScreenThreshold",maxError:Math.sqrt(t.lodThreshold/(Math.PI*.25))}),r.push({metricType:this.lodSelectionMetricType,maxError:t.lodThreshold}),r}getInformationFromMaterial(t){var n,i,a;let r={textureData:{name:null}};if(t){let o=(n=this.tileset.materialDefinitions)==null?void 0:n[t.definition];if(o){r.materialDefinition=o;let s=(a=(i=o==null?void 0:o.pbrMetallicRoughness)==null?void 0:i.baseColorTexture)==null?void 0:a.textureSetDefinitionId;typeof s=="number"&&(r.textureData=this.textureDefinitionsSelectedFormats[s]||r.textureData)}}return r}initSelectedFormatsForTextureDefinitions(t){this.textureDefinitionsSelectedFormats=[];let r=this.getSupportedTextureFormats(),n=t.textureSetDefinitions||[];for(let i of n){let a=i&&i.formats||[],o=null;for(let s of r){let u=a.find(c=>c.format===s);if(u){o=u;break}}o&&o.format==="ktx2"&&(this.textureLoaderOptions.basis={format:Iv(),containerFormat:"ktx2",module:"encoder"}),this.textureDefinitionsSelectedFormats.push(o)}}getSupportedTextureFormats(){let t=[];if(!this.options.i3s||this.options.i3s.useCompressedTextures){let r=a_();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 RRe(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=bRe(r,e));let o=e.children||[];return YW({...e,children:o,url:r,contentUrl:n,textureUrl:i,textureFormat:"jpg",attributeUrls:a,isDracoGeometry:!1})}function YW(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 aa().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 ORe(e,t,r){let n=aB(r.url||""),i,a;if(e.nodePages)i=new hE(e,n,t),a=await i.formTileFromNodePages(0);else{let o=t.i3s,s=yh(`${n}/nodes/root`,o.token);a=await mn(s,Zl,{...t,i3s:{...t.i3s,loadContent:!1,isTileHeader:!0,isTileset:!1}})}return{...e,loader:Zl,url:n,basePath:n,type:"I3S",nodePagesTile:i,root:a,lodMetricType:a.lodMetricType,lodMetricValue:a.lodMetricValue}}var hYt="4.0.0-beta.6",pYt=/layers\/[0-9]+$/,mYt=/nodes\/([0-9-]+|root)$/,gYt="504b0304",vYt="PointCloud",Zl={name:"I3S (Indexed Scene Layers)",id:"i3s",module:"i3s",version:hYt,mimeTypes:["application/octet-stream"],parse:bYt,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,colorsByAttribute:null}}};async function bYt(e,t={},r){let n=r.url;if(t.i3s=t.i3s||{},EYt(e)===gYt)throw new Error("Files with .slpk extention currently are not supported by I3SLoader");let a=aB(n),o;t.i3s.isTileset==="auto"?o=pYt.test(a):o=t.i3s.isTileset;let s;return t.isTileHeader==="auto"?s=mYt.test(a):s=t.i3s.isTileHeader,o?e=await xYt(e,t,r):s?e=await _Yt(e,r):e=await yYt(e,t),e}async function yYt(e,t){return await Bo(e,FRe,t)}async function xYt(e,t,r){let n=JSON.parse(new TextDecoder().decode(e));if((n==null?void 0:n.layerType)===vYt)throw new Error("Point Cloud layers currently are not supported by I3SLoader");return await ORe(n,t,r)}async function _Yt(e,t){return e=JSON.parse(new TextDecoder().decode(e)),RRe(e,t)}function EYt(e){return e instanceof ArrayBuffer?[...new Uint8Array(e,0,4)].map(t=>t.toString(16).padStart(2,"0")).join(""):null}function $W(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 aa().fromCenterHalfSizeQuaternion(n,e.halfSize,e.quaternion);return[...i.center,...i.halfAxes.toArray()]}var sB=Kt(_u(),1),wYt=()=>({version:{path:"version",default:"1.0"}}),kRe=()=>({boundingVolume:{path:"boundingVolume"},geometricError:{path:"geometricError"},content:{path:"content"},children:{path:"children",transform:e=>e.map(t=>(0,sB.default)(t,kRe()))}}),IRe=()=>({asset:{path:"asset",transform:e=>(0,sB.default)(e,wYt())},geometricError:{path:"root",transform:e=>e.geometricError},root:{path:"root",transform:e=>(0,sB.default)(e,kRe())}});function PRe(e,t){let r=new Float32Array(e.length),n=SYt(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=AYt([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 AYt(e){return[e[0]-Math.floor(e[0]),e[1]-Math.floor(e[1])]}function SYt(e){let r=[];for(let n=0;n<e.length;n++)r[n]=e[n]/65535;return r}var TYt=new Kr([1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1]),jRe=new ce,pE=class{rtcCenter;i3sTile;async convert(t,r=null){let n=await this.buildGLTF(t,r);return iC({gltfEncoded:new Uint8Array(n),type:"b3dm",featuresLength:this._getFeaturesLength(r),batchTable:r},eG)}async buildGLTF(t,r){let{tileContent:n,textureFormat:i,box:a}=t,{material:o,attributes:s,indices:u,modelMatrix:c}=n,l=new qr,f=await this._addI3sTextureToGLTF(n,i,l),d=this._convertI3sMaterialToGLTFMaterial(o,f),h=l.addMaterial(d),p=s.positions,b=p.value;s.uvRegions&&s.texCoords&&(s.texCoords.value=PRe(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 w=u||J4(b.length/p.size),S=l.addMesh({attributes:s,indices:w,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(),iC(l.gltf,Lq)}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,jRe),c=jRe.subtract(u),a.set(c,o)}return a}_generateTransformMatrix(t){return new Kr().translate(t).multiplyLeft(TYt)}_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 LRe=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 mn(t.contentUrl,Zl,n)};var CYt="I3S",ay=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(vn)return console.log(ty),ty;let{inputUrl:r,outputPath:n,tilesetName:i,maxDepth:a,egmFilePath:o}=t;if(this.conversionStartTime=JW.default.hrtime(),this.options={maxDepth:a},console.log("Loading egm file..."),this.geoidHeightModel=await mn(o,Z4),console.log("Loading egm file completed!"),this.sourceTileset=await mn(r,Zl,this.loaderOptions),!this.sourceTileset)return;let s=(f=this.sourceTileset)==null?void 0:f.root;s.obb||(s.obb=PW(s.mbs)),this.tilesetPath=(0,MRe.join)(`${n}`,`${i}`),this.attributeStorageInfo=this.sourceTileset.attributeStorageInfo;try{await iE(this.tilesetPath)}catch{}let u={boundingVolume:{box:$W(s.obb,this.geoidHeightModel)},geometricError:MW(s),children:[]};await this._addChildren(s,u,1);let c=(0,qRe.default)({root:u},IRe());await Fi(this.tilesetPath,JSON.stringify(c),"tileset.json"),this._finishConversion({slpk:!1,outputPath:n,tilesetName:i}),Pa.getWorkerFarm({}).destroy()}async convertChildNode(t,r,n,i){let a=await this._loadChildNode(t,i);if(a.contentUrl){let o=await LRe(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=PW(a.mbs));let u={box:$W(a.obb,this.geoidHeightModel)},c={boundingVolume:u,geometricError:MW(a),children:[]},l={tileContent:o,box:u.box,textureFormat:a.textureFormat},d=await new pE().convert(l,s);c.content={uri:`${a.id}.b3dm`,boundingVolume:u},await Fi(this.tilesetPath,new Uint8Array(d),`${a.id}.b3dm`),r.children.push(c),await this._addChildren(a,c,n+1)}else await this._addChildren(a,r,n+1)}async _addChildren(t,r,n){if(this.options.maxDepth&&n>this.options.maxDepth)return;let i=[];for(let a of t.children||[])i.push(this.convertChildNode(t,r,n,a));await Promise.all(i)}async _loadChildNode(t,r){var i;let n;if((i=this.sourceTileset)!=null&&i.nodePagesTile)console.log(`Node conversion: ${r.id}`),n=await this.sourceTileset.nodePagesTile.formTileFromNodePages(parseInt(r.id));else{let a=this._relativeUrlToFullUrl(t.url,r.href),o={i3s:{...this.loaderOptions,isTileHeader:!0,loadContent:!1}};console.log(`Node conversion: ${a}`),n=await mn(a,Zl,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(mn(s,dE,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 $4(t),n=JW.default.hrtime(this.conversionStartTime),i=Y4(n);console.log("------------------------------------------------"),console.log(`Finish conversion of ${CYt}`),console.log(`Total conversion time: ${i}`),console.log("Vertex count: ",this.vertexCounter),console.log("File(s) size: ",r," bytes"),console.log("------------------------------------------------")}};var uB=require("path");var DYt="4.0.0-beta.6",FYt="https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip",cB=class{async install(t=""){console.log('Installing "EGM2008-5" model...');let r=await mn(FYt,VU,{}),n=process.cwd();t&&(n=(0,uB.join)(n,t)),await Fi(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(wd[ii.DECODER],"draco",ii.DECODER),await this.installFromUrl(wd[ii.DECODER_WASM],"draco",ii.DECODER_WASM),console.log('Installing "Draco encoder" library'),await this.installFromUrl(wd[ii.ENCODER],"draco",ii.ENCODER),console.log('Installing "Basis transcoder" library'),await this.installFromNpm("textures",xc.TRANSCODER,"libs"),await this.installFromNpm("textures",xc.TRANSCODER_WASM,"libs"),console.log('Installing "Basis encoder" library'),await this.installFromNpm("textures",xc.ENCODER,"libs"),await this.installFromNpm("textures",xc.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 Fo(`https://unpkg.com/@loaders.gl/${t}@${DYt}/dist/${n}/${r}`)).arrayBuffer();if(!a)return;let o=(0,uB.join)(process.cwd(),"modules",t,"dist",n);await Fi(o,a,r)}async installFromUrl(t,r,n){let a=await(await Fo(t)).arrayBuffer();if(!a)return;let o=(0,uB.join)(process.cwd(),"modules",r,"dist","libs");await Fi(o,a,n)}};function Su(e,t){if(e+1>=t.length)return"";let r=t[e+1];return r.indexOf("--")===0?"":r}function NRe(e,t){let r=Su(e,t);return console.log(`Input tileset value: ${r}`),console.log(`Modified tileset value: ${r.replace(/\\/g,"/")}`),r.replace(/\\/g,"/")}function URe(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 GRe(e,t){let r=Su(e,t),n=Number.parseInt(r);return isFinite(n)?n:NaN}function Nc(e,t){let r=Su(e,t).toLowerCase().trim();return["--no-draco","--split-nodes"].includes(t[e])&&!r?!1:!r||r==="true"}var QW={I3S:"I3S",_3DTILES:"3DTILES"};async function BYt(){let[,,...e]=process.argv;e.length===0&&ZW();let t=URe(e),r=kYt(t);if(r.installDependencies){new cB().install("deps");return}let n=OYt(r);await RYt(n)}BYt().catch(e=>{console.log(e),process.exit(1)});function ZW(){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 RYt(e){switch(console.log("------------------------------------------------"),console.log(`Starting conversion of ${e.inputType}`),console.log("------------------------------------------------"),e.inputType.toUpperCase()){case QW.I3S:new ay().convert({inputUrl:e.tileset,outputPath:e.output,tilesetName:e.name,maxDepth:e.maxDepth,egmFilePath:e.egm});break;case QW._3DTILES:await new ry().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:HRe.default});break;default:ZW()}}function OYt(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(QW).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 kYt(e){let t={output:"data",instantNodeWriting:!1,mergeMaterials:!0,sevenZipExe:"C:\\Program Files\\7-Zip\\7z.exe",egm:(0,zRe.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=Su(n,e);break;case"--tileset":t.tileset=NRe(n,e);break;case"--name":t.name=Su(n,e);break;case"--output":t.output=Su(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=GRe(n,e);break;case"--slpk":t.slpk=Nc(n,e);break;case"--7zExe":t.sevenZipExe=Su(n,e);break;case"--egm":t.egm=Su(n,e);break;case"--token":t.token=Su(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=Su(n,e);break;case"--help":ZW();break;default:console.warn(`Unknown option ${r}`),process.exit(0)}}),t}
180
180
  /*! Bundled license information:
181
181
 
182
182
  is-buffer/index.js: