minecraft-renderer 0.1.107 → 0.1.109
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lightOwnerWorker.js +9 -0
- package/dist/lightOwnerWorker.js.map +7 -0
- package/dist/mesher.js +1 -1
- package/dist/mesher.js.map +2 -2
- package/dist/mesherWasm.js +222 -222
- package/dist/minecraft-renderer.js +84 -84
- package/dist/minecraft-renderer.js.meta.json +1 -1
- package/dist/threeWorker.js +517 -517
- package/package.json +1 -1
- package/src/bundler/bundlePrepare.test.ts +25 -0
- package/src/bundler/bundlePrepare.ts +1 -1
- package/src/graphicsBackend/appViewer.ts +15 -0
- package/src/graphicsBackend/config.ts +5 -0
- package/src/graphicsBackend/rendererDefaultOptions.test.ts +51 -0
- package/src/graphicsBackend/rendererDefaultOptions.ts +13 -1
- package/src/graphicsBackend/rendererOptionsSync.ts +3 -3
- package/src/lib/blockEntityLightRegistry.ts +4 -0
- package/src/lib/worldrendererCommon.lightOwner.test.ts +916 -0
- package/src/lib/worldrendererCommon.removeColumn.test.ts +16 -0
- package/src/lib/worldrendererCommon.ts +329 -67
- package/src/lighting/cache/rendererLightCache.test.ts +158 -0
- package/src/lighting/cache/rendererLightCache.ts +248 -0
- package/src/lighting/coordinator/clientLightCoordinator.test.ts +102 -0
- package/src/lighting/coordinator/clientLightCoordinator.ts +574 -0
- package/src/lighting/debug/clientLightProbe.test.ts +24 -0
- package/src/lighting/debug/clientLightProbe.ts +20 -0
- package/src/lighting/debug/clientLightTrace.test.ts +271 -0
- package/src/lighting/debug/clientLightTrace.ts +335 -0
- package/src/lighting/entity/entityLightController.test.ts +216 -0
- package/src/lighting/entity/entityLightController.ts +322 -0
- package/src/lighting/owner/clientLightOwner.test.ts +467 -0
- package/src/lighting/owner/clientLightOwner.ts +523 -0
- package/src/lighting/owner/lightOwnerHost.test.ts +78 -0
- package/src/lighting/owner/lightOwnerHost.ts +202 -0
- package/src/lighting/owner/lightOwnerWorker.ts +154 -0
- package/src/lighting/owner/updateLight1171OwnerPath.test.ts +68 -0
- package/src/lighting/owner/updateLightToOwnerEvents.ts +49 -0
- package/src/lighting/tables/lightTables1171.generated.json +10 -0
- package/src/lighting/tables/lightTables1171.test.ts +168 -0
- package/src/lighting/tables/lightTables1171.ts +59 -0
- package/src/lighting/versioning/clientLightVersions.test.ts +241 -0
- package/src/lighting/versioning/clientLightVersions.ts +203 -0
- package/src/lighting/versioning/pendingSectionFlush.test.ts +214 -0
- package/src/lighting/versioning/pendingSectionFlush.ts +123 -0
- package/src/mesher-shared/lightNibblePack.ts +26 -0
- package/src/mesher-shared/mcDataWorkerShim.cjs +9 -7
- package/src/mesher-shared/modelsGeometryCommon.test.ts +6 -1
- package/src/mesher-shared/shared.ts +48 -1
- package/src/three/chunkMeshManager.ts +26 -0
- package/src/three/cloudCover.ts +22 -0
- package/src/three/cloudGeometry.ts +71 -0
- package/src/three/entities.ts +77 -11
- package/src/three/entity/EntityMesh.ts +1 -0
- package/src/three/entity/legWalkAnimation.test.ts +11 -2
- package/src/three/entity/legWalkAnimation.ts +1 -9
- package/src/three/globalBlockBuffer.ts +94 -2
- package/src/three/globalLegacyBuffer.ts +94 -2
- package/src/three/graphicsBackendBase.ts +2 -9
- package/src/three/modules/clouds.ts +98 -75
- package/src/three/tests/cloudGeometry.test.ts +87 -0
- package/src/three/tests/clouds.test.ts +65 -14
- package/src/three/tests/globalBlockBuffer.test.ts +98 -0
- package/src/three/tests/globalLegacyBuffer.test.ts +108 -0
- package/src/three/worldRendererThree.ts +75 -34
- package/src/wasm-mesher/bridge/render-from-wasm.ts +46 -1
- package/src/wasm-mesher/runtime-build/wasm_mesher.d.ts +31 -5
- package/src/wasm-mesher/runtime-build/wasm_mesher.js +180 -5
- package/src/wasm-mesher/runtime-build/wasm_mesher_bg.wasm +0 -0
- package/src/wasm-mesher/runtime-build/wasm_mesher_bg.wasm.d.ts +11 -0
- package/src/wasm-mesher/tests/mesherLightDependencies.test.ts +83 -0
- package/src/wasm-mesher/tests/mesherWasmColumnTickSelect.test.ts +39 -0
- package/src/wasm-mesher/tests/mesherWasmConversionCache.test.ts +30 -1
- package/src/wasm-mesher/tests/mesherWasmTickParseCache.test.ts +73 -0
- package/src/wasm-mesher/tests/mesherWasmTickSchedule.test.ts +51 -0
- package/src/wasm-mesher/tests/mesherWasmTopologyPostCache.test.ts +78 -0
- package/src/wasm-mesher/worker/clientLightDarkPublication.probe.test.ts +32 -0
- package/src/wasm-mesher/worker/mesherLightDependencies.ts +43 -0
- package/src/wasm-mesher/worker/mesherWasm.ownerLightSync.test.ts +198 -0
- package/src/wasm-mesher/worker/mesherWasm.ts +506 -96
- package/src/wasm-mesher/worker/mesherWasmChunkBuffer.ts +1 -0
- package/src/wasm-mesher/worker/mesherWasmColumnTickSelect.ts +47 -0
- package/src/wasm-mesher/worker/mesherWasmConversionCache.ts +16 -5
- package/src/wasm-mesher/worker/mesherWasmLightDirty.test.ts +17 -1
- package/src/wasm-mesher/worker/mesherWasmLightDirty.ts +10 -0
- package/src/wasm-mesher/worker/mesherWasmLightMerge.test.ts +208 -0
- package/src/wasm-mesher/worker/mesherWasmLightMerge.ts +228 -0
- package/src/wasm-mesher/worker/mesherWasmOwnerLight.test.ts +161 -0
- package/src/wasm-mesher/worker/mesherWasmOwnerLight.ts +112 -0
- package/src/wasm-mesher/worker/mesherWasmTickParseCache.ts +45 -0
- package/src/wasm-mesher/worker/mesherWasmTickSchedule.ts +44 -0
- package/src/wasm-mesher/worker/mesherWasmTopologyPostCache.ts +63 -0
- package/src/worldView/types.ts +1 -0
- package/src/worldView/worldView.geometryReload.test.ts +68 -0
- package/src/worldView/worldView.spiral.test.ts +1 -1
- package/src/worldView/worldView.ts +46 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
globalThis.global = globalThis;process = {env: {}, versions: {} };
|
|
2
|
+
"use strict";(()=>{var xr=Object.defineProperty;var At=(n,i)=>()=>(n&&(i=n(n=0)),i);var Ce=(n,i)=>{for(var s in i)xr(n,s,{get:i[s],enumerable:!0})};var H=At(()=>{});var ut={};Ce(ut,{_debugEnd:()=>_n,_debugProcess:()=>hn,_events:()=>Sn,_eventsCount:()=>vn,_exiting:()=>Ke,_fatalExceptions:()=>ln,_getActiveHandles:()=>Ze,_getActiveRequests:()=>Je,_kill:()=>tn,_linkedBinding:()=>Ye,_maxListeners:()=>xn,_preload_modules:()=>kn,_rawDebug:()=>je,_startProfilerIdleNotifier:()=>dn,_stopProfilerIdleNotifier:()=>yn,_tickCallback:()=>gn,abort:()=>En,addListener:()=>Mn,allowedNodeEnvironmentFlags:()=>sn,arch:()=>xe,argv:()=>Me,argv0:()=>Bn,assert:()=>un,binding:()=>Fe,browser:()=>$e,chdir:()=>He,config:()=>ze,cpuUsage:()=>Zt,cwd:()=>Ge,debugPort:()=>Cn,default:()=>Wn,dlopen:()=>Xe,domain:()=>qe,emit:()=>Fn,emitWarning:()=>Oe,env:()=>ve,execArgv:()=>Pe,execPath:()=>Tn,exit:()=>on,features:()=>an,hasUncaughtExceptionCaptureCallback:()=>pn,hrtime:()=>Jt,kill:()=>rn,listeners:()=>Hn,memoryUsage:()=>nn,moduleLoadList:()=>Ve,nextTick:()=>ke,off:()=>Rn,on:()=>_t,once:()=>Pn,openStdin:()=>cn,pid:()=>An,platform:()=>Se,ppid:()=>Ln,prependListener:()=>Dn,prependOnceListener:()=>Gn,reallyExit:()=>Qe,release:()=>We,removeAllListeners:()=>On,removeListener:()=>Nn,resourceUsage:()=>en,setSourceMapsEnabled:()=>Un,setUncaughtExceptionCaptureCallback:()=>fn,stderr:()=>bn,stdin:()=>mn,stdout:()=>wn,title:()=>Ie,umask:()=>De,uptime:()=>In,version:()=>Re,versions:()=>Ne});function le(n){throw new Error("Node.js process "+n+" is not supported by JSPM core outside of Node.js")}function Sr(){!St||!Lt||(St=!1,Lt.length?ht=Lt.concat(ht):Xt=-1,ht.length&&Be())}function Be(){if(!St){var n=setTimeout(Sr,0);St=!0;for(var i=ht.length;i;){for(Lt=ht,ht=[];++Xt<i;)Lt&&Lt[Xt].run();Xt=-1,i=ht.length}Lt=null,St=!1,clearTimeout(n)}}function ke(n){var i=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)i[s-1]=arguments[s];ht.push(new Ue(n,i)),ht.length===1&&!St&&setTimeout(Be,0)}function Ue(n,i){this.fun=n,this.array=i}function z(){}function Ye(n){le("_linkedBinding")}function Xe(n){le("dlopen")}function Je(){return[]}function Ze(){return[]}function un(n,i){if(!n)throw new Error(i||"assertion error")}function pn(){return!1}function In(){return mt.now()/1e3}function Jt(n){var i=Math.floor((Date.now()-mt.now())*.001),s=mt.now()*.001,a=Math.floor(s)+i,g=Math.floor(s%1*1e9);return n&&(a=a-n[0],g=g-n[1],g<0&&(a--,g+=ae)),[a,g]}function _t(){return Wn}function Hn(n){return[]}var ht,St,Lt,Xt,Ie,xe,Se,ve,Me,Pe,Re,Ne,Oe,Fe,De,Ge,He,We,$e,je,Ve,qe,Ke,ze,Qe,tn,Zt,en,nn,rn,on,cn,sn,an,ln,fn,gn,hn,_n,dn,yn,wn,bn,mn,En,An,Ln,Tn,Cn,Bn,kn,Un,mt,ue,ae,xn,Sn,vn,Mn,Pn,Rn,Nn,On,Fn,Dn,Gn,Wn,$n=At(()=>{H();$();W();ht=[],St=!1,Xt=-1;Ue.prototype.run=function(){this.fun.apply(null,this.array)};Ie="browser",xe="x64",Se="browser",ve={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Me=["/usr/bin/node"],Pe=[],Re="v16.8.0",Ne={},Oe=function(n,i){console.warn((i?i+": ":"")+n)},Fe=function(n){le("binding")},De=function(n){return 0},Ge=function(){return"/"},He=function(n){},We={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};$e=!0,je=z,Ve=[];qe={},Ke=!1,ze={};Qe=z,tn=z,Zt=function(){return{}},en=Zt,nn=Zt,rn=z,on=z,cn=z,sn={};an={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ln=z,fn=z;gn=z,hn=z,_n=z,dn=z,yn=z,wn=void 0,bn=void 0,mn=void 0,En=z,An=2,Ln=1,Tn="/bin/usr/node",Cn=9229,Bn="node",kn=[],Un=z,mt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};mt.now===void 0&&(ue=Date.now(),mt.timing&&mt.timing.navigationStart&&(ue=mt.timing.navigationStart),mt.now=()=>Date.now()-ue);ae=1e9;Jt.bigint=function(n){var i=Jt(n);return typeof BigInt>"u"?i[0]*ae+i[1]:BigInt(i[0]*ae)+BigInt(i[1])};xn=10,Sn={},vn=0;Mn=_t,Pn=_t,Rn=_t,Nn=_t,On=_t,Fn=z,Dn=_t,Gn=_t;Wn={version:Re,versions:Ne,arch:xe,platform:Se,browser:$e,release:We,_rawDebug:je,moduleLoadList:Ve,binding:Fe,_linkedBinding:Ye,_events:Sn,_eventsCount:vn,_maxListeners:xn,on:_t,addListener:Mn,once:Pn,off:Rn,removeListener:Nn,removeAllListeners:On,emit:Fn,prependListener:Dn,prependOnceListener:Gn,listeners:Hn,domain:qe,_exiting:Ke,config:ze,dlopen:Xe,uptime:In,_getActiveRequests:Je,_getActiveHandles:Ze,reallyExit:Qe,_kill:tn,cpuUsage:Zt,resourceUsage:en,memoryUsage:nn,kill:rn,exit:on,openStdin:cn,allowedNodeEnvironmentFlags:sn,assert:un,features:an,_fatalExceptions:ln,setUncaughtExceptionCaptureCallback:fn,hasUncaughtExceptionCaptureCallback:pn,emitWarning:Oe,nextTick:ke,_tickCallback:gn,_debugProcess:hn,_debugEnd:_n,_startProfilerIdleNotifier:dn,_stopProfilerIdleNotifier:yn,stdout:wn,stdin:mn,stderr:bn,abort:En,umask:De,chdir:He,cwd:Ge,env:ve,title:Ie,argv:Me,execArgv:Pe,pid:An,ppid:Ln,execPath:Tn,debugPort:Cn,hrtime:Jt,argv0:Bn,_preload_modules:kn,setSourceMapsEnabled:Un}});var W=At(()=>{$n()});function vr(){if(jn)return Ot;jn=!0,Ot.byteLength=w,Ot.toByteArray=U,Ot.fromByteArray=I;for(var n=[],i=[],s=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",g=0,_=a.length;g<_;++g)n[g]=a[g],i[a.charCodeAt(g)]=g;i[45]=62,i[95]=63;function c(d){var y=d.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var b=d.indexOf("=");b===-1&&(b=y);var L=b===y?0:4-b%4;return[b,L]}function w(d){var y=c(d),b=y[0],L=y[1];return(b+L)*3/4-L}function A(d,y,b){return(y+b)*3/4-b}function U(d){var y,b=c(d),L=b[0],k=b[1],m=new s(A(d,L,k)),S=0,M=k>0?L-4:L,x;for(x=0;x<M;x+=4)y=i[d.charCodeAt(x)]<<18|i[d.charCodeAt(x+1)]<<12|i[d.charCodeAt(x+2)]<<6|i[d.charCodeAt(x+3)],m[S++]=y>>16&255,m[S++]=y>>8&255,m[S++]=y&255;return k===2&&(y=i[d.charCodeAt(x)]<<2|i[d.charCodeAt(x+1)]>>4,m[S++]=y&255),k===1&&(y=i[d.charCodeAt(x)]<<10|i[d.charCodeAt(x+1)]<<4|i[d.charCodeAt(x+2)]>>2,m[S++]=y>>8&255,m[S++]=y&255),m}function E(d){return n[d>>18&63]+n[d>>12&63]+n[d>>6&63]+n[d&63]}function C(d,y,b){for(var L,k=[],m=y;m<b;m+=3)L=(d[m]<<16&16711680)+(d[m+1]<<8&65280)+(d[m+2]&255),k.push(E(L));return k.join("")}function I(d){for(var y,b=d.length,L=b%3,k=[],m=16383,S=0,M=b-L;S<M;S+=m)k.push(C(d,S,S+m>M?M:S+m));return L===1?(y=d[b-1],k.push(n[y>>2]+n[y<<4&63]+"==")):L===2&&(y=(d[b-2]<<8)+d[b-1],k.push(n[y>>10]+n[y>>4&63]+n[y<<2&63]+"=")),k.join("")}return Ot}function Mr(){if(Vn)return Qt;Vn=!0;return Qt.read=function(n,i,s,a,g){var _,c,w=g*8-a-1,A=(1<<w)-1,U=A>>1,E=-7,C=s?g-1:0,I=s?-1:1,d=n[i+C];for(C+=I,_=d&(1<<-E)-1,d>>=-E,E+=w;E>0;_=_*256+n[i+C],C+=I,E-=8);for(c=_&(1<<-E)-1,_>>=-E,E+=a;E>0;c=c*256+n[i+C],C+=I,E-=8);if(_===0)_=1-U;else{if(_===A)return c?NaN:(d?-1:1)*(1/0);c=c+Math.pow(2,a),_=_-U}return(d?-1:1)*c*Math.pow(2,_-a)},Qt.write=function(n,i,s,a,g,_){var c,w,A,U=_*8-g-1,E=(1<<U)-1,C=E>>1,I=g===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=a?0:_-1,y=a?1:-1,b=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(w=isNaN(i)?1:0,c=E):(c=Math.floor(Math.log(i)/Math.LN2),i*(A=Math.pow(2,-c))<1&&(c--,A*=2),c+C>=1?i+=I/A:i+=I*Math.pow(2,1-C),i*A>=2&&(c++,A/=2),c+C>=E?(w=0,c=E):c+C>=1?(w=(i*A-1)*Math.pow(2,g),c=c+C):(w=i*Math.pow(2,C-1)*Math.pow(2,g),c=0));g>=8;n[s+d]=w&255,d+=y,w/=256,g-=8);for(c=c<<g|w,U+=g;U>0;n[s+d]=c&255,d+=y,c/=256,U-=8);n[s+d-y]|=b*128},Qt}function qn(){if(Yn)return Tt;Yn=!0;let n=vr(),i=Mr(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Tt.Buffer=c,Tt.SlowBuffer=k,Tt.INSPECT_MAX_BYTES=50;let a=2147483647;Tt.kMaxLength=a,c.TYPED_ARRAY_SUPPORT=g(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function g(){try{let r=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(r,t),r.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function _(r){if(r>a)throw new RangeError('The value "'+r+'" is invalid for option "size"');let t=new Uint8Array(r);return Object.setPrototypeOf(t,c.prototype),t}function c(r,t,e){if(typeof r=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return E(r)}return w(r,t,e)}c.poolSize=8192;function w(r,t,e){if(typeof r=="string")return C(r,t);if(ArrayBuffer.isView(r))return d(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(gt(r,ArrayBuffer)||r&>(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(gt(r,SharedArrayBuffer)||r&>(r.buffer,SharedArrayBuffer)))return y(r,t,e);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let o=r.valueOf&&r.valueOf();if(o!=null&&o!==r)return c.from(o,t,e);let u=b(r);if(u)return u;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return c.from(r[Symbol.toPrimitive]("string"),t,e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}c.from=function(r,t,e){return w(r,t,e)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function A(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function U(r,t,e){return A(r),r<=0?_(r):t!==void 0?typeof e=="string"?_(r).fill(t,e):_(r).fill(t):_(r)}c.alloc=function(r,t,e){return U(r,t,e)};function E(r){return A(r),_(r<0?0:L(r)|0)}c.allocUnsafe=function(r){return E(r)},c.allocUnsafeSlow=function(r){return E(r)};function C(r,t){if((typeof t!="string"||t==="")&&(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let e=m(r,t)|0,o=_(e),u=o.write(r,t);return u!==e&&(o=o.slice(0,u)),o}function I(r){let t=r.length<0?0:L(r.length)|0,e=_(t);for(let o=0;o<t;o+=1)e[o]=r[o]&255;return e}function d(r){if(gt(r,Uint8Array)){let t=new Uint8Array(r);return y(t.buffer,t.byteOffset,t.byteLength)}return I(r)}function y(r,t,e){if(t<0||r.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<t+(e||0))throw new RangeError('"length" is outside of buffer bounds');let o;return t===void 0&&e===void 0?o=new Uint8Array(r):e===void 0?o=new Uint8Array(r,t):o=new Uint8Array(r,t,e),Object.setPrototypeOf(o,c.prototype),o}function b(r){if(c.isBuffer(r)){let t=L(r.length)|0,e=_(t);return e.length===0||r.copy(e,0,0,t),e}if(r.length!==void 0)return typeof r.length!="number"||se(r.length)?_(0):I(r);if(r.type==="Buffer"&&Array.isArray(r.data))return I(r.data)}function L(r){if(r>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return r|0}function k(r){return+r!=r&&(r=0),c.alloc(+r)}c.isBuffer=function(t){return t!=null&&t._isBuffer===!0&&t!==c.prototype},c.compare=function(t,e){if(gt(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),gt(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let o=t.length,u=e.length;for(let l=0,p=Math.min(o,u);l<p;++l)if(t[l]!==e[l]){o=t[l],u=e[l];break}return o<u?-1:u<o?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return c.alloc(0);let o;if(e===void 0)for(e=0,o=0;o<t.length;++o)e+=t[o].length;let u=c.allocUnsafe(e),l=0;for(o=0;o<t.length;++o){let p=t[o];if(gt(p,Uint8Array))l+p.length>u.length?(c.isBuffer(p)||(p=c.from(p)),p.copy(u,l)):Uint8Array.prototype.set.call(u,p,l);else if(c.isBuffer(p))p.copy(u,l);else throw new TypeError('"list" argument must be an Array of Buffers');l+=p.length}return u};function m(r,t){if(c.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||gt(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);let e=r.length,o=arguments.length>2&&arguments[2]===!0;if(!o&&e===0)return 0;let u=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":return ce(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return e*2;case"hex":return e>>>1;case"base64":return Te(r).length;default:if(u)return o?-1:ce(r).length;t=(""+t).toLowerCase(),u=!0}}c.byteLength=m;function S(r,t,e){let o=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((e===void 0||e>this.length)&&(e=this.length),e<=0)||(e>>>=0,t>>>=0,e<=t))return"";for(r||(r="utf8");;)switch(r){case"hex":return it(this,t,e);case"utf8":case"utf-8":return q(this,t,e);case"ascii":return nt(this,t,e);case"latin1":case"binary":return rt(this,t,e);case"base64":return Q(this,t,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ot(this,t,e);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),o=!0}}c.prototype._isBuffer=!0;function M(r,t,e){let o=r[t];r[t]=r[e],r[e]=o}c.prototype.swap16=function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)M(this,e,e+1);return this},c.prototype.swap32=function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)M(this,e,e+3),M(this,e+1,e+2);return this},c.prototype.swap64=function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)M(this,e,e+7),M(this,e+1,e+6),M(this,e+2,e+5),M(this,e+3,e+4);return this},c.prototype.toString=function(){let t=this.length;return t===0?"":arguments.length===0?q(this,0,t):S.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:c.compare(this,t)===0},c.prototype.inspect=function(){let t="",e=Tt.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(t,e,o,u,l){if(gt(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(e===void 0&&(e=0),o===void 0&&(o=t?t.length:0),u===void 0&&(u=0),l===void 0&&(l=this.length),e<0||o>t.length||u<0||l>this.length)throw new RangeError("out of range index");if(u>=l&&e>=o)return 0;if(u>=l)return-1;if(e>=o)return 1;if(e>>>=0,o>>>=0,u>>>=0,l>>>=0,this===t)return 0;let p=l-u,B=o-e,F=Math.min(p,B),O=this.slice(u,l),D=t.slice(e,o);for(let P=0;P<F;++P)if(O[P]!==D[P]){p=O[P],B=D[P];break}return p<B?-1:B<p?1:0};function x(r,t,e,o,u){if(r.length===0)return-1;if(typeof e=="string"?(o=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,se(e)&&(e=u?0:r.length-1),e<0&&(e=r.length+e),e>=r.length){if(u)return-1;e=r.length-1}else if(e<0)if(u)e=0;else return-1;if(typeof t=="string"&&(t=c.from(t,o)),c.isBuffer(t))return t.length===0?-1:j(r,t,e,o,u);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?u?Uint8Array.prototype.indexOf.call(r,t,e):Uint8Array.prototype.lastIndexOf.call(r,t,e):j(r,[t],e,o,u);throw new TypeError("val must be string, number or Buffer")}function j(r,t,e,o,u){let l=1,p=r.length,B=t.length;if(o!==void 0&&(o=String(o).toLowerCase(),o==="ucs2"||o==="ucs-2"||o==="utf16le"||o==="utf-16le")){if(r.length<2||t.length<2)return-1;l=2,p/=2,B/=2,e/=2}function F(D,P){return l===1?D[P]:D.readUInt16BE(P*l)}let O;if(u){let D=-1;for(O=e;O<p;O++)if(F(r,O)===F(t,D===-1?0:O-D)){if(D===-1&&(D=O),O-D+1===B)return D*l}else D!==-1&&(O-=O-D),D=-1}else for(e+B>p&&(e=p-B),O=e;O>=0;O--){let D=!0;for(let P=0;P<B;P++)if(F(r,O+P)!==F(t,P)){D=!1;break}if(D)return O}return-1}c.prototype.includes=function(t,e,o){return this.indexOf(t,e,o)!==-1},c.prototype.indexOf=function(t,e,o){return x(this,t,e,o,!0)},c.prototype.lastIndexOf=function(t,e,o){return x(this,t,e,o,!1)};function V(r,t,e,o){e=Number(e)||0;let u=r.length-e;o?(o=Number(o),o>u&&(o=u)):o=u;let l=t.length;o>l/2&&(o=l/2);let p;for(p=0;p<o;++p){let B=parseInt(t.substr(p*2,2),16);if(se(B))return p;r[e+p]=B}return p}function Y(r,t,e,o){return zt(ce(t,r.length-e),r,e,o)}function X(r,t,e,o){return zt(Br(t),r,e,o)}function J(r,t,e,o){return zt(Te(t),r,e,o)}function Z(r,t,e,o){return zt(kr(t,r.length-e),r,e,o)}c.prototype.write=function(t,e,o,u){if(e===void 0)u="utf8",o=this.length,e=0;else if(o===void 0&&typeof e=="string")u=e,o=this.length,e=0;else if(isFinite(e))e=e>>>0,isFinite(o)?(o=o>>>0,u===void 0&&(u="utf8")):(u=o,o=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let l=this.length-e;if((o===void 0||o>l)&&(o=l),t.length>0&&(o<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");u||(u="utf8");let p=!1;for(;;)switch(u){case"hex":return V(this,t,e,o);case"utf8":case"utf-8":return Y(this,t,e,o);case"ascii":case"latin1":case"binary":return X(this,t,e,o);case"base64":return J(this,t,e,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Z(this,t,e,o);default:if(p)throw new TypeError("Unknown encoding: "+u);u=(""+u).toLowerCase(),p=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Q(r,t,e){return t===0&&e===r.length?n.fromByteArray(r):n.fromByteArray(r.slice(t,e))}function q(r,t,e){e=Math.min(r.length,e);let o=[],u=t;for(;u<e;){let l=r[u],p=null,B=l>239?4:l>223?3:l>191?2:1;if(u+B<=e){let F,O,D,P;switch(B){case 1:l<128&&(p=l);break;case 2:F=r[u+1],(F&192)===128&&(P=(l&31)<<6|F&63,P>127&&(p=P));break;case 3:F=r[u+1],O=r[u+2],(F&192)===128&&(O&192)===128&&(P=(l&15)<<12|(F&63)<<6|O&63,P>2047&&(P<55296||P>57343)&&(p=P));break;case 4:F=r[u+1],O=r[u+2],D=r[u+3],(F&192)===128&&(O&192)===128&&(D&192)===128&&(P=(l&15)<<18|(F&63)<<12|(O&63)<<6|D&63,P>65535&&P<1114112&&(p=P))}}p===null?(p=65533,B=1):p>65535&&(p-=65536,o.push(p>>>10&1023|55296),p=56320|p&1023),o.push(p),u+=B}return tt(o)}let K=4096;function tt(r){let t=r.length;if(t<=K)return String.fromCharCode.apply(String,r);let e="",o=0;for(;o<t;)e+=String.fromCharCode.apply(String,r.slice(o,o+=K));return e}function nt(r,t,e){let o="";e=Math.min(r.length,e);for(let u=t;u<e;++u)o+=String.fromCharCode(r[u]&127);return o}function rt(r,t,e){let o="";e=Math.min(r.length,e);for(let u=t;u<e;++u)o+=String.fromCharCode(r[u]);return o}function it(r,t,e){let o=r.length;(!t||t<0)&&(t=0),(!e||e<0||e>o)&&(e=o);let u="";for(let l=t;l<e;++l)u+=Ur[r[l]];return u}function ot(r,t,e){let o=r.slice(t,e),u="";for(let l=0;l<o.length-1;l+=2)u+=String.fromCharCode(o[l]+o[l+1]*256);return u}c.prototype.slice=function(t,e){let o=this.length;t=~~t,e=e===void 0?o:~~e,t<0?(t+=o,t<0&&(t=0)):t>o&&(t=o),e<0?(e+=o,e<0&&(e=0)):e>o&&(e=o),e<t&&(e=t);let u=this.subarray(t,e);return Object.setPrototypeOf(u,c.prototype),u};function v(r,t,e){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+t>e)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,o){t=t>>>0,e=e>>>0,o||v(t,e,this.length);let u=this[t],l=1,p=0;for(;++p<e&&(l*=256);)u+=this[t+p]*l;return u},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,o){t=t>>>0,e=e>>>0,o||v(t,e,this.length);let u=this[t+--e],l=1;for(;e>0&&(l*=256);)u+=this[t+--e]*l;return u},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t=t>>>0,e||v(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t=t>>>0,e||v(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t=t>>>0,e||v(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t=t>>>0,e||v(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t=t>>>0,e||v(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=bt(function(t){t=t>>>0,wt(t,"offset");let e=this[t],o=this[t+7];(e===void 0||o===void 0)&&xt(t,this.length-8);let u=e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,l=this[++t]+this[++t]*2**8+this[++t]*2**16+o*2**24;return BigInt(u)+(BigInt(l)<<BigInt(32))}),c.prototype.readBigUInt64BE=bt(function(t){t=t>>>0,wt(t,"offset");let e=this[t],o=this[t+7];(e===void 0||o===void 0)&&xt(t,this.length-8);let u=e*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],l=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+o;return(BigInt(u)<<BigInt(32))+BigInt(l)}),c.prototype.readIntLE=function(t,e,o){t=t>>>0,e=e>>>0,o||v(t,e,this.length);let u=this[t],l=1,p=0;for(;++p<e&&(l*=256);)u+=this[t+p]*l;return l*=128,u>=l&&(u-=Math.pow(2,8*e)),u},c.prototype.readIntBE=function(t,e,o){t=t>>>0,e=e>>>0,o||v(t,e,this.length);let u=e,l=1,p=this[t+--u];for(;u>0&&(l*=256);)p+=this[t+--u]*l;return l*=128,p>=l&&(p-=Math.pow(2,8*e)),p},c.prototype.readInt8=function(t,e){return t=t>>>0,e||v(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},c.prototype.readInt16LE=function(t,e){t=t>>>0,e||v(t,2,this.length);let o=this[t]|this[t+1]<<8;return o&32768?o|4294901760:o},c.prototype.readInt16BE=function(t,e){t=t>>>0,e||v(t,2,this.length);let o=this[t+1]|this[t]<<8;return o&32768?o|4294901760:o},c.prototype.readInt32LE=function(t,e){return t=t>>>0,e||v(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t=t>>>0,e||v(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=bt(function(t){t=t>>>0,wt(t,"offset");let e=this[t],o=this[t+7];(e===void 0||o===void 0)&&xt(t,this.length-8);let u=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(o<<24);return(BigInt(u)<<BigInt(32))+BigInt(e+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)}),c.prototype.readBigInt64BE=bt(function(t){t=t>>>0,wt(t,"offset");let e=this[t],o=this[t+7];(e===void 0||o===void 0)&&xt(t,this.length-8);let u=(e<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(u)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+o)}),c.prototype.readFloatLE=function(t,e){return t=t>>>0,e||v(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t=t>>>0,e||v(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t=t>>>0,e||v(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t=t>>>0,e||v(t,8,this.length),i.read(this,t,!1,52,8)};function N(r,t,e,o,u,l){if(!c.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>u||t<l)throw new RangeError('"value" argument is out of bounds');if(e+o>r.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,o,u){if(t=+t,e=e>>>0,o=o>>>0,!u){let B=Math.pow(2,8*o)-1;N(this,t,e,o,B,0)}let l=1,p=0;for(this[e]=t&255;++p<o&&(l*=256);)this[e+p]=t/l&255;return e+o},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,o,u){if(t=+t,e=e>>>0,o=o>>>0,!u){let B=Math.pow(2,8*o)-1;N(this,t,e,o,B,0)}let l=o-1,p=1;for(this[e+l]=t&255;--l>=0&&(p*=256);)this[e+l]=t/p&255;return e+o},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,1,255,0),this[e]=t&255,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,2,65535,0),this[e]=t&255,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=t&255,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t&255,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4};function ct(r,t,e,o,u){Kt(t,o,u,r,e,7);let l=Number(t&BigInt(4294967295));r[e++]=l,l=l>>8,r[e++]=l,l=l>>8,r[e++]=l,l=l>>8,r[e++]=l;let p=Number(t>>BigInt(32)&BigInt(4294967295));return r[e++]=p,p=p>>8,r[e++]=p,p=p>>8,r[e++]=p,p=p>>8,r[e++]=p,e}function at(r,t,e,o,u){Kt(t,o,u,r,e,7);let l=Number(t&BigInt(4294967295));r[e+7]=l,l=l>>8,r[e+6]=l,l=l>>8,r[e+5]=l,l=l>>8,r[e+4]=l;let p=Number(t>>BigInt(32)&BigInt(4294967295));return r[e+3]=p,p=p>>8,r[e+2]=p,p=p>>8,r[e+1]=p,p=p>>8,r[e]=p,e+8}c.prototype.writeBigUInt64LE=bt(function(t,e=0){return ct(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=bt(function(t,e=0){return at(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(t,e,o,u){if(t=+t,e=e>>>0,!u){let F=Math.pow(2,8*o-1);N(this,t,e,o,F-1,-F)}let l=0,p=1,B=0;for(this[e]=t&255;++l<o&&(p*=256);)t<0&&B===0&&this[e+l-1]!==0&&(B=1),this[e+l]=(t/p>>0)-B&255;return e+o},c.prototype.writeIntBE=function(t,e,o,u){if(t=+t,e=e>>>0,!u){let F=Math.pow(2,8*o-1);N(this,t,e,o,F-1,-F)}let l=o-1,p=1,B=0;for(this[e+l]=t&255;--l>=0&&(p*=256);)t<0&&B===0&&this[e+l+1]!==0&&(B=1),this[e+l]=(t/p>>0)-B&255;return e+o},c.prototype.writeInt8=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=t&255,e+1},c.prototype.writeInt16LE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,2,32767,-32768),this[e]=t&255,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=t&255,e+2},c.prototype.writeInt32LE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,4,2147483647,-2147483648),this[e]=t&255,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,o){return t=+t,e=e>>>0,o||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t&255,e+4},c.prototype.writeBigInt64LE=bt(function(t,e=0){return ct(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=bt(function(t,e=0){return at(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function lt(r,t,e,o,u,l){if(e+o>r.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function ft(r,t,e,o,u){return t=+t,e=e>>>0,u||lt(r,t,e,4),i.write(r,t,e,o,23,4),e+4}c.prototype.writeFloatLE=function(t,e,o){return ft(this,t,e,!0,o)},c.prototype.writeFloatBE=function(t,e,o){return ft(this,t,e,!1,o)};function pt(r,t,e,o,u){return t=+t,e=e>>>0,u||lt(r,t,e,8),i.write(r,t,e,o,52,8),e+8}c.prototype.writeDoubleLE=function(t,e,o){return pt(this,t,e,!0,o)},c.prototype.writeDoubleBE=function(t,e,o){return pt(this,t,e,!1,o)},c.prototype.copy=function(t,e,o,u){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(o||(o=0),!u&&u!==0&&(u=this.length),e>=t.length&&(e=t.length),e||(e=0),u>0&&u<o&&(u=o),u===o||t.length===0||this.length===0)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(o<0||o>=this.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("sourceEnd out of bounds");u>this.length&&(u=this.length),t.length-e<u-o&&(u=t.length-e+o);let l=u-o;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(e,o,u):Uint8Array.prototype.set.call(t,this.subarray(o,u),e),l},c.prototype.fill=function(t,e,o,u){if(typeof t=="string"){if(typeof e=="string"?(u=e,e=0,o=this.length):typeof o=="string"&&(u=o,o=this.length),u!==void 0&&typeof u!="string")throw new TypeError("encoding must be a string");if(typeof u=="string"&&!c.isEncoding(u))throw new TypeError("Unknown encoding: "+u);if(t.length===1){let p=t.charCodeAt(0);(u==="utf8"&&p<128||u==="latin1")&&(t=p)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(e<0||this.length<e||this.length<o)throw new RangeError("Out of range index");if(o<=e)return this;e=e>>>0,o=o===void 0?this.length:o>>>0,t||(t=0);let l;if(typeof t=="number")for(l=e;l<o;++l)this[l]=t;else{let p=c.isBuffer(t)?t:c.from(t,u),B=p.length;if(B===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(l=0;l<o-e;++l)this[l+e]=p[l%B]}return this};let st={};function Nt(r,t,e){st[r]=class extends e{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(u){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:u,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}Nt("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Nt("ERR_INVALID_ARG_TYPE",function(r,t){return`The "${r}" argument must be of type number. Received type ${typeof t}`},TypeError),Nt("ERR_OUT_OF_RANGE",function(r,t,e){let o=`The value of "${r}" is out of range.`,u=e;return Number.isInteger(e)&&Math.abs(e)>2**32?u=qt(String(e)):typeof e=="bigint"&&(u=String(e),(e>BigInt(2)**BigInt(32)||e<-(BigInt(2)**BigInt(32)))&&(u=qt(u)),u+="n"),o+=` It must be ${t}. Received ${u}`,o},RangeError);function qt(r){let t="",e=r.length,o=r[0]==="-"?1:0;for(;e>=o+4;e-=3)t=`_${r.slice(e-3,e)}${t}`;return`${r.slice(0,e)}${t}`}function oe(r,t,e){wt(t,"offset"),(r[t]===void 0||r[t+e]===void 0)&&xt(t,r.length-(e+1))}function Kt(r,t,e,o,u,l){if(r>e||r<t){let p=typeof t=="bigint"?"n":"",B;throw t===0||t===BigInt(0)?B=`>= 0${p} and < 2${p} ** ${(l+1)*8}${p}`:B=`>= -(2${p} ** ${(l+1)*8-1}${p}) and < 2 ** ${(l+1)*8-1}${p}`,new st.ERR_OUT_OF_RANGE("value",B,r)}oe(o,u,l)}function wt(r,t){if(typeof r!="number")throw new st.ERR_INVALID_ARG_TYPE(t,"number",r)}function xt(r,t,e){throw Math.floor(r)!==r?(wt(r,e),new st.ERR_OUT_OF_RANGE("offset","an integer",r)):t<0?new st.ERR_BUFFER_OUT_OF_BOUNDS:new st.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,r)}let Tr=/[^+/0-9A-Za-z-_]/g;function Cr(r){if(r=r.split("=")[0],r=r.trim().replace(Tr,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function ce(r,t){t=t||1/0;let e,o=r.length,u=null,l=[];for(let p=0;p<o;++p){if(e=r.charCodeAt(p),e>55295&&e<57344){if(!u){if(e>56319){(t-=3)>-1&&l.push(239,191,189);continue}else if(p+1===o){(t-=3)>-1&&l.push(239,191,189);continue}u=e;continue}if(e<56320){(t-=3)>-1&&l.push(239,191,189),u=e;continue}e=(u-55296<<10|e-56320)+65536}else u&&(t-=3)>-1&&l.push(239,191,189);if(u=null,e<128){if((t-=1)<0)break;l.push(e)}else if(e<2048){if((t-=2)<0)break;l.push(e>>6|192,e&63|128)}else if(e<65536){if((t-=3)<0)break;l.push(e>>12|224,e>>6&63|128,e&63|128)}else if(e<1114112){if((t-=4)<0)break;l.push(e>>18|240,e>>12&63|128,e>>6&63|128,e&63|128)}else throw new Error("Invalid code point")}return l}function Br(r){let t=[];for(let e=0;e<r.length;++e)t.push(r.charCodeAt(e)&255);return t}function kr(r,t){let e,o,u,l=[];for(let p=0;p<r.length&&!((t-=2)<0);++p)e=r.charCodeAt(p),o=e>>8,u=e%256,l.push(u),l.push(o);return l}function Te(r){return n.toByteArray(Cr(r))}function zt(r,t,e,o){let u;for(u=0;u<o&&!(u+e>=t.length||u>=r.length);++u)t[u+e]=r[u];return u}function gt(r,t){return r instanceof t||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===t.name}function se(r){return r!==r}let Ur=function(){let r="0123456789abcdef",t=new Array(256);for(let e=0;e<16;++e){let o=e*16;for(let u=0;u<16;++u)t[o+u]=r[e]+r[u]}return t}();function bt(r){return typeof BigInt>"u"?Ir:r}function Ir(){throw new Error("BigInt not supported")}return Tt}var Ot,jn,Qt,Vn,Tt,Yn,Kn=At(()=>{H();$();W();Ot={},jn=!1;Qt={},Vn=!1;Tt={},Yn=!1});var Ct,dt,Si,vi,zn=At(()=>{H();$();W();Kn();Ct=qn();Ct.Buffer;Ct.SlowBuffer;Ct.INSPECT_MAX_BYTES;Ct.kMaxLength;dt=Ct.Buffer,Si=Ct.INSPECT_MAX_BYTES,vi=Ct.kMaxLength});var $=At(()=>{zn()});var wr={};Ce(wr,{JsLightEngine:()=>Yt,computeWireframeEdges:()=>Jr,computeWireframeEdgesU16:()=>Zr,default:()=>yi,generateGeometryFromDump118:()=>Qr,generateGeometryFromMapChunkV18Plus:()=>ti,generateGeometryFromMapChunkV18PlusMulti:()=>ei,generateGeometryFromParsedV16V17:()=>ni,generateGeometryFromParsedV16V17Multi:()=>ri,generate_geometry:()=>ii,generate_geometry_multi:()=>oi,initSync:()=>di,parseChunkDump118:()=>ci,parseChunkDump118FullColumn:()=>si,parseChunkDump118FullColumnAll:()=>ui,parseChunkDump118NoMarshal:()=>ai,parseChunkSectionsV16V17:()=>li,parseMapChunkV18Plus:()=>fi,parseUpdateLightV17:()=>pi,unpackLightSection118:()=>gi});function Yr(n){let i=f.__externref_table_alloc();return f.__wbindgen_externrefs.set(i,n),i}function Ee(n){let i=typeof n;if(i=="number"||i=="boolean"||n==null)return`${n}`;if(i=="string")return`"${n}"`;if(i=="symbol"){let g=n.description;return g==null?"Symbol":`Symbol(${g})`}if(i=="function"){let g=n.name;return typeof g=="string"&&g.length>0?`Function(${g})`:"Function"}if(Array.isArray(n)){let g=n.length,_="[";g>0&&(_+=Ee(n[0]));for(let c=1;c<g;c++)_+=", "+Ee(n[c]);return _+="]",_}let s=/\[object ([^\]]+)\]/.exec(toString.call(n)),a;if(s&&s.length>1)a=s[1];else return toString.call(n);if(a=="Object")try{return"Object("+JSON.stringify(n)+")"}catch{return"Object"}return n instanceof Error?`${n.name}: ${n.message}
|
|
3
|
+
${n.stack}`:a}function lr(n,i){return n=n>>>0,fr().subarray(n/4,n/4+i)}function or(n,i){return n=n>>>0,Kr().subarray(n/4,n/4+i)}function cr(n,i){return n=n>>>0,pr().subarray(n/2,n/2+i)}function qr(n,i){return n=n>>>0,gr().subarray(n/4,n/4+i)}function Ae(n,i){return n=n>>>0,Rt().subarray(n/1,n/1+i)}function Pt(){return(kt===null||kt.buffer.detached===!0||kt.buffer.detached===void 0&&kt.buffer!==f.memory.buffer)&&(kt=new DataView(f.memory.buffer)),kt}function fr(){return(Gt===null||Gt.byteLength===0)&&(Gt=new Float32Array(f.memory.buffer)),Gt}function Kr(){return(Ht===null||Ht.byteLength===0)&&(Ht=new Int32Array(f.memory.buffer)),Ht}function be(n,i){return n=n>>>0,Xr(n,i)}function pr(){return(Wt===null||Wt.byteLength===0)&&(Wt=new Uint16Array(f.memory.buffer)),Wt}function gr(){return($t===null||$t.byteLength===0)&&($t=new Uint32Array(f.memory.buffer)),$t}function Rt(){return(jt===null||jt.byteLength===0)&&(jt=new Uint8Array(f.memory.buffer)),jt}function sr(n,i){try{return n.apply(this,i)}catch(s){let a=Yr(s);f.__wbindgen_exn_store(a)}}function ee(n){return n==null}function T(n,i){let s=i(n.length*2,2)>>>0;return pr().set(n,s/2),h=n.length,s}function G(n,i){let s=i(n.length*4,4)>>>0;return gr().set(n,s/4),h=n.length,s}function R(n,i){let s=i(n.length*1,1)>>>0;return Rt().set(n,s/1),h=n.length,s}function hr(n,i){let s=i(n.length*4,4)>>>0;return fr().set(n,s/4),h=n.length,s}function ur(n,i,s){if(s===void 0){let w=Vt.encode(n),A=i(w.length,1)>>>0;return Rt().subarray(A,A+w.length).set(w),h=w.length,A}let a=n.length,g=i(a,1)>>>0,_=Rt(),c=0;for(;c<a;c++){let w=n.charCodeAt(c);if(w>127)break;_[g+c]=w}if(c!==a){c!==0&&(n=n.slice(c)),g=s(g,a,a=c+n.length*3,1)>>>0;let w=Rt().subarray(g+c,g+a),A=Vt.encodeInto(n,w);c+=A.written,g=s(g,a,c,1)>>>0}return h=c,g}function Xr(n,i){return me+=i,me>=zr&&(ne=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),ne.decode(),me=i),ne.decode(Rt().subarray(n,n+i))}function Jr(n,i){let s=hr(n,f.__wbindgen_malloc),a=h,g=G(i,f.__wbindgen_malloc),_=h,c=f.computeWireframeEdges(s,a,g,_);var w=lr(c[0],c[1]).slice();return f.__wbindgen_free(c[0],c[1]*4,4),w}function Zr(n,i){let s=hr(n,f.__wbindgen_malloc),a=h,g=T(i,f.__wbindgen_malloc),_=h,c=f.computeWireframeEdgesU16(s,a,g,_);var w=lr(c[0],c[1]).slice();return f.__wbindgen_free(c[0],c[1]*4,4),w}function Qr(n,i,s,a,g,_,c,w,A,U,E,C,I,d,y,b,L,k,m,S,M,x,j,V,Y){let X=R(w,f.__wbindgen_malloc),J=h,Z=R(A,f.__wbindgen_malloc),Q=h,q=R(U,f.__wbindgen_malloc),K=h,tt=G(E,f.__wbindgen_malloc),nt=h,rt=G(C,f.__wbindgen_malloc),it=h,ot=G(I,f.__wbindgen_malloc),v=h,N=G(d,f.__wbindgen_malloc),ct=h,at=T(k,f.__wbindgen_malloc),lt=h,ft=T(m,f.__wbindgen_malloc),pt=h,st=T(S,f.__wbindgen_malloc),Nt=h,qt=T(M,f.__wbindgen_malloc),oe=h,Kt=T(x,f.__wbindgen_malloc),wt=h;return f.generateGeometryFromDump118(n,i,s,a,g,_,c,X,J,Z,Q,q,K,tt,nt,rt,it,ot,v,N,ct,y,b,L,at,lt,ft,pt,st,Nt,qt,oe,Kt,wt,j,V,Y)}function ti(n,i,s,a,g,_,c,w,A,U,E,C,I,d,y,b,L,k,m,S){let M=R(n,f.__wbindgen_malloc),x=h,j=T(I,f.__wbindgen_malloc),V=h,Y=T(d,f.__wbindgen_malloc),X=h,J=T(y,f.__wbindgen_malloc),Z=h,Q=T(b,f.__wbindgen_malloc),q=h,K=T(L,f.__wbindgen_malloc),tt=h;return f.generateGeometryFromMapChunkV18Plus(M,x,i,s,a,g,_,c,w,A,U,E,C,j,V,Y,X,J,Z,Q,q,K,tt,k,m,S)}function ei(n,i,s,a,g,_,c,w,A,U,E,C,I,d,y,b,L,k,m,S,M,x){let j=G(i,f.__wbindgen_malloc),V=h,Y=G(_,f.__wbindgen_malloc),X=h,J=G(c,f.__wbindgen_malloc),Z=h,Q=T(y,f.__wbindgen_malloc),q=h,K=T(b,f.__wbindgen_malloc),tt=h,nt=T(L,f.__wbindgen_malloc),rt=h,it=T(k,f.__wbindgen_malloc),ot=h,v=T(m,f.__wbindgen_malloc),N=h;return f.generateGeometryFromMapChunkV18PlusMulti(n,j,V,s,a,g,Y,X,J,Z,w,A,U,E,C,I,d,Q,q,K,tt,nt,rt,it,ot,v,N,S,M,x)}function ni(n,i,s,a,g,_,c,w,A,U,E,C,I,d,y,b,L,k,m,S,M,x,j){let V=R(n,f.__wbindgen_malloc),Y=h,X=G(i,f.__wbindgen_malloc),J=h,Z=G(g,f.__wbindgen_malloc),Q=h,q=R(c,f.__wbindgen_malloc),K=h,tt=R(w,f.__wbindgen_malloc),nt=h,rt=T(b,f.__wbindgen_malloc),it=h,ot=T(L,f.__wbindgen_malloc),v=h,N=T(k,f.__wbindgen_malloc),ct=h,at=T(m,f.__wbindgen_malloc),lt=h,ft=T(S,f.__wbindgen_malloc),pt=h;return f.generateGeometryFromParsedV16V17(V,Y,X,J,s,a,Z,Q,_,q,K,tt,nt,A,U,E,C,I,d,y,rt,it,ot,v,N,ct,at,lt,ft,pt,M,x,j)}function ri(n,i,s,a,g,_,c,w,A,U,E,C,I,d,y,b,L,k,m,S,M,x,j,V,Y){let X=G(i,f.__wbindgen_malloc),J=h,Z=G(s,f.__wbindgen_malloc),Q=h,q=G(A,f.__wbindgen_malloc),K=h,tt=G(U,f.__wbindgen_malloc),nt=h,rt=T(k,f.__wbindgen_malloc),it=h,ot=T(m,f.__wbindgen_malloc),v=h,N=T(S,f.__wbindgen_malloc),ct=h,at=T(M,f.__wbindgen_malloc),lt=h,ft=T(x,f.__wbindgen_malloc),pt=h;return f.generateGeometryFromParsedV16V17Multi(n,X,J,Z,Q,a,g,_,c,w,q,K,tt,nt,E,C,I,d,y,b,L,rt,it,ot,v,N,ct,at,lt,ft,pt,j,V,Y)}function ii(n,i,s,a,g,_,c,w,A,U,E,C,I,d,y,b,L,k,m){let S=T(w,f.__wbindgen_malloc),M=h,x=R(A,f.__wbindgen_malloc),j=h,V=R(U,f.__wbindgen_malloc),Y=h,X=R(E,f.__wbindgen_malloc),J=h,Z=T(C,f.__wbindgen_malloc),Q=h,q=T(I,f.__wbindgen_malloc),K=h,tt=T(d,f.__wbindgen_malloc),nt=h,rt=T(y,f.__wbindgen_malloc),it=h,ot=T(b,f.__wbindgen_malloc),v=h;return f.generate_geometry(n,i,s,a,g,_,c,S,M,x,j,V,Y,X,J,Z,Q,q,K,tt,nt,rt,it,ot,v,L,k,m)}function oi(n,i,s,a,g,_,c,w,A,U,E,C,I,d,y,b,L,k,m,S,M){let x=G(w,f.__wbindgen_malloc),j=h,V=G(A,f.__wbindgen_malloc),Y=h,X=T(U,f.__wbindgen_malloc),J=h,Z=R(E,f.__wbindgen_malloc),Q=h,q=R(C,f.__wbindgen_malloc),K=h,tt=R(I,f.__wbindgen_malloc),nt=h,rt=T(d,f.__wbindgen_malloc),it=h,ot=T(y,f.__wbindgen_malloc),v=h,N=T(b,f.__wbindgen_malloc),ct=h,at=T(L,f.__wbindgen_malloc),lt=h,ft=T(k,f.__wbindgen_malloc),pt=h;return f.generate_geometry_multi(n,i,s,a,g,_,c,x,j,V,Y,X,J,Z,Q,q,K,tt,nt,rt,it,ot,v,N,ct,at,lt,ft,pt,m,S,M)}function ci(n,i,s,a){let g=R(n,f.__wbindgen_malloc),_=h;return f.parseChunkDump118(g,_,i,s,a)}function si(n,i,s,a){let g=R(n,f.__wbindgen_malloc),_=h;return f.parseChunkDump118FullColumn(g,_,i,s,a)}function ui(n,i,s,a,g,_,c,w,A,U){let E=R(n,f.__wbindgen_malloc),C=h,I=R(i,f.__wbindgen_malloc),d=h,y=R(s,f.__wbindgen_malloc),b=h,L=G(a,f.__wbindgen_malloc),k=h,m=G(g,f.__wbindgen_malloc),S=h,M=G(_,f.__wbindgen_malloc),x=h,j=G(c,f.__wbindgen_malloc),V=h;return f.parseChunkDump118FullColumnAll(E,C,I,d,y,b,L,k,m,S,M,x,j,V,w,A,U)}function ai(n,i,s,a){let g=R(n,f.__wbindgen_malloc),_=h;return f.parseChunkDump118NoMarshal(g,_,i,s,a)}function li(n,i,s,a,g,_){let c=R(n,f.__wbindgen_malloc),w=h,A=G(i,f.__wbindgen_malloc),U=h,E=G(g,f.__wbindgen_malloc),C=h;return f.parseChunkSectionsV16V17(c,w,A,U,s,a,E,C,_)}function fi(n,i,s,a,g){let _=R(n,f.__wbindgen_malloc),c=h;return f.parseMapChunkV18Plus(_,c,i,s,a,g)}function pi(n,i){let s=R(n,f.__wbindgen_malloc),a=h;return f.parseUpdateLightV17(s,a,i)}function gi(n){let i=R(n,f.__wbindgen_malloc),s=h,a=f.unpackLightSection118(i,s);var g=Ae(a[0],a[1]).slice();return f.__wbindgen_free(a[0],a[1]*1,1),g}async function _i(n,i){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,i)}catch(a){if(n.ok&&hi.has(n.type)&&n.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",a);else throw a}let s=await n.arrayBuffer();return await WebAssembly.instantiate(s,i)}else{let s=await WebAssembly.instantiate(n,i);return s instanceof WebAssembly.Instance?{instance:s,module:n}:s}}function _r(){let n={};return n.wbg={},n.wbg.__wbg_Error_52673b7de5a0ca89=function(i,s){return Error(be(i,s))},n.wbg.__wbg___wbindgen_boolean_get_dea25b33882b895b=function(i){let s=i,a=typeof s=="boolean"?s:void 0;return ee(a)?16777215:a?1:0},n.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6=function(i,s){let a=Ee(s),g=ur(a,f.__wbindgen_malloc,f.__wbindgen_realloc),_=h;Pt().setInt32(i+4*1,_,!0),Pt().setInt32(i+4*0,g,!0)},n.wbg.__wbg___wbindgen_is_null_dfda7d66506c95b5=function(i){return i===null},n.wbg.__wbg___wbindgen_is_undefined_f6b95eab589e0269=function(i){return i===void 0},n.wbg.__wbg___wbindgen_number_get_9619185a74197f95=function(i,s){let a=s,g=typeof a=="number"?a:void 0;Pt().setFloat64(i+8*1,ee(g)?0:g,!0),Pt().setInt32(i+4*0,!ee(g),!0)},n.wbg.__wbg___wbindgen_string_get_a2a31e16edf96e42=function(i,s){let a=s,g=typeof a=="string"?a:void 0;var _=ee(g)?0:ur(g,f.__wbindgen_malloc,f.__wbindgen_realloc),c=h;Pt().setInt32(i+4*1,c,!0),Pt().setInt32(i+4*0,_,!0)},n.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e=function(i,s){throw new Error(be(i,s))},n.wbg.__wbg_get_6b7bd52aca3f9671=function(i,s){return i[s>>>0]},n.wbg.__wbg_get_af9dab7e9603ea93=function(){return sr(function(i,s){return Reflect.get(i,s)},arguments)},n.wbg.__wbg_instanceof_Int32Array_b6281022039fba32=function(i){let s;try{s=i instanceof Int32Array}catch{s=!1}return s},n.wbg.__wbg_instanceof_Uint8Array_da54ccc9d3e09434=function(i){let s;try{s=i instanceof Uint8Array}catch{s=!1}return s},n.wbg.__wbg_length_22ac23eaec9d8053=function(i){return i.length},n.wbg.__wbg_length_497fc8f401ac8b1c=function(i){return i.length},n.wbg.__wbg_length_89c3414ed7f0594d=function(i){return i.length},n.wbg.__wbg_length_ab53989976907f11=function(i){return i.length},n.wbg.__wbg_new_1ba21ce319a06297=function(){return new Object},n.wbg.__wbg_new_25f239778d6112b9=function(){return new Array},n.wbg.__wbg_new_6421f6084cc5bc5a=function(i){return new Uint8Array(i)},n.wbg.__wbg_new_9f7fd5c3a6ba7298=function(i){return new Uint16Array(i)},n.wbg.__wbg_new_from_slice_e6bd3cfb5a35313d=function(i,s){return new Int32Array(or(i,s))},n.wbg.__wbg_new_with_length_1e8603a5c71d4e06=function(i){return new Int32Array(i>>>0)},n.wbg.__wbg_new_with_length_202b3db94ba5fc86=function(i){return new Uint32Array(i>>>0)},n.wbg.__wbg_new_with_length_aa5eaf41d35235e5=function(i){return new Uint8Array(i>>>0)},n.wbg.__wbg_new_with_length_d7142aa2b68069a8=function(i){return new Uint16Array(i>>>0)},n.wbg.__wbg_now_69d776cd24f5215b=function(){return Date.now()},n.wbg.__wbg_prototypesetcall_b0bea5f39077cfd3=function(i,s,a){Uint16Array.prototype.set.call(cr(i,s),a)},n.wbg.__wbg_prototypesetcall_dd07c344a74d4bfd=function(i,s,a){Int32Array.prototype.set.call(or(i,s),a)},n.wbg.__wbg_prototypesetcall_dfe9b766cdc1f1fd=function(i,s,a){Uint8Array.prototype.set.call(Ae(i,s),a)},n.wbg.__wbg_push_7d9be8f38fc13975=function(i,s){return i.push(s)},n.wbg.__wbg_set_169e13b608078b7b=function(i,s,a){i.set(Ae(s,a))},n.wbg.__wbg_set_3f1d0b984ed272ed=function(i,s,a){i[s]=a},n.wbg.__wbg_set_781438a03c0c3c81=function(){return sr(function(i,s,a){return Reflect.set(i,s,a)},arguments)},n.wbg.__wbg_set_7df433eea03a5c14=function(i,s,a){i[s>>>0]=a},n.wbg.__wbg_set_bb0c6a7fe60d81b5=function(i,s,a){i.set(cr(s,a))},n.wbg.__wbg_set_e7cd108182596b7f=function(i,s,a){i.set(qr(s,a))},n.wbg.__wbindgen_cast_2241b6af4c4b2941=function(i,s){return be(i,s)},n.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(i){return BigInt.asUintN(64,i)},n.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(i){return i},n.wbg.__wbindgen_init_externref_table=function(){let i=f.__wbindgen_externrefs,s=i.grow(4);i.set(0,void 0),i.set(s+0,void 0),i.set(s+1,null),i.set(s+2,!0),i.set(s+3,!1)},n}function dr(n,i){return f=n.exports,yr.__wbindgen_wasm_module=i,kt=null,Gt=null,Ht=null,Wt=null,$t=null,jt=null,f.__wbindgen_start(),f}function di(n){if(f!==void 0)return f;typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module:n}=n:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let i=_r();n instanceof WebAssembly.Module||(n=new WebAssembly.Module(n));let s=new WebAssembly.Instance(n,i);return dr(s,n)}async function yr(n){if(f!==void 0)return f;typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof n>"u"&&(n=new URL("wasm_mesher_bg.wasm",wi.url));let i=_r();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));let{instance:s,module:a}=await _i(await n,i);return dr(s,a)}var wi,f,kt,Gt,Ht,Wt,$t,jt,ne,zr,me,Vt,h,ar,Yt,hi,yi,br=At(()=>{"use strict";H();$();W();wi={};kt=null;Gt=null;Ht=null;Wt=null;$t=null;jt=null;ne=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});ne.decode();zr=2146435072,me=0;Vt=new TextEncoder;"encodeInto"in Vt||(Vt.encodeInto=function(n,i){let s=Vt.encode(n);return i.set(s),{read:n.length,written:s.length}});h=0,ar=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>f.__wbg_jslightengine_free(n>>>0,1)),Yt=class{__destroy_into_raw(){let i=this.__wbg_ptr;return this.__wbg_ptr=0,ar.unregister(this),i}free(){let i=this.__destroy_into_raw();f.__wbg_jslightengine_free(i,0)}pushEvent(i){f.jslightengine_pushEvent(this.__wbg_ptr,i)}getSkyLight(i,s,a){return f.jslightengine_getSkyLight(this.__wbg_ptr,i,s,a)}getBlockLight(i,s,a){return f.jslightengine_getBlockLight(this.__wbg_ptr,i,s,a)}setLightTables(i,s){let a=R(i,f.__wbindgen_malloc),g=h,_=R(s,f.__wbindgen_malloc),c=h;f.jslightengine_setLightTables(this.__wbg_ptr,a,g,_,c)}get fallbackRelights(){return f.jslightengine_fallbackRelights(this.__wbg_ptr)>>>0}setOcclusionTable(i){let s=R(i,f.__wbindgen_malloc),a=h;f.jslightengine_setOcclusionTable(this.__wbg_ptr,s,a)}setSkyLightEnabled(i){f.jslightengine_setSkyLightEnabled(this.__wbg_ptr,i)}pollCompletedPublication(){return f.jslightengine_pollCompletedPublication(this.__wbg_ptr)}step(i){return f.jslightengine_step(this.__wbg_ptr,i)!==0}constructor(i,s){let a=f.jslightengine_js_new(i,s);return this.__wbg_ptr=a>>>0,ar.register(this,this.__wbg_ptr,this),this}};Symbol.dispose&&(Yt.prototype[Symbol.dispose]=Yt.prototype.free);hi=new Set(["basic","cors","default"]);yi=yr});H();$();W();H();$();W();H();$();W();function fe(n,i){let s=i>>6,a=i&63,g=s*2;if(g+1>=n.length)return!1;let _=a<32?n[g]:n[g+1],c=a&31;return(_>>>c&1)===1}function Xn(n,i){return{x:n.x,z:n.z,trustEdges:!!n.trustEdges,numSections:i,skyLight:n.skyLight,blockLight:n.blockLight,skyLightMask:n.skyLightMask??new Uint32Array(2),emptySkyLightMask:n.emptySkyLightMask??new Uint32Array(2),blockLightMask:n.blockLightMask??new Uint32Array(2),emptyBlockLightMask:n.emptyBlockLightMask??new Uint32Array(2),skyBelow:n.skyBelow,skyAbove:n.skyAbove,blockBelow:n.blockBelow,blockAbove:n.blockAbove}}H();$();W();function Jn(n){let i=new Uint8Array(2048),s=Math.min(n.length,4096);for(let a=0;a<s;a++){let g=n[a]&15,_=a>>1;i[_]=a&1?i[_]&15|g<<4:i[_]&240|g}return i}function Pr(n,i){let s=n.x,a=n.z,g=Math.floor(i/16),_=[],c=(w,A,U,E,C,I)=>{let d=n.numSections+2;for(let y=0;y<d;y++){let b=fe(A,y),L=fe(U,y);if(!b&&!L)continue;let k=g+y-1;if(L){_.push({type:"serverLight",sx:s,sy:k,sz:a,channel:w,kind:"empty",trusted:n.trustEdges});continue}let m;if(y===0?m=C:y===n.numSections+1?m=I:m=E.subarray((y-1)*4096,y*4096),!m||m.length<4096){_.push({type:"serverLight",sx:s,sy:k,sz:a,channel:w,kind:"empty",trusted:n.trustEdges});continue}_.push({type:"serverLight",sx:s,sy:k,sz:a,channel:w,kind:"data",trusted:n.trustEdges,data:Jn(m)})}};return c("block",n.blockLightMask,n.emptyBlockLightMask,n.blockLight,n.blockBelow,n.blockAbove),c("sky",n.skyLightMask,n.emptySkyLightMask,n.skyLight,n.skyBelow,n.skyAbove),_}function pe(n,i,s){return Pr(Xn(n,i),s)}H();$();W();var Rr="__clientLightTrace";var te=!1,Mt=!1,Nr=0;var Qn=0,Ft=0,Dt=0,tr=!1,Or,Fr,vt=null,Bt=[],yt=null,Dr,ge=new Array(2048);function he(){return te}function _e(){return Mt}function er(n){te=n,n||(Mt=!1,rr(),$r()),Vr(n),ir()}function de(n=!0){Mt=n,Mt||rr(),ir()}function Gr(n){if(!te)return;let i=n.tLocal??performance.now(),s=n.timeOrigin??performance.timeOrigin,a={...n,t:n.t??s+i,tLocal:i,timeOrigin:s,sessionEpoch:n.sessionEpoch??Nr};return jr(a),a}function Hr(){tr=!0}function ye(n,i){let s=Gr(i);if(!(!s||!Mt)){if(vt=n,Bt.push(s),Bt.length>=200){Zn();return}yt==null&&(yt=setTimeout(()=>{yt=null,Zn()},250))}}function Zn(){if(yt!=null&&(clearTimeout(yt),yt=null),!vt||Bt.length===0){Bt=[],vt=null;return}let n=Bt,i=vt;Bt=[],vt=null,i({type:Rr,events:n})}function we(){let n=[];for(let i=0;i<Dt;i++){let s=ge[(Ft+i)%2048];s&&n.push(s)}return n}function nr(){let n={};for(let i of we())n[i.phase]=(n[i.phase]??0)+1;return{count:Dt,dropped:Qn,byPhase:n}}function Wr(){return Hr(),{events:we(),aggregates:nr()}}function rr(){yt!=null&&(clearTimeout(yt),yt=null),Bt=[],vt=null}function $r(){tr=!1,Or=void 0,Fr=void 0}function ir(){Dr?.({enabled:te,armed:Mt})}function jr(n){if(Dt===2048){ge[Ft]=n,Ft=(Ft+1)%2048,Qn++;return}ge[(Ft+Dt)%2048]=n,Dt++}function Vr(n){if(typeof globalThis>"u")return;let i=globalThis;n?(i.getClientLightTrace=we,i.getClientLightTraceAggregates=nr,i.clientLightTraceArm=(s=!0)=>{de(s!==!1)},i.clientLightTraceDump=Wr):(delete i.getClientLightTrace,delete i.getClientLightTraceAggregates,delete i.clientLightTraceArm,delete i.clientLightTraceDump)}var et=null,Ut=null,re=0,ie=[],Le=null,mr=0,It=self,Er=n=>{It.postMessage(n)};function Ar(n){Le=null;let i=et?.step(n)??!1,s=et?.pollCompletedPublication()??null;It.postMessage({type:"stepped",remaining:i,publication:s,stepGeneration:mr,fallbackRelights:et?.fallbackRelights??0}),s&&he()&&_e()&&ye(Er,{phase:"ownerComplete",lightVersion:s.publicationVersion,worldGeneration:s.worldGeneration,queueDepth:i?1:0,fallbackRelights:et?.fallbackRelights??0}),i&&(Le=setTimeout(()=>{Ar(n)},0))}async function Lr(n){if(!(!n||typeof n!="object"))switch(n.type){case"init":{Ut=await Promise.resolve().then(()=>(br(),wr)),await Ut.default("/wasm_mesher_bg.wasm");let i=Ut.JsLightEngine;re=n.worldMinY??0,et=new i(re,n.worldHeight??256),It.postMessage({type:"ready"});let s=ie.splice(0,ie.length);for(let a of s)await Lr(a);break}case"setLightTables":{et?.setLightTables(n.emission,n.opacity),n.occupancy&&et?.setOcclusionTable?.(n.occupancy),It.postMessage({type:"tablesSet"});break}case"setSkyLightEnabled":{et?.setSkyLightEnabled?.(!!n.enabled);break}case"pushEvent":{et?.pushEvent(n.event);let i=n.event,s=i&&"x"in i&&typeof i.x=="number"?`${Math.floor(i.x/16)},${Math.floor(i.z/16)}`:i&&"sx"in i&&typeof i.sx=="number"?`${i.sx},${i.sz}`:void 0;he()&&_e()&&ye(Er,{phase:"ownerAdmit",currentColumn:s,queueDepth:ie.length});break}case"clientLightTraceConfig":{er(!!n.enabled),de(!!n.armed);break}case"setUpdateLightV17":{if(!Ut||!et)break;let i=Ut.parseUpdateLightV17(n.rawPacket,n.numSections);for(let s of pe(i,n.numSections,re))et.pushEvent(s);break}case"setUpdateLightV16":{if(!Ut||!et)break;let i=Ut.parseUpdateLightV17(n.rawPacket,16);for(let s of pe(i,16,re))et.pushEvent(s);break}case"step":{if(typeof n.stepGeneration=="number"&&(mr=n.stepGeneration),Le)break;Ar(n.budgetMs??5);break}case"poll":{let i=et?.pollCompletedPublication()??null;It.postMessage({type:"publication",publication:i});break}default:break}}It.onmessage=async n=>{let i=n.data;if(!(!i||typeof i!="object"))try{if(!et&&i.type!=="init"){ie.push(i);return}await Lr(i)}catch(s){It.postMessage({type:"error",error:s instanceof Error?s.message:String(s)})}};})();
|
|
4
|
+
/*! Bundled license information:
|
|
5
|
+
|
|
6
|
+
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|
|
7
|
+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
8
|
+
*/
|
|
9
|
+
//# sourceMappingURL=lightOwnerWorker.js.map
|